|
|
|
@@ -1,18 +1,18 @@
|
|
|
|
|
import{createRequire as A}from"module";var i={7038:(A,i,g)=>{var f;f={value:true};i.v=void 0;const p=g(918);function create(){return p.DefaultArtifactClient.create()}i.v=create},918:function(A,i,g){var f=this&&this.__createBinding||(Object.create?function(A,i,g,f){if(f===undefined)f=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,f,p)}:function(A,i,g,f){if(f===undefined)f=g;A[f]=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 E=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))f(i,A,g);p(i,A);return i};var C=this&&this.__awaiter||function(A,i,g,f){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(f.next(A))}catch(A){p(A)}}function rejected(A){try{step(f["throw"](A))}catch(A){p(A)}}function step(A){A.done?g(A.value):adopt(A.value).then(fulfilled,rejected)}step((f=f.apply(A,i||[])).next())})};Object.defineProperty(i,"__esModule",{value:true});i.DefaultArtifactClient=void 0;const B=E(g(9910));const Q=g(9367);const I=g(8950);const y=g(2669);const b=g(9400);const k=g(3439);const D=g(3886);const R=g(1124);const S=g(6928);class DefaultArtifactClient{static create(){return new DefaultArtifactClient}uploadArtifact(A,i,g,f){return C(this,void 0,void 0,function*(){B.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,Q.getUploadSpecification)(A,g,i);const E={artifactName:A,artifactItems:[],size:0,failedItems:[]};const C=new I.UploadHttpClient;if(p.length===0){B.warning(`No files found that can be uploaded`)}else{const i=yield C.createArtifactInFileContainer(A,f);if(!i.fileContainerResourceUrl){B.debug(i.toString());throw new Error("No URL provided by the Artifact Service to upload an artifact to")}B.debug(`Upload Resource URL: ${i.fileContainerResourceUrl}`);B.info(`Container for artifact "${A}" successfully created. Starting upload of file(s)`);const g=yield C.uploadArtifactToFileContainer(i.fileContainerResourceUrl,p,f);B.info(`File upload process has finished. Finalizing the artifact upload`);yield C.patchArtifactSize(g.totalSize,A);if(g.failedItems.length>0){B.info(`Upload finished. There were ${g.failedItems.length} items that failed to upload`)}else{B.info(`Artifact has been finalized. All files have been successfully uploaded!`)}B.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`);E.artifactItems=p.map(A=>A.absoluteFilePath);E.size=g.uploadSize;E.failedItems=g.failedItems}return E})}downloadArtifact(A,i,g){return C(this,void 0,void 0,function*(){const f=new k.DownloadHttpClient;const p=yield f.listArtifacts();if(p.count===0){throw new Error(`Unable to find any artifacts for the associated workflow`)}const E=p.value.find(i=>i.name===A);if(!E){throw new Error(`Unable to find an artifact with the name: ${A}`)}const C=yield f.getContainerItems(E.name,E.fileContainerResourceUrl);if(!i){i=(0,R.getWorkSpaceDirectory)()}i=(0,S.normalize)(i);i=(0,S.resolve)(i);const Q=(0,D.getDownloadSpecification)(A,C.value,i,(g===null||g===void 0?void 0:g.createArtifactFolder)||false);if(Q.filesToDownload.length===0){B.info(`No downloadable files were found for the artifact: ${E.name}`)}else{yield(0,y.createDirectoriesForArtifact)(Q.directoryStructure);B.info("Directory structure has been set up for the artifact");yield(0,y.createEmptyFilesForArtifact)(Q.emptyFilesToCreate);yield f.downloadSingleArtifact(Q.filesToDownload)}return{artifactName:A,downloadPath:Q.rootDownloadLocation}})}downloadAllArtifacts(A){return C(this,void 0,void 0,function*(){const i=new k.DownloadHttpClient;const g=[];const f=yield i.listArtifacts();if(f.count===0){B.info("Unable to find any artifacts for the associated workflow");return g}if(!A){A=(0,R.getWorkSpaceDirectory)()}A=(0,S.normalize)(A);A=(0,S.resolve)(A);let p=0;while(p<f.count){const E=f.value[p];p+=1;B.info(`starting download of artifact ${E.name} : ${p}/${f.count}`);const C=yield i.getContainerItems(E.name,E.fileContainerResourceUrl);const Q=(0,D.getDownloadSpecification)(E.name,C.value,A,true);if(Q.filesToDownload.length===0){B.info(`No downloa
Line truncated
|
|
|
|
|
import{createRequire as t}from"module";var A={7038:(t,A,u)=>{var d;d={value:true};A.v=void 0;const E=u(918);function create(){return E.DefaultArtifactClient.create()}A.v=create},918:function(t,A,u){var d=this&&this.__createBinding||(Object.create?function(t,A,u,d){if(d===undefined)d=u;var E=Object.getOwnPropertyDescriptor(A,u);if(!E||("get"in E?!A.__esModule:E.writable||E.configurable)){E={enumerable:true,get:function(){return A[u]}}}Object.defineProperty(t,d,E)}:function(t,A,u,d){if(d===undefined)d=u;t[d]=A[u]});var E=this&&this.__setModuleDefault||(Object.create?function(t,A){Object.defineProperty(t,"default",{enumerable:true,value:A})}:function(t,A){t["default"]=A});var C=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var A={};if(t!=null)for(var u in t)if(u!=="default"&&Object.prototype.hasOwnProperty.call(t,u))d(A,t,u);E(A,t);return A};var Q=this&&this.__awaiter||function(t,A,u,d){function adopt(t){return t instanceof u?t:new u(function(A){A(t)})}return new(u||(u=Promise))(function(u,E){function fulfilled(t){try{step(d.next(t))}catch(t){E(t)}}function rejected(t){try{step(d["throw"](t))}catch(t){E(t)}}function step(t){t.done?u(t.value):adopt(t.value).then(fulfilled,rejected)}step((d=d.apply(t,A||[])).next())})};Object.defineProperty(A,"__esModule",{value:true});A.DefaultArtifactClient=void 0;const B=C(u(9910));const I=u(9367);const m=u(8950);const y=u(2669);const b=u(9400);const D=u(3439);const R=u(3886);const k=u(1124);const S=u(6928);class DefaultArtifactClient{static create(){return new DefaultArtifactClient}uploadArtifact(t,A,u,d){return Q(this,void 0,void 0,function*(){B.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)(t);const E=(0,I.getUploadSpecification)(t,u,A);const C={artifactName:t,artifactItems:[],size:0,failedItems:[]};const Q=new m.UploadHttpClient;if(E.length===0){B.warning(`No files found that can be uploaded`)}else{const A=yield Q.createArtifactInFileContainer(t,d);if(!A.fileContainerResourceUrl){B.debug(A.toString());throw new Error("No URL provided by the Artifact Service to upload an artifact to")}B.debug(`Upload Resource URL: ${A.fileContainerResourceUrl}`);B.info(`Container for artifact "${t}" successfully created. Starting upload of file(s)`);const u=yield Q.uploadArtifactToFileContainer(A.fileContainerResourceUrl,E,d);B.info(`File upload process has finished. Finalizing the artifact upload`);yield Q.patchArtifactSize(u.totalSize,t);if(u.failedItems.length>0){B.info(`Upload finished. There were ${u.failedItems.length} items that failed to upload`)}else{B.info(`Artifact has been finalized. All files have been successfully uploaded!`)}B.info(`\nThe raw size of all the files that were specified for upload is ${u.totalSize} bytes\nThe size of all the files that were uploaded is ${u.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=E.map(t=>t.absoluteFilePath);C.size=u.uploadSize;C.failedItems=u.failedItems}return C})}downloadArtifact(t,A,u){return Q(this,void 0,void 0,function*(){const d=new D.DownloadHttpClient;const E=yield d.listArtifacts();if(E.count===0){throw new Error(`Unable to find any artifacts for the associated workflow`)}const C=E.value.find(A=>A.name===t);if(!C){throw new Error(`Unable to find an artifact with the name: ${t}`)}const Q=yield d.getContainerItems(C.name,C.fileContainerResourceUrl);if(!A){A=(0,k.getWorkSpaceDirectory)()}A=(0,S.normalize)(A);A=(0,S.resolve)(A);const I=(0,R.getDownloadSpecification)(t,Q.value,A,(u===null||u===void 0?void 0:u.createArtifactFolder)||false);if(I.filesToDownload.length===0){B.info(`No downloadable files were found for the artifact: ${C.name}`)}else{yield(0,y.createDirectoriesForArtifact)(I.directoryStructure);B.info("Directory structure has been set up for the artifact");yield(0,y.createEmptyFilesForArtifact)(I.emptyFilesToCreate);yield d.downloadSingleArtifact(I.filesToDownload)}return{artifactName:t,downloadPath:I.rootDownloadLocation}})}downloadAllArtifacts(t){return Q(this,void 0,void 0,function*(){const A=new D.DownloadHttpClient;const u=[];const d=yield A.listArtifacts();if(d.count===0){B.info("Unable to find any artifacts for the associated workflow");return u}if(!t){t=(0,k.getWorkSpaceDirectory)()}t=(0,S.normalize)(t);t=(0,S.resolve)(t);let E=0;while(E<d.count){const C=d.value[E];E+=1;B.info(`starting download of artifact ${C.name} : ${E}/${d.count}`);const Q=yield A.getContainerItems(C.name,C.fileContainerResourceUrl);const I=(0,R.getDownloadSpecification)(C.name,Q.value,t,true);if(I.filesToDownload.length===0){B.info(`No downloa
Line truncated
|
|
|
|
|
/*!
|
|
|
|
|
* mime-db
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
A.exports=g(7080)},3674:(A,i,g)=>{
|
|
|
|
|
t.exports=u(7080)},3674:(t,A,u)=>{
|
|
|
|
|
/*!
|
|
|
|
|
* mime-types
|
|
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
var f=g(8975);var p=g(6928).extname;var E=/^\s*([^;\s]*)(?:;|\s|$)/;var C=/^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=E.exec(A);var g=i&&f[i[1].toLowerCase()];if(g&&g.charset){return g.charset}if(i&&C.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 f=i.charset(g);if(f)g+="; charset="+f.toLowerCase()}return g}function extension(A){if(!A||typeof A!=="string"){return false}var g=E.exec(A);var f=g&&i.extensions[g[1].toLowerCase()];if(!f||!f.length){return false}return f[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(f).forEach(function forEachMimeType(p){var E=f[p];var C=E.extensions;if(!C||!C.length){return}A[p]=C;for(var B=0;B<C.length;B++){var Q=C[B];if(i[Q]){var I=g.indexOf(f[i[Q]].source);var y=g.indexOf(E.source);if(i[Q]!=="application/octet-stream"&&(I>y||I===y&&i[Q].substr(0,12)==="application/")){continue}}i[Q]=p}})}},4023:A=>{var i=1e3;var g=i*60;var f=g*60;var p=f*24;var E=p*7;var C=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 B=/^(-?(?:\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(!B){return}var Q=parseFloat(B[1]);var I=(B[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return Q*C;case"weeks":case"week":case"w":return Q*E;case"days":case"day":case"d":return Q*p;case"hours":case"hour":case"hrs":case"hr":case"h":return Q*f;case"minutes":case"minute":case"mins":case"min":case"m":return Q*g;case"seconds":case"second":case"secs":case"sec":case"s":return Q*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return Q;default:return undefined}}function fmtShort(A){var E=Math.abs(A);if(E>=p){return Math.round(A/p)+"d"}if(E>=f){return Math.round(A/f)+"h"}if(E>=g){return Math.round(A/g)+"m"}if(E>=i){return Math.round(A/i)+"s"}return A+"ms"}function fmtLong(A){var E=Math.abs(A);if(E>=p){return plural(A,E,p,"day")}if(E>=f){return plural(A,E,f,"hour")}if(E>=g){return plural(A,E,g,"minute")}if(E>=i){return plural(A,E,i,"second")}return A+" ms"}function plural(A,i,g,f){var p=i>=g*1.5;return Math.round(A/g)+" "+f+(p?"s":"")}},6916:(A,i,g)=>{const f=g(857);const p=g(2018);const E=g(2219);const{env:C}=process;let B;if(E("no-color")||E("no-colors")||E("color=false")||E("color=never")){B=0}else if(E("color")||E("colors")||E("color=true")||E("color=always")){B=1}if("FORCE_COLOR"in C){if(C.FORCE_COLOR==="true"){B=1}else if(C.FORCE_COLOR==="false"){B=0}else{B=C.FORCE_COLOR.length===0?1:Math.min(parseInt(C.FORCE_COLOR,10),3)}}function translateLevel(A){if(A===0){return false}return{level:A,hasBasic:true,has256:A>=2,has16m:A>=3}}function supportsColor(A,i){if(B===0){return 0}if(E("color=16m")||E("color=full")||E("color=truecolor")){return 3}if(E("color=256")){return 2}if(A&&!i&&B===undefined){return 0}const g=B||0;if(C.TERM==="dumb"){return g}if(process.platform==="win32"){const A=f.release().split(".");if(Number(A[0])>=10&&Number(A[2])>=10586){return Number(A[2])>=14931?3:2}return 1}if("CI"in C){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(A=>A in C)||C.CI_NAME==="codeship"){return 1}return g}if("TEAMCITY_VERSION"in C){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(C.TEAMCITY_VERSION)?1:0}if(C.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in C){const A=parseInt((C.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(C.TERM_PROGRAM){case"iTerm.app":return A>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(C.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(C.TERM)){return 1}if("COLORTERM"in C){return 1}return g}function getSupportLevel(A){const i=supportsColor(A,A&&A.isTTY);return translateLevel(i)}A.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,p.isatty(1))),stderr:translateLevel(supportsColor(true,p.isatty(2)))}},9229:(A,i,g)=>{const{promisify:f}=g(9023);const p=g(3125);A.exports.fileSync=p.fileSync;const E=f((A,i)=>p.file(A,(A,g,p,E)=>A?i(A):i(undefined,{path:g,fd:p,cleanup:f(E)})));A.exports.file=async A=>E(A);A.exports.withFile=async function withFile(i,g){const{path:f,fd:p,cleanup:E}=await A.exports.file(g);try{return await i(Line truncated
|
|
|
|
|
var d=u(8975);var E=u(6928).extname;var C=/^\s*([^;\s]*)(?:;|\s|$)/;var Q=/^text\//i;A.charset=charset;A.charsets={lookup:charset};A.contentType=contentType;A.extension=extension;A.extensions=Object.create(null);A.lookup=lookup;A.types=Object.create(null);populateMaps(A.extensions,A.types);function charset(t){if(!t||typeof t!=="string"){return false}var A=C.exec(t);var u=A&&d[A[1].toLowerCase()];if(u&&u.charset){return u.charset}if(A&&Q.test(A[1])){return"UTF-8"}return false}function contentType(t){if(!t||typeof t!=="string"){return false}var u=t.indexOf("/")===-1?A.lookup(t):t;if(!u){return false}if(u.indexOf("charset")===-1){var d=A.charset(u);if(d)u+="; charset="+d.toLowerCase()}return u}function extension(t){if(!t||typeof t!=="string"){return false}var u=C.exec(t);var d=u&&A.extensions[u[1].toLowerCase()];if(!d||!d.length){return false}return d[0]}function lookup(t){if(!t||typeof t!=="string"){return false}var u=E("x."+t).toLowerCase().substr(1);if(!u){return false}return A.types[u]||false}function populateMaps(t,A){var u=["nginx","apache",undefined,"iana"];Object.keys(d).forEach(function forEachMimeType(E){var C=d[E];var Q=C.extensions;if(!Q||!Q.length){return}t[E]=Q;for(var B=0;B<Q.length;B++){var I=Q[B];if(A[I]){var m=u.indexOf(d[A[I]].source);var y=u.indexOf(C.source);if(A[I]!=="application/octet-stream"&&(m>y||m===y&&A[I].substr(0,12)==="application/")){continue}}A[I]=E}})}},4023:t=>{var A=1e3;var u=A*60;var d=u*60;var E=d*24;var C=E*7;var Q=E*365.25;t.exports=function(t,A){A=A||{};var u=typeof t;if(u==="string"&&t.length>0){return parse(t)}else if(u==="number"&&isFinite(t)){return A.long?fmtLong(t):fmtShort(t)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function parse(t){t=String(t);if(t.length>100){return}var B=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!B){return}var I=parseFloat(B[1]);var m=(B[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return I*Q;case"weeks":case"week":case"w":return I*C;case"days":case"day":case"d":return I*E;case"hours":case"hour":case"hrs":case"hr":case"h":return I*d;case"minutes":case"minute":case"mins":case"min":case"m":return I*u;case"seconds":case"second":case"secs":case"sec":case"s":return I*A;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return I;default:return undefined}}function fmtShort(t){var C=Math.abs(t);if(C>=E){return Math.round(t/E)+"d"}if(C>=d){return Math.round(t/d)+"h"}if(C>=u){return Math.round(t/u)+"m"}if(C>=A){return Math.round(t/A)+"s"}return t+"ms"}function fmtLong(t){var C=Math.abs(t);if(C>=E){return plural(t,C,E,"day")}if(C>=d){return plural(t,C,d,"hour")}if(C>=u){return plural(t,C,u,"minute")}if(C>=A){return plural(t,C,A,"second")}return t+" ms"}function plural(t,A,u,d){var E=A>=u*1.5;return Math.round(t/u)+" "+d+(E?"s":"")}},4147:(t,A,u)=>{var d=u(7016).parse;var E={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var C=String.prototype.endsWith||function(t){return t.length<=this.length&&this.indexOf(t,this.length-t.length)!==-1};function getProxyForUrl(t){var A=typeof t==="string"?d(t):t||{};var u=A.protocol;var C=A.host;var Q=A.port;if(typeof C!=="string"||!C||typeof u!=="string"){return""}u=u.split(":",1)[0];C=C.replace(/:\d*$/,"");Q=parseInt(Q)||E[u]||0;if(!shouldProxy(C,Q)){return""}var B=getEnv("npm_config_"+u+"_proxy")||getEnv(u+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(B&&B.indexOf("://")===-1){B=u+"://"+B}return B}function shouldProxy(t,A){var u=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!u){return true}if(u==="*"){return false}return u.split(/[,\s]/).every(function(u){if(!u){return true}var d=u.match(/^(.+):(\d+)$/);var E=d?d[1]:u;var Q=d?parseInt(d[2]):0;if(Q&&Q!==A){return true}if(!/^[.*]/.test(E)){return t!==E}if(E.charAt(0)==="*"){E=E.slice(1)}return!C.call(t,E)})}function getEnv(t){return process.env[t.toLowerCase()]||process.env[t.toUpperCase()]||""}A.T=getProxyForUrl},4398:(t,A,u)=>{var d;d={value:true};const E=u(9105);const C=u(7016);const Q=u(4434);const B=u(1141);const I=u(3106);const m=u(6550);const y=u(9023);const b=u(9896);const D=u(7967);const R=u(6928);function _interopDefaultLegacy(t){return t&&typeof t==="object"&&"default"in t?t:{default:t}}const k=_interopDefaultLegacy(E);const S=_interopDefaultLegacy(C);const v=_interopDefaultLegacy(B);const x=_interopDefaultLegacy(I);const N=_interopDefaultLegacy(m);const L=_interopDefaultLegacy(y);const M=_interopDefaultLegacy(b);const T=_interopDefaultLegacy(D);const H=_interopDefaultLegacy(R);const G=v["default"]("screepsapi:socket");const Y={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends Q.EventEmitter{constructor(t){super();this.api=t;this.opts=Object.assign({},Y);this.on("error",()=>{});this.reset();this.on("auth",t=>{if(t.data.status==="ok"){while(this.__queue.length)Line truncated
|
|
|
|
|
/*!
|
|
|
|
|
* Tmp
|
|
|
|
|
*
|
|
|
|
@@ -20,8 +20,8 @@ var f=g(8975);var p=g(6928).extname;var E=/^\s*([^;\s]*)(?:;|\s|$)/;var C=/^text
|
|
|
|
|
*
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*/
|
|
|
|
|
const f=g(9896);const p=g(857);const E=g(6928);const C=g(6982);const B={fs:f.constants,os:p.constants};const Q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",I=/XXXXXX/,y=3,b=(B.O_CREAT||B.fs.O_CREAT)|(B.O_EXCL||B.fs.O_EXCL)|(B.O_RDWR||B.fs.O_RDWR),k=p.platform()==="win32",D=B.EBADF||B.os.errno.EBADF,R=B.ENOENT||B.os.errno.ENOENT,S=448,v=384,F="exit",x=[],U=f.rmdirSync.bind(f);let L=false;function rimraf(A,i){return f.rm(A,{recursive:true},i)}function FN_RIMRAF_SYNC(A){return f.rmSync(A,{recursive:true})}function tmpName(A,i){const g=_parseArguments(A,i),p=g[0],E=g[1];_assertAndSanitizeOptions(p,function(A,i){if(A)return E(A);let g=i.tries;(function _getUniqueName(){try{const A=_generateTmpName(i);f.stat(A,function(i){if(!i){if(g-- >0)return _getUniqueName();return E(new Error("Could not get a unique tmp filename, max tries reached "+A))}E(null,A)})}catch(A){E(A)}})()})}function tmpNameSync(A){const i=_parseArguments(A),g=i[0];const p=_assertAndSanitizeOptionsSync(g);let E=p.tries;do{const A=_generateTmpName(p);try{f.statSync(A)}catch(i){return A}}while(E-- >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],E=g[1];tmpName(p,function _tmpNameCreated(A,i){if(A)return E(A);f.open(i,b,p.mode||v,function _fileCreated(A,g){if(A)return E(A);if(p.discardDescriptor){return f.close(g,function _discardCallback(A){return E(A,i,undefined,_prepareTmpFileRemoveCallback(i,-1,p,false))})}else{const A=p.discardDescriptor||p.detachDescriptor;E(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 E=tmpNameSync(g);let C=f.openSync(E,b,g.mode||v);if(g.discardDescriptor){f.closeSync(C);C=undefined}return{name:E,fd:C,removeCallback:_prepareTmpFileRemoveCallback(E,p?-1:C,g,true)}}function dir(A,i){const g=_parseArguments(A,i),p=g[0],E=g[1];tmpName(p,function _tmpNameCreated(A,i){if(A)return E(A);f.mkdir(i,p.mode||S,function _dirCreated(A){if(A)return E(A);E(null,i,_prepareTmpDirRemoveCallback(i,p,false))})})}function dirSync(A){const i=_parseArguments(A),g=i[0];const p=tmpNameSync(g);f.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])f.close(A[0],function(){f.unlink(A[1],_handler)});else f.unlink(A[1],_handler)}function _removeFileSync(A){let i=null;try{if(0<=A[0])f.closeSync(A[0])}catch(A){if(!_isEBADF(A)&&!_isENOENT(A))throw A}finally{try{f.unlinkSync(A[1])}catch(A){if(!_isENOENT(A))i=A}}if(i!==null){throw i}}function _prepareTmpFileRemoveCallback(A,i,g,f){const p=_prepareRemoveCallback(_removeFileSync,[i,A],f);const E=_prepareRemoveCallback(_removeFileAsync,[i,A],f,p);if(!g.keep)x.unshift(p);return f?p:E}function _prepareTmpDirRemoveCallback(A,i,g){const p=i.unsafeCleanup?rimraf:f.rmdir.bind(f);const E=i.unsafeCleanup?FN_RIMRAF_SYNC:U;const C=_prepareRemoveCallback(E,A,g);const B=_prepareRemoveCallback(p,A,g,C);if(!i.keep)x.unshift(C);return g?C:B}function _prepareRemoveCallback(A,i,g,f){let p=false;return function _cleanupCallback(E){if(!p){const C=f||_cleanupCallback;const B=x.indexOf(C);if(B>=0)x.splice(B,1);p=true;if(g||A===U||A===FN_RIMRAF_SYNC){return A(i)}else{return A(i,E||function(){})}}}}function _garbageCollector(){if(!L)return;while(x.length){try{x[0]()}catch(A){}}}function _randomChars(A){let i=[],g=null;try{g=C.randomBytes(A)}catch(i){g=C.pseudoRandomBytes(A)}for(let f=0;f<A;f++){i.push(Q[g[f]%Q.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=E.isAbsolute(A)?A:E.join(i,A);f.stat(p,function(A){if(A){f.realpath(E.dirname(p),function(A,i){if(A)return g(A);g(null,E.join(i,E.basename(p)))})}else{f.realpath(p,g)}})}function _resolvePathSync(A,i){const g=E.isAbsolute(A)?A:E.join(i,A);try{f.statSync(g);return f.realpathSync(g)}catch(A){const i=f.realpathSync(E.dirname(g));return E.join(i,E.basename(g))}}function _generateTmpName(A){const i=A.tmpdir;if(!_isUndefined(A.name)){return E.join(i,A.dir,A.name)}if(!_isUndefined(A.template)){return E.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 E.join(i,A.dir,g)}function _assertPath(A,i){if(typeof i!=="string"){throw new Error(`${A} option must be a string, got "${typeof i}".`)}if(i.includes("..")){throw new Error("Relative value not allowed")}return i}function _assertOptionsBase(A){if(!_isUndefined(A.name)){const i=A.name;if(E.isAbsolute(i))throw new Error(`name option must not contain an absolute path, found "${i}".`);const g=E.basename(i);if(g===".."Line 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 f=[];const p=new Uint8Array([13,10]);b=0;let E=false;for(const[i,C]of A){if(typeof C==="string"){const A=V.encode(g+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(C)}\r\n`);f.push(A);b+=A.byteLength}else{const A=V.encode(`${g}; name="${escape(normalizeLinefeeds(i))}"`+(C.name?`; filename="${escape(C.name)}"`:"")+"\r\n"+`Content-Type: ${C.type||"application/octet-stream"}\r\n\r\n`);f.push(A,C,p);if(typeof C.size==="number"){b+=A.byteLength+C.size+p.byteLength}else{E=true}}}const C=V.encode(`--${i}--`);f.push(C);b+=C.byteLength;if(E){b=null}y=A;I=async function*(){for(const A of f){if(A.stream){yield*A.stream()}else{yield A}}};k="multipart/form-data; boundary="+i}else if(C(A)){y=A;b=A.size;if(A.type){k=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")}f=A instanceof J?A:E(A)}if(typeof y==="string"||p.isBuffer(y)){b=Buffer.byteLength(y)}if(I!=null){let i;f=new J({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(f)){A.enqueue(new Uint8Array(g))}}return A.desiredSize>0},async cancel(A){await i.return()},type:undefined})}const D={stream:f,source:y,length:b};return[D,k]}function safelyExtractBody(A,i=false){if(!J){J=g(3774).ReadableStream}if(A instanceof J){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 f=S(g,{transfer:[g]});const[,p]=f.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 R("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=G(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(){D.brandCheck(this,A);throwIfAborted(this[k]);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 f({headers:A,preservePath:true})}catch(A){throw new R(`${A}`,"AbortError")}g.on("field",(A,g)=>{i.append(A,g)});g.on("file",(A,g,f,p,E)=>{const C=[];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;C.push(Buffer.from(p.slice(0,i),"base64"));p=p.slice(i)});g.on("end",()=>{C.push(Buffer.from(p,"base64"));i.append(A,new P(C,f,{type:E}))})}else{g.on("data",A=>{C.push(A)});g.on("end",()=>{i.append(A,new P(C,f,{type:E}))})}});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[k].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[k].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,f]of A){i.append(g,f)}return i}else{await Promise.resolve();throwIfAborted(this[k]);throw D.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){D.brandCheck(A,g);throwIfAborted(A[k]);if(bodyUnusable(A[k].body)){throw new TypeError("Body is unusable")}const f=I();const errorSteps=A=>f.reject(A);const successSteps=A=>{try{f.resolve(i(A))}catch(A){errorSteps(A)}};if(A[k].body==null){successSteps(new Uint8Array);return f.promise}await y(A[k].body,successSteps,errorSteps);return f.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[k];const g=i.get("content-type");if(g===null){reLine truncated
|
|
|
|
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */E[p-4]=this.maskKey[0];E[p-3]=this.maskKey[1];E[p-2]=this.maskKey[2];E[p-1]=this.maskKey[3];E[1]=g;if(g===126){E.writeUInt16BE(i,2)}else if(g===127){E[2]=E[3]=0;E.writeUIntBE(i,4,6)}E[1]|=128;for(let A=0;A<i;A++){E[p+A]=this.frameData[A]^this.maskKey[A%4]}return E}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},5080:(A,i,g)=>{const{Writable:f}=g(2203);const p=g(1637);const{parserStates:E,opcodes:C,states:B,emptyBuffer:Q}=g(8551);const{kReadyState:I,kSentClose:y,kResponse:b,kReceivedClose:k}=g(327);const{isValidStatusCode:D,failWebsocketConnection:R,websocketMessageReceived:S}=g(1501);const{WebsocketFrameSend:v}=g(9140);const F={};F.ping=p.channel("undici:websocket:ping");F.pong=p.channel("undici:websocket:pong");class ByteParser extends f{#i=[];#o=0;#a=E.INFO;#c={};#l=[];constructor(A){super();this.ws=A}_write(A,i,g){this.#i.push(A);this.#o+=A.length;this.run(g)}run(A){while(true){if(this.#a===E.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!==C.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==C.BINARY&&this.#c.opcode!==C.TEXT){R(this.ws,"Invalid frame type was fragmented.");return}const g=i[1]&127;if(g<=125){this.#c.payloadLength=g;this.#a=E.READ_DATA}else if(g===126){this.#a=E.PAYLOADLENGTH_16}else if(g===127){this.#a=E.PAYLOADLENGTH_64}if(this.#c.fragmented&&g>125){R(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===C.PING||this.#c.opcode===C.PONG||this.#c.opcode===C.CLOSE)&&g>125){R(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===C.CLOSE){if(g===1){R(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(C.CLOSE),A=>{if(!A){this.ws[y]=true}})}this.ws[I]=B.CLOSING;this.ws[k]=true;this.end();return}else if(this.#c.opcode===C.PING){const i=this.consume(g);if(!this.ws[k]){const A=new v(i);this.ws[b].socket.write(A.createFrame(C.PONG));if(F.ping.hasSubscribers){F.ping.publish({payload:i})}}this.#a=E.INFO;if(this.#o>0){continue}else{A();return}}else if(this.#c.opcode===C.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===E.PAYLOADLENGTH_16){if(this.#o<2){return A()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#a=E.READ_DATA}else if(this.#a===E.PAYLOADLENGTH_64){if(this.#o<8){return A()}const i=this.consume(8);const g=i.readUInt32BE(0);if(g>2**31-1){R(this.ws,"Received payload length > 2^31 bytes.");return}const f=i.readUInt32BE(4);this.#c.payloadLength=(g<<8)+f;this.#a=E.READ_DATA}else if(this.#a===E.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===C.CONTINUATION){const A=Buffer.concat(this.#l);S(this.ws,this.#c.originalOpcode,A);this.#c={};this.#l.length=0}this.#a=E.INFO}}if(this.#o>0){continue}else{A();break}}}consume(A){if(A>this.#o){return null}else if(A===0){return Q}if(this.#i[0].length===A){this.#o-=this.#i[0].length;return this.#i.shift()}const i=Buffer.allocUnsafe(A);let g=0;while(g!==A){const f=this.#i[0];const{length:p}=f;if(p+g===A){i.set(this.#i.shift(),g);break}else if(p+g>A){i.set(f.subarray(0,A-g),g);this.#i[0]=f.subarray(A-g);break}else{i.set(this.#i.shift(),g);g+=f.length}}this.#o-=A;return i}parseCloseBody(A,i){let g;if(i.length>=2){g=i.readUInt16BE(0)}if(A){if(!D(g)){return null}return{code:g}}let f=i.subarray(2);if(f[0]===239&&f[1]===187&&f[2]===191){f=f.subarray(3)}if(g!==undefined&&!D(g)){return null}try{f=new TextDecoder("utf-8",{fatal:true}).decode(f)}catch{return null}return{code:g,reason:f}}get closingInfo(){return this.#c.closeInfo}}A.exports={ByteParser:ByteParser}},327: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")}},1501:(A,i,g)=>{const{kReadyState:f,kController:p,kResponse:E,kBinaryType:C,kWebSocketURL:B}=g(327);const{states:Q,opcodes:I}=g(8551);const{MessageEvent:y,ErrorEvent:b}=g(7952);function isEstablished(A){return A[f]===Q.OPEN}function isClosing(A){return A[f]===Q.CLOSING}function isClosed(A){return A[f]===Q.CLOSED}function fireEvent(A,i,g=Event,f){const p=new g(A,f);i.dispatchEvent(p)}function websocketMessageReceived(A,i,g){if(A[f]!==Q.OPEN){return}let p;if(i===I.TEXT){try{p=new TextDecoder("utf-8",{fatal:true}).decode(g)}catch{failWebsocketConnection(A,"Received iLine 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 f=[];const p=new Uint8Array([13,10]);y=0;let E=false;for(const[i,C]of A){if(typeof C==="string"){const A=H.encode(g+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(C)}\r\n`);f.push(A);y+=A.byteLength}else{const A=H.encode(`${g}; name="${escape(normalizeLinefeeds(i))}"`+(C.name?`; filename="${escape(C.name)}"`:"")+"\r\n"+`Content-Type: ${C.type||"application/octet-stream"}\r\n\r\n`);f.push(A,C,p);if(typeof C.size==="number"){y+=A.byteLength+C.size+p.byteLength}else{E=true}}}const C=H.encode(`--${i}--\r\n`);f.push(C);y+=C.byteLength;if(E){y=null}I=A;Q=async function*(){for(const A of f){if(A.stream){yield*A.stream()}else{yield A}}};b=`multipart/form-data; boundary=${i}`}else if(E(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(f.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"||f.isBuffer(I)){y=Buffer.byteLength(I)}if(Q!=null){let i;g=new ReadableStream({async start(){i=Q(A)[Symbol.asyncIterator]()},async pull(A){const{value:f,done:p}=await i.next();if(p){queueMicrotask(()=>{A.close();A.byobRequest?.respond(0)})}else{if(!F(g)){const i=new Uint8Array(f);if(i.byteLength){A.enqueue(i)}}}return A.desiredSize>0},async cancel(A){await i.return()},type:"bytes"})}const k={stream:g,source:I,length:y};return[k,b]}function safelyExtractBody(A,i=false){if(A instanceof ReadableStream){v(!f.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,f]=i.stream.tee();i.stream=g;return{stream:f,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 f=new k;f[D]=g;return f}case"application/x-www-form-urlencoded":{const i=new URLSearchParams(A.toString());const g=new k;for(const[A,f]of i){g.append(A,f)}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){R.brandCheck(A,g);if(bodyUnusable(A)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(A[D]);const f=Q();const errorSteps=A=>f.reject(A);const successSteps=A=>{try{f.resolve(i(A))}catch(A){errorSteps(A)}};if(A[D].body==null){successSteps(Buffer.allocUnsafe(0));return f.promise}await I(A[D].body,successSteps,errorSteps);return f.promise}function bodyUnusable(A){const i=A[D].body;return i!=null&&(i.stream.locked||f.isDisturbed(i.stream))}function parseJSONFromBytes(A){return JSON.parse(b(A))}function bodyMimeType(A){const i=A[D].headersList;const g=y(i);if(g==="failure"){return null}return g}A.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:G,hasFinalizationRegistry:_,bodyUnusable:bodyUnusable}},4578:A=>{const i=["GET","HEAD","POST"];const g=new Set(i);const f=[101,204,205,304];const p=[301,302,303,307,308];const E=new Set(p);const C=["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 B=new Set(C);const Q=["","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(Q);const y=["follow","manual","error"];const b=["GET","HEAD","OPTIONS","TRACE"];const k=new Set(b);const D=["navigate","same-origin","no-cors","cors"];const R=["omit","same-origin","include"];const S=["default","no-store","reload","no-cache","force-cache","onlLine truncated
|
|
|
|
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */B[C-4]=g[0];B[C-3]=g[1];B[C-2]=g[2];B[C-1]=g[3];B[1]=E;if(E===126){B.writeUInt16BE(p,2)}else if(E===127){B[2]=B[3]=0;B.writeUIntBE(p,4,6)}B[1]|=128;for(let A=0;A<p;++A){B[C+A]=i[A]^g[A&3]}return B}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},6286:(A,i,g)=>{const{createInflateRaw:f,Z_DEFAULT_WINDOWBITS:p}=g(8522);const{isValidClientWindowBits:E}=g(8098);const{MessageSizeExceededError:C}=g(6246);const B=Buffer.from([0,0,255,255]);const Q=Symbol("kBuffer");const I=Symbol("kLength");class PerMessageDeflate{#ne;#S={};#re=0;constructor(A,i){this.#S.serverNoContextTakeover=A.has("server_no_context_takeover");this.#S.serverMaxWindowBits=A.get("server_max_window_bits");this.#re=i.maxPayloadSize}decompress(A,i,g){if(!this.#ne){let A=p;if(this.#S.serverMaxWindowBits){if(!E(this.#S.serverMaxWindowBits)){g(new Error("Invalid server_max_window_bits"));return}A=Number.parseInt(this.#S.serverMaxWindowBits)}try{this.#ne=f({windowBits:A})}catch(A){g(A);return}this.#ne[Q]=[];this.#ne[I]=0;this.#ne.on("data",A=>{this.#ne[I]+=A.length;if(this.#re>0&&this.#ne[I]>this.#re){g(new C);this.#ne.removeAllListeners();this.#ne=null;return}this.#ne[Q].push(A)});this.#ne.on("error",A=>{this.#ne=null;g(A)})}this.#ne.write(A);if(i){this.#ne.write(B)}this.#ne.flush(()=>{if(!this.#ne){return}const A=Buffer.concat(this.#ne[Q],this.#ne[I]);this.#ne[Q].length=0;this.#ne[I]=0;g(null,A)})}}A.exports={PerMessageDeflate:PerMessageDeflate}},5975:(A,i,g)=>{const{Writable:f}=g(7075);const p=g(4589);const{parserStates:E,opcodes:C,states:B,emptyBuffer:Q,sentCloseFrameState:I}=g(8397);const{kReadyState:y,kSentClose:b,kResponse:k,kReceivedClose:D}=g(7609);const{channels:R}=g(9978);const{isValidStatusCode:S,isValidOpcode:v,failWebsocketConnection:F,websocketMessageReceived:x,utf8Decode:U,isControlFrame:L,isTextBinaryFrame:M,isContinuationFrame:T}=g(8098);const{WebsocketFrameSend:H}=g(9321);const{closeWebSocketConnection:_}=g(1874);const{PerMessageDeflate:G}=g(6286);const{MessageSizeExceededError:Y}=g(6246);function failWebsocketConnectionWithCode(A,i,g){_(A,i,g,Buffer.byteLength(g));F(A,g)}class ByteParser extends f{#i=[];#ie=0;#o=0;#oe=false;#a=E.INFO;#c={};#l=[];#d;#ae;#re;constructor(A,i,g={}){super();this.ws=A;this.#d=i==null?new Map:i;this.#ae=g.maxFragments??0;this.#re=g.maxPayloadSize??0;if(this.#d.has("permessage-deflate")){this.#d.set("permessage-deflate",new G(i,g))}}_write(A,i,g){this.#i.push(A);this.#o+=A.length;this.#oe=true;this.run(g)}#ce(){if(this.#re>0&&!L(this.#c.opcode)&&this.#c.payloadLength+this.#ie>this.#re){failWebsocketConnectionWithCode(this.ws,1009,"Payload size exceeds maximum allowed size");return false}return true}run(A){while(this.#oe){if(this.#a===E.INFO){if(this.#o<2){return A()}const i=this.consume(2);const g=(i[0]&128)!==0;const f=i[0]&15;const p=(i[1]&128)===128;const B=!g&&f!==C.CONTINUATION;const Q=i[1]&127;const I=i[0]&64;const y=i[0]&32;const b=i[0]&16;if(!v(f)){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(B&&!M(f)){F(this.ws,"Invalid frame type was fragmented.");return}if(M(f)&&this.#l.length>0){F(this.ws,"Expected continuation frame");return}if(this.#c.fragmented&&B){F(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((Q>125||B)&&L(f)){F(this.ws,"Control frame either too large or fragmented");return}if(T(f)&&this.#l.length===0&&!this.#c.compressed){F(this.ws,"Unexpected continuation frame");return}if(Q<=125){this.#c.payloadLength=Q;this.#a=E.READ_DATA;if(!this.#ce()){return}}else if(Q===126){this.#a=E.PAYLOADLENGTH_16}else if(Q===127){this.#a=E.PAYLOADLENGTH_64}if(M(f)){this.#c.binaryType=f;this.#c.compressed=I!==0}this.#c.opcode=f;this.#c.masked=p;this.#c.fin=g;this.#c.fragmented=B}else if(this.#a===E.PAYLOADLENGTH_16){if(this.#o<2){return A()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#a=E.READ_DATA;if(!this.#ce()){return}}else if(this.#a===E.PAYLOADLENGTH_64){if(this.#o<8){return A()}const i=this.consume(8);const g=i.readUInt32BE(0);const f=i.readUInt32BE(4);if(g!==0||f>2**31-1){F(this.ws,"Received payload length > 2^31 bytes.");return}this.#c.payloadLength=f;this.#a=E.READ_DATA;if(!this.#ce()){return}}else if(this.#a===E.READ_DATA){if(this.#o<this.#c.payloadLength){return A()}const i=this.consume(this.#c.payloadLength);if(L(this.#c.opcode)){this.#oe=this.parseControlFrame(i);this.#a=E.INFO}else{if(!this.#c.compressed){if(!this.writeFragments(i)){return}if(this.#re>0&&this.#ie>this.#re){failWebsocketConnectionWithCode(this.ws,1009,(new Y).message);return}if(!this.#c.fragmented&&this.#c.fin){x(this.ws,this.#c.binaryType,this.consumeFragments())}this.#a=E.INFO}else{this.#d.get("permessage-deflate").decompress(i,this.#c.fin,(i,g)=>{if(i){const A=i instanceof Y?1009:1007;failWebsocketConnectionWithCLine truncated
|
|
|
|
|
const d=u(9896);const E=u(857);const C=u(6928);const Q=u(6982);const B={fs:d.constants,os:E.constants};const I="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",m=/XXXXXX/,y=3,b=(B.O_CREAT||B.fs.O_CREAT)|(B.O_EXCL||B.fs.O_EXCL)|(B.O_RDWR||B.fs.O_RDWR),D=E.platform()==="win32",R=B.EBADF||B.os.errno.EBADF,k=B.ENOENT||B.os.errno.ENOENT,S=448,v=384,x="exit",N=[],L=d.rmdirSync.bind(d);let M=false;function rimraf(t,A){return d.rm(t,{recursive:true},A)}function FN_RIMRAF_SYNC(t){return d.rmSync(t,{recursive:true})}function tmpName(t,A){const u=_parseArguments(t,A),E=u[0],C=u[1];_assertAndSanitizeOptions(E,function(t,A){if(t)return C(t);let u=A.tries;(function _getUniqueName(){try{const t=_generateTmpName(A);d.stat(t,function(A){if(!A){if(u-- >0)return _getUniqueName();return C(new Error("Could not get a unique tmp filename, max tries reached "+t))}C(null,t)})}catch(t){C(t)}})()})}function tmpNameSync(t){const A=_parseArguments(t),u=A[0];const E=_assertAndSanitizeOptionsSync(u);let C=E.tries;do{const t=_generateTmpName(E);try{d.statSync(t)}catch(A){return t}}while(C-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(t,A){const u=_parseArguments(t,A),E=u[0],C=u[1];tmpName(E,function _tmpNameCreated(t,A){if(t)return C(t);d.open(A,b,E.mode||v,function _fileCreated(t,u){if(t)return C(t);if(E.discardDescriptor){return d.close(u,function _discardCallback(t){return C(t,A,undefined,_prepareTmpFileRemoveCallback(A,-1,E,false))})}else{const t=E.discardDescriptor||E.detachDescriptor;C(null,A,u,_prepareTmpFileRemoveCallback(A,t?-1:u,E,false))}})})}function fileSync(t){const A=_parseArguments(t),u=A[0];const E=u.discardDescriptor||u.detachDescriptor;const C=tmpNameSync(u);let Q=d.openSync(C,b,u.mode||v);if(u.discardDescriptor){d.closeSync(Q);Q=undefined}return{name:C,fd:Q,removeCallback:_prepareTmpFileRemoveCallback(C,E?-1:Q,u,true)}}function dir(t,A){const u=_parseArguments(t,A),E=u[0],C=u[1];tmpName(E,function _tmpNameCreated(t,A){if(t)return C(t);d.mkdir(A,E.mode||S,function _dirCreated(t){if(t)return C(t);C(null,A,_prepareTmpDirRemoveCallback(A,E,false))})})}function dirSync(t){const A=_parseArguments(t),u=A[0];const E=tmpNameSync(u);d.mkdirSync(E,u.mode||S);return{name:E,removeCallback:_prepareTmpDirRemoveCallback(E,u,true)}}function _removeFileAsync(t,A){const _handler=function(t){if(t&&!_isENOENT(t)){return A(t)}A()};if(0<=t[0])d.close(t[0],function(){d.unlink(t[1],_handler)});else d.unlink(t[1],_handler)}function _removeFileSync(t){let A=null;try{if(0<=t[0])d.closeSync(t[0])}catch(t){if(!_isEBADF(t)&&!_isENOENT(t))throw t}finally{try{d.unlinkSync(t[1])}catch(t){if(!_isENOENT(t))A=t}}if(A!==null){throw A}}function _prepareTmpFileRemoveCallback(t,A,u,d){const E=_prepareRemoveCallback(_removeFileSync,[A,t],d);const C=_prepareRemoveCallback(_removeFileAsync,[A,t],d,E);if(!u.keep)N.unshift(E);return d?E:C}function _prepareTmpDirRemoveCallback(t,A,u){const E=A.unsafeCleanup?rimraf:d.rmdir.bind(d);const C=A.unsafeCleanup?FN_RIMRAF_SYNC:L;const Q=_prepareRemoveCallback(C,t,u);const B=_prepareRemoveCallback(E,t,u,Q);if(!A.keep)N.unshift(Q);return u?Q:B}function _prepareRemoveCallback(t,A,u,d){let E=false;return function _cleanupCallback(C){if(!E){const Q=d||_cleanupCallback;const B=N.indexOf(Q);if(B>=0)N.splice(B,1);E=true;if(u||t===L||t===FN_RIMRAF_SYNC){return t(A)}else{return t(A,C||function(){})}}}}function _garbageCollector(){if(!M)return;while(N.length){try{N[0]()}catch(t){}}}function _randomChars(t){let A=[],u=null;try{u=Q.randomBytes(t)}catch(A){u=Q.pseudoRandomBytes(t)}for(let d=0;d<t;d++){A.push(I[u[d]%I.length])}return A.join("")}function _isUndefined(t){return typeof t==="undefined"}function _parseArguments(t,A){if(typeof t==="function"){return[{},t]}if(_isUndefined(t)){return[{},A]}const u={};for(const A of Object.getOwnPropertyNames(t)){u[A]=t[A]}return[u,A]}function _resolvePath(t,A,u){const E=C.isAbsolute(t)?t:C.join(A,t);d.stat(E,function(t){if(t){d.realpath(C.dirname(E),function(t,A){if(t)return u(t);u(null,C.join(A,C.basename(E)))})}else{d.realpath(E,u)}})}function _resolvePathSync(t,A){const u=C.isAbsolute(t)?t:C.join(A,t);try{d.statSync(u);return d.realpathSync(u)}catch(t){const A=d.realpathSync(C.dirname(u));return C.join(A,C.basename(u))}}function _generateTmpName(t){const A=t.tmpdir;if(!_isUndefined(t.name)){return C.join(A,t.dir,t.name)}if(!_isUndefined(t.template)){return C.join(A,t.dir,t.template).replace(m,_randomChars(6))}const u=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_randomChars(12),t.postfix?"-"+t.postfix:""].join("");return C.join(A,t.dir,u)}function _assertPath(t,A){if(typeof A!=="string"){throw new Error(`${t} option must be a string, got "${typeof A}".`)}if(A.includes("..")){throw new Error("Relative value not allowed")}return A}function _assertOptionsBase(t){if(!_isUndefined(t.name)){const A=t.name;if(C.isAbsolute(A))throw new Error(`name option must not contain an absolute path, found "${A}".`);const u=C.basename(A);if(u===".."Line truncated
|
|
|
|
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=t=>t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=t=>t.replace(/\r?\n|\r/g,"\r\n");const d=[];const E=new Uint8Array([13,10]);b=0;let C=false;for(const[A,Q]of t){if(typeof Q==="string"){const t=q.encode(u+`; name="${escape(normalizeLinefeeds(A))}"`+`\r\n\r\n${normalizeLinefeeds(Q)}\r\n`);d.push(t);b+=t.byteLength}else{const t=q.encode(`${u}; name="${escape(normalizeLinefeeds(A))}"`+(Q.name?`; filename="${escape(Q.name)}"`:"")+"\r\n"+`Content-Type: ${Q.type||"application/octet-stream"}\r\n\r\n`);d.push(t,Q,E);if(typeof Q.size==="number"){b+=t.byteLength+Q.size+E.byteLength}else{C=true}}}const Q=q.encode(`--${A}--`);d.push(Q);b+=Q.byteLength;if(C){b=null}y=t;m=async function*(){for(const t of d){if(t.stream){yield*t.stream()}else{yield t}}};D="multipart/form-data; boundary="+A}else if(Q(t)){y=t;b=t.size;if(t.type){D=t.type}}else if(typeof t[Symbol.asyncIterator]==="function"){if(A){throw new TypeError("keepalive")}if(E.isDisturbed(t)||t.locked){throw new TypeError("Response body object should not be disturbed or locked")}d=t instanceof P?t:C(t)}if(typeof y==="string"||E.isBuffer(y)){b=Buffer.byteLength(y)}if(m!=null){let A;d=new P({async start(){A=m(t)[Symbol.asyncIterator]()},async pull(t){const{value:u,done:E}=await A.next();if(E){queueMicrotask(()=>{t.close()})}else{if(!M(d)){t.enqueue(new Uint8Array(u))}}return t.desiredSize>0},async cancel(t){await A.return()},type:undefined})}const R={stream:d,source:y,length:b};return[R,D]}function safelyExtractBody(t,A=false){if(!P){P=u(3774).ReadableStream}if(t instanceof P){L(!E.isDisturbed(t),"The body has already been consumed.");L(!t.locked,"The stream is locked.")}return extractBody(t,A)}function cloneBody(t){const[A,u]=t.stream.tee();const d=S(u,{transfer:[u]});const[,E]=d.tee();t.stream=A;return{stream:E,length:t.length,source:t.source}}async function*consumeBody(t){if(t){if(T(t)){yield t}else{const A=t.stream;if(E.isDisturbed(A)){throw new TypeError("The body has already been consumed.")}if(A.locked){throw new TypeError("The stream is locked.")}A[N]=true;yield*A}}}function throwIfAborted(t){if(t.aborted){throw new k("The operation was aborted.","AbortError")}}function bodyMixinMethods(t){const A={blob(){return specConsumeBody(this,t=>{let A=bodyMimeType(this);if(A==="failure"){A=""}else if(A){A=O(A)}return new v([t],{type:A})},t)},arrayBuffer(){return specConsumeBody(this,t=>new Uint8Array(t).buffer,t)},text(){return specConsumeBody(this,utf8DecodeBytes,t)},json(){return specConsumeBody(this,parseJSONFromBytes,t)},async formData(){R.brandCheck(this,t);throwIfAborted(this[D]);const A=this.headers.get("Content-Type");if(/multipart\/form-data/.test(A)){const t={};for(const[A,u]of this.headers)t[A.toLowerCase()]=u;const A=new b;let u;try{u=new d({headers:t,preservePath:true})}catch(t){throw new k(`${t}`,"AbortError")}u.on("field",(t,u)=>{A.append(t,u)});u.on("file",(t,u,d,E,C)=>{const Q=[];if(E==="base64"||E.toLowerCase()==="base64"){let E="";u.on("data",t=>{E+=t.toString().replace(/[\r\n]/gm,"");const A=E.length-E.length%4;Q.push(Buffer.from(E.slice(0,A),"base64"));E=E.slice(A)});u.on("end",()=>{Q.push(Buffer.from(E,"base64"));A.append(t,new W(Q,d,{type:C}))})}else{u.on("data",t=>{Q.push(t)});u.on("end",()=>{A.append(t,new W(Q,d,{type:C}))})}});const E=new Promise((t,A)=>{u.on("finish",t);u.on("error",t=>A(new TypeError(t)))});if(this.body!==null)for await(const t of consumeBody(this[D].body))u.write(t);u.end();await E;return A}else if(/application\/x-www-form-urlencoded/.test(A)){let t;try{let A="";const u=new TextDecoder("utf-8",{ignoreBOM:true});for await(const t of consumeBody(this[D].body)){if(!T(t)){throw new TypeError("Expected Uint8Array chunk")}A+=u.decode(t,{stream:true})}A+=u.decode();t=new URLSearchParams(A)}catch(t){throw Object.assign(new TypeError,{cause:t})}const A=new b;for(const[u,d]of t){A.append(u,d)}return A}else{await Promise.resolve();throwIfAborted(this[D]);throw R.errors.exception({header:`${t.name}.formData`,message:"Could not parse content as FormData."})}}};return A}function mixinBody(t){Object.assign(t.prototype,bodyMixinMethods(t))}async function specConsumeBody(t,A,u){R.brandCheck(t,u);throwIfAborted(t[D]);if(bodyUnusable(t[D].body)){throw new TypeError("Body is unusable")}const d=m();const errorSteps=t=>d.reject(t);const successSteps=t=>{try{d.resolve(A(t))}catch(t){errorSteps(t)}};if(t[D].body==null){successSteps(new Uint8Array);return d.promise}await y(t[D].body,successSteps,errorSteps);return d.promise}function bodyUnusable(t){return t!=null&&(t.stream.locked||E.isDisturbed(t.stream))}function utf8DecodeBytes(t){if(t.length===0){return""}if(t[0]===239&&t[1]===187&&t[2]===191){t=t.subarray(3)}const A=j.decode(t);return A}function parseJSONFromBytes(t){return JSON.parse(utf8DecodeBytes(t))}function bodyMimeType(t){const{headersList:A}=t[D];const u=A.get("content-type");if(u===null){reLine truncated
|
|
|
|
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */C[E-4]=this.maskKey[0];C[E-3]=this.maskKey[1];C[E-2]=this.maskKey[2];C[E-1]=this.maskKey[3];C[1]=u;if(u===126){C.writeUInt16BE(A,2)}else if(u===127){C[2]=C[3]=0;C.writeUIntBE(A,4,6)}C[1]|=128;for(let t=0;t<A;t++){C[E+t]=this.frameData[t]^this.maskKey[t%4]}return C}}t.exports={WebsocketFrameSend:WebsocketFrameSend}},5080:(t,A,u)=>{const{Writable:d}=u(2203);const E=u(1637);const{parserStates:C,opcodes:Q,states:B,emptyBuffer:I}=u(932);const{kReadyState:m,kSentClose:y,kResponse:b,kReceivedClose:D}=u(327);const{isValidStatusCode:R,failWebsocketConnection:k,websocketMessageReceived:S}=u(1501);const{WebsocketFrameSend:v}=u(9140);const x={};x.ping=E.channel("undici:websocket:ping");x.pong=E.channel("undici:websocket:pong");class ByteParser extends d{#n=[];#o=0;#a=C.INFO;#c={};#l=[];constructor(t){super();this.ws=t}_write(t,A,u){this.#n.push(t);this.#o+=t.length;this.run(u)}run(t){while(true){if(this.#a===C.INFO){if(this.#o<2){return t()}const A=this.consume(2);this.#c.fin=(A[0]&128)!==0;this.#c.opcode=A[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==Q.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==Q.BINARY&&this.#c.opcode!==Q.TEXT){k(this.ws,"Invalid frame type was fragmented.");return}const u=A[1]&127;if(u<=125){this.#c.payloadLength=u;this.#a=C.READ_DATA}else if(u===126){this.#a=C.PAYLOADLENGTH_16}else if(u===127){this.#a=C.PAYLOADLENGTH_64}if(this.#c.fragmented&&u>125){k(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===Q.PING||this.#c.opcode===Q.PONG||this.#c.opcode===Q.CLOSE)&&u>125){k(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===Q.CLOSE){if(u===1){k(this.ws,"Received close frame with a 1-byte body.");return}const t=this.consume(u);this.#c.closeInfo=this.parseCloseBody(false,t);if(!this.ws[y]){const t=Buffer.allocUnsafe(2);t.writeUInt16BE(this.#c.closeInfo.code,0);const A=new v(t);this.ws[b].socket.write(A.createFrame(Q.CLOSE),t=>{if(!t){this.ws[y]=true}})}this.ws[m]=B.CLOSING;this.ws[D]=true;this.end();return}else if(this.#c.opcode===Q.PING){const A=this.consume(u);if(!this.ws[D]){const t=new v(A);this.ws[b].socket.write(t.createFrame(Q.PONG));if(x.ping.hasSubscribers){x.ping.publish({payload:A})}}this.#a=C.INFO;if(this.#o>0){continue}else{t();return}}else if(this.#c.opcode===Q.PONG){const A=this.consume(u);if(x.pong.hasSubscribers){x.pong.publish({payload:A})}if(this.#o>0){continue}else{t();return}}}else if(this.#a===C.PAYLOADLENGTH_16){if(this.#o<2){return t()}const A=this.consume(2);this.#c.payloadLength=A.readUInt16BE(0);this.#a=C.READ_DATA}else if(this.#a===C.PAYLOADLENGTH_64){if(this.#o<8){return t()}const A=this.consume(8);const u=A.readUInt32BE(0);if(u>2**31-1){k(this.ws,"Received payload length > 2^31 bytes.");return}const d=A.readUInt32BE(4);this.#c.payloadLength=(u<<8)+d;this.#a=C.READ_DATA}else if(this.#a===C.READ_DATA){if(this.#o<this.#c.payloadLength){return t()}else if(this.#o>=this.#c.payloadLength){const t=this.consume(this.#c.payloadLength);this.#l.push(t);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===Q.CONTINUATION){const t=Buffer.concat(this.#l);S(this.ws,this.#c.originalOpcode,t);this.#c={};this.#l.length=0}this.#a=C.INFO}}if(this.#o>0){continue}else{t();break}}}consume(t){if(t>this.#o){return null}else if(t===0){return I}if(this.#n[0].length===t){this.#o-=this.#n[0].length;return this.#n.shift()}const A=Buffer.allocUnsafe(t);let u=0;while(u!==t){const d=this.#n[0];const{length:E}=d;if(E+u===t){A.set(this.#n.shift(),u);break}else if(E+u>t){A.set(d.subarray(0,t-u),u);this.#n[0]=d.subarray(t-u);break}else{A.set(this.#n.shift(),u);u+=d.length}}this.#o-=t;return A}parseCloseBody(t,A){let u;if(A.length>=2){u=A.readUInt16BE(0)}if(t){if(!R(u)){return null}return{code:u}}let d=A.subarray(2);if(d[0]===239&&d[1]===187&&d[2]===191){d=d.subarray(3)}if(u!==undefined&&!R(u)){return null}try{d=new TextDecoder("utf-8",{fatal:true}).decode(d)}catch{return null}return{code:u,reason:d}}get closingInfo(){return this.#c.closeInfo}}t.exports={ByteParser:ByteParser}},327:t=>{t.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")}},1501:(t,A,u)=>{const{kReadyState:d,kController:E,kResponse:C,kBinaryType:Q,kWebSocketURL:B}=u(327);const{states:I,opcodes:m}=u(932);const{MessageEvent:y,ErrorEvent:b}=u(7952);function isEstablished(t){return t[d]===I.OPEN}function isClosing(t){return t[d]===I.CLOSING}function isClosed(t){return t[d]===I.CLOSED}function fireEvent(t,A,u=Event,d){const E=new u(t,d);A.dispatchEvent(E)}function websocketMessageReceived(t,A,u){if(t[d]!==I.OPEN){return}let E;if(A===m.TEXT){try{E=new TextDecoder("utf-8",{fatal:true}).decode(u)}catch{failWebsocketConnection(t,"Received invLine truncated
|
|
|
|
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=t=>t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=t=>t.replace(/\r?\n|\r/g,"\r\n");const d=[];const E=new Uint8Array([13,10]);y=0;let C=false;for(const[A,Q]of t){if(typeof Q==="string"){const t=G.encode(u+`; name="${escape(normalizeLinefeeds(A))}"`+`\r\n\r\n${normalizeLinefeeds(Q)}\r\n`);d.push(t);y+=t.byteLength}else{const t=G.encode(`${u}; name="${escape(normalizeLinefeeds(A))}"`+(Q.name?`; filename="${escape(Q.name)}"`:"")+"\r\n"+`Content-Type: ${Q.type||"application/octet-stream"}\r\n\r\n`);d.push(t,Q,E);if(typeof Q.size==="number"){y+=t.byteLength+Q.size+E.byteLength}else{C=true}}}const Q=G.encode(`--${A}--\r\n`);d.push(Q);y+=Q.byteLength;if(C){y=null}m=t;I=async function*(){for(const t of d){if(t.stream){yield*t.stream()}else{yield t}}};b=`multipart/form-data; boundary=${A}`}else if(C(t)){m=t;y=t.size;if(t.type){b=t.type}}else if(typeof t[Symbol.asyncIterator]==="function"){if(A){throw new TypeError("keepalive")}if(d.isDisturbed(t)||t.locked){throw new TypeError("Response body object should not be disturbed or locked")}u=t instanceof ReadableStream?t:E(t)}if(typeof m==="string"||d.isBuffer(m)){y=Buffer.byteLength(m)}if(I!=null){let A;u=new ReadableStream({async start(){A=I(t)[Symbol.asyncIterator]()},async pull(t){const{value:d,done:E}=await A.next();if(E){queueMicrotask(()=>{t.close();t.byobRequest?.respond(0)})}else{if(!x(u)){const A=new Uint8Array(d);if(A.byteLength){t.enqueue(A)}}}return t.desiredSize>0},async cancel(t){await A.return()},type:"bytes"})}const D={stream:u,source:m,length:y};return[D,b]}function safelyExtractBody(t,A=false){if(t instanceof ReadableStream){v(!d.isDisturbed(t),"The body has already been consumed.");v(!t.locked,"The stream is locked.")}return extractBody(t,A)}function cloneBody(t,A){const[u,d]=A.stream.tee();A.stream=u;return{stream:d,length:A.length,source:A.source}}function throwIfAborted(t){if(t.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(t){const A={blob(){return consumeBody(this,t=>{let A=bodyMimeType(this);if(A===null){A=""}else if(A){A=M(A)}return new S([t],{type:A})},t)},arrayBuffer(){return consumeBody(this,t=>new Uint8Array(t).buffer,t)},text(){return consumeBody(this,b,t)},json(){return consumeBody(this,parseJSONFromBytes,t)},formData(){return consumeBody(this,t=>{const A=bodyMimeType(this);if(A!==null){switch(A.essence){case"multipart/form-data":{const u=T(t,A);if(u==="failure"){throw new TypeError("Failed to parse body as FormData.")}const d=new D;d[R]=u;return d}case"application/x-www-form-urlencoded":{const A=new URLSearchParams(t.toString());const u=new D;for(const[t,d]of A){u.append(t,d)}return u}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return consumeBody(this,t=>new Uint8Array(t),t)}};return A}function mixinBody(t){Object.assign(t.prototype,bodyMixinMethods(t))}async function consumeBody(t,A,u){k.brandCheck(t,u);if(bodyUnusable(t)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(t[R]);const d=I();const errorSteps=t=>d.reject(t);const successSteps=t=>{try{d.resolve(A(t))}catch(t){errorSteps(t)}};if(t[R].body==null){successSteps(Buffer.allocUnsafe(0));return d.promise}await m(t[R].body,successSteps,errorSteps);return d.promise}function bodyUnusable(t){const A=t[R].body;return A!=null&&(A.stream.locked||d.isDisturbed(A.stream))}function parseJSONFromBytes(t){return JSON.parse(b(t))}function bodyMimeType(t){const A=t[R].headersList;const u=y(A);if(u==="failure"){return null}return u}t.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:O,hasFinalizationRegistry:Y,bodyUnusable:bodyUnusable}},4578:t=>{const A=["GET","HEAD","POST"];const u=new Set(A);const d=[101,204,205,304];const E=[301,302,303,307,308];const C=new Set(E);const Q=["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 B=new Set(Q);const I=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const m=new Set(I);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-cache","onlLine truncated
|
|
|
|
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */B[Q-4]=u[0];B[Q-3]=u[1];B[Q-2]=u[2];B[Q-1]=u[3];B[1]=C;if(C===126){B.writeUInt16BE(E,2)}else if(C===127){B[2]=B[3]=0;B.writeUIntBE(E,4,6)}B[1]|=128;for(let t=0;t<E;++t){B[Q+t]=A[t]^u[t&3]}return B}}t.exports={WebsocketFrameSend:WebsocketFrameSend}},6286:(t,A,u)=>{const{createInflateRaw:d,Z_DEFAULT_WINDOWBITS:E}=u(8522);const{isValidClientWindowBits:C}=u(8098);const{MessageSizeExceededError:Q}=u(6246);const B=Buffer.from([0,0,255,255]);const I=Symbol("kBuffer");const m=Symbol("kLength");class PerMessageDeflate{#re;#S={};#ie=0;constructor(t,A){this.#S.serverNoContextTakeover=t.has("server_no_context_takeover");this.#S.serverMaxWindowBits=t.get("server_max_window_bits");this.#ie=A.maxPayloadSize}decompress(t,A,u){if(!this.#re){let t=E;if(this.#S.serverMaxWindowBits){if(!C(this.#S.serverMaxWindowBits)){u(new Error("Invalid server_max_window_bits"));return}t=Number.parseInt(this.#S.serverMaxWindowBits)}try{this.#re=d({windowBits:t})}catch(t){u(t);return}this.#re[I]=[];this.#re[m]=0;this.#re.on("data",t=>{this.#re[m]+=t.length;if(this.#ie>0&&this.#re[m]>this.#ie){u(new Q);this.#re.removeAllListeners();this.#re=null;return}this.#re[I].push(t)});this.#re.on("error",t=>{this.#re=null;u(t)})}this.#re.write(t);if(A){this.#re.write(B)}this.#re.flush(()=>{if(!this.#re){return}const t=Buffer.concat(this.#re[I],this.#re[m]);this.#re[I].length=0;this.#re[m]=0;u(null,t)})}}t.exports={PerMessageDeflate:PerMessageDeflate}},5975:(t,A,u)=>{const{Writable:d}=u(7075);const E=u(4589);const{parserStates:C,opcodes:Q,states:B,emptyBuffer:I,sentCloseFrameState:m}=u(8397);const{kReadyState:y,kSentClose:b,kResponse:D,kReceivedClose:R}=u(7609);const{channels:k}=u(9978);const{isValidStatusCode:S,isValidOpcode:v,failWebsocketConnection:x,websocketMessageReceived:N,utf8Decode:L,isControlFrame:M,isTextBinaryFrame:T,isContinuationFrame:H}=u(8098);const{WebsocketFrameSend:G}=u(9321);const{closeWebSocketConnection:Y}=u(1874);const{PerMessageDeflate:O}=u(6286);const{MessageSizeExceededError:_}=u(6246);function failWebsocketConnectionWithCode(t,A,u){Y(t,A,u,Buffer.byteLength(u));x(t,u)}class ByteParser extends d{#n=[];#ne=0;#o=0;#oe=false;#a=C.INFO;#c={};#l=[];#d;#ae;#ie;constructor(t,A,u={}){super();this.ws=t;this.#d=A==null?new Map:A;this.#ae=u.maxFragments??0;this.#ie=u.maxPayloadSize??0;if(this.#d.has("permessage-deflate")){this.#d.set("permessage-deflate",new O(A,u))}}_write(t,A,u){this.#n.push(t);this.#o+=t.length;this.#oe=true;this.run(u)}#ce(){if(this.#ie>0&&!M(this.#c.opcode)&&this.#c.payloadLength+this.#ne>this.#ie){failWebsocketConnectionWithCode(this.ws,1009,"Payload size exceeds maximum allowed size");return false}return true}run(t){while(this.#oe){if(this.#a===C.INFO){if(this.#o<2){return t()}const A=this.consume(2);const u=(A[0]&128)!==0;const d=A[0]&15;const E=(A[1]&128)===128;const B=!u&&d!==Q.CONTINUATION;const I=A[1]&127;const m=A[0]&64;const y=A[0]&32;const b=A[0]&16;if(!v(d)){x(this.ws,"Invalid opcode received");return t()}if(E){x(this.ws,"Frame cannot be masked");return t()}if(m!==0&&!this.#d.has("permessage-deflate")){x(this.ws,"Expected RSV1 to be clear.");return}if(y!==0||b!==0){x(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(B&&!T(d)){x(this.ws,"Invalid frame type was fragmented.");return}if(T(d)&&this.#l.length>0){x(this.ws,"Expected continuation frame");return}if(this.#c.fragmented&&B){x(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((I>125||B)&&M(d)){x(this.ws,"Control frame either too large or fragmented");return}if(H(d)&&this.#l.length===0&&!this.#c.compressed){x(this.ws,"Unexpected continuation frame");return}if(I<=125){this.#c.payloadLength=I;this.#a=C.READ_DATA;if(!this.#ce()){return}}else if(I===126){this.#a=C.PAYLOADLENGTH_16}else if(I===127){this.#a=C.PAYLOADLENGTH_64}if(T(d)){this.#c.binaryType=d;this.#c.compressed=m!==0}this.#c.opcode=d;this.#c.masked=E;this.#c.fin=u;this.#c.fragmented=B}else if(this.#a===C.PAYLOADLENGTH_16){if(this.#o<2){return t()}const A=this.consume(2);this.#c.payloadLength=A.readUInt16BE(0);this.#a=C.READ_DATA;if(!this.#ce()){return}}else if(this.#a===C.PAYLOADLENGTH_64){if(this.#o<8){return t()}const A=this.consume(8);const u=A.readUInt32BE(0);const d=A.readUInt32BE(4);if(u!==0||d>2**31-1){x(this.ws,"Received payload length > 2^31 bytes.");return}this.#c.payloadLength=d;this.#a=C.READ_DATA;if(!this.#ce()){return}}else if(this.#a===C.READ_DATA){if(this.#o<this.#c.payloadLength){return t()}const A=this.consume(this.#c.payloadLength);if(M(this.#c.opcode)){this.#oe=this.parseControlFrame(A);this.#a=C.INFO}else{if(!this.#c.compressed){if(!this.writeFragments(A)){return}if(this.#ie>0&&this.#ne>this.#ie){failWebsocketConnectionWithCode(this.ws,1009,(new _).message);return}if(!this.#c.fragmented&&this.#c.fin){N(this.ws,this.#c.binaryType,this.consumeFragments())}this.#a=C.INFO}else{this.#d.get("permessage-deflate").decompress(A,this.#c.fin,(A,u)=>{if(A){const t=A instanceof _?1009:1007;failWebsocketConnectionWithCLine truncated
|