数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
107 KiB

2 years ago
"use strict";var Li=Object.defineProperty;var u=(c,l)=>Li(c,"name",{value:l,configurable:!0});var co=(c,l,d)=>{if(!l.has(c))throw TypeError("Cannot "+d)};var L=(c,l,d)=>(co(c,l,"read from private field"),d?d.call(c):l.get(c)),ue=(c,l,d)=>{if(l.has(c))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(c):l.set(c,d)},J=(c,l,d,b)=>(co(c,l,"write to private field"),b?b.call(c,d):l.set(c,d),d);var be,ct,et,Qt,Me,dt,ht,pt,X,bt,$e,De,mt;Object.defineProperty(exports,"__esModule",{value:!0});const http=require("node:http"),https=require("node:https"),zlib=require("node:zlib"),Stream=require("node:stream"),node_buffer=require("node:buffer"),node_util=require("node:util"),node_url=require("node:url"),node_net=require("node:net"),node_fs=require("node:fs"),node_path=require("node:path");function _interopDefaultCompat(c){return c&&typeof c=="object"&&"default"in c?c.default:c}u(_interopDefaultCompat,"_interopDefaultCompat");const http__default=_interopDefaultCompat(http),https__default=_interopDefaultCompat(https),zlib__default=_interopDefaultCompat(zlib),Stream__default=_interopDefaultCompat(Stream);function dataUriToBuffer(c){if(!/^data:/i.test(c))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');c=c.replace(/\r?\n/g,"");const l=c.indexOf(",");if(l===-1||l<=4)throw new TypeError("malformed data: URI");const d=c.substring(5,l).split(";");let b="",y=!1;const S=d[0]||"text/plain";let R=S;for(let N=1;N<d.length;N++)d[N]==="base64"?y=!0:d[N]&&(R+=`;${d[N]}`,d[N].indexOf("charset=")===0&&(b=d[N].substring(8)));!d[0]&&!b.length&&(R+=";charset=US-ASCII",b="US-ASCII");const C=y?"base64":"ascii",O=unescape(c.substring(l+1)),A=Buffer.from(O,C);return A.type=S,A.typeFull=R,A.charset=b,A}u(dataUriToBuffer,"dataUriToBuffer");var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}u(getDefaultExportFromCjs,"getDefaultExportFromCjs");var ponyfill_es2018={exports:{}},hasRequiredPonyfill_es2018;function requirePonyfill_es2018(){return hasRequiredPonyfill_es2018||(hasRequiredPonyfill_es2018=1,function(c,l){(function(d,b){b(l)})(commonjsGlobal,function(d){const b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:n=>`Symbol(${n})`;function y(){}u(y,"noop");function S(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof commonjsGlobal<"u")return commonjsGlobal}u(S,"getGlobals");const R=S();function C(n){return typeof n=="object"&&n!==null||typeof n=="function"}u(C,"typeIsObject");const O=y,A=Promise,N=Promise.prototype.then,oe=Promise.resolve.bind(A),H=Promise.reject.bind(A);function F(n){return new A(n)}u(F,"newPromise");function T(n){return oe(n)}u(T,"promiseResolvedWith");function v(n){return H(n)}u(v,"promiseRejectedWith");function j(n,o,a){return N.call(n,o,a)}u(j,"PerformPromiseThen");function D(n,o,a){j(j(n,o,a),void 0,O)}u(D,"uponPromise");function ie(n,o){D(n,o)}u(ie,"uponFulfillment");function tt(n,o){D(n,void 0,o)}u(tt,"uponRejection");function $(n,o,a){return j(n,o,a)}u($,"transformPromiseWith");function V(n){j(n,void 0,O)}u(V,"setPromiseIsHandledToTrue");const U=(()=>{const n=R&&R.queueMicrotask;if(typeof n=="function")return n;const o=T(void 0);return a=>j(o,a)})();function Pe(n,o,a){if(typeof n!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(n,o,a)}u(Pe,"reflectCall");function le(n,o,a){try{return T(Pe(n,o,a))}catch(p){return v(p)}}u(le,"promiseCall");const Gr=16384,Ar=class Ar{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(o){const a=this._back;let p=a;a._elements.length===Gr-1&&(p={_elements:[],_next:void 0}),a._elements.push(o),p!==a&&(this._back=p,a._next=p),++this._size}shift(){const o=this._front;let a=o;const p=this._cursor;let g=p+1;const _=o._elem
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e$1"),x=u((c,l,d)=>{if(l.length<d)throw new TypeError(`Failed to execute '${c}' on 'FormData': ${d} arguments required, but only ${l.length} present.`)},"x");const FormData=(bt=class{constructor(...l){ue(this,X,[]);if(l.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[t$1](){return"FormData"}[i](){return this.entries()}static[h](l){return l&&typeof l=="object"&&l[t$1]==="FormData"&&!m.some(d=>typeof l[d]!="function")}append(...l){x("append",arguments,2),L(this,X).push(f(...l))}delete(l){x("delete",arguments,1),l+="",J(this,X,L(this,X).filter(([d])=>d!==l))}get(l){x("get",arguments,1),l+="";for(var d=L(this,X),b=d.length,y=0;y<b;y++)if(d[y][0]===l)return d[y][1];return null}getAll(l,d){return x("getAll",arguments,1),d=[],l+="",L(this,X).forEach(b=>b[0]===l&&d.push(b[1])),d}has(l){return x("has",arguments,1),l+="",L(this,X).some(d=>d[0]===l)}forEach(l,d){x("forEach",arguments,1);for(var[b,y]of this)l.call(d,y,b,this)}set(...l){x("set",arguments,2);var d=[],b=!0;l=f(...l),L(this,X).forEach(y=>{y[0]===l[0]?b&&(b=!d.push(l)):d.push(y)}),b&&d.push(l),J(this,X,d)}*entries(){yield*L(this,X)}*keys(){for(var[l]of this)yield l}*values(){for(var[,l]of this)yield l}},X=new WeakMap,u(bt,"FormData"),bt);function formDataToBlob(c,l=r$1){var d=`${r()}${r()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),b=[],y=`--${d}\r
Content-Disposition: form-data; name="`;return c.forEach((S,R)=>typeof S=="string"?b.push(y+e$1(R)+`"\r
\r
${S.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
`)}\r
`):b.push(y+e$1(R)+`"; filename="${e$1(S.name,1)}"\r
Content-Type: ${S.type||"application/octet-stream"}\r
\r
`,S,`\r
`)),b.push(`--${d}--`),new l(b,{type:"multipart/form-data; boundary="+d})}u(formDataToBlob,"formDataToBlob");const Nr=class Nr extends Error{constructor(l,d){super(l),Error.captureStackTrace(this,this.constructor),this.type=d}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};u(Nr,"FetchBaseError");let FetchBaseError=Nr;const Hr=class Hr extends FetchBaseError{constructor(l,d,b){super(l,d),b&&(this.code=this.errno=b.code,this.erroredSysCall=b.syscall)}};u(Hr,"FetchError");let FetchError=Hr;const NAME=Symbol.toStringTag,isURLSearchParameters=u(c=>typeof c=="object"&&typeof c.append=="function"&&typeof c.delete=="function"&&typeof c.get=="function"&&typeof c.getAll=="function"&&typeof c.has=="function"&&typeof c.set=="function"&&typeof c.sort=="function"&&c[NAME]==="URLSearchParams","isURLSearchParameters"),isBlob=u(c=>c&&typeof c=="object"&&typeof c.arrayBuffer=="function"&&typeof c.type=="string"&&typeof c.stream=="function"&&typeof c.constructor=="function"&&/^(Blob|File)$/.test(c[NAME]),"isBlob"),isAbortSignal=u(c=>typeof c=="object"&&(c[NAME]==="AbortSignal"||c[NAME]==="EventTarget"),"isAbortSignal"),isDomainOrSubdomain=u((c,l)=>{const d=new URL(l).hostname,b=new URL(c).hostname;return d===b||d.endsWith(`.${b}`)},"isDomainOrSubdomain"),isSameProtocol=u((c,l)=>{const d=new URL(l).protocol,b=new URL(c).protocol;return d===b},"isSameProtocol"),pipeline=node_util.promisify(Stream__default.pipeline),INTERNALS$2=Symbol("Body internals"),Vr=class Vr{constructor(l,{size:d=0}={}){let b=null;l===null?l=null:isURLSearchParameters(l)?l=node_buffer.Buffer.from(l.toString()):isBlob(l)||node_buffer.Buffer.isBuffer(l)||(node_util.types.isAnyArrayBuffer(l)?l=node_buffer.Buffer.from(l):ArrayBuffer.isView(l)?l=node_buffer.Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof Stream__default||(l instanceof FormData?(l=formDataToBlob(l),b=l.type.split("=")[1]):l=node_buffer.Buffer.from(String(l))));let y=l;node_buffer.Buffer.isBuffer(l)?y=Stream__default.Readable.from(l):isBlob(l)&&(y=Stream__default.Readable.from(l.stream())),this[INTERNALS$2]={body:l,stream:y,boundary:b,disturbed:!1,error:null},this.size=d,l instanceof Stream__default&&l.on("error",S=>{const R=S instanceof FetchBaseError?S:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${S.message}`,"system",S);this[INTERNALS$2].error=R})}get body(){return this[INTERNALS$2].stream}get bodyUsed(){return this[INTERNALS$2].disturbed}async arrayBuffer(){const{buffer:l,byteOffset:d,byteLength:b}=await consumeBody(this);return l.slice(d,d+b)}async formData(){const l=this.headers.get("content-type");if(l.startsWith("application/x-www-form-urlencoded")){const b=new FormData,y=new URLSearchParams(await this.text());for(const[S,R]of y)b.append(S,R);return b}const{toFormData:d}=await import("./chunks/multipart-parser.cjs");return d(this.body,l)}async blob(){const l=this.headers&&this.headers.get("content-type")||this[INTERNALS$2].body&&this[INTERNALS$2].body.type||"",d=await this.arrayBuffer();return new r$1([d],{type:l})}async json(){const l=await this.text();return JSON.parse(l)}async text(){const l=await consumeBody(this);return new TextDecoder().decode(l)}buffer(){return consumeBody(this)}};u(Vr,"Body");let Body=Vr;Body.prototype.buffer=node_util.deprecate(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(Body.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:node_util.deprecate(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function consumeBody(c){if(c[INTERNALS$2].disturbed)throw new TypeError(`body used already for: ${c.url}`);if(c[INTERNALS$2].disturbed=!0,c[INTERNALS$2].error)throw c[INTERNALS$2].error;const{body:l}=c;if(l===null||!(l instanceof Stream__default))return node_buffer.Buffer.alloc(0);const d=[];let b
\r
`);let b=!1,y=!1,S;c.on("response",R=>{const{headers:C}=R;b=C["transfer-encoding"]==="chunked"&&!C["content-length"]}),c.on("socket",R=>{const C=u(()=>{if(b&&!y){const A=new Error("Premature close");A.code="ERR_STREAM_PREMATURE_CLOSE",l(A)}},"onSocketClose"),O=u(A=>{y=node_buffer.Buffer.compare(A.slice(-5),d)===0,!y&&S&&(y=node_buffer.Buffer.compare(S.slice(-3),d.slice(0,3))===0&&node_buffer.Buffer.compare(A.slice(-2),d.slice(3))===0),S=A},"onData");R.prependListener("close",C),R.on("data",O),c.on("close",()=>{R.removeListener("close",C),R.removeListener("data",O)})})}u(fixResponseChunkedTransferBadEnding,"fixResponseChunkedTransferBadEnding");const privateData=new WeakMap,wrappers=new WeakMap;function pd(c){const l=privateData.get(c);return console.assert(l!=null,"'this' is expected an Event object, but got",c),l}u(pd,"pd");function setCancelFlag(c){if(c.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",c.passiveListener);return}c.event.cancelable&&(c.canceled=!0,typeof c.event.preventDefault=="function"&&c.event.preventDefault())}u(setCancelFlag,"setCancelFlag");function Event(c,l){privateData.set(this,{eventTarget:c,event:l,eventPhase:2,currentTarget:c,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:l.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const d=Object.keys(l);for(let b=0;b<d.length;++b){const y=d[b];y in this||Object.defineProperty(this,y,defineRedirectDescriptor(y))}}u(Event,"Event"),Event.prototype={get type(){return pd(this).event.type},get target(){return pd(this).eventTarget},get currentTarget(){return pd(this).currentTarget},composedPath(){const c=pd(this).currentTarget;return c==null?[]:[c]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return pd(this).eventPhase},stopPropagation(){const c=pd(this);c.stopped=!0,typeof c.event.stopPropagation=="function"&&c.event.stopPropagation()},stopImmediatePropagation(){const c=pd(this);c.stopped=!0,c.immediateStopped=!0,typeof c.event.stopImmediatePropagation=="function"&&c.event.stopImmediatePropagation()},get bubbles(){return!!pd(this).event.bubbles},get cancelable(){return!!pd(this).event.cancelable},preventDefault(){setCancelFlag(pd(this))},get defaultPrevented(){return pd(this).canceled},get composed(){return!!pd(this).event.composed},get timeStamp(){return pd(this).timeStamp},get srcElement(){return pd(this).eventTarget},get cancelBubble(){return pd(this).stopped},set cancelBubble(c){if(!c)return;const l=pd(this);l.stopped=!0,typeof l.event.cancelBubble=="boolean"&&(l.event.cancelBubble=!0)},get returnValue(){return!pd(this).canceled},set returnValue(c){c||setCancelFlag(pd(this))},initEvent(){}},Object.defineProperty(Event.prototype,"constructor",{value:Event,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Event.prototype,window.Event.prototype),wrappers.set(window.Event.prototype,Event));function defineRedirectDescriptor(c){return{get(){return pd(this).event[c]},set(l){pd(this).event[c]=l},configurable:!0,enumerable:!0}}u(defineRedirectDescriptor,"defineRedirectDescriptor");function defineCallDescriptor(c){return{value(){const l=pd(this).event;return l[c].apply(l,arguments)},configurable:!0,enumerable:!0}}u(defineCallDescriptor,"defineCallDescriptor");function defineWrapper(c,l){const d=Object.keys(l);if(d.length===0)return c;function b(y,S){c.call(this,y,S)}u(b,"CustomEvent"),b.prototype=Object.create(c.prototype,{constructor:{value:b,configurable:!0,writable:!0}});for(let y=0;y<d.length;++y){const S=d[y];if(!(S in c.prototype)){const C=typeof Object.getOwnPropertyDescriptor(l,S).value=="function";Object.defineProperty(b.prototype,S,C?defineCallDescriptor(S):defineRedirectDescriptor(S))}}return b}u(defineWrapper,"defineWrapper");function getWrapper(c){if(c==null||c===Object.prototype)return Event;let l=wrappers.get(c);return l==null&&(l=defineWrapper(