fix(deps): update dependency @actions/artifact to v5
This commit is contained in:
1 parent
d0a08da728
commit
ab4544f395
3 files changed
+1883
-67
No files matched your search
Vendored
+77
-12
@@ -1,27 +1,92 @@
|
|||||||
import{createRequire as A}from"module";var i={7884:(A,i,g)=>{var E;E={value:true};i.v=void 0;const p=g(6856);function create(){return p.DefaultArtifactClient.create()}i.v=create},6856:function(A,i,g){var E=this&&this.__createBinding||(Object.create?function(A,i,g,E){if(E===undefined)E=g;var p=Object.getOwnPropertyDescriptor(i,g);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable)){p={enumerable:true,get:function(){return i[g]}}}Object.defineProperty(A,E,p)}:function(A,i,g,E){if(E===undefined)E=g;A[E]=i[g]});var p=this&&this.__setModuleDefault||(Object.create?function(A,i){Object.defineProperty(A,"default",{enumerable:true,value:i})}:function(A,i){A["default"]=i});var C=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var i={};if(A!=null)for(var g in A)if(g!=="default"&&Object.prototype.hasOwnProperty.call(A,g))E(i,A,g);p(i,A);return i};var f=this&&this.__awaiter||function(A,i,g,E){function adopt(A){return A instanceof g?A:new g((function(i){i(A)}))}return new(g||(g=Promise))((function(g,p){function fulfilled(A){try{step(E.next(A))}catch(A){p(A)}}function rejected(A){try{step(E["throw"](A))}catch(A){p(A)}}function step(A){A.done?g(A.value):adopt(A.value).then(fulfilled,rejected)}step((E=E.apply(A,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.DefaultArtifactClient=void 0;const Q=C(g(4086));const B=g(5973);const I=g(6036);const y=g(1631);const b=g(1774);const D=g(809);const R=g(1280);const k=g(9562);const S=g(6928);class DefaultArtifactClient{static create(){return new DefaultArtifactClient}uploadArtifact(A,i,g,E){return f(this,void 0,void 0,(function*(){Q.info(`Starting artifact upload\nFor more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging`);(0,b.checkArtifactName)(A);const p=(0,B.getUploadSpecification)(A,g,i);const C={artifactName:A,artifactItems:[],size:0,failedItems:[]};const f=new I.UploadHttpClient;if(p.length===0){Q.warning(`No files found that can be uploaded`)}else{const i=yield f.createArtifactInFileContainer(A,E);if(!i.fileContainerResourceUrl){Q.debug(i.toString());throw new Error("No URL provided by the Artifact Service to upload an artifact to")}Q.debug(`Upload Resource URL: ${i.fileContainerResourceUrl}`);Q.info(`Container for artifact "${A}" successfully created. Starting upload of file(s)`);const g=yield f.uploadArtifactToFileContainer(i.fileContainerResourceUrl,p,E);Q.info(`File upload process has finished. Finalizing the artifact upload`);yield f.patchArtifactSize(g.totalSize,A);if(g.failedItems.length>0){Q.info(`Upload finished. There were ${g.failedItems.length} items that failed to upload`)}else{Q.info(`Artifact has been finalized. All files have been successfully uploaded!`)}Q.info(`\nThe raw size of all the files that were specified for upload is ${g.totalSize} bytes\nThe size of all the files that were uploaded is ${g.uploadSize} bytes. This takes into account any gzip compression used to reduce the upload size, time and storage\n\nNote: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads \r\n`);C.artifactItems=p.map((A=>A.absoluteFilePath));C.size=g.uploadSize;C.failedItems=g.failedItems}return C}))}downloadArtifact(A,i,g){return f(this,void 0,void 0,(function*(){const E=new D.DownloadHttpClient;const p=yield E.listArtifacts();if(p.count===0){throw new Error(`Unable to find any artifacts for the associated workflow`)}const C=p.value.find((i=>i.name===A));if(!C){throw new Error(`Unable to find an artifact with the name: ${A}`)}const f=yield E.getContainerItems(C.name,C.fileContainerResourceUrl);if(!i){i=(0,k.getWorkSpaceDirectory)()}i=(0,S.normalize)(i);i=(0,S.resolve)(i);const B=(0,R.getDownloadSpecification)(A,f.value,i,(g===null||g===void 0?void 0:g.createArtifactFolder)||false);if(B.filesToDownload.length===0){Q.info(`No downloadable files were found for the artifact: ${C.name}`)}else{yield(0,y.createDirectoriesForArtifact)(B.directoryStructure);Q.info("Directory structure has been set up for the artifact");yield(0,y.createEmptyFilesForArtifact)(B.emptyFilesToCreate);yield E.downloadSingleArtifact(B.filesToDownload)}return{artifactName:A,downloadPath:B.rootDownloadLocation}}))}downloadAllArtifacts(A){return f(this,void 0,void 0,(function*(){const i=new D.DownloadHttpClient;const g=[];const E=yield i.listArtifacts();if(E.count===0){Q.info("Unable to find any artifacts for the associated workflow");return g}if(!A){A=(0,k.getWorkSpaceDirectory)()}A=(0,S.normalize)(A);A=(0,S.resolve)(A);let p=0;while(p<E.count){const C=E.value[p];p+=1;Q.info(`starting download of artifact ${C.name} : ${p}/${E.count}`);const f=yield i.getContainerItems(C.name,C.fileContainerResourceUrl);const B=(0,R.getDownloadSpecification)(C.name,f.value,A,true);if(B.filesToDownload.length===0){Q.inLine truncated
|
import{createRequire as i}from"module";var B={76846:function(i,B,I){var _=this&&this.__createBinding||(Object.create?function(i,B,I,_){if(_===undefined)_=I;var P=Object.getOwnPropertyDescriptor(B,I);if(!P||("get"in P?!B.__esModule:P.writable||P.configurable)){P={enumerable:true,get:function(){return B[I]}}}Object.defineProperty(i,_,P)}:function(i,B,I,_){if(_===undefined)_=I;i[_]=B[I]});var P=this&&this.__exportStar||function(i,B){for(var I in i)if(I!=="default"&&!Object.prototype.hasOwnProperty.call(B,I))_(B,i,I)};Object.defineProperty(B,"__esModule",{value:true});const M=I(64487);P(I(13776),B);P(I(45655),B);P(I(64487),B);const U=new M.DefaultArtifactClient;B["default"]=U},35592:(i,B,I)=>{Object.defineProperty(B,"__esModule",{value:true});B.Timestamp=void 0;const _=I(68886);const P=I(68886);const M=I(68886);const U=I(68886);const H=I(68886);const j=I(68886);const V=I(68886);class Timestamp$Type extends V.MessageType{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const i=this.create();const B=Date.now();i.seconds=j.PbLong.from(Math.floor(B/1e3)).toString();i.nanos=B%1e3*1e6;return i}toDate(i){return new Date(j.PbLong.from(i.seconds).toNumber()*1e3+Math.ceil(i.nanos/1e6))}fromDate(i){const B=this.create();const I=i.getTime();B.seconds=j.PbLong.from(Math.floor(I/1e3)).toString();B.nanos=I%1e3*1e6;return B}internalJsonWrite(i,B){let I=j.PbLong.from(i.seconds).toNumber()*1e3;if(I<Date.parse("0001-01-01T00:00:00Z")||I>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(i.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let _="Z";if(i.nanos>0){let B=(i.nanos+1e9).toString().substring(1);if(B.substring(3)==="000000")_="."+B.substring(0,3)+"Z";else if(B.substring(6)==="000")_="."+B.substring(0,6)+"Z";else _="."+B+"Z"}return new Date(I).toISOString().replace(".000Z",_)}internalJsonRead(i,B,I){if(typeof i!=="string")throw new Error("Unable to parse Timestamp from JSON "+(0,H.typeofJsonValue)(i)+".");let _=i.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!_)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let P=Date.parse(_[1]+"-"+_[2]+"-"+_[3]+"T"+_[4]+":"+_[5]+":"+_[6]+(_[8]?_[8]:"Z"));if(Number.isNaN(P))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(P<Date.parse("0001-01-01T00:00:00Z")||P>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(!I)I=this.create();I.seconds=j.PbLong.from(P/1e3).toString();I.nanos=0;if(_[7])I.nanos=parseInt("1"+_[7]+"0".repeat(9-_[7].length))-1e9;return I}create(i){const B={seconds:"0",nanos:0};globalThis.Object.defineProperty(B,U.MESSAGE_TYPE,{enumerable:false,value:this});if(i!==undefined)(0,M.reflectionMergePartial)(this,B,i);return B}internalBinaryRead(i,B,I,_){let M=_!==null&&_!==void 0?_:this.create(),U=i.pos+B;while(i.pos<U){let[B,_]=i.tag();switch(B){case 1:M.seconds=i.int64().toString();break;case 2:M.nanos=i.int32();break;default:let U=I.readUnknownField;if(U==="throw")throw new globalThis.Error(`Unknown field ${B} (wire type ${_}) for ${this.typeName}`);let H=i.skip(_);if(U!==false)(U===true?P.UnknownFieldHandler.onRead:U)(this.typeName,M,B,_,H)}}return M}internalBinaryWrite(i,B,I){if(i.seconds!=="0")B.tag(1,_.WireType.Varint).int64(i.seconds);if(i.nanos!==0)B.tag(2,_.WireType.Varint).int32(i.nanos);let M=I.writeUnknownFields;if(M!==false)(M==true?P.UnknownFieldHandler.onWrite:M)(this.typeName,i,B);return B}}B.Timestamp=new Timestamp$Type},78806:(i,B,I)=>{Object.defineProperty(B,"__esModule",{value:true});B.BytesValue=B.StringValue=B.BoolValue=B.UInt32Value=B.Int32Value=B.UInt64Value=B.Int64Value=B.FloatValue=B.DoubleValue=void 0;const _=I(68886);const P=I(68886);const M=I(68886);const U=I(68886);const H=I(68886);const j=I(68886);const V=I(68886);class DoubleValue$Type extends V.MessageType{constructor(){super("google.protobuf.DoubleValue",[{no:1,name:"value",kind:"scalar",T:1}])}internalJsonWrite(i,B){return this.refJsonWriter.scalar(2,i.value,"value",false,true)}internalJsonRead(i,B,I){if(!I)I=this.create();I.value=this.refJsonReader.scalar(i,1,undefined,"value");return I}create(i){const B={value:0};globalThis.Object.defineProperty(B,j.MESSAGE_TYPE,{enumerable:false,value:this});if(i!==undefined)(0,H.reflectionMergePartial)(this,B,i);return B}internalBinaryRead(i,B,I,_){let P=_!==null&&_!==void 0?_:this.create(),M=i.pos+B;while(i.pos<M){let[B,_]=i.tag();switch(B){case 1:P.value=i.double();break;default:let M=I.readUnknownField;if(M==="throw")throw new globalThis.Error(`Unknown field ${B} (wire type ${_}) for ${this.typeName}`);let H=i.skip(_);if(M!==false)(M===true?U.UnknownFieldHandLine truncated
|
||||||
/*! 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 E=[];const p=new Uint8Array([13,10]);b=0;let C=false;for(const[i,f]of A){if(typeof f==="string"){const A=P.encode(g+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(f)}\r\n`);E.push(A);b+=A.byteLength}else{const A=P.encode(`${g}; name="${escape(normalizeLinefeeds(i))}"`+(f.name?`; filename="${escape(f.name)}"`:"")+"\r\n"+`Content-Type: ${f.type||"application/octet-stream"}\r\n\r\n`);E.push(A,f,p);if(typeof f.size==="number"){b+=A.byteLength+f.size+p.byteLength}else{C=true}}}const f=P.encode(`--${i}--`);E.push(f);b+=f.byteLength;if(C){b=null}y=A;I=async function*(){for(const A of E){if(A.stream){yield*A.stream()}else{yield A}}};D="multipart/form-data; boundary="+i}else if(f(A)){y=A;b=A.size;if(A.type){D=A.type}}else if(typeof A[Symbol.asyncIterator]==="function"){if(i){throw new TypeError("keepalive")}if(p.isDisturbed(A)||A.locked){throw new TypeError("Response body object should not be disturbed or locked")}E=A instanceof _?A:C(A)}if(typeof y==="string"||p.isBuffer(y)){b=Buffer.byteLength(y)}if(I!=null){let i;E=new _({async start(){i=I(A)[Symbol.asyncIterator]()},async pull(A){const{value:g,done:p}=await i.next();if(p){queueMicrotask((()=>{A.close()}))}else{if(!L(E)){A.enqueue(new Uint8Array(g))}}return A.desiredSize>0},async cancel(A){await i.return()},type:undefined})}const R={stream:E,source:y,length:b};return[R,D]}function safelyExtractBody(A,i=false){if(!_){_=g(3774).ReadableStream}if(A instanceof _){U(!p.isDisturbed(A),"The body has already been consumed.");U(!A.locked,"The stream is locked.")}return extractBody(A,i)}function cloneBody(A){const[i,g]=A.stream.tee();const E=S(g,{transfer:[g]});const[,p]=E.tee();A.stream=i;return{stream:p,length:A.length,source:A.source}}async function*consumeBody(A){if(A){if(M(A)){yield A}else{const i=A.stream;if(p.isDisturbed(i)){throw new TypeError("The body has already been consumed.")}if(i.locked){throw new TypeError("The stream is locked.")}i[x]=true;yield*i}}}function throwIfAborted(A){if(A.aborted){throw new k("The operation was aborted.","AbortError")}}function bodyMixinMethods(A){const i={blob(){return specConsumeBody(this,(A=>{let i=bodyMimeType(this);if(i==="failure"){i=""}else if(i){i=Y(i)}return new v([A],{type:i})}),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(){R.brandCheck(this,A);throwIfAborted(this[D]);const i=this.headers.get("Content-Type");if(/multipart\/form-data/.test(i)){const A={};for(const[i,g]of this.headers)A[i.toLowerCase()]=g;const i=new b;let g;try{g=new E({headers:A,preservePath:true})}catch(A){throw new k(`${A}`,"AbortError")}g.on("field",((A,g)=>{i.append(A,g)}));g.on("file",((A,g,E,p,C)=>{const f=[];if(p==="base64"||p.toLowerCase()==="base64"){let p="";g.on("data",(A=>{p+=A.toString().replace(/[\r\n]/gm,"");const i=p.length-p.length%4;f.push(Buffer.from(p.slice(0,i),"base64"));p=p.slice(i)}));g.on("end",(()=>{f.push(Buffer.from(p,"base64"));i.append(A,new V(f,E,{type:C}))}))}else{g.on("data",(A=>{f.push(A)}));g.on("end",(()=>{i.append(A,new V(f,E,{type:C}))}))}}));const p=new Promise(((A,i)=>{g.on("finish",A);g.on("error",(A=>i(new TypeError(A))))}));if(this.body!==null)for await(const A of consumeBody(this[D].body))g.write(A);g.end();await p;return i}else if(/application\/x-www-form-urlencoded/.test(i)){let A;try{let i="";const g=new TextDecoder("utf-8",{ignoreBOM:true});for await(const A of consumeBody(this[D].body)){if(!M(A)){throw new TypeError("Expected Uint8Array chunk")}i+=g.decode(A,{stream:true})}i+=g.decode();A=new URLSearchParams(i)}catch(A){throw Object.assign(new TypeError,{cause:A})}const i=new b;for(const[g,E]of A){i.append(g,E)}return i}else{await Promise.resolve();throwIfAborted(this[D]);throw R.errors.exception({header:`${A.name}.formData`,message:"Could not parse content as FormData."})}}};return i}function mixinBody(A){Object.assign(A.prototype,bodyMixinMethods(A))}async function specConsumeBody(A,i,g){R.brandCheck(A,g);throwIfAborted(A[D]);if(bodyUnusable(A[D].body)){throw new TypeError("Body is unusable")}const E=I();const errorSteps=A=>E.reject(A);const successSteps=A=>{try{E.resolve(i(A))}catch(A){errorSteps(A)}};if(A[D].body==null){successSteps(new Uint8Array);return E.promise}await y(A[D].body,successSteps,errorSteps);return E.promise}function bodyUnusable(A){return A!=null&&(A.stream.locked||p.isDisturbed(A.stream))}function utf8DecodeBytes(A){if(A.length===0){return""}if(A[0]===239&&A[1]===187&&A[2]===191){A=A.subarray(3)}const i=j.decode(A);return i}function parseJSONFromBytes(A){return JSON.parse(utf8DecodeBytes(A))}function bodyMimeType(A){const{headersList:i}=A[D];const g=i.get("content-Line truncated
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=i=>i.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=i=>i.replace(/\r?\n|\r/g,"\r\n");const _=[];const P=new Uint8Array([13,10]);z=0;let M=false;for(const[B,U]of i){if(typeof U==="string"){const i=xe.encode(I+`; name="${escape(normalizeLinefeeds(B))}"`+`\r\n\r\n${normalizeLinefeeds(U)}\r\n`);_.push(i);z+=i.byteLength}else{const i=xe.encode(`${I}; name="${escape(normalizeLinefeeds(B))}"`+(U.name?`; filename="${escape(U.name)}"`:"")+"\r\n"+`Content-Type: ${U.type||"application/octet-stream"}\r\n\r\n`);_.push(i,U,P);if(typeof U.size==="number"){z+=i.byteLength+U.size+P.byteLength}else{M=true}}}const U=xe.encode(`--${B}--`);_.push(U);z+=U.byteLength;if(M){z=null}Y=i;V=async function*(){for(const i of _){if(i.stream){yield*i.stream()}else{yield i}}};X="multipart/form-data; boundary="+B}else if(U(i)){Y=i;z=i.size;if(i.type){X=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(B){throw new TypeError("keepalive")}if(P.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}_=i instanceof ve?i:M(i)}if(typeof Y==="string"||P.isBuffer(Y)){z=Buffer.byteLength(Y)}if(V!=null){let B;_=new ve({async start(){B=V(i)[Symbol.asyncIterator]()},async pull(i){const{value:I,done:P}=await B.next();if(P){queueMicrotask((()=>{i.close()}))}else{if(!pe(_)){i.enqueue(new Uint8Array(I))}}return i.desiredSize>0},async cancel(i){await B.return()},type:undefined})}const re={stream:_,source:Y,length:z};return[re,X]}function safelyExtractBody(i,B=false){if(!ve){ve=I(63774).ReadableStream}if(i instanceof ve){de(!P.isDisturbed(i),"The body has already been consumed.");de(!i.locked,"The stream is locked.")}return extractBody(i,B)}function cloneBody(i){const[B,I]=i.stream.tee();const _=oe(I,{transfer:[I]});const[,P]=_.tee();i.stream=B;return{stream:P,length:i.length,source:i.source}}async function*consumeBody(i){if(i){if(he(i)){yield i}else{const B=i.stream;if(P.isDisturbed(B)){throw new TypeError("The body has already been consumed.")}if(B.locked){throw new TypeError("The stream is locked.")}B[ue]=true;yield*B}}}function throwIfAborted(i){if(i.aborted){throw new se("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const B={blob(){return specConsumeBody(this,(i=>{let B=bodyMimeType(this);if(B==="failure"){B=""}else if(B){B=Ie(B)}return new ae([i],{type:B})}),i)},arrayBuffer(){return specConsumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return specConsumeBody(this,utf8DecodeBytes,i)},json(){return specConsumeBody(this,parseJSONFromBytes,i)},async formData(){re.brandCheck(this,i);throwIfAborted(this[X]);const B=this.headers.get("Content-Type");if(/multipart\/form-data/.test(B)){const i={};for(const[B,I]of this.headers)i[B.toLowerCase()]=I;const B=new z;let I;try{I=new _({headers:i,preservePath:true})}catch(i){throw new se(`${i}`,"AbortError")}I.on("field",((i,I)=>{B.append(i,I)}));I.on("file",((i,I,_,P,M)=>{const U=[];if(P==="base64"||P.toLowerCase()==="base64"){let P="";I.on("data",(i=>{P+=i.toString().replace(/[\r\n]/gm,"");const B=P.length-P.length%4;U.push(Buffer.from(P.slice(0,B),"base64"));P=P.slice(B)}));I.on("end",(()=>{U.push(Buffer.from(P,"base64"));B.append(i,new Re(U,_,{type:M}))}))}else{I.on("data",(i=>{U.push(i)}));I.on("end",(()=>{B.append(i,new Re(U,_,{type:M}))}))}}));const P=new Promise(((i,B)=>{I.on("finish",i);I.on("error",(i=>B(new TypeError(i))))}));if(this.body!==null)for await(const i of consumeBody(this[X].body))I.write(i);I.end();await P;return B}else if(/application\/x-www-form-urlencoded/.test(B)){let i;try{let B="";const I=new TextDecoder("utf-8",{ignoreBOM:true});for await(const i of consumeBody(this[X].body)){if(!he(i)){throw new TypeError("Expected Uint8Array chunk")}B+=I.decode(i,{stream:true})}B+=I.decode();i=new URLSearchParams(B)}catch(i){throw Object.assign(new TypeError,{cause:i})}const B=new z;for(const[I,_]of i){B.append(I,_)}return B}else{await Promise.resolve();throwIfAborted(this[X]);throw re.errors.exception({header:`${i.name}.formData`,message:"Could not parse content as FormData."})}}};return B}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function specConsumeBody(i,B,I){re.brandCheck(i,I);throwIfAborted(i[X]);if(bodyUnusable(i[X].body)){throw new TypeError("Body is unusable")}const _=V();const errorSteps=i=>_.reject(i);const successSteps=i=>{try{_.resolve(B(i))}catch(i){errorSteps(i)}};if(i[X].body==null){successSteps(new Uint8Array);return _.promise}await Y(i[X].body,successSteps,errorSteps);return _.promise}function bodyUnusable(i){return i!=null&&(i.stream.locked||P.isDisturbed(i.stream))}function utf8DecodeBytes(i){if(i.length===0){return""}if(i[0]===239&&i[1]===187&&i[2]===191){i=i.subarray(3)}const B=Ne.decode(i);return B}function parseJSONFromBytes(i){return JSON.parse(utf8DecodeBytes(i))}function bodyMimeType(i){const{headersList:B}=Line truncated
|
||||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */C[p-4]=this.maskKey[0];C[p-3]=this.maskKey[1];C[p-2]=this.maskKey[2];C[p-1]=this.maskKey[3];C[1]=g;if(g===126){C.writeUInt16BE(i,2)}else if(g===127){C[2]=C[3]=0;C.writeUIntBE(i,4,6)}C[1]|=128;for(let A=0;A<i;A++){C[p+A]=this.frameData[A]^this.maskKey[A%4]}return C}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},5553:(A,i,g)=>{const{Writable:E}=g(2203);const p=g(1637);const{parserStates:C,opcodes:f,states:Q,emptyBuffer:B}=g(1859);const{kReadyState:I,kSentClose:y,kResponse:b,kReceivedClose:D}=g(5199);const{isValidStatusCode:R,failWebsocketConnection:k,websocketMessageReceived:S}=g(4604);const{WebsocketFrameSend:v}=g(231);const F={};F.ping=p.channel("undici:websocket:ping");F.pong=p.channel("undici:websocket:pong");class ByteParser extends E{#n=[];#o=0;#a=C.INFO;#c={};#l=[];constructor(A){super();this.ws=A}_write(A,i,g){this.#n.push(A);this.#o+=A.length;this.run(g)}run(A){while(true){if(this.#a===C.INFO){if(this.#o<2){return A()}const i=this.consume(2);this.#c.fin=(i[0]&128)!==0;this.#c.opcode=i[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==f.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==f.BINARY&&this.#c.opcode!==f.TEXT){k(this.ws,"Invalid frame type was fragmented.");return}const g=i[1]&127;if(g<=125){this.#c.payloadLength=g;this.#a=C.READ_DATA}else if(g===126){this.#a=C.PAYLOADLENGTH_16}else if(g===127){this.#a=C.PAYLOADLENGTH_64}if(this.#c.fragmented&&g>125){k(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===f.PING||this.#c.opcode===f.PONG||this.#c.opcode===f.CLOSE)&&g>125){k(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===f.CLOSE){if(g===1){k(this.ws,"Received close frame with a 1-byte body.");return}const A=this.consume(g);this.#c.closeInfo=this.parseCloseBody(false,A);if(!this.ws[y]){const A=Buffer.allocUnsafe(2);A.writeUInt16BE(this.#c.closeInfo.code,0);const i=new v(A);this.ws[b].socket.write(i.createFrame(f.CLOSE),(A=>{if(!A){this.ws[y]=true}}))}this.ws[I]=Q.CLOSING;this.ws[D]=true;this.end();return}else if(this.#c.opcode===f.PING){const i=this.consume(g);if(!this.ws[D]){const A=new v(i);this.ws[b].socket.write(A.createFrame(f.PONG));if(F.ping.hasSubscribers){F.ping.publish({payload:i})}}this.#a=C.INFO;if(this.#o>0){continue}else{A();return}}else if(this.#c.opcode===f.PONG){const i=this.consume(g);if(F.pong.hasSubscribers){F.pong.publish({payload:i})}if(this.#o>0){continue}else{A();return}}}else if(this.#a===C.PAYLOADLENGTH_16){if(this.#o<2){return A()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#a=C.READ_DATA}else if(this.#a===C.PAYLOADLENGTH_64){if(this.#o<8){return A()}const i=this.consume(8);const g=i.readUInt32BE(0);if(g>2**31-1){k(this.ws,"Received payload length > 2^31 bytes.");return}const E=i.readUInt32BE(4);this.#c.payloadLength=(g<<8)+E;this.#a=C.READ_DATA}else if(this.#a===C.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.#l.push(A);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===f.CONTINUATION){const A=Buffer.concat(this.#l);S(this.ws,this.#c.originalOpcode,A);this.#c={};this.#l.length=0}this.#a=C.INFO}}if(this.#o>0){continue}else{A();break}}}consume(A){if(A>this.#o){return null}else if(A===0){return B}if(this.#n[0].length===A){this.#o-=this.#n[0].length;return this.#n.shift()}const i=Buffer.allocUnsafe(A);let g=0;while(g!==A){const E=this.#n[0];const{length:p}=E;if(p+g===A){i.set(this.#n.shift(),g);break}else if(p+g>A){i.set(E.subarray(0,A-g),g);this.#n[0]=E.subarray(A-g);break}else{i.set(this.#n.shift(),g);g+=E.length}}this.#o-=A;return i}parseCloseBody(A,i){let g;if(i.length>=2){g=i.readUInt16BE(0)}if(A){if(!R(g)){return null}return{code:g}}let E=i.subarray(2);if(E[0]===239&&E[1]===187&&E[2]===191){E=E.subarray(3)}if(g!==undefined&&!R(g)){return null}try{E=new TextDecoder("utf-8",{fatal:true}).decode(E)}catch{return null}return{code:g,reason:E}}get closingInfo(){return this.#c.closeInfo}}A.exports={ByteParser:ByteParser}},5199:A=>{A.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},4604:(A,i,g)=>{const{kReadyState:E,kController:p,kResponse:C,kBinaryType:f,kWebSocketURL:Q}=g(5199);const{states:B,opcodes:I}=g(1859);const{MessageEvent:y,ErrorEvent:b}=g(3273);function isEstablished(A){return A[E]===B.OPEN}function isClosing(A){return A[E]===B.CLOSING}function isClosed(A){return A[E]===B.CLOSED}function fireEvent(A,i,g=Event,E){const p=new g(A,E);i.dispatchEvent(p)}function websocketMessageReceived(A,i,g){if(A[E]!==B.OPEN){return}let p;if(i===I.TEXT){try{p=new TextDecoder("utf-8",{fatal:true}).decode(g)}catch{failWebsocketConnection(A,"ReceivLine truncated
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */M[P-4]=this.maskKey[0];M[P-3]=this.maskKey[1];M[P-2]=this.maskKey[2];M[P-1]=this.maskKey[3];M[1]=I;if(I===126){M.writeUInt16BE(B,2)}else if(I===127){M[2]=M[3]=0;M.writeUIntBE(B,4,6)}M[1]|=128;for(let i=0;i<B;i++){M[P+i]=this.frameData[i]^this.maskKey[i%4]}return M}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},83042:(i,B,I)=>{const{Writable:_}=I(2203);const P=I(31637);const{parserStates:M,opcodes:U,states:H,emptyBuffer:j}=I(90362);const{kReadyState:V,kSentClose:Y,kResponse:z,kReceivedClose:X}=I(62218);const{isValidStatusCode:re,failWebsocketConnection:se,websocketMessageReceived:oe}=I(71927);const{WebsocketFrameSend:ae}=I(96098);const Ae={};Ae.ping=P.channel("undici:websocket:ping");Ae.pong=P.channel("undici:websocket:pong");class ByteParser extends _{#o=[];#a=0;#c=M.INFO;#A={};#l=[];constructor(i){super();this.ws=i}_write(i,B,I){this.#o.push(i);this.#a+=i.length;this.run(I)}run(i){while(true){if(this.#c===M.INFO){if(this.#a<2){return i()}const B=this.consume(2);this.#A.fin=(B[0]&128)!==0;this.#A.opcode=B[0]&15;this.#A.originalOpcode??=this.#A.opcode;this.#A.fragmented=!this.#A.fin&&this.#A.opcode!==U.CONTINUATION;if(this.#A.fragmented&&this.#A.opcode!==U.BINARY&&this.#A.opcode!==U.TEXT){se(this.ws,"Invalid frame type was fragmented.");return}const I=B[1]&127;if(I<=125){this.#A.payloadLength=I;this.#c=M.READ_DATA}else if(I===126){this.#c=M.PAYLOADLENGTH_16}else if(I===127){this.#c=M.PAYLOADLENGTH_64}if(this.#A.fragmented&&I>125){se(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#A.opcode===U.PING||this.#A.opcode===U.PONG||this.#A.opcode===U.CLOSE)&&I>125){se(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#A.opcode===U.CLOSE){if(I===1){se(this.ws,"Received close frame with a 1-byte body.");return}const i=this.consume(I);this.#A.closeInfo=this.parseCloseBody(false,i);if(!this.ws[Y]){const i=Buffer.allocUnsafe(2);i.writeUInt16BE(this.#A.closeInfo.code,0);const B=new ae(i);this.ws[z].socket.write(B.createFrame(U.CLOSE),(i=>{if(!i){this.ws[Y]=true}}))}this.ws[V]=H.CLOSING;this.ws[X]=true;this.end();return}else if(this.#A.opcode===U.PING){const B=this.consume(I);if(!this.ws[X]){const i=new ae(B);this.ws[z].socket.write(i.createFrame(U.PONG));if(Ae.ping.hasSubscribers){Ae.ping.publish({payload:B})}}this.#c=M.INFO;if(this.#a>0){continue}else{i();return}}else if(this.#A.opcode===U.PONG){const B=this.consume(I);if(Ae.pong.hasSubscribers){Ae.pong.publish({payload:B})}if(this.#a>0){continue}else{i();return}}}else if(this.#c===M.PAYLOADLENGTH_16){if(this.#a<2){return i()}const B=this.consume(2);this.#A.payloadLength=B.readUInt16BE(0);this.#c=M.READ_DATA}else if(this.#c===M.PAYLOADLENGTH_64){if(this.#a<8){return i()}const B=this.consume(8);const I=B.readUInt32BE(0);if(I>2**31-1){se(this.ws,"Received payload length > 2^31 bytes.");return}const _=B.readUInt32BE(4);this.#A.payloadLength=(I<<8)+_;this.#c=M.READ_DATA}else if(this.#c===M.READ_DATA){if(this.#a<this.#A.payloadLength){return i()}else if(this.#a>=this.#A.payloadLength){const i=this.consume(this.#A.payloadLength);this.#l.push(i);if(!this.#A.fragmented||this.#A.fin&&this.#A.opcode===U.CONTINUATION){const i=Buffer.concat(this.#l);oe(this.ws,this.#A.originalOpcode,i);this.#A={};this.#l.length=0}this.#c=M.INFO}}if(this.#a>0){continue}else{i();break}}}consume(i){if(i>this.#a){return null}else if(i===0){return j}if(this.#o[0].length===i){this.#a-=this.#o[0].length;return this.#o.shift()}const B=Buffer.allocUnsafe(i);let I=0;while(I!==i){const _=this.#o[0];const{length:P}=_;if(P+I===i){B.set(this.#o.shift(),I);break}else if(P+I>i){B.set(_.subarray(0,i-I),I);this.#o[0]=_.subarray(i-I);break}else{B.set(this.#o.shift(),I);I+=_.length}}this.#a-=i;return B}parseCloseBody(i,B){let I;if(B.length>=2){I=B.readUInt16BE(0)}if(i){if(!re(I)){return null}return{code:I}}let _=B.subarray(2);if(_[0]===239&&_[1]===187&&_[2]===191){_=_.subarray(3)}if(I!==undefined&&!re(I)){return null}try{_=new TextDecoder("utf-8",{fatal:true}).decode(_)}catch{return null}return{code:I,reason:_}}get closingInfo(){return this.#A.closeInfo}}i.exports={ByteParser:ByteParser}},62218:i=>{i.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},71927:(i,B,I)=>{const{kReadyState:_,kController:P,kResponse:M,kBinaryType:U,kWebSocketURL:H}=I(62218);const{states:j,opcodes:V}=I(90362);const{MessageEvent:Y,ErrorEvent:z}=I(18686);function isEstablished(i){return i[_]===j.OPEN}function isClosing(i){return i[_]===j.CLOSING}function isClosed(i){return i[_]===j.CLOSED}function fireEvent(i,B,I=Event,_){const P=new I(i,_);B.dispatchEvent(P)}function websocketMessageReceived(i,B,I){if(i[_]!==j.OPEN){return}let P;if(B===V.TEXT){try{P=new TextDecoder("utf-8",{fatal:true}).decode(I)}catch{Line truncated
|
||||||
|
/**
|
||||||
|
* Archiver Vending
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(50549);var P={};var vending=function(i,B){return vending.create(i,B)};vending.create=function(i,B){if(P[i]){var I=new _(i,B);I.setFormat(i);I.setModule(new P[i](B));return I}else{throw new Error("create("+i+"): format not registered")}};vending.registerFormat=function(i,B){if(P[i]){throw new Error("register("+i+"): format already registered")}if(typeof B!=="function"){throw new Error("register("+i+"): format module invalid")}if(typeof B.prototype.append!=="function"||typeof B.prototype.finalize!=="function"){throw new Error("register("+i+"): format module missing methods")}P[i]=B};vending.isRegisteredFormat=function(i){if(P[i]){return true}return false};vending.registerFormat("zip",I(22836));vending.registerFormat("tar",I(10396));vending.registerFormat("json",I(54693));i.exports=vending},50549:(i,B,I)=>{
|
||||||
|
/**
|
||||||
|
* Archiver Core
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(79896);var P=I(51364);var M=I(97329);var U=I(16928);var H=I(53296);var j=I(39023).inherits;var V=I(13110);var Y=I(29963).Transform;var z=process.platform==="win32";var Archiver=function(i,B){if(!(this instanceof Archiver)){return new Archiver(i,B)}if(typeof i!=="string"){B=i;i="zip"}B=this.options=H.defaults(B,{highWaterMark:1024*1024,statConcurrency:4});Y.call(this,B);this._format=false;this._module=false;this._pending=0;this._pointer=0;this._entriesCount=0;this._entriesProcessedCount=0;this._fsEntriesTotalBytes=0;this._fsEntriesProcessedBytes=0;this._queue=M.queue(this._onQueueTask.bind(this),1);this._queue.drain(this._onQueueDrain.bind(this));this._statQueue=M.queue(this._onStatQueueTask.bind(this),B.statConcurrency);this._statQueue.drain(this._onQueueDrain.bind(this));this._state={aborted:false,finalize:false,finalizing:false,finalized:false,modulePiped:false};this._streams=[]};j(Archiver,Y);Archiver.prototype._abort=function(){this._state.aborted=true;this._queue.kill();this._statQueue.kill();if(this._queue.idle()){this._shutdown()}};Archiver.prototype._append=function(i,B){B=B||{};var I={source:null,filepath:i};if(!B.name){B.name=i}B.sourcePath=i;I.data=B;this._entriesCount++;if(B.stats&&B.stats instanceof _.Stats){I=this._updateQueueTaskWithStats(I,B.stats);if(I){if(B.stats.size){this._fsEntriesTotalBytes+=B.stats.size}this._queue.push(I)}}else{this._statQueue.push(I)}};Archiver.prototype._finalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}this._state.finalizing=true;this._moduleFinalize();this._state.finalizing=false;this._state.finalized=true};Archiver.prototype._maybeFinalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return false}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize();return true}return false};Archiver.prototype._moduleAppend=function(i,B,I){if(this._state.aborted){I();return}this._module.append(i,B,function(i){this._task=null;if(this._state.aborted){this._shutdown();return}if(i){this.emit("error",i);setImmediate(I);return}this.emit("entry",B);this._entriesProcessedCount++;if(B.stats&&B.stats.size){this._fsEntriesProcessedBytes+=B.stats.size}this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}});setImmediate(I)}.bind(this))};Archiver.prototype._moduleFinalize=function(){if(typeof this._module.finalize==="function"){this._module.finalize()}else if(typeof this._module.end==="function"){this._module.end()}else{this.emit("error",new V("NOENDMETHOD"))}};Archiver.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this));this._module.pipe(this);this._state.modulePiped=true};Archiver.prototype._moduleSupports=function(i){if(!this._module.supports||!this._module.supports[i]){return false}return this._module.supports[i]};Archiver.prototype._moduleUnpipe=function(){this._module.unpipe(this);this._state.modulePiped=false};Archiver.prototype._normalizeEntryData=function(i,B){i=H.defaults(i,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:false});if(B&&i.stats===false){i.stats=B}var I=i.type==="directory";if(i.name){if(typeof i.prefix==="string"&&""!==i.prefix){i.name=i.prefix+"/"+i.name;i.prefix=null}i.name=H.sanitizePath(i.name);if(i.type!=="symlink"&&i.name.slice(-1)==="/"){I=true;i.type="directory"}else if(I){i.name+="/"}}if(typeof i.mode==="number"){if(z){i.mode&=511}else{i.mode&=4095}}else if(i.stats&&i.mode===null){if(z){i.mode=i.stats.mode&511}else{i.mode=i.stats.mode&4095}if(z&&I){i.mode=493}}else if(i.mode===null){i.mode=I?493:420}if(i.stats&&i.date===null){i.date=i.stats.mtime}else{i.date=H.dateify(i.date)}return i};Archiver.prototype._onModuleError=function(i){this.emit("error",i)};Archiver.prototype._onQueueDrain=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}};Archiver.prototype._onQueueTask=function(i,B){var fullCallback=()=>{if(i.data.callback){i.data.callback()}B()};if(this._state.finalizing||this._state.finalized||this._state.aborted){fullCallback();return}this._task=i;this._moduleAppend(i.source,i.data,fullCallback)};Archiver.prototype._onStatQueueTask=function(i,B){if(this._state.finalizing||this._state.finalized||this._state.aborted){B();return}_.lstat(i.filepath,function(I,_){if(this._state.aborted){setImmediate(B);return}if(I){this._entriesCount--;this.emit("warning",I);setImmediate(B);return}i=this._updateQueueTaskWithStats(i,_);if(i){if(_.size){this._fsEntriesTotalBytes+=_.size}this._queue.push(i)}setImmediate(B)}.bind(this))};Archiver.prototype._shutdown=function(){this._moduleUnpipe();this.end()};Archiver.prototype._transform=function(i,B,I){if(i){this._pointer+=i.length}I(null,i)};Archiver.prototLine truncated
|
||||||
|
/**
|
||||||
|
* Archiver Core
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(39023);const P={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function ArchiverError(i,B){Error.captureStackTrace(this,this.constructor);this.message=P[i]||i;this.code=i;this.data=B}_.inherits(ArchiverError,Error);B=i.exports=ArchiverError},54693:(i,B,I)=>{
|
||||||
|
/**
|
||||||
|
* JSON Format Plugin
|
||||||
|
*
|
||||||
|
* @module plugins/json
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(39023).inherits;var P=I(29963).Transform;var M=I(84928);var U=I(53296);var Json=function(i){if(!(this instanceof Json)){return new Json(i)}i=this.options=U.defaults(i,{});P.call(this,i);this.supports={directory:true,symlink:true};this.files=[]};_(Json,P);Json.prototype._transform=function(i,B,I){I(null,i)};Json.prototype._writeStringified=function(){var i=JSON.stringify(this.files);this.write(i)};Json.prototype.append=function(i,B,I){var _=this;B.crc32=0;function onend(i,P){if(i){I(i);return}B.size=P.length||0;B.crc32=M.unsigned(P);_.files.push(B);I(null,B)}if(B.sourceType==="buffer"){onend(null,i)}else if(B.sourceType==="stream"){U.collectStream(i,onend)}};Json.prototype.finalize=function(){this._writeStringified();this.end()};i.exports=Json},10396:(i,B,I)=>{
|
||||||
|
/**
|
||||||
|
* TAR Format Plugin
|
||||||
|
*
|
||||||
|
* @module plugins/tar
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(43106);var P=I(56118);var M=I(53296);var Tar=function(i){if(!(this instanceof Tar)){return new Tar(i)}i=this.options=M.defaults(i,{gzip:false});if(typeof i.gzipOptions!=="object"){i.gzipOptions={}}this.supports={directory:true,symlink:true};this.engine=P.pack(i);this.compressor=false;if(i.gzip){this.compressor=_.createGzip(i.gzipOptions);this.compressor.on("error",this._onCompressorError.bind(this))}};Tar.prototype._onCompressorError=function(i){this.engine.emit("error",i)};Tar.prototype.append=function(i,B,I){var _=this;B.mtime=B.date;function append(i,P){if(i){I(i);return}_.engine.entry(B,P,(function(i){I(i,B)}))}if(B.sourceType==="buffer"){append(null,i)}else if(B.sourceType==="stream"&&B.stats){B.size=B.stats.size;var P=_.engine.entry(B,(function(i){I(i,B)}));i.pipe(P)}else if(B.sourceType==="stream"){M.collectStream(i,append)}};Tar.prototype.finalize=function(){this.engine.finalize()};Tar.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Tar.prototype.pipe=function(i,B){if(this.compressor){return this.engine.pipe.apply(this.engine,[this.compressor]).pipe(i,B)}else{return this.engine.pipe.apply(this.engine,arguments)}};Tar.prototype.unpipe=function(){if(this.compressor){return this.compressor.unpipe.apply(this.compressor,arguments)}else{return this.engine.unpipe.apply(this.engine,arguments)}};i.exports=Tar},22836:(i,B,I)=>{
|
||||||
|
/**
|
||||||
|
* ZIP Format Plugin
|
||||||
|
*
|
||||||
|
* @module plugins/zip
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(41622);var P=I(53296);var Zip=function(i){if(!(this instanceof Zip)){return new Zip(i)}i=this.options=P.defaults(i,{comment:"",forceUTC:false,namePrependSlash:false,store:false});this.supports={directory:true,symlink:true};this.engine=new _(i)};Zip.prototype.append=function(i,B,I){this.engine.entry(i,B,I)};Zip.prototype.finalize=function(){this.engine.finalize()};Zip.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Zip.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};Zip.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};i.exports=Zip},97329:function(i,B){(function(i,I){true?I(B):0})(this,(function(i){"use strict";function apply(i,...B){return(...I)=>i(...B,...I)}function initialParams(i){return function(...B){var I=B.pop();return i.call(this,B,I)}}var B=typeof queueMicrotask==="function"&&queueMicrotask;var I=typeof setImmediate==="function"&&setImmediate;var _=typeof process==="object"&&typeof process.nextTick==="function";function fallback(i){setTimeout(i,0)}function wrap(i){return(B,...I)=>i((()=>B(...I)))}var P;if(B){P=queueMicrotask}else if(I){P=setImmediate}else if(_){P=process.nextTick}else{P=fallback}var M=wrap(P);function asyncify(i){if(isAsync(i)){return function(...B){const I=B.pop();const _=i.apply(this,B);return handlePromise(_,I)}}return initialParams((function(B,I){var _;try{_=i.apply(this,B)}catch(i){return I(i)}if(_&&typeof _.then==="function"){return handlePromise(_,I)}else{I(null,_)}}))}function handlePromise(i,B){return i.then((i=>{invokeCallback(B,null,i)}),(i=>{invokeCallback(B,i&&(i instanceof Error||i.message)?i:new Error(i))}))}function invokeCallback(i,B,I){try{i(B,I)}catch(i){M((i=>{throw i}),i)}}function isAsync(i){return i[Symbol.toStringTag]==="AsyncFunction"}function isAsyncGenerator(i){return i[Symbol.toStringTag]==="AsyncGenerator"}function isAsyncIterable(i){return typeof i[Symbol.asyncIterator]==="function"}function wrapAsync(i){if(typeof i!=="function")throw new Error("expected a function");return isAsync(i)?asyncify(i):i}function awaitify(i,B){if(!B)B=i.length;if(!B)throw new Error("arity is undefined");function awaitable(...I){if(typeof I[B-1]==="function"){return i.apply(this,I)}return new Promise(((_,P)=>{I[B-1]=(i,...B)=>{if(i)return P(i);_(B.length>1?B:B[0])};i.apply(this,I)}))}return awaitable}function applyEach$1(i){return function applyEach(B,...I){const _=awaitify((function(_){var P=this;return i(B,((i,B)=>{wrapAsync(i).apply(P,I.concat(B))}),_)}));return _}}function _asyncMap(i,B,I,_){B=B||[];var P=[];var M=0;var U=wrapAsync(I);return i(B,((i,B,I)=>{var _=M++;U(i,((i,B)=>{P[_]=B;I(i)}))}),(i=>{_(i,P)}))}function isArrayLike(i){return i&&typeof i.length==="number"&&i.length>=0&&i.length%1===0}const U={};function once(i){function wrapper(...B){if(i===null)return;var I=i;i=null;I.apply(this,B)}Object.assign(wrapper,i);return wrapper}function getIterator(i){return i[Symbol.iterator]&&i[Symbol.iterator]()}function createArrayIterator(i){var B=-1;var I=i.length;return function next(){return++B<I?{value:i[B],key:B}:null}}function createES2015Iterator(i){var B=-1;return function next(){var I=i.next();if(I.done)return null;B++;return{value:I.value,key:B}}}function createObjectIterator(i){var B=i?Object.keys(i):[];var I=-1;var _=B.length;return function next(){var P=B[++I];if(P==="__proto__"){return next()}return I<_?{value:i[P],key:P}:null}}function createIterator(i){if(isArrayLike(i)){return createArrayIterator(i)}var B=getIterator(i);return B?createES2015Iterator(B):createObjectIterator(i)}function onlyOnce(i){return function(...B){if(i===null)throw new Error("Callback was already called.");var I=i;i=null;I.apply(this,B)}}function asyncEachOfLimit(i,B,I,_){let P=false;let M=false;let H=false;let j=0;let V=0;function replenish(){if(j>=B||H||P)return;H=true;i.next().then((({value:i,done:B})=>{if(M||P)return;H=false;if(B){P=true;if(j<=0){_(null)}return}j++;I(i,V,iterateeCallback);V++;replenish()})).catch(handleError)}function iterateeCallback(i,B){j-=1;if(M)return;if(i)return handleError(i);if(i===false){P=true;M=true;return}if(B===U||P&&j<=0){P=true;return _(null)}replenish()}function handleError(i){if(M)return;H=false;P=true;_(i)}replenish()}var eachOfLimit$2=i=>(B,I,_)=>{_=once(_);if(i<=0){throw new RangeError("concurrency limit cannot be less than 1")}if(!B){return _(null)}if(isAsyncGenerator(B)){return asyncEachOfLimit(B,i,I,_)}if(isAsyncIterable(B)){return asyncEachOfLimit(B[Symbol.asyncIterator](),i,I,_)}var P=createIterator(B);var M=false;var H=false;var j=0;var V=false;function iterateeCallback(i,B){if(H)return;j-=1;if(i){M=true;_(i)}else if(i===false){M=true;H=true}else if(B===U||M&&j<=0){M=true;return _(null)}else if(!V){replenish()}}function replenish(){V=true;while(j<i&&!M){var B=P();if(B===null){M=true;if(j<=0){_(null)}return}j+=1;I(B.value,B.key,onlyOnce(iterateeCallback))}V=false}replenish()};function eachOfLimit(i,B,I,_){return eachOfLimit$2(B)(i,wrapAsynLine truncated
|
||||||
|
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||||
|
var I;(function(i){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if(true){i(B)}else{}}else{i(I={})}})((function(i){i.version="1.2.2";function signed_crc_table(){var i=0,B=new Array(256);for(var I=0;I!=256;++I){i=I;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;i=i&1?-306674912^i>>>1:i>>>1;B[I]=i}return typeof Int32Array!=="undefined"?new Int32Array(B):B}var B=signed_crc_table();function slice_by_16_tables(i){var B=0,I=0,_=0,P=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(_=0;_!=256;++_)P[_]=i[_];for(_=0;_!=256;++_){I=i[_];for(B=256+_;B<4096;B+=256)I=P[B]=I>>>8^i[I&255]}var M=[];for(_=1;_!=16;++_)M[_-1]=typeof Int32Array!=="undefined"?P.subarray(_*256,_*256+256):P.slice(_*256,_*256+256);return M}var I=slice_by_16_tables(B);var _=I[0],P=I[1],M=I[2],U=I[3],H=I[4];var j=I[5],V=I[6],Y=I[7],z=I[8],X=I[9];var re=I[10],se=I[11],oe=I[12],ae=I[13],Ae=I[14];function crc32_bstr(i,I){var _=I^-1;for(var P=0,M=i.length;P<M;)_=_>>>8^B[(_^i.charCodeAt(P++))&255];return~_}function crc32_buf(i,I){var ue=I^-1,de=i.length-15,pe=0;for(;pe<de;)ue=Ae[i[pe++]^ue&255]^ae[i[pe++]^ue>>8&255]^oe[i[pe++]^ue>>16&255]^se[i[pe++]^ue>>>24]^re[i[pe++]]^X[i[pe++]]^z[i[pe++]]^Y[i[pe++]]^V[i[pe++]]^j[i[pe++]]^H[i[pe++]]^U[i[pe++]]^M[i[pe++]]^P[i[pe++]]^_[i[pe++]]^B[i[pe++]];de+=15;while(pe<de)ue=ue>>>8^B[(ue^i[pe++])&255];return~ue}function crc32_str(i,I){var _=I^-1;for(var P=0,M=i.length,U=0,H=0;P<M;){U=i.charCodeAt(P++);if(U<128){_=_>>>8^B[(_^U)&255]}else if(U<2048){_=_>>>8^B[(_^(192|U>>6&31))&255];_=_>>>8^B[(_^(128|U&63))&255]}else if(U>=55296&&U<57344){U=(U&1023)+64;H=i.charCodeAt(P++)&1023;_=_>>>8^B[(_^(240|U>>8&7))&255];_=_>>>8^B[(_^(128|U>>2&63))&255];_=_>>>8^B[(_^(128|H>>6&15|(U&3)<<4))&255];_=_>>>8^B[(_^(128|H&63))&255]}else{_=_>>>8^B[(_^(224|U>>12&15))&255];_=_>>>8^B[(_^(128|U>>6&63))&255];_=_>>>8^B[(_^(128|U&63))&255]}}return~_}i.table=B;i.bstr=crc32_bstr;i.buf=crc32_buf;i.str=crc32_str}))},3662:(i,B,I)=>{const{Transform:_}=I(29963);const P=I(84891);class CRC32Stream extends _{constructor(i){super(i);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0}_transform(i,B,I){if(i){this.checksum=P.buf(i,this.checksum)>>>0;this.rawSize+=i.length}I(null,i)}digest(i){const B=Buffer.allocUnsafe(4);B.writeUInt32BE(this.checksum>>>0,0);return i?B.toString(i):B}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}}i.exports=CRC32Stream},76252:(i,B,I)=>{const{DeflateRaw:_}=I(43106);const P=I(84891);class DeflateCRC32Stream extends _{constructor(i){super(i);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0;this.compressedSize=0}push(i,B){if(i){this.compressedSize+=i.length}return super.push(i,B)}_transform(i,B,I){if(i){this.checksum=P.buf(i,this.checksum)>>>0;this.rawSize+=i.length}super._transform(i,B,I)}digest(i){const B=Buffer.allocUnsafe(4);B.writeUInt32BE(this.checksum>>>0,0);return i?B.toString(i):B}hex(){return this.digest("hex").toUpperCase()}size(i=false){if(i){return this.compressedSize}else{return this.rawSize}}}i.exports=DeflateCRC32Stream},82770:(i,B,I)=>{i.exports={CRC32Stream:I(3662),DeflateCRC32Stream:I(76252)}},6110:(i,B,I)=>{B.formatArgs=formatArgs;B.save=save;B.load=load;B.useColors=useColors;B.storage=localstorage();B.destroy=(()=>{let i=false;return()=>{if(!i){i=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();B.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let i;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(i=navLine truncated
|
||||||
|
/**
|
||||||
|
* @author Toru Nagashima <https://github.com/mysticatea>
|
||||||
|
* @copyright 2015 Toru Nagashima. All rights reserved.
|
||||||
|
* See LICENSE file in root directory for full license.
|
||||||
|
*/
|
||||||
|
Object.defineProperty(B,"__esModule",{value:true});const I=new WeakMap;const _=new WeakMap;function pd(i){const B=I.get(i);console.assert(B!=null,"'this' is expected an Event object, but got",i);return B}function setCancelFlag(i){if(i.passiveListener!=null){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error("Unable to preventDefault inside passive event listener invocation.",i.passiveListener)}return}if(!i.event.cancelable){return}i.canceled=true;if(typeof i.event.preventDefault==="function"){i.event.preventDefault()}}function Event(i,B){I.set(this,{eventTarget:i,event:B,eventPhase:2,currentTarget:i,canceled:false,stopped:false,immediateStopped:false,passiveListener:null,timeStamp:B.timeStamp||Date.now()});Object.defineProperty(this,"isTrusted",{value:false,enumerable:true});const _=Object.keys(B);for(let i=0;i<_.length;++i){const B=_[i];if(!(B in this)){Object.defineProperty(this,B,defineRedirectDescriptor(B))}}}Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const i=pd(this).currentTarget;if(i==null){return[]}return[i]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const i=pd(this);i.stopped=true;if(typeof i.event.stopPropagation==="function"){i.event.stopPropagation()}},stopImmediatePropagation(){const i=pd(this);i.stopped=true;i.immediateStopped=true;if(typeof i.event.stopImmediatePropagation==="function"){i.event.stopImmediatePropagation()}},get bubbles(){return Boolean(pd(this).event.bubbles)},get cancelable(){return Boolean(pd(this).event.cancelable)},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return Boolean(pd(this).event.composed)},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(i){if(!i){return}const B=pd(this);B.stopped=true;if(typeof B.event.cancelBubble==="boolean"){B.event.cancelBubble=true}},get returnValue(){return!pd(this).canceled},set returnValue(i){if(!i){setCancelFlag(pd(this))}},initEvent(){}};Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:true,writable:true});if(typeof window!=="undefined"&&typeof window.Event!=="undefined"){Object.setPrototypeOf(Event.prototype,window.Event.prototype);_.set(window.Event.prototype,Event)}function defineRedirectDescriptor(i){return{get(){return pd(this).event[i]},set(B){pd(this).event[i]=B},configurable:true,enumerable:true}}function defineCallDescriptor(i){return{value(){const B=pd(this).event;return B[i].apply(B,arguments)},configurable:true,enumerable:true}}function defineWrapper(i,B){const I=Object.keys(B);if(I.length===0){return i}function CustomEvent(B,I){i.call(this,B,I)}CustomEvent.prototype=Object.create(i.prototype,{constructor:{value:CustomEvent,configurable:true,writable:true}});for(let _=0;_<I.length;++_){const P=I[_];if(!(P in i.prototype)){const i=Object.getOwnPropertyDescriptor(B,P);const I=typeof i.value==="function";Object.defineProperty(CustomEvent.prototype,P,I?defineCallDescriptor(P):defineRedirectDescriptor(P))}}return CustomEvent}function getWrapper(i){if(i==null||i===Object.prototype){return Event}let B=_.get(i);if(B==null){B=defineWrapper(getWrapper(Object.getPrototypeOf(i)),i);_.set(i,B)}return B}function wrapEvent(i,B){const I=getWrapper(Object.getPrototypeOf(B));return new I(i,B)}function isStopped(i){return pd(i).immediateStopped}function setEventPhase(i,B){pd(i).eventPhase=B}function setCurrentTarget(i,B){pd(i).currentTarget=B}function setPassiveListener(i,B){pd(i).passiveListener=B}const P=new WeakMap;const M=1;const U=2;const H=3;function isObject(i){return i!==null&&typeof i==="object"}function getListeners(i){const B=P.get(i);if(B==null){throw new TypeError("'this' is expected an EventTarget object, but got another value.")}return B}function defineEventAttributeDescriptor(i){return{get(){const B=getListeners(this);let I=B.get(i);while(I!=null){if(I.listenerType===H){return I.listener}I=I.next}return null},set(B){if(typeof B!=="function"&&!isObject(B)){B=null}const I=getListeners(this);let _=null;let P=I.get(i);while(P!=null){if(P.listenerType===H){if(_!==null){_.next=P.next}else if(P.next!==null){I.set(i,P.next)}else{I.delete(i)}}else{_=P}P=P.next}if(B!==null){const P={listener:B,listenerType:H,passive:false,once:false,next:null};if(_===null){I.set(i,P)}else{_.next=P}}},configurable:true,enumerable:true}}function defineEventAttribute(i,B){Object.defineProperty(i,`on${B}`,defineEventAttributeDescriptor(B))}function defineCustomEventTarget(i){function CustomEventTarget(){EventTarget.call(this)}CustomEventTarget.prototype=Object.create(EventTarget.prototype,{constructor:{value:CustomEventTarget,configurable:true,writable:true}});for(let B=0;B<i.length;++B){defLine truncated
|
||||||
/*!
|
/*!
|
||||||
* mime-db
|
* mime-db
|
||||||
* Copyright(c) 2014 Jonathan Ong
|
* Copyright(c) 2014 Jonathan Ong
|
||||||
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
A.exports=g(1813)},4096:(A,i,g)=>{
|
i.exports=I(81813)},14096:(i,B,I)=>{
|
||||||
/*!
|
/*!
|
||||||
* mime-types
|
* mime-types
|
||||||
* Copyright(c) 2014 Jonathan Ong
|
* Copyright(c) 2014 Jonathan Ong
|
||||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
var E=g(9829);var p=g(6928).extname;var C=/^\s*([^;\s]*)(?:;|\s|$)/;var f=/^text\//i;i.charset=charset;i.charsets={lookup:charset};i.contentType=contentType;i.extension=extension;i.extensions=Object.create(null);i.lookup=lookup;i.types=Object.create(null);populateMaps(i.extensions,i.types);function charset(A){if(!A||typeof A!=="string"){return false}var i=C.exec(A);var g=i&&E[i[1].toLowerCase()];if(g&&g.charset){return g.charset}if(i&&f.test(i[1])){return"UTF-8"}return false}function contentType(A){if(!A||typeof A!=="string"){return false}var g=A.indexOf("/")===-1?i.lookup(A):A;if(!g){return false}if(g.indexOf("charset")===-1){var E=i.charset(g);if(E)g+="; charset="+E.toLowerCase()}return g}function extension(A){if(!A||typeof A!=="string"){return false}var g=C.exec(A);var E=g&&i.extensions[g[1].toLowerCase()];if(!E||!E.length){return false}return E[0]}function lookup(A){if(!A||typeof A!=="string"){return false}var g=p("x."+A).toLowerCase().substr(1);if(!g){return false}return i.types[g]||false}function populateMaps(A,i){var g=["nginx","apache",undefined,"iana"];Object.keys(E).forEach((function forEachMimeType(p){var C=E[p];var f=C.extensions;if(!f||!f.length){return}A[p]=f;for(var Q=0;Q<f.length;Q++){var B=f[Q];if(i[B]){var I=g.indexOf(E[i[B]].source);var y=g.indexOf(C.source);if(i[B]!=="application/octet-stream"&&(I>y||I===y&&i[B].substr(0,12)==="application/")){continue}}i[B]=p}}))}},744:A=>{var i=1e3;var g=i*60;var E=g*60;var p=E*24;var C=p*7;var f=p*365.25;A.exports=function(A,i){i=i||{};var g=typeof A;if(g==="string"&&A.length>0){return parse(A)}else if(g==="number"&&isFinite(A)){return i.long?fmtLong(A):fmtShort(A)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(A))};function parse(A){A=String(A);if(A.length>100){return}var Q=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(A);if(!Q){return}var B=parseFloat(Q[1]);var I=(Q[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return B*f;case"weeks":case"week":case"w":return B*C;case"days":case"day":case"d":return B*p;case"hours":case"hour":case"hrs":case"hr":case"h":return B*E;case"minutes":case"minute":case"mins":case"min":case"m":return B*g;case"seconds":case"second":case"secs":case"sec":case"s":return B*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return undefined}}function fmtShort(A){var C=Math.abs(A);if(C>=p){return Math.round(A/p)+"d"}if(C>=E){return Math.round(A/E)+"h"}if(C>=g){return Math.round(A/g)+"m"}if(C>=i){return Math.round(A/i)+"s"}return A+"ms"}function fmtLong(A){var C=Math.abs(A);if(C>=p){return plural(A,C,p,"day")}if(C>=E){return plural(A,C,E,"hour")}if(C>=g){return plural(A,C,g,"minute")}if(C>=i){return plural(A,C,i,"second")}return A+" ms"}function plural(A,i,g,E){var p=i>=g*1.5;return Math.round(A/g)+" "+E+(p?"s":"")}},7777:(A,i,g)=>{var E=g(7016).parse;var p={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var C=String.prototype.endsWith||function(A){return A.length<=this.length&&this.indexOf(A,this.length-A.length)!==-1};function getProxyForUrl(A){var i=typeof A==="string"?E(A):A||{};var g=i.protocol;var C=i.host;var f=i.port;if(typeof C!=="string"||!C||typeof g!=="string"){return""}g=g.split(":",1)[0];C=C.replace(/:\d*$/,"");f=parseInt(f)||p[g]||0;if(!shouldProxy(C,f)){return""}var Q=getEnv("npm_config_"+g+"_proxy")||getEnv(g+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(Q&&Q.indexOf("://")===-1){Q=g+"://"+Q}return Q}function shouldProxy(A,i){var g=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!g){return true}if(g==="*"){return false}return g.split(/[,\s]/).every((function(g){if(!g){return true}var E=g.match(/^(.+):(\d+)$/);var p=E?E[1]:g;var f=E?parseInt(E[2]):0;if(f&&f!==i){return true}if(!/^[.*]/.test(p)){return A!==p}if(p.charAt(0)==="*"){p=p.slice(1)}return!C.call(A,p)}))}function getEnv(A){return process.env[A.toLowerCase()]||process.env[A.toUpperCase()]||""}i.T=getProxyForUrl},9546:(A,i,g)=>{var E;E={value:true};const p=g(1354);const C=g(7016);const f=g(4434);const Q=g(2830);const B=g(3106);const I=g(4922);const y=g(9023);const b=g(9896);const D=g(9557);const R=g(6928);function _interopDefaultLegacy(A){return A&&typeof A==="object"&&"default"in A?A:{default:A}}const k=_interopDefaultLegacy(p);const S=_interopDefaultLegacy(C);const v=_interopDefaultLegacy(Q);const F=_interopDefaultLegacy(B);const x=_interopDefaultLegacy(I);const U=_interopDefaultLegacy(y);const L=_interopDefaultLegacy(b);const M=_interopDefaultLegacy(D);const T=_interopDefaultLegacy(R);const H=v["default"]("screepsapi:socket");const G={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends f.EventEmitter{constructor(A){super();this.api=A;this.opts=Object.assign({},G);this.on("error",(()=>{}));this.reset();this.on("auth",(A=>{if(A.data.status==="ok"){while(this.__queue.lLine truncated
|
var _=I(99829);var P=I(16928).extname;var M=/^\s*([^;\s]*)(?:;|\s|$)/;var U=/^text\//i;B.charset=charset;B.charsets={lookup:charset};B.contentType=contentType;B.extension=extension;B.extensions=Object.create(null);B.lookup=lookup;B.types=Object.create(null);populateMaps(B.extensions,B.types);function charset(i){if(!i||typeof i!=="string"){return false}var B=M.exec(i);var I=B&&_[B[1].toLowerCase()];if(I&&I.charset){return I.charset}if(B&&U.test(B[1])){return"UTF-8"}return false}function contentType(i){if(!i||typeof i!=="string"){return false}var I=i.indexOf("/")===-1?B.lookup(i):i;if(!I){return false}if(I.indexOf("charset")===-1){var _=B.charset(I);if(_)I+="; charset="+_.toLowerCase()}return I}function extension(i){if(!i||typeof i!=="string"){return false}var I=M.exec(i);var _=I&&B.extensions[I[1].toLowerCase()];if(!_||!_.length){return false}return _[0]}function lookup(i){if(!i||typeof i!=="string"){return false}var I=P("x."+i).toLowerCase().substr(1);if(!I){return false}return B.types[I]||false}function populateMaps(i,B){var I=["nginx","apache",undefined,"iana"];Object.keys(_).forEach((function forEachMimeType(P){var M=_[P];var U=M.extensions;if(!U||!U.length){return}i[P]=U;for(var H=0;H<U.length;H++){var j=U[H];if(B[j]){var V=I.indexOf(_[B[j]].source);var Y=I.indexOf(M.source);if(B[j]!=="application/octet-stream"&&(V>Y||V===Y&&B[j].substr(0,12)==="application/")){continue}}B[j]=P}}))}},4469:(i,B,I)=>{var _=I(16928);var P=I(79896);var M=parseInt("0777",8);i.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(i,B,I,U){if(typeof B==="function"){I=B;B={}}else if(!B||typeof B!=="object"){B={mode:B}}var H=B.mode;var j=B.fs||P;if(H===undefined){H=M}if(!U)U=null;var V=I||function(){};i=_.resolve(i);j.mkdir(i,H,(function(I){if(!I){U=U||i;return V(null,U)}switch(I.code){case"ENOENT":if(_.dirname(i)===i)return V(I);mkdirP(_.dirname(i),B,(function(I,_){if(I)V(I,_);else mkdirP(i,B,V,_)}));break;default:j.stat(i,(function(i,B){if(i||!B.isDirectory())V(I,U);else V(null,U)}));break}}))}mkdirP.sync=function sync(i,B,I){if(!B||typeof B!=="object"){B={mode:B}}var U=B.mode;var H=B.fs||P;if(U===undefined){U=M}if(!I)I=null;i=_.resolve(i);try{H.mkdirSync(i,U);I=I||i}catch(P){switch(P.code){case"ENOENT":I=sync(_.dirname(i),B,I);sync(i,B,I);break;default:var j;try{j=H.statSync(i)}catch(i){throw P}if(!j.isDirectory())throw P;break}}return I}},70744:i=>{var B=1e3;var I=B*60;var _=I*60;var P=_*24;var M=P*7;var U=P*365.25;i.exports=function(i,B){B=B||{};var I=typeof i;if(I==="string"&&i.length>0){return parse(i)}else if(I==="number"&&isFinite(i)){return B.long?fmtLong(i):fmtShort(i)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function parse(i){i=String(i);if(i.length>100){return}var H=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!H){return}var j=parseFloat(H[1]);var V=(H[2]||"ms").toLowerCase();switch(V){case"years":case"year":case"yrs":case"yr":case"y":return j*U;case"weeks":case"week":case"w":return j*M;case"days":case"day":case"d":return j*P;case"hours":case"hour":case"hrs":case"hr":case"h":return j*_;case"minutes":case"minute":case"mins":case"min":case"m":return j*I;case"seconds":case"second":case"secs":case"sec":case"s":return j*B;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return j;default:return undefined}}function fmtShort(i){var M=Math.abs(i);if(M>=P){return Math.round(i/P)+"d"}if(M>=_){return Math.round(i/_)+"h"}if(M>=I){return Math.round(i/I)+"m"}if(M>=B){return Math.round(i/B)+"s"}return i+"ms"}function fmtLong(i){var M=Math.abs(i);if(M>=P){return plural(i,M,P,"day")}if(M>=_){return plural(i,M,_,"hour")}if(M>=I){return plural(i,M,I,"minute")}if(M>=B){return plural(i,M,B,"second")}return i+" ms"}function plural(i,B,I,_){var P=B>=I*1.5;return Math.round(i/I)+" "+_+(P?"s":"")}},56133:i=>{
|
||||||
/*!
|
/*!
|
||||||
* Tmp
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
||||||
*
|
* Released under the MIT License.
|
||||||
* MIT Licensed
|
|
||||||
*/
|
*/
|
||||||
const E=g(9896);const p=g(857);const C=g(6928);const f=g(6982);const Q={fs:E.constants,os:p.constants};const B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",I=/XXXXXX/,y=3,b=(Q.O_CREAT||Q.fs.O_CREAT)|(Q.O_EXCL||Q.fs.O_EXCL)|(Q.O_RDWR||Q.fs.O_RDWR),D=p.platform()==="win32",R=Q.EBADF||Q.os.errno.EBADF,k=Q.ENOENT||Q.os.errno.ENOENT,S=448,v=384,F="exit",x=[],U=E.rmdirSync.bind(E);let L=false;function rimraf(A,i){return E.rm(A,{recursive:true},i)}function FN_RIMRAF_SYNC(A){return E.rmSync(A,{recursive:true})}function tmpName(A,i){const g=_parseArguments(A,i),p=g[0],C=g[1];_assertAndSanitizeOptions(p,(function(A,i){if(A)return C(A);let g=i.tries;(function _getUniqueName(){try{const A=_generateTmpName(i);E.stat(A,(function(i){if(!i){if(g-- >0)return _getUniqueName();return C(new Error("Could not get a unique tmp filename, max tries reached "+A))}C(null,A)}))}catch(A){C(A)}})()}))}function tmpNameSync(A){const i=_parseArguments(A),g=i[0];const p=_assertAndSanitizeOptionsSync(g);let C=p.tries;do{const A=_generateTmpName(p);try{E.statSync(A)}catch(i){return A}}while(C-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(A,i){const g=_parseArguments(A,i),p=g[0],C=g[1];tmpName(p,(function _tmpNameCreated(A,i){if(A)return C(A);E.open(i,b,p.mode||v,(function _fileCreated(A,g){if(A)return C(A);if(p.discardDescriptor){return E.close(g,(function _discardCallback(A){return C(A,i,undefined,_prepareTmpFileRemoveCallback(i,-1,p,false))}))}else{const A=p.discardDescriptor||p.detachDescriptor;C(null,i,g,_prepareTmpFileRemoveCallback(i,A?-1:g,p,false))}}))}))}function fileSync(A){const i=_parseArguments(A),g=i[0];const p=g.discardDescriptor||g.detachDescriptor;const C=tmpNameSync(g);let f=E.openSync(C,b,g.mode||v);if(g.discardDescriptor){E.closeSync(f);f=undefined}return{name:C,fd:f,removeCallback:_prepareTmpFileRemoveCallback(C,p?-1:f,g,true)}}function dir(A,i){const g=_parseArguments(A,i),p=g[0],C=g[1];tmpName(p,(function _tmpNameCreated(A,i){if(A)return C(A);E.mkdir(i,p.mode||S,(function _dirCreated(A){if(A)return C(A);C(null,i,_prepareTmpDirRemoveCallback(i,p,false))}))}))}function dirSync(A){const i=_parseArguments(A),g=i[0];const p=tmpNameSync(g);E.mkdirSync(p,g.mode||S);return{name:p,removeCallback:_prepareTmpDirRemoveCallback(p,g,true)}}function _removeFileAsync(A,i){const _handler=function(A){if(A&&!_isENOENT(A)){return i(A)}i()};if(0<=A[0])E.close(A[0],(function(){E.unlink(A[1],_handler)}));else E.unlink(A[1],_handler)}function _removeFileSync(A){let i=null;try{if(0<=A[0])E.closeSync(A[0])}catch(A){if(!_isEBADF(A)&&!_isENOENT(A))throw A}finally{try{E.unlinkSync(A[1])}catch(A){if(!_isENOENT(A))i=A}}if(i!==null){throw i}}function _prepareTmpFileRemoveCallback(A,i,g,E){const p=_prepareRemoveCallback(_removeFileSync,[i,A],E);const C=_prepareRemoveCallback(_removeFileAsync,[i,A],E,p);if(!g.keep)x.unshift(p);return E?p:C}function _prepareTmpDirRemoveCallback(A,i,g){const p=i.unsafeCleanup?rimraf:E.rmdir.bind(E);const C=i.unsafeCleanup?FN_RIMRAF_SYNC:U;const f=_prepareRemoveCallback(C,A,g);const Q=_prepareRemoveCallback(p,A,g,f);if(!i.keep)x.unshift(f);return g?f:Q}function _prepareRemoveCallback(A,i,g,E){let p=false;return function _cleanupCallback(C){if(!p){const f=E||_cleanupCallback;const Q=x.indexOf(f);if(Q>=0)x.splice(Q,1);p=true;if(g||A===U||A===FN_RIMRAF_SYNC){return A(i)}else{return A(i,C||function(){})}}}}function _garbageCollector(){if(!L)return;while(x.length){try{x[0]()}catch(A){}}}function _randomChars(A){let i=[],g=null;try{g=f.randomBytes(A)}catch(i){g=f.pseudoRandomBytes(A)}for(let E=0;E<A;E++){i.push(B[g[E]%B.length])}return i.join("")}function _isUndefined(A){return typeof A==="undefined"}function _parseArguments(A,i){if(typeof A==="function"){return[{},A]}if(_isUndefined(A)){return[{},i]}const g={};for(const i of Object.getOwnPropertyNames(A)){g[i]=A[i]}return[g,i]}function _resolvePath(A,i,g){const p=C.isAbsolute(A)?A:C.join(i,A);E.stat(p,(function(A){if(A){E.realpath(C.dirname(p),(function(A,i){if(A)return g(A);g(null,C.join(i,C.basename(p)))}))}else{E.realpath(p,g)}}))}function _resolvePathSync(A,i){const g=C.isAbsolute(A)?A:C.join(i,A);try{E.statSync(g);return E.realpathSync(g)}catch(A){const i=E.realpathSync(C.dirname(g));return C.join(i,C.basename(g))}}function _generateTmpName(A){const i=A.tmpdir;if(!_isUndefined(A.name)){return C.join(i,A.dir,A.name)}if(!_isUndefined(A.template)){return C.join(i,A.dir,A.template).replace(I,_randomChars(6))}const g=[A.prefix?A.prefix:"tmp","-",process.pid,"-",_randomChars(12),A.postfix?"-"+A.postfix:""].join("");return C.join(i,A.dir,g)}function _assertOptionsBase(A){if(!_isUndefined(A.name)){const i=A.name;if(C.isAbsolute(i))throw new Error(`name option must not contain an absolute path, found "${i}".`);const g=C.basename(i);if(g===".."||g==="."||g!==i)throw new Error(`name option must not contain a path, found "${i}".`)}if(!_isUndefined(A.template)&&!A.template.match(I)){throw new Error(`Invalid template,
Line truncated
|
i.exports=function(i,B){if(typeof i!=="string"){throw new TypeError("expected path to be a string")}if(i==="\\"||i==="/")return"/";var I=i.length;if(I<=1)return i;var _="";if(I>4&&i[3]==="\\"){var P=i[2];if((P==="?"||P===".")&&i.slice(0,2)==="\\\\"){i=i.slice(2);_="//"}}var M=i.split(/[/\\]+/);if(B!==false&&M[M.length-1]===""){M.pop()}return _+M.join("/")}},55560:(i,B,I)=>{var _=I(58264);i.exports=_(once);i.exports.strict=_(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(i){var f=function(){if(f.called)return f.value;f.called=true;return f.value=i.apply(this,arguments)};f.called=false;return f}function onceStrict(i){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=i.apply(this,arguments)};var B=i.name||"Function wrapped with `once`";f.onceError=B+" shouldn't be called more than once";f.called=false;return f}},19183:i=>{if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){i.exports={nextTick:nextTick}}else{i.exports=process}function nextTick(i,B,I,_){if(typeof i!=="function"){throw new TypeError('"callback" argument must be a function')}var P=arguments.length;var M,U;switch(P){case 0:case 1:return process.nextTick(i);case 2:return process.nextTick((function afterTickOne(){i.call(null,B)}));case 3:return process.nextTick((function afterTickTwo(){i.call(null,B,I)}));case 4:return process.nextTick((function afterTickThree(){i.call(null,B,I,_)}));default:M=new Array(P-1);U=0;while(U<M.length){M[U++]=arguments[U]}return process.nextTick((function afterTick(){i.apply(null,M)}))}}},7945:i=>{i.exports=global.process},77777:(i,B,I)=>{var _=I(87016).parse;var P={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var M=String.prototype.endsWith||function(i){return i.length<=this.length&&this.indexOf(i,this.length-i.length)!==-1};function getProxyForUrl(i){var B=typeof i==="string"?_(i):i||{};var I=B.protocol;var M=B.host;var U=B.port;if(typeof M!=="string"||!M||typeof I!=="string"){return""}I=I.split(":",1)[0];M=M.replace(/:\d*$/,"");U=parseInt(U)||P[I]||0;if(!shouldProxy(M,U)){return""}var H=getEnv("npm_config_"+I+"_proxy")||getEnv(I+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(H&&H.indexOf("://")===-1){H=I+"://"+H}return H}function shouldProxy(i,B){var I=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!I){return true}if(I==="*"){return false}return I.split(/[,\s]/).every((function(I){if(!I){return true}var _=I.match(/^(.+):(\d+)$/);var P=_?_[1]:I;var U=_?parseInt(_[2]):0;if(U&&U!==B){return true}if(!/^[.*]/.test(P)){return i!==P}if(P.charAt(0)==="*"){P=P.slice(1)}return!M.call(i,P)}))}function getEnv(i){return process.env[i.toLowerCase()]||process.env[i.toUpperCase()]||""}B.T=getProxyForUrl},80652:(i,B,I)=>{const{SymbolDispose:_}=I(50999);const{AbortError:P,codes:M}=I(69220);const{isNodeStream:U,isWebStream:H,kControllerErrorFunction:j}=I(83426);const V=I(36815);const{ERR_INVALID_ARG_TYPE:Y}=M;let z;const validateAbortSignal=(i,B)=>{if(typeof i!=="object"||!("aborted"in i)){throw new Y(B,"AbortSignal",i)}};i.exports.addAbortSignal=function addAbortSignal(B,I){validateAbortSignal(B,"signal");if(!U(I)&&!H(I)){throw new Y("stream",["ReadableStream","WritableStream","Stream"],I)}return i.exports.addAbortSignalNoValidate(B,I)};i.exports.addAbortSignalNoValidate=function(i,B){if(typeof i!=="object"||!("aborted"in i)){return B}const M=U(B)?()=>{B.destroy(new P(undefined,{cause:i.reason}))}:()=>{B[j](new P(undefined,{cause:i.reason}))};if(i.aborted){M()}else{z=z||I(23539).addAbortListener;const P=z(i,M);V(B,P[_])}return B}},77336:(i,B,I)=>{const{StringPrototypeSlice:_,SymbolIterator:P,TypedArrayPrototypeSet:M,Uint8Array:U}=I(50999);const{Buffer:H}=I(20181);const{inspect:j}=I(23539);i.exports=class BufferList{constructor(){this.head=null;this.tail=null;this.length=0}push(i){const B={data:i,next:null};if(this.length>0)this.tail.next=B;else this.head=B;this.tail=B;++this.length}unshift(i){const B={data:i,next:this.head};if(this.length===0)this.tail=B;this.head=B;++this.length}shift(){if(this.length===0)return;const i=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return i}clear(){this.head=this.tail=null;this.length=0}join(i){if(this.length===0)return"";let B=this.head;let I=""+B.data;while((B=B.next)!==null)I+=i+B.data;return I}concat(i){if(this.length===0)return H.alloc(0);const B=H.allocUnsafe(i>>>0);let I=this.head;let _=0;while(I){M(B,I.data,_);_+=I.data.length;I=I.next}return B}consume(i,B){const I=this.head.data;if(i<I.length){const B=I.slice(0,i);this.head.data=I.slice(i);return B}if(i===I.length){return this.shift()}return B?this._getString(i):this._getBuffLine truncated
|
||||||
/*! 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 E=[];const p=new Uint8Array([13,10]);y=0;let C=false;for(const[i,f]of A){if(typeof f==="string"){const A=H.encode(g+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(f)}\r\n`);E.push(A);y+=A.byteLength}else{const A=H.encode(`${g}; name="${escape(normalizeLinefeeds(i))}"`+(f.name?`; filename="${escape(f.name)}"`:"")+"\r\n"+`Content-Type: ${f.type||"application/octet-stream"}\r\n\r\n`);E.push(A,f,p);if(typeof f.size==="number"){y+=A.byteLength+f.size+p.byteLength}else{C=true}}}const f=H.encode(`--${i}--\r\n`);E.push(f);y+=f.byteLength;if(C){y=null}I=A;B=async function*(){for(const A of E){if(A.stream){yield*A.stream()}else{yield A}}};b=`multipart/form-data; boundary=${i}`}else if(C(A)){I=A;y=A.size;if(A.type){b=A.type}}else if(typeof A[Symbol.asyncIterator]==="function"){if(i){throw new TypeError("keepalive")}if(E.isDisturbed(A)||A.locked){throw new TypeError("Response body object should not be disturbed or locked")}g=A instanceof ReadableStream?A:p(A)}if(typeof I==="string"||E.isBuffer(I)){y=Buffer.byteLength(I)}if(B!=null){let i;g=new ReadableStream({async start(){i=B(A)[Symbol.asyncIterator]()},async pull(A){const{value:E,done:p}=await i.next();if(p){queueMicrotask((()=>{A.close();A.byobRequest?.respond(0)}))}else{if(!F(g)){const i=new Uint8Array(E);if(i.byteLength){A.enqueue(i)}}}return A.desiredSize>0},async cancel(A){await i.return()},type:"bytes"})}const D={stream:g,source:I,length:y};return[D,b]}function safelyExtractBody(A,i=false){if(A instanceof ReadableStream){v(!E.isDisturbed(A),"The body has already been consumed.");v(!A.locked,"The stream is locked.")}return extractBody(A,i)}function cloneBody(A,i){const[g,E]=i.stream.tee();i.stream=g;return{stream:E,length:i.length,source:i.source}}function throwIfAborted(A){if(A.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(A){const i={blob(){return consumeBody(this,(A=>{let i=bodyMimeType(this);if(i===null){i=""}else if(i){i=L(i)}return new S([A],{type:i})}),A)},arrayBuffer(){return consumeBody(this,(A=>new Uint8Array(A).buffer),A)},text(){return consumeBody(this,b,A)},json(){return consumeBody(this,parseJSONFromBytes,A)},formData(){return consumeBody(this,(A=>{const i=bodyMimeType(this);if(i!==null){switch(i.essence){case"multipart/form-data":{const g=M(A,i);if(g==="failure"){throw new TypeError("Failed to parse body as FormData.")}const E=new D;E[R]=g;return E}case"application/x-www-form-urlencoded":{const i=new URLSearchParams(A.toString());const g=new D;for(const[A,E]of i){g.append(A,E)}return g}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),A)},bytes(){return consumeBody(this,(A=>new Uint8Array(A)),A)}};return i}function mixinBody(A){Object.assign(A.prototype,bodyMixinMethods(A))}async function consumeBody(A,i,g){k.brandCheck(A,g);if(bodyUnusable(A)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(A[R]);const E=B();const errorSteps=A=>E.reject(A);const successSteps=A=>{try{E.resolve(i(A))}catch(A){errorSteps(A)}};if(A[R].body==null){successSteps(Buffer.allocUnsafe(0));return E.promise}await I(A[R].body,successSteps,errorSteps);return E.promise}function bodyUnusable(A){const i=A[R].body;return i!=null&&(i.stream.locked||E.isDisturbed(i.stream))}function parseJSONFromBytes(A){return JSON.parse(b(A))}function bodyMimeType(A){const i=A[R].headersList;const g=y(i);if(g==="failure"){return null}return g}A.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:Y,hasFinalizationRegistry:G,bodyUnusable:bodyUnusable}},4495:A=>{const i=["GET","HEAD","POST"];const g=new Set(i);const E=[101,204,205,304];const p=[301,302,303,307,308];const C=new Set(p);const f=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const Q=new Set(f);const B=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const I=new Set(B);const y=["follow","manual","error"];const b=["GET","HEAD","OPTIONS","TRACE"];const D=new Set(b);const R=["navigate","same-origin","no-cors","cors"];const k=["omit","same-origin","include"];const S=["default","no-store","reload","no-cache","force-cLine truncated
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */Q[f-4]=g[0];Q[f-3]=g[1];Q[f-2]=g[2];Q[f-1]=g[3];Q[1]=C;if(C===126){Q.writeUInt16BE(p,2)}else if(C===127){Q[2]=Q[3]=0;Q.writeUIntBE(p,4,6)}Q[1]|=128;for(let A=0;A<p;++A){Q[f+A]=i[A]^g[A&3]}return Q}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(A,i,g)=>{const{createInflateRaw:E,Z_DEFAULT_WINDOWBITS:p}=g(8522);const{isValidClientWindowBits:C}=g(8625);const f=Buffer.from([0,0,255,255]);const Q=Symbol("kBuffer");const B=Symbol("kLength");class PerMessageDeflate{#re;#S={};constructor(A){this.#S.serverNoContextTakeover=A.has("server_no_context_takeover");this.#S.serverMaxWindowBits=A.get("server_max_window_bits")}decompress(A,i,g){if(!this.#re){let A=p;if(this.#S.serverMaxWindowBits){if(!C(this.#S.serverMaxWindowBits)){g(new Error("Invalid server_max_window_bits"));return}A=Number.parseInt(this.#S.serverMaxWindowBits)}this.#re=E({windowBits:A});this.#re[Q]=[];this.#re[B]=0;this.#re.on("data",(A=>{this.#re[Q].push(A);this.#re[B]+=A.length}));this.#re.on("error",(A=>{this.#re=null;g(A)}))}this.#re.write(A);if(i){this.#re.write(f)}this.#re.flush((()=>{const A=Buffer.concat(this.#re[Q],this.#re[B]);this.#re[Q].length=0;this.#re[B]=0;g(null,A)}))}}A.exports={PerMessageDeflate:PerMessageDeflate}},1652:(A,i,g)=>{const{Writable:E}=g(7075);const p=g(4589);const{parserStates:C,opcodes:f,states:Q,emptyBuffer:B,sentCloseFrameState:I}=g(736);const{kReadyState:y,kSentClose:b,kResponse:D,kReceivedClose:R}=g(1216);const{channels:k}=g(2414);const{isValidStatusCode:S,isValidOpcode:v,failWebsocketConnection:F,websocketMessageReceived:x,utf8Decode:U,isControlFrame:L,isTextBinaryFrame:M,isContinuationFrame:T}=g(8625);const{WebsocketFrameSend:H}=g(3264);const{closeWebSocketConnection:G}=g(6897);const{PerMessageDeflate:Y}=g(9469);class ByteParser extends E{#n=[];#o=0;#ie=false;#a=C.INFO;#c={};#l=[];#d;constructor(A,i){super();this.ws=A;this.#d=i==null?new Map:i;if(this.#d.has("permessage-deflate")){this.#d.set("permessage-deflate",new Y(i))}}_write(A,i,g){this.#n.push(A);this.#o+=A.length;this.#ie=true;this.run(g)}run(A){while(this.#ie){if(this.#a===C.INFO){if(this.#o<2){return A()}const i=this.consume(2);const g=(i[0]&128)!==0;const E=i[0]&15;const p=(i[1]&128)===128;const Q=!g&&E!==f.CONTINUATION;const B=i[1]&127;const I=i[0]&64;const y=i[0]&32;const b=i[0]&16;if(!v(E)){F(this.ws,"Invalid opcode received");return A()}if(p){F(this.ws,"Frame cannot be masked");return A()}if(I!==0&&!this.#d.has("permessage-deflate")){F(this.ws,"Expected RSV1 to be clear.");return}if(y!==0||b!==0){F(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(Q&&!M(E)){F(this.ws,"Invalid frame type was fragmented.");return}if(M(E)&&this.#l.length>0){F(this.ws,"Expected continuation frame");return}if(this.#c.fragmented&&Q){F(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((B>125||Q)&&L(E)){F(this.ws,"Control frame either too large or fragmented");return}if(T(E)&&this.#l.length===0&&!this.#c.compressed){F(this.ws,"Unexpected continuation frame");return}if(B<=125){this.#c.payloadLength=B;this.#a=C.READ_DATA}else if(B===126){this.#a=C.PAYLOADLENGTH_16}else if(B===127){this.#a=C.PAYLOADLENGTH_64}if(M(E)){this.#c.binaryType=E;this.#c.compressed=I!==0}this.#c.opcode=E;this.#c.masked=p;this.#c.fin=g;this.#c.fragmented=Q}else if(this.#a===C.PAYLOADLENGTH_16){if(this.#o<2){return A()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#a=C.READ_DATA}else if(this.#a===C.PAYLOADLENGTH_64){if(this.#o<8){return A()}const i=this.consume(8);const g=i.readUInt32BE(0);if(g>2**31-1){F(this.ws,"Received payload length > 2^31 bytes.");return}const E=i.readUInt32BE(4);this.#c.payloadLength=(g<<8)+E;this.#a=C.READ_DATA}else if(this.#a===C.READ_DATA){if(this.#o<this.#c.payloadLength){return A()}const i=this.consume(this.#c.payloadLength);if(L(this.#c.opcode)){this.#ie=this.parseControlFrame(i);this.#a=C.INFO}else{if(!this.#c.compressed){this.#l.push(i);if(!this.#c.fragmented&&this.#c.fin){const A=Buffer.concat(this.#l);x(this.ws,this.#c.binaryType,A);this.#l.length=0}this.#a=C.INFO}else{this.#d.get("permessage-deflate").decompress(i,this.#c.fin,((i,g)=>{if(i){G(this.ws,1007,i.message,i.message.length);return}this.#l.push(g);if(!this.#c.fin){this.#a=C.INFO;this.#ie=true;this.run(A);return}x(this.ws,this.#c.binaryType,Buffer.concat(this.#l));this.#ie=true;this.#a=C.INFO;this.#l.length=0;this.run(A)}));this.#ie=false;break}}}}}consume(A){if(A>this.#o){throw new Error("Called consume() before buffers satiated.")}else if(A===0){return B}if(this.#n[0].length===A){this.#o-=this.#n[0].length;return this.#n.shift()}const i=Buffer.allocUnsafe(A);let g=0;while(g!==A){const E=this.#n[0];const{length:p}=E;if(p+g===A){i.set(this.#n.shift(),g);break}else if(p+g>A){i.set(E.subarray(0,A-g),g);this.#n[0]=E.subarray(A-g);break}else{i.set(this.#n.shift(),g);g+=E.length}}this.#o-=A;return i}parseCloseBody(A){p(A.length!==1);let i;if(A.length>=2){i=A.readUInt16BE(0)}if(i!==undefined&&!S(i)){return{code:1002,Line truncated
|
var _=I(20181);var P=_.Buffer;function copyProps(i,B){for(var I in i){B[I]=i[I]}}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow){i.exports=_}else{copyProps(_,B);B.Buffer=SafeBuffer}function SafeBuffer(i,B,I){return P(i,B,I)}SafeBuffer.prototype=Object.create(P.prototype);copyProps(P,SafeBuffer);SafeBuffer.from=function(i,B,I){if(typeof i==="number"){throw new TypeError("Argument must not be a number")}return P(i,B,I)};SafeBuffer.alloc=function(i,B,I){if(typeof i!=="number"){throw new TypeError("Argument must be a number")}var _=P(i);if(B!==undefined){if(typeof I==="string"){_.fill(B,I)}else{_.fill(B)}}else{_.fill(0)}return _};SafeBuffer.allocUnsafe=function(i){if(typeof i!=="number"){throw new TypeError("Argument must be a number")}return P(i)};SafeBuffer.allocUnsafeSlow=function(i){if(typeof i!=="number"){throw new TypeError("Argument must be a number")}return _.SlowBuffer(i)}},89546:(i,B,I)=>{var _;_={value:true};const P=I(11354);const M=I(87016);const U=I(24434);const H=I(2830);const j=I(43106);const V=I(34922);const Y=I(39023);const z=I(79896);const X=I(99557);const re=I(16928);function _interopDefaultLegacy(i){return i&&typeof i==="object"&&"default"in i?i:{default:i}}const se=_interopDefaultLegacy(P);const oe=_interopDefaultLegacy(M);const ae=_interopDefaultLegacy(H);const Ae=_interopDefaultLegacy(j);const ue=_interopDefaultLegacy(V);const de=_interopDefaultLegacy(Y);const pe=_interopDefaultLegacy(z);const he=_interopDefaultLegacy(X);const fe=_interopDefaultLegacy(re);const Ee=ae["default"]("screepsapi:socket");const Be={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends U.EventEmitter{constructor(i){super();this.api=i;this.opts=Object.assign({},Be);this.on("error",(()=>{}));this.reset();this.on("auth",(i=>{if(i.data.status==="ok"){while(this.__queue.length){this.emit(this.__queue.shift())}clearInterval(this.keepAliveInter);if(this.opts.keepAlive){this.keepAliveInter=setInterval((()=>this.ws&&this.ws.ping(1)),1e4)}}}))}reset(){this.authed=false;this.connected=false;this.reconnecting=false;clearInterval(this.keepAliveInter);this.keepAliveInter=0;this.__queue=[];this.__subQueue=[];this.__subs={}}async connect(i={}){Object.assign(this.opts,i);if(!this.api.token){throw new Error("No token! Call api.auth() before connecting the socket!")}return new Promise(((i,B)=>{const I=this.api.opts.url.replace("http","ws");const _=new M.URL("socket/websocket",I);this.ws=new se["default"](_);this.ws.on("open",(()=>{this.connected=true;this.reconnecting=false;if(this.opts.resubscribe){this.__subQueue.push(...Object.keys(this.__subs))}Ee("connected");this.emit("connected");i(this.auth(this.api.token))}));this.ws.on("close",(()=>{clearInterval(this.keepAliveInter);this.authed=false;this.connected=false;Ee("disconnected");this.emit("disconnected");if(this.opts.reconnect){this.reconnect().catch((()=>{}))}}));this.ws.on("error",(i=>{this.ws.terminate();this.emit("error",i);Ee(`error ${i}`);if(!this.connected){B(i)}}));this.ws.on("unexpected-response",((i,I)=>{const _=new Error(`WS Unexpected Response: ${I.statusCode} ${I.statusMessage}`);this.emit("error",_);B(_)}));this.ws.on("message",(i=>this.handleMessage(i)))}))}async reconnect(){if(this.reconnecting){return}this.reconnecting=true;let i=0;let B;do{let I=Math.pow(2,i)*100;if(I>this.opts.maxRetryDelay)I=this.opts.maxRetryDelay;await this.sleep(I);if(!this.reconnecting)return;try{await this.connect();B=false}catch(i){B=true}i++;Ee(`reconnect ${i}/${this.opts.maxRetries}`)}while(B&&i<this.opts.maxRetries);if(B){const i=new Error(`Reconnection failed after ${this.opts.maxRetries} retries`);this.reconnecting=false;Ee("reconnect failed");this.emit("error",i);throw i}else{Object.keys(this.__subs).forEach((i=>this.subscribe(i)))}}disconnect(){Ee("disconnect");clearInterval(this.keepAliveInter);this.ws.removeAllListeners();this.ws.terminate();this.reset();this.emit("disconnected")}sleep(i){return new Promise(((B,I)=>{setTimeout(B,i)}))}handleMessage(i){i=i.data||i;if(i.slice(0,3)==="gz:"){i=this.api.inflate(i)}Ee(`message ${i}`);if(i[0]==="["){i=JSON.parse(i);let[,B,I,_]=i[0].match(/^(.+):(.+?)(?:\/(.+))?$/);_=_||B;const P={channel:_,id:I,type:B,data:i[1]};this.emit(i[0],P);this.emit(P.channel,P);this.emit("message",P)}else{const[B,...I]=i.split(" ");const _={type:"server",channel:B,data:I};if(B==="auth"){_.data={status:I[0],token:I[1]}}if(["protocol","time","package"].includes(B)){_.data={[B]:I[0]}}this.emit(B,_);this.emit("message",_)}}async gzip(i){this.send(`gzip ${i?"on":"off"}`)}async send(i){if(!this.connected){this.__queue.push(i)}else{this.ws.send(i)}}auth(i){return new Promise(((B,I)=>{this.send(`auth ${i}`);this.once("auth",(i=>{const{data:_}=i;if(_.status==="ok"){this.authed=true;this.emit("token",_.token);this.emit("authed");while(this.__subQueue.length){this.send(this.__subQueue.shift())}B()}else{I(new Error("socket auth failed"))}}))}))}async subscribe(i,B){if(!i)return;const I=await this.api.userID();if(!Line truncated
|
||||||
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=i=>i.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=i=>i.replace(/\r?\n|\r/g,"\r\n");const _=[];const P=new Uint8Array([13,10]);Y=0;let M=false;for(const[B,U]of i){if(typeof U==="string"){const i=Ee.encode(I+`; name="${escape(normalizeLinefeeds(B))}"`+`\r\n\r\n${normalizeLinefeeds(U)}\r\n`);_.push(i);Y+=i.byteLength}else{const i=Ee.encode(`${I}; name="${escape(normalizeLinefeeds(B))}"`+(U.name?`; filename="${escape(U.name)}"`:"")+"\r\n"+`Content-Type: ${U.type||"application/octet-stream"}\r\n\r\n`);_.push(i,U,P);if(typeof U.size==="number"){Y+=i.byteLength+U.size+P.byteLength}else{M=true}}}const U=Ee.encode(`--${B}--\r\n`);_.push(U);Y+=U.byteLength;if(M){Y=null}V=i;j=async function*(){for(const i of _){if(i.stream){yield*i.stream()}else{yield i}}};z=`multipart/form-data; boundary=${B}`}else if(M(i)){V=i;Y=i.size;if(i.type){z=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(B){throw new TypeError("keepalive")}if(_.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}I=i instanceof ReadableStream?i:P(i)}if(typeof V==="string"||_.isBuffer(V)){Y=Buffer.byteLength(V)}if(j!=null){let B;I=new ReadableStream({async start(){B=j(i)[Symbol.asyncIterator]()},async pull(i){const{value:_,done:P}=await B.next();if(P){queueMicrotask((()=>{i.close();i.byobRequest?.respond(0)}))}else{if(!Ae(I)){const B=new Uint8Array(_);if(B.byteLength){i.enqueue(B)}}}return i.desiredSize>0},async cancel(i){await B.return()},type:"bytes"})}const X={stream:I,source:V,length:Y};return[X,z]}function safelyExtractBody(i,B=false){if(i instanceof ReadableStream){ae(!_.isDisturbed(i),"The body has already been consumed.");ae(!i.locked,"The stream is locked.")}return extractBody(i,B)}function cloneBody(i,B){const[I,_]=B.stream.tee();B.stream=I;return{stream:_,length:B.length,source:B.source}}function throwIfAborted(i){if(i.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const B={blob(){return consumeBody(this,(i=>{let B=bodyMimeType(this);if(B===null){B=""}else if(B){B=pe(B)}return new oe([i],{type:B})}),i)},arrayBuffer(){return consumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return consumeBody(this,z,i)},json(){return consumeBody(this,parseJSONFromBytes,i)},formData(){return consumeBody(this,(i=>{const B=bodyMimeType(this);if(B!==null){switch(B.essence){case"multipart/form-data":{const I=he(i,B);if(I==="failure"){throw new TypeError("Failed to parse body as FormData.")}const _=new X;_[re]=I;return _}case"application/x-www-form-urlencoded":{const B=new URLSearchParams(i.toString());const I=new X;for(const[i,_]of B){I.append(i,_)}return I}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),i)},bytes(){return consumeBody(this,(i=>new Uint8Array(i)),i)}};return B}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function consumeBody(i,B,I){se.brandCheck(i,I);if(bodyUnusable(i)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(i[re]);const _=j();const errorSteps=i=>_.reject(i);const successSteps=i=>{try{_.resolve(B(i))}catch(i){errorSteps(i)}};if(i[re].body==null){successSteps(Buffer.allocUnsafe(0));return _.promise}await V(i[re].body,successSteps,errorSteps);return _.promise}function bodyUnusable(i){const B=i[re].body;return B!=null&&(B.stream.locked||_.isDisturbed(B.stream))}function parseJSONFromBytes(i){return JSON.parse(z(i))}function bodyMimeType(i){const B=i[re].headersList;const I=Y(B);if(I==="failure"){return null}return I}i.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:Ie,hasFinalizationRegistry:Be,bodyUnusable:bodyUnusable}},4495:i=>{const B=["GET","HEAD","POST"];const I=new Set(B);const _=[101,204,205,304];const P=[301,302,303,307,308];const M=new Set(P);const U=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const H=new Set(U);const j=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const V=new Set(j);const Y=["follow","manual","error"];const z=["GET","HEAD","OPTIONS","TRACE"];const X=new Set(z);const re=["navigate","same-origin","no-cors","cors"];const se=["omit","same-origin","include"];const oe=["default","no-store","reloadLine truncated
|
||||||
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */H[U-4]=I[0];H[U-3]=I[1];H[U-2]=I[2];H[U-1]=I[3];H[1]=M;if(M===126){H.writeUInt16BE(P,2)}else if(M===127){H[2]=H[3]=0;H.writeUIntBE(P,4,6)}H[1]|=128;for(let i=0;i<P;++i){H[U+i]=B[i]^I[i&3]}return H}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},19469:(i,B,I)=>{const{createInflateRaw:_,Z_DEFAULT_WINDOWBITS:P}=I(38522);const{isValidClientWindowBits:M}=I(98625);const U=Buffer.from([0,0,255,255]);const H=Symbol("kBuffer");const j=Symbol("kLength");class PerMessageDeflate{#ie;#x={};constructor(i){this.#x.serverNoContextTakeover=i.has("server_no_context_takeover");this.#x.serverMaxWindowBits=i.get("server_max_window_bits")}decompress(i,B,I){if(!this.#ie){let i=P;if(this.#x.serverMaxWindowBits){if(!M(this.#x.serverMaxWindowBits)){I(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#x.serverMaxWindowBits)}this.#ie=_({windowBits:i});this.#ie[H]=[];this.#ie[j]=0;this.#ie.on("data",(i=>{this.#ie[H].push(i);this.#ie[j]+=i.length}));this.#ie.on("error",(i=>{this.#ie=null;I(i)}))}this.#ie.write(i);if(B){this.#ie.write(U)}this.#ie.flush((()=>{const i=Buffer.concat(this.#ie[H],this.#ie[j]);this.#ie[H].length=0;this.#ie[j]=0;I(null,i)}))}}i.exports={PerMessageDeflate:PerMessageDeflate}},81652:(i,B,I)=>{const{Writable:_}=I(57075);const P=I(34589);const{parserStates:M,opcodes:U,states:H,emptyBuffer:j,sentCloseFrameState:V}=I(20736);const{kReadyState:Y,kSentClose:z,kResponse:X,kReceivedClose:re}=I(61216);const{channels:se}=I(42414);const{isValidStatusCode:oe,isValidOpcode:ae,failWebsocketConnection:Ae,websocketMessageReceived:ue,utf8Decode:de,isControlFrame:pe,isTextBinaryFrame:he,isContinuationFrame:fe}=I(98625);const{WebsocketFrameSend:Ee}=I(3264);const{closeWebSocketConnection:Be}=I(86897);const{PerMessageDeflate:Ie}=I(19469);class ByteParser extends _{#o=[];#a=0;#se=false;#c=M.INFO;#A={};#l=[];#h;constructor(i,B){super();this.ws=i;this.#h=B==null?new Map:B;if(this.#h.has("permessage-deflate")){this.#h.set("permessage-deflate",new Ie(B))}}_write(i,B,I){this.#o.push(i);this.#a+=i.length;this.#se=true;this.run(I)}run(i){while(this.#se){if(this.#c===M.INFO){if(this.#a<2){return i()}const B=this.consume(2);const I=(B[0]&128)!==0;const _=B[0]&15;const P=(B[1]&128)===128;const H=!I&&_!==U.CONTINUATION;const j=B[1]&127;const V=B[0]&64;const Y=B[0]&32;const z=B[0]&16;if(!ae(_)){Ae(this.ws,"Invalid opcode received");return i()}if(P){Ae(this.ws,"Frame cannot be masked");return i()}if(V!==0&&!this.#h.has("permessage-deflate")){Ae(this.ws,"Expected RSV1 to be clear.");return}if(Y!==0||z!==0){Ae(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(H&&!he(_)){Ae(this.ws,"Invalid frame type was fragmented.");return}if(he(_)&&this.#l.length>0){Ae(this.ws,"Expected continuation frame");return}if(this.#A.fragmented&&H){Ae(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((j>125||H)&&pe(_)){Ae(this.ws,"Control frame either too large or fragmented");return}if(fe(_)&&this.#l.length===0&&!this.#A.compressed){Ae(this.ws,"Unexpected continuation frame");return}if(j<=125){this.#A.payloadLength=j;this.#c=M.READ_DATA}else if(j===126){this.#c=M.PAYLOADLENGTH_16}else if(j===127){this.#c=M.PAYLOADLENGTH_64}if(he(_)){this.#A.binaryType=_;this.#A.compressed=V!==0}this.#A.opcode=_;this.#A.masked=P;this.#A.fin=I;this.#A.fragmented=H}else if(this.#c===M.PAYLOADLENGTH_16){if(this.#a<2){return i()}const B=this.consume(2);this.#A.payloadLength=B.readUInt16BE(0);this.#c=M.READ_DATA}else if(this.#c===M.PAYLOADLENGTH_64){if(this.#a<8){return i()}const B=this.consume(8);const I=B.readUInt32BE(0);if(I>2**31-1){Ae(this.ws,"Received payload length > 2^31 bytes.");return}const _=B.readUInt32BE(4);this.#A.payloadLength=(I<<8)+_;this.#c=M.READ_DATA}else if(this.#c===M.READ_DATA){if(this.#a<this.#A.payloadLength){return i()}const B=this.consume(this.#A.payloadLength);if(pe(this.#A.opcode)){this.#se=this.parseControlFrame(B);this.#c=M.INFO}else{if(!this.#A.compressed){this.#l.push(B);if(!this.#A.fragmented&&this.#A.fin){const i=Buffer.concat(this.#l);ue(this.ws,this.#A.binaryType,i);this.#l.length=0}this.#c=M.INFO}else{this.#h.get("permessage-deflate").decompress(B,this.#A.fin,((B,I)=>{if(B){Be(this.ws,1007,B.message,B.message.length);return}this.#l.push(I);if(!this.#A.fin){this.#c=M.INFO;this.#se=true;this.run(i);return}ue(this.ws,this.#A.binaryType,Buffer.concat(this.#l));this.#se=true;this.#c=M.INFO;this.#l.length=0;this.run(i)}));this.#se=false;break}}}}}consume(i){if(i>this.#a){throw new Error("Called consume() before buffers satiated.")}else if(i===0){return j}if(this.#o[0].length===i){this.#a-=this.#o[0].length;return this.#o.shift()}const B=Buffer.allocUnsafe(i);let I=0;while(I!==i){const _=this.#o[0];const{length:P}=_;if(P+I===i){B.set(this.#o.shift(),I);break}else if(P+I>i){B.set(_.subarray(0,i-I),I);this.#o[0]=_.subarray(i-I);break}else{B.set(this.#o.shift(),I);I+=_.length}}this.#a-=i;return B}parseCloseBody(i){P(i.length!==1);let B;if(i.length>=2){B=i.readUInt16BLine truncated
|
||||||
|
/**
|
||||||
|
* ZipStream
|
||||||
|
*
|
||||||
|
* @ignore
|
||||||
|
* @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
|
||||||
|
* @copyright (c) 2014 Chris Talkington, contributors.
|
||||||
|
*/
|
||||||
|
var _=I(39023).inherits;var P=I(47544).ZipArchiveOutputStream;var M=I(47544).ZipArchiveEntry;var U=I(53296);var H=i.exports=function(i){if(!(this instanceof H)){return new H(i)}i=this.options=i||{};i.zlib=i.zlib||{};P.call(this,i);if(typeof i.level==="number"&&i.level>=0){i.zlib.level=i.level;delete i.level}if(!i.forceZip64&&typeof i.zlib.level==="number"&&i.zlib.level===0){i.store=true}i.namePrependSlash=i.namePrependSlash||false;if(i.comment&&i.comment.length>0){this.setComment(i.comment)}};_(H,P);H.prototype._normalizeFileData=function(i){i=U.defaults(i,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var B=i.type==="directory";var I=i.type==="symlink";if(i.name){i.name=U.sanitizePath(i.name);if(!I&&i.name.slice(-1)==="/"){B=true;i.type="directory"}else if(B){i.name+="/"}}if(B||I){i.store=true}i.date=U.dateify(i.date);return i};H.prototype.entry=function(i,B,I){if(typeof I!=="function"){I=this._emitErrorCallback.bind(this)}B=this._normalizeFileData(B);if(B.type!=="file"&&B.type!=="directory"&&B.type!=="symlink"){I(new Error(B.type+" entries not currently supported"));return}if(typeof B.name!=="string"||B.name.length===0){I(new Error("entry name must be a non-empty string value"));return}if(B.type==="symlink"&&typeof B.linkname!=="string"){I(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var _=new M(B.name);_.setTime(B.date,this.options.forceLocalTime);if(B.namePrependSlash){_.setName(B.name,true)}if(B.store){_.setMethod(0)}if(B.comment.length>0){_.setComment(B.comment)}if(B.type==="symlink"&&typeof B.mode!=="number"){B.mode=40960}if(typeof B.mode==="number"){if(B.type==="symlink"){B.mode|=40960}_.setUnixMode(B.mode)}if(B.type==="symlink"&&typeof B.linkname==="string"){i=Buffer.from(B.linkname)}return P.prototype.entry.call(this,_,i,I)};H.prototype.finalize=function(){this.finish()}},42613:B=>{B.exports=i(import.meta.url)("assert")},90290:B=>{B.exports=i(import.meta.url)("async_hooks")},20181:B=>{B.exports=i(import.meta.url)("buffer")},77969:B=>{B.exports=i(import.meta.url)("bufferutil")},35317:B=>{B.exports=i(import.meta.url)("child_process")},64236:B=>{B.exports=i(import.meta.url)("console")},49140:B=>{B.exports=i(import.meta.url)("constants")},76982:B=>{B.exports=i(import.meta.url)("crypto")},31637:B=>{B.exports=i(import.meta.url)("diagnostics_channel")},24434:B=>{B.exports=i(import.meta.url)("events")},79896:B=>{B.exports=i(import.meta.url)("fs")},91943:B=>{B.exports=i(import.meta.url)("fs/promises")},58611:B=>{B.exports=i(import.meta.url)("http")},85675:B=>{B.exports=i(import.meta.url)("http2")},65692:B=>{B.exports=i(import.meta.url)("https")},69278:B=>{B.exports=i(import.meta.url)("net")},34589:B=>{B.exports=i(import.meta.url)("node:assert")},16698:B=>{B.exports=i(import.meta.url)("node:async_hooks")},4573:B=>{B.exports=i(import.meta.url)("node:buffer")},37540:B=>{B.exports=i(import.meta.url)("node:console")},77598:B=>{B.exports=i(import.meta.url)("node:crypto")},53053:B=>{B.exports=i(import.meta.url)("node:diagnostics_channel")},40610:B=>{B.exports=i(import.meta.url)("node:dns")},78474:B=>{B.exports=i(import.meta.url)("node:events")},73024:B=>{B.exports=i(import.meta.url)("node:fs")},51455:B=>{B.exports=i(import.meta.url)("node:fs/promises")},37067:B=>{B.exports=i(import.meta.url)("node:http")},32467:B=>{B.exports=i(import.meta.url)("node:http2")},44708:B=>{B.exports=i(import.meta.url)("node:https")},77030:B=>{B.exports=i(import.meta.url)("node:net")},48161:B=>{B.exports=i(import.meta.url)("node:os")},76760:B=>{B.exports=i(import.meta.url)("node:path")},643:B=>{B.exports=i(import.meta.url)("node:perf_hooks")},1708:B=>{B.exports=i(import.meta.url)("node:process")},41792:B=>{B.exports=i(import.meta.url)("node:querystring")},57075:B=>{B.exports=i(import.meta.url)("node:stream")},46193:B=>{B.exports=i(import.meta.url)("node:string_decoder")},41692:B=>{B.exports=i(import.meta.url)("node:tls")},73136:B=>{B.exports=i(import.meta.url)("node:url")},57975:B=>{B.exports=i(import.meta.url)("node:util")},73429:B=>{B.exports=i(import.meta.url)("node:util/types")},75919:B=>{B.exports=i(import.meta.url)("node:worker_threads")},38522:B=>{B.exports=i(import.meta.url)("node:zlib")},70857:B=>{B.exports=i(import.meta.url)("os")},16928:B=>{B.exports=i(import.meta.url)("path")},82987:B=>{B.exports=i(import.meta.url)("perf_hooks")},83480:B=>{B.exports=i(import.meta.url)("querystring")},2203:B=>{B.exports=i(import.meta.url)("stream")},63774:B=>{B.exports=i(import.meta.url)("stream/web")},13193:B=>{B.exports=i(import.meta.url)("string_decoder")},53557:B=>{B.exports=i(import.meta.url)("timers")},64756:B=>{B.exports=i(import.meta.url)("tls")},52018:B=>{B.exports=i(import.meta.url)("tty")},87016:B=>{B.exports=i(import.meta.url)("url")},47258:B=>{B.exports=i(import.meta.url)("utf-8-validate")},39023:B=>{B.exports=i(import.meta.url)("util")},98253:B=>{B.exports=i(import.meta.url)("util/typeLine truncated
|
||||||
Generated
+1805
-54
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
"build": "ncc build index.js -o dist -m --external utf-8-validate --external bufferutil"
|
"build": "ncc build index.js -o dist -m --external utf-8-validate --external bufferutil"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^1.1.2",
|
"@actions/artifact": "^5.0.0",
|
||||||
"@actions/core": "^3.0.0",
|
"@actions/core": "^3.0.0",
|
||||||
"glob": "^13.0.0",
|
"glob": "^13.0.0",
|
||||||
"screeps-api": "^1.7.2"
|
"screeps-api": "^1.7.2"
|
||||||
|
|||||||
Reference in new issue
Block a user