chore(deps): update dependency glob to v13.0.3 (#68)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [glob](https://github.com/isaacs/node-glob) | [`13.0.0` → `13.0.3`](https://renovatebot.com/diffs/npm/glob/13.0.0/13.0.3) |  |  | --- ### Release Notes <details> <summary>isaacs/node-glob (glob)</summary> ### [`v13.0.3`](https://github.com/isaacs/node-glob/compare/v13.0.2...782e3a74b42d8f71deca7b4b74cea17a600e59d2) [Compare Source](https://github.com/isaacs/node-glob/compare/v13.0.2...v13.0.3) ### [`v13.0.2`](https://github.com/isaacs/node-glob/compare/v13.0.1...2135b0c3580caf6330e28dedb2d57cea75f15154) [Compare Source](https://github.com/isaacs/node-glob/compare/v13.0.1...v13.0.2) ### [`v13.0.1`](https://github.com/isaacs/node-glob/compare/v13.0.0...v13.0.1) [Compare Source](https://github.com/isaacs/node-glob/compare/v13.0.0...v13.0.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45NC4wIiwidXBkYXRlZEluVmVyIjoiNDIuOTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiQXV0b21hdGlvbiJdfQ==--> Reviewed-on: #68 Co-authored-by: Renovate Bot <renovate@horstenkamp.eu> Co-committed-by: Renovate Bot <renovate@horstenkamp.eu>
This commit was merged in pull request #68.
This commit is contained in:
1 parent
684cc88afb
commit
96f131369e
2 files changed
+86
-34
No files matched your search
Vendored
+5
-5
@@ -1,16 +1,16 @@
|
||||
(()=>{var __webpack_modules__={6136:(module,__unused_webpack_exports,__nccwpck_require__)=>{const{ScreepsAPI:ScreepsAPI}=__nccwpck_require__(9546);const core=__nccwpck_require__(7484);const fs=__nccwpck_require__(9896);const{glob:glob}=__nccwpck_require__(1363);const path=__nccwpck_require__(6928);function replacePlaceholders(e,t){const s=(new Date).toISOString();return e.replace(/{{gitHash}}/g,process.env.GITHUB_SHA).replace(/{{gitRef}}/g,process.env.GITHUB_REF).replace(/{{deployTime}}/g,s).replace(/{{hostname}}/g,t)}async function readReplaceAndWriteFiles(e,t,s){const i=t?path.join(t,e):e;const n=await glob(i);let r=n.map((e=>fs.promises.readFile(e,"utf8").then((t=>{t=replacePlaceholders(t,s);return fs.promises.writeFile(e,t)}))));await Promise.all(r);return n}async function readFilesIntoDict(e,t){const s=t?path.join(t,e):e;const i=await glob(s);let n={};let r=i.map((e=>fs.promises.readFile(e,"utf8").then((s=>{let i=e;if(t&&e.startsWith(t)){i=i.slice(t.length)}i=path.basename(i,path.extname(i));n[i]=s}))));await Promise.all(r);return n}function validateAuthentication(e,t,s){if(e){if(t||s){return"Token is defined along with username and/or password."}}else{if(!t&&!s){return"Neither token nor password and username are defined."}if(t&&!s){return"Username is defined but no password is provided."}if(!t&&s){return"Password is defined but no username is provided."}}return null}async function postCode(){const e=core.getInput("protocol")||"https";const t=core.getInput("hostname")||"screeps.com";const s=core.getInput("port")||"443";const i=core.getInput("path")||"/";const n=core.getInput("token")||undefined;const r=core.getInput("username")||undefined;const o=core.getInput("password")||undefined;const a=core.getInput("source-prefix");const A=core.getInput("pattern")||"*.js";const c=core.getInput("branch")||"default";const l=core.getInput("git-replace")||null;if(l){await readReplaceAndWriteFiles(l,a,t)}const u=await readFilesIntoDict(A,a);core.info(`Trying to upload the following files to ${c}:`);Object.keys(u).forEach((e=>{core.info(`Key: ${e}`)}));const p={token:n,username:r,password:o,protocol:e,hostname:t,port:s,path:i};core.info("login_arguments:");core.info(JSON.stringify(p,null,2));const h=validateAuthentication(n,r,o);if(h){core.error(h);return}let d=new ScreepsAPI(p);if(n){const e=await d.code.set(c,u);core.info(JSON.stringify(e,null,2));console.log(`Code set successfully to ${c}`)}else{core.info(`Logging in as user ${r}`);await Promise.resolve().then((()=>d.auth(r,o,p))).then((()=>{d.code.set(c,u)})).then((()=>{console.log(`Code set successfully to ${c}`)})).catch((e=>{console.error("Error:",e)}))}}if(require.main===require.cache[eval("__filename")]){postCode()}module.exports={validateAuthentication:validateAuthentication,replacePlaceholders:replacePlaceholders,postCode:postCode,readReplaceAndWriteFiles:readReplaceAndWriteFiles,readFilesIntoDict:readFilesIntoDict}},4914:function(e,t,s){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,s,i){if(i===undefined)i=s;var n=Object.getOwnPropertyDescriptor(t,s);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[s]}}}Object.defineProperty(e,i,n)}:function(e,t,s,i){if(i===undefined)i=s;e[i]=t[s]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var r=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s))t[t.length]=s;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s=ownKeys(e),r=0;r<s.length;r++)if(s[r]!=="default")i(t,e,s[r]);n(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.issueCommand=issueCommand;t.issue=issue;const o=r(s(857));const a=s(302);function issueCommand(e,t,s){const i=new Command(e,t,s);process.stdout.write(i.toString()+o.EOL)}function issue(e,t=""){issueCommand(e,{},t)}const A="::";class Command{constructor(e,t,s){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=s}toString(){let e=A+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const s in this.properties){if(this.properties.hasOwnProperty(s)){const i=this.properties[s];if(i){if(t){t=false}else{e+=","}e+=`${s}=${escapeProperty(i)}`}}}}e+=`${A}${escapeData(this.message)}`;return e}}function escapeData(e){return(0,a.toCommandValue)(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return(0,a.toCommandValue)(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},7484:function(e,t,s){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,s,i){if(i===undefined)i=s;var n=Object.getOwnPropertyDescriptor(t,s);if(!n||("get"in n?!t.__esModule:nLine truncated
|
||||
(()=>{var __webpack_modules__={6136:(module,__unused_webpack_exports,__nccwpck_require__)=>{const{ScreepsAPI:ScreepsAPI}=__nccwpck_require__(9546);const core=__nccwpck_require__(7484);const fs=__nccwpck_require__(9896);const{glob:glob}=__nccwpck_require__(8941);const path=__nccwpck_require__(6928);function replacePlaceholders(i,A){const p=(new Date).toISOString();return i.replace(/{{gitHash}}/g,process.env.GITHUB_SHA).replace(/{{gitRef}}/g,process.env.GITHUB_REF).replace(/{{deployTime}}/g,p).replace(/{{hostname}}/g,A)}async function readReplaceAndWriteFiles(i,A,p){const g=A?path.join(A,i):i;const f=await glob(g);let E=f.map((i=>fs.promises.readFile(i,"utf8").then((A=>{A=replacePlaceholders(A,p);return fs.promises.writeFile(i,A)}))));await Promise.all(E);return f}async function readFilesIntoDict(i,A){const p=A?path.join(A,i):i;const g=await glob(p);let f={};let E=g.map((i=>fs.promises.readFile(i,"utf8").then((p=>{let g=i;if(A&&i.startsWith(A)){g=g.slice(A.length)}g=path.basename(g,path.extname(g));f[g]=p}))));await Promise.all(E);return f}function validateAuthentication(i,A,p){if(i){if(A||p){return"Token is defined along with username and/or password."}}else{if(!A&&!p){return"Neither token nor password and username are defined."}if(A&&!p){return"Username is defined but no password is provided."}if(!A&&p){return"Password is defined but no username is provided."}}return null}async function postCode(){const i=core.getInput("protocol")||"https";const A=core.getInput("hostname")||"screeps.com";const p=core.getInput("port")||"443";const g=core.getInput("path")||"/";const f=core.getInput("token")||undefined;const E=core.getInput("username")||undefined;const C=core.getInput("password")||undefined;const Q=core.getInput("source-prefix");const B=core.getInput("pattern")||"*.js";const I=core.getInput("branch")||"default";const y=core.getInput("git-replace")||null;if(y){await readReplaceAndWriteFiles(y,Q,A)}const w=await readFilesIntoDict(B,Q);core.info(`Trying to upload the following files to ${I}:`);Object.keys(w).forEach((i=>{core.info(`Key: ${i}`)}));const v={token:f,username:E,password:C,protocol:i,hostname:A,port:p,path:g};core.info("login_arguments:");core.info(JSON.stringify(v,null,2));const x=validateAuthentication(f,E,C);if(x){core.error(x);return}let k=new ScreepsAPI(v);if(f){const i=await k.code.set(I,w);core.info(JSON.stringify(i,null,2));console.log(`Code set successfully to ${I}`)}else{core.info(`Logging in as user ${E}`);await Promise.resolve().then((()=>k.auth(E,C,v))).then((()=>{k.code.set(I,w)})).then((()=>{console.log(`Code set successfully to ${I}`)})).catch((i=>{console.error("Error:",i)}))}}if(require.main===require.cache[eval("__filename")]){postCode()}module.exports={validateAuthentication:validateAuthentication,replacePlaceholders:replacePlaceholders,postCode:postCode,readReplaceAndWriteFiles:readReplaceAndWriteFiles,readFilesIntoDict:readFilesIntoDict}},4914:function(i,A,p){"use strict";var g=this&&this.__createBinding||(Object.create?function(i,A,p,g){if(g===undefined)g=p;var f=Object.getOwnPropertyDescriptor(A,p);if(!f||("get"in f?!A.__esModule:f.writable||f.configurable)){f={enumerable:true,get:function(){return A[p]}}}Object.defineProperty(i,g,f)}:function(i,A,p,g){if(g===undefined)g=p;i[g]=A[p]});var f=this&&this.__setModuleDefault||(Object.create?function(i,A){Object.defineProperty(i,"default",{enumerable:true,value:A})}:function(i,A){i["default"]=A});var E=this&&this.__importStar||function(){var ownKeys=function(i){ownKeys=Object.getOwnPropertyNames||function(i){var A=[];for(var p in i)if(Object.prototype.hasOwnProperty.call(i,p))A[A.length]=p;return A};return ownKeys(i)};return function(i){if(i&&i.__esModule)return i;var A={};if(i!=null)for(var p=ownKeys(i),E=0;E<p.length;E++)if(p[E]!=="default")g(A,i,p[E]);f(A,i);return A}}();Object.defineProperty(A,"__esModule",{value:true});A.issueCommand=issueCommand;A.issue=issue;const C=E(p(857));const Q=p(302);function issueCommand(i,A,p){const g=new Command(i,A,p);process.stdout.write(g.toString()+C.EOL)}function issue(i,A=""){issueCommand(i,{},A)}const B="::";class Command{constructor(i,A,p){if(!i){i="missing.command"}this.command=i;this.properties=A;this.message=p}toString(){let i=B+this.command;if(this.properties&&Object.keys(this.properties).length>0){i+=" ";let A=true;for(const p in this.properties){if(this.properties.hasOwnProperty(p)){const g=this.properties[p];if(g){if(A){A=false}else{i+=","}i+=`${p}=${escapeProperty(g)}`}}}}i+=`${B}${escapeData(this.message)}`;return i}}function escapeData(i){return(0,Q.toCommandValue)(i).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(i){return(0,Q.toCommandValue)(i).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},7484:function(i,A,p){"use strict";var g=this&&this.__createBinding||(Object.create?function(i,A,p,g){if(g===undefined)g=p;var f=Object.getOwnPropertyDescriptor(A,p);if(!f||("get"in f?!A.__esModule:fLine truncated
|
||||
/*!
|
||||
* mime-db
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
e.exports=s(1813)},4096:(e,t,s)=>{"use strict";
|
||||
i.exports=p(1813)},4096:(i,A,p)=>{"use strict";
|
||||
/*!
|
||||
* mime-types
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/var i=s(9829);var n=s(6928).extname;var r=/^\s*([^;\s]*)(?:;|\s|$)/;var o=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=r.exec(e);var s=t&&i[t[1].toLowerCase()];if(s&&s.charset){return s.charset}if(t&&o.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var s=e.indexOf("/")===-1?t.lookup(e):e;if(!s){return false}if(s.indexOf("charset")===-1){var i=t.charset(s);if(i)s+="; charset="+i.toLowerCase()}return s}function extension(e){if(!e||typeof e!=="string"){return false}var s=r.exec(e);var i=s&&t.extensions[s[1].toLowerCase()];if(!i||!i.length){return false}return i[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var s=n("x."+e).toLowerCase().substr(1);if(!s){return false}return t.types[s]||false}function populateMaps(e,t){var s=["nginx","apache",undefined,"iana"];Object.keys(i).forEach((function forEachMimeType(n){var r=i[n];var o=r.extensions;if(!o||!o.length){return}e[n]=o;for(var a=0;a<o.length;a++){var A=o[a];if(t[A]){var c=s.indexOf(i[t[A]].source);var l=s.indexOf(r.source);if(t[A]!=="application/octet-stream"&&(c>l||c===l&&t[A].substr(0,12)==="application/")){continue}}t[A]=n}}))}},744:e=>{var t=1e3;var s=t*60;var i=s*60;var n=i*24;var r=n*7;var o=n*365.25;e.exports=function(e,t){t=t||{};var s=typeof e;if(s==="string"&&e.length>0){return parse(e)}else if(s==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var A=parseFloat(a[1]);var c=(a[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return A*o;case"weeks":case"week":case"w":return A*r;case"days":case"day":case"d":return A*n;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*s;case"seconds":case"second":case"secs":case"sec":case"s":return A*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return undefined}}function fmtShort(e){var r=Math.abs(e);if(r>=n){return Math.round(e/n)+"d"}if(r>=i){return Math.round(e/i)+"h"}if(r>=s){return Math.round(e/s)+"m"}if(r>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var r=Math.abs(e);if(r>=n){return plural(e,r,n,"day")}if(r>=i){return plural(e,r,i,"hour")}if(r>=s){return plural(e,r,s,"minute")}if(r>=t){return plural(e,r,t,"second")}return e+" ms"}function plural(e,t,s,i){var n=t>=s*1.5;return Math.round(e/s)+" "+i+(n?"s":"")}},7777:(e,t,s)=>{"use strict";var i=s(7016).parse;var n={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var r=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function getProxyForUrl(e){var t=typeof e==="string"?i(e):e||{};var s=t.protocol;var r=t.host;var o=t.port;if(typeof r!=="string"||!r||typeof s!=="string"){return""}s=s.split(":",1)[0];r=r.replace(/:\d*$/,"");o=parseInt(o)||n[s]||0;if(!shouldProxy(r,o)){return""}var a=getEnv("npm_config_"+s+"_proxy")||getEnv(s+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(a&&a.indexOf("://")===-1){a=s+"://"+a}return a}function shouldProxy(e,t){var s=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!s){return true}if(s==="*"){return false}return s.split(/[,\s]/).every((function(s){if(!s){return true}var i=s.match(/^(.+):(\d+)$/);var n=i?i[1]:s;var o=i?parseInt(i[2]):0;if(o&&o!==t){return true}if(!/^[.*]/.test(n)){return e!==n}if(n.charAt(0)==="*"){n=n.slice(1)}return!r.call(e,n)}))}function getEnv(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}t.T=getProxyForUrl},9546:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const i=s(1354);const n=s(7016);const r=s(4434);const o=s(2830);const a=s(3106);const A=s(4922);const c=s(9023);const l=s(9896);const u=s(9557);const p=s(6928);function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}const h=_interopDefaultLegacy(i);const d=_interopDefaultLegacy(n);const f=_interopDefaultLegacy(o);const g=_interopDefaultLegacy(a);const E=_interopDefaultLegacy(A);const C=_interopDefaultLegacy(c);const Q=_interopDefaultLegacy(l);const B=_interopDefaultLegacy(u);const I=_interopDefaultLegacy(p);const y=f["default"]("screepsapi:socket");const b={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends r.EventEmitter{constructor(e){super();this.api=e;this.opts=Object.assign({},b);this.on("error",(()=>{}));this.reset();this.oLine truncated
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const i=[];const n=new Uint8Array([13,10]);l=0;let r=false;for(const[t,o]of e){if(typeof o==="string"){const e=b.encode(s+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(o)}\r\n`);i.push(e);l+=e.byteLength}else{const e=b.encode(`${s}; name="${escape(normalizeLinefeeds(t))}"`+(o.name?`; filename="${escape(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r\n\r\n`);i.push(e,o,n);if(typeof o.size==="number"){l+=e.byteLength+o.size+n.byteLength}else{r=true}}}const o=b.encode(`--${t}--\r\n`);i.push(o);l+=o.byteLength;if(r){l=null}c=e;A=async function*(){for(const e of i){if(e.stream){yield*e.stream()}else{yield e}}};u=`multipart/form-data; boundary=${t}`}else if(r(e)){c=e;l=e.size;if(e.type){u=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(i.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}s=e instanceof ReadableStream?e:n(e)}if(typeof c==="string"||i.isBuffer(c)){l=Buffer.byteLength(c)}if(A!=null){let t;s=new ReadableStream({async start(){t=A(e)[Symbol.asyncIterator]()},async pull(e){const{value:i,done:n}=await t.next();if(n){queueMicrotask((()=>{e.close();e.byobRequest?.respond(0)}))}else{if(!E(s)){const t=new Uint8Array(i);if(t.byteLength){e.enqueue(t)}}}return e.desiredSize>0},async cancel(e){await t.return()},type:"bytes"})}const p={stream:s,source:c,length:l};return[p,u]}function safelyExtractBody(e,t=false){if(e instanceof ReadableStream){g(!i.isDisturbed(e),"The body has already been consumed.");g(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e,t){const[s,i]=t.stream.tee();t.stream=s;return{stream:i,length:t.length,source:t.source}}function throwIfAborted(e){if(e.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return consumeBody(this,(e=>{let t=bodyMimeType(this);if(t===null){t=""}else if(t){t=B(t)}return new f([e],{type:t})}),e)},arrayBuffer(){return consumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return consumeBody(this,u,e)},json(){return consumeBody(this,parseJSONFromBytes,e)},formData(){return consumeBody(this,(e=>{const t=bodyMimeType(this);if(t!==null){switch(t.essence){case"multipart/form-data":{const s=I(e,t);if(s==="failure"){throw new TypeError("Failed to parse body as FormData.")}const i=new p;i[h]=s;return i}case"application/x-www-form-urlencoded":{const t=new URLSearchParams(e.toString());const s=new p;for(const[e,i]of t){s.append(e,i)}return s}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),e)},bytes(){return consumeBody(this,(e=>new Uint8Array(e)),e)}};return t}function mixinBody(e){Object.assign(e.prototype,bodyMixinMethods(e))}async function consumeBody(e,t,s){d.brandCheck(e,s);if(bodyUnusable(e)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(e[h]);const i=A();const errorSteps=e=>i.reject(e);const successSteps=e=>{try{i.resolve(t(e))}catch(e){errorSteps(e)}};if(e[h].body==null){successSteps(Buffer.allocUnsafe(0));return i.promise}await c(e[h].body,successSteps,errorSteps);return i.promise}function bodyUnusable(e){const t=e[h].body;return t!=null&&(t.stream.locked||i.isDisturbed(t.stream))}function parseJSONFromBytes(e){return JSON.parse(u(e))}function bodyMimeType(e){const t=e[h].headersList;const s=l(t);if(s==="failure"){return null}return s}e.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:v,hasFinalizationRegistry:w,bodyUnusable:bodyUnusable}},4495:e=>{"use strict";const t=["GET","HEAD","POST"];const s=new Set(t);const i=[101,204,205,304];const n=[301,302,303,307,308];const r=new Set(n);const o=["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 a=new Set(o);const A=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const c=new Set(A);const l=["follow","manual","error"];const u=["GET","HEAD","OPTIONS","TRACE"];const p=new Set(u);const h=["navigate","same-origin","no-cors","cors"];const d=["omit","same-origin","include"];const f=["default","no-store","reload","no-caLine truncated
|
||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */a[o-4]=s[0];a[o-3]=s[1];a[o-2]=s[2];a[o-1]=s[3];a[1]=r;if(r===126){a.writeUInt16BE(n,2)}else if(r===127){a[2]=a[3]=0;a.writeUIntBE(n,4,6)}a[1]|=128;for(let e=0;e<n;++e){a[o+e]=t[e]^s[e&3]}return a}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(e,t,s)=>{"use strict";const{createInflateRaw:i,Z_DEFAULT_WINDOWBITS:n}=s(8522);const{isValidClientWindowBits:r}=s(8625);const o=Buffer.from([0,0,255,255]);const a=Symbol("kBuffer");const A=Symbol("kLength");class PerMessageDeflate{#Z;#h={};constructor(e){this.#h.serverNoContextTakeover=e.has("server_no_context_takeover");this.#h.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,t,s){if(!this.#Z){let e=n;if(this.#h.serverMaxWindowBits){if(!r(this.#h.serverMaxWindowBits)){s(new Error("Invalid server_max_window_bits"));return}e=Number.parseInt(this.#h.serverMaxWindowBits)}this.#Z=i({windowBits:e});this.#Z[a]=[];this.#Z[A]=0;this.#Z.on("data",(e=>{this.#Z[a].push(e);this.#Z[A]+=e.length}));this.#Z.on("error",(e=>{this.#Z=null;s(e)}))}this.#Z.write(e);if(t){this.#Z.write(o)}this.#Z.flush((()=>{const e=Buffer.concat(this.#Z[a],this.#Z[A]);this.#Z[a].length=0;this.#Z[A]=0;s(null,e)}))}}e.exports={PerMessageDeflate:PerMessageDeflate}},1652:(e,t,s)=>{"use strict";const{Writable:i}=s(7075);const n=s(4589);const{parserStates:r,opcodes:o,states:a,emptyBuffer:A,sentCloseFrameState:c}=s(736);const{kReadyState:l,kSentClose:u,kResponse:p,kReceivedClose:h}=s(1216);const{channels:d}=s(2414);const{isValidStatusCode:f,isValidOpcode:g,failWebsocketConnection:E,websocketMessageReceived:C,utf8Decode:Q,isControlFrame:B,isTextBinaryFrame:I,isContinuationFrame:y}=s(8625);const{WebsocketFrameSend:b}=s(3264);const{closeWebSocketConnection:w}=s(6897);const{PerMessageDeflate:v}=s(9469);class ByteParser extends i{#K=[];#X=0;#$=false;#Q=r.INFO;#ee={};#te=[];#se;constructor(e,t){super();this.ws=e;this.#se=t==null?new Map:t;if(this.#se.has("permessage-deflate")){this.#se.set("permessage-deflate",new v(t))}}_write(e,t,s){this.#K.push(e);this.#X+=e.length;this.#$=true;this.run(s)}run(e){while(this.#$){if(this.#Q===r.INFO){if(this.#X<2){return e()}const t=this.consume(2);const s=(t[0]&128)!==0;const i=t[0]&15;const n=(t[1]&128)===128;const a=!s&&i!==o.CONTINUATION;const A=t[1]&127;const c=t[0]&64;const l=t[0]&32;const u=t[0]&16;if(!g(i)){E(this.ws,"Invalid opcode received");return e()}if(n){E(this.ws,"Frame cannot be masked");return e()}if(c!==0&&!this.#se.has("permessage-deflate")){E(this.ws,"Expected RSV1 to be clear.");return}if(l!==0||u!==0){E(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(a&&!I(i)){E(this.ws,"Invalid frame type was fragmented.");return}if(I(i)&&this.#te.length>0){E(this.ws,"Expected continuation frame");return}if(this.#ee.fragmented&&a){E(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((A>125||a)&&B(i)){E(this.ws,"Control frame either too large or fragmented");return}if(y(i)&&this.#te.length===0&&!this.#ee.compressed){E(this.ws,"Unexpected continuation frame");return}if(A<=125){this.#ee.payloadLength=A;this.#Q=r.READ_DATA}else if(A===126){this.#Q=r.PAYLOADLENGTH_16}else if(A===127){this.#Q=r.PAYLOADLENGTH_64}if(I(i)){this.#ee.binaryType=i;this.#ee.compressed=c!==0}this.#ee.opcode=i;this.#ee.masked=n;this.#ee.fin=s;this.#ee.fragmented=a}else if(this.#Q===r.PAYLOADLENGTH_16){if(this.#X<2){return e()}const t=this.consume(2);this.#ee.payloadLength=t.readUInt16BE(0);this.#Q=r.READ_DATA}else if(this.#Q===r.PAYLOADLENGTH_64){if(this.#X<8){return e()}const t=this.consume(8);const s=t.readUInt32BE(0);if(s>2**31-1){E(this.ws,"Received payload length > 2^31 bytes.");return}const i=t.readUInt32BE(4);this.#ee.payloadLength=(s<<8)+i;this.#Q=r.READ_DATA}else if(this.#Q===r.READ_DATA){if(this.#X<this.#ee.payloadLength){return e()}const t=this.consume(this.#ee.payloadLength);if(B(this.#ee.opcode)){this.#$=this.parseControlFrame(t);this.#Q=r.INFO}else{if(!this.#ee.compressed){this.#te.push(t);if(!this.#ee.fragmented&&this.#ee.fin){const e=Buffer.concat(this.#te);C(this.ws,this.#ee.binaryType,e);this.#te.length=0}this.#Q=r.INFO}else{this.#se.get("permessage-deflate").decompress(t,this.#ee.fin,((t,s)=>{if(t){w(this.ws,1007,t.message,t.message.length);return}this.#te.push(s);if(!this.#ee.fin){this.#Q=r.INFO;this.#$=true;this.run(e);return}C(this.ws,this.#ee.binaryType,Buffer.concat(this.#te));this.#$=true;this.#Q=r.INFO;this.#te.length=0;this.run(e)}));this.#$=false;break}}}}}consume(e){if(e>this.#X){throw new Error("Called consume() before buffers satiated.")}else if(e===0){return A}if(this.#K[0].length===e){this.#X-=this.#K[0].length;return this.#K.shift()}const t=Buffer.allocUnsafe(e);let s=0;while(s!==e){const i=this.#K[0];const{length:n}=i;if(n+s===e){t.set(this.#K.shift(),s);break}else if(n+s>e){t.set(i.subarray(0,e-s),s);this.#K[0]=i.subarray(e-s);break}else{t.set(this.#K.shift(),s);s+=i.length}}this.#X-=e;return t}parseCloseBody(e){n(e.length!==1);let t;if(e.length>=2){t=e.readUInt16BE(0)}if(Line truncated
|
||||
*/var g=p(9829);var f=p(6928).extname;var E=/^\s*([^;\s]*)(?:;|\s|$)/;var C=/^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(i){if(!i||typeof i!=="string"){return false}var A=E.exec(i);var p=A&&g[A[1].toLowerCase()];if(p&&p.charset){return p.charset}if(A&&C.test(A[1])){return"UTF-8"}return false}function contentType(i){if(!i||typeof i!=="string"){return false}var p=i.indexOf("/")===-1?A.lookup(i):i;if(!p){return false}if(p.indexOf("charset")===-1){var g=A.charset(p);if(g)p+="; charset="+g.toLowerCase()}return p}function extension(i){if(!i||typeof i!=="string"){return false}var p=E.exec(i);var g=p&&A.extensions[p[1].toLowerCase()];if(!g||!g.length){return false}return g[0]}function lookup(i){if(!i||typeof i!=="string"){return false}var p=f("x."+i).toLowerCase().substr(1);if(!p){return false}return A.types[p]||false}function populateMaps(i,A){var p=["nginx","apache",undefined,"iana"];Object.keys(g).forEach((function forEachMimeType(f){var E=g[f];var C=E.extensions;if(!C||!C.length){return}i[f]=C;for(var Q=0;Q<C.length;Q++){var B=C[Q];if(A[B]){var I=p.indexOf(g[A[B]].source);var y=p.indexOf(E.source);if(A[B]!=="application/octet-stream"&&(I>y||I===y&&A[B].substr(0,12)==="application/")){continue}}A[B]=f}}))}},744:i=>{var A=1e3;var p=A*60;var g=p*60;var f=g*24;var E=f*7;var C=f*365.25;i.exports=function(i,A){A=A||{};var p=typeof i;if(p==="string"&&i.length>0){return parse(i)}else if(p==="number"&&isFinite(i)){return A.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 Q=/^(-?(?:\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(!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*C;case"weeks":case"week":case"w":return B*E;case"days":case"day":case"d":return B*f;case"hours":case"hour":case"hrs":case"hr":case"h":return B*g;case"minutes":case"minute":case"mins":case"min":case"m":return B*p;case"seconds":case"second":case"secs":case"sec":case"s":return B*A;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return B;default:return undefined}}function fmtShort(i){var E=Math.abs(i);if(E>=f){return Math.round(i/f)+"d"}if(E>=g){return Math.round(i/g)+"h"}if(E>=p){return Math.round(i/p)+"m"}if(E>=A){return Math.round(i/A)+"s"}return i+"ms"}function fmtLong(i){var E=Math.abs(i);if(E>=f){return plural(i,E,f,"day")}if(E>=g){return plural(i,E,g,"hour")}if(E>=p){return plural(i,E,p,"minute")}if(E>=A){return plural(i,E,A,"second")}return i+" ms"}function plural(i,A,p,g){var f=A>=p*1.5;return Math.round(i/p)+" "+g+(f?"s":"")}},7777:(i,A,p)=>{"use strict";var g=p(7016).parse;var f={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var E=String.prototype.endsWith||function(i){return i.length<=this.length&&this.indexOf(i,this.length-i.length)!==-1};function getProxyForUrl(i){var A=typeof i==="string"?g(i):i||{};var p=A.protocol;var E=A.host;var C=A.port;if(typeof E!=="string"||!E||typeof p!=="string"){return""}p=p.split(":",1)[0];E=E.replace(/:\d*$/,"");C=parseInt(C)||f[p]||0;if(!shouldProxy(E,C)){return""}var Q=getEnv("npm_config_"+p+"_proxy")||getEnv(p+"_proxy")||getEnv("npm_config_proxy")||getEnv("all_proxy");if(Q&&Q.indexOf("://")===-1){Q=p+"://"+Q}return Q}function shouldProxy(i,A){var p=(getEnv("npm_config_no_proxy")||getEnv("no_proxy")).toLowerCase();if(!p){return true}if(p==="*"){return false}return p.split(/[,\s]/).every((function(p){if(!p){return true}var g=p.match(/^(.+):(\d+)$/);var f=g?g[1]:p;var C=g?parseInt(g[2]):0;if(C&&C!==A){return true}if(!/^[.*]/.test(f)){return i!==f}if(f.charAt(0)==="*"){f=f.slice(1)}return!E.call(i,f)}))}function getEnv(i){return process.env[i.toLowerCase()]||process.env[i.toUpperCase()]||""}A.T=getProxyForUrl},9546:(i,A,p)=>{"use strict";Object.defineProperty(A,"__esModule",{value:true});const g=p(1354);const f=p(7016);const E=p(4434);const C=p(2830);const Q=p(3106);const B=p(4922);const I=p(9023);const y=p(9896);const w=p(9557);const v=p(6928);function _interopDefaultLegacy(i){return i&&typeof i==="object"&&"default"in i?i:{default:i}}const x=_interopDefaultLegacy(g);const k=_interopDefaultLegacy(f);const S=_interopDefaultLegacy(C);const D=_interopDefaultLegacy(Q);const N=_interopDefaultLegacy(B);const T=_interopDefaultLegacy(I);const M=_interopDefaultLegacy(y);const U=_interopDefaultLegacy(w);const L=_interopDefaultLegacy(v);const _=S["default"]("screepsapi:socket");const O={reconnect:true,resubscribe:true,keepAlive:true,maxRetries:10,maxRetryDelay:60*1e3};class Socket extends E.EventEmitter{constructor(i){super();this.api=i;this.opts=Object.assign({},O);this.on("error",(()=>{}));this.reset();this.oLine 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 g=[];const f=new Uint8Array([13,10]);y=0;let E=false;for(const[A,C]of i){if(typeof C==="string"){const i=O.encode(p+`; name="${escape(normalizeLinefeeds(A))}"`+`\r\n\r\n${normalizeLinefeeds(C)}\r\n`);g.push(i);y+=i.byteLength}else{const i=O.encode(`${p}; name="${escape(normalizeLinefeeds(A))}"`+(C.name?`; filename="${escape(C.name)}"`:"")+"\r\n"+`Content-Type: ${C.type||"application/octet-stream"}\r\n\r\n`);g.push(i,C,f);if(typeof C.size==="number"){y+=i.byteLength+C.size+f.byteLength}else{E=true}}}const C=O.encode(`--${A}--\r\n`);g.push(C);y+=C.byteLength;if(E){y=null}I=i;B=async function*(){for(const i of g){if(i.stream){yield*i.stream()}else{yield i}}};w=`multipart/form-data; boundary=${A}`}else if(E(i)){I=i;y=i.size;if(i.type){w=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(A){throw new TypeError("keepalive")}if(g.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}p=i instanceof ReadableStream?i:f(i)}if(typeof I==="string"||g.isBuffer(I)){y=Buffer.byteLength(I)}if(B!=null){let A;p=new ReadableStream({async start(){A=B(i)[Symbol.asyncIterator]()},async pull(i){const{value:g,done:f}=await A.next();if(f){queueMicrotask((()=>{i.close();i.byobRequest?.respond(0)}))}else{if(!N(p)){const A=new Uint8Array(g);if(A.byteLength){i.enqueue(A)}}}return i.desiredSize>0},async cancel(i){await A.return()},type:"bytes"})}const v={stream:p,source:I,length:y};return[v,w]}function safelyExtractBody(i,A=false){if(i instanceof ReadableStream){D(!g.isDisturbed(i),"The body has already been consumed.");D(!i.locked,"The stream is locked.")}return extractBody(i,A)}function cloneBody(i,A){const[p,g]=A.stream.tee();A.stream=p;return{stream:g,length:A.length,source:A.source}}function throwIfAborted(i){if(i.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const A={blob(){return consumeBody(this,(i=>{let A=bodyMimeType(this);if(A===null){A=""}else if(A){A=U(A)}return new S([i],{type:A})}),i)},arrayBuffer(){return consumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return consumeBody(this,w,i)},json(){return consumeBody(this,parseJSONFromBytes,i)},formData(){return consumeBody(this,(i=>{const A=bodyMimeType(this);if(A!==null){switch(A.essence){case"multipart/form-data":{const p=L(i,A);if(p==="failure"){throw new TypeError("Failed to parse body as FormData.")}const g=new v;g[x]=p;return g}case"application/x-www-form-urlencoded":{const A=new URLSearchParams(i.toString());const p=new v;for(const[i,g]of A){p.append(i,g)}return p}}}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 A}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function consumeBody(i,A,p){k.brandCheck(i,p);if(bodyUnusable(i)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(i[x]);const g=B();const errorSteps=i=>g.reject(i);const successSteps=i=>{try{g.resolve(A(i))}catch(i){errorSteps(i)}};if(i[x].body==null){successSteps(Buffer.allocUnsafe(0));return g.promise}await I(i[x].body,successSteps,errorSteps);return g.promise}function bodyUnusable(i){const A=i[x].body;return A!=null&&(A.stream.locked||g.isDisturbed(A.stream))}function parseJSONFromBytes(i){return JSON.parse(w(i))}function bodyMimeType(i){const A=i[x].headersList;const p=y(A);if(p==="failure"){return null}return p}i.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:H,hasFinalizationRegistry:G,bodyUnusable:bodyUnusable}},4495:i=>{"use strict";const A=["GET","HEAD","POST"];const p=new Set(A);const g=[101,204,205,304];const f=[301,302,303,307,308];const E=new Set(f);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 Q=new Set(C);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 w=["GET","HEAD","OPTIONS","TRACE"];const v=new Set(w);const x=["navigate","same-origin","no-cors","cors"];const k=["omit","same-origin","include"];const S=["default","no-store","reload","no-caLine truncated
|
||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */Q[C-4]=p[0];Q[C-3]=p[1];Q[C-2]=p[2];Q[C-1]=p[3];Q[1]=E;if(E===126){Q.writeUInt16BE(f,2)}else if(E===127){Q[2]=Q[3]=0;Q.writeUIntBE(f,4,6)}Q[1]|=128;for(let i=0;i<f;++i){Q[C+i]=A[i]^p[i&3]}return Q}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(i,A,p)=>{"use strict";const{createInflateRaw:g,Z_DEFAULT_WINDOWBITS:f}=p(8522);const{isValidClientWindowBits:E}=p(8625);const C=Buffer.from([0,0,255,255]);const Q=Symbol("kBuffer");const B=Symbol("kLength");class PerMessageDeflate{#Z;#h={};constructor(i){this.#h.serverNoContextTakeover=i.has("server_no_context_takeover");this.#h.serverMaxWindowBits=i.get("server_max_window_bits")}decompress(i,A,p){if(!this.#Z){let i=f;if(this.#h.serverMaxWindowBits){if(!E(this.#h.serverMaxWindowBits)){p(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#h.serverMaxWindowBits)}this.#Z=g({windowBits:i});this.#Z[Q]=[];this.#Z[B]=0;this.#Z.on("data",(i=>{this.#Z[Q].push(i);this.#Z[B]+=i.length}));this.#Z.on("error",(i=>{this.#Z=null;p(i)}))}this.#Z.write(i);if(A){this.#Z.write(C)}this.#Z.flush((()=>{const i=Buffer.concat(this.#Z[Q],this.#Z[B]);this.#Z[Q].length=0;this.#Z[B]=0;p(null,i)}))}}i.exports={PerMessageDeflate:PerMessageDeflate}},1652:(i,A,p)=>{"use strict";const{Writable:g}=p(7075);const f=p(4589);const{parserStates:E,opcodes:C,states:Q,emptyBuffer:B,sentCloseFrameState:I}=p(736);const{kReadyState:y,kSentClose:w,kResponse:v,kReceivedClose:x}=p(1216);const{channels:k}=p(2414);const{isValidStatusCode:S,isValidOpcode:D,failWebsocketConnection:N,websocketMessageReceived:T,utf8Decode:M,isControlFrame:U,isTextBinaryFrame:L,isContinuationFrame:_}=p(8625);const{WebsocketFrameSend:O}=p(3264);const{closeWebSocketConnection:G}=p(6897);const{PerMessageDeflate:H}=p(9469);class ByteParser extends g{#K=[];#X=0;#$=false;#Q=E.INFO;#ee={};#te=[];#se;constructor(i,A){super();this.ws=i;this.#se=A==null?new Map:A;if(this.#se.has("permessage-deflate")){this.#se.set("permessage-deflate",new H(A))}}_write(i,A,p){this.#K.push(i);this.#X+=i.length;this.#$=true;this.run(p)}run(i){while(this.#$){if(this.#Q===E.INFO){if(this.#X<2){return i()}const A=this.consume(2);const p=(A[0]&128)!==0;const g=A[0]&15;const f=(A[1]&128)===128;const Q=!p&&g!==C.CONTINUATION;const B=A[1]&127;const I=A[0]&64;const y=A[0]&32;const w=A[0]&16;if(!D(g)){N(this.ws,"Invalid opcode received");return i()}if(f){N(this.ws,"Frame cannot be masked");return i()}if(I!==0&&!this.#se.has("permessage-deflate")){N(this.ws,"Expected RSV1 to be clear.");return}if(y!==0||w!==0){N(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(Q&&!L(g)){N(this.ws,"Invalid frame type was fragmented.");return}if(L(g)&&this.#te.length>0){N(this.ws,"Expected continuation frame");return}if(this.#ee.fragmented&&Q){N(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((B>125||Q)&&U(g)){N(this.ws,"Control frame either too large or fragmented");return}if(_(g)&&this.#te.length===0&&!this.#ee.compressed){N(this.ws,"Unexpected continuation frame");return}if(B<=125){this.#ee.payloadLength=B;this.#Q=E.READ_DATA}else if(B===126){this.#Q=E.PAYLOADLENGTH_16}else if(B===127){this.#Q=E.PAYLOADLENGTH_64}if(L(g)){this.#ee.binaryType=g;this.#ee.compressed=I!==0}this.#ee.opcode=g;this.#ee.masked=f;this.#ee.fin=p;this.#ee.fragmented=Q}else if(this.#Q===E.PAYLOADLENGTH_16){if(this.#X<2){return i()}const A=this.consume(2);this.#ee.payloadLength=A.readUInt16BE(0);this.#Q=E.READ_DATA}else if(this.#Q===E.PAYLOADLENGTH_64){if(this.#X<8){return i()}const A=this.consume(8);const p=A.readUInt32BE(0);if(p>2**31-1){N(this.ws,"Received payload length > 2^31 bytes.");return}const g=A.readUInt32BE(4);this.#ee.payloadLength=(p<<8)+g;this.#Q=E.READ_DATA}else if(this.#Q===E.READ_DATA){if(this.#X<this.#ee.payloadLength){return i()}const A=this.consume(this.#ee.payloadLength);if(U(this.#ee.opcode)){this.#$=this.parseControlFrame(A);this.#Q=E.INFO}else{if(!this.#ee.compressed){this.#te.push(A);if(!this.#ee.fragmented&&this.#ee.fin){const i=Buffer.concat(this.#te);T(this.ws,this.#ee.binaryType,i);this.#te.length=0}this.#Q=E.INFO}else{this.#se.get("permessage-deflate").decompress(A,this.#ee.fin,((A,p)=>{if(A){G(this.ws,1007,A.message,A.message.length);return}this.#te.push(p);if(!this.#ee.fin){this.#Q=E.INFO;this.#$=true;this.run(i);return}T(this.ws,this.#ee.binaryType,Buffer.concat(this.#te));this.#$=true;this.#Q=E.INFO;this.#te.length=0;this.run(i)}));this.#$=false;break}}}}}consume(i){if(i>this.#X){throw new Error("Called consume() before buffers satiated.")}else if(i===0){return B}if(this.#K[0].length===i){this.#X-=this.#K[0].length;return this.#K.shift()}const A=Buffer.allocUnsafe(i);let p=0;while(p!==i){const g=this.#K[0];const{length:f}=g;if(f+p===i){A.set(this.#K.shift(),p);break}else if(f+p>i){A.set(g.subarray(0,i-p),p);this.#K[0]=g.subarray(i-p);break}else{A.set(this.#K.shift(),p);p+=g.length}}this.#X-=i;return A}parseCloseBody(i){f(i.length!==1);let A;if(i.length>=2){A=i.readUInt16BE(0)}if(Line truncated
|
||||
Generated
+81
-29
@@ -555,25 +555,13 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/balanced-match": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
|
||||
"integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
|
||||
"license": "MIT",
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-9.0.0.tgz",
|
||||
"integrity": "sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/brace-expansion": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz",
|
||||
"integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@isaacs/balanced-match": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/resolve-uri": {
|
||||
@@ -1202,6 +1190,20 @@
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/bufferutil": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz",
|
||||
"integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"node-gyp-build": "^4.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.14.2"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
@@ -1528,12 +1530,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.0.tgz",
|
||||
"integrity": "sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==",
|
||||
"version": "13.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.3.tgz",
|
||||
"integrity": "sha512-/g3B0mC+4x724v1TgtBlBtt2hPi/EWptsIAmXUx9Z2rvBYleQcsrmaOzd5LyL50jf/Soi83ZDJmw2+XqvH/EeA==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"minimatch": "^10.1.1",
|
||||
"minimatch": "^10.2.0",
|
||||
"minipass": "^7.1.2",
|
||||
"path-scurry": "^2.0.0"
|
||||
},
|
||||
@@ -1668,6 +1670,21 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/jackspeak": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.2.3.tgz",
|
||||
"integrity": "sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/cliui": "^9.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/js-tokens": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
|
||||
@@ -1753,12 +1770,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "10.1.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
|
||||
"integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.0.tgz",
|
||||
"integrity": "sha512-ugkC31VaVg9cF0DFVoADH12k6061zNZkZON+aX8AWsR9GhPcErkcMBceb6znR8wLERM2AkkOxy2nWRLpT9Jq5w==",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/brace-expansion": "^5.0.0"
|
||||
"brace-expansion": "^5.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
@@ -1767,6 +1784,30 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch/node_modules/balanced-match": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.2.tgz",
|
||||
"integrity": "sha512-x0K50QvKQ97fdEz2kPehIerj+YTeptKF9hyYkKf6egnwmMWAkADiO0QCzSp0R5xN8FTZgYaBfSaue46Ej62nMg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jackspeak": "^4.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch/node_modules/brace-expansion": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.2.tgz",
|
||||
"integrity": "sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/minipass": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
|
||||
@@ -1878,7 +1919,6 @@
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -2111,13 +2151,26 @@
|
||||
"node": ">=18.17"
|
||||
}
|
||||
},
|
||||
"node_modules/utf-8-validate": {
|
||||
"version": "5.0.10",
|
||||
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
|
||||
"integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"node-gyp-build": "^4.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.14.2"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "7.3.1",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
|
||||
"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.27.0",
|
||||
"fdir": "^6.5.0",
|
||||
@@ -2193,7 +2246,6 @@
|
||||
"integrity": "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vitest/expect": "4.0.18",
|
||||
"@vitest/mocker": "4.0.18",
|
||||
|
||||
Reference in new issue
Block a user