cargo-semver-checks/dist/index.js

9 lines
1.9 MiB
JavaScript
Raw Normal View History

(()=>{var __webpack_modules__={2544:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))s(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.annotate=t.escapeProperty=t.escapeData=void 0;const o=n(r(2037));function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}function escapeData(e){return toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}t.escapeData=escapeData;function escapeProperty(e){return toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}t.escapeProperty=escapeProperty;const a="::";function render(e,t,r){let s=a+e;if(r&&Object.keys(r).length>0){s+=" ";let e=true;for(const[t,i]of Object.entries(r)){if(i){if(e){e=false}else{s+=","}s+=`${t}=${escapeProperty(i)}`}}}s+=`${a}${escapeData(t)}`;return s}function annotate(e){let t;switch(e.annotation_level){case"notice":case"warning":t="warning";break;case"failure":t="error";break}const r=render(t,e.message,{file:e.path,line:e.start_line,col:e.start_column});process.stdout.write(r+o.EOL)}t.annotate=annotate},6014:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))s(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.CheckReporter=void 0;const o=n(r(3706));class CheckReporter{constructor(e,t){this.client=e;this.checkName=t;this.checkId=undefined}async startCheck(e){const{owner:t,repo:r}=o.context.repo;const s=await this.client.checks.create({owner:t,repo:r,name:this.checkName,head_sha:o.context.sha,status:e?e:"in_progress"});this.checkId=s.data.id;return this.checkId}async finishCheck(e,t){const{owner:r,repo:s}=o.context.repo;await this.client.checks.update({owner:r,repo:s,name:this.checkName,check_run_id:this.checkId,status:"completed",conclusion:e,completed_at:(new Date).toISOString(),output:t});return}async cancelCheck(){const{owner:e,repo:t}=o.context.repo;await this.client.checks.update({owner:e,repo:t,name:this.checkName,check_run_id:this.checkId,status:"completed",conclusion:"cancelled",completed_at:(new Date).toISOString(),output:{title:this.checkName,summary:"Unhandled error",text:"Check was cancelled due to unhandled error. Check the Action logs for details."}});return}}t.CheckReporter=CheckReporter},9438:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))s(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.Cargo=t.resolveVersion=void 0;const o=n(r(7436));const a=n(r(2186));const l
2023-01-09 00:46:08 +01:00
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,r;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;r=t.prototype;if(isObject(r)===false)return false;if(r.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},3973:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var s=function(){try{return r(1017)}catch(e){}}()||{sep:"/"};minimatch.sep=s.sep;var i=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var n=r(3717);var o={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var a="[^/]";var l=a+"*?";var c="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var A="(?:(?!(?:\\/|^)\\.).)*?";var p=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var d=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,s,i){return minimatch(r,e,t)}}function ext(e,t){t=t||{};var r={};Object.keys(e).forEach((function(t){r[t]=e[t]}));Object.keys(t).forEach((function(e){r[e]=t[e]}));return r}minimatch.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}var t=minimatch;var r=function minimatch(r,s,i){return t(r,s,ext(e,i))};r.Minimatch=function Minimatch(r,s){return new t.Minimatch(r,ext(e,s))};r.Minimatch.defaults=function defaults(r){return t.defaults(ext(e,r)).Minimatch};r.filter=function filter(r,s){return t.filter(r,ext(e,s))};r.defaults=function defaults(r){return t.defaults(ext(e,r))};r.makeRe=function makeRe(r,s){return t.makeRe(r,ext(e,s))};r.braceExpand=function braceExpand(r,s){return t.braceExpand(r,ext(e,s))};r.match=function(r,s,i){return t.match(r,s,ext(e,i))};return r};Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){assertValidPattern(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}assertValidPattern(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&s.sep!=="/"){e=e.split(s.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(d)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);this.set=r}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var e=this.pattern;var t=false;var r=this.options;var s=0;if(r.nonegate)return;for(var i=0,n=e.length;i<n&&e.charAt(i)==="!";i++){t=!t;s++}if(s)this.pattern=e.substr(s);this.negate=t}minimatch.braceExpand=function(e,t){return braceExpand(e,t)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(e,t){if(!t){if(this instanceof Minimatch){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;assertValidPattern(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return n(e)}var u=1024*64;var assertValidPattern=function(e){if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>u){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var h={};function parse(e,t){assertValidPattern(e);var r=this.options;if(e==="**"){if(!r.noglobstar)return i;else e="*"}if(e==="")return"";var s="";var n=!!r.nocase;var c=false;var A=[];var d=[];var u;var g=false;var E=-1;var y=-1;var C=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const s=[];const i=new Uint8Array([13,10]);p=0;let n=false;for(const[t,o]of e){if(typeof o==="string"){const e=T.encode(r+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(o)}\r\n`);s.push(e);p+=e.byteLength}else{const e=T.encode(`${r}; name="${escape(normalizeLinefeeds(t))}"`+(o.name?`; filename="${escape(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r\n\r\n`);s.push(e,o,i);if(typeof o.size==="number"){p+=e.byteLength+o.size+i.byteLength}else{n=true}}}const o=T.encode(`--${t}--`);s.push(o);p+=o.byteLength;if(n){p=null}A=e;c=async function*(){for(const e of s){if(e.stream){yield*e.stream()}else{yield e}}};d="multipart/form-data; boundary="+t}else if(o(e)){A=e;p=e.size;if(e.type){d=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(i.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}s=e instanceof R?e:n(e)}if(typeof A==="string"||i.isBuffer(A)){p=Buffer.byteLength(A)}if(c!=null){let t;s=new R({async start(){t=c(e)[Symbol.asyncIterator]()},async pull(e){const{value:r,done:i}=await t.next();if(i){queueMicrotask((()=>{e.close()}))}else{if(!B(s)){e.enqueue(new Uint8Array(r))}}return e.desiredSize>0},async cancel(e){await t.return()},type:undefined})}const u={stream:s,source:A,length:p};return[u,d]}function safelyExtractBody(e,t=false){if(!R){R=r(5356).ReadableStream}if(e instanceof R){I(!i.isDisturbed(e),"The body has already been consumed.");I(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e){const[t,r]=e.stream.tee();const s=g(r,{transfer:[r]});const[,i]=s.tee();e.stream=t;return{stream:i,length:e.length,source:e.source}}async function*consumeBody(e){if(e){if(b(e)){yield e}else{const t=e.stream;if(i.isDisturbed(t)){throw new TypeError("The body has already been consumed.")}if(t.locked){throw new TypeError("The stream is locked.")}t[C]=true;yield*t}}}function throwIfAborted(e){if(e.aborted){throw new h("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return specConsumeBody(this,(e=>{let t=bodyMimeType(this);if(t==="failure"){t=""}else if(t){t=S(t)}return new E([e],{type:t})}),e)},arrayBuffer(){return specConsumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return specConsumeBody(this,utf8DecodeBytes,e)},json(){return specConsumeBody(this,parseJSONFromBytes,e)},async formData(){u.brandCheck(this,e);throwIfAborted(this[d]);const t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){const e={};for(const[t,r]of this.headers)e[t.toLowerCase()]=r;const t=new p;let r;try{r=new s({headers:e,preservePath:true})}catch(e){throw new h(`${e}`,"AbortError")}r.on("field",((e,r)=>{t.append(e,r)}));r.on("file",((e,r,s,i,n)=>{const o=[];if(i==="base64"||i.toLowerCase()==="base64"){let i="";r.on("data",(e=>{i+=e.toString().replace(/[\r\n]/gm,"");const t=i.length-i.length%4;o.push(Buffer.from(i.slice(0,t),"base64"));i=i.slice(t)}));r.on("end",(()=>{o.push(Buffer.from(i,"base64"));t.append(e,new N(o,s,{type:n}))}))}else{r.on("data",(e=>{o.push(e)}));r.on("end",(()=>{t.append(e,new N(o,s,{type:n}))}))}}));const i=new Promise(((e,t)=>{r.on("finish",e);r.on("error",(e=>t(new TypeError(e))))}));if(this.body!==null)for await(const e of consumeBody(this[d].body))r.write(e);r.end();await i;return t}else if(/application\/x-www-form-urlencoded/.test(t)){let e;try{let t="";const r=new TextDecoder("utf-8",{ignoreBOM:true});for await(const e of consumeBody(this[d].body)){if(!b(e)){throw new TypeError("Expected Uint8Array chunk")}t+=r.decode(e,{stream:true})}t+=r.decode();e=new URLSearchParams(t)}catch(e){throw Object.assign(new TypeError,{cause:e})}const t=new p;for(const[r,s]of e){t.append(r,s)}return t}else{await Promise.resolve();throwIfAborted(this[d]);throw u.errors.exception({he
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */n[i-4]=this.maskKey[0];n[i-3]=this.maskKey[1];n[i-2]=this.maskKey[2];n[i-1]=this.maskKey[3];n[1]=r;if(r===126){n.writeUInt16BE(t,2)}else if(r===127){n[2]=n[3]=0;n.writeUIntBE(t,4,6)}n[1]|=128;for(let e=0;e<t;e++){n[i+e]=this.frameData[e]^this.maskKey[e%4]}return n}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},1688:(e,t,r)=>{"use strict";const{Writable:s}=r(2781);const i=r(7643);const{parserStates:n,opcodes:o,states:a,emptyBuffer:l}=r(9188);const{kReadyState:c,kSentClose:A,kResponse:p,kReceivedClose:d}=r(7578);const{isValidStatusCode:u,failWebsocketConnection:h,websocketMessageReceived:g}=r(5515);const{WebsocketFrameSend:E}=r(5444);const y={};y.ping=i.channel("undici:websocket:ping");y.pong=i.channel("undici:websocket:pong");class ByteParser extends s{#o=[];#a=0;#l=n.INFO;#c={};#A=[];constructor(e){super();this.ws=e}_write(e,t,r){this.#o.push(e);this.#a+=e.length;this.run(r)}run(e){while(true){if(this.#l===n.INFO){if(this.#a<2){return e()}const t=this.consume(2);this.#c.fin=(t[0]&128)!==0;this.#c.opcode=t[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==o.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==o.BINARY&&this.#c.opcode!==o.TEXT){h(this.ws,"Invalid frame type was fragmented.");return}const r=t[1]&127;if(r<=125){this.#c.payloadLength=r;this.#l=n.READ_DATA}else if(r===126){this.#l=n.PAYLOADLENGTH_16}else if(r===127){this.#l=n.PAYLOADLENGTH_64}if(this.#c.fragmented&&r>125){h(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===o.PING||this.#c.opcode===o.PONG||this.#c.opcode===o.CLOSE)&&r>125){h(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===o.CLOSE){if(r===1){h(this.ws,"Received close frame with a 1-byte body.");return}const e=this.consume(r);this.#c.closeInfo=this.parseCloseBody(false,e);if(!this.ws[A]){const e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#c.closeInfo.code,0);const t=new E(e);this.ws[p].socket.write(t.createFrame(o.CLOSE),(e=>{if(!e){this.ws[A]=true}}))}this.ws[c]=a.CLOSING;this.ws[d]=true;this.end();return}else if(this.#c.opcode===o.PING){const t=this.consume(r);if(!this.ws[d]){const e=new E(t);this.ws[p].socket.write(e.createFrame(o.PONG));if(y.ping.hasSubscribers){y.ping.publish({payload:t})}}this.#l=n.INFO;if(this.#a>0){continue}else{e();return}}else if(this.#c.opcode===o.PONG){const t=this.consume(r);if(y.pong.hasSubscribers){y.pong.publish({payload:t})}if(this.#a>0){continue}else{e();return}}}else if(this.#l===n.PAYLOADLENGTH_16){if(this.#a<2){return e()}const t=this.consume(2);this.#c.payloadLength=t.readUInt16BE(0);this.#l=n.READ_DATA}else if(this.#l===n.PAYLOADLENGTH_64){if(this.#a<8){return e()}const t=this.consume(8);const r=t.readUInt32BE(0);if(r>2**31-1){h(this.ws,"Received payload length > 2^31 bytes.");return}const s=t.readUInt32BE(4);this.#c.payloadLength=(r<<8)+s;this.#l=n.READ_DATA}else if(this.#l===n.READ_DATA){if(this.#a<this.#c.payloadLength){return e()}else if(this.#a>=this.#c.payloadLength){const e=this.consume(this.#c.payloadLength);this.#A.push(e);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===o.CONTINUATION){const e=Buffer.concat(this.#A);g(this.ws,this.#c.originalOpcode,e);this.#c={};this.#A.length=0}this.#l=n.INFO}}if(this.#a>0){continue}else{e();break}}}consume(e){if(e>this.#a){return null}else if(e===0){return l}if(this.#o[0].length===e){this.#a-=this.#o[0].length;return this.#o.shift()}const t=Buffer.allocUnsafe(e);let r=0;while(r!==e){const s=this.#o[0];const{length:i}=s;if(i+r===e){t.set(this.#o.shift(),r);break}else if(i+r>e){t.set(s.subarray(0,e-r),r);this.#o[0]=s.subarray(e-r);break}else{t.set(this.#o.shift(),r);r+=s.length}}this.#a-=e;return t}parseCloseBody(e,t){let r;if(t.length>=2){r=t.readUInt16BE(0)}if(e){if(!u(r)){return null}return{code:r}}let s=t.subarray(2);if(s[0]===239&&s[1]===187&&s[2]===191){s=s.subarray(3)}if(r!==undefined&&!u(r)){return null}try{s=new TextDecoder("utf-8",{fatal:true}).decode(s)}catch{return null}return{code:r,reason:s}}get closingIn