ghaction-upx/dist/index.js

4 lines
604 KiB
JavaScript
Raw Permalink Normal View History

2024-10-27 13:39:31 -06:00
require('./sourcemap-register.js');(()=>{var A={7351:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)if(t!=="default"&&Object.prototype.hasOwnProperty.call(A,t))r(e,A,t);s(e,A);return e};Object.defineProperty(e,"__esModule",{value:true});e.issue=e.issueCommand=void 0;const i=n(t(2037));const o=t(5278);function issueCommand(A,e,t){const r=new Command(A,e,t);process.stdout.write(r.toString()+i.EOL)}e.issueCommand=issueCommand;function issue(A,e=""){issueCommand(A,{},e)}e.issue=issue;const a="::";class Command{constructor(A,e,t){if(!A){A="missing.command"}this.command=A;this.properties=e;this.message=t}toString(){let A=a+this.command;if(this.properties&&Object.keys(this.properties).length>0){A+=" ";let e=true;for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const r=this.properties[t];if(r){if(e){e=false}else{A+=","}A+=`${t}=${escapeProperty(r)}`}}}}A+=`${a}${escapeData(this.message)}`;return A}}function escapeData(A){return(0,o.toCommandValue)(A).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(A){return(0,o.toCommandValue)(A).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)if(t!=="default"&&Object.prototype.hasOwnProperty.call(A,t))r(e,A,t);s(e,A);return e};var i=this&&this.__awaiter||function(A,e,t,r){function adopt(A){return A instanceof t?A:new t((function(e){e(A)}))}return new(t||(t=Promise))((function(t,s){function fulfilled(A){try{step(r.next(A))}catch(A){s(A)}}function rejected(A){try{step(r["throw"](A))}catch(A){s(A)}}function step(A){A.done?t(A.value):adopt(A.value).then(fulfilled,rejected)}step((r=r.apply(A,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:true});e.platform=e.toPlatformPath=e.toWin32Path=e.toPosixPath=e.markdownSummary=e.summary=e.getIDToken=e.getState=e.saveState=e.group=e.endGroup=e.startGroup=e.info=e.notice=e.warning=e.error=e.debug=e.isDebug=e.setFailed=e.setCommandEcho=e.setOutput=e.getBooleanInput=e.getMultilineInput=e.getInput=e.addPath=e.setSecret=e.exportVariable=e.ExitCode=void 0;const o=t(7351);const a=t(717);const c=t(5278);const g=n(t(2037));const l=n(t(1017));const E=t(8041);var h;(function(A){A[A["Success"]=0]="Success";A[A["Failure"]=1]="Failure"})(h||(e.ExitCode=h={}));function exportVariable(A,e){const t=(0,c.toCommandValue)(e);process.env[A]=t;const r=process.env["GITHUB_ENV"]||"";if(r){return(0,a.issueFileCommand)("ENV",(0,a.prepareKeyValueMessage)(A,e))}(0,o.issueCommand)("set-env",{name:A},t)}e.exportVariable=exportVariable;function setSecret(A){(0,o.issueCommand)("add-mask",{},A)}e.setSecret=setSecret;function addPath(A){const e=process.env["GITHUB_PATH"]||"";if(e){(0,a.issueFileCommand)("PATH",A)}else{(0,o.issueCommand)("add-path",{},A)}process.env["PATH"]=`${A}${l.delimiter}${process.env["PATH"]}`}e.addPath=addPath;function getInput(A,e){const t=process.env[`INPUT_${A.replace(/ /g
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=A=>A.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=A=>A.replace(/\r?\n|\r/g,"\r\n");const r=[];const s=new Uint8Array([13,10]);l=0;let n=false;for(const[e,i]of A){if(typeof i==="string"){const A=S.encode(t+`; name="${escape(normalizeLinefeeds(e))}"`+`\r\n\r\n${normalizeLinefeeds(i)}\r\n`);r.push(A);l+=A.byteLength}else{const A=S.encode(`${t}; name="${escape(normalizeLinefeeds(e))}"`+(i.name?`; filename="${escape(i.name)}"`:"")+"\r\n"+`Content-Type: ${i.type||"application/octet-stream"}\r\n\r\n`);r.push(A,i,s);if(typeof i.size==="number"){l+=A.byteLength+i.size+s.byteLength}else{n=true}}}const i=S.encode(`--${e}--`);r.push(i);l+=i.byteLength;if(n){l=null}g=A;c=async function*(){for(const A of r){if(A.stream){yield*A.stream()}else{yield A}}};E="multipart/form-data; boundary="+e}else if(i(A)){g=A;l=A.size;if(A.type){E=A.type}}else if(typeof A[Symbol.asyncIterator]==="function"){if(e){throw new TypeError("keepalive")}if(s.isDisturbed(A)||A.locked){throw new TypeError("Response body object should not be disturbed or locked")}r=A instanceof b?A:n(A)}if(typeof g==="string"||s.isBuffer(g)){l=Buffer.byteLength(g)}if(c!=null){let e;r=new b({async start(){e=c(A)[Symbol.asyncIterator]()},async pull(A){const{value:t,done:s}=await e.next();if(s){queueMicrotask((()=>{A.close()}))}else{if(!p(r)){A.enqueue(new Uint8Array(t))}}return A.desiredSize>0},async cancel(A){await e.return()},type:undefined})}const h={stream:r,source:g,length:l};return[h,E]}function safelyExtractBody(A,e=false){if(!b){b=t(5356).ReadableStream}if(A instanceof b){d(!s.isDisturbed(A),"The body has already been consumed.");d(!A.locked,"The stream is locked.")}return extractBody(A,e)}function cloneBody(A){const[e,t]=A.stream.tee();const r=Q(t,{transfer:[t]});const[,s]=r.tee();A.stream=e;return{stream:s,length:A.length,source:A.source}}async function*consumeBody(A){if(A){if(y(A)){yield A}else{const e=A.stream;if(s.isDisturbed(e)){throw new TypeError("The body has already been consumed.")}if(e.locked){throw new TypeError("The stream is locked.")}e[I]=true;yield*e}}}function throwIfAborted(A){if(A.aborted){throw new u("The operation was aborted.","AbortError")}}function bodyMixinMethods(A){const e={blob(){return specConsumeBody(this,(A=>{let e=bodyMimeType(this);if(e==="failure"){e=""}else if(e){e=D(e)}return new C([A],{type:e})}),A)},arrayBuffer(){return specConsumeBody(this,(A=>new Uint8Array(A).buffer),A)},text(){return specConsumeBody(this,utf8DecodeBytes,A)},json(){return specConsumeBody(this,parseJSONFromBytes,A)},async formData(){h.brandCheck(this,A);throwIfAborted(this[E]);const e=this.headers.get("Content-Type");if(/multipart\/form-data/.test(e)){const A={};for(const[e,t]of this.headers)A[e.toLowerCase()]=t;const e=new l;let t;try{t=new r({headers:A,preservePath:true})}catch(A){throw new u(`${A}`,"AbortError")}t.on("field",((A,t)=>{e.append(A,t)}));t.on("file",((A,t,r,s,n)=>{const i=[];if(s==="base64"||s.toLowerCase()==="base64"){let s="";t.on("data",(A=>{s+=A.toString().replace(/[\r\n]/gm,"");const e=s.length-s.length%4;i.push(Buffer.from(s.slice(0,e),"base64"));s=s.slice(e)}));t.on("end",(()=>{i.push(Buffer.from(s,"base64"));e.append(A,new k(i,r,{type:n}))}))}else{t.on("data",(A=>{i.push(A)}));t.on("end",(()=>{e.append(A,new k(i,r,{type:n}))}))}}));const s=new Promise(((A,e)=>{t.on("finish",A);t.on("error",(A=>e(new TypeError(A))))}));if(this.body!==null)for await(const A of consumeBody(this[E].body))t.write(A);t.end();await s;return e}else if(/application\/x-www-form-urlencoded/.test(e)){let A;try{let e="";const t=new TextDecoder("utf-8",{ignoreBOM:true});for await(const A of consumeBody(this[E].body)){if(!y(A)){throw new TypeError("Expected Uint8Array chunk")}e+=t.decode(A,{stream:true})}e+=t.decode();A=new URLSearchParams(e)}catch(A){throw Object.assign(new TypeError,{cause:A})}const e=new l;for(const[t,r]of A){e.append(t,r)}return e}else{await Promise.resolve();throwIfAborted(this[E]);throw h.errors.exception({he
2024-10-27 14:01:52 -06:00
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */n[s-4]=this.maskKey[0];n[s-3]=this.maskKey[1];n[s-2]=this.maskKey[2];n[s-1]=this.maskKey[3];n[1]=t;if(t===126){n.writeUInt16BE(e,2)}else if(t===127){n[2]=n[3]=0;n.writeUIntBE(e,4,6)}n[1]|=128;for(let A=0;A<e;A++){n[s+A]=this.frameData[A]^this.maskKey[A%4]}return n}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},1688:(A,e,t)=>{"use strict";const{Writable:r}=t(2781);const s=t(7643);const{parserStates:n,opcodes:i,states:o,emptyBuffer:a}=t(9188);const{kReadyState:c,kSentClose:g,kResponse:l,kReceivedClose:E}=t(7578);const{isValidStatusCode:h,failWebsocketConnection:u,websocketMessageReceived:Q}=t(5515);const{WebsocketFrameSend:C}=t(5444);const B={};B.ping=s.channel("undici:websocket:ping");B.pong=s.channel("undici:websocket:pong");class ByteParser extends r{#i=[];#o=0;#a=n.INFO;#c={};#g=[];constructor(A){super();this.ws=A}_write(A,e,t){this.#i.push(A);this.#o+=A.length;this.run(t)}run(A){while(true){if(this.#a===n.INFO){if(this.#o<2){return A()}const e=this.consume(2);this.#c.fin=(e[0]&128)!==0;this.#c.opcode=e[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==i.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==i.BINARY&&this.#c.opcode!==i.TEXT){u(this.ws,"Invalid frame type was fragmented.");return}const t=e[1]&127;if(t<=125){this.#c.payloadLength=t;this.#a=n.READ_DATA}else if(t===126){this.#a=n.PAYLOADLENGTH_16}else if(t===127){this.#a=n.PAYLOADLENGTH_64}if(this.#c.fragmented&&t>125){u(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===i.PING||this.#c.opcode===i.PONG||this.#c.opcode===i.CLOSE)&&t>125){u(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===i.CLOSE){if(t===1){u(this.ws,"Received close frame with a 1-byte body.");return}const A=this.consume(t);this.#c.closeInfo=this.parseCloseBody(false,A);if(!this.ws[g]){const A=Buffer.allocUnsafe(2);A.writeUInt16BE(this.#c.closeInfo.code,0);const e=new C(A);this.ws[l].socket.write(e.createFrame(i.CLOSE),(A=>{if(!A){this.ws[g]=true}}))}this.ws[c]=o.CLOSING;this.ws[E]=true;this.end();return}else if(this.#c.opcode===i.PING){const e=this.consume(t);if(!this.ws[E]){const A=new C(e);this.ws[l].socket.write(A.createFrame(i.PONG));if(B.ping.hasSubscribers){B.ping.publish({payload:e})}}this.#a=n.INFO;if(this.#o>0){continue}else{A();return}}else if(this.#c.opcode===i.PONG){const e=this.consume(t);if(B.pong.hasSubscribers){B.pong.publish({payload:e})}if(this.#o>0){continue}else{A();return}}}else if(this.#a===n.PAYLOADLENGTH_16){if(this.#o<2){return A()}const e=this.consume(2);this.#c.payloadLength=e.readUInt16BE(0);this.#a=n.READ_DATA}else if(this.#a===n.PAYLOADLENGTH_64){if(this.#o<8){return A()}const e=this.consume(8);const t=e.readUInt32BE(0);if(t>2**31-1){u(this.ws,"Received payload length > 2^31 bytes.");return}const r=e.readUInt32BE(4);this.#c.payloadLength=(t<<8)+r;this.#a=n.READ_DATA}else if(this.#a===n.READ_DATA){if(this.#o<this.#c.payloadLength){return A()}else if(this.#o>=this.#c.payloadLength){const A=this.consume(this.#c.payloadLength);this.#g.push(A);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===i.CONTINUATION){const A=Buffer.concat(this.#g);Q(this.ws,this.#c.originalOpcode,A);this.#c={};this.#g.length=0}this.#a=n.INFO}}if(this.#o>0){continue}else{A();break}}}consume(A){if(A>this.#o){return null}else if(A===0){return a}if(this.#i[0].length===A){this.#o-=this.#i[0].length;return this.#i.shift()}const e=Buffer.allocUnsafe(A);let t=0;while(t!==A){const r=this.#i[0];const{length:s}=r;if(s+t===A){e.set(this.#i.shift(),t);break}else if(s+t>A){e.set(r.subarray(0,A-t),t);this.#i[0]=r.subarray(A-t);break}else{e.set(this.#i.shift(),t);t+=r.length}}this.#o-=A;return e}parseCloseBody(A,e){let t;if(e.length>=2){t=e.readUInt16BE(0)}if(A){if(!h(t)){return null}return{code:t}}let r=e.subarray(2);if(r[0]===239&&r[1]===187&&r[2]===191){r=r.subarray(3)}if(t!==undefined&&!h(t)){return null}try{r=new TextDecoder("utf-8",{fatal:true}).decode(r)}catch{return null}return{code:t,reason:r}}get closingIn
//# sourceMappingURL=index.js.map