mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-10 17:41:49 +08:00
255 lines
2.6 MiB
JavaScript
255 lines
2.6 MiB
JavaScript
|
|
#!/usr/bin/env node
|
|||
|
|
var E9=Object.defineProperty;var e0e=Object.getOwnPropertyDescriptor;var t0e=Object.getOwnPropertyNames;var r0e=Object.prototype.hasOwnProperty;var n0e=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),i0e=(e,t)=>{for(var r in t)E9(e,r,{get:t[r],enumerable:!0})},a0e=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of t0e(t))!r0e.call(e,i)&&i!==r&&E9(e,i,{get:()=>t[i],enumerable:!(n=e0e(t,i))||n.enumerable});return e};var Oi=e=>a0e(E9({},"__esModule",{value:!0}),e);var m1=h(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.isString=x9;en.isNumber=sM;en.isBoolean=lM;en.isObject=dv;en.isFunction=O9;en.isPlainObject=pv;en.isDictionary=o0e;en.isInstance=s0e;en.isClassAssignableTo=l0e;en.isArray=C9;en.isArrayLike=c0e;en.isAnyJson=u0e;en.isJsonMap=d0e;en.isJsonArray=p0e;en.isKeyOf=f0e;function x9(e){return typeof e=="string"}function sM(e){return typeof e=="number"}function lM(e){return typeof e=="boolean"}function dv(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function O9(e){return typeof e=="function"}function pv(e){let t=n=>dv(n)&&Object.prototype.toString.call(n)==="[object Object]";if(!t(e))return!1;let r=e.constructor;return!(!O9(r)||!t(r.prototype)||!r.prototype.hasOwnProperty("isPrototypeOf"))}function o0e(e){return pv(e)}function s0e(e,t){return e instanceof t}function l0e(e,t){return e===t||((n,i)=>dv(n)&&i in n)(e,"prototype")&&e.prototype instanceof t}function C9(e){return Array.isArray(e)}function c0e(e){let t=r=>dv(r)&&"length"in r;return!O9(e)&&(x9(e)||t(e))}function u0e(e){return e===null||x9(e)||sM(e)||lM(e)||pv(e)||C9(e)}function d0e(e){return pv(e)}function p0e(e){return C9(e)}function f0e(e,t){return Object.keys(e).includes(t)}});var gd=h(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.asString=m0e;Ci.asNumber=h0e;Ci.asBoolean=g0e;Ci.asObject=y0e;Ci.asPlainObject=b0e;Ci.asDictionary=v0e;Ci.asInstance=_0e;Ci.asArray=w0e;Ci.asFunction=S0e;Ci.asJsonMap=E0e;Ci.asJsonArray=x0e;var Xa=m1();function m0e(e,t){return(0,Xa.isString)(e)?e:t}function h0e(e,t){return(0,Xa.isNumber)(e)?e:t}function g0e(e,t){return(0,Xa.isBoolean)(e)?e:t}function y0e(e,t){return(0,Xa.isObject)(e)?e:t}function b0e(e,t){return(0,Xa.isPlainObject)(e)?e:t}function v0e(e,t){return(0,Xa.isDictionary)(e)?e:t}function _0e(e,t,r){return(0,Xa.isInstance)(e,t)?e:r}function w0e(e,t){return(0,Xa.isArray)(e)?e:t}function S0e(e,t){return(0,Xa.isFunction)(e)?e:t}function E0e(e,t){return(0,Xa.isJsonMap)(e)?e:t}function x0e(e,t){return(0,Xa.isJsonArray)(e)?e:t}});var fv=h($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.JsonCloneError=$o.UnexpectedValueTypeError=$o.AssertionFailedError=$o.NamedError=void 0;var cf=class extends Error{name;constructor(t,r){super(r),this.name=t}};$o.NamedError=cf;var T9=class extends cf{constructor(t){super("AssertionFailedError",t)}};$o.AssertionFailedError=T9;var I9=class extends cf{constructor(t){super("UnexpectedValueTypeError",t)}};$o.UnexpectedValueTypeError=I9;var A9=class extends cf{constructor(t){super("JsonCloneError",t.message)}};$o.JsonCloneError=A9});var mv=h(h1=>{"use strict";Object.defineProperty(h1,"__esModule",{value:!0});h1.toAnyJson=D9;h1.toJsonMap=C0e;h1.toJsonArray=T0e;var O0e=fv(),cM=gd();function D9(e,t){try{return e!==void 0?JSON.parse(JSON.stringify(e)):t}catch(r){throw new O0e.JsonCloneError(r)}}function C0e(e,t){return(0,cM.asJsonMap)(D9(e))??t}function T0e(e,t){return(0,cM.asJsonArray)(D9(e))??t}});var dM=h(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.assert=uM;wn.assertNonNull=Ti;wn.assertString=D0e;wn.assertNumber=L0e;wn.assertBoolean=k0e;wn.assertObject=N0e;wn.assertPlainObject=j0e;wn.assertDictionary=P0e;wn.assertInstance=M0e;wn.assertArray=R0e;wn.assertFunction=F0e;wn.assertAnyJson=$0e;wn.assertJsonMap=U0e;wn.assertJsonArray=z0e;var I0e=fv(),Ya=gd(),A0e=mv();function uM(e,t){if(!e)throw new I0e.AssertionFailedError(t??"Assertion condition was false")}function Ti(e,t){uM(e!=null,t??"Value is not defined")}function D0e(e,t){Ti(
|
|||
|
|
`).length;return new e(t,n,u,c)}static format(t,r,n,i){return n==null?t.message||"Unknown cause":`Parse error in file ${r??"unknown"} on line ${n}
|
|||
|
|
${i??t.message}`}};aa.JsonParseError=z9;var q9=class extends bd{constructor(t){super("JsonStringifyError",t)}};aa.JsonStringifyError=q9;var B9=class extends bd{constructor(t){super("JsonDataFormatError",t)}};aa.JsonDataFormatError=B9;var V9=class extends bd{constructor(t){super("InvalidDefaultEnvValueError",t)}};aa.InvalidDefaultEnvValueError=V9});var MM=h((pf,y1)=>{(function(){function e(g,x,L){switch(L.length){case 0:return g.call(x);case 1:return g.call(x,L[0]);case 2:return g.call(x,L[0],L[1]);case 3:return g.call(x,L[0],L[1],L[2])}return g.apply(x,L)}function t(g,x,L,U){for(var V=-1,Q=g==null?0:g.length;++V<Q;){var X=g[V];x(U,X,L(X),g)}return U}function r(g,x){for(var L=-1,U=g==null?0:g.length;++L<U&&x(g[L],L,g)!==!1;);}function n(g,x){for(var L=-1,U=g==null?0:g.length,V=0,Q=[];++L<U;){var X=g[L];x(X,L,g)&&(Q[V++]=X)}return Q}function i(g,x){for(var L=-1,U=g==null?0:g.length,V=Array(U);++L<U;)V[L]=x(g[L],L,g);return V}function a(g,x){for(var L=-1,U=x.length,V=g.length;++L<U;)g[V+L]=x[L];return g}function o(g,x){for(var L=-1,U=g==null?0:g.length;++L<U;)if(x(g[L],L,g))return!0;return!1}function s(g,x,L){var U;return L(g,function(V,Q,X){if(x(V,Q,X))return U=Q,!1}),U}function l(g){return function(x){return x==null?Ee:x[g]}}function c(g,x){var L=g.length;for(g.sort(x);L--;)g[L]=g[L].c;return g}function u(g){return function(x){return g(x)}}function d(g,x){return i(x,function(L){return g[L]})}function f(g){var x=-1,L=Array(g.size);return g.forEach(function(U,V){L[++x]=[V,U]}),L}function p(g){var x=Object;return function(L){return g(x(L))}}function m(g){var x=-1,L=Array(g.size);return g.forEach(function(U){L[++x]=U}),L}function y(g){for(var x=g.length;x--&&xge.test(g.charAt(x)););return x}function v(){}function S(g){var x=-1,L=g==null?0:g.length;for(this.clear();++x<L;){var U=g[x];this.set(U[0],U[1])}}function E(g){var x=-1,L=g==null?0:g.length;for(this.clear();++x<L;){var U=g[x];this.set(U[0],U[1])}}function w(g){var x=-1,L=g==null?0:g.length;for(this.clear();++x<L;){var U=g[x];this.set(U[0],U[1])}}function _(g){var x=-1,L=g==null?0:g.length;for(this.__data__=new w;++x<L;)this.add(g[x])}function b(g){this.size=(this.__data__=new E(g)).size}function A(g,x){var L=Qr(g),U=!L&&sf(g),V=!L&&!U&&lf(g),Q=!L&&!U&&!V&&sv(g);if(L=L||U||V||Q){for(var U=g.length,Ae=String,X=-1,ue=Array(U);++X<U;)ue[X]=Ae(X);U=ue}else U=[];var we,Ae=U.length;for(we in g)!x&&!Rn.call(g,we)||L&&(we=="length"||V&&(we=="offset"||we=="parent")||Q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||Kb(we,Ae))||U.push(we);return U}function j(g,x,L){(L===Ee||ud(g[x],L))&&(L!==Ee||x in g)||$(g,x,L)}function P(g,x,L){var U=g[x];Rn.call(g,x)&&ud(U,L)&&(L!==Ee||x in g)||$(g,x,L)}function T(g,x){for(var L=g.length;L--;)if(ud(g[L][0],x))return L;return-1}function N(g,x,L,U){return tM(g,function(V,Q,X){x(U,V,L(V),X)}),U}function k(g,x){return g&&kc(x,dd(x),g)}function B(g,x){return g&&kc(x,pd(x),g)}function $(g,x,L){x=="__proto__"&&av?av(g,x,{configurable:!0,enumerable:!0,value:L,writable:!0}):g[x]=L}function K(g,x,L,U,V,Q){var X,ue=1&x,$e=2&x,we=4&x;if(L&&(X=V?L(g,U,V,Q):L(g)),X!==Ee)return X;if(!Mn(g))return g;if(U=Qr(g)){if(X=yge(g),!ue)return na(g,X)}else{var Ae=Ka(g),Ze=Ae=="[object Function]"||Ae=="[object GeneratorFunction]";if(lf(g))return Yr(g,ue);if(Ae=="[object Object]"||Ae=="[object Arguments]"||Ze&&!V){if(X=$e||Ze?{}:xP(g),!ue)return $e?l1(g,B(X,g)):Hb(g,k(X,g))}else{if(!It[Ae])return V?g:{};X=bge(g,Ae,ue)}}if(Q||(Q=new b),V=Q.get(g))return V;Q.set(g,X),oM(g)?g.forEach(function(zt){X.add(K(zt,x,L,zt,g,Q))}):aM(g)&&g.forEach(function(zt,hr){X.set(hr,K(zt,x,L,hr,g,Q))});var $e=we?$e?EP:r9:$e?pd:dd,Nt=U?Ee:$e(g);return r(Nt||g,function(zt,hr){Nt&&(hr=zt,zt=g[hr]),P(X,hr,K(zt,x,L,hr,g,Q))}),X}function ae(g,x,L){for(var U=-1,V=g.length;++U<V;){var Q=g[U],X=x(Q);if(X!=null&&(ue===Ee?X===X&&!jc(X):L(X,ue)))var ue=X,we=Q}return we}function ne(g,x,L,U,V){var Q=-1,X=g.length;for(L||(L=vge),V||(V=[]);++Q<X;){var ue=g[Q];0<x&&L(ue)?1<x?ne(ue,x-1,L,U,V):a(V,ue):U||(V[V.length]=ue)}return V}function re(g,x){return g&&rM(g,x,dd)}function ce(g,x){x=fr(x,g);for(var L=0,
|
|||
|
|
causes have become circular...`;let n=J9(e);return n?(t.add(e),r+`
|
|||
|
|
caused by: `+GM(n,t)):r},Ebe=e=>GM(e,new Set),JM=(e,t,r)=>{if(!_1(e))return"";let n=r?"":e.message||"";if(t.has(e))return n+": ...";let i=J9(e);if(i){t.add(e);let a=typeof e.cause=="function";return n+(a?"":": ")+JM(i,t,a)}else return n},xbe=e=>JM(e,new Set);KM.exports={isErrorLike:_1,getErrorCause:J9,stackWithCauses:Ebe,messageWithCauses:xbe}});var X9=h((Jyt,YM)=>{"use strict";var Obe=Symbol("circular-ref-tag"),_v=Symbol("pino-raw-err-ref"),XM=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[_v]},set:function(e){this[_v]=e}}});Object.defineProperty(XM,_v,{writable:!0,value:{}});YM.exports={pinoErrProto:XM,pinoErrorSymbols:{seen:Obe,rawSymbol:_v}}});var tR=h((Kyt,eR)=>{"use strict";eR.exports=Q9;var{messageWithCauses:Cbe,stackWithCauses:Tbe,isErrorLike:QM}=K9(),{pinoErrProto:Ibe,pinoErrorSymbols:Abe}=X9(),{seen:Y9}=Abe,{toString:Dbe}=Object.prototype;function Q9(e){if(!QM(e))return e;e[Y9]=void 0;let t=Object.create(Ibe);t.type=Dbe.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=Cbe(e),t.stack=Tbe(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Q9(r)));for(let r in e)if(t[r]===void 0){let n=e[r];QM(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Y9)&&(t[r]=Q9(n)):t[r]=n}return delete e[Y9],t.raw=e,t}});var nR=h((Xyt,rR)=>{"use strict";rR.exports=Sv;var{isErrorLike:e7}=K9(),{pinoErrProto:Lbe,pinoErrorSymbols:kbe}=X9(),{seen:wv}=kbe,{toString:Nbe}=Object.prototype;function Sv(e){if(!e7(e))return e;e[wv]=void 0;let t=Object.create(Lbe);t.type=Nbe.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Sv(r))),e7(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,wv)&&(t.cause=Sv(e.cause));for(let r in e)if(t[r]===void 0){let n=e[r];e7(n)?Object.prototype.hasOwnProperty.call(n,wv)||(t[r]=Sv(n)):t[r]=n}return delete e[wv],t.raw=e,t}});var sR=h((Yyt,oR)=>{"use strict";oR.exports={mapHttpRequest:jbe,reqSerializer:aR};var t7=Symbol("pino-raw-req-ref"),iR=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[t7]},set:function(e){this[t7]=e}}});Object.defineProperty(iR,t7,{writable:!0,value:{}});function aR(e){let t=e.info||e.socket,r=Object.create(iR);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let n=e.path;r.url=typeof n=="string"?n:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function jbe(e){return{req:aR(e)}}});var dR=h((Qyt,uR)=>{"use strict";uR.exports={mapHttpResponse:Pbe,resSerializer:cR};var r7=Symbol("pino-raw-res-ref"),lR=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[r7]},set:function(e){this[r7]=e}}});Object.defineProperty(lR,r7,{writable:!0,value:{}});function cR(e){let t=Object.create(lR);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function Pbe(e){return{res:cR(e)}}});var i7=h((ebt,pR)=>{"use strict";var n7=tR(),Mbe=nR(),Ev=sR(),xv=dR();pR.exports={err:n7,errWithCause:Mbe,mapHttpRequest:Ev.mapHttpRequest,mapHttpResponse:xv.mapHttpResponse,req:Ev.reqSerializer,res:xv.resSerializer,wrapErrorSerializer:function(t){return t===n7?t:function(n){return t(n7(n))}},wrapRequestSerializer:fu
|
|||
|
|
${E}`,b=`,
|
|||
|
|
${E}`);let B=Math.min(w.length,s),$=0;for(;$<B-1;$++){let ae=l(String($),w,y,v,S,E);_+=ae!==void 0?ae:"null",_+=b}let K=l(String($),w,y,v,S,E);if(_+=K!==void 0?K:"null",w.length-1>s){let ae=w.length-s-1;_+=`${b}"... ${Sd(ae)} not stringified"`}return S!==""&&(_+=`
|
|||
|
|
${A}`),y.pop(),`[${_}]`}let j=Object.keys(w),P=j.length;if(P===0)return"{}";if(o<y.length+1)return'"[Object]"';let T="",N="";S!==""&&(E+=S,b=`,
|
|||
|
|
${E}`,T=" ");let k=Math.min(P,s);i&&!j7(w)&&(j=N7(j,a)),y.push(w);for(let B=0;B<k;B++){let $=j[B],K=l($,w,y,v,S,E);K!==void 0&&(_+=`${N}${Uc($)}:${T}${K}`,N=b)}if(P>s){let B=P-s;_+=`${N}"...":${T}"${Sd(B)} not stringified"`,N=b}return S!==""&&N.length>1&&(_=`
|
|||
|
|
${E}${_}
|
|||
|
|
${A}`),y.pop(),`{${_}}`}case"number":return isFinite(w)?String(w):t?t(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return t?t(w):void 0}}function c(p,m,y,v,S,E){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(p)),typeof m){case"string":return Uc(m);case"object":{if(m===null)return"null";if(y.indexOf(m)!==-1)return r;let w=E,_="",b=",";if(Array.isArray(m)){if(m.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(m),S!==""&&(E+=S,_+=`
|
|||
|
|
${E}`,b=`,
|
|||
|
|
${E}`);let P=Math.min(m.length,s),T=0;for(;T<P-1;T++){let k=c(String(T),m[T],y,v,S,E);_+=k!==void 0?k:"null",_+=b}let N=c(String(T),m[T],y,v,S,E);if(_+=N!==void 0?N:"null",m.length-1>s){let k=m.length-s-1;_+=`${b}"... ${Sd(k)} not stringified"`}return S!==""&&(_+=`
|
|||
|
|
${w}`),y.pop(),`[${_}]`}y.push(m);let A="";S!==""&&(E+=S,b=`,
|
|||
|
|
${E}`,A=" ");let j="";for(let P of v){let T=c(P,m[P],y,v,S,E);T!==void 0&&(_+=`${j}${Uc(P)}:${A}${T}`,j=b)}return S!==""&&j.length>1&&(_=`
|
|||
|
|
${E}${_}
|
|||
|
|
${w}`),y.pop(),`{${_}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function u(p,m,y,v,S){switch(typeof m){case"string":return Uc(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(p),typeof m!="object")return u(p,m,y,v,S);if(m===null)return"null"}if(y.indexOf(m)!==-1)return r;let E=S;if(Array.isArray(m)){if(m.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(m),S+=v;let T=`
|
|||
|
|
${S}`,N=`,
|
|||
|
|
${S}`,k=Math.min(m.length,s),B=0;for(;B<k-1;B++){let K=u(String(B),m[B],y,v,S);T+=K!==void 0?K:"null",T+=N}let $=u(String(B),m[B],y,v,S);if(T+=$!==void 0?$:"null",m.length-1>s){let K=m.length-s-1;T+=`${N}"... ${Sd(K)} not stringified"`}return T+=`
|
|||
|
|
${E}`,y.pop(),`[${T}]`}let w=Object.keys(m),_=w.length;if(_===0)return"{}";if(o<y.length+1)return'"[Object]"';S+=v;let b=`,
|
|||
|
|
${S}`,A="",j="",P=Math.min(_,s);j7(m)&&(A+=TF(m,b,s),w=w.slice(m.length),P-=m.length,j=b),i&&(w=N7(w,a)),y.push(m);for(let T=0;T<P;T++){let N=w[T],k=u(N,m[N],y,v,S);k!==void 0&&(A+=`${j}${Uc(N)}: ${k}`,j=b)}if(_>s){let T=_-s;A+=`${j}"...": "${Sd(T)} not stringified"`,j=b}return j!==""&&(A=`
|
|||
|
|
${S}${A}
|
|||
|
|
${E}`),y.pop(),`{${A}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function d(p,m,y){switch(typeof m){case"string":return Uc(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(p),typeof m!="object")return d(p,m,y);if(m===null)return"null"}if(y.indexOf(m)!==-1)return r;let v="",S=m.length!==void 0;if(S&&Array.isArray(m)){if(m.length===0)return"[]";if(o<y.length+1)return'"[Array]"';y.push(m);let A=Math.min(m.length,s),j=0;for(;j<A-1;j++){let T=d(String(j),m[j],y);v+=T!==void 0?T:"null",v+=","}let P=d(String(j),m[j],y);if(v+=P!==void 0?P:"null",m.length-1>s){let T=m.length-s-1;v+=`,"... ${Sd(T)} not stringified"`}return y.pop(),`[${v}]`}let E=Object.keys(m),w=E.length;if(w===0)return"{}";if(o<y.length+1)return'"[Object]"';let _="",b=Math.min(w,s);S&&j7(m)&&(v+=TF(m,",",s),E=E.slice(m.length),b-=m.length,_=","),i&&(E=N7(E,a)),y.push(m);for(let A=0;A<b;A++){let j=E[A],P=d(j,m[j],y);P!==void 0&&(v+=`${_}${Uc(j)}:${P}`,_=",")}if(w>s){let A=w-s;v+=`${_}"...":"${Sd(A)} not stringified"`}return y.pop(),`{${v}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return t?t(m):void 0}}function f(p,m,y){if(arguments.length>1){let v="";if(typeof y=="number"?v=" ".repeat(Math.min(y,10)):typeof y=="string"&&(v=y.slice(0,10)),m!=null){if(typeof m=="function")return l("",{"":p},[],m,v,"");if(Array.isArray(m))return c("",p,[],a4e(m),v,"")}if(v.length!==0)return u("",p,[],v,"")}return d("",p,[])}return f}});var jF=h((wbt,NF)=>{"use strict";var R7=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:kF}=Rv(),s4e=kF.info;function l4e(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(kF);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(d=>{r[d]=t.levels[d]});let n={write:i,add:s,remove:l,emit:a,flushSync:o,end:c,minLevel:0,lastId:0,streams:[],clone:u,[R7]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(s,n):s.call(n,e),e=null,n;function i(d){let f,p=this.lastLevel,{streams:m}=this,y=0,v;for(let S=c4e(m.length,t.dedupe);d4e(S,m.length,t.dedupe);S=u4e(S,t.dedupe))if(f=m[S],f.level<=p){if(y!==0&&y!==f.level)break;if(v=f.stream,v[R7]){let{lastTime:E,lastMsg:w,lastObj:_,lastLogger:b}=this;v.lastLevel=p,v.lastTime=E,v.lastMsg=w,v.lastObj=_,v.lastLogger=b}v.write(d),t.dedupe&&(y=f.level)}else if(!t.dedupe)break}function a(...d){for(let{stream:f}of this.streams)typeof f.emit=="function"&&f.emit(...d)}function o(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function s(d){if(!d)return n;let f=typeof d.write=="function"||d.stream,p=d.write?d:d.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:y}=this,v;typeof d.levelVal=="number"?v=d.levelVal:typeof d.level=="string"?v=y[d.level]:typeof d.level=="number"?v=d.level:v=s4e;let S={stream:p,level:v,levelVal:void 0,id:++n.lastId};return m.unshift(S),m.sort(LF),this.minLevel=m[0].level,n}function l(d){let{streams:f}=this,p=f.findIndex(m=>m.id===d);return p>=0&&(f.splice(p,1),f.sort(LF),this.minLevel=f.length>0?f[0].level:-1),n}function c(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function u(d){let f=new Array(this.streams.length);for(let p=0;p<f.length;p++)f[p]={level:d,stream:this.streams[p].stream};return{write:i,add:s,remove:l,minLevel:d,streams:f,clone:u,emit:a,flushSync:o,[R7]:!0}}}function LF(e,t){return e.level-t.level}function c4e(e,t){return t?e-1:0}function u4e(e,t){return t?e-1:e+1}function d4e(e,t,r){return r?e>=0:e<t}NF.exports=l4e});var GF=h((Sbt,sa)=>{"use strict";var p4e=require("node:os"),qF=i7(),f4e=a7(),m4e=l7(),BF=TR(),h4e=CF(),VF=mf(),{configure:g4e}=DF(),{assertDefaultLevelFound:y4e,mappings:WF,genLsCache:b4e,genLevelComparison:v4e,assertLevelComparison:_4e}=I7(),{DEFAULT_LEVELS:ZF,SORTING_ORDER:w4e}=Rv(),{
|
|||
|
|
`:`
|
|||
|
|
`),ae=E4e.bind(null,{[RF]:"",[FF]:o,[UF]:B,[$F]:F7,[$7]:T,[zF]:N}),ne="";d!==null&&(f===void 0?ne=ae(d):ne=ae(Object.assign({},d,{name:f})));let re=s instanceof Function?s:s?HF:V4e,ce=re().indexOf(":")+1;if(E&&!m)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(v&&typeof v!="function")throw Error(`Unknown mixin type "${typeof v}" - expected "function"`);if(P&&typeof P!="string")throw Error(`Unknown msgPrefix type "${typeof P}" - expected "string"`);y4e(p,m,E);let _e=WF(m,E);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:_e,messageKey:l,errorKey:c}}),_4e(y);let We=v4e(y);return Object.assign(t,{levels:_e,[F4e]:We,[$4e]:E,[D4e]:n,[I4e]:re,[A4e]:ce,[$F]:F7,[$7]:T,[UF]:B,[k4e]:K,[N4e]:$,[j4e]:l,[P4e]:c,[M4e]:u,[z4e]:u?`,${JSON.stringify(u)}:{`:"",[FF]:o,[R4e]:v,[q4e]:S,[RF]:ne,[zF]:N,[U4e]:_,silent:O4e,onChild:j,[B4e]:P}),Object.setPrototypeOf(t,h4e()),b4e(t),t[L4e](p),t}sa.exports=U7;sa.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=MF(e.dest||process.stdout.fd),PF(e)):PF({dest:MF(e),minLength:0});sa.exports.transport=S7();sa.exports.multistream=jF();sa.exports.levels=WF();sa.exports.stdSerializers=K4e;sa.exports.stdTimeFunctions=Object.assign({},BF);sa.exports.symbols=VF;sa.exports.version=C4e;sa.exports.default=U7;sa.exports.pino=U7});var ao=h(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.constants=bf.SEP=void 0;bf.SEP="/";bf.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});var z7=h(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});x1.Stats=void 0;var X4e=ao(),{S_IFMT:Y4e,S_IFDIR:Q4e,S_IFREG:ewe,S_IFBLK:twe,S_IFCHR:rwe,S_IFLNK:nwe,S_IFIFO:iwe,S_IFSOCK:awe}=X4e.constants,zv=class e{static build(t,r=!1){let n=new e,{uid:i,gid:a,atime:o,mtime:s,ctime:l}=t,c=r?d=>BigInt(d):d=>d;n.uid=c(i),n.gid=c(a),n.rdev=c(t.rdev),n.blksize=c(4096),n.ino=c(t.ino),n.size=c(t.getSize()),n.blocks=c(1),n.atime=o,n.mtime=s,n.ctime=l,n.birthtime=l,n.atimeMs=c(o.getTime()),n.mtimeMs=c(s.getTime());let u=c(l.getTime());if(n.ctimeMs=u,n.birthtimeMs=u,r){n.atimeNs=BigInt(o.getTime())*BigInt(1e6),n.mtimeNs=BigInt(s.getTime())*BigInt(1e6);let d=BigInt(l.getTime())*BigInt(1e6);n.ctimeNs=d,n.birthtimeNs=d}return n.dev=c(0),n.mode=c(t.mode),n.nlink=c(t.nlink),n}_checkModeProperty(t){return(Number(this.mode)&Y4e)===t}isDirectory(){return this._checkModeProperty(Q4e)}isFile(){return this._checkModeProperty(ewe)}isBlockDevice(){return this._checkModeProperty(twe)}isCharacterDevice(){return this._checkModeProperty(rwe)}isSymbolicLink(){return this._checkModeProperty(nwe)}isFIFO(){return this._checkModeProperty(iwe)}isSocket(){return this._checkModeProperty(awe)}};x1.Stats=zv;x1.default=zv});var Al=h(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.bufferFrom=zc.bufferAllocUnsafe=zc.Buffer=void 0;var qv=require("buffer");Object.defineProperty(zc,"Buffer",{enumerable:!0,get:function(){return qv.Buffer}});function JF(e,...t){return new qv.Buffer(e,...t)}var owe=qv.Buffer.allocUnsafe||JF;zc.bufferAllocUnsafe=owe;var swe=qv.Buffer.from||JF;zc.bufferFrom=swe});var Wv=h(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.AssertionError=ni.RangeError=ni.TypeError=ni.Error=void 0;ni.message=YF;ni.E=ge;var qc=require("assert"),q7=require("util"),KF=typeof Symbol>"u"?"_kCode":Symbol("code"),XF={};function V7(e){return class extends e{constructor(r,...n){super(YF(r,n)),this.code=r,this[KF]=r,
|
|||
|
|
`+e+l+(s?" "+s:"")}return r};v_.printTree=H6e});var Q$=h(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});__.printBinary=void 0;var G6e=(e="",t)=>{let r=t[0],n=t[1],i="";return r&&(i+=`
|
|||
|
|
`+e+"\u2190 "+r(e+" ")),n&&(i+=`
|
|||
|
|
`+e+"\u2192 "+n(e+" ")),i};__.printBinary=G6e});var eU=h(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.printJson=void 0;var J6e=(e="",t,r=2)=>(JSON.stringify(t,null,r)||"nil").split(`
|
|||
|
|
`).join(`
|
|||
|
|
`+e);w_.printJson=J6e});var tU=h(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});var pE=(ai(),Oi(ii));pE.__exportStar(Y$(),A1);pE.__exportStar(Q$(),A1);pE.__exportStar(eU(),A1)});var rU=h(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.newNotAllowedError=En.newTypeMismatchError=En.newNotFoundError=En.assertCanWrite=En.assertName=En.basename=En.ctx=void 0;var K6e=(e={})=>Object.assign({separator:"/",syncHandleAllowed:!1,mode:"read"},e);En.ctx=K6e;var X6e=(e,t)=>{e[e.length-1]===t&&(e=e.slice(0,-1));let r=e.lastIndexOf(t);return r===-1?e:e.slice(r+1)};En.basename=X6e;var Y6e=/^(\.{1,2})$|^(.*([\/\\]).*)$/,Q6e=(e,t,r)=>{if(!e||Y6e.test(e))throw new TypeError(`Failed to execute '${t}' on '${r}': Name is not allowed.`)};En.assertName=Q6e;var e3e=e=>{if(e!=="readwrite")throw new DOMException("The request is not allowed by the user agent or the platform in the current context.","NotAllowedError")};En.assertCanWrite=e3e;var t3e=()=>new DOMException("A requested file or directory could not be found at the time an operation was processed.","NotFoundError");En.newNotFoundError=t3e;var r3e=()=>new DOMException("The path supplied exists, but was not an entry of requested type.","TypeMismatchError");En.newTypeMismatchError=r3e;var n3e=()=>new DOMException("Permission not granted.","NotAllowedError");En.newNotAllowedError=n3e});var nU=h(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});D1.toTreeSync=void 0;var i3e=tU(),a3e=rU(),o3e=(e,t={})=>{var r;let n=t.separator||"/",i=t.dir||n;i[i.length-1]!==n&&(i+=n);let a=t.tab||"",o=(r=t.depth)!==null&&r!==void 0?r:10,s=" (...)";if(o>0){let c=e.readdirSync(i,{withFileTypes:!0});s=(0,i3e.printTree)(a,c.map(u=>d=>u.isDirectory()?(0,D1.toTreeSync)(e,{dir:i+u.name,depth:o-1,tab:d}):u.isSymbolicLink()?""+u.name+" \u2192 "+e.readlinkSync(i+u.name):""+u.name))}return(0,a3e.basename)(i,n)+n+s};D1.toTreeSync=o3e});var oU=h(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.getWriteFileOptions=xe.writeFileDefaults=xe.getRealpathOptsAndCb=xe.getRealpathOptions=xe.getStatfsOptsAndCb=xe.getStatfsOptions=xe.getStatOptsAndCb=xe.getStatOptions=xe.getAppendFileOptsAndCb=xe.getAppendFileOpts=xe.getOpendirOptsAndCb=xe.getOpendirOptions=xe.getReaddirOptsAndCb=xe.getReaddirOptions=xe.getReadFileOptions=xe.getRmOptsAndCb=xe.getRmdirOptions=xe.getDefaultOptsAndCb=xe.getDefaultOpts=xe.optsDefaults=xe.getMkdirOptions=void 0;xe.getOptions=aU;xe.optsGenerator=kl;xe.optsAndCbGenerator=Od;var S_=Sf(),s3e=O1(),fE=Vc(),iU={mode:511,recursive:!1},l3e=e=>typeof e=="number"?Object.assign({},iU,{mode:e}):Object.assign({},iU,e);xe.getMkdirOptions=l3e;var c3e=e=>`Expected options to be either an object or a string, but got ${e} instead`;function aU(e,t){let r;if(t){let n=typeof t;switch(n){case"string":r=Object.assign({},e,{encoding:t});break;case"object":r=Object.assign({},e,t);break;default:throw TypeError(c3e(n))}}else return e;return r.encoding!=="buffer"&&(0,s3e.assertEncoding)(r.encoding),r}function kl(e){return t=>aU(e,t)}function Od(e){return(t,r)=>typeof t=="function"?[e(),t]:[e(t),(0,fE.validateCallback)(r)]}xe.optsDefaults={encoding:"utf8"};xe.getDefaultOpts=kl(xe.optsDefaults);xe.getDefaultOptsAndCb=Od(xe.getDefaultOpts);var u3e={recursive:!1},d3e=e=>Object.assign({},u3e,e);xe.getRmdirOptions=d3e;var p3e=kl(xe.optsDefaults);xe.getRmOptsAndCb=Od(p3e);var f3e={flag:"r"};xe.getReadFileOptions=kl(f3e);var m3e={encoding:"utf8",recursive:!1,withFileTypes:!1};xe.getReaddirOptions=kl(m3e);xe.getReaddirOptsAndCb=Od(xe.getReaddirOptions);var h3e={encoding:"utf8",bufferSize:32,recursive:!1};xe.getOpendirOptions=kl(h3e);xe.getOpendirOptsAndCb=Od(xe.getOpendirOptions);var g3e={encoding:"utf8",mode:438,flag:S_.FLAGS[S_.FLAGS.a]};xe.getAppendFileOpts=kl(g3e);xe.getAppendFileOptsAndCb=Od(xe.getAppendFileOpts);var y3e={bigint:!1},b3e=(e={})=>Object.assign({},y3e,e);xe.getStatOptions=b3e;var v3e=(e,t)=>typeof e=="function"?[(0,xe.getStatOptions)(),e]:[(0,xe.getStatOptions)(e),(0,fE.validateCallback)(t)];xe.getStatOptsAndCb=v3e;var _3e={bigint:!1},w3e=(e={
|
|||
|
|
`),s=o.shift(),l=o.join(`
|
|||
|
|
`).trim();if(s&&l.length>0){let c=s.trim();if(o.filter(d=>!!d.trim()).every(d=>p5e.exec(d))){let f=l.split(f5e).filter(n).map(p=>p.split(`
|
|||
|
|
`).filter(m=>!!m.trim()).map(m=>m.trim()).join(`
|
|||
|
|
`));r.set(c,f)}else r.set(c,l)}else throw new Error(`Invalid markdown message file: ${e}
|
|||
|
|
The line "# <key>" must be immediately followed by the message on a new line.`)}return r},h5e=(e,t)=>{let r;try{if(r=JSON.parse(t),!(0,M1.isObject)(r))throw new Error(`Unexpected token. Found returned content type '${typeof r}'.`)}catch(n){let i=n;if(i.message.startsWith("Unexpected token")){let a=new Error(`Invalid JSON content in message file: ${e}
|
|||
|
|
${i.message}`);throw a.name=i.name,a}throw n}return new Map(Object.entries(r))},$_=class e{messages;static loaders=new Map;static bundles=new Map;locale;bundleName;constructor(t,r,n){this.messages=n,this.bundleName=t,this.locale=r}static readFile=t=>require(t);static getLocale(){return"en_US"}static setLoaderFunction(t,r,n){this.loaders.set(kE(t,r),n)}static generateFileLoaderFunction(t,r){let n=Vo.extname(r);if(![".json",".js",".md"].includes(n))throw new Error(`Only json, js and md message files are allowed, not ${n}: ${r}`);return i=>{let a,o;if(n===".md"?(a=F_.readFileSync(r,"utf-8"),o=m5e):(a=JSON.stringify(e.readFile(r)),(a==="null"||a==='""')&&(a=""),o=h5e),!a||a.trim().length===0){let l=new Error(`Invalid message file: ${r}. No content.`);throw l.name="SfError",l}let s=o(r,a);return new e(t,i,s)}}static importMessageFile(t,r){let n=Vo.basename(r,Vo.extname(r));e.isCached(t,n)||this.setLoaderFunction(t,n,e.generateFileLoaderFunction(n,r))}static importMessagesDirectoryFromMetaUrl(t,r=!0,n){return e.importMessagesDirectory(Vo.dirname((0,l5e.fileURLToPath)(t)),r,n)}static importMessagesDirectory(t,r=!0,n){let i=t,a=t;if(!Vo.isAbsolute(t))throw new Error("Invalid module path. Relative URLs are not allowed.");for(;a.length>=0;)try{F_.statSync(Vo.join(a,"package.json"));break}catch(s){if(s.code!=="ENOENT")throw s;a=a.substring(0,a.lastIndexOf(Vo.sep))}r&&(i=a);let o=n??g5e(i);i+=`${Vo.sep}messages`;for(let s of F_.readdirSync(i)){let l=Vo.join(i,s),c=F_.statSync(l);c&&(c.isDirectory()||c.isFile()&&this.importMessageFile(o,l))}}static loadMessages(t,r){let n=kE(t,r),i;if(this.isCached(t,r))i=this.bundles.get(n);else if(this.loaders.has(n)){let a=this.loaders.get(n);a&&(i=a(e.getLocale()),this.bundles.set(n,i),i=this.bundles.get(n))}if(i)return i;throw new P1.SfError(`Missing bundle ${n} for locale ${e.getLocale()}.`,"MissingBundleError")}static isCached(t,r){return this.bundles.has(kE(t,r))}getMessage(t,r=[]){return this.getMessageWithMap(t,r,this.messages).join(o5e.EOL)}getMessages(t,r=[]){return this.getMessageWithMap(t,r,this.messages)}createError(t,r=[],n=[],i,a){let{message:o,name:s,actions:l}=this.formatMessageContents({type:"error",key:t,tokens:r,actionTokens:n});return new P1.SfError(o,s,l,i,a)}createWarning(t,r=[],n=[]){return this.formatMessageContents({type:"warning",key:t,tokens:r,actionTokens:n})}createInfo(t,r=[],n=[]){return this.formatMessageContents({type:"info",key:t,tokens:r,actionTokens:n})}formatMessageContents({type:t,key:r,tokens:n=[],actionTokens:i=[],preserveName:a=!1}){let o=(0,LE.upperFirst)(t),s=new RegExp(`${o}$`),l=t==="error"?/^error.*\./:new RegExp(`^${t}.`),c=`${(0,LE.upperFirst)(r.replace(l,""))}${s.exec(r)??a?"":o}`,u=this.getMessage(r,n),d;try{d=this.getMessageWithMap(`${r}.actions`,i,this.messages)}catch{}return{message:u,name:c,actions:d}}getMessageWithMap(t,r=[],n){let i=RegExp(/([a-zA-Z0-9_-]+)\.(.*)/).exec(t);if(i){let l=i[1],c=i[2],u=n.get(l);if(u&&(0,M1.isJsonMap)(u)){let d=new Map(Object.entries(u));return this.getMessageWithMap(c,r,d)}}let a=n.get(t);if(!a)throw new P1.SfError(`Missing message ${this.bundleName}:${t} for locale ${e.getLocale()}.`,"MissingMessageError");let o=(0,LE.ensureArray)(a),s=0;return o.map(l=>{let c=(0,M1.ensureString)(l),u=new RegExp("%[sdifjoO]{1}","gm"),f=(c.match(u)??[]).length;if(f>0){let p=r.slice(s,s+f);return s+=f,s5e.format(c,...p)}else r.length>0&&c5e.Logger.childFromRoot("core:messages").warn(`Unable to render tokens in message. Ensure a specifier (e.g. %s) exists in the message:
|
|||
|
|
${c}`);return c})}};Wo.Messages=$_;var g5e=e=>{let t=`Invalid or missing package.json file at '${e}'. If not using a package.json, pass in a packageName.`;try{let r=(0,M1.asString)((0,M1.ensureJsonMap)($_.readFile(Vo.join(e,"package.json"))).name);if(!r)throw P1.SfError.create({message:t,name:"MissingPackageName"});return r}catch(r){throw P1.SfError.create({message:t,name:"MissingPackageName",cause:r})}}});var NE=h(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.traverse=oi.SFDX_PROJECT_JSON=void 0;oi.resolveProjectPath=b5e;oi.resolveProjectPathSync=v5e;var z_=require("node:path"),qU=Rr(),y5e=bt(),BU=new y5e.Messages("@salesforce/core","config",new Map([["unknownConfigKey","Unknown config name: %s."],["deprecatedConfigKey","Deprecated config name: %s. Please use %s instead."],["invalidWrite","The writeSync method is not allowed on SfdxConfig. Use the async write method instead."],["invalidConfigValue","Invalid config value: %s."],["invalidInstanceUrl","Specify a valid Salesforce instance URL."],["invalidApiVersion","Specify a valid Salesforce API version, for example, 42.0."],["invalidCustomOrgMetadataTemplates","Specify a valid repository URL or directory for the custom org metadata templates."],["invalidIsvDebuggerSid","Specify a valid Debugger SID."],["invalidIsvDebuggerUrl","Specify a valid Debugger URL."],["invalidNumberConfigValue","Specify a valid positive integer, for example, 150000."],["invalidBooleanConfigValue","The config value can only be set to true or false."],["invalidProjectWorkspace","%s does not contain a valid Salesforce DX project."],["schemaValidationError",`The config file "%s" is not schema valid.
|
|||
|
|
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]]));oi.SFDX_PROJECT_JSON="sfdx-project.json";async function b5e(e=process.cwd()){let t=await oi.traverse.forFile(e,oi.SFDX_PROJECT_JSON);if(!t)throw BU.createError("invalidProjectWorkspace",[e]);return t}function v5e(e=process.cwd()){let t=oi.traverse.forFileSync(e,oi.SFDX_PROJECT_JSON);if(!t)throw BU.createError("invalidProjectWorkspace",[e]);return t}oi.traverse={forFile:async(e,t)=>{let r;try{qU.fs.statSync((0,z_.join)(e,t)),r=e}catch(n){if(n&&n.code==="ENOENT"){let i=(0,z_.resolve)(e,"..");i!==e&&(r=await oi.traverse.forFile(i,t))}}return r},forFileSync:(e,t)=>{let r;try{qU.fs.statSync((0,z_.join)(e,t)),r=e}catch(n){if(n&&n.code==="ENOENT"){let i=(0,z_.resolve)(e,"..");i!==e&&(r=oi.traverse.forFileSync(i,t))}}return r}}});var WU=h((kvt,VU)=>{var Gc=require("constants"),_5e=process.cwd,q_=null,w5e=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return q_||(q_=_5e.call(process)),q_};try{process.cwd()}catch{}typeof process.chdir=="function"&&(jE=process.chdir,process.chdir=function(e){q_=null,jE.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,jE));var jE;VU.exports=S5e;function S5e(e){Gc.hasOwnProperty("O_SYMLINK")&&proces
|
|||
|
|
GFS4: `),console.error(e)});Ht[nn]||(XU=global[nn]||[],QU(Ht,XU),Ht.close=function(e){function t(r,n){return e.call(Ht,r,function(i){i||YU(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,W_,{value:e}),t}(Ht.close),Ht.closeSync=function(e){function t(r){e.apply(Ht,arguments),YU()}return Object.defineProperty(t,W_,{value:e}),t}(Ht.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ld(Ht[nn]),require("assert").equal(Ht[nn].length,0)}));var XU;global[nn]||QU(global,Ht[nn]);RE.exports=PE(I5e(Ht));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ht.__patched&&(RE.exports=PE(Ht),Ht.__patched=!0);function PE(e){C5e(e),e.gracefulify=PE,e.createReadStream=b,e.createWriteStream=A;var t=e.readFile;e.readFile=r;function r(T,N,k){return typeof N=="function"&&(k=N,N=null),B(T,N,k);function B($,K,ae,ne){return t($,K,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?Af([B,[$,K,ae],re,ne||Date.now(),Date.now()]):typeof ae=="function"&&ae.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=i;function i(T,N,k,B){return typeof k=="function"&&(B=k,k=null),$(T,N,k,B);function $(K,ae,ne,re,ce){return n(K,ae,ne,function(_e){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Af([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(T,N,k,B){return typeof k=="function"&&(B=k,k=null),$(T,N,k,B);function $(K,ae,ne,re,ce){return a(K,ae,ne,function(_e){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Af([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=l);function l(T,N,k,B){return typeof k=="function"&&(B=k,k=0),$(T,N,k,B);function $(K,ae,ne,re,ce){return s(K,ae,ne,function(_e){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Af([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var c=e.readdir;e.readdir=d;var u=/^v[0-5]\./;function d(T,N,k){typeof N=="function"&&(k=N,N=null);var B=u.test(process.version)?function(ae,ne,re,ce){return c(ae,$(ae,ne,re,ce))}:function(ae,ne,re,ce){return c(ae,ne,$(ae,ne,re,ce))};return B(T,N,k);function $(K,ae,ne,re){return function(ce,_e){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?Af([B,[K,ae,ne],ce,re||Date.now(),Date.now()]):(_e&&_e.sort&&_e.sort(),typeof ne=="function"&&ne.call(this,ce,_e))}}}if(process.version.substr(0,4)==="v0.8"){var f=T5e(e);S=f.ReadStream,w=f.WriteStream}var p=e.ReadStream;p&&(S.prototype=Object.create(p.prototype),S.prototype.open=E);var m=e.WriteStream;m&&(w.prototype=Object.create(m.prototype),w.prototype.open=_),Object.defineProperty(e,"ReadStream",{get:function(){return S},set:function(T){S=T},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return w},set:function(T){w=T},enumerable:!0,configurable:!0});var y=S;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(T){y=T},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(e,"FileWriteStream",{get:function(){return v},set:function(T){v=T},enumerable:!0,configurable:!0});function S(T,N){return this instanceof S?(p.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function E(){var T=this;P(T.path,T.flags,T.mode,function(N,k){N?(T.autoClose&&T.destroy(),T.emit("error",N)):(T.fd=k,T.emit("open",k),T.read())})}function w(T,N){return this instanceof w?(m.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function _(){var T=this;P(T.path,T.flags,T.mode,function(N,k){N?(T.destroy(),T.emit("error",N)):(T.fd=k,T.emit("open",k))})}function b(T,N){return new e.ReadStream(T,N)}function A(T,N){return new e.WriteStream(T,N)}var j=e.open;e.open=P;function P(T,N,k,B){return typeof k=="function"&&(B=k,k=null),$(T,N,k,B);function $(K,ae,ne,re,ce){return j(K,ae,ne,function(_e,We){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?Af([$,[K,ae,ne,re],_e,ce||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}return e}function Af(e){Ld("ENQUEUE",e[0].
|
|||
|
|
%s`],["passwordNotFoundError.actions",["Ensure a valid password is returned with the following command: [%s]"]],["setCredentialError",`Command failed with response:
|
|||
|
|
%s`],["setCredentialError.actions",["Determine why this command failed to set an encryption key for user %s: [%s]."]],["macKeychainOutOfSync","We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."],["v1CryptoWithV2KeyWarning",'The SF_CRYPTO_V2 environment variable was set to "false" but a v2 crypto key was detected. v1 crypto can only be used with a v1 key. Unset the SF_CRYPTO_V2 environment variable.'],["v2CryptoWithV1KeyWarning",'SF_CRYPTO_V2 was set to "true" but a v1 crypto key was detected. v2 crypto can only be used with a v2 key. To generate a v2 key:\n\n1. Logout of all orgs: `sf org logout --all`\n2. Delete the sfdx keychain entry (account: local, service: sfdx). If `SF_USE_GENERIC_UNIX_KEYCHAIN=true` env var is set, you can delete the `key.json` file.\n3. Set `SF_CRYPTO_V2=true` env var.\n4. Re-Authenticate with your orgs using the CLI org login commands.']])),TB=3,Z1=e=>e.join(" "),IB=(e,t,r)=>process.platform==="win32"?!0:!!(e&parseInt("0001",8)||e&parseInt("0010",8)&&process.getgid&&t===process.getgid()||e&parseInt("0100",8)&&process.getuid&&r===process.getuid()),_x=async(e,t,r)=>{let n;try{let i=t.statSync(e);n=!r(i.mode,i.gid,i.uid)}catch{throw $r.createError("missingCredentialProgramError",[e])}if(n)throw $r.createError("credentialProgramAccessError",[e])},H1=class{osImpl;fsIfc;constructor(t,r){this.osImpl=t,this.fsIfc=r}async validateProgram(){await _x(this.osImpl.getProgram(),this.fsIfc,IB)}async getPassword(t,r,n=0){if(t.service==null){r($r.createError("keyChainServiceRequiredError"));return}if(t.account==null){r($r.createError("keyChainAccountRequiredError"));return}await this.validateProgram();let i=this.osImpl.getCommandFunc(t,CB.spawn),a="",o="";i.stdout&&i.stdout.on("data",s=>{a+=s}),i.stderr&&i.stderr.on("data",s=>{o+=s}),i.on("close",async s=>{try{return await this.osImpl.onGetCommandClose(s,a,o,t,r)}catch(l){if(l.retry){if(n>=TB)throw $r.createError("passwordRetryError",[TB]);return this.getPassword(t,r,n+1)}else throw l}}),i.stdin&&i.stdin.end()}async setPassword(t,r){if(t.service==null){r($r.createError("keyChainServiceRequiredError"));return}if(t.account==null){r($r.createError("keyChainAccountRequiredError"));return}if(t.password==null){r($r.createError("passwordRequiredError"));return}await _x(this.osImpl.getProgram(),this.fsIfc,IB);let n=this.osImpl.setCommandFunc(t,CB.spawn),i="",a="";n.stdout&&n.stdout.on("data",o=>{i+=o}),n.stderr&&n.stderr.on("data",o=>{a+=o}),n.on("close",async o=>this.osImpl.onSetCommandClose(o,i,a,t,r)),n.stdin&&n.stdin.end()}};Ur.KeychainAccess=H1;var Ml={getProgram(){return process.env.SFDX_SECRET_TOOL_PATH??Md.join(Md.sep,"usr","bin","secret-tool")},getProgramOptions(e){return["lookup","user",e.account,"domain",e.service]},getCommandFunc(e,t){return t(Ml.getProgram(),Ml.getProgramOptions(e))},async onGetCommandClose(e,t,r,n,i){if(e===1){let a=`${Ml.getProgram()} ${Z1(Ml.getProgramOptions(n))}`,o=$r.createError("passwordNotFoundError",[],[a]);if(r?.includes("invalid or unencryptable secret"))throw o.retry=!0,o;i(o)}else i(null,t.trim())},setProgramOptions(e){return["store","--label='salesforce.com'","user",e.account,"domain",e.service]},setCommandFunc(e,t){let r=t(Ml.getProgram(),Ml.setProgramOptions(e));return r.stdin&&r.stdin.write(`${e.password??""}
|
|||
|
|
`),r},async onSetCommandClose(e,t,r,n,i){if(e!==0){let a=`${Ml.getProgram()} ${Z1(Ml.setProgramOptions(n))}`;i($r.createError("setCredentialError",[`${t} - ${r}`],[DB.userInfo().username,a]))}else i(null)}},so={getProgram(){return Md.join(Md.sep,"usr","bin","security")},getProgramOptions(e){return["find-generic-password","-a",e.account,"-s",e.service,"-g"]},getCommandFunc(e,t){return t(so.getProgram(),so.getProgramOptions(e))},async onGetCommandClose(e,t,r,n,i){let a;if(e!==0){switch(e){case 128:{a=$r.createError("keyChainUserCanceledError");break}default:{let o=`${so.getProgram()} ${Z1(so.getProgramOptions(n))}`;a=$r.createError("passwordNotFoundError",[`${t} - ${r}`],[o])}}i(a);return}if(r.includes("password")){let o=RegExp(/"(.*)"/).exec(r);o?.[1]?i(null,o[1]):i($r.createError("passwordNotFoundError",[`${t} - ${r}`]))}else{let o=`${so.getProgram()} ${Z1(so.getProgramOptions(n))}`;i($r.createError("passwordNotFoundError",[`${t} - ${r}`],[o]))}},setProgramOptions(e){let t=["add-generic-password","-a",e.account,"-s",e.service];return e.password&&t.push("-w",e.password),t},setCommandFunc(e,t){return t(so.getProgram(),so.setProgramOptions(e))},async onSetCommandClose(e,t,r,n,i){if(e!==0){let a=`${so.getProgram()} ${Z1(so.setProgramOptions(n))}`;i($r.createError("setCredentialError",[`${t} - ${r}`],[DB.userInfo().username,a]))}else i(null)}},J1=()=>Md.join(LB.Global.DIR,"key.json"),Xc;(function(e){e.SERVICE="service",e.ACCOUNT="account",e.KEY="key"})(Xc||(Xc={}));async function AB(e,t){try{let r={[Xc.ACCOUNT]:e.account,[Xc.KEY]:e.password,[Xc.SERVICE]:e.service},n=J1();await Ri.fs.promises.mkdir(Md.dirname(n),{recursive:!0}),await Ri.fs.promises.writeFile(n,JSON.stringify(r,null,4),{mode:"600"}),t(null,r)}catch(r){t(r)}}async function DEe(){let e=(0,IEe.parseJsonMap)(await Ri.fs.promises.readFile(J1(),"utf8"));return{account:(0,vx.ensureString)(e[Xc.ACCOUNT]),password:(0,vx.asString)(e[Xc.KEY]),service:(0,vx.ensureString)(e[Xc.SERVICE])}}var G1=class{async getPassword(t,r){await this.isValidFileAccess(async n=>{if(n==null)try{let{service:i,account:a,password:o}=await DEe();t.service===i&&t.account===a?r(null,o):r($r.createError("genericKeychainServiceError",[J1()]))}catch(i){r(i)}else n.code==="ENOENT"?r($r.createError("passwordNotFoundError")):r(n)})}async setPassword(t,r){await this.isValidFileAccess(async n=>{n!=null?n.code==="ENOENT"?await AB.call(this,t,r):r(n):await AB.call(this,t,r)})}async isValidFileAccess(t){try{let r=(0,TEe.homedir)();await Ri.fs.promises.access(Md.join(r,LB.Global.SFDX_STATE_FOLDER),Ri.fs.constants.R_OK|Ri.fs.constants.X_OK|Ri.fs.constants.W_OK),await t(null)}catch(r){await t(r)}}};Ur.GenericKeychainAccess=G1;var b2=class extends G1{async isValidFileAccess(t){await super.isValidFileAccess(async r=>{if(r!=null)await t(r);else{let n=J1(),a=((await Ri.fs.promises.stat(n)).mode&511).toString(8),o="600";a===o?await t(null):t($r.createError("genericKeychainInvalidPermsError",[n],[n,o]))}})}};Ur.GenericUnixKeychainAccess=b2;var v2=class extends G1{async isValidFileAccess(t){await super.isValidFileAccess(async r=>{if(r!=null)await t(r);else try{await Ri.fs.promises.access(J1(),Ri.fs.constants.R_OK|Ri.fs.constants.W_OK),await t(null)}catch(n){await t(n)}})}};Ur.GenericWindowsKeychainAccess=v2;Ur.keyChainImpl={generic_unix:new b2,generic_windows:new v2,darwin:new H1(so,Ri.fs),linux:new H1(Ml,Ri.fs),validateProgram:_x}});var NB=h(_2=>{"use strict";Object.defineProperty(_2,"__esModule",{value:!0});_2.retrieveKeychain=void 0;var LEe=He(),kEe=yt(),NEe=bt(),Yc=kB(),jEe=new NEe.Messages("@salesforce/core","encryption",new Map([["invalidEncryptedFormatError","The encrypted data is not properly formatted."],["invalidEncryptedFormatError.actions",["If attempting to create a scratch org then re-authorize. Otherwise create a new scratch org."]],["authDecryptError","Failed to decipher auth data. reason: %s."],["unsupportedOperatingSystemError","Unsupported Operating System: %s"],["missingCredentialProgramError","Unable to find required security software: %s"],["credentialProgramAccessError","Unable to execute securi
|
|||
|
|
%s`],["passwordNotFoundError.actions",["Ensure a valid password is returned with the following command: [%s]"]],["setCredentialError",`Command failed with response:
|
|||
|
|
%s`],["setCredentialError.actions",["Determine why this command failed to set an encryption key for user %s: [%s]."]],["macKeychainOutOfSync","We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."],["v1CryptoWithV2KeyWarning",'The SF_CRYPTO_V2 environment variable was set to "false" but a v2 crypto key was detected. v1 crypto can only be used with a v1 key. Unset the SF_CRYPTO_V2 environment variable.'],["v2CryptoWithV1KeyWarning",'SF_CRYPTO_V2 was set to "true" but a v1 crypto key was detected. v2 crypto can only be used with a v2 key. To generate a v2 key:\n\n1. Logout of all orgs: `sf org logout --all`\n2. Delete the sfdx keychain entry (account: local, service: sfdx). If `SF_USE_GENERIC_UNIX_KEYCHAIN=true` env var is set, you can delete the `key.json` file.\n3. Set `SF_CRYPTO_V2=true` env var.\n4. Re-Authenticate with your orgs using the CLI org login commands.']])),PEe=async e=>{let t=await kEe.Logger.child("keyChain"),r=LEe.env.getBoolean("SF_USE_GENERIC_UNIX_KEYCHAIN");if(e.startsWith("win"))return t.debug(`platform: ${e}. Using generic Windows keychain.`),Yc.keyChainImpl.generic_windows;if(e.includes("darwin"))return r?(t.debug(`platform: ${e}. Using generic Unix keychain.`),Yc.keyChainImpl.generic_unix):(t.debug(`platform: ${e}. Using Darwin native keychain.`),Yc.keyChainImpl.darwin);if(e.includes("linux")){if(r)return t.debug(`platform: ${e}. Using generic Unix keychain.`),Yc.keyChainImpl.generic_unix;try{return t.debug(`platform: ${e}. Using Linux keychain.`),await Yc.keyChainImpl.linux.validateProgram(),Yc.keyChainImpl.linux}catch{return t.debug(`platform: ${e}. Using generic Unix keychain.`),Yc.keyChainImpl.generic_unix}}else{if(e==="browser")return t.debug(`platform: ${e}. Using generic keychain.`),Yc.keyChainImpl.generic_unix;throw jEe.createError("unsupportedOperatingSystemError",[e])}};_2.retrieveKeychain=PEe});var xx=h(Go=>{"use strict";var MEe=Go&&Go.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),REe=Go&&Go.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),FEe=Go&&Go.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&MEe(t,e,r);return REe(t,e),t};Object.defineProperty(Go,"__esModule",{value:!0});Go.SecureBuffer=void 0;var Ho=FEe(require("node:crypto")),$Ee=Ke(),Sx="aes-256-cbc",UEe=32,Ex=class{key=Ho.randomBytes(UEe);iv=Ho.randomBytes(16);secret;value(t){if(t){let r=Ho.createDecipheriv(Sx,this.key,this.iv),n=r.update((0,$Ee.ensure)(this.secret)),i=r.final(),a=Buffer.concat([n,i]);try{return t(a)}finally{Ho.randomFillSync(n),Ho.randomFillSync(i),Ho.randomFillSync(a)}}}clear(){this.secret&&Ho.randomFillSync(this.secret);let t=Ho.createCipheriv(Sx,this.key,this.iv);this.secret=Buffer.concat([t.update(Buffer.from("")),t.final()])}consume(t){let r=t;r||(r=Buffer.from(""));let n=Ho.createCipheriv(Sx,this.key,this.iv);this.secret=Buffer.concat([n.update(r),n.final()]),Ho.randomFillSync(r)}};Go.SecureBuffer=Ex});var BB=h(Jo=>{"use strict";var zEe=Jo&&Jo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qEe=Jo&&Jo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),UB=Jo&&Jo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.
|
|||
|
|
%s`],["passwordNotFoundError.actions",["Ensure a valid password is returned with the following command: [%s]"]],["setCredentialError",`Command failed with response:
|
|||
|
|
%s`],["setCredentialError.actions",["Determine why this command failed to set an encryption key for user %s: [%s]."]],["macKeychainOutOfSync","We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."],["v1CryptoWithV2KeyWarning",'The SF_CRYPTO_V2 environment variable was set to "false" but a v2 crypto key was detected. v1 crypto can only be used with a v1 key. Unset the SF_CRYPTO_V2 environment variable.'],["v2CryptoWithV1KeyWarning",'SF_CRYPTO_V2 was set to "true" but a v1 crypto key was detected. v2 crypto can only be used with a v2 key. To generate a v2 key:\n\n1. Logout of all orgs: `sf org logout --all`\n2. Delete the sfdx keychain entry (account: local, service: sfdx). If `SF_USE_GENERIC_UNIX_KEYCHAIN=true` env var is set, you can delete the `key.json` file.\n3. Set `SF_CRYPTO_V2=true` env var.\n4. Re-Authenticate with your orgs using the CLI org login commands.']])),FB=(e,t)=>{let r=new zB.SecureBuffer;return r.consume(Buffer.from(e,t)),r},$B={getPassword(e,t,r){let n=`${ZEe.Global.DIR}:${t}:${r}`,i=Cx.Cache.get(n);if(i){let a=Tx[tu()],o=(0,E2.ensure)(i.value(s=>s.toString(a)),"Expected the keychain password to be set");return Cx.Cache.set(n,FB(o,a)),new Promise(s=>s({username:r,password:o}))}else return new Promise((a,o)=>e.getPassword({service:t,account:r},(s,l)=>{if(s)return o(s);let c=(0,E2.ensure)(l,"Expected the keychain password to be set");return KEe(c),Cx.Cache.set(n,FB(c,Tx[tu()])),a({username:r,password:c})}))},setPassword(e,t,r,n){return new Promise((i,a)=>e.setPassword({service:t,account:r,password:n},o=>o?a(o):i({username:r,password:n})))}},Ax=class extends K1.AsyncOptionalCreatable{key=new zB.SecureBuffer;options;noResetOnClose;constructor(t){super(t),this.options=t??{}}static unsetCryptoVersion(){ru=void 0}encrypt(t){if(t!=null){if(this.key==null)throw Qc.createError("keychainPasswordCreationError");return this.isV2Crypto()?this.encryptV2(t):this.encryptV1(t)}}decrypt(t){if(t==null)return;let r=t.split(w2);if(r.length!==2)throw Qc.createError("invalidEncryptedFormatError");return this.isV2Crypto()?this.decryptV2(r):this.decryptV1(r)}isEncrypted(t){if(t==null)return!1;let r=t.split(w2);if(r.length!==2)return!1;let n=r[1],i=r[0];return n.length===JEe&&i.length>=Fd[tu()]&&jB.test(n)&&jB.test(r[0])}close(){this.noResetOnClose||this.key.clear()}isV2Crypto(){return tu()==="v2"}async init(){this.options.platform||(this.options.platform=Ox.platform()),this.noResetOnClose=!!this.options.noResetOnClose;try{let t=await this.getKeyChain(this.options.platform),r=(await $B.getPassword(t,PB,MB)).password;this.key.consume(Buffer.from(r,Tx[tu()]))}catch(t){if(t.name==="PasswordNotFoundError"){if(this.options.retryStatus==="KEY_SET")throw eu().debug("a key was set but the retry to get the password failed."),t;eu().debug(`password not found in keychain. Creating new one (Crypto ${tu()}) and re-init.`);let r=Rd.randomBytes(Ix[tu()]).toString("hex");return await $B.setPassword((0,E2.ensure)(this.options.keychain),PB,MB,r),this.init()}else throw t}}encryptV1(t){let r=Rd.randomBytes(Fd.v1).toString("hex");return this.key.value(n=>{let i=Rd.createCipheriv(S2,n.toString("utf8"),r),a=i.update(t,"utf8","hex");a+=i.final("hex");let o=i.getAuthTag().toString("hex");return`${r}${a}${w2}${o}`})}encryptV2(t){let r=Rd.randomBytes(Fd.v2);return this.key.value(n=>{let i=Rd.createCipheriv(S2,n,r),a=r.toString("hex"),o=i.update(t,"utf8","hex");o+=i.final("hex");let s=i.getAuthTag().toString("hex");return`${a}${o}${w2}${s}`})}decryptV1(t){let r=t[1],n=t[0].substring(0,Fd.v1*2),i=t[0].substring(Fd.v1*2,t[0].length);return this.key.value(a=>{let o=Rd.createDecipheriv(S2,a.toString("utf8"),n);try{return o.setAuthTag(Buffer.from(r,"hex")),`${o.update(i,"hex","utf8")}${o.final("utf8")}`}catch(s){let l=Qc.createError("authDecryptError",[s.message],[],s),c=K1.env.getBoolean("SF_USE_GENERIC_UNIX_KEYCHAIN")||K1.env.getBoolean("USE_GENERIC_UNIX_KEYCHAIN");throw Ox.platform()==="darwin"&&!c&&(l.ac
|
|||
|
|
|
|||
|
|
Your environment has both variables populated, and with different values. The value from %s will be used.`],["sfCapitalizeRecordTypes","Whether record types are capitalized on scratch org creation."]])),z;(function(e){e.FORCE_OPEN_URL="FORCE_OPEN_URL",e.FORCE_SHOW_SPINNER="FORCE_SHOW_SPINNER",e.FORCE_SPINNER_DELAY="FORCE_SPINNER_DELAY",e.HTTP_PROXY="HTTP_PROXY",e.HTTPS_PROXY="HTTPS_PROXY",e.NODE_EXTRA_CA_CERTS="NODE_EXTRA_CA_CERTS",e.NODE_TLS_REJECT_UNAUTHORIZED="NODE_TLS_REJECT_UNAUTHORIZED",e.SFDX_ACCESS_TOKEN="SFDX_ACCESS_TOKEN",e.SFDX_API_VERSION="SFDX_API_VERSION",e.SFDX_AUDIENCE_URL="SFDX_AUDIENCE_URL",e.SFDX_CONTENT_TYPE="SFDX_CONTENT_TYPE",e.SFDX_DEFAULTDEVHUBUSERNAME="SFDX_DEFAULTDEVHUBUSERNAME",e.SFDX_DEFAULTUSERNAME="SFDX_DEFAULTUSERNAME",e.SFDX_DISABLE_AUTOUPDATE="SFDX_DISABLE_AUTOUPDATE",e.SFDX_AUTOUPDATE_DISABLE="SFDX_AUTOUPDATE_DISABLE",e.SFDX_DISABLE_SOURCE_MEMBER_POLLING="SFDX_DISABLE_SOURCE_MEMBER_POLLING",e.SFDX_SOURCE_TRACKING_BATCH_SIZE="SFDX_SOURCE_TRACKING_BATCH_SIZE",e.SFDX_DISABLE_TELEMETRY="SFDX_DISABLE_TELEMETRY",e.SFDX_DNS_TIMEOUT="SFDX_DNS_TIMEOUT",e.SFDX_DOMAIN_RETRY="SFDX_DOMAIN_RETRY",e.SFDX_IMPROVED_CODE_COVERAGE="SFDX_IMPROVED_CODE_COVERAGE",e.SFDX_INSTANCE_URL="SFDX_INSTANCE_URL",e.SFDX_JSON_TO_STDOUT="SFDX_JSON_TO_STDOUT",e.SFDX_DISABLE_LOG_FILE="SFDX_DISABLE_LOG_FILE",e.SFDX_LOG_LEVEL="SFDX_LOG_LEVEL",e.SFDX_LOG_ROTATION_COUNT="SFDX_LOG_ROTATION_COUNT",e.SFDX_LOG_ROTATION_PERIOD="SFDX_LOG_ROTATION_PERIOD",e.SFDX_MAX_QUERY_LIMIT="SFDX_MAX_QUERY_LIMIT",e.SFDX_MDAPI_TEMP_DIR="SFDX_MDAPI_TEMP_DIR",e.SFDX_NPM_REGISTRY="SFDX_NPM_REGISTRY",e.SFDX_PRECOMPILE_ENABLE="SFDX_PRECOMPILE_ENABLE",e.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE="SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE",e.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE="SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE",e.SFDX_REST_DEPLOY="SFDX_REST_DEPLOY",e.SFDX_SOURCE_MEMBER_POLLING_TIMEOUT="SFDX_SOURCE_MEMBER_POLLING_TIMEOUT",e.SFDX_USE_GENERIC_UNIX_KEYCHAIN="SFDX_USE_GENERIC_UNIX_KEYCHAIN",e.SFDX_USE_PROGRESS_BAR="SFDX_USE_PROGRESS_BAR",e.SFDX_LAZY_LOAD_MODULES="SFDX_LAZY_LOAD_MODULES",e.SFDX_S3_HOST="SFDX_S3_HOST",e.SFDX_UPDATE_INSTRUCTIONS="SFDX_UPDATE_INSTRUCTIONS",e.SFDX_INSTALLER="SFDX_INSTALLER",e.SFDX_ENV="SFDX_ENV",e.SF_TARGET_ORG="SF_TARGET_ORG",e.SF_TARGET_DEV_HUB="SF_TARGET_DEV_HUB",e.SF_ACCESS_TOKEN="SF_ACCESS_TOKEN",e.SF_ORG_API_VERSION="SF_ORG_API_VERSION",e.SF_AUDIENCE_URL="SF_AUDIENCE_URL",e.SF_CONTENT_TYPE="SF_CONTENT_TYPE",e.SF_DISABLE_AUTOUPDATE="SF_DISABLE_AUTOUPDATE",e.SF_AUTOUPDATE_DISABLE="SF_AUTOUPDATE_DISABLE",e.SF_DISABLE_SOURCE_MEMBER_POLLING="SF_DISABLE_SOURCE_MEMBER_POLLING",e.SF_DISABLE_TELEMETRY="SF_DISABLE_TELEMETRY",e.SF_DNS_TIMEOUT="SF_DNS_TIMEOUT",e.SF_DOMAIN_RETRY="SF_DOMAIN_RETRY",e.SF_IMPROVED_CODE_COVERAGE="SF_IMPROVED_CODE_COVERAGE",e.SF_ORG_INSTANCE_URL="SF_ORG_INSTANCE_URL",e.SF_JSON_TO_STDOUT="SF_JSON_TO_STDOUT",e.SF_DISABLE_LOG_FILE="SF_DISABLE_LOG_FILE",e.SF_LOG_LEVEL="SF_LOG_LEVEL",e.SF_LOG_ROTATION_COUNT="SF_LOG_ROTATION_COUNT",e.SF_LOG_ROTATION_PERIOD="SF_LOG_ROTATION_PERIOD",e.SF_ORG_MAX_QUERY_LIMIT="SF_ORG_MAX_QUERY_LIMIT",e.SF_MDAPI_TEMP_DIR="SF_MDAPI_TEMP_DIR",e.SF_NPM_REGISTRY="SF_NPM_REGISTRY",e.SF_PRECOMPILE_ENABLE="SF_PRECOMPILE_ENABLE",e.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE="SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE",e.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE="SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE",e.SF_SOURCE_MEMBER_POLLING_TIMEOUT="SF_SOURCE_MEMBER_POLLING_TIMEOUT",e.SF_SOURCE_TRACKING_BATCH_SIZE="SF_SOURCE_TRACKING_BATCH_SIZE",e.SF_USE_GENERIC_UNIX_KEYCHAIN="SF_USE_GENERIC_UNIX_KEYCHAIN",e.SF_USE_PROGRESS_BAR="SF_USE_PROGRESS_BAR",e.SF_LAZY_LOAD_MODULES="SF_LAZY_LOAD_MODULES",e.SF_S3_HOST="SF_S3_HOST",e.SF_UPDATE_INSTRUCTIONS="SF_UPDATE_INSTRUCTIONS",e.SF_INSTALLER="SF_INSTALLER",e.SF_ENV="SF_ENV",e.SF_CAPITALIZE_RECORD_TYPES="SF_CAPITALIZE_RECORD_TYPES"})(z||(ya.EnvironmentVariable=z={}));var pe=e=>Q1.getMessage((0,W2.camelCase)(e));ya.SUPPORTED_ENV_VARS={[z.FORCE_SHOW_SPINNER]:{d
|
|||
|
|
|
|||
|
|
Due to: %s`],["jwtAuthError","Error authenticating with JWT config due to: %s"],["jwtAuthErrors",`Error authenticating with JWT.
|
|||
|
|
Errors encountered:
|
|||
|
|
%s`],["refreshTokenAuthError","Error authenticating with the refresh token due to: %s"],["invalidSfdxAuthUrlError",`Invalid SFDX authorization URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX authorization URL doesn\\'t include the protocol ("https://"). Run "org display --target-org" on an org to see an example of an SFDX authorization URL.`],["orgDataNotAvailableError","An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired."],["orgDataNotAvailableError.actions",["Run `sfdx force:org:list --clean` to remove stale org authentications.","Use `sfdx force:config:set` to update the defaultusername.","Use `sfdx force:org:create` to create a new org.","Use `sfdx auth` to authenticate an existing org."]],["namedOrgNotFound","No authorization information found for %s."],["noAliasesFound","Nothing to set."],["invalidFormat","Setting aliases must be in the format <key>=<value> but found: [%s]."],["invalidJsonCasing",'All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`\nFound "%s" at %s'],["missingClientId","Client ID is required for JWT authentication."]])).createError("namedOrgNotFound",[t]);return i&&this.contents.set(t,i.getContents(r)),this.contents.get(t)}getAll(t=!1){return[...this.configs.keys()].map(r=>this.get(r,t)).filter(r=>!(0,vV.isEmpty)(r))}has(t){return this.contents.has(t)}async exists(t){let r=this.configs.get(t);return r?r.exists():!1}async stat(t){let r=this.configs.get(t);return r?r.stat():null}async hasFile(t){try{return await _V.fs.promises.access(this.parseFilename(t)),!0}catch{return this.logger.debug(`No auth file found for ${t}`),!1}}async list(){return this.getAllFiles()}set(t,r){let n=this.configs.get(t);n?((0,uOe.entriesOf)(r).map(([i,a])=>n.set(i,a)),n.has("username")||n.set("username",t)):this.contents.set(t,{...r,username:r.username??t})}update(t,r){let n=this.get(t)||{},i=Object.assign({},n,r);return this.set(t,i)}async remove(t){await this.configs.get(t)?.unlink(),this.configs.delete(t),this.contents.delete(t)}async write(t){let r=this.configs.get(t);if(r)return await r.write();{let n=this.contents.get(t)??{};await this.read(t,!1,!1);let i=this.configs.get(t);if(i)return i.setContentsFromObject(n),await i.write();this.logger.debug(`Failed to write auth file for ${t}. readConfig not found.`)}}async init(){this.logger=await dOe.Logger.child(this.constructor.name)}async getAllFiles(){let t=this.getFileRegex();try{return(await _V.fs.promises.readdir(SV.Global.DIR)).filter(r=>t.test(r))}catch{return[]}}parseUsername(t){return t.replace(this.getFileExtension(),"")}parseFilename(t){return cOe.join(SV.Global.DIR,`${t}${this.getFileExtension()}`)}};ba.BaseOrgAccessor=Q2;var Gx=class extends Q2{async initAuthFile(t,r=!1){return wV.AuthInfoConfig.create({...wV.AuthInfoConfig.getOptions(t),throwOnNotFound:r})}getFileRegex(){return/^[^.][^@]*@[^.]+(\.[^.\s]+)+\.json$/}getFileExtension(){return".json"}};ba.OrgAccessor=Gx});var xV=h(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.SandboxOrgConfig=void 0;var hOe=Cr(),gOe=nu(),eg=class extends gOe.ConfigFile{constructor(t){super(t)}static getOptions(t){return{isGlobal:!0,isState:!0,filename:`${t}.sandbox.json`,orgId:t,stateFolder:hOe.Global.SFDX_STATE_FOLDER}}};tg.SandboxOrgConfig=eg;(function(e){let t;(function(r){r.PROD_ORG_USERNAME="prodOrgUsername"})(t=e.Fields||(e.Fields={}))})(eg||(tg.SandboxOrgConfig=eg={}))});var CV=h(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});e4.SandboxAccessor=void 0;var OV=xV(),yOe=Jx(),Kx=class extends yOe.BaseOrgAccessor{async initAuthFile(t,r=!1){return OV.SandboxOrgConfig.create({...OV.SandboxOrgConfig.getOptions(t),throwOnNotFound:r})}getFileRegex(){return/^(00D.*?)\.sandbox\.json$/}getFileExtension(){return".sandbox.json"}};e4.SandboxAccessor=Kx});var zf=h(t4=>{"use strict";Object
|
|||
|
|
`).join(`
|
|||
|
|
`+a),e.push(i+"m+"+u4.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=LCe()+t+" "+e[0]}function LCe(){return Br.inspectOpts.hideDate?"":new Date().toISOString()+" "}function kCe(...e){return process.stderr.write(c4.formatWithOptions(Br.inspectOpts,...e)+`
|
|||
|
|
`)}function NCe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function jCe(){return process.env.DEBUG}function PCe(e){e.inspectOpts={};let t=Object.keys(Br.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Br.inspectOpts[t[r]]}u4.exports=pO()(Br);var{formatters:hW}=u4.exports;hW.o=function(e){return this.inspectOpts.colors=this.useColors,c4.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(t=>t.trim()).join(" ")};hW.O=function(e){return this.inspectOpts.colors=this.useColors,c4.inspect(e,this.inspectOpts)}});var d4=h((P2t,fO)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?fO.exports=mW():fO.exports=gW()});var yW=h(mO=>{"use strict";Object.defineProperty(mO,"__esModule",{value:!0});function MCe(e){return function(t,r){return new Promise((n,i)=>{e.call(this,t,r,(a,o)=>{a?i(a):n(o)})})}}mO.default=MCe});var _W=h((gO,vW)=>{"use strict";var bW=gO&&gO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},RCe=require("events"),FCe=bW(d4()),$Ce=bW(yW()),ug=FCe.default("agent-base");function UCe(e){return!!e&&typeof e.addRequest=="function"}function hO(){let{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
|
|||
|
|
`).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function p4(e,t){return new p4.Agent(e,t)}(function(e){class t extends RCe.EventEmitter{constructor(n,i){super();let a=i;typeof n=="function"?this.callback=n:n&&(a=n),this.timeout=null,a&&typeof a.timeout=="number"&&(this.timeout=a.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:hO()?443:80}set defaultPort(n){this.explicitDefaultPort=n}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:hO()?"https:":"http:"}set protocol(n){this.explicitProtocol=n}callback(n,i,a){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(n,i){let a=Object.assign({},i);typeof a.secureEndpoint!="boolean"&&(a.secureEndpoint=hO()),a.host==null&&(a.host="localhost"),a.port==null&&(a.port=a.secureEndpoint?443:80),a.protocol==null&&(a.protocol=a.secureEndpoint?"https:":"http:"),a.host&&a.path&&delete a.path,delete a.agent,delete a.hostname,delete a._defaultAgent,delete a.defaultPort,delete a.createConnection,n._last=!0,n.shouldKeepAlive=!1;let o=!1,s=null,l=a.timeout||this.timeout,c=p=>{n._hadError||(n.emit("error",p),n._hadError=!0)},u=()=>{s=null,o=!0;let p=new Error(`A "socket" was not created for HTTP request before ${l}ms`);p.code="ETIMEOUT",c(p)},d=p=>{o||(s!==null&&(clearTimeout(s),s=null),c(p))},f=p=>{if(o)return;if(s!=null&&(clearTimeout(s),s=null),UCe(p)){ug("Callback returned another Agent instance %o",p.constructor.name),p.addRequest(n,a);return}if(p){p.once("free",()=>{this.freeSocket(p,a)}),n.onSocket(p);return}let m=new Error(`no Duplex stream was returned to agent-base for \`${n.method} ${n.path}\``);c(m)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ug("Converting legacy callback function to promise"),this.promisifiedCallback=$Ce.default(this.callback)):this.promisifiedCallback=this.callback),typeof l=="number"&&l>0&&(s=setTimeout(u,l)),"port"in a&&typeof a.port!="number"&&(a.port=Number(a.port));try{ug("Resolving socket for %o request: %o",a.protocol,`${n.method} ${n.path}`),Promise.resolve(this.promisifiedCallback(n,a)).then(f,d)}catch(p){Promise.reject(p).catch(d)}}freeSocket(n,i){ug("Freeing socket %o %o",n.constructor.name,i),n.destroy()}destroy(){ug("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(p4||(p4={}));vW.exports=p4});var wW=h(pg=>{"use strict";var zCe=pg&&pg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pg,"__esModule",{value:!0});var qCe=zCe(d4()),dg=qCe.default("https-proxy-agent:parse-proxy-response");function BCe(e){return new Promise((t,r)=>{let n=0,i=[];function a(){let d=e.read();d?u(d):e.once("readable",a)}function o(){e.removeListener("end",l),e.removeListener("error",c),e.removeListener("close",s),e.removeListener("readable",a)}function s(d){dg("onclose had error %o",d)}function l(){dg("onend")}function c(d){o(),dg("onerror %o",d),r(d)}function u(d){i.push(d),n+=d.length;let f=Buffer.concat(i,n);if(f.indexOf(`\r
|
|||
|
|
\r
|
|||
|
|
`)===-1){dg("have not received end of HTTP headers yet..."),a();return}let m=f.toString("ascii",0,f.indexOf(`\r
|
|||
|
|
`)),y=+m.split(" ")[1];dg("got proxy server response: %o",m),t({statusCode:y,buffered:f})}e.on("error",c),e.on("close",s),e.on("end",l),a()})}pg.default=BCe});var xW=h(Vd=>{"use strict";var VCe=Vd&&Vd.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(u){try{c(n.next(u))}catch(d){o(d)}}function l(u){try{c(n.throw(u))}catch(d){o(d)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})},Xf=Vd&&Vd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vd,"__esModule",{value:!0});var SW=Xf(require("net")),EW=Xf(require("tls")),WCe=Xf(require("url")),ZCe=Xf(require("assert")),HCe=Xf(d4()),GCe=_W(),JCe=Xf(wW()),fg=HCe.default("https-proxy-agent:agent"),yO=class extends GCe.Agent{constructor(t){let r;if(typeof t=="string"?r=WCe.default.parse(t):r=t,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");fg("creating new HttpsProxyAgent instance: %o",r),super(r);let n=Object.assign({},r);this.secureProxy=r.secureProxy||YCe(n.protocol),n.host=n.hostname||n.host,typeof n.port=="string"&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(t,r){return VCe(this,void 0,void 0,function*(){let{proxy:n,secureProxy:i}=this,a;i?(fg("Creating `tls.Socket`: %o",n),a=EW.default.connect(n)):(fg("Creating `net.Socket`: %o",n),a=SW.default.connect(n));let o=Object.assign({},n.headers),l=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r
|
|||
|
|
`;n.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:c,port:u,secureEndpoint:d}=r;XCe(u,d)||(c+=`:${u}`),o.Host=c,o.Connection="close";for(let v of Object.keys(o))l+=`${v}: ${o[v]}\r
|
|||
|
|
`;let f=JCe.default(a);a.write(`${l}\r
|
|||
|
|
`);let{statusCode:p,buffered:m}=yield f;if(p===200){if(t.once("socket",KCe),r.secureEndpoint){fg("Upgrading socket connection to TLS");let v=r.servername||r.host;return EW.default.connect(Object.assign(Object.assign({},QCe(r,"host","hostname","path","port")),{socket:a,servername:v}))}return a}a.destroy();let y=new SW.default.Socket({writable:!1});return y.readable=!0,t.once("socket",v=>{fg("replaying proxy buffer for failed request"),ZCe.default(v.listenerCount("data")>0),v.push(m),v.push(null)}),y})}};Vd.default=yO;function KCe(e){e.resume()}function XCe(e,t){return!!(!t&&e===80||t&&e===443)}function YCe(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function QCe(e,...t){let r={},n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}});var CW=h((_O,OW)=>{"use strict";var eTe=_O&&_O.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bO=eTe(xW());function vO(e){return new bO.default(e)}(function(e){e.HttpsProxyAgent=bO.default,e.prototype=bO.default.prototype})(vO||(vO={}));OW.exports=vO});var fo=h(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.getLogger=yr.Logger=yr.LogLevels=void 0;yr.LogLevels={DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5,NONE:6};var tTe=["","DEBUG","INFO","WARN","ERROR","FATAL","NONE"],rTe=(()=>{let e=process.env.JSFORCE_LOG_LEVEL||global.__JSFORCE_LOG_LEVEL__||"NONE";if(/^(DEBUG|INFO|WARN|ERROR|FATAL|NONE)$/i.test(e))return{"*":e};try{return JSON.parse(e)}catch{return{"*":"NONE"}}})();function nTe(e,t){let r=e[t]||e["*"];return typeof r=="number"?r:yr.LogLevels[r]||yr.LogLevels.NONE}var f4=class e{_moduleName;_logLevel;constructor(t,r=rTe){this._moduleName=t,this._logLevel=typeof r=="number"?r:typeof r=="string"?yr.LogLevels[r]||yr.LogLevels.NONE:nTe(r,t)}createInstance(t=this._logLevel){return new e(this._moduleName,t)}setLogLevel(t){typeof t=="string"?this._logLevel=yr.LogLevels[t]||yr.LogLevels.NONE:this._logLevel=t}log(t,...r){if(this._logLevel<=t){let n=[`${tTe[t]} [${this._moduleName}] `,...r];t<yr.LogLevels.ERROR?console.log(...n):console.error(...n)}}debug(...t){this.log(yr.LogLevels.DEBUG,...t)}info(...t){this.log(yr.LogLevels.INFO,...t)}warn(...t){this.log(yr.LogLevels.WARN,...t)}error(...t){this.log(yr.LogLevels.ERROR,...t)}fatal(...t){this.log(yr.LogLevels.FATAL,...t)}};yr.Logger=f4;var TW={};function iTe(e){let t=TW[e]||new f4(e);return TW[e]=t,t}yr.getLogger=iTe});var Yf=h(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.concatStreamsAsDuplex=du.readAll=du.createLazyStream=void 0;var m4=require("stream"),aTe=fo(),wO=(0,aTe.getLogger)("stream");function oTe(){let e=new m4.PassThrough,t=new m4.PassThrough,r=IW(e,t),n=!1;return{stream:r,setStream:a=>{if(n)throw new Error("stream is already piped to actual stream");n=!0,e.pipe(a).pipe(t)}}}du.createLazyStream=oTe;var SO=class extends m4.Writable{_chunks;_totalBytes;constructor(){super(),this._chunks=[],this._totalBytes=0}_write(t,r,n){this._chunks.push(t),this._totalBytes+=t.length,n()}_writev(t,r){for(let{chunk:n}of t)this._chunks.push(n),this._totalBytes+=n.length;r()}toString(t="utf-8"){return Buffer.concat(this._chunks).toString(t)}};async function sTe(e,t="utf-8"){wO.debug("readAll: starting to read stream");let r=Date.now();return new Promise((n,i)=>{let a=new SO;e.on("error",o=>{wO.error(`readAll: stream error: ${o.message}`),i(o)}).pipe(a).on("finish",()=>{wO.debug(`readAll: stream finished in ${Date.now()-r}ms`),n(a.toString(t))})})}du.readAll=sTe;var EO=class extends m4.Duplex{_writable;_readable;constructor(t,r,n={}){super({writableObjectMode:n.writableObjectMode??t.writableObjectMode,readableObjectMode:n.readableObjectMode??r.readableObjectMode}),this._writable=t,this._readable=r,t.once("finish",()=>{this.end()}),this.once("finish",()=>{t.end()}),r.on("readable",()=>{this._readStream()}),r.once("end",()=>{this.push(null)}),t.on("error",i=>this.emit("error",i)),r.on("error",i=>this.emit("error",i))}_write(t,r,n){this._writable.write(t,r,n)}_read(t){this._readStream(t)}_readStream(t){let r;for(;(r=this._readable.read(t))!==null;)this.push(r)}};function IW(e,t,r){return new E
|
|||
|
|
`;rt.DEFAULT_CONTENT_TYPE="application/octet-stream";rt.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=qO.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),a=this._multiPartFooter();n(i),n(t),n(a),this._trackLength(i,t,r)};rt.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+rt.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&pu(t,"httpVersion"))&&!(t instanceof qIe))&&(r.knownLength||this._valuesToMeasure.push(t))};rt.prototype._lengthRetriever=function(e,t){pu(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):zIe.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):pu(e,"httpVersion")?t(null,Number(e.headers["content-length"])):pu(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};rt.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),a="",o={"Content-Disposition":["form-data",'name="'+DH(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&zO(o,r.header);var s;for(var l in o)if(pu(o,l)){if(s=o[l],s==null)continue;Array.isArray(s)||(s=[s]),s.length&&(a+=l+": "+s.join("; ")+rt.LINE_BREAK)}return"--"+this.getBoundary()+rt.LINE_BREAK+a+rt.LINE_BREAK};rt.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=$O.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=$O.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&pu(e,"httpVersion")&&(r=$O.basename(e.client._httpMessage.path||"")),r)return'filename="'+DH(r)+'"'};rt.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=UO.lookup(e.name)),!r&&e&&e.path&&(r=UO.lookup(e.path)),!r&&e&&e.readable&&pu(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=UO.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=rt.DEFAULT_CONTENT_TYPE),r};rt.prototype._multiPartFooter=function(){return function(e){var t=rt.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};rt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+rt.LINE_BREAK};rt.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)pu(e,t)&&(r[t.toLowerCase()]=e[t]);return r};rt.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};rt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};rt.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(rt.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};rt.prototype._generateBoundary=function(){this._boundary="--------------------------"+BIe.randomBytes(12).toString("hex")};rt.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};rt.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};rt.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length
|
|||
|
|
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(rC)});var Yo=h((rG,mu)=>{(function(){var e,t,r,n,i,a,o,s=[].slice,l={}.hasOwnProperty;e=function(){var c,u,d,f,p,m;if(m=arguments[0],p=2<=arguments.length?s.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(c=0,d=p.length;c<d;c++)if(f=p[c],f!=null)for(u in f)l.call(f,u)&&(m[u]=f[u]);return m},i=function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},a=function(c){var u;return!!c&&((u=typeof c)=="function"||u==="object")},r=function(c){return i(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},n=function(c){var u;if(r(c))return!c.length;for(u in c)if(l.call(c,u))return!1;return!0},o=function(c){var u,d;return a(c)&&(d=Object.getPrototypeOf(c))&&(u=d.constructor)&&typeof u=="function"&&u instanceof u&&Function.prototype.toString.call(u)===Function.prototype.toString.call(Object)},t=function(c){return i(c.valueOf)?c.valueOf():c},mu.exports.assign=e,mu.exports.isFunction=i,mu.exports.isObject=a,mu.exports.isArray=r,mu.exports.isEmpty=n,mu.exports.isPlainObject=o,mu.exports.getValue=t}).call(rG)});var nC=h((nG,iG)=>{(function(){var e;iG.exports=e=function(){function t(){}return t.prototype.hasFeature=function(r,n){return!0},t.prototype.createDocumentType=function(r,n,i){throw new Error("This DOM method is not implemented.")},t.prototype.createDocument=function(r,n,i){throw new Error("This DOM method is not implemented.")},t.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")},t.prototype.getFeature=function(r,n){throw new Error("This DOM method is not implemented.")},t}()}).call(nG)});var sG=h((aG,oG)=>{(function(){var e;oG.exports=e=function(){function t(){}return t.prototype.handleError=function(r){throw new Error(r)},t}()}).call(aG)});var uG=h((lG,cG)=>{(function(){var e;cG.exports=e=function(){function t(r){this.arr=r||[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.arr.length}}),t.prototype.item=function(r){return this.arr[r]||null},t.prototype.contains=function(r){return this.arr.indexOf(r)!==-1},t}()}).call(lG)});var fG=h((dG,pG)=>{(function(){var e,t,r;t=sG(),r=uG(),pG.exports=e=function(){function n(){var i;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new t,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=i=Object.create(this.defaultParams)}return Object.defineProperty(n.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),n.prototype.getParameter=function(i){return this.params.hasOwnProperty(i)?this.params[i]:null},n.prototype.canSetParameter=function(i,a){return!0},n.prototype.setParameter=function(i,a){return a!=null?this.params[i]=a:delete this.params[i]},n}()}).call(dG)});var lr=h((mG,hG)=>{(function(){hG.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(mG)});var iC=h((gG,yG)=>{(function(){var e,t,r;e=lr(),r=qi(),yG.exports=t=function(){function n(i,a,o){if(this.parent=i,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),a==null)throw new Error("Missing attribute name. "+this.debugInfo(a));this.name=this.stringify.name(a),this.value=this.stringify.attValue(o),this.type=e.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(n.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(n.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defin
|
|||
|
|
`,_.offset=(j=w.offset)!=null?j:0,_.dontPrettyTextNodes=(P=(T=w.dontPrettyTextNodes)!=null?T:w.dontprettytextnodes)!=null?P:0,_.spaceBeforeSlash=(N=(k=w.spaceBeforeSlash)!=null?k:w.spacebeforeslash)!=null?N:"",_.spaceBeforeSlash===!0&&(_.spaceBeforeSlash=" "),_.suppressPrettyCount=0,_.user={},_.state=t.None,_},E.prototype.indent=function(w,_,b){var A;return!_.pretty||_.suppressPrettyCount?"":_.pretty&&(A=(b||0)+_.offset+1,A>0)?new Array(A).join(_.indent):""},E.prototype.endline=function(w,_,b){return!_.pretty||_.suppressPrettyCount?"":_.newline},E.prototype.attribute=function(w,_,b){var A;return this.openAttribute(w,_,b),A=" "+w.name+'="'+w.value+'"',this.closeAttribute(w,_,b),A},E.prototype.cdata=function(w,_,b){var A;return this.openNode(w,_,b),_.state=t.OpenTag,A=this.indent(w,_,b)+"<![CDATA[",_.state=t.InsideTag,A+=w.value,_.state=t.CloseTag,A+="]]>"+this.endline(w,_,b),_.state=t.None,this.closeNode(w,_,b),A},E.prototype.comment=function(w,_,b){var A;return this.openNode(w,_,b),_.state=t.OpenTag,A=this.indent(w,_,b)+"<!-- ",_.state=t.InsideTag,A+=w.value,_.state=t.CloseTag,A+=" -->"+this.endline(w,_,b),_.state=t.None,this.closeNode(w,_,b),A},E.prototype.declaration=function(w,_,b){var A;return this.openNode(w,_,b),_.state=t.OpenTag,A=this.indent(w,_,b)+"<?xml",_.state=t.InsideTag,A+=' version="'+w.version+'"',w.encoding!=null&&(A+=' encoding="'+w.encoding+'"'),w.standalone!=null&&(A+=' standalone="'+w.standalone+'"'),_.state=t.CloseTag,A+=_.spaceBeforeSlash+"?>",A+=this.endline(w,_,b),_.state=t.None,this.closeNode(w,_,b),A},E.prototype.docType=function(w,_,b){var A,j,P,T,N;if(b||(b=0),this.openNode(w,_,b),_.state=t.OpenTag,T=this.indent(w,_,b),T+="<!DOCTYPE "+w.root().name,w.pubID&&w.sysID?T+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(T+=' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(T+=" [",T+=this.endline(w,_,b),_.state=t.InsideTag,N=w.children,j=0,P=N.length;j<P;j++)A=N[j],T+=this.writeChildNode(A,_,b+1);_.state=t.CloseTag,T+="]"}return _.state=t.CloseTag,T+=_.spaceBeforeSlash+">",T+=this.endline(w,_,b),_.state=t.None,this.closeNode(w,_,b),T},E.prototype.element=function(w,_,b){var A,j,P,T,N,k,B,$,K,ae,ne,re,ce,_e;b||(b=0),ae=!1,ne="",this.openNode(w,_,b),_.state=t.OpenTag,ne+=this.indent(w,_,b)+"<"+w.name,re=w.attribs;for(K in re)S.call(re,K)&&(A=re[K],ne+=this.attribute(A,_,b));if(P=w.children.length,T=P===0?null:w.children[0],P===0||w.children.every(function(We){return(We.type===e.Text||We.type===e.Raw)&&We.value===""}))_.allowEmpty?(ne+=">",_.state=t.CloseTag,ne+="</"+w.name+">"+this.endline(w,_,b)):(_.state=t.CloseTag,ne+=_.spaceBeforeSlash+"/>"+this.endline(w,_,b));else if(_.pretty&&P===1&&(T.type===e.Text||T.type===e.Raw)&&T.value!=null)ne+=">",_.state=t.InsideTag,_.suppressPrettyCount++,ae=!0,ne+=this.writeChildNode(T,_,b+1),_.suppressPrettyCount--,ae=!1,_.state=t.CloseTag,ne+="</"+w.name+">"+this.endline(w,_,b);else{if(_.dontPrettyTextNodes){for(ce=w.children,N=0,B=ce.length;N<B;N++)if(j=ce[N],(j.type===e.Text||j.type===e.Raw)&&j.value!=null){_.suppressPrettyCount++,ae=!0;break}}for(ne+=">"+this.endline(w,_,b),_.state=t.InsideTag,_e=w.children,k=0,$=_e.length;k<$;k++)j=_e[k],ne+=this.writeChildNode(j,_,b+1);_.state=t.CloseTag,ne+=this.indent(w,_,b)+"</"+w.name+">",ae&&_.suppressPrettyCount--,ne+=this.endline(w,_,b),_.state=t.None}return this.closeNode(w,_,b),ne},E.prototype.writeChildNode=function(w,_,b){switch(w.type){case e.CData:return this.cdata(w,_,b);case e.Comment:return this.comment(w,_,b);case e.Element:return this.element(w,_,b);case e.Raw:return this.raw(w,_,b);case e.Text:return this.text(w,_,b);case e.ProcessingInstruction:return this.processingInstruction(w,_,b);case e.Dummy:return"";case e.Declaration:return this.declaration(w,_,b);case e.DocType:return this.docType(w,_,b);case e.AttributeDeclaration:return this.dtdAttList(w,_,b);case e.ElementDeclaration:return this.dtdElement(w,_,b);case e.EntityDeclaration:return this.dtdEntity(w,_,b);case e.NotationDeclaration:return this.dtdNotation(w,_,b);default:throw new Error("Unknown XML node type: "+w.constructor.name)}},E.prototype.proc
|
|||
|
|
`||D==="\r"||D===" "}function b(D){return D==='"'||D==="'"}function A(D){return D===">"||_(D)}function j(D,I){return D.test(I)}function P(D,I){return!j(D,I)}var T=0;e.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},e.XML_ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'"}),e.ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}),Object.keys(e.ENTITIES).forEach(function(D){var I=e.ENTITIES[D],W=typeof I=="number"?String.fromCharCode(I):I;e.ENTITIES[D]=W});for(var N in e.STATE)e.STATE[e.STATE[N]]=N;T=e.STATE;function k(D,I,W){D[I]&&D[I](W)}function B(D){var I=D&&D.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return I?I[2]:null}function $(D){return D?D.toLowerCase().replace(/[^a-z0-9]/g,""):null}function K(D,I){let W=$(D),q=$(I);return!W||!q?!0:q==="utf16"?W==="utf16le"||W==="utf16be":W===q}function ae(D,I){if(!(!D.strict||!D.encoding||!I||I.name!=="xml")){var W=B(I.body);W&&!K(D.encoding,W)&&Me(D,"XML declaration encoding "+W+" d
|
|||
|
|
Line: `+D.line+`
|
|||
|
|
Column: `+D.column+`
|
|||
|
|
Char: `+D.c),I=new Error(I),D.error=I,k(D,"onerror",I),D}function We(D){return D.sawRoot&&!D.closedRoot&&Me(D,"Unclosed root tag"),D.state!==T.BEGIN&&D.state!==T.BEGIN_WHITESPACE&&D.state!==T.TEXT&&_e(D,"Unexpected end"),re(D),D.c="",D.closed=!0,k(D,"onend"),r.call(D,D.strict,D.opt),D}function Me(D,I){if(typeof D!="object"||!(D instanceof r))throw new Error("bad call to strictFail");D.strict&&_e(D,I)}function Ro(D){D.strict||(D.tagName=D.tagName[D.looseCase]());var I=D.tags[D.tags.length-1]||D,W=D.tag={name:D.tagName,attributes:{}};D.opt.xmlns&&(W.ns=I.ns),D.attribList.length=0,ne(D,"onopentagstart",W)}function Fo(D,I){var W=D.indexOf(":"),q=W<0?["",D]:D.split(":"),ot=q[0],Ut=q[1];return I&&D==="xmlns"&&(ot="xmlns",Ut=""),{prefix:ot,local:Ut}}function a1(D){if(D.strict||(D.attribName=D.attribName[D.looseCase]()),D.attribList.indexOf(D.attribName)!==-1||D.tag.attributes.hasOwnProperty(D.attribName)){D.attribName=D.attribValue="";return}if(D.opt.xmlns){var I=Fo(D.attribName,!0),W=I.prefix,q=I.local;if(W==="xmlns")if(q==="xml"&&D.attribValue!==p)Me(D,"xml: prefix must be bound to "+p+`
|
|||
|
|
Actual: `+D.attribValue);else if(q==="xmlns"&&D.attribValue!==m)Me(D,"xmlns: prefix must be bound to "+m+`
|
|||
|
|
Actual: `+D.attribValue);else{var ot=D.tag,Ut=D.tags[D.tags.length-1]||D;ot.ns===Ut.ns&&(ot.ns=Object.create(Ut.ns)),ot.ns[q]=D.attribValue}D.attribList.push([D.attribName,D.attribValue])}else D.tag.attributes[D.attribName]=D.attribValue,ne(D,"onattribute",{name:D.attribName,value:D.attribValue});D.attribName=D.attribValue=""}function El(D,I){if(D.opt.xmlns){var W=D.tag,q=Fo(D.tagName);W.prefix=q.prefix,W.local=q.local,W.uri=W.ns[q.prefix]||"",W.prefix&&!W.uri&&(Me(D,"Unbound namespace prefix: "+JSON.stringify(D.tagName)),W.uri=q.prefix);var ot=D.tags[D.tags.length-1]||D;W.ns&&ot.ns!==W.ns&&Object.keys(W.ns).forEach(function(Gb){ne(D,"onopennamespace",{prefix:Gb,uri:W.ns[Gb]})});for(var Ut=0,ir=D.attribList.length;Ut<ir;Ut++){var fr=D.attribList[Ut],Yr=fr[0],xi=fr[1],mr=Fo(Yr,!0),na=mr.prefix,kc=mr.local,Hb=na===""?"":W.ns[na]||"",l1={name:Yr,value:xi,prefix:na,local:kc,uri:Hb};na&&na!=="xmlns"&&!Hb&&(Me(D,"Unbound namespace prefix: "+JSON.stringify(na)),l1.uri=na),D.tag.attributes[Yr]=l1,ne(D,"onattribute",l1)}D.attribList.length=0}D.tag.isSelfClosing=!!I,D.sawRoot=!0,D.tags.push(D.tag),ne(D,"onopentag",D.tag),I||(!D.noscript&&D.tagName.toLowerCase()==="script"?D.state=T.SCRIPT:D.state=T.TEXT,D.tag=null,D.tagName=""),D.attribName=D.attribValue="",D.attribList.length=0}function o1(D){if(!D.tagName){Me(D,"Weird empty close tag."),D.textNode+="</>",D.state=T.TEXT;return}if(D.script){if(D.tagName!=="script"){D.script+="</"+D.tagName+">",D.tagName="",D.state=T.SCRIPT;return}ne(D,"onscript",D.script),D.script=""}var I=D.tags.length,W=D.tagName;D.strict||(W=W[D.looseCase]());for(var q=W;I--;){var ot=D.tags[I];if(ot.name!==q)Me(D,"Unexpected close tag");else break}if(I<0){Me(D,"Unmatched closing tag: "+D.tagName),D.textNode+="</"+D.tagName+">",D.state=T.TEXT;return}D.tagName=W;for(var Ut=D.tags.length;Ut-- >I;){var ir=D.tag=D.tags.pop();D.tagName=D.tag.name,ne(D,"onclosetag",D.tagName);var fr={};for(var Yr in ir.ns)fr[Yr]=ir.ns[Yr];var xi=D.tags[D.tags.length-1]||D;D.opt.xmlns&&ir.ns!==xi.ns&&Object.keys(ir.ns).forEach(function(mr){var na=ir.ns[mr];ne(D,"onclosenamespace",{prefix:mr,uri:na})})}I===0&&(D.closedRoot=!0),D.tagName=D.attribValue=D.attribName="",D.attribList.length=0,D.state=T.TEXT}function e9(D){var I=D.entity,W=I.toLowerCase(),q,ot="";return D.ENTITIES[I]?D.ENTITIES[I]:D.ENTITIES[W]?D.ENTITIES[W]:(I=W,I.charAt(0)==="#"&&(I.charAt(1)==="x"?(I=I.slice(2),q=parseInt(I,16),ot=q.toString(16)):(I=I.slice(1),q=parseInt(I,10),ot=q.toString(10))),I=I.replace(/^0+/,""),isNaN(q)||ot.toLowerCase()!==I||q<0||q>1114111||!Wb(q)?(Me(D,"Invalid character entity"),"&"+D.entity+";"):String.fromCodePoint(q))}function Wb(D){return D===9||D===10||D===13||D>=32&&D<=55295||D>=57344&&D<=65533||D>=65536&&D<=1114111}function Zb(D,I){I==="<"?(D.state=T.OPEN_WAKA,D.startTagPosition=D.position):_(I)||(Me(D,"Non-whitespace before first tag."),D.textNode=I,D.state=T.TEXT)}function s1(D,I){var W="";return I<D.length&&(W=D.charAt(I)),W}function t9(D){var I=this;if(this.error)throw this.error;if(I.closed)return _e(I,"Cannot write after close. Assign an onready handler.");if(D===null)return We(I);typeof D=="object"&&(D=D.toString());for(var W=0,q="";q=s1(D,W++),I.c=q,!!q;)switch(I.trackPosition&&(I.position++,q===`
|
|||
|
|
`?(I.line++,I.column=0):I.column++),I.state){case T.BEGIN:if(I.state=T.BEGIN_WHITESPACE,q==="\uFEFF")continue;Zb(I,q);continue;case T.BEGIN_WHITESPACE:Zb(I,q);continue;case T.TEXT:if(I.sawRoot&&!I.closedRoot){for(var Ut=W-1;q&&q!=="<"&&q!=="&";)q=s1(D,W++),q&&I.trackPosition&&(I.position++,q===`
|
|||
|
|
`?(I.line++,I.column=0):I.column++);I.textNode+=D.substring(Ut,W-1)}q==="<"&&!(I.sawRoot&&I.closedRoot&&!I.strict)?(I.state=T.OPEN_WAKA,I.startTagPosition=I.position):(!_(q)&&(!I.sawRoot||I.closedRoot)&&Me(I,"Text data outside of root node."),q==="&"?I.state=T.TEXT_ENTITY:I.textNode+=q);continue;case T.SCRIPT:q==="<"?I.state=T.SCRIPT_ENDING:I.script+=q;continue;case T.SCRIPT_ENDING:q==="/"?I.state=T.CLOSE_TAG:(I.script+="<"+q,I.state=T.SCRIPT);continue;case T.OPEN_WAKA:if(q==="!")I.state=T.SGML_DECL,I.sgmlDecl="";else if(!_(q))if(j(v,q))I.state=T.OPEN_TAG,I.tagName=q;else if(q==="/")I.state=T.CLOSE_TAG,I.tagName="";else if(q==="?")I.state=T.PROC_INST,I.procInstName=I.procInstBody="";else{if(Me(I,"Unencoded <"),I.startTagPosition+1<I.position){var ot=I.position-I.startTagPosition;q=new Array(ot).join(" ")+q}I.textNode+="<"+q,I.state=T.TEXT}continue;case T.SGML_DECL:if(I.sgmlDecl+q==="--"){I.state=T.COMMENT,I.comment="",I.sgmlDecl="";continue}I.doctype&&I.doctype!==!0&&I.sgmlDecl?(I.state=T.DOCTYPE_DTD,I.doctype+="<!"+I.sgmlDecl+q,I.sgmlDecl=""):d.test(I.sgmlDecl+q)?(ne(I,"onopencdata"),I.state=T.CDATA,I.sgmlDecl="",I.cdata=""):f.test(I.sgmlDecl+q)?(I.state=T.DOCTYPE,(I.doctype||I.sawRoot)&&Me(I,"Inappropriately located doctype declaration"),I.doctype="",I.sgmlDecl=""):q===">"?(ne(I,"onsgmldeclaration",I.sgmlDecl),I.sgmlDecl="",I.state=T.TEXT):(b(q)&&(I.state=T.SGML_DECL_QUOTED),I.sgmlDecl+=q);continue;case T.SGML_DECL_QUOTED:q===I.q&&(I.state=T.SGML_DECL,I.q=""),I.sgmlDecl+=q;continue;case T.DOCTYPE:q===">"?(I.state=T.TEXT,ne(I,"ondoctype",I.doctype),I.doctype=!0):(I.doctype+=q,q==="["?I.state=T.DOCTYPE_DTD:b(q)&&(I.state=T.DOCTYPE_QUOTED,I.q=q));continue;case T.DOCTYPE_QUOTED:I.doctype+=q,q===I.q&&(I.q="",I.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:q==="]"?(I.doctype+=q,I.state=T.DOCTYPE):q==="<"?(I.state=T.OPEN_WAKA,I.startTagPosition=I.position):b(q)?(I.doctype+=q,I.state=T.DOCTYPE_DTD_QUOTED,I.q=q):I.doctype+=q;continue;case T.DOCTYPE_DTD_QUOTED:I.doctype+=q,q===I.q&&(I.state=T.DOCTYPE_DTD,I.q="");continue;case T.COMMENT:q==="-"?I.state=T.COMMENT_ENDING:I.comment+=q;continue;case T.COMMENT_ENDING:q==="-"?(I.state=T.COMMENT_ENDED,I.comment=ce(I.opt,I.comment),I.comment&&ne(I,"oncomment",I.comment),I.comment=""):(I.comment+="-"+q,I.state=T.COMMENT);continue;case T.COMMENT_ENDED:q!==">"?(Me(I,"Malformed comment"),I.comment+="--"+q,I.state=T.COMMENT):I.doctype&&I.doctype!==!0?I.state=T.DOCTYPE_DTD:I.state=T.TEXT;continue;case T.CDATA:for(var Ut=W-1;q&&q!=="]";)q=s1(D,W++),q&&I.trackPosition&&(I.position++,q===`
|
|||
|
|
`?(I.line++,I.column=0):I.column++);I.cdata+=D.substring(Ut,W-1),q==="]"&&(I.state=T.CDATA_ENDING);continue;case T.CDATA_ENDING:q==="]"?I.state=T.CDATA_ENDING_2:(I.cdata+="]"+q,I.state=T.CDATA);continue;case T.CDATA_ENDING_2:q===">"?(I.cdata&&ne(I,"oncdata",I.cdata),ne(I,"onclosecdata"),I.cdata="",I.state=T.TEXT):q==="]"?I.cdata+="]":(I.cdata+="]]"+q,I.state=T.CDATA);continue;case T.PROC_INST:q==="?"?I.state=T.PROC_INST_ENDING:_(q)?I.state=T.PROC_INST_BODY:I.procInstName+=q;continue;case T.PROC_INST_BODY:if(!I.procInstBody&&_(q))continue;q==="?"?I.state=T.PROC_INST_ENDING:I.procInstBody+=q;continue;case T.PROC_INST_ENDING:if(q===">"){let xi={name:I.procInstName,body:I.procInstBody};ae(I,xi),ne(I,"onprocessinginstruction",xi),I.procInstName=I.procInstBody="",I.state=T.TEXT}else I.procInstBody+="?"+q,I.state=T.PROC_INST_BODY;continue;case T.OPEN_TAG:j(S,q)?I.tagName+=q:(Ro(I),q===">"?El(I):q==="/"?I.state=T.OPEN_TAG_SLASH:(_(q)||Me(I,"Invalid character in tag name"),I.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:q===">"?(El(I,!0),o1(I)):(Me(I,"Forward-slash in opening tag not followed by >"),I.state=T.ATTRIB);continue;case T.ATTRIB:if(_(q))continue;q===">"?El(I):q==="/"?I.state=T.OPEN_TAG_SLASH:j(v,q)?(I.attribName=q,I.attribValue="",I.state=T.ATTRIB_NAME):Me(I,"Invalid attribute name");continue;case T.ATTRIB_NAME:q==="="?I.state=T.ATTRIB_VALUE:q===">"?(Me(I,"Attribute without value"),I.attribValue=I.attribName,a1(I),El(I)):_(q)?I.state=T.ATTRIB_NAME_SAW_WHITE:j(S,q)?I.attribName+=q:Me(I,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if(q==="=")I.state=T.ATTRIB_VALUE;else{if(_(q))continue;Me(I,"Attribute without value"),I.tag.attributes[I.attribName]="",I.attribValue="",ne(I,"onattribute",{name:I.attribName,value:""}),I.attribName="",q===">"?El(I):j(v,q)?(I.attribName=q,I.state=T.ATTRIB_NAME):(Me(I,"Invalid attribute name"),I.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(_(q))continue;b(q)?(I.q=q,I.state=T.ATTRIB_VALUE_QUOTED):(I.opt.unquotedAttributeValues||_e(I,"Unquoted attribute value"),I.state=T.ATTRIB_VALUE_UNQUOTED,I.attribValue=q);continue;case T.ATTRIB_VALUE_QUOTED:if(q!==I.q){q==="&"?I.state=T.ATTRIB_VALUE_ENTITY_Q:I.attribValue+=q;continue}a1(I),I.q="",I.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:_(q)?I.state=T.ATTRIB:q===">"?El(I):q==="/"?I.state=T.OPEN_TAG_SLASH:j(v,q)?(Me(I,"No whitespace between attributes"),I.attribName=q,I.attribValue="",I.state=T.ATTRIB_NAME):Me(I,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!A(q)){q==="&"?I.state=T.ATTRIB_VALUE_ENTITY_U:I.attribValue+=q;continue}a1(I),q===">"?El(I):I.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(I.tagName)q===">"?o1(I):j(S,q)?I.tagName+=q:I.script?(I.script+="</"+I.tagName+q,I.tagName="",I.state=T.SCRIPT):(_(q)||Me(I,"Invalid tagname in closing tag"),I.state=T.CLOSE_TAG_SAW_WHITE);else{if(_(q))continue;P(v,q)?I.script?(I.script+="</"+q,I.state=T.SCRIPT):Me(I,"Invalid tagname in closing tag."):I.tagName=q}continue;case T.CLOSE_TAG_SAW_WHITE:if(_(q))continue;q===">"?o1(I):Me(I,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var ir,fr;switch(I.state){case T.TEXT_ENTITY:ir=T.TEXT,fr="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:ir=T.ATTRIB_VALUE_QUOTED,fr="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:ir=T.ATTRIB_VALUE_UNQUOTED,fr="attribValue";break}if(q===";"){var Yr=e9(I);I.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(Yr)?((I.entityCount+=1)>I.opt.maxEntityCount&&_e(I,"Parsed entity count exceeds max entity count"),(I.entityDepth+=1)>I.opt.maxEntityDepth&&_e(I,"Parsed entity depth exceeds max entity depth"),I.entity="",I.state=ir,I.write(Yr),I.entityDepth-=1):(I[fr]+=Yr,I.entity="",I.state=ir)}else j(I.entity.length?w:E,q)?I.entity+=q:(Me(I,"Invalid character in entity name"),I[fr]+="&"+I.entity+q,I.entity="",I.state=ir);continue;default:throw new Error(I,"Unknown state: "+I.state)}return I.position>=I.bufferCheckPosition&&n(I),I}String.fromCodePoint||function(){var D=String.fromCharCode,I=Math.floor
|
|||
|
|
`,o).length:d,c?(s===null?0:s.length)+l.length:0,c?l.length+d:0);return f<p},parse:function(n,i,a,o){let{bom:s,comment_no_infix:l,encoding:c,from_line:u,ltrim:d,max_record_size:f,raw:p,relax_quotes:m,rtrim:y,skip_empty_lines:v,to:S,to_line:E}=this.options,{comment:w,escape:_,quote:b,record_delimiter:A}=this.options,{bomSkipped:j,previousBuf:P,rawBuffer:T,escapeIsQuote:N}=this.state,k;if(P===void 0)if(n===void 0){o();return}else k=n;else P!==void 0&&n===void 0?k=P:k=Buffer.concat([P,n]);if(j===!1)if(s===!1)this.state.bomSkipped=!0;else if(k.length<3){if(i===!1){this.state.previousBuf=k;return}}else{for(let K in im)if(im[K].compare(k,0,im[K].length)===0){let ae=im[K].length;this.state.bufBytesStart+=ae,k=k.slice(ae),this.options=OJ({...this.original_options,encoding:K}),{comment:w,escape:_,quote:b}=this.options;break}this.state.bomSkipped=!0}let B=k.length,$;for($=0;$<B&&!this.__needMoreData($,B,i);$++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),E!==-1&&this.info.lines>E){this.state.stop=!0,o();return}this.state.quoting===!1&&A.length===0&&this.__autoDiscoverRecordDelimiter(k,$)&&(A=this.options.record_delimiter);let K=k[$];if(p===!0&&T.append(K),(K===KAe||K===XAe)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(_!==null&&this.state.quoting===!0&&this.__isEscape(k,$,K)&&$+_.length<B)if(N){if(this.__isQuote(k,$+_.length)){this.state.escaping=!0,$+=_.length-1;continue}}else{this.state.escaping=!0,$+=_.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(k,$))if(this.state.quoting===!0){let re=k[$+b.length],ce=y&&this.__isCharTrimable(k,$+b.length),_e=w!==null&&this.__compareBytes(w,k,$+b.length,re),We=this.__isDelimiter(k,$+b.length,re),Me=A.length===0?this.__autoDiscoverRecordDelimiter(k,$+b.length):this.__isRecordDelimiter(re,k,$+b.length);if(_!==null&&this.__isEscape(k,$,K)&&this.__isQuote(k,$+_.length))$+=_.length-1;else if(!re||We||Me||_e||ce){this.state.quoting=!1,this.state.wasQuoting=!0,$+=b.length-1;continue}else if(m===!1){let Ro=this.__error(new ut("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(re)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(Ro!==void 0)return Ro}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(b),$+=b.length-1}else if(this.state.field.length!==0){if(m===!1){let re=this.__infoField(),ce=Object.keys(im).map(We=>im[We].equals(this.state.field.toString())?We:!1).filter(Boolean)[0],_e=this.__error(new ut("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(re.column)} at line ${re.lines}, value is ${JSON.stringify(this.state.field.toString(c))}`,ce?`(${ce} bom)`:void 0],this.options,re,{field:this.state.field}));if(_e!==void 0)return _e}}else{this.state.quoting=!0,$+=b.length-1;continue}if(this.state.quoting===!1){let re=this.__isRecordDelimiter(K,k,$);if(re!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=u){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),$+=re-1;continue}if(v===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,$+=re-1;continue}this.info.bytes=this.state.bufBytesStart+$;let We=this.__onField();if(We!==void 0)return We;this.info.bytes=this.state.bufBytesStart+$+re;let Me=this.__onRecord(a);if(Me!==void 0)return Me;if(S!==-1&&this.info.records>=S){this.state.stop=!0,o();return}}this.state.commenting=!1,$+=re-1;continue}if(this.state.commenting)continue;if(w!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(w,k,$,K)!==0){this.state.commenting=!0;continue}let ce=this.__isDelimiter(k,$,K);if(ce!==0){this.info.bytes=this.state.bufBytesStart+$;le
|
|||
|
|
`,a),Buffer.from(`
|
|||
|
|
`,a),Buffer.from("\r",a)];e:for(let s=0;s<o.length;s++){let l=o[s].length;for(let c=0;c<l;c++)if(o[s][c]!==n[i+c])continue e;return this.options.record_delimiter.push(o[s]),this.state.recordDelimiterMaxLength=o[s].length,o[s].length}return 0},__error:function(n){let{encoding:i,raw:a,skip_records_with_error:o}=this.options,s=typeof n=="string"?new Error(n):n;if(o){this.state.recordHasError=!0,this.options.on_skip!==void 0&&this.options.on_skip(s,a?this.state.rawBuffer.toString(i):void 0);return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:n,raw:i,encoding:a}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:n===!0,index:this.state.record.length,raw:i?this.state.rawBuffer.toString(a):void 0}},__infoField:function(){let{columns:n}=this.options,i=Array.isArray(n);return{...this.__infoRecord(),column:i===!0?n.length>this.state.record.length?n[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}},G4=class extends qAe.Transform{constructor(t={}){super({readableObjectMode:!0,...t,encoding:null}),this.api=YAe({on_skip:(r,n)=>{this.emit("skip",r,n)},...t}),this.state=this.api.state,this.options=this.api.options,this.info=this.api.info}_transform(t,r,n){if(this.state.stop===!0)return;let i=this.api.parse(t,!1,a=>{this.push(a)},()=>{this.push(null),this.end(),this.on("end",this.destroy)});i!==void 0&&(this.state.stop=!0),n(i)}_flush(t){if(this.state.stop===!0)return;let r=this.api.parse(void 0,!0,n=>{this.push(n)},()=>{this.push(null),this.on("end",this.destroy)});t(r)}},QAe=function(){let e,t,r;for(let i in arguments){let a=arguments[i],o=typeof a;if(e===void 0&&(typeof a=="string"||Buffer.isBuffer(a)))e=a;else if(t===void 0&&TJ(a))t=a;else if(r===void 0&&o==="function")r=a;else throw new ut("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(a)} at index ${i}`],t||{})}let n=new G4(t);if(r){let i=t===void 0||t.objname===void 0?[]:{};n.on("readable",function(){let a;for(;(a=this.read())!==null;)t===void 0||t.objname===void 0?i.push(a):i[a[0]]=a[1]}),n.on("error",function(a){r(a,void 0,n.api.__infoDataSet())}),n.on("end",function(){r(void 0,i,n.api.__infoDataSet())})}if(e!==void 0){let i=function(){n.write(e),n.end()};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}return n};J4.CsvError=ut;J4.Parser=G4;J4.parse=QAe});var NJ=h(pC=>{"use strict";var ht=class e extends Error{constructor(t,r,n,...i){Array.isArray(r)&&(r=r.join(" ").trim()),super(r),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,e),this.code=t;for(let a of i)for(let o in a){let s=a[o];this[o]=Buffer.isBuffer(s)?s.toString(n.encoding):s==null?s:JSON.parse(JSON.stringify(s))}}},eDe=function(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)},kJ=function(e){let t=[];for(let r=0,n=e.length;r<n;r++){let i=e[r];if(i==null||i===!1)t[r]={disabled:!0};else if(typeof i=="string")t[r]={name:i};else if(eDe(i)){if(typeof i.name!="string")throw new ht("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"]);t[r]=i}else throw new ht("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(i)} at position ${r}`])}return t},K4=class{constructor(t=100){this.size=t,this.length=0,this.buf=Buffer.allocUnsafe(t)}prepend(t){if(Buffer.isBuffer(t)){let r=this.length+t.length;if(r>=this.size&&(this.resize(),r>=this.size))throw Error("INVALID_BUFFER_STATE");let n=this.buf;this.buf=Buffer.allocUnsafe(this.size),t.copy(this.buf,0),n.copy(this.buf,t.length),this.length+=t.length}else{let r=this.length++;r===this.size&&this.resize();let n=this.clone();this.buf[0]=t,n.copy(this.buf,1,0,r)}}append(t){let r=this.length++;r===this.size&&this.resize(),this.buf[r]=t}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let t=this.length;this.size=this.size*2;let r=Buffer.allocUnsafe(this.size);this.buf.copy(r,0,0,t),this.buf=r}toString(t){ret
|
|||
|
|
`,o).length:d,c?(s===null?0:s.length)+l.length:0,c?l.length+d:0);return f<p},parse:function(n,i,a,o){let{bom:s,comment_no_infix:l,encoding:c,from_line:u,ltrim:d,max_record_size:f,raw:p,relax_quotes:m,rtrim:y,skip_empty_lines:v,to:S,to_line:E}=this.options,{comment:w,escape:_,quote:b,record_delimiter:A}=this.options,{bomSkipped:j,previousBuf:P,rawBuffer:T,escapeIsQuote:N}=this.state,k;if(P===void 0)if(n===void 0){o();return}else k=n;else P!==void 0&&n===void 0?k=P:k=Buffer.concat([P,n]);if(j===!1)if(s===!1)this.state.bomSkipped=!0;else if(k.length<3){if(i===!1){this.state.previousBuf=k;return}}else{for(let K in am)if(am[K].compare(k,0,am[K].length)===0){let ae=am[K].length;this.state.bufBytesStart+=ae,k=k.slice(ae),this.options=DJ({...this.original_options,encoding:K}),{comment:w,escape:_,quote:b}=this.options;break}this.state.bomSkipped=!0}let B=k.length,$;for($=0;$<B&&!this.__needMoreData($,B,i);$++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),E!==-1&&this.info.lines>E){this.state.stop=!0,o();return}this.state.quoting===!1&&A.length===0&&this.__autoDiscoverRecordDelimiter(k,$)&&(A=this.options.record_delimiter);let K=k[$];if(p===!0&&T.append(K),(K===lDe||K===cDe)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(_!==null&&this.state.quoting===!0&&this.__isEscape(k,$,K)&&$+_.length<B)if(N){if(this.__isQuote(k,$+_.length)){this.state.escaping=!0,$+=_.length-1;continue}}else{this.state.escaping=!0,$+=_.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(k,$))if(this.state.quoting===!0){let re=k[$+b.length],ce=y&&this.__isCharTrimable(k,$+b.length),_e=w!==null&&this.__compareBytes(w,k,$+b.length,re),We=this.__isDelimiter(k,$+b.length,re),Me=A.length===0?this.__autoDiscoverRecordDelimiter(k,$+b.length):this.__isRecordDelimiter(re,k,$+b.length);if(_!==null&&this.__isEscape(k,$,K)&&this.__isQuote(k,$+_.length))$+=_.length-1;else if(!re||We||Me||_e||ce){this.state.quoting=!1,this.state.wasQuoting=!0,$+=b.length-1;continue}else if(m===!1){let Ro=this.__error(new ht("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(re)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(Ro!==void 0)return Ro}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(b),$+=b.length-1}else if(this.state.field.length!==0){if(m===!1){let re=this.__infoField(),ce=Object.keys(am).map(We=>am[We].equals(this.state.field.toString())?We:!1).filter(Boolean)[0],_e=this.__error(new ht("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(re.column)} at line ${re.lines}, value is ${JSON.stringify(this.state.field.toString(c))}`,ce?`(${ce} bom)`:void 0],this.options,re,{field:this.state.field}));if(_e!==void 0)return _e}}else{this.state.quoting=!0,$+=b.length-1;continue}if(this.state.quoting===!1){let re=this.__isRecordDelimiter(K,k,$);if(re!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=u){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),$+=re-1;continue}if(v===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,$+=re-1;continue}this.info.bytes=this.state.bufBytesStart+$;let We=this.__onField();if(We!==void 0)return We;this.info.bytes=this.state.bufBytesStart+$+re;let Me=this.__onRecord(a);if(Me!==void 0)return Me;if(S!==-1&&this.info.records>=S){this.state.stop=!0,o();return}}this.state.commenting=!1,$+=re-1;continue}if(this.state.commenting)continue;if(w!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(w,k,$,K)!==0){this.state.commenting=!0;continue}let ce=this.__isDelimiter(k,$,K);if(ce!==0){this.info.bytes=this.state.bufBytesStart+$;le
|
|||
|
|
`,a),Buffer.from(`
|
|||
|
|
`,a),Buffer.from("\r",a)];e:for(let s=0;s<o.length;s++){let l=o[s].length;for(let c=0;c<l;c++)if(o[s][c]!==n[i+c])continue e;return this.options.record_delimiter.push(o[s]),this.state.recordDelimiterMaxLength=o[s].length,o[s].length}return 0},__error:function(n){let{encoding:i,raw:a,skip_records_with_error:o}=this.options,s=typeof n=="string"?new Error(n):n;if(o){this.state.recordHasError=!0,this.options.on_skip!==void 0&&this.options.on_skip(s,a?this.state.rawBuffer.toString(i):void 0);return}else return s},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:n,raw:i,encoding:a}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:n===!0,index:this.state.record.length,raw:i?this.state.rawBuffer.toString(a):void 0}},__infoField:function(){let{columns:n}=this.options,i=Array.isArray(n);return{...this.__infoRecord(),column:i===!0?n.length>this.state.record.length?n[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}},dDe=function(e,t={}){typeof e=="string"&&(e=Buffer.from(e));let r=t&&t.objname?{}:[],n=uDe(t),i=l=>{n.options.objname===void 0?r.push(l):r[l[0]]=l[1]},a=()=>{},o=n.parse(e,!1,i,a);if(o!==void 0)throw o;let s=n.parse(void 0,!0,i,a);if(s!==void 0)throw s;return r};pC.CsvError=ht;pC.parse=dDe});var $J=h(Y4=>{"use strict";var pDe=require("stream"),ho=class e extends Error{constructor(t,r,...n){Array.isArray(r)&&(r=r.join(" ")),super(r),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,e),this.code=t;for(let i of n)for(let a in i){let o=i[a];this[a]=Buffer.isBuffer(o)?o.toString():o==null?o:JSON.parse(JSON.stringify(o))}}},PJ=function(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)},fDe=46,mDe=/\\(\\)?/g,hDe=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),gDe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yDe=/^\w*$/,bDe=function(e){return Object.prototype.toString.call(e)},MJ=function(e){let t=typeof e;return t==="symbol"||t==="object"&&e&&bDe(e)==="[object Symbol]"},vDe=function(e,t){if(Array.isArray(e))return!1;let r=typeof e;return r==="number"||r==="symbol"||r==="boolean"||!e||MJ(e)?!0:yDe.test(e)||!gDe.test(e)||t!=null&&e in Object(t)},_De=function(e){let t=[];return e.charCodeAt(0)===fDe&&t.push(""),e.replace(hDe,function(r,n,i,a){let o=r;i?o=a.replace(mDe,"$1"):n&&(o=n.trim()),t.push(o)}),t},wDe=function(e,t){return Array.isArray(e)?e:vDe(e,t)?[e]:_De(e)},SDe=function(e){if(typeof e=="string"||MJ(e))return e;let t=`${e}`;return t=="0"&&1/e==-1/0?"-0":t},EDe=function(e,t){t=wDe(t,e);let r=0,n=t.length;for(;e!=null&&r<n;)e=e[SDe(t[r++])];return r&&r===n?e:void 0},RJ=function(e){if(e==null)return[void 0,void 0];if(typeof e!="object")return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(e)){let t=[];for(let r of e)if(typeof r=="string")t.push({key:r,header:r});else if(typeof r=="object"&&r!==null&&!Array.isArray(r)){if(!r.key)return[Error('Invalid column definition: property "key" is required')];r.header===void 0&&(r.header=r.key),t.push(r)}else return[Error("Invalid column definition: expect a string or an object")];e=t}else{let t=[];for(let r in e)t.push({key:r,header:e[r]});e=t}return[void 0,e]},xDe=function(e){return e.replace(/([A-Z])/g,function(t,r){return"_"+r.toLowerCase()})},FJ=function(e){let t={};for(let i in e)t[xDe(i)]=e[i];if(t.bom===void 0||t.bom===null||t.bom===!1)t.bom=!1;else if(t.bom!==!0)return[new ho("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(t.bom)}`])];if(t.delimiter===void 0||t.delimiter===null)t.delimiter=",";else if(Buffer.isBuffer(t.delimiter))t.delimiter=t.delimiter.toString();else if(typeof t.delimiter!="string")return[new ho("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(t.delimiter)}`])];if(t.quote===void 0||t.quote===null)t.quote='"';else if(t.quote===!0)t.quote='"';else if(t.quote===!1)t.quote=""
|
|||
|
|
`;else if(Buffer.isBuffer(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if(typeof t.record_delimiter!="string")return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter=`
|
|||
|
|
`;break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter=`\r
|
|||
|
|
`;break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028";break}return[void 0,t]},ODe=Buffer.from([239,187,191]),jJ=function(e,t){return t.length!==0&&(e.indexOf(t)!==-1||t.length>1&&(e+t).indexOf(t)<e.length)},CDe=function(e,t,r){return{options:e,state:t,info:r,__transform:function(n,i){if(!Array.isArray(n)&&typeof n!="object")return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(n)}`);if(this.info.records===0){if(Array.isArray(n)){if(this.options.header===!0&&this.options.columns===void 0)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(this.options.columns===void 0){let[s,l]=RJ(Object.keys(n));if(s)return;this.options.columns=l}}if(this.info.records===0){this.bom(i);let s=this.headers(i);if(s)return s}try{this.options.on_record&&this.options.on_record(n,this.info.records)}catch(s){return s}let a,o;if(this.options.eof){if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;o=o+this.options.record_delimiter}else{if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;(this.options.header||this.info.records)&&(o=this.options.record_delimiter+o)}this.info.records++,i(o)},stringify:function(n,i=!1){if(typeof n!="object")return[void 0,n];let{columns:a}=this.options,o=[];if(Array.isArray(n)){a&&n.splice(a.length);for(let l=0;l<n.length;l++){let c=n[l],[u,d]=this.__cast(c,{index:l,column:l,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}}else for(let l=0;l<a.length;l++){let c=EDe(n,a[l].key),[u,d]=this.__cast(c,{index:l,column:a[l].key,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}let s="";for(let l=0;l<o.length;l++){let c,u,[d,f]=o[l];if(typeof d=="string")c=this.options;else if(PJ(d)){if(c=d,d=c.value,delete c.value,typeof d!="string"&&d!==void 0&&d!==null&&u)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(d)}`)];if(c={...this.options,...c},[u,c]=FJ(c),u!==void 0)return[u]}else if(d==null)c=this.options;else return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(d)}`)];let{delimiter:p,escape:m,quote:y,quoted:v,quoted_empty:S,quoted_string:E,quoted_match:w,record_delimiter:_,escape_formulas:b}=c;if(d===""&&f===""){let A=w&&w.filter(P=>typeof P=="string"?d.indexOf(P)!==-1:P.test(d));A=A&&A.length>0,(A||S===!0||E===!0&&S!==!1)===!0&&(d=y+d+y),s+=d}else if(d){if(typeof d!="string")return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(d)}`)];let A=jJ(d,p),j=y!==""&&d.indexOf(y)>=0,P=d.indexOf(m)>=0&&m!==y,T=jJ(d,_),N=E&&typeof f=="string",k=w&&w.filter($=>typeof $=="string"?d.indexOf($)!==-1:$.test(d));if(k=k&&k.length>0,b)switch(d[0]){case"=":case"+":case"-":case"@":case" ":case"\r":case"\uFF1D":case"\uFF0B":case"\uFF0D":case"\uFF20":d=`'${d}`;break}let B=j===!0||A||T||v||N||k;B===!0&&P===!0&&(d=d.replaceAll(m,()=>m+m)),j===!0&&(d=d.replaceAll(y,()=>m+y)),B===!0&&(d=y+d+y),s+=d}else(S===!0||f===""&&E===!0&&S!==!1)&&(s+=y+y);l!==o.length-1&&(s+=p)}return[void 0,s]},bom:function(n){this.options.bom===!0&&n(ODe)},headers:function(n){if(this.options.header===!1||this.options.columns===void 0)return;let i,a=this.options.columns.map(o=>o.header);if(this.options.eof?([i,a]=this.stringify(a,!0),a+=this.options.record_delimiter):[i,a]=this.stringify(a),i)return i;this.options.header_as_comment&&(a=this.options.header_as_comment+" "+a),n(a)},__cast:function(n,i){let a=typeof n;try{return a==="string"?[void 0,this.options.cast.string(n,i)]:a==="bigint"?[void 0,this.options.cast.bigint(n,i)]:a==="number"?[void 0,this.options.cast.number(n,i)]:a==="boolean"?[void 0,this.options.cast.boolean(n,i)]:n instanceof Date?[void 0,this.options.cast.date(n,i)]:a==="object"&&n!==null?[void 0,this.options.cast.object(n,i)]:n===null&&this.options.cast.null!==void 0?[void 0,this.options.cast.null(n,i)]:n===void 0&&this.options.cast.undefined!==void 0?[void 0,this.options.cast.undefined(n,i)]:[void 0,n]}catch(o){return[o]}}}},X4=class exte
|
|||
|
|
`;else if(Buffer.isBuffer(t.record_delimiter))t.record_delimiter=t.record_delimiter.toString();else if(typeof t.record_delimiter!="string")return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(t.record_delimiter)}`)];switch(t.record_delimiter){case"unix":t.record_delimiter=`
|
|||
|
|
`;break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter=`\r
|
|||
|
|
`;break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028";break}return[void 0,t]},UDe=Buffer.from([239,187,191]),UJ=function(e,t){return t.length!==0&&(e.indexOf(t)!==-1||t.length>1&&(e+t).indexOf(t)<e.length)},zDe=function(e,t,r){return{options:e,state:t,info:r,__transform:function(n,i){if(!Array.isArray(n)&&typeof n!="object")return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(n)}`);if(this.info.records===0){if(Array.isArray(n)){if(this.options.header===!0&&this.options.columns===void 0)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(this.options.columns===void 0){let[s,l]=qJ(Object.keys(n));if(s)return;this.options.columns=l}}if(this.info.records===0){this.bom(i);let s=this.headers(i);if(s)return s}try{this.options.on_record&&this.options.on_record(n,this.info.records)}catch(s){return s}let a,o;if(this.options.eof){if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;o=o+this.options.record_delimiter}else{if([a,o]=this.stringify(n),a)return a;if(o===void 0)return;(this.options.header||this.info.records)&&(o=this.options.record_delimiter+o)}this.info.records++,i(o)},stringify:function(n,i=!1){if(typeof n!="object")return[void 0,n];let{columns:a}=this.options,o=[];if(Array.isArray(n)){a&&n.splice(a.length);for(let l=0;l<n.length;l++){let c=n[l],[u,d]=this.__cast(c,{index:l,column:l,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}}else for(let l=0;l<a.length;l++){let c=RDe(n,a[l].key),[u,d]=this.__cast(c,{index:l,column:a[l].key,records:this.info.records,header:i});if(u)return[u];o[l]=[d,c]}let s="";for(let l=0;l<o.length;l++){let c,u,[d,f]=o[l];if(typeof d=="string")c=this.options;else if(FDe(d)){if(c=d,d=c.value,delete c.value,typeof d!="string"&&d!==void 0&&d!==null&&u)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(d)}`)];if(c={...this.options,...c},[u,c]=BJ(c),u!==void 0)return[u]}else if(d==null)c=this.options;else return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(d)}`)];let{delimiter:p,escape:m,quote:y,quoted:v,quoted_empty:S,quoted_string:E,quoted_match:w,record_delimiter:_,escape_formulas:b}=c;if(d===""&&f===""){let A=w&&w.filter(P=>typeof P=="string"?d.indexOf(P)!==-1:P.test(d));A=A&&A.length>0,(A||S===!0||E===!0&&S!==!1)===!0&&(d=y+d+y),s+=d}else if(d){if(typeof d!="string")return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(d)}`)];let A=UJ(d,p),j=y!==""&&d.indexOf(y)>=0,P=d.indexOf(m)>=0&&m!==y,T=UJ(d,_),N=E&&typeof f=="string",k=w&&w.filter($=>typeof $=="string"?d.indexOf($)!==-1:$.test(d));if(k=k&&k.length>0,b)switch(d[0]){case"=":case"+":case"-":case"@":case" ":case"\r":case"\uFF1D":case"\uFF0B":case"\uFF0D":case"\uFF20":d=`'${d}`;break}let B=j===!0||A||T||v||N||k;B===!0&&P===!0&&(d=d.replaceAll(m,()=>m+m)),j===!0&&(d=d.replaceAll(y,()=>m+y)),B===!0&&(d=y+d+y),s+=d}else(S===!0||f===""&&E===!0&&S!==!1)&&(s+=y+y);l!==o.length-1&&(s+=p)}return[void 0,s]},bom:function(n){this.options.bom===!0&&n(UDe)},headers:function(n){if(this.options.header===!1||this.options.columns===void 0)return;let i,a=this.options.columns.map(o=>o.header);if(this.options.eof?([i,a]=this.stringify(a,!0),a+=this.options.record_delimiter):[i,a]=this.stringify(a),i)return i;this.options.header_as_comment&&(a=this.options.header_as_comment+" "+a),n(a)},__cast:function(n,i){let a=typeof n;try{return a==="string"?[void 0,this.options.cast.string(n,i)]:a==="bigint"?[void 0,this.options.cast.bigint(n,i)]:a==="number"?[void 0,this.options.cast.number(n,i)]:a==="boolean"?[void 0,this.options.cast.boolean(n,i)]:n instanceof Date?[void 0,this.options.cast.date(n,i)]:a==="object"&&n!==null?[void 0,this.options.cast.object(n,i)]:n===null&&this.options.cast.null!==void 0?[void 0,this.options.cast.null(n,i)]:n===void 0&&this.options.cast.undefined!==void 0?[void 0,this.options.cast.undefined(n,i)]:[void 0,n]}catch(o){return[o]}}}},qDe=function
|
|||
|
|
Check that the org exists and can be reached.
|
|||
|
|
|
|||
|
|
HTTP status code: ${t.statusCode}.
|
|||
|
|
REST API Status Codes and Error Responses:
|
|||
|
|
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm
|
|||
|
|
|
|||
|
|
See \`error.data\` for the full html response.`,n.errorCode,n.message)):n instanceof Hd?n:new Hd(n.message,n.errorCode,n)}};Vl.HttpApi=Q4;var Hd=class extends Error{data;errorCode;constructor(t,r,n){super(t),this.name=r||this.name,this.errorCode=this.name,this.data=n}get content(){return this.data}};Vl.default=Q4;Vl.isBrowser="window"in globalThis||"self"in globalThis});var ZJ=h(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});Ig.SessionRefreshDelegate=void 0;var dLe=fo(),ew=class e{static _logger=(0,dLe.getLogger)("session-refresh-delegate");_refreshFn;_conn;_logger;_lastRefreshedAt=void 0;_refreshPromise=void 0;constructor(t,r){this._conn=t,this._logger=t._logLevel?e._logger.createInstance(t._logLevel):e._logger,this._refreshFn=r}async refresh(t){if(!(this._lastRefreshedAt&&this._lastRefreshedAt>t)){if(this._refreshPromise){await this._refreshPromise;return}try{this._logger.info("<refresh token>"),this._refreshPromise=new Promise((r,n)=>{this._refreshFn(this._conn,(i,a,o)=>{i?n(i):(this._logger.debug("Connection refresh completed."),this._conn.accessToken=a,this._conn.emit("refresh",a,o),r())})}),await this._refreshPromise,this._logger.info("<refresh complete>")}catch(r){throw new Error(`Unable to refresh session due to: ${r.message}`)}finally{this._refreshPromise=void 0,this._lastRefreshedAt=Date.now()}}}isRefreshing(){return!!this._refreshPromise}async waitRefresh(){return this._refreshPromise}};Ig.SessionRefreshDelegate=ew;Ig.default=ew});var Ag=h(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.Parsable=Wl.Serializable=Wl.RecordStream=void 0;var lm=require("stream"),HJ=fC(),pLe=Yf();function fLe(e,t){if(typeof e=="string"){let r=/^\$\{(\w+)\}$/.exec(e);return r?t[r[1]]:e.replace(/\$\{(\w+)\}/g,(n,i)=>{let a=t[i];return typeof a>"u"||a===null?"":String(a)})}return e}function GJ(e,t={}){return Object.keys(e).reduce((r,n)=>{let i=r[n],a;if(n==="attributes")return a={...r},delete a[n],a;if(t.nullValue&&i===null)return{...r,[n]:t.nullValue};if(i!==null&&typeof i=="object"){let o=GJ(i,t);return Object.keys(o).reduce((s,l)=>(s[`${n}.${l}`]=o[l],s),{...r})}return r},e)}function mLe(e,t){return e.pipe(t),(0,pLe.concatStreamsAsDuplex)(e,t,{writableObjectMode:!0})}var hLe={serialize(e={}){let{nullValue:t,...r}=e;return mLe(Gd.map(n=>GJ(n,e)),(0,HJ.serializeCSVStream)(r))},parse(e={}){return(0,HJ.parseCSVStream)(e)}},JJ={csv:hLe},Gd=class e extends lm.PassThrough{constructor(){super({objectMode:!0})}map(t){return this.pipe(e.map(t))}filter(t){return this.pipe(e.filter(t))}on(t,r){return super.on(t==="record"?"data":t,r)}addListener=this.on;static map(t){let r=new lm.Transform({objectMode:!0,transform(n,i,a){let o=t(n)||n;r.push(o),a()}});return r}static recordMapStream(t,r){return e.map(n=>{let i={Id:n.Id};for(let a of Object.keys(t))i[a]=r?t[a]:fLe(t[a],n);return i})}static filter(t){let r=new lm.Transform({objectMode:!0,transform(n,i,a){t(n)&&r.push(n),a()}});return r}};Wl.RecordStream=Gd;var hC=class extends Gd{_dataStreams={};stream(t="csv",r={}){if(this._dataStreams[t])return this._dataStreams[t];let n=JJ[t];if(!n)throw new Error(`Converting [${t}] data stream is not supported.`);let i=new lm.PassThrough;return this.pipe(n.serialize(r)).pipe(i),this._dataStreams[t]=i,i}};Wl.Serializable=hC;var gC=class extends Gd{_dataStreams={};_execParse=!1;_incomings=[];stream(t="csv",r={}){if(this._dataStreams[t])return this._dataStreams[t];let n=JJ[t];if(!n)throw new Error(`Converting [${t}] data stream is not supported.`);let i=new lm.PassThrough,a=n.parse(r);return a.on("error",o=>this.emit("error",o)),a.pipe(this).pipe(new lm.PassThrough({objectMode:!0,highWaterMark:500*1e3})),this._execParse?i.pipe(a):this._incomings.push([i,a]),this._dataStreams[t]=i,i}on(t,r){if((t==="readable"||t==="record")&&!this._execParse){this._execParse=!0;for(let[n,i]of this._incomings)n.pipe(i)}return super.on(t,r)}addListener=this.on};Wl.Parsable=gC;Wl.default=Gd});var yC=h(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.formatDate=um.zeroPad=void 0;function cm(e,t=2){let r="";for(let n=
|
|||
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|||
|
|
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
|
|||
|
|
<operation>${n}</operation>
|
|||
|
|
<object>${this.type}</object>
|
|||
|
|
${r.extIdField?`<externalIdFieldName>${r.extIdField}</externalIdFieldName>`:""}
|
|||
|
|
${r.concurrencyMode?`<concurrencyMode>${r.concurrencyMode}</concurrencyMode>`:""}
|
|||
|
|
${r.assignmentRuleId?`<assignmentRuleId>${r.assignmentRuleId}</assignmentRuleId>`:""}
|
|||
|
|
<contentType>CSV</contentType>
|
|||
|
|
</jobInfo>
|
|||
|
|
`.trim();this._jobInfo=(async()=>{try{let a=await t._request({method:"POST",path:"/job",body:i,headers:{"Content-Type":"application/xml; charset=utf-8"},responseType:"application/xml"});return this.emit("open",a.jobInfo),this.id=a.jobInfo.id,this.state=a.jobInfo.state,a.jobInfo}catch(a){throw this.emit("error",a),a}})()}return this._jobInfo}createBatch(){let t=new Qg(this);return t.on("queue",()=>{this._batches[t.id]=t}),t}batch(t){let r=this._batches[t];return r||(r=new Qg(this,t),this._batches[t]=r),r}check(){let t=this._bulk,r=t._logger;return this._jobInfo=(async()=>{let n=await this.ready(),i=await t._request({method:"GET",path:"/job/"+n,responseType:"application/xml"});return r.debug(i.jobInfo),this.id=i.jobInfo.id,this.type=i.jobInfo.object,this.operation=i.jobInfo.operation,this.state=i.jobInfo.state,i.jobInfo})(),this._jobInfo}ready(){return this.id?Promise.resolve(this.id):this.open().then(({id:t})=>t)}async list(){let t=this._bulk,r=t._logger,n=await this.ready(),i=await t._request({method:"GET",path:"/job/"+n+"/batch",responseType:"application/xml"});return r.debug(i.batchInfoList.batchInfo),Array.isArray(i.batchInfoList.batchInfo)?i.batchInfoList.batchInfo:[i.batchInfoList.batchInfo]}async close(){if(this.id)try{let t=await this._changeState("Closed");return this.id=null,this.emit("close",t),t}catch(t){throw this.emit("error",t),t}}async abort(){if(this.id)try{let t=await this._changeState("Aborted");return this.id=null,this.emit("abort",t),t}catch(t){throw this.emit("error",t),t}}async _changeState(t){let r=this._bulk,n=r._logger;return this._jobInfo=(async()=>{let i=await this.ready(),a=`
|
|||
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|||
|
|
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
|
|||
|
|
<state>${t}</state>
|
|||
|
|
</jobInfo>
|
|||
|
|
`.trim(),o=await r._request({method:"POST",path:"/job/"+i,body:a,headers:{"Content-Type":"application/xml; charset=utf-8"},responseType:"application/xml"});return n.debug(o.jobInfo),this.state=o.jobInfo.state,o.jobInfo})(),this._jobInfo}};bo.Job=Yg;var Pw=class extends Error{jobId;batchId;constructor(t,r,n){super(t),this.name="PollingTimeout",this.jobId=r,this.batchId=n}},Qg=class extends Fje.Writable{job;id;_bulk;_uploadStream;_downloadStream;_dataStream;_result;_error;constructor(t,r){super({objectMode:!0}),this.job=t,this.id=r,this._bulk=t._bulk,this.on("error",l=>this._error=l);let n={nullValue:"#N/A"},i=this._uploadStream=new jw.Serializable,a=i.stream("csv",n),s=(this._downloadStream=new jw.Parsable).stream("csv",n);this.on("finish",()=>i.end()),a.once("readable",async()=>{try{await this.job.ready(),a.pipe(this._createRequestStream())}catch(l){this.emit("error",l)}}),this._dataStream=(0,qje.concatStreamsAsDuplex)(a,s)}_createRequestStream(){let t=this._bulk,r=t._logger,n=t._request({method:"POST",path:"/job/"+this.job.id+"/batch",headers:{"Content-Type":"text/csv"},responseType:"application/xml"});return(async()=>{try{let i=await n;r.debug(i.batchInfo),this.id=i.batchInfo.id,this.emit("queue",i.batchInfo)}catch(i){this.emit("error",i)}})(),n.stream()}_write(t,r,n){let{Id:i,type:a,attributes:o,...s}=t,l;switch(this.job.operation){case"insert":l=s;break;case"delete":case"hardDelete":l={Id:i};break;default:l={Id:i,...s}}this._uploadStream.write(l,r,n)}stream(){return this._dataStream}execute(t){if(this._result)throw new Error("Batch already executed.");if(this._result=new Promise((r,n)=>{this.once("response",r),this.once("error",n)}),AX.default.nodeStream(t))t.pipe(this._dataStream);else{let r=structuredClone(t);if(Array.isArray(r)){for(let n of r){for(let i of Object.keys(n))typeof n[i]=="boolean"&&(n[i]=String(n[i]));this.write(n)}this.end()}else typeof r=="string"&&(this._dataStream.write(r,"utf8"),this._dataStream.end())}return this}run=this.execute;exec=this.execute;then(t,r){return this._result||this.execute(),this._result.then(t,r)}async check(){let t=this._bulk,r=t._logger,n=this.job.id,i=this.id;if(!n||!i)throw new Error("Batch not started.");let a=await t._request({method:"GET",path:"/job/"+n+"/batch/"+i,responseType:"application/xml"});return r.debug(a.batchInfo),a.batchInfo}poll(t,r){let n=this.job.id,i=this.id;if(!n||!i)throw new Error("Batch not started.");let o=new Date().getTime()+r;if(r===0)throw new Pw(`Skipping polling because of timeout = 0ms. Job Id = ${n} | Batch Id = ${i}`,n,i);let s=async()=>{let l=new Date().getTime();if(o<l){let u=new Pw("Polling time out. Job Id = "+n+" , batch Id = "+i,n,i);this.emit("error",u);return}let c;try{c=await this.check()}catch(u){this.emit("error",u);return}c.state==="Failed"?parseInt(c.numberRecordsProcessed,10)>0?this.retrieve():this.emit("error",new Error(c.stateMessage)):c.state==="Completed"?this.retrieve():c.state==="NotProcessed"?this.emit("error",new Error("Job has been aborted")):(this.emit("inProgress",c),setTimeout(s,t))};setTimeout(s,t)}async retrieve(){let t=this._bulk,r=this.job.id,n=this.job,i=this.id;if(!r||!i)throw new Error("Batch not started.");try{let a=await t._request({method:"GET",path:"/job/"+r+"/batch/"+i+"/result"}),o;if(n.operation==="query"||n.operation==="queryAll"){let l=a["result-list"].result;o=(Array.isArray(l)?l:[l]).map(c=>({id:c,batchId:i,jobId:r}))}else o=a.map(l=>({id:l.Id||null,success:l.Success==="true",created:l.Created==="true",errors:l.Error?[l.Error]:[]}));return this.emit("response",o),o}catch(a){throw this.emit("error",a),a}}result(t){let r=this.job.id,n=this.id;if(!r||!n)throw new Error("Batch not started.");let i=new jw.Parsable,a=i.stream("csv");return this._bulk._request({method:"GET",path:"/job/"+r+"/batch/"+n+"/result/"+t,responseType:"application/octet-stream"}).stream().pipe(a),i}};bo.Batch=Qg;var dT=class extends Uje.default{beforeSend(t){t.headers={...t.headers,"X-SFDC-SESSION":this._conn.accessToken??""}}isSessionExpired(t){return t.statusCode===400&&t.body.includes("<exceptionCode>InvalidSessionId</
|
|||
|
|
\\[?(?:
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){7}(?:[a-fA-F\\d]{1,4}|:)|
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|:[a-fA-F\\d]{1,4}|:)|
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,2}|:)|
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){4}(?:(?::[a-fA-F\\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,3}|:)|
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){3}(?:(?::[a-fA-F\\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,4}|:)|
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){2}(?:(?::[a-fA-F\\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,5}|:)|
|
|||
|
|
(?:[a-fA-F\\d]{1,4}:){1}(?:(?::[a-fA-F\\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,6}|:)|
|
|||
|
|
(?::(?:(?::[a-fA-F\\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?::[a-fA-F\\d]{1,4}){1,7}|:))
|
|||
|
|
)(?:%[0-9a-zA-Z]{1,})?\\]?
|
|||
|
|
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),zT=new RegExp(`^${hMe}$`),gMe="(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])",yMe=new RegExp(`^${gMe}$`);function UY(e){return new URL(`http://${e}`).hostname}function sp(e){if(e==null)return;let t=e.trim().replace(/^\./,"");return zT.test(t)?(t.startsWith("[")||(t="["+t),t.endsWith("]")||(t=t+"]"),UY(t).slice(1,-1)):/[^\u0001-\u007f]/.test(t)?UY(t):t.toLowerCase()}function eQ(e){return e.toUTCString()}function r6(e){if(!e)return;let t={foundTime:void 0,foundDayOfMonth:void 0,foundMonth:void 0,foundYear:void 0},r=e.split(vMe).filter(i=>i.length>0);for(let i of r){if(t.foundTime===void 0){let[,a,o,s]=_Me.exec(i)||[];if(a!=null&&o!=null&&s!=null){let l=parseInt(a,10),c=parseInt(o,10),u=parseInt(s,10);if(!isNaN(l)&&!isNaN(c)&&!isNaN(u)){t.foundTime={hours:l,minutes:c,seconds:u};continue}}}if(t.foundDayOfMonth===void 0&&wMe.test(i)){let a=parseInt(i,10);if(!isNaN(a)){t.foundDayOfMonth=a;continue}}if(t.foundMonth===void 0&&SMe.test(i)){let a=bMe.indexOf(i.substring(0,3).toLowerCase());if(a>=0&&a<=11){t.foundMonth=a;continue}}if(t.foundYear===void 0&&EMe.test(i)){let a=parseInt(i,10);if(!isNaN(a)){t.foundYear=a;continue}}}if(t.foundYear!==void 0&&t.foundYear>=70&&t.foundYear<=99&&(t.foundYear+=1900),t.foundYear!==void 0&&t.foundYear>=0&&t.foundYear<=69&&(t.foundYear+=2e3),t.foundDayOfMonth===void 0||t.foundMonth===void 0||t.foundYear===void 0||t.foundTime===void 0||t.foundDayOfMonth<1||t.foundDayOfMonth>31||t.foundYear<1601||t.foundTime.hours>23||t.foundTime.minutes>59||t.foundTime.seconds>59)return;let n=new Date(Date.UTC(t.foundYear,t.foundMonth,t.foundDayOfMonth,t.foundTime.hours,t.foundTime.minutes,t.foundTime.seconds));if(!(n.getUTCFullYear()!==t.foundYear||n.getUTCMonth()!==t.foundMonth||n.getUTCDate()!==t.foundDayOfMonth))return n}var bMe=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],vMe=/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/,_Me=/^(\d{1,2}):(\d{1,2}):(\d{1,2})(?:[\x00-\x2F\x3A-\xFF][\x00-\xFF]*)?$/,wMe=/^[0-9]{1,2}(?:[\x00-\x2F\x3A-\xFF][\x00-\xFF]*)?$/,SMe=/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[\x00-\xFF]*$/i,EMe=/^[\x30-\x39]{2,4}(?:[\x00-\x2F\x3A-\xFF][\x00-\xFF]*)?$/,xMe=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/,OMe=/[\x20-\x3A\x3C-\x7E]+/,zY=/[\x00-\x1F]/,qY=[`
|
|||
|
|
`,"\r","\0"];function CMe(e){if($T(e))return e;for(let t=0;t<qY.length;t++){let r=qY[t],n=r?e.indexOf(r):-1;n!==-1&&(e=e.slice(0,n))}return e}function TMe(e,t){e=CMe(e);let r=e.indexOf("=");if(t)r===0&&(e=e.substring(1),r=e.indexOf("="));else if(r<=0)return;let n,i;if(r<=0?(n="",i=e.trim()):(n=e.slice(0,r).trim(),i=e.slice(r+1).trim()),zY.test(n)||zY.test(i))return;let a=new Vn;return a.key=n,a.value=i,a}function IMe(e,t){if($T(e)||!YY(e))return;e=e.trim();let r=e.indexOf(";"),n=r===-1?e:e.slice(0,r),i=TMe(n,t?.loose??!1);if(!i)return;if(r===-1)return i;let a=e.slice(r+1).trim();if(a.length===0)return i;let o=a.split(";");for(;o.length;){let s=(o.shift()??"").trim();if(s.length===0)continue;let l=s.indexOf("="),c,u;switch(l===-1?(c=s,u=null):(c=s.slice(0,l),u=s.slice(l+1)),c=c.trim().toLowerCase(),u&&(u=u.trim()),c){case"expires":if(u){let d=r6(u);d&&(i.expires=d)}break;case"max-age":if(u&&/^-?[0-9]+$/.test(u)){let d=parseInt(u,10);i.setMaxAge(d)}break;case"domain":if(u){let d=u.trim().replace(/^\./,"");d&&(i.domain=d.toLowerCase())}break;case"path":i.path=u&&u[0]==="/"?u:null;break;case"secure":i.secure=!0;break;case"httponly":i.httpOnly=!0;break;case"samesite":switch(u?u.toLowerCase():""){case"strict":i.sameSite="strict";break;case"lax":i.sameSite="lax";break;case"none":i.sameSite="none";break;default:i.sameSite=void 0;break}break;default:i.extensions=i.extensions||[],i.extensions.push(s);break}}return i}function BY(e){if(!e||$T(e))return;let t;if(typeof e=="string")try{t=JSON.parse(e)}catch{return}else t=e;let r=new Vn;return Vn.serializableProperties.forEach(n=>{if(t&&typeof t=="object"&&y0(n,t)){let i=t[n];if(i===void 0||y0(n,un)&&i===un[n])return;switch(n){case"key":case"value":case"sameSite":typeof i=="string"&&(r[n]=i);break;case"expires":case"creation":case"lastAccessed":typeof i=="number"||typeof i=="string"||i instanceof Date?r[n]=t[n]=="Infinity"?"Infinity":new Date(i):i===null&&(r[n]=null);break;case"maxAge":(typeof i=="number"||i==="Infinity"||i==="-Infinity")&&(r[n]=i);break;case"domain":case"path":(typeof i=="string"||i===null)&&(r[n]=i);break;case"secure":case"httpOnly":typeof i=="boolean"&&(r[n]=i);break;case"extensions":Array.isArray(i)&&i.every(a=>typeof a=="string")&&(r[n]=i);break;case"hostOnly":case"pathIsDefault":(typeof i=="boolean"||i===null)&&(r[n]=i);break}}}),r}var un={key:"",value:"",expires:"Infinity",maxAge:null,domain:null,path:null,secure:!1,httpOnly:!1,extensions:null,hostOnly:null,pathIsDefault:null,creation:null,lastAccessed:null,sameSite:void 0},b0=class Su{constructor(t={}){this.key=t.key??un.key,this.value=t.value??un.value,this.expires=t.expires??un.expires,this.maxAge=t.maxAge??un.maxAge,this.domain=t.domain??un.domain,this.path=t.path??un.path,this.secure=t.secure??un.secure,this.httpOnly=t.httpOnly??un.httpOnly,this.extensions=t.extensions??un.extensions,this.creation=t.creation??un.creation,this.hostOnly=t.hostOnly??un.hostOnly,this.pathIsDefault=t.pathIsDefault??un.pathIsDefault,this.lastAccessed=t.lastAccessed??un.lastAccessed,this.sameSite=t.sameSite??un.sameSite,this.creation=t.creation??new Date,Object.defineProperty(this,"creationIndex",{configurable:!1,enumerable:!1,writable:!0,value:++Su.cookiesCreated}),this.creationIndex=Su.cookiesCreated}[Symbol.for("nodejs.util.inspect.custom")](){let t=Date.now(),r=this.hostOnly!=null?this.hostOnly.toString():"?",n=this.creation&&this.creation!=="Infinity"?`${String(t-this.creation.getTime())}ms`:"?",i=this.lastAccessed&&this.lastAccessed!=="Infinity"?`${String(t-this.lastAccessed.getTime())}ms`:"?";return`Cookie="${this.toString()}; hostOnly=${r}; aAge=${i}; cAge=${n}"`}toJSON(){let t={};for(let r of Su.serializableProperties){let n=this[r];if(n!==un[r])switch(r){case"key":case"value":case"sameSite":typeof n=="string"&&(t[r]=n);break;case"expires":case"creation":case"lastAccessed":typeof n=="number"||typeof n=="string"||n instanceof Date?t[r]=n=="Infinity"?"Infinity":new Date(n).toISOString():n===null&&(t[r]=null);break;case"maxAge":(typeof n=="number"||n==="Infinity"||n==="-Infinity")&&(t[r]=n);break;case"domain":case"path":(ty
|
|||
|
|
`))}};jm.prototype.toString=function(){return this._lines.join("")};jm.prototype._strip=function(e){return e.toString().replace(/^ */,"").replace(/ *$/,"")};zQ.exports=jm});var BQ=h((K6t,qQ)=>{"use strict";var p6=Hr().Buffer,f6=function(){this._queue=[],this._queueSize=0,this._offset=0};f6.prototype.put=function(e){!e||e.length===0||(p6.isBuffer(e)||(e=p6.from(e)),this._queue.push(e),this._queueSize+=e.length)};f6.prototype.read=function(e){if(e>this._queueSize)return null;if(e===0)return p6.alloc(0);this._queueSize-=e;var t=this._queue,r=e,n=t[0],i,a;if(n.length>=e)return n.length===e?t.shift():(a=n.slice(0,e),t[0]=n.slice(e),a);for(var o=0,s=t.length;o<s&&!(r<t[o].length);o++)r-=t[o].length;return i=t.splice(0,o),r>0&&t.length>0&&(i.push(t[0].slice(0,r)),t[0]=t[0].slice(r)),p6.concat(i,e)};f6.prototype.eachByte=function(e,t){for(var r,n,i;this._queue.length>0;){for(r=this._queue[0],n=r.length;this._offset<n;)i=this._offset,this._offset+=1,e.call(t,r[i]);this._offset=0,this._queue.shift()}};qQ.exports=f6});var xu=h((X6t,JQ)=>{"use strict";var VQ=Hr().Buffer,HQ=require("events").EventEmitter,RRe=require("util"),WQ=UQ(),GQ=d6(),FRe=BQ(),Zn=function(e,t,r){HQ.call(this),Zn.validateOptions(r||{},["maxLength","masking","requireMasking","protocols"]),this._request=e,this._reader=new FRe,this._options=r||{},this._maxLength=this._options.maxLength||this.MAX_LENGTH,this._headers=new GQ,this.__queue=[],this.readyState=0,this.url=t,this.io=new WQ.IO(this),this.messages=new WQ.Messages(this),this._bindEventListeners()};RRe.inherits(Zn,HQ);Zn.isWebSocket=function(e){var t=e.headers.connection||"",r=e.headers.upgrade||"";return e.method==="GET"&&t.toLowerCase().split(/ *, */).indexOf("upgrade")>=0&&r.toLowerCase()==="websocket"};Zn.validateOptions=function(e,t){for(var r in e)if(t.indexOf(r)<0)throw new Error("Unrecognized option: "+r)};var ZQ={MAX_LENGTH:67108863,STATES:["connecting","open","closing","closed"],_bindEventListeners:function(){var e=this;this.messages.on("error",function(){}),this.on("message",function(t){var r=e.messages;r.readable&&r.emit("data",t.data)}),this.on("error",function(t){var r=e.messages;r.readable&&r.emit("error",t)}),this.on("close",function(){var t=e.messages;t.readable&&(t.readable=t.writable=!1,t.emit("end"))})},getState:function(){return this.STATES[this.readyState]||null},addExtension:function(e){return!1},setHeader:function(e,t){return this.readyState>0?!1:(this._headers.set(e,t),!0)},start:function(){if(this.readyState!==0)return!1;if(!Zn.isWebSocket(this._request))return this._failHandshake(new Error("Not a WebSocket request"));var e;try{e=this._handshakeResponse()}catch(t){return this._failHandshake(t)}return this._write(e),this._stage!==-1&&this._open(),!0},_failHandshake:function(e){var t=new GQ;return t.set("Content-Type","text/plain"),t.set("Content-Length",VQ.byteLength(e.message,"utf8")),t=["HTTP/1.1 400 Bad Request",t.toString(),e.message],this._write(VQ.from(t.join(`\r
|
|||
|
|
`),"utf8")),this._fail("protocol_error",e.message),!1},text:function(e){return this.frame(e)},binary:function(e){return!1},ping:function(){return!1},pong:function(){return!1},close:function(e,t){return this.readyState!==1?!1:(this.readyState=3,this.emit("close",new Zn.CloseEvent(null,null)),!0)},_open:function(){this.readyState=1,this.__queue.forEach(function(e){this.frame.apply(this,e)},this),this.__queue=[],this.emit("open",new Zn.OpenEvent)},_queue:function(e){return this.__queue.push(e),!0},_write:function(e){var t=this.io;t.readable&&t.emit("data",e)},_fail:function(e,t){this.readyState=2,this.emit("error",new Error(t)),this.close()}};for(rI in ZQ)Zn.prototype[rI]=ZQ[rI];var rI;Zn.ConnectEvent=function(){};Zn.OpenEvent=function(){};Zn.CloseEvent=function(e,t){this.code=e,this.reason=t};Zn.MessageEvent=function(e){this.data=e};Zn.PingEvent=function(e){this.data=e};Zn.PongEvent=function(e){this.data=e};JQ.exports=Zn});var eee=h(aI=>{aI.HTTPParser=Te;function Te(e){if(e!==void 0&&e!==Te.REQUEST&&e!==Te.RESPONSE)throw new Error("type must be REQUEST or RESPONSE");e===void 0||this.initialize(e),this.maxHeaderSize=Te.maxHeaderSize}Te.prototype.initialize=function(e,t){if(e!==Te.REQUEST&&e!==Te.RESPONSE)throw new Error("type must be REQUEST or RESPONSE");this.type=e,this.state=e+"_LINE",this.info={headers:[],upgrade:!1},this.trailers=[],this.line="",this.isChunked=!1,this.connection="",this.headerSize=0,this.body_bytes=null,this.isUserCall=!1,this.hadError=!1};Te.encoding="ascii";Te.maxHeaderSize=80*1024;Te.REQUEST="REQUEST";Te.RESPONSE="RESPONSE";var KQ=Te.kOnHeaders=1,nI=Te.kOnHeadersComplete=2,m6=Te.kOnBody=3,iI=Te.kOnMessageComplete=4;Te.prototype[KQ]=Te.prototype[nI]=Te.prototype[m6]=Te.prototype[iI]=function(){};var XQ=!0;Object.defineProperty(Te,"kOnExecute",{get:function(){return XQ=!1,99}});var YQ=aI.methods=Te.methods=["DELETE","GET","HEAD","POST","PUT","CONNECT","OPTIONS","TRACE","COPY","LOCK","MKCOL","MOVE","PROPFIND","PROPPATCH","SEARCH","UNLOCK","BIND","REBIND","UNBIND","ACL","REPORT","MKACTIVITY","CHECKOUT","MERGE","M-SEARCH","NOTIFY","SUBSCRIBE","UNSUBSCRIBE","PATCH","PURGE","MKCALENDAR","LINK","UNLINK","SOURCE"],QQ=YQ.indexOf("CONNECT");Te.prototype.reinitialize=Te;Te.prototype.close=Te.prototype.pause=Te.prototype.resume=Te.prototype.remove=Te.prototype.free=function(){};Te.prototype._compatMode0_11=!1;Te.prototype.getAsyncId=function(){return 0};var $Re={REQUEST_LINE:!0,RESPONSE_LINE:!0,HEADER:!0};Te.prototype.execute=function(e,t,r){if(!(this instanceof Te))throw new TypeError("not a HTTPParser");t=t||0,r=typeof r=="number"?r:e.length,this.chunk=e,this.offset=t;var n=this.end=t+r;try{for(;this.offset<n&&!this[this.state](););}catch(i){if(this.isUserCall)throw i;return this.hadError=!0,i}return this.chunk=null,r=this.offset-t,$Re[this.state]&&(this.headerSize+=r,this.headerSize>(this.maxHeaderSize||Te.maxHeaderSize))?new Error("max header size exceeded"):r};var URe={REQUEST_LINE:!0,RESPONSE_LINE:!0,BODY_RAW:!0};Te.prototype.finish=function(){if(!this.hadError){if(!URe[this.state])return new Error("invalid state for EOF");this.state==="BODY_RAW"&&this.userCall()(this[iI]())}};Te.prototype.consume=Te.prototype.unconsume=Te.prototype.getCurrentBuffer=function(){};Te.prototype.userCall=function(){this.isUserCall=!0;var e=this;return function(t){return e.isUserCall=!1,t}};Te.prototype.nextRequest=function(){this.userCall()(this[iI]()),this.reinitialize(this.type)};Te.prototype.consumeLine=function(){for(var e=this.end,t=this.chunk,r=this.offset;r<e;r++)if(t[r]===10){var n=this.line+t.toString(Te.encoding,this.offset,r);return n.charAt(n.length-1)==="\r"&&(n=n.substr(0,n.length-1)),this.line="",this.offset=r+1,n}this.line+=t.toString(Te.encoding,this.offset,this.end),this.offset=this.end};var zRe=/^([^: \t]+):[ \t]*((?:.*[^ \t])|)/,qRe=/^[ \t]+(.*[^ \t])/;Te.prototype.parseHeader=function(e,t){if(e.indexOf("\r")!==-1)throw h6("HPE_LF_EXPECTED");var r=zRe.exec(e),n=r&&r[1];if(n)t.push(n),t.push(r[2]);else{var i=qRe.exec(e);i&&t.length&&(t[t.length-1]&&(t[t.length-1]+=" "),t[t.length-1]+=i[1])}};var BRe=/^([A-Z
|
|||
|
|
`),"utf8")},_shutdown:function(e,t,r){delete this._frame,delete this._message,this._stage=5;var n=this.readyState===1;this.readyState=2,this._extensions.close(function(){n&&this.frame(t,"close",e),this.readyState=3,r&&this.emit("error",new Error(t)),this.emit("close",new fp.CloseEvent(e,t))},this)},_fail:function(e,t){this.readyState>1||this._shutdown(this.ERRORS[e],t,!0)},_parseOpcode:function(e){var t=[this.RSV1,this.RSV2,this.RSV3].map(function(n){return(e&n)===n}),r=this._frame=new Tee;if(r.final=(e&this.FIN)===this.FIN,r.rsv1=t[0],r.rsv2=t[1],r.rsv3=t[2],r.opcode=e&this.OPCODE,this._stage=1,!this._extensions.validFrameRsv(r))return this._fail("protocol_error","One or more reserved bits are on: reserved1 = "+(r.rsv1?1:0)+", reserved2 = "+(r.rsv2?1:0)+", reserved3 = "+(r.rsv3?1:0));if(this.OPCODE_CODES.indexOf(r.opcode)<0)return this._fail("protocol_error","Unrecognized frame opcode: "+r.opcode);if(this.MESSAGE_OPCODES.indexOf(r.opcode)<0&&!r.final)return this._fail("protocol_error","Received fragmented control frame: opcode = "+r.opcode);if(this._message&&this.OPENING_OPCODES.indexOf(r.opcode)>=0)return this._fail("protocol_error","Received new data frame but previous continuous frame is unfinished")},_parseLength:function(e){var t=this._frame;if(t.masked=(e&this.MASK)===this.MASK,t.length=e&this.LENGTH,t.length>=0&&t.length<=125){if(this._stage=t.masked?3:4,!this._checkFrameLength())return}else this._stage=2,t.lengthBytes=t.length===126?2:8;if(this._requireMasking&&!t.masked)return this._fail("unacceptable","Received unmasked frame but masking is required")},_parseExtendedLength:function(e){var t=this._frame;if(t.length=this._readUInt(e),this._stage=t.masked?3:4,this.MESSAGE_OPCODES.indexOf(t.opcode)<0&&t.length>125)return this._fail("protocol_error","Received control frame having too long payload: "+t.length);this._checkFrameLength()},_checkFrameLength:function(){var e=this._message?this._message.length:0;return e+this._frame.length>this._maxLength?(this._fail("too_large","WebSocket frame length too large"),!1):!0},_emitFrame:function(e){var t=this._frame,r=t.payload=Gi.mask(e,t.maskingKey),n=t.opcode,i,a,o,s,l;if(delete this._frame,n===this.OPCODES.continuation){if(!this._message)return this._fail("protocol_error","Received unexpected continuation frame");this._message.pushFrame(t)}if((n===this.OPCODES.text||n===this.OPCODES.binary)&&(this._message=new Iee,this._message.pushFrame(t)),t.final&&this.MESSAGE_OPCODES.indexOf(n)>=0)return this._emitMessage(this._message);n===this.OPCODES.close&&(a=r.length>=2?r.readUInt16BE(0):null,o=r.length>2?this._encode(r.slice(2)):null,r.length!==0&&!(a!==null&&a>=this.MIN_RESERVED_ERROR&&a<=this.MAX_RESERVED_ERROR)&&this.ERROR_CODES.indexOf(a)<0&&(a=this.ERRORS.protocol_error),(r.length>125||r.length>2&&!o)&&(a=this.ERRORS.protocol_error),this._shutdown(a||this.DEFAULT_ERROR_CODE,o||"")),n===this.OPCODES.ping&&(this.frame(r,"pong"),this.emit("ping",new fp.PingEvent(r.toString()))),n===this.OPCODES.pong&&(s=this._pingCallbacks,i=this._encode(r),l=s[i],delete s[i],l&&l(),this.emit("pong",new fp.PongEvent(r.toString())))},_emitMessage:function(t){var t=this._message;t.read(),delete this._message,this._extensions.processIncomingMessage(t,function(r,n){if(r)return this._fail("extension_error",r.message);var i=n.data;if(i.length>this._maxLength)return this._fail("too_large","WebSocket frame length too large");if(n.opcode===this.OPCODES.text&&(i=this._encode(i)),i===null)return this._fail("encoding_error","Could not decode a text frame as UTF-8");this.emit("message",new fp.MessageEvent(i))},this)},_encode:function(e){try{var t=e.toString("binary",0,e.length);if(!this.UTF8_MATCH.test(t))return null}catch{}return e.toString("utf8",0,e.length)},_readUInt:function(e){return e.length===2?e.readUInt16BE(0):e.readUInt32BE(0)*4294967296+e.readUInt32BE(4)}};for(mI in Aee)Gi.prototype[mI]=Aee[mI];var mI;Lee.exports=Gi});var Mee=h((u3t,Pee)=>{"use strict";var jee=Hr().Buffer,oFe=require("stream").Stream,kee=require("url"),sFe=require("util"),lFe=xu(),cFe=d6(),uFe=y6(),dFe={"ws:":80,"wss:":443},yI
|
|||
|
|
`),"utf8")),!0},pause:function(){this._paused=!0},resume:function(){this._paused=!1,this.emit("drain")},write:function(e){if(!this.writable)return!1;if(this._http.parse(e),!this._http.isComplete())return!this._paused;if(this.statusCode=this._http.statusCode,this.headers=this._http.headers,this.statusCode===200)this.emit("connect",new lFe.ConnectEvent);else{var t="Can't establish a connection to the server at "+this._origin.href;this.emit("error",new Error(t))}return this.end(),!this._paused},end:function(e){this.writable&&(e!==void 0&&this.write(e),this.readable=this.writable=!1,this.emit("close"),this.emit("end"))},destroy:function(){this.end()}};for(gI in Nee)yI.prototype[gI]=Nee[gI];var gI;Pee.exports=yI});var Uee=h((d3t,$ee)=>{"use strict";var Fee=Hr().Buffer,pFe=require("crypto"),fFe=require("url"),mFe=require("util"),hFe=y6(),gFe=xu(),Mm=hI(),yFe=Mee(),A0=function(e,t){this.version="hybi-"+Mm.VERSION,Mm.call(this,null,e,t),this.readyState=-1,this._key=A0.generateKey(),this._accept=Mm.generateAccept(this._key),this._http=new hFe("response");var r=fFe.parse(this.url),n=r.auth&&Fee.from(r.auth,"utf8").toString("base64");if(this.VALID_PROTOCOLS.indexOf(r.protocol)<0)throw new Error(this.url+" is not a valid WebSocket URL");this._pathname=(r.pathname||"/")+(r.search||""),this._headers.set("Host",r.host),this._headers.set("Upgrade","websocket"),this._headers.set("Connection","Upgrade"),this._headers.set("Sec-WebSocket-Key",this._key),this._headers.set("Sec-WebSocket-Version",Mm.VERSION),this._protocols.length>0&&this._headers.set("Sec-WebSocket-Protocol",this._protocols.join(", ")),n&&this._headers.set("Authorization","Basic "+n)};mFe.inherits(A0,Mm);A0.generateKey=function(){return pFe.randomBytes(16).toString("base64")};var Ree={VALID_PROTOCOLS:["ws:","wss:"],proxy:function(e,t){return new yFe(this,e,t)},start:function(){return this.readyState!==-1?!1:(this._write(this._handshakeRequest()),this.readyState=0,!0)},parse:function(e){if(this.readyState!==3){if(this.readyState>0)return Mm.prototype.parse.call(this,e);this._http.parse(e),this._http.isComplete()&&(this._validateHandshake(),this.readyState!==3&&(this._open(),this.parse(this._http.body)))}},_handshakeRequest:function(){var e=this._extensions.generateOffer();e&&this._headers.set("Sec-WebSocket-Extensions",e);var t="GET "+this._pathname+" HTTP/1.1",r=[t,this._headers.toString(),""];return Fee.from(r.join(`\r
|
|||
|
|
`),"utf8")},_failHandshake:function(e){e="Error during WebSocket handshake: "+e,this.readyState=3,this.emit("error",new Error(e)),this.emit("close",new gFe.CloseEvent(this.ERRORS.protocol_error,e))},_validateHandshake:function(){if(this.statusCode=this._http.statusCode,this.headers=this._http.headers,this._http.error)return this._failHandshake(this._http.error.message);if(this._http.statusCode!==101)return this._failHandshake("Unexpected response code: "+this._http.statusCode);var e=this._http.headers,t=e.upgrade||"",r=e.connection||"",n=e["sec-websocket-accept"]||"",i=e["sec-websocket-protocol"]||"";if(t==="")return this._failHandshake("'Upgrade' header is missing");if(t.toLowerCase()!=="websocket")return this._failHandshake("'Upgrade' header value is not 'WebSocket'");if(r==="")return this._failHandshake("'Connection' header is missing");if(r.toLowerCase()!=="upgrade")return this._failHandshake("'Connection' header value is not 'Upgrade'");if(n!==this._accept)return this._failHandshake("Sec-WebSocket-Accept mismatch");if(this.protocol=null,i!==""){if(this._protocols.indexOf(i)<0)return this._failHandshake("Sec-WebSocket-Protocol mismatch");this.protocol=i}try{this._extensions.activate(this.headers["sec-websocket-extensions"])}catch(a){return this._failHandshake(a.message)}}};for(bI in Ree)A0.prototype[bI]=Ree[bI];var bI;$ee.exports=A0});var wI=h((p3t,qee)=>{"use strict";var v6=Hr().Buffer,_6=xu(),bFe=require("util"),_I=function(e,t,r){_6.apply(this,arguments),this._stage=0,this.version="hixie-75",this._headers.set("Upgrade","WebSocket"),this._headers.set("Connection","Upgrade"),this._headers.set("WebSocket-Origin",this._request.headers.origin),this._headers.set("WebSocket-Location",this.url)};bFe.inherits(_I,_6);var zee={close:function(){return this.readyState===3?!1:(this.readyState=3,this.emit("close",new _6.CloseEvent(null,null)),!0)},parse:function(e){this.readyState>1||(this._reader.put(e),this._reader.eachByte(function(t){var r;switch(this._stage){case-1:this._body.push(t),this._sendHandshakeBody();break;case 0:this._parseLeadingByte(t);break;case 1:if(this._length=(t&127)+128*this._length,this._length>this._maxLength)return this.close();if(this._closing&&this._length===0)return this.close();(t&128)!==128&&(this._length===0?this._stage=0:(this._skipped=0,this._stage=2));break;case 2:if(t===255)this._stage=0,r=v6.from(this._buffer).toString("utf8",0,this._buffer.length),this.emit("message",new _6.MessageEvent(r));else if(this._length)this._skipped+=1,this._skipped===this._length&&(this._stage=0);else if(this._buffer.push(t),this._buffer.length>this._maxLength)return this.close();break}},this))},frame:function(e){if(this.readyState===0)return this._queue([e]);if(this.readyState>1)return!1;typeof e!="string"&&(e=e.toString());var t=v6.byteLength(e),r=v6.allocUnsafe(t+2);return r[0]=0,r.write(e,1),r[r.length-1]=255,this._write(r),!0},_handshakeResponse:function(){var e="HTTP/1.1 101 Web Socket Protocol Handshake",t=[e,this._headers.toString(),""];return v6.from(t.join(`\r
|
|||
|
|
`),"utf8")},_parseLeadingByte:function(e){(e&128)===128?(this._length=0,this._stage=1):(delete this._length,delete this._skipped,this._buffer=[],this._stage=2)}};for(vI in zee)_I.prototype[vI]=zee[vI];var vI;qee.exports=_I});var Hee=h((f3t,Zee)=>{"use strict";var D0=Hr().Buffer,vFe=xu(),w6=wI(),_Fe=require("crypto"),wFe=require("util"),Bee=function(e){return parseInt((e.match(/[0-9]/g)||[]).join(""),10)},Vee=function(e){return(e.match(/ /g)||[]).length},EI=function(e,t,r){w6.apply(this,arguments),this._stage=-1,this._body=[],this.version="hixie-76",this._headers.clear(),this._headers.set("Upgrade","WebSocket"),this._headers.set("Connection","Upgrade"),this._headers.set("Sec-WebSocket-Origin",this._request.headers.origin),this._headers.set("Sec-WebSocket-Location",this.url)};wFe.inherits(EI,w6);var Wee={BODY_SIZE:8,start:function(){return w6.prototype.start.call(this)?(this._started=!0,this._sendHandshakeBody(),!0):!1},close:function(){return this.readyState===3?!1:(this.readyState===1&&this._write(D0.from([255,0])),this.readyState=3,this.emit("close",new vFe.CloseEvent(null,null)),!0)},_handshakeResponse:function(){var s=this._request.headers,e=s["sec-websocket-key1"],t=s["sec-websocket-key2"];if(!e)throw new Error("Missing required header: Sec-WebSocket-Key1");if(!t)throw new Error("Missing required header: Sec-WebSocket-Key2");var r=Bee(e),n=Vee(e),i=Bee(t),a=Vee(t);if(r%n!==0||i%a!==0)throw new Error("Client sent invalid Sec-WebSocket-Key headers");this._keyValues=[r/n,i/a];var o="HTTP/1.1 101 WebSocket Protocol Handshake",s=[o,this._headers.toString(),""];return D0.from(s.join(`\r
|
|||
|
|
`),"binary")},_handshakeSignature:function(){if(this._body.length<this.BODY_SIZE)return null;var e=_Fe.createHash("md5"),t=D0.allocUnsafe(8+this.BODY_SIZE);return t.writeUInt32BE(this._keyValues[0],0),t.writeUInt32BE(this._keyValues[1],4),D0.from(this._body).copy(t,8,0,this.BODY_SIZE),e.update(t),D0.from(e.digest("binary"),"binary")},_sendHandshakeBody:function(){if(this._started){var e=this._handshakeSignature();e&&(this._write(e),this._stage=0,this._open(),this._body.length>this.BODY_SIZE&&this.parse(this._body.slice(this.BODY_SIZE)))}},_parseLeadingByte:function(e){if(e!==255)return w6.prototype._parseLeadingByte.call(this,e);this._closing=!0,this._length=0,this._stage=1}};for(SI in Wee)EI.prototype[SI]=Wee[SI];var SI;Zee.exports=EI});var Jee=h((m3t,Gee)=>{"use strict";var SFe=require("util"),EFe=y6(),CI=xu(),xFe=wI(),OFe=Hee(),CFe=hI(),mp=function(e){CI.call(this,null,null,e),this._http=new EFe("request")};SFe.inherits(mp,CI);var OI={EVENTS:["open","message","error","close","ping","pong"],_bindEventListeners:function(){this.messages.on("error",function(){}),this.on("error",function(){})},parse:function(e){if(this._delegate)return this._delegate.parse(e);if(this._http.parse(e),!!this._http.isComplete()){this.method=this._http.method,this.url=this._http.url,this.headers=this._http.headers,this.body=this._http.body;var t=this;this._delegate=mp.http(this,this._options),this._delegate.messages=this.messages,this._delegate.io=this.io,this._open(),this.EVENTS.forEach(function(r){this._delegate.on(r,function(n){t.emit(r,n)})},this),this.protocol=this._delegate.protocol,this.version=this._delegate.version,this.parse(this._http.body),this.emit("connect",new CI.ConnectEvent)}},_open:function(){this.__queue.forEach(function(e){this._delegate[e[0]].apply(this._delegate,e[1])},this),this.__queue=[]}};["addExtension","setHeader","start","frame","text","binary","ping","close"].forEach(function(e){OI[e]=function(){return this._delegate?this._delegate[e].apply(this._delegate,arguments):(this.__queue.push([e,arguments]),!0)}});for(xI in OI)mp.prototype[xI]=OI[xI];var xI;mp.isSecureRequest=function(e){if(e.connection&&e.connection.authorized!==void 0||e.socket&&e.socket.secure)return!0;var t=e.headers;return t?t.https==="on"||t["x-forwarded-ssl"]==="on"||t["x-forwarded-scheme"]==="https"||t["x-forwarded-proto"]==="https":!1};mp.determineUrl=function(e){var t=this.isSecureRequest(e)?"wss:":"ws:";return t+"//"+e.headers.host+e.url};mp.http=function(e,t){t=t||{},t.requireMasking===void 0&&(t.requireMasking=!0);var r=e.headers,n=r["sec-websocket-version"],i=r["sec-websocket-key"],a=r["sec-websocket-key1"],o=r["sec-websocket-key2"],s=this.determineUrl(e);return n||i?new CFe(e,s,t):a||o?new OFe(e,s,t):new xFe(e,s,t)};Gee.exports=mp});var L0=h((h3t,Xee)=>{"use strict";var Kee=xu(),TFe=Uee(),S6=Jee(),IFe={client:function(e,t){return t=t||{},t.masking===void 0&&(t.masking=!0),new TFe(e,t)},server:function(e){return e=e||{},e.requireMasking===void 0&&(e.requireMasking=!0),new S6(e)},http:function(){return S6.http.apply(S6,arguments)},isSecureRequest:function(e){return S6.isSecureRequest(e)},isWebSocket:function(e){return Kee.isWebSocket(e)},validateOptions:function(e,t){Kee.validateOptions(e,t)}};Xee.exports=IFe});var k0=h((g3t,Yee)=>{"use strict";var hp=function(e,t){this.type=e;for(var r in t)this[r]=t[r]};hp.prototype.initEvent=function(e,t,r){this.type=e,this.bubbles=t,this.cancelable=r};hp.prototype.stopPropagation=function(){};hp.prototype.preventDefault=function(){};hp.CAPTURING_PHASE=1;hp.AT_TARGET=2;hp.BUBBLING_PHASE=3;Yee.exports=hp});var TI=h((y3t,Qee)=>{"use strict";var AFe=k0(),DFe={onopen:null,onmessage:null,onerror:null,onclose:null,addEventListener:function(e,t,r){this.on(e,t)},removeEventListener:function(e,t,r){this.removeListener(e,t)},dispatchEvent:function(e){e.target=e.currentTarget=this,e.eventPhase=AFe.AT_TARGET,this["on"+e.type]&&this["on"+e.type](e),this.emit(e.type,e)}};Qee.exports=DFe});var x6=h((b3t,rte)=>{"use strict";var LFe=require("stream").Stream,kFe=require("util"),NFe=L0(),ete=TI(),E6=k0(),Bt=function(e){e=e||
|
|||
|
|
Content-Type: text/event-stream\r
|
|||
|
|
Cache-Control: no-cache, no-store\r
|
|||
|
|
Connection: close\r
|
|||
|
|
`+i.toString()+`\r
|
|||
|
|
retry: `+Math.floor(this._retry*1e3)+`\r
|
|||
|
|
\r
|
|||
|
|
`;this._write(s),this._stream.on("drain",function(){a.emit("drain")}),this._ping&&(this._pingTimer=setInterval(function(){a.ping()},this._ping*1e3)),["error","end"].forEach(function(l){a._stream.on(l,function(){a.close()})})}};$Fe.inherits(N0,FFe);N0.isEventSource=function(e){if(e.method!=="GET")return!1;var t=(e.headers.accept||"").split(/\s*,\s*/);return t.indexOf("text/event-stream")>=0};var dte={DEFAULT_PING:10,DEFAULT_RETRY:5,_write:function(e){if(!this.writable)return!1;try{return this._stream.write(e,"utf8")}catch{return!1}},_open:function(){if(this.readyState===Rm.CONNECTING){this.readyState=Rm.OPEN;var e=new ute("open");e.initEvent("open",!1,!1),this.dispatchEvent(e)}},write:function(e){return this.send(e)},end:function(e){e!==void 0&&this.write(e),this.close()},send:function(e,t){if(this.readyState>Rm.OPEN)return!1;e=String(e).replace(/(\r\n|\r|\n)/g,"$1data: "),t=t||{};var r="";return t.event&&(r+="event: "+t.event+`\r
|
|||
|
|
`),t.id&&(r+="id: "+t.id+`\r
|
|||
|
|
`),r+="data: "+e+`\r
|
|||
|
|
\r
|
|||
|
|
`,this._write(r)},ping:function(){return this._write(`:\r
|
|||
|
|
\r
|
|||
|
|
`)},close:function(){if(this.readyState>Rm.OPEN)return!1;this.readyState=Rm.CLOSED,this.writable=!1,this._pingTimer&&clearInterval(this._pingTimer),this._stream&&this._stream.end();var e=new ute("close");return e.initEvent("close",!1,!1),this.dispatchEvent(e),!0}};for(DI in dte)N0.prototype[DI]=dte[DI];var DI;for(LI in cte)N0.prototype[LI]=cte[LI];var LI;pte.exports=N0});var NI=h((S3t,hte)=>{"use strict";var qFe=require("util"),kI=L0(),mte=x6(),Ou=function(e,t,r,n,i){i=i||{},this._stream=t,this._driver=kI.http(e,{maxLength:i.maxLength,protocols:n});var a=this;if(!(!this._stream||!this._stream.writable)){if(!this._stream.readable)return this._stream.end();var o=function(){a._stream.removeListener("data",o)};this._stream.on("data",o),mte.call(this,i),process.nextTick(function(){a._driver.start(),a._driver.io.write(r)})}};qFe.inherits(Ou,mte);Ou.isWebSocket=function(e){return kI.isWebSocket(e)};Ou.validateOptions=function(e,t){kI.validateOptions(e,t)};Ou.WebSocket=Ou;Ou.Client=lte();Ou.EventSource=fte();hte.exports=Ou});var yte=h((E3t,gte)=>{"use strict";var BFe=NI().Client;gte.exports={create:function(e,t,r){return new BFe(e,t,r)}}});var wte=h((x3t,_te)=>{"use strict";var VFe=Lr(),WFe=Tm(),ZFe=HT(),HFe=f0(),bte=ST(),GFe=o6(),vte=Dr(),JFe=Om(),KFe=yte(),XFe=Am(),YFe=_0(),Fm=vte(VFe(YFe,{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(e,t){this.callback(function(){e.call(t,!0)}),this.errback(function(){e.call(t,!1)}),this.connect()},request:function(e){this._pending=this._pending||new ZFe;for(var t=0,r=e.length;t<r;t++)this._pending.add(e[t]);var n=this,i=new WFe(function(a,o){n.callback(function(s){!s||s.readyState!==1||(s.send(JFe(e)),a(s))}),n.connect()});return{abort:function(){i.then(function(a){a.close()})}}},connect:function(){if(!Fm._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var e=this._createSocket();if(!e)return this.setDeferredStatus("failed");var t=this;e.onopen=function(){e.headers&&t._storeCookies(e.headers["set-cookie"]),t._socket=e,t._state=t.CONNECTED,t._everConnected=!0,t.setDeferredStatus("succeeded",e)};var r=!1;e.onclose=e.onerror=function(){if(!r){r=!0;var n=t._state===t.CONNECTED;e.onopen=e.onclose=e.onerror=e.onmessage=null,delete t._socket,t._state=t.UNCONNECTED;var i=t._pending?t._pending.toArray():[];delete t._pending,n||t._everConnected?(t.setDeferredStatus("unknown"),t._handleError(i,n)):t.setDeferredStatus("failed")}},e.onmessage=function(n){var i;try{i=JSON.parse(n.data)}catch{}if(i){i=[].concat(i);for(var a=0,o=i.length;a<o;a++)i[a].successful!==void 0&&t._pending.remove(i[a]);t._receive(i)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var e=Fm.getSocketUrl(this.endpoint),t=this._dispatcher.headers,r=this._dispatcher.wsExtensions,n=this._getCookies(),i=this._dispatcher.tls,a={extensions:r,headers:t,proxy:this._proxy,tls:i};n!==""&&(a.headers.Cookie=n);try{return KFe.create(e,[],a)}catch{}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(e,t){var r=e.transports.websocket=e.transports.websocket||{};return r[t.href]=r[t.href]||new this(e,t),r[t.href]},getSocketUrl:function(e){return e=GFe(e),e.protocol=this.PROTOCOLS[e.protocol],HFe.stringify(e)},isUsable:function(e,t,r,n){this.create(e,t).isUsable(r,n)}});vte(Fm.prototype,XFe);bte.Event&&global.onbeforeunload!==void 0&&bte.Event.on(global,"beforeunload",function(){Fm._unloaded===void 0&&(Fm._unloaded=!0)});_te.exports=Fm});var Ote=h($m=>{"use strict";var O3t=require("net"),QFe=require("tls"),jI=require("http"),Ste=require("https"),e$e=require("events"),t$e=require("assert"),r$e=require("util"),n$e=Hr().Buffer;$m.httpOverHttp=i$e;$m.httpsOverHttp=a$e;$m.httpOverHttps=o$e;$m.httpsOverHttps=s$e;function i$e(e){var t=new os(e);return t.request=jI.request,t}function a$e(e){var t=new os(e);return t.request=jI.request,t.createSocket=Ete,t.defaultPort=443,t}function o$e(e){var t=new os(e);return t.request=Ste.request,t}function s$e(e){var t=new os(e);return t.request=Ste.request,t.createSocket=Ete,t.defaultPort=4
|
|||
|
|
`,d.message,d.stack);var f=new Error("tunneling socket could not be established, cause="+d.message);f.code="ECONNRESET",t.request.emit("error",f),n.removeSocket(i)}};os.prototype.removeSocket=function(t){var r=this.sockets.indexOf(t);if(r!==-1){this.sockets.splice(r,1);var n=this.requests.shift();n&&this.createConnection(n)}};function Ete(e,t){var r=this;os.prototype.createSocket.call(r,e,function(n){var i=QFe.connect(0,xte({},r.options,{servername:e.host,socket:n}));r.sockets[r.sockets.indexOf(n)]=i,t(i)})}function xte(e){for(var t=1,r=arguments.length;t<r;++t){var n=arguments[t];if(typeof n=="object")for(var i=Object.keys(n),a=0,o=i.length;a<o;++a){var s=i[a];n[s]!==void 0&&(e[s]=n[s])}}return e}var gp;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?gp=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:gp=function(){};$m.debug=gp});var kte=h((T3t,Lte)=>{"use strict";var PI=Hr().Buffer,Cte=require("http"),Tte=require("https"),Ite=Ote(),l$e=Lr(),Ate=f0(),yp=Dr(),c$e=Om(),Dte=_0(),u$e=yp(l$e(Dte,{className:"NodeHttp",SECURE_PROTOCOLS:["https:","wss:"],initialize:function(){Dte.prototype.initialize.apply(this,arguments),this._endpointSecure=this.SECURE_PROTOCOLS.indexOf(this.endpoint.protocol)>=0,this._httpClient=this._endpointSecure?Tte:Cte;var e=this._proxy;if(e.origin){if(this._proxyUri=Ate.parse(e.origin),this._proxySecure=this.SECURE_PROTOCOLS.indexOf(this._proxyUri.protocol)>=0,!this._endpointSecure){this._httpClient=this._proxySecure?Tte:Cte;return}var t=yp({proxy:{host:this._proxyUri.hostname,port:this._proxyUri.port||this.DEFAULT_PORTS[this._proxyUri.protocol],proxyAuth:this._proxyUri.auth,headers:yp({host:this.endpoint.host},e.headers)}},this._dispatcher.tls);this._proxySecure?(yp(t.proxy,e.tls),this._tunnel=Ite.httpsOverHttps(t)):this._tunnel=Ite.httpsOverHttp(t)}},encode:function(e){return c$e(e)},request:function(e){var t=PI.from(this.encode(e),"utf8"),r=this._buildParams(t),n=this._httpClient.request(r),i=this;return n.on("response",function(a){i._handleResponse(e,a),i._storeCookies(a.headers["set-cookie"])}),n.on("error",function(a){i.error("HTTP error: "+a.message),i._handleError(e)}),n.end(t),n},_buildParams:function(e){var t=this.endpoint,r=this._proxyUri,n=this._tunnel?t:r||t,i={"Content-Length":e.length,"Content-Type":"application/json",Host:t.host};t.auth&&(i.Authorization="Basic "+PI.from(t.auth,"utf8").toString("base64"));var a={method:"POST",host:n.hostname,port:n.port||this.DEFAULT_PORTS[n.protocol],path:t.path,headers:yp(i,this._dispatcher.headers)},o=this._getCookies();return o!==""&&(a.headers.Cookie=o),this._tunnel?a.agent=this._tunnel:this._endpointSecure?yp(a,this._dispatcher.tls):r&&(a.path=this.endpoint.href,yp(a,this._proxy.tls),r.auth&&(a.headers["Proxy-Authorization"]=PI.from(r.auth,"utf8").toString("base64"))),a},_handleResponse:function(e,t){var r="",n=this;t.setEncoding("utf8"),t.on("data",function(i){r+=i}),t.on("end",function(){var i;try{i=JSON.parse(r)}catch{}i?n._receive(i):n._handleError(e)})}}),{isUsable:function(e,t,r,n){r.call(n,Ate.isURI(t))}});Lte.exports=u$e});var jte=h((I3t,Nte)=>{"use strict";var C6=_0();C6.register("in-process",PQ());C6.register("websocket",wte());C6.register("long-polling",kte());Nte.exports=C6});var MI=h((A3t,Mte)=>{"use strict";var d$e=Dr(),Pte=function(e,t){this.message=e,this.options=t,this.attempts=0};d$e(Pte.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var e=this.options.attempts,t=this.attempts,r=this.options.deadline,n=new Date().getTime();return!(e!==void 0&&t>=e||r!==void 0&&n>r)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}});Mte.exports=Pte});var zte=h((D3t,Ute)=>{"use strict";var p$e=Lr(),Rte=f0(),Fte=qT(),$te=Dr(),f$e=Xl(),m$e=Dm(),RI=jte(),h$e=MI(),j0=p$e({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(e,t,r){this._client=e,this.endpoint
|
|||
|
|
Backtrace:
|
|||
|
|
`+u.stack)}},i.onclose=function(s){o._server.closeSocket(a),i=null}},handleEventSource:function(e,t){var r=new lre(e,t,{ping:this._options.ping}),n=r.url.split("/").pop(),i=this;this.debug("Opened EventSource connection for ?",n),this._server.openSocket(n,r,e),r.onclose=function(a){i._server.closeSocket(n),r=null}},_handleOptions:function(e,t){var r=e.headers.origin||e.headers.referer,n={"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Accept, Authorization, Content-Type, Pragma, X-Requested-With","Access-Control-Allow-Methods":"POST, GET","Access-Control-Allow-Origin":r||"*","Access-Control-Max-Age":"86400"};t.writeHead(200,n),t.end("")},_concatStream:function(e,t,r){var n=[],i=0;e.on("data",function(a){n.push(a),i+=a.length}),e.on("end",function(){for(var a=are.alloc(i),o=0,s=0,l=n.length;s<l;s++)n[s].copy(a,o),o+=n[s].length;t.call(r,a.toString("utf8"))})},_parseJSON:function(e){var t=JSON.parse(e);if(typeof t=="object")return t;throw new SyntaxError("JSON messages must contain an object or array")},_formatRequest:function(e){var t=e.method.toUpperCase(),r="curl -X "+t;return r+=" 'http://"+e.headers.host+e.url+"'",t==="POST"&&(r+=" -H 'Content-Type: "+e.headers["content-type"]+"'",r+=" -d '"+e.body+"'"),r},_returnError:function(e,t){var r=t.message;t.stack&&(r+=`
|
|||
|
|
Backtrace:
|
|||
|
|
`+t.stack),this.error(r),e&&(e.writeHead(400,qI.TYPE_TEXT),e.end("Bad request"))}});for(ure in q$e)(function(e){BI.prototype[e]=function(){return this._server._engine[e].apply(this._server._engine,arguments)}})(ure);var ure;pre(BI.prototype,z$e);fre.exports=BI});var VI=h(($3t,gre)=>{"use strict";var Z$e=xm(),H$e=Xl(),hre={VERSION:Z$e.VERSION,Client:UI(),Scheduler:MI(),NodeAdapter:mre()};H$e.wrapper=hre;gre.exports=hre});var bre=h(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.Replay=Um.AuthFailure=void 0;var WI=class{_failureCallback;constructor(t){this._failureCallback=t}incoming(t,r){(t.channel==="/meta/connect"||t.channel==="/meta/handshake")&&t.advice&&t.advice.reconnect=="none"?this._failureCallback(t):r(t)}};Um.AuthFailure=WI;var yre="replay",ZI=class{_extensionEnabled;_replay;_channel;constructor(t,r){this._extensionEnabled=r!=null,this._channel=t,this._replay=r}setExtensionEnabled(t){this._extensionEnabled=t}setReplay(t){this._replay=parseInt(t,10)}setChannel(t){this._channel=t}incoming(t,r){t.channel==="/meta/handshake"?t.ext&&t.ext[yre]==!0&&(this._extensionEnabled=!0):t.channel===this._channel&&t.data?.event?.replayId&&(this._replay=t.data.event.replayId),r(t)}outgoing(t,r){if(t.channel==="/meta/subscribe"&&this._extensionEnabled){t.ext||(t.ext={});let n={[this._channel]:this._replay};t.ext[yre]=n}r(t)}};Um.Replay=ZI});var vre=h(dn=>{"use strict";var G$e=dn&&dn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),J$e=dn&&dn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),K$e=dn&&dn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&G$e(t,e,r);return J$e(t,e),t};Object.defineProperty(dn,"__esModule",{value:!0});dn.StreamingExtension=dn.Streaming=dn.Subscription=dn.Client=void 0;var X$e=require("events"),JI=VI();Object.defineProperty(dn,"Client",{enumerable:!0,get:function(){return JI.Client}});Object.defineProperty(dn,"Subscription",{enumerable:!0,get:function(){return JI.Subscription}});var Y$e=Wi(),Q$e=K$e(bre());dn.StreamingExtension=Q$e;var HI=class{_streaming;name;constructor(t,r){this._streaming=t,this.name=r}subscribe(t){return this._streaming.subscribe(this.name,t)}unsubscribe(t){return this._streaming.unsubscribe(this.name,t),this}},GI=class{_streaming;_id;name;constructor(t,r){this._streaming=t,this.name=r}subscribe(t){return this._streaming.subscribe(this.name,t)}unsubscribe(t){return this._streaming.unsubscribe(this.name,t),this}async push(t){let r=Array.isArray(t),n=Array.isArray(t)?t:[t],i=this._streaming._conn;this._id||(this._id=i.sobject("StreamingChannel").findOne({Name:this.name},["Id"]).then(l=>l?.Id));let a=await this._id;if(!a)throw new Error(`No streaming channel available for name: ${this.name}`);let o=`/sobjects/StreamingChannel/${a}/push`,s=await i.requestPost(o,{pushEvents:n});return r?s:s[0]}},R0=class extends X$e.EventEmitter{_conn;_topics={};_fayeClients={};constructor(t){super(),this._conn=t}_createClient(t,r){let n=typeof t=="string"&&t.startsWith("/u/"),i=[this._conn.instanceUrl,"cometd"+(n&&this._conn.version==="36.0"?"/replay":""),this._conn.version].join("/"),a=new JI.Client(i,{});if(a.setHeader("Authorization","OAuth "+this._conn.accessToken),Array.isArray(r))for(let s of r)a.addExtension(s);let o=a._dispatcher;return o.getConnectionTypes().indexOf("callback-polling")===-1&&(o.selectTransport("long-polling"),o._transport.batching=!1),a}_getFayeClient(t){let n=t.startsWith("/u/")?"generic":"pushTopic";return this._fayeClients[n]||(this._fayeClients[n]=this._createClient(t)),this._fayeClients[n]}topic(t){return this._topics=this._topics||{},this._topics[t]=this._topics[t]||new HI(this,t)}channel(t){return new GI(this,t)}subscribe(t
|
|||
|
|
Supported algorithms are:
|
|||
|
|
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,U0="secret must be a string or buffer",Bm="key must be a string or a buffer",ZUe="key must be a string, a buffer or an object",sA=typeof La.createPublicKey=="function";sA&&(Bm+=" or a KeyObject",U0+="or a KeyObject");function rne(e){if(!Vm.isBuffer(e)&&typeof e!="string"&&(!sA||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw _o(Bm)}function nne(e){if(!Vm.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw _o(ZUe)}function HUe(e){if(!Vm.isBuffer(e)){if(typeof e=="string")return e;if(!sA||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw _o(U0)}}function lA(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ine(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function _o(e){var t=[].slice.call(arguments,1),r=ene.format.bind(ene,e).apply(null,t);return new TypeError(r)}function GUe(e){return Vm.isBuffer(e)||typeof e=="string"}function z0(e){return GUe(e)||(e=JSON.stringify(e)),e}function ane(e){return function(r,n){HUe(n),r=z0(r);var i=La.createHmac("sha"+e,n),a=(i.update(r),i.digest("base64"));return lA(a)}}var oA,JUe="timingSafeEqual"in La?function(t,r){return t.byteLength!==r.byteLength?!1:La.timingSafeEqual(t,r)}:function(t,r){return oA||(oA=Qre()),oA(t,r)};function KUe(e){return function(r,n,i){var a=ane(e)(r,i);return JUe(Vm.from(n),Vm.from(a))}}function one(e){return function(r,n){nne(n),r=z0(r);var i=La.createSign("RSA-SHA"+e),a=(i.update(r),i.sign(n,"base64"));return lA(a)}}function sne(e){return function(r,n,i){rne(i),r=z0(r),n=ine(n);var a=La.createVerify("RSA-SHA"+e);return a.update(r),a.verify(i,n,"base64")}}function XUe(e){return function(r,n){nne(n),r=z0(r);var i=La.createSign("RSA-SHA"+e),a=(i.update(r),i.sign({key:n,padding:La.constants.RSA_PKCS1_PSS_PADDING,saltLength:La.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return lA(a)}}function YUe(e){return function(r,n,i){rne(i),r=z0(r),n=ine(n);var a=La.createVerify("RSA-SHA"+e);return a.update(r),a.verify({key:i,padding:La.constants.RSA_PKCS1_PSS_PADDING,saltLength:La.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function QUe(e){var t=one(e);return function(){var n=t.apply(null,arguments);return n=tne.derToJose(n,"ES"+e),n}}function eze(e){var t=sne(e);return function(n,i,a){i=tne.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,a);return o}}function tze(){return function(){return""}}function rze(){return function(t,r){return r===""}}lne.exports=function(t){var r={hs:ane,rs:one,ps:XUe,es:QUe,none:tze},n={hs:KUe,rs:sne,ps:YUe,es:eze,none:rze},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw _o(WUe,t);var a=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[a](o),verify:n[a](o)}}});var uA=h((aSt,cne)=>{var nze=require("buffer").Buffer;cne.exports=function(t){return typeof t=="string"?t:typeof t=="number"||nze.isBuffer(t)?t.toString():JSON.stringify(t)}});var hne=h((oSt,mne)=>{var ize=Hr().Buffer,une=nA(),aze=cA(),oze=require("stream"),dne=uA(),dA=require("util");function pne(e,t){return ize.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function sze(e,t,r){r=r||"utf8";var n=pne(dne(e),"binary"),i=pne(dne(t),r);return dA.format("%s.%s",n,i)}function fne(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,a=aze(t.alg),o=sze(t,r,i),s=a.sign(o,n);return dA.format("%s.%s",o,s)}function j6(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new une(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new une(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this
|
|||
|
|
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),vr;(function(e){e.TARGET_ORG="target-org",e.TARGET_DEV_HUB="target-dev-hub",e.ORG_API_VERSION="org-api-version",e.ORG_CUSTOM_METADATA_TEMPLATES="org-custom-metadata-templates",e.ORG_MAX_QUERY_LIMIT="org-max-query-limit",e.ORG_INSTANCE_URL="org-instance-url",e.ORG_ISV_DEBUGGER_SID="org-isv-debugger-sid",e.ORG_ISV_DEBUGGER_URL="org-isv-debugger-url",e.ORG_CAPITALIZE_RECORD_TYPES="org-capitalize-record-types"})(vr||(Gm.OrgConfigProperties=vr={}));Gm.ORG_CONFIG_ALLOWED_PROPERTIES=[{key:vr.ORG_CAPITALIZE_RECORD_TYPES,description:fi.getMessage(vr.ORG_CAPITALIZE_RECORD_TYPES)},{key:vr.ORG_CUSTOM_METADATA_TEMPLATES,description:fi.getMessage(vr.ORG_CUSTOM_METADATA_TEMPLATES)},{key:vr.TARGET_ORG,description:fi.getMessage(vr.TARGET_ORG)},{key:vr.TARGET_DEV_HUB,description:fi.getMessage(vr.TARGET_DEV_HUB)},{key:vr.ORG_INSTANCE_URL,description:fi.getMessage(vr.ORG_INSTANCE_URL),input:{validator:e=>e==null?!0:(0,W6.isString)(e)&&TA.SfdcUrl.isValidUrl(e)&&(new TA.SfdcUrl(e).isSalesforceDomain()||new TA.SfdcUrl(e).isInternalUrl()),failedMessage:fi.getMessage("invalidInstanceUrl")}},{key:vr.ORG_API_VERSION,description:fi.getMessage(vr.ORG_API_VERSION),hidden:!0,input:{validator:e=>e==null|
|
|||
|
|
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),iVe="sfdx-config.json",aVe="config.json",H0;(function(e){e.DISABLE_TELEMETRY="disable-telemetry"})(H0||(Cn.SfConfigProperties=H0={}));Cn.SF_ALLOWED_PROPERTIES=[{key:H0.DISABLE_TELEMETRY,description:Dt.getMessage(H0.DISABLE_TELEMETRY),input:{validator:e=>e==null||DA(e),failedMessage:Dt.getMessage("invalidBooleanConfigValue")}}];var _r;(function(e){e.DEFAULT_DEV_HUB_USERNAME="defaultdevhubusername",e.DEFAULT_USERNAME="defaultusername",e.ISV_DEBUGGER_SID="isvDebuggerSid",e.ISV_DEBUGGER_URL="isvDebuggerUrl",e.API_VERSION="apiVersion",e.DISABLE_TELEMETRY="disableTelemetry",e.CUSTOM_ORG_METADATA_TEMPLATES="customOrgMetadataTemplates",e.MAX_QUERY_LIMIT="maxQueryLimit",e.REST_DEPLOY="restDeploy",e.INSTANCE_URL="instanceUrl"})(_r||(Cn.SfdxPropertyKeys=_r={}));Cn.SFDX_ALLOWED_PROPERTIES=[{key:_r.INSTANCE_URL,description:Dt.getMessage(_r.INSTANCE_URL),newKey:tc.OrgConfigProperties.ORG_INSTANCE_URL,deprecated:!0,input:{validator:e=>e==null?!0:(0,Lu.isString)(e)&&IA.SfdcUrl.isValidUrl(e)&&(new IA.SfdcUrl(e).isSalesforceDomain()||new IA.SfdcUrl(e).isInternalUrl()),failedMessage:Dt.getMessage("invalidInstanceUrl")}},{key:_r.API_VERSION,newKey:tc.OrgConfigProperties.ORG_API_VERSION,deprec
|
|||
|
|
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),jA=class e extends NA.AsyncOptionalCreatable{static encrypted=!0;static instances=new Map;static mutex=new dVe.Mutex;allowedProperties;localConfig;globalConfig;envVars={};constructor(t){super(t??{});try{this.localConfig=new Km.Config({...Km.Config.getDefaultOptions(!1),...t?.projectPath?{rootFolder:t.projectPath}:{}})}catch(r){if(r.name!=="InvalidProjectWorkspaceError")throw r}this.globalConfig=new Km.Config(Km.Config.getDefaultOptions(!0)),this.setAllowedProperties(Km.Config.getAllowedProperties())}get config(){return this.resolveProperties(this.globalConfig.getContents(),this.localConfig?.getContents())}static async create(t){return e.mutex.lock(async()=>{let r=t?.projectPath?(0,kA.resolve)(t.projectPath):process.cwd();if(!e.instances.has(r)){let i=new this(t);e.instances.set(r,i),await i.init()}let n=e.instances.get(r);return e.encrypted&&await n.loadProperties(),t?.customConfigMeta&&Km.Config.addAllowedProperties(t.customConfigMeta),n})}static async clearInstance(t){return e.mutex.lock(()=>{if(t){let r=(0,kA.resolve)(t);e.instances.delete(r)}else e.instances.clear();e.encrypted=!0})}static getValue(t,r){return this.getInstance(r??process.cwd()).getInfo(t)}static getIns
|
|||
|
|
`)}});var WA=h(de=>{"use strict";var jWe=de&&de.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),PWe=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),VA=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&jWe(t,e,r);return PWe(t,e),t};Object.defineProperty(de,"__esModule",{value:!0});de.safeDecodeAsync=de._safeDecodeAsync=de.safeEncodeAsync=de._safeEncodeAsync=de.safeDecode=de._safeDecode=de.safeEncode=de._safeEncode=de.decodeAsync=de._decodeAsync=de.encodeAsync=de._encodeAsync=de.decode=de._decode=de.encode=de._encode=de.safeParseAsync=de._safeParseAsync=de.safeParse=de._safeParse=de.parseAsync=de._parseAsync=de.parse=de._parse=void 0;var Qm=VA(Sp()),Ji=VA(BA()),eh=VA(Se()),MWe=e=>(t,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Qm.$ZodAsyncError;if(o.issues.length){let s=new(i?.Err??e)(o.issues.map(l=>eh.finalizeIssue(l,a,Qm.config())));throw eh.captureStackTrace(s,i?.callee),s}return o.value};de._parse=MWe;de.parse=(0,de._parse)(Ji.$ZodRealError);var RWe=e=>async(t,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(i?.Err??e)(o.issues.map(l=>eh.finalizeIssue(l,a,Qm.config())));throw eh.captureStackTrace(s,i?.callee),s}return o.value};de._parseAsync=RWe;de.parseAsync=(0,de._parseAsync)(Ji.$ZodRealError);var FWe=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Qm.$ZodAsyncError;return a.issues.length?{success:!1,error:new(e??Ji.$ZodError)(a.issues.map(o=>eh.finalizeIssue(o,i,Qm.config())))}:{success:!0,data:a.value}};de._safeParse=FWe;de.safeParse=(0,de._safeParse)(Ji.$ZodRealError);var $We=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>eh.finalizeIssue(o,i,Qm.config())))}:{success:!0,data:a.value}};de._safeParseAsync=$We;de.safeParseAsync=(0,de._safeParseAsync)(Ji.$ZodRealError);var UWe=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._parse)(e)(t,r,i)};de._encode=UWe;de.encode=(0,de._encode)(Ji.$ZodRealError);var zWe=e=>(t,r,n)=>(0,de._parse)(e)(t,r,n);de._decode=zWe;de.decode=(0,de._decode)(Ji.$ZodRealError);var qWe=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._parseAsync)(e)(t,r,i)};de._encodeAsync=qWe;de.encodeAsync=(0,de._encodeAsync)(Ji.$ZodRealError);var BWe=e=>async(t,r,n)=>(0,de._parseAsync)(e)(t,r,n);de._decodeAsync=BWe;de.decodeAsync=(0,de._decodeAsync)(Ji.$ZodRealError);var VWe=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._safeParse)(e)(t,r,i)};de._safeEncode=VWe;de.safeEncode=(0,de._safeEncode)(Ji.$ZodRealError);var WWe=e=>(t,r,n)=>(0,de._safeParse)(e)(t,r,n);de._safeDecode=WWe;de.safeDecode=(0,de._safeDecode)(Ji.$ZodRealError);var ZWe=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,de._safeParseAsync)(e)(t,r,i)};de._safeEncodeAsync=ZWe;de.safeEncodeAsync=(0,de._safeEncodeAsync)(Ji.$ZodRealError);var HWe=e=>async(t,r,n)=>(0,de._safeParseAsync)(e)(t,r,n);de._safeDecodeAsync=HWe;de.safeDecodeAsync=(0,de._safeDecodeAsync)(Ji.$ZodRealError)});var e3=h(J=>{"use strict";var GWe=J&&J.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=
|
|||
|
|
`).filter(o=>o),i=Math.min(...n.map(o=>o.length-o.trimStart().length)),a=n.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...r,i.join(`
|
|||
|
|
`))}};r3.Doc=GA});var KA=h(n3=>{"use strict";Object.defineProperty(n3,"__esModule",{value:!0});n3.version=void 0;n3.version={major:4,minor:4,patch:3}});var QA=h(F=>{"use strict";var cZe=F&&F.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),uZe=F&&F.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l3=F&&F.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&cZe(t,e,r);return uZe(t,e),t};Object.defineProperty(F,"__esModule",{value:!0});F.$ZodTuple=F.$ZodIntersection=F.$ZodDiscriminatedUnion=F.$ZodXor=F.$ZodUnion=F.$ZodObjectJIT=F.$ZodObject=F.$ZodArray=F.$ZodDate=F.$ZodVoid=F.$ZodNever=F.$ZodUnknown=F.$ZodAny=F.$ZodNull=F.$ZodUndefined=F.$ZodSymbol=F.$ZodBigIntFormat=F.$ZodBigInt=F.$ZodBoolean=F.$ZodNumberFormat=F.$ZodNumber=F.$ZodCustomStringFormat=F.$ZodJWT=F.$ZodE164=F.$ZodBase64URL=F.$ZodBase64=F.$ZodCIDRv6=F.$ZodCIDRv4=F.$ZodMAC=F.$ZodIPv6=F.$ZodIPv4=F.$ZodISODuration=F.$ZodISOTime=F.$ZodISODate=F.$ZodISODateTime=F.$ZodKSUID=F.$ZodXID=F.$ZodULID=F.$ZodCUID2=F.$ZodCUID=F.$ZodNanoID=F.$ZodEmoji=F.$ZodURL=F.$ZodEmail=F.$ZodUUID=F.$ZodGUID=F.$ZodStringFormat=F.$ZodString=F.clone=F.$ZodType=void 0;F.$ZodCustom=F.$ZodLazy=F.$ZodPromise=F.$ZodFunction=F.$ZodTemplateLiteral=F.$ZodReadonly=F.$ZodPreprocess=F.$ZodCodec=F.$ZodPipe=F.$ZodNaN=F.$ZodCatch=F.$ZodSuccess=F.$ZodNonOptional=F.$ZodPrefault=F.$ZodDefault=F.$ZodNullable=F.$ZodExactOptional=F.$ZodOptional=F.$ZodTransform=F.$ZodFile=F.$ZodLiteral=F.$ZodEnum=F.$ZodSet=F.$ZodMap=F.$ZodRecord=void 0;F.isValidBase64=YA;F.isValidBase64URL=yae;F.isValidJWT=bae;var c3=l3(t3()),oe=l3(Sp()),dZe=JA(),th=WA(),dt=l3(e3()),se=l3(Se()),pZe=KA();F.$ZodType=oe.$constructor("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pZe.version;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let a of i._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(o,s,l)=>{let c=se.aborted(o),u;for(let d of s){if(d._zod.def.when){if(se.explicitlyAborted(o)||!d._zod.def.when(o))continue}else if(c)continue;let f=o.issues.length,p=d._zod.check(o);if(p instanceof Promise&&l?.async===!1)throw new oe.$ZodAsyncError;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,o.issues.length!==f&&(c||(c=se.aborted(o,f)))});else{if(o.issues.length===f)continue;c||(c=se.aborted(o,f))}}return u?u.then(()=>o):o},a=(o,s,l)=>{if(se.aborted(o))return o.aborted=!0,o;let c=i(s,n,l);if(c instanceof Promise){if(l.async===!1)throw new oe.$ZodAsyncError;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if(s.direction==="backward"){let c=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>a(u,o,s)):a(c,o,s)}let l=e._zod.parse(o,s);if(l instanceof Promise){if(s.async===!1)throw new oe.$ZodAsyncError;return l.then(c=>i(c,n,s))}return i(l,n,s)}}se.defineLazy(e,"~standard",()=>({validate:i=>{try{let a=(0,th.safeParse)(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return(0,th.safeParseAsync)(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))});var fZe=Se();Object.defineProperty(F,"clone",{enumerable:!0,get:function(){return fZe.clone}});F.$ZodString=oe.$constructor("$ZodString",(e,t)=>{F.$ZodType.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dt.string(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}
|
|||
|
|
if (${_}.issues.length) {
|
|||
|
|
if (${b} in input) {
|
|||
|
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|||
|
|
...iss,
|
|||
|
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|||
|
|
})));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (${_}.value === undefined) {
|
|||
|
|
if (${b} in input) {
|
|||
|
|
newResult[${b}] = undefined;
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
newResult[${b}] = ${_}.value;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
`):j?p.write(`
|
|||
|
|
if (${_}.issues.length) {
|
|||
|
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|||
|
|
...iss,
|
|||
|
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|||
|
|
})));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (${_}.value === undefined) {
|
|||
|
|
if (${b} in input) {
|
|||
|
|
newResult[${b}] = undefined;
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
newResult[${b}] = ${_}.value;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
`):p.write(`
|
|||
|
|
const ${_}_present = ${b} in input;
|
|||
|
|
if (${_}.issues.length) {
|
|||
|
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|||
|
|
...iss,
|
|||
|
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|||
|
|
})));
|
|||
|
|
}
|
|||
|
|
if (!${_}_present && !${_}.issues.length) {
|
|||
|
|
payload.issues.push({
|
|||
|
|
code: "invalid_type",
|
|||
|
|
expected: "nonoptional",
|
|||
|
|
input: undefined,
|
|||
|
|
path: [${b}]
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (${_}_present) {
|
|||
|
|
if (${_}.value === undefined) {
|
|||
|
|
newResult[${b}] = undefined;
|
|||
|
|
} else {
|
|||
|
|
newResult[${b}] = ${_}.value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
`)}p.write("payload.value = newResult;"),p.write("return payload;");let E=p.compile();return(w,_)=>E(f,w,_)},a,o=se.isObject,s=!oe.globalConfig.jitless,l=se.allowsEval,c=s&&l.value,u=t.catchall,d;e._zod.parse=(f,p)=>{d??(d=n.value);let m=f.value;return o(m)?s&&c&&p?.async===!1&&p.jitless!==!0?(a||(a=i(t.shape)),f=a(f,p),u?_ae([],m,f,p,d,e):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function iae(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let i=e.filter(a=>!se.aborted(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>se.finalizeIssue(o,n,oe.config())))}),t)}F.$ZodUnion=oe.$constructor("$ZodUnion",(e,t)=>{F.$ZodType.init(e,t),se.defineLazy(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),se.defineLazy(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),se.defineLazy(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),se.defineLazy(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>se.cleanRegex(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)o.push(l),a=!0;else{if(l.issues.length===0)return l;o.push(l)}}return a?Promise.all(o).then(s=>iae(s,n,e,i)):iae(o,n,e,i)}});function aae(e,t,r,n){let i=e.filter(a=>a.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>se.finalizeIssue(o,n,oe.config())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}F.$ZodXor=oe.$constructor("$ZodXor",(e,t)=>{F.$ZodUnion.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of t.options){let l=s._zod.run({value:n.value,issues:[]},i);l instanceof Promise?(o.push(l),a=!0):o.push(l)}return a?Promise.all(o).then(s=>aae(s,n,e,i)):aae(o,n,e,i)}});F.$ZodDiscriminatedUnion=oe.$constructor("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,F.$ZodUnion.init(e,t);let r=e._zod.parse;se.defineLazy(e._zod,"propValues",()=>{let i={};for(let a of t.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[s,l]of Object.entries(o)){i[s]||(i[s]=new Set);for(let c of l)i[s].add(c)}}return i});let n=se.cached(()=>{let i=t.options,a=new Map;for(let o of i){let s=o._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let l of s){if(a.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);a.set(l,o)}}return a});e._zod.parse=(i,a)=>{let o=i.value;if(!se.isObject(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;let s=n.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}});F.$ZodIntersection=oe.$constructor("$ZodIntersection",(e,t)=>{F.$ZodType.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,a=t.left._zod.run({value:i,issues:[]},n),o=t.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([l,c])=>oae(r,l,c)):oae(r,a,o)}});function XA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(se.isPlainObject(e)&&se.isPlainObject(t)){let r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!
|
|||
|
|
|
|||
|
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of e.seen.entries()){let s=o[1];if(t===o[0]){a(o);continue}if(e.external){let c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&e.reused==="ref"){a(o);continue}}}function oD(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let l=e.seen.get(s);if(l.ref===null)return;let c=l.def??l.schema,u={...c},d=l.ref;if(l.ref=null,d){n(d);let p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,u),s._zod.parent===d)for(let v in c)v==="$ref"||v==="allOf"||v in u||delete c[v];if(m.$ref&&p.def)for(let v in c)v==="$ref"||v==="allOf"||v in p.def&&JSON.stringify(c[v])===JSON.stringify(p.def[v])&&delete c[v]}let f=s._zod.parent;if(f&&f!==d){n(f);let p=e.seen.get(f);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}e.override({zodSchema:s,jsonSchema:c,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())n(s[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}Object.assign(i,r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:(0,ka.createStandardJSONSchemaMethod)(t,"input",e.processors),output:(0,ka.createStandardJSONSchemaMethod)(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Jn(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Jn(n.element,r);if(n.type==="set")return Jn(n.valueType,r);if(n.type==="lazy")return Jn(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Jn(n.innerType,r);if(n.type==="intersection")return Jn(n.left,r)||Jn(n.right,r);if(n.type==="record"||n.type==="map")return Jn(n.keyType,r)||Jn(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Jn(n.in,r)||Jn(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Jn(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Jn(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Jn(i,r))return!0;return!!(n.rest&&Jn(n.rest,r))}return!1}var tet=(e,t={})=>r=>{let n=iD({...r,processors:t});return uS(e,n),aD(n,e),oD(n,e)};ka.createToJSONSchemaMethod=tet;var ret=(e,t,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=iD({...i??{},target:a,io:t,processors:r});return uS(e,o),aD(o,e),oD(o,e)};ka.createStandardJSONSchemaMethod=ret});var ay=h(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.allProcessors=Y.lazyProcessor=Y.optionalProcessor=Y.promiseProcessor=Y.readonlyProcessor=Y.pipeProcessor=Y.catchProcessor=Y.prefaultProcessor=Y.defaultProcessor=Y.nonoptionalProcessor=Y.nullableProcessor=Y.recordProcessor=Y.tupleProcessor=Y.intersectionProcessor=Y.unionProcessor=Y.objectProcessor=Y.arrayProcessor=Y.setProcessor=Y.mapProcessor=Y.transformProcessor=Y.functionProcessor=Y.customProcessor=Y.successProcessor=Y.f
|
|||
|
|
|
|||
|
|
Due to: %s`],["jwtAuthError","Error authenticating with JWT config due to: %s"],["jwtAuthErrors",`Error authenticating with JWT.
|
|||
|
|
Errors encountered:
|
|||
|
|
%s`],["refreshTokenAuthError","Error authenticating with the refresh token due to: %s"],["invalidSfdxAuthUrlError",`Invalid SFDX authorization URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX authorization URL doesn\\'t include the protocol ("https://"). Run "org display --target-org" on an org to see an example of an SFDX authorization URL.`],["orgDataNotAvailableError","An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired."],["orgDataNotAvailableError.actions",["Run `sfdx force:org:list --clean` to remove stale org authentications.","Use `sfdx force:config:set` to update the defaultusername.","Use `sfdx force:org:create` to create a new org.","Use `sfdx auth` to authenticate an existing org."]],["namedOrgNotFound","No authorization information found for %s."],["noAliasesFound","Nothing to set."],["invalidFormat","Setting aliases must be in the format <key>=<value> but found: [%s]."],["invalidJsonCasing",'All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`\nFound "%s" at %s'],["missingClientId","Client ID is required for JWT authentication."]])),mnt=e=>(t=[])=>r=>{let n=hle(r,t),i=n.filter(a=>/^[A-Z]/.test(a)).join(", ");return unt.strict.strictEqual(i.length,0,fnt.getMessage("invalidJsonCasing",[i,e])),n};LS.ensureNoUppercaseKeys=mnt;var hle=(e,t)=>Object.entries(e).filter(([r])=>!t.includes(r)).flatMap(([r,n])=>(0,dnt.isJsonMap)(n)?[r,...hle(n,t)]:[r])});var my=h(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.isNamedPackagingDirectory=gi.isPackagingDirectory=gi.SfProject=gi.SfProjectJson=void 0;var al=require("node:path"),wD=He(),hnt=Ke(),yle=vD(),gnt=Rr(),ynt=ec(),bnt=rc(),ble=nu(),SD=NE(),_D=wt(),vnt=bt(),_nt=gle(),vle=sn(),Fa=new vnt.Messages("@salesforce/core","config",new Map([["unknownConfigKey","Unknown config name: %s."],["deprecatedConfigKey","Deprecated config name: %s. Please use %s instead."],["invalidWrite","The writeSync method is not allowed on SfdxConfig. Use the async write method instead."],["invalidConfigValue","Invalid config value: %s."],["invalidInstanceUrl","Specify a valid Salesforce instance URL."],["invalidApiVersion","Specify a valid Salesforce API version, for example, 42.0."],["invalidCustomOrgMetadataTemplates","Specify a valid repository URL or directory for the custom org metadata templates."],["invalidIsvDebuggerSid","Specify a valid Debugger SID."],["invalidIsvDebuggerUrl","Specify a valid Debugger URL."],["invalidNumberConfigValue","Specify a valid positive integer, for example, 150000."],["invalidBooleanConfigValue","The config value can only be set to true or false."],["invalidProjectWorkspace","%s does not contain a valid Salesforce DX project."],["schemaValidationError",`The config file "%s" is not schema valid.
|
|||
|
|
Due to: %s`],["schemaValidationError.actions",["Fix the invalid entries at %s."]],["missingDefaultPath",'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'],["missingPackageDirectory",'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'],["invalidPackageDirectory",'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'],["multipleDefaultPaths","In sfdx-project.json, indicate only one package directory (path) as the default."],["singleNonDefaultPackage",'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'],["target-org","Username or alias of the org that all commands run against by default. (sf only)"],["target-dev-hub","Username or alias of your default Dev Hub org. (sf only)"],["defaultUsername","Username or alias of the org that all commands run against by default. (sfdx only)"],["defaultDevHubUsername","Username or alias of your default Dev Hub org. (sfdx only)"],["isvDebuggerSid","ISV debugger SID (sfdx only)"],["isvDebuggerUrl","ISV debugger URL (sfdx only)"],["org-isv-debugger-sid","ISV debugger SID."],["org-isv-debugger-url","ISV debugger URL."],["apiVersion","API version of your project. Default: API version of your Dev Hub org. (sfdx only)"],["org-api-version","API version of your project. Default: API version of your Dev Hub org."],["disableTelemetry","Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"],["disable-telemetry","Disables the collection of usage and user environment information, etc. Default: false."],["maxQueryLimit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"],["org-max-query-limit","Maximum number of Salesforce records returned by a CLI command. Default: 10,000."],["restDeploy","Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"],["instanceUrl","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"],["org-instance-url","URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."],["customOrgMetadataTemplates","A valid repository URL or directory for the custom org metadata templates."],["org-custom-metadata-templates","A valid repository URL or directory for the custom org metadata templates."],["org-capitalize-record-types","Whether record types are capitalized on scratch org creation."],["invalidId","The given id %s is not a valid 15 or 18 character Salesforce ID."]])),oc=class e extends ble.ConfigFile{static BLOCKLIST=["packageAliases","plugins","packageBundleAliases"];static getFileName(){return SD.SFDX_PROJECT_JSON}static getDefaultOptions(t=!1){let r=ble.ConfigFile.getDefaultOptions(t,e.getFileName());return r.isState=!1,r}async read(){let t=await super.read();return this.validateKeys(),t}refreshSync(){return super.readSync(!1,!0),this}readSync(){let t=super.readSync();return this.validateKeys(),t}async write(){return this.validateKeys(),super.write()}writeSync(){return this.validateKeys(),super.writeSync()}getDefaultOptions(t){return{isState:!1,...t??{}}}async schemaValidate(){this.hasRead||await this.read();let t=yle.ProjectJsonSchema.safeParse(this.getContents());if(!t.success){let r=t.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`).join(`
|
|||
|
|
`),n=Fa.getMessage("schemaValidationError",[this.getPath(),r]);if(wD.env.getBoolean("SFDX_PROJECT_JSON_VALIDATION",!1)&&!this.options.isGlobal)throw Fa.createError("schemaValidationError",[this.getPath(),r],[this.getPath()]);await vle.Lifecycle.getInstance().emitWarning(n)}}async getPackageDirectories(){return this.getPackageDirectoriesSync()}schemaValidateSync(){this.hasRead||this.readSync();let t=yle.ProjectJsonSchema.safeParse(this.getContents());if(!t.success){let r=t.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`).join(`
|
|||
|
|
`),n=Fa.getMessage("schemaValidationError",[this.getPath(),r]);if(wD.env.getBoolean("SFDX_PROJECT_JSON_VALIDATION",!1)&&!this.options.isGlobal)throw Fa.createError("schemaValidationError",[this.getPath(),r],[this.getPath()]);vle.Lifecycle.getInstance().emitWarning(n)}}getPackageDirectoriesSync(){let r=(this.getContents().packageDirectories||[]).map(i=>{if((0,al.isAbsolute)(i.path))throw Fa.createError("invalidPackageDirectory",[i.path]);let a=al.sep==="/"?/\\/g:/\//g,o=i.path.replace(a,al.sep),s=(0,al.normalize)(o).replace(new RegExp(`\\${al.sep}$`),""),l=`${(0,al.dirname)(this.getPath())}${al.sep}${s}${al.sep}`;if(!this.doesPackageExist(l))throw Fa.createError("missingPackageDirectory",[i.path]);return Object.assign({},i,{name:s,path:o,fullPath:l})});if(r.length===1){if(r[0].default===!1)throw Fa.createError("singleNonDefaultPackage");r[0].default=!0}let n=r.filter(i=>i.default);if(n.length===0&&!this.isGlobal())throw Fa.createError("missingDefaultPath");if(n.length>1)throw Fa.createError("multipleDefaultPaths");return r}getUniquePackageDirectories(){let t=new Set,r=[];return this.getPackageDirectoriesSync().forEach(n=>{t.has(n.name)||(t.add(n.name),r.push(n))}),r}getUniquePackageNames(){return this.getUniquePackageDirectories().map(t=>t.name)}hasPackages(){return this.getContents()?.packageDirectories?.length>0}hasMultiplePackages(){return this.getContents()?.packageDirectories?.length>1}hasMultiplePackageBundles(){return(this.getContents()?.packageBundles?.length??0)>1}async hasPackageAliases(){return Object.keys(this.getContents().packageAliases??{}).length>0}getPackageAliases(){return this.getContents().packageAliases}addPackageAlias(t,r){if(!/^.{15,18}$/.test(r))throw Fa.createError("invalidId",[r]);let n={...this.getContents().packageAliases??{},[t]:r};this.contents.set("packageAliases",n)}addPackageDirectory(t){let r=this.getContents().packageDirectories.findIndex(Ent(t)),n=Object.assign({},r>-1?this.getContents().packageDirectories[r]:t,t),i=r>-1?this.getContents().packageDirectories.map((a,o)=>o===r?t:a):[...this.getContents()?.packageDirectories??[],n];this.set("packageDirectories",i)}getPackageBundles(){return this.get("packageBundles")??[]}addPackageBundle(t){let r=this.getPackageBundles(),n=r.findIndex(o=>o.name===t.name),i={...n>-1?r[n]:t,...t},a=n>-1?r.map(o=>o.name===t.name?i:o):[...r,i];this.set("packageBundles",a)}hasPackageBundleAliases(){return Object.keys(this.getContents().packageBundleAliases??{}).length>0}getPackageBundleAliases(){return this.get("packageBundleAliases")}addPackageBundleAlias(t,r){let n={...this.get("packageBundleAliases")??{},[t]:r};this.set("packageBundleAliases",n)}doesPackageExist(t){return gnt.fs.existsSync(t)}validateKeys(){(0,_nt.ensureNoUppercaseKeys)(this.getPath())(e.BLOCKLIST)(this.toObject())}};gi.SfProjectJson=oc;var ED=class e{path;static instances=new Map;projectConfig;sfProjectJson;sfProjectJsonGlobal;packageDirectories;activePackage;packageAliases;packageBundleAliases;constructor(t){this.path=t}static clearInstances(){e.instances.clear()}static async resolve(t){let r=await this.resolveProjectPath(t??process.cwd());return this.getMemoizedInstance(r)}static getInstance(t){let r=this.resolveProjectPathSync(t??process.cwd());return this.getMemoizedInstance(r)}static async resolveProjectPath(t){return(0,SD.resolveProjectPath)(t)}static resolveProjectPathSync(t){return(0,SD.resolveProjectPathSync)(t)}static getMemoizedInstance(t){if(!e.instances.has(t)){let r=new e(t);e.instances.set(t,r)}return(0,hnt.ensure)(e.instances.get(t))}getPath(){return this.path}async retrieveSfProjectJson(t=!1){let r=oc.getDefaultOptions(t);return t?(this.sfProjectJsonGlobal||(this.sfProjectJsonGlobal=await oc.create(r)),this.sfProjectJsonGlobal):(r.rootFolder=this.getPath(),this.sfProjectJson||(this.sfProjectJson=await oc.create(r)),this.sfProjectJson)}getSfProjectJson(t=!1){let r=oc.getDefaultOptions(t);return t?(this.sfProjectJsonGlobal||(this.sfProjectJsonGlobal=new oc(r),this.sfProjectJsonGlobal.readSync()),this.sfProjectJsonGlobal):(r.rootFolder=this.getPath(),this.sfProjectJson||(this
|
|||
|
|
If you still see this error after enabling the Dev Hub feature, then re-authenticate to the org.`]])),iit=new Nle.Messages("@salesforce/core","scratchOrgErrorCodes",new Map([["SignupFailedError","The request to create a scratch org failed with error code: %s."],["SignupFailedUnknownError","An unknown server error occurred. Please try again. If you still see this error, contact Salesforce support for assistance. Include the information from 'sfdx force:data:record:get -s ScratchOrgInfo -i %s -u %s'."],["SignupFailedActionError","See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_error_codes.htm for information on error code %s."],["SignupUnexpectedError","The request to create a scratch org returned an unexpected status"],["StillInProgressError","The scratch org isn't ready yet (Status = %s)."],["action.StillInProgress","Wait for a few minutes, and then try the command again"],["NoScratchOrgInfoError","No ScratchOrgInfo object found in the Dev Hub you specified. Check that the ID and the Dev Hub are correct."],["ScratchOrgDeletedError","That scratch org has been deleted, so you can't connect to it anymore."],["INVALID_ID_FIELD","Provide a valid template ID, in the format 0TTxxxxxxxxxxxx."],["T-0002","We couldn\u2019t find a template or snapshot with the ID or name specified in the scratch org definition. If you\u2019re sure the ID is correct, contact Salesforce Support."],["T-0003","The template specified in the scratch org definition is unapproved. Contact Salesforce Support to request template approval."],["T-0004","The Trialforce Source Organization (TSO) for the template doesn\u2019t exist or has expired."],["S-1006","Provide a valid email address in your scratch org definition or your %s file."],["S-2006","Provide a valid country code in your scratch org definition or your %s file."],["S-1017","Specify a namespace that\u2019s used by a release org associated with your Dev Hub org."],["S-1018","Provide a valid My Domain value. This value can\u2019t include double hyphens, end in a hyphen, include restricted words, or be more than 40 characters long."],["S-1019","The My Domain value you chose is already in use."],["S-1026","Provide a valid namespace value. This value must begin with a letter. It can\u2019t include consecutive underscores, end in an underscore, be more than 15 characters long, or be a restricted or reserved namespace. Only alphanumeric characters and underscores are allowed."],["S-9999","A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance."],["SH-0001","Can\u2019t create scratch org. Contact the source org admin to add your Dev Hub org ID to Setup > Org Shape. Then try again."],["SH-0002","Can\u2019t create scratch org. No org shape exists for the specified sourceOrg. Create an org shape and try again."],["SH-0003","Can\u2019t create scratch org from org shape. The org shape version is outdated. Recreate the org shape and try again."],["C-1007","The username provided to the org:create command is already in use. Run 'force:org:list --clean' to remove stale org authentications or create the org with a different username."],["C-1015","We encountered a problem while registering your My Domain value with the DNS provider. Please try again."],["C-1016","We encountered a problem while attempting to configure and approve the Connected App for your org. Verify the Connected App configuration with your Salesforce admin."],["C-1017","Provide a valid namespace prefix. This value must begin with a letter. It can\u2019t include consecutive underscores, end in an underscore, be more than 15 characters long, or be a restricted or reserved namespace. Only alphanumeric characters and underscores are allowed."],["C-1020","We couldn't find a template with the ID specified in the scratch org definition. If you\u2019re sure the ID is correct, contact Salesforce Support."],["C-1027","The template specified in the Scratch Definition isn\u2019t supported. Specify a generic edition (such as Developer or Enterprise
|
|||
|
|
${(0,Jnt.inspect)(u)}`),c}}else throw c}return await l.save({devHubUsername:r.getUsername(),created:new Date(t.CreatedDate??new Date).valueOf().toString(),expirationDate:t.ExpirationDate,clientId:t.ConnectedAppConsumerKey,createdOrgInstance:t.SignupInstance,isDevHub:!1,isScratch:!0,isSandbox:!1,...t.Namespace?{namespacePrefix:t.Namespace}:{},...t.Snapshot?{snapshot:t.Snapshot}:{}}),l};wr.authorizeScratchOrg=lit;var cit=async e=>{let t=Object.keys(e).find(n=>n.toUpperCase()==="USERNAME");if(!t)return;let r=e[t];if(r&&r.length>0){try{await AD.AuthInfo.create({username:r.toLowerCase()})}catch(n){let i=ol.SfError.wrap(n);if(i.name==="NamedOrgNotFoundError")return;throw i}throw iit.createError("C-1007")}},uit=async(e,t,r)=>{if(!e.isDevHubOrg())throw MS.createError("hubOrgIsNotDevHub",[e.getUsername(),e.getOrgId()]);if(t.orgPreferences&&r.hasSettings())throw new ol.SfError("SignupDuplicateSettingsSpecifiedError");if(t.orgPreferences)throw new ol.SfError(MS.getMessage("DeprecatedPrefFormat"));let n=(0,tit.default)((0,sl.omit)(t,["settings","objectSettings"]),sl.upperFirst,!0);typeof n.Username=="string"&&(n.Username=n.Username.toLowerCase()),await cit(n);try{return await(0,DD.emit)({stage:"send request"}),await e.getConnection().sobject("ScratchOrgInfo").create(n)}catch(i){let a=i;throw a.errorCode==="REQUIRED_FIELD_MISSING"?new ol.SfError(MS.getMessage("SignupFieldsMissingError",[a.fields.toString()])):ol.SfError.wrap(a)}};wr.requestScratchOrgCreation=uit;var dit=async(e,t,r=sl.Duration.minutes(15))=>{let n=await sh.Logger.child("scratchOrgInfoApi-pollForScratchOrgInfo");n.debug(`PollingTimeout in minutes: ${r.minutes}`);let i={async poll(){try{let o=await(0,wr.queryScratchOrgInfo)(e,t);return n.debug(`polling client result: ${JSON.stringify(o,null,4)}`),o.Status==="Active"||o.Status==="Error"?{completed:!0,payload:o}:(await(0,DD.emit)({stage:"wait for org",scratchOrgInfo:o}),n.debug(`Scratch org status is ${o.Status}`),{completed:!1})}catch(o){return n.debug(`An error occurred trying to retrieve scratchOrgInfo for ${t}`),n.debug(`Error: ${o.message}`),n.debug("Re-trying deploy check again...."),{completed:!1}}},timeout:r,frequency:sl.Duration.seconds(1),timeoutErrorName:"ScratchOrgInfoTimeoutError"},a=await Ynt.PollingClient.create(i);try{let o=await a.subscribe();return await(0,nit.checkScratchOrgInfoForErrors)(o,e.getUsername())}catch(o){if(o instanceof Error){let s=ol.SfError.wrap(o);throw s.setData({username:e.getUsername(),orgId:e.getOrgId(),scratchOrgInfoId:t}),s}throw new ol.SfError(`The scratch org did not complete within ${r.minutes} minutes`,"orgCreationTimeout",["Try your force:org:create command again with a longer --wait value"])}};wr.pollForScratchOrgInfo=dit;var pit=async(e,t,r,n=sl.Duration.minutes(10))=>{let i=await sh.Logger.child("scratchOrgInfoApi-deploySettings");if(t.hasSettings()){i.debug(`deploying scratch org settings with apiVersion ${r}`);try{await t.createDeploy(),await t.deploySettingsViaFolder(e,r,n),await(0,wr.updateRevisionCounterToZero)(e),i.trace("Settings deployed to org")}catch(a){throw ol.SfError.wrap(a)}}};wr.deploySettings=pit;var fit=async e=>{let t=await sh.Logger.child("scratchOrgInfoApi-resolveUrl"),{instanceUrl:r}=e.getFields();if(!r)throw ol.SfError.create({message:"Org does not have instanceUrl",data:{orgId:e.getFields().orgId,username:e.getFields().username,instanceUrl:r}});t.debug(`processScratchOrgInfoResult - resultData.instanceUrl: ${r}`);let n={timeout:sl.Duration.minutes(3),frequency:sl.Duration.seconds(10),url:new Xnt.SfdcUrl(r)};try{return await(await Qnt.MyDomainResolver.create(n)).resolve(),e}catch(i){let a=ol.SfError.wrap(i);throw t.debug("processScratchOrgInfoResult - err: %s",i),a.name==="MyDomainResolverTimeoutError"&&(a.setData({orgId:e.getFields().orgId,username:e.getFields().username,instanceUrl:r}),t.debug("processScratchOrgInfoResult - err data: %s",a.data)),a}};wr.resolveUrl=fit;var mit=async e=>{let t=e.getConnection(),r=await t.tooling.sobject("SourceMember").find({RevisionCounter:{$gt:0}},["Id"]);if(r.length!==0)try{await Promise.all(r.map(n=>t.tooling.sob
|
|||
|
|
`,this.pretty=!0,(0,RS.isUndefined)(t.doubleQuotes)||(this.doubleQuotes=t.doubleQuotes),(0,RS.isUndefined)(t.indent)||(this.indent=t.indent),(0,RS.isUndefined)(t.newline)||(this.newline=t.newline),(0,RS.isUndefined)(t.pretty)||(this.pretty=t.pretty)}return e}();FS.StringOptions=wit});var $S=h($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.escapeDoubleQuotes=$a.escapeSingleQuotes=$a.escapeRightAngleBracketsInCdataTerminator=$a.escapeLeftAngleBrackets=$a.escapeAmpersands=void 0;function Sit(e){return e.replace(/&/g,"&")}$a.escapeAmpersands=Sit;function Eit(e){return e.replace(/</g,"<")}$a.escapeLeftAngleBrackets=Eit;function xit(e){return e.replace(/]]>/g,"]]>")}$a.escapeRightAngleBracketsInCdataTerminator=xit;function Oit(e){return e.replace(/'/g,"'")}$a.escapeSingleQuotes=Oit;function Cit(e){return e.replace(/"/g,""")}$a.escapeDoubleQuotes=Cit});var ND=h(kD=>{"use strict";Object.defineProperty(kD,"__esModule",{value:!0});var Tit=mn(),jle=$S(),LD=Nr(),Iit=function(){function e(t,r,n){this._validation=r,(0,LD.isUndefined)(n.replaceInvalidCharsInCharData)?this._replaceInvalidCharsInCharData=!1:this._replaceInvalidCharsInCharData=n.replaceInvalidCharsInCharData,this._parent=t,this.charData=n.charData}return Object.defineProperty(e.prototype,"charData",{get:function(){return this._charData},set:function(t){if(this._replaceInvalidCharsInCharData)t=(0,LD.fixChar)(t);else if(this._validation&&!(0,LD.validateChar)(t))throw new Error((0,Tit.getContext)(this.up())+": attribute text"+(' "'+t+'" should not contain characters not')+" allowed in XML");this._charData=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t=this._charData;return t=(0,jle.escapeAmpersands)(t),t=(0,jle.escapeLeftAngleBrackets)(t),t},e.prototype.up=function(){return this._parent},e}();kD.default=Iit});var US=h(jD=>{"use strict";Object.defineProperty(jD,"__esModule",{value:!0});var Ple=mn(),Mle=Nr(),Ait=function(){function e(t,r,n){this._hex=!1,this._validation=r,this._parent=t,this.char=n.char,(0,Mle.isUndefined)(n.hex)||(this.hex=n.hex)}return Object.defineProperty(e.prototype,"char",{get:function(){return this._char},set:function(t){if(this._validation&&!(0,Mle.validateSingleChar)(t))throw new Error((0,Ple.getContext)(this.up())+": character reference"+(' "'+t+'" should reference a single character,')+" and this character should be allowed in XML");this._char=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hex",{get:function(){return this._hex},set:function(t){this._hex=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var t;if(this._char.length===1)t=this._char.charCodeAt(0);else{var r=this._char.charCodeAt(0);if(r>=55296&&r<=56319&&this._char.length>1){var n=this._char.charCodeAt(1);if(n>=56320&&n<=57343)t=(r-55296)*1024+n-56320+65536;else throw new Error((0,Ple.getContext)(this.up())+": character"+(' reference "'+this.char+'" should')+" reference a valid Unicode character")}else t=r}return this._hex?"&#x"+t.toString(16)+";":"&#"+t+";"},e.prototype.up=function(){return this._parent},e}();jD.default=Ait});var zS=h(PD=>{"use strict";Object.defineProperty(PD,"__esModule",{value:!0});var Dit=mn(),Lit=Nr(),kit=function(){function e(t,r,n){this._validation=r,this._parent=t,this.name=n.name}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){if(this._validation&&!(0,Lit.validateName)(t))throw new Error((0,Dit.getContext)(this.up())+": entity reference name"+(' "'+t+'" should not contain characters not')+" allowed in XML names");this._name=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"&"+this._name+";"},e.prototype.up=function(){return this._parent},e}();PD.default=kit});var qS=h(vy=>{"use strict";var FD=vy&&vy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vy,"__esModule",{value:!0});var MD=mn(),Rle=$S(),Nit=ch(),RD=Nr(),jit=FD(ND()),Pit=FD(US()),Mit=FD(zS()),Rit=function(){function e(t,r,n){this._validation=r,(0,RD.isUndefined)(n.replaceInvalidCh
|
|||
|
|
\0`,k+=Lt(P,2),k+=s.magic,k+=Lt(v,2),k+=Lt(S,2),k+=Lt(j.crc32,4),k+=Lt(j.compressedSize,4),k+=Lt(j.uncompressedSize,4),k+=Lt(c.length,2),k+=Lt(E.length,2);var B=U5.LOCAL_FILE_HEADER+k+c+E,$=U5.CENTRAL_FILE_HEADER+Lt(N,2)+k+Lt(f.length,2)+"\0\0\0\0"+Lt(T,4)+Lt(n,4)+c+E+f;return{fileRecord:B,dirRecord:$}},Zct=function(e,t,r,n,i){var a="",o=Nh.transformTo("string",i(n));return a=U5.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Lt(e,2)+Lt(e,2)+Lt(t,4)+Lt(r,4)+Lt(o.length,2)+o,a},Hct=function(e){var t="";return t=U5.DATA_DESCRIPTOR+Lt(e.crc32,4)+Lt(e.compressedSize,4)+Lt(e.uncompressedSize,4),t};function To(e,t,r,n){jh.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Nh.inherits(To,jh);To.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,jh.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))};To.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Epe(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0};To.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Epe(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:Hct(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};To.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=Zct(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};To.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};To.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(r){t.error(r)}),this};To.prototype.resume=function(){if(!jh.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};To.prototype.error=function(e){var t=this._sources;if(!jh.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch{}return!0};To.prototype.lock=function(){jh.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};xpe.exports=To});var Tpe=h(Cpe=>{"use strict";var Gct=Fk(),Jct=Ope(),Kct=function(e,t){var r=e||t,n=Gct[r];if(!n)throw new Error(r+" is not a valid compression method !");return n};Cpe.generateWorker=function(e,t,r){var n=new Jct(t.streamFiles,r,t.platform,t.encodeFileName),i=0;try{e.forEach(function(a,o){i++;var s=Kct(o.options.compression,t.compression),l=o.options.compressionOptions||t.compressionOptions||{},c=o.dir,u=o.date;o._compressWorker(s,l).withStreamInfo("file",{name:a,dir:c,date:u,comment:o.comment||"",unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions}).pipe(n)}),n.entriesCount=i}catch(a){n.error(a)}return n}});var Ape=h((K8t,Ipe)=>{"use strict";var Xct=Jt(),z5=Qi();function ob(e,t){z5.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Xct.inherits(ob,z5);ob.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(r){t.push({data:r,meta:{per
|
|||
|
|
`);throw $ut.SfError.create({message:`A scratch org was created with username ${i??"<undefined>"}, but the settings failed to deploy due to:
|
|||
|
|
${m}`,name:"ProblemDeployingSettings",data:{...c,username:i}})}}async createDeployPackageContents(t){let r=(0,yn.createObjectFileContent)({allRecordTypes:this.allRecordTypes,allBusinessProcesses:this.allBusinessProcesses,apiVersion:t,settingData:this.settingData,objectSettingsData:this.objectSettingsData}),n=Yk.parse("Package",r);await this.writer.addToStore(n,this.packageFilePath),await this.writer.finalize()}getShapeDirName(){return this.shapeDirName}getDestinationPath(){return this.writer.getDestinationPath()}async writeObjectSettingsIfNeeded(t,r,n){this.objectSettingsData&&await Promise.all(Object.entries(this.objectSettingsData).map(([i,a])=>{let o=(0,yn.createRecordTypeAndBusinessProcessFileContent)(i,a,r,n,this.capitalizeRecordTypes),s=Yk.parse("CustomObject",o);return this.writer.addToStore(s,qp.join(t,(0,ta.upperFirst)(i)+".object"))}))}async writeSettingsIfNeeded(t){this.settingData&&await Promise.all(Object.entries(this.settingData).map(([r,n])=>{let i=(0,ta.upperFirst)(r),a=i.replace("Settings",""),o=Yk.parse(i,n);return this.writer.addToStore(o,qp.join(t,a+".settings"))}))}};yn.default=eN});var bfe=h(Z5=>{"use strict";Object.defineProperty(Z5,"__esModule",{value:!0});Z5.simpleFeaturesList=void 0;Z5.simpleFeaturesList=["AIAttribution","API","AccountInspection","AccountingSubledgerGrowthEdition","AccountingSubledgerStarterEdition","AccountingSubledgerUser","AdmissionsConnectUser","AdvisorLinkFeature","AdvisorLinkPathwaysFeature","AllUserIdServiceAccess","AnalyticsAdminPerms","AnalyticsAppEmbedded","ApexGuruCodeAnalyzer","ApexUserModeWithPermSet","ArcGraphCommunity","Assessments","AssociationEngine","AuthorApex","B2BCommerce","B2BLoyaltyManagement","B2CCommerceGMV","B2CLoyaltyManagement","B2CLoyaltyManagementPlus","BYOCCaaS","BYOOTT","BatchManagement","BenefitManagement","BigObjectsBulkAPI","BillingAdvanced","Briefcase","BudgetManagement","BusinessRulesEngine","CGAnalytics","CMSMaxContType","CMSMaxNodesPerContType","CMSUnlimitedUse","CPQ","CacheOnlyKeys","CampaignInfluence2","CascadeDelete","CaseClassification","CaseWrapUp","ChangeDataCapture","Chatbot","ChatterEmailFooterLogo","ChatterEmailFooterText","ChatterEmailSenderName","CloneApplication","Communities","CompareReportsOrgPerm","ConAppPluginExecuteAsUser","ConnectedAppCustomNotifSubscription","ConnectedAppToolingAPI","ConsentEventStream","ContactsToMultipleAccounts","ContractApprovals","ContractManagement","ContractMgmtInd","CoreCpq","CustomFieldDataTranslation","CustomNotificationType","CustomerDataPlatform","CustomerDataPlatformLite","CustomerExperienceAnalytics","DSARPortability","DataComDnbAccounts","DataComFullClean","DataMaskUser","DataProcessingEngine","DebugApex","DecisionTable","DefaultWorkflowUser","DeferSharingCalc","DevOpsCenter","DevelopmentWave","DeviceTrackingEnabled","DisableManageIdConfAPI","DisclosureFramework","Division","DocGen","DocGenDesigner","DocGenInd","DocumentChecklist","DocumentReaderPageLimit","DurableClassicStreamingAPI","DurableGenericStreamingAPI","DynamicClientCreationLimit","EAOutputConnectors","EASyncOut","EAndUDigitalSales","EAndUSelfServicePortal","ERMAnalytics","EdPredictionM3Threshold","EdPredictionTimeout","EdPredictionTimeoutBulk","EdPredictionTimeoutByomBulk","Einstein1AIPlatform","EinsteinAnalyticsPlus","EinsteinArticleRecommendations","EinsteinBuilderFree","EinsteinDocReader","EinsteinGPTForDevelopers","EinsteinRecommendationBuilder","EinsteinRecommendationBuilderMetadata","EinsteinSalesRepFdbk","EinsteinSearch","EinsteinVisits","EinsteinVisitsED","EmbeddedLoginForIE","EnableManageIdConfUI","EnablePRM","EnableSetPasswordInApi","Enablement","EnergyAndUtilitiesCloud","Entitlements","EntityTranslation","EventLogFile","ExcludeSAMLSessionIndex","Explainability","ExpressionSetMaxExecPerHour","ExternalIdentityLogin","FSCAlertFramework","FSCServiceProcess","FieldAuditTrail","FieldServiceMobileExtension","FinanceLogging","FinancialServicesInsuranceUser","FlowSites","ForceComPlatform","ForecastEnableCustomField","Functions","Fundraising","GenericStreaming","Grantmaking","GuidanceHubAllowed","HLSAnalytics","HealthCloudAddO
|
|||
|
|
`);return await Tfe.Lifecycle.getInstance().emitWarning(`Scratch org definition validation issues in ${t}:
|
|||
|
|
${n}`),e}return r.data},ydt=async e=>{try{let t=await sdt.fs.promises.readFile(e,"utf8"),r=(0,adt.parseJson)(t);delete r.$schema;let n=Cfe.ScratchOrgDefSchema.safeParse(r);if(n.success)return n.data;{let i=n.error.issues.map(a=>`${a.path.join(".")}: ${a.message}`).join(`
|
|||
|
|
`);return await Tfe.Lifecycle.getInstance().emitWarning(`Scratch org definition validation issues in ${e}:
|
|||
|
|
${i}`),r}}catch(t){let r=t;throw r.name==="JsonParseError"?new bl.SfError(`An error occurred parsing ${e}`):bl.SfError.wrap(r)}}});var sN=h(Ao=>{"use strict";var bdt=Ao&&Ao.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.scratchOrgCreate=Ao.scratchOrgResume=Ao.DEFAULT_STREAM_TIMEOUT_MINUTES=void 0;var Y5=He(),vdt=Ke(),_dt=bt(),aN=yt(),oN=rc(),Dfe=Du(),wdt=my(),Sdt=zf(),Edt=wt(),Q5=lh(),vc=ID(),Lfe=bdt(tN()),Afe=Ife(),xdt=sc(),Xu=yy(),kfe=PS(),Odt=TD(),cb=new _dt.Messages("@salesforce/core","scratchOrgCreate",new Map([["UnsupportedSnapshotOrgCreateOptionsError","Org snapshots don\u2019t support one or more options you specified: %s."],["DurationDaysValidationMinError","Expected 'durationDays' greater than or equal to %s but received %s."],["DurationDaysValidationMaxError","Expected 'durationDays' less than or equal to %s but received %s."],["DurationDaysNotIntError","Expected 'durationDays' to be an integer number."],["RetryNotIntError","Expected 'retry' to be an integer number."],["CacheMissError","The ScratchOrgInfoId %s was not found in the cache."]]));Ao.DEFAULT_STREAM_TIMEOUT_MINUTES=6;var Cdt=e=>{if(Number.isInteger(e)){if(e<1)throw cb.createError("DurationDaysValidationMinError",[1,e]);if(e>30)throw cb.createError("DurationDaysValidationMaxError",[30,e]);return}throw cb.createError("DurationDaysNotIntError")},Tdt=e=>{if(!Number.isInteger(e))throw cb.createError("RetryNotIntError")},Idt=async(e,t=Y5.Duration.minutes(15))=>{let[r,n]=await Promise.all([aN.Logger.child("scratchOrgResume"),kfe.ScratchOrgCache.create(),(0,Xu.emit)({stage:"send request"})]);r.debug(`resuming scratch org creation for jobId: ${e}`);let i=n.get(e,!0);if(!i)throw cb.createError("CacheMissError",[e]);let{hubUsername:a,apiVersion:o,clientSecret:s,signupTargetLoginUrlConfig:l,definitionjson:c,alias:u,setDefault:d,tracksSource:f}=i,p=l??await Nfe();p&&r.debug(`resuming org create with LoginUrl override= ${p}`);let m=await Q5.Org.create({aliasOrUsername:a}),y=await(0,Odt.validateScratchOrgInfoForResume)({jobId:e,hubOrg:m,cache:n,hubUsername:a,timeout:t}),v=y.Username??y.SignupUsername,E=await(await Sdt.StateAggregator.getInstance()).orgs.exists(v)?await xdt.AuthInfo.create({username:v}):await(0,vc.authorizeScratchOrg)({scratchOrgInfoComplete:y,hubOrg:m,clientSecret:s,signupTargetLoginUrl:p,retry:0});await e8(68)(E.handleAliasAndDefaultSettings({alias:u,setDefault:d??!1,setDefaultDevHub:!1,setTracksSource:f??!0}));let w=await Q5.Org.create({aliasOrUsername:v}),_=await oN.ConfigAggregator.create();await(0,Xu.emit)({stage:"deploy settings",scratchOrgInfo:y});let b=await jfe(),A=new Lfe.default({capitalizeRecordTypes:b});await A.extract({...y,...c});let[j]=await e8(68)(Promise.all([(0,vc.resolveUrl)(E),(0,vc.deploySettings)(w,A,o??_.getPropertyValue(Dfe.OrgConfigProperties.ORG_API_VERSION)??await w.retrieveMaxApiVersion())]));n.unset(y.Id??e);let P=j.getFields();return await Promise.all([(0,Xu.emit)({stage:"done",scratchOrgInfo:y}),n.write(),(0,Xu.emitPostOrgCreate)(P)]),{username:v,scratchOrgInfo:y,authInfo:j,authFields:P,warnings:[]}};Ao.scratchOrgResume=Idt;var Adt=async e=>{let t=await aN.Logger.child("scratchOrgCreate"),r=Date.now();t.debug("preparing scratch org signup request..."),await(0,Xu.emit)({stage:"prepare request"});let{hubOrg:n,connectedAppConsumerKey:i,durationDays:a=1,nonamespace:o,noancestors:s,wait:l=Y5.Duration.minutes(Ao.DEFAULT_STREAM_TIMEOUT_MINUTES),retry:c=0,apiversion:u,definitionjson:d,definitionfile:f,orgConfig:p,clientSecret:m=void 0,alias:y,setDefault:v=!1,tracksSource:S=!0}=e;Cdt(a),Tdt(c);let{scratchOrgInfoPayload:E,ignoreAncestorIds:w,warnings:_}=await(0,Afe.getScratchOrgInfoPayload)({definitionjson:d,definitionfile:f,connectedAppConsumerKey:i,durationDays:a,nonamespace:o,noancestors:s,orgConfig:p}),b=await(0,Afe.generateScratchOrgInfo)({hubOrg:n,scratchOrgInfoPayload:E,nonamespace:o,ignoreAncestorIds:w}),A=await jfe(),j=new Lfe.default({capitalizeRecordTypes:A}),P=await j.extract(b);t.debug(`the scratch org def file has settings: ${j.hasSettings
|
|||
|
|
|
|||
|
|
Due to: %s`],["jwtAuthError","Error authenticating with JWT config due to: %s"],["jwtAuthErrors",`Error authenticating with JWT.
|
|||
|
|
Errors encountered:
|
|||
|
|
%s`],["refreshTokenAuthError","Error authenticating with the refresh token due to: %s"],["invalidSfdxAuthUrlError",`Invalid SFDX authorization URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the "instanceUrl" inside the SFDX authorization URL doesn\\'t include the protocol ("https://"). Run "org display --target-org" on an org to see an example of an SFDX authorization URL.`],["orgDataNotAvailableError","An attempt to refresh the authentication token failed with a 'Data Not Found Error'. The org identified by username %s does not appear to exist. Likely cause is that the org was deleted by another user or has expired."],["orgDataNotAvailableError.actions",["Run `sfdx force:org:list --clean` to remove stale org authentications.","Use `sfdx force:config:set` to update the defaultusername.","Use `sfdx force:org:create` to create a new org.","Use `sfdx auth` to authenticate an existing org."]],["namedOrgNotFound","No authorization information found for %s."],["noAliasesFound","Nothing to set."],["invalidFormat","Setting aliases must be in the format <key>=<value> but found: [%s]."],["invalidJsonCasing",'All JSON input must have heads down camelcase keys. E.g., `{ sfdcLoginUrl: "https://login.salesforce.com" }`\nFound "%s" at %s'],["missingClientId","Client ID is required for JWT authentication."]]));function gN(e){let t=e.split("/"),r=t.pop(),n=t.pop();return{userId:r,orgId:n,url:e}}Pr.DEFAULT_CONNECTED_APP_INFO={clientId:"PlatformCLI",clientSecret:""};Pr.CODE_BUILDER_CONNECTED_APP_INFO={clientId:"CodeBuilder",clientSecret:""};var yN=class e extends $h.AsyncOptionalCreatable{usingAccessToken=!1;logger;stateAggregator;username;options;constructor(t){super(t),this.options=t??{}}static getDefaultInstanceUrl(){return fN.ConfigAggregator.getValue(n8.OrgConfigProperties.ORG_INSTANCE_URL)?.value??vl.SfdcUrl.PRODUCTION}static async listAllAuthorizations(t=r=>!!r){let r=await r8.StateAggregator.getInstance(),n=(await fN.ConfigAggregator.create()).getConfigInfo(),i=await r.orgs.readAll(),a=[];for(let o of i){let s=(0,Ct.ensureString)(o.username),l=r.aliases.getAll(s)??void 0,c=n.filter(u=>l.includes(u.value)||u.value===s).map(u=>u.key);try{let u=await e.create({username:s}),{orgId:d,instanceUrl:f,devHubUsername:p,expirationDate:m,isDevHub:y}=u.getFields();a.push({aliases:l,configs:c,username:s,instanceUrl:f,isScratchOrg:!!p,isDevHub:y??!1,isSandbox:await r.sandboxes.hasFile(d),orgId:d,accessToken:u.getConnectionOptions().accessToken,oauthMethod:u.isJwt()?"jwt":u.isOauth()?"web":"token",isExpired:p&&m?new Date((0,Ct.ensureString)(m)).getTime()<new Date().getTime():"unknown"})}catch(u){a.push({aliases:l,configs:c,username:s,orgId:o.orgId,instanceUrl:o.instanceUrl,accessToken:void 0,oauthMethod:"unknown",error:u.message,isExpired:"unknown"})}}return a.filter(t)}static async hasAuthentications(){try{let t=await(await r8.StateAggregator.getInstance()).orgs.list();return!(0,$h.isEmpty)(t)}catch(t){let r=t;if(r.name==="OrgDataNotAvailableError"||r.code==="ENOENT")return!1;throw r}}static getAuthorizationUrl(t,r){let n=r??new pb.OAuth2({useVerifier:!0,...t}),i={state:t.state??(0,Hdt.randomBytes)(Math.ceil(6)).toString("hex"),prompt:"login",scope:t.scope??$h.env.getString("SFDX_AUTH_SCOPES","refresh_token api web")};return n.getAuthorizationUrl(i)}static parseSfdxAuthUrl(t){let r=t.match(/^force:\/\/([a-zA-Z0-9._-]+={0,2}):([a-zA-Z0-9._-]*={0,2}):([a-zA-Z0-9._-]+={0,2})@([a-zA-Z0-9:._-]+)/);if(!r)throw new Ec.SfError(ko.getMessage("invalidSfdxAuthUrlError"),"INVALID_SFDX_AUTH_URL");let[,n,i,a,o]=r;return{clientId:n,clientSecret:i,refreshToken:a,loginUrl:`https://${o}`}}static async identifyPossibleScratchOrgs(t,r){let n=await mN.Logger.child("Common",{tag:"identifyPossibleScratchOrgs"});if(await(0,Vfe.determineOrg)(r),t.isDevHub||t.devHubUsername||!t.orgId)return;n.debug("getting devHubs and prod orgs to identify scratch orgs and sandboxes");let i=await e.getDevHubAuthInfos(),a=await e.listAllAuthorizations(o=>o&&!o.isScratchOrg&&!o.isSandbox);n.debug(`found ${i.length} DevHubs`),n.debug(
|
|||
|
|
`)]),"JwtAuthError");let u={accessToken:(0,Ct.asString)(s.access_token),orgId:gN((0,Ct.ensureString)(s.id)).orgId,loginUrl:t.loginUrl,privateKey:t.privateKey,clientId:t.clientId},d=(0,Ct.ensureString)(s.instance_url),f=new vl.SfdcUrl(d);try{await f.lookup(),u.instanceUrl=d}catch{this.logger.debug(`Instance URL [${s.instance_url}] is not available. DNS lookup failed. Using loginUrl [${t.loginUrl}] instead. This may result in a "Destination URL not reset" error.`),u.instanceUrl=t.loginUrl}return u}async tryJwtAuth(t,r,n,i){let a=Jdt.sign({iss:t,sub:this.getUsername(),aud:n,exp:Date.now()+300},i,{algorithm:"RS256"}),o=new pb.OAuth2({loginUrl:r});return(0,Ct.ensureJsonMap)(await o.requestToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:a}))}async buildRefreshTokenConfig(t){let r={...t,redirectUri:t.redirectUri??this.getRedirectUri(),...t.clientId?{}:{clientId:Pr.DEFAULT_CONNECTED_APP_INFO.clientId,clientSecret:Pr.DEFAULT_CONNECTED_APP_INFO.clientSecret}},n=new pb.OAuth2(r),i;try{i=await n.refreshToken((0,Ct.ensure)(r.refreshToken))}catch(s){let l=s instanceof Error?s:Ec.SfError.wrap(s);throw ko.createError("refreshTokenAuthError",[l.message],void 0,l)}let{orgId:a}=gN(i.id),o=this.getUsername();if(!o){let s=await this.retrieveUserInfo(i.instance_url,i.access_token);o=(0,Ct.ensureString)(s?.username)}return{orgId:a,username:o,accessToken:i.access_token,instanceUrl:i.instance_url,loginUrl:r.loginUrl??i.instance_url,refreshToken:r.refreshToken,clientId:r.clientId,clientSecret:r.clientSecret}}async exchangeToken(t,r=new pb.OAuth2(t)){r.redirectUri||(r.redirectUri=this.getRedirectUri()),r.clientId||(r.clientId=this.getClientId());let n;try{this.logger.debug(`Exchanging auth code for access token using loginUrl: ${t.loginUrl??"<undefined>"}`),n=await r.requestToken((0,Ct.ensure)(t.authCode)),this.logger.debug(`Successfully requested an access token with scopes: "${n.scope}".`)}catch(o){let s=o instanceof Error?`${o.name}::${o.message}`:typeof o=="string"?o:"UNKNOWN",l=(0,Xdt.filterSecrets)(t);throw Ec.SfError.create({message:ko.getMessage("authCodeExchangeError",[s]),name:"AuthCodeExchangeError",...o instanceof Error?{cause:o}:{},data:(0,Ct.isArray)(l)?l[0]:l})}let{orgId:i}=gN(n.id),a=this.getUsername();return a||(a=(await this.retrieveUserInfo(n.instance_url,n.access_token))?.username),{accessToken:n.access_token,instanceUrl:n.instance_url,orgId:i,username:a,loginUrl:t.loginUrl??n.instance_url,refreshToken:n.refresh_token,clientId:t.clientId,clientSecret:t.clientSecret}}async retrieveUserInfo(t,r){let n="v51.0",i=(0,Ct.ensure)(t),a=new vl.SfdcUrl(i),o=`${a.toString()}services/oauth2/userinfo`,s=Object.assign({Authorization:`Bearer ${r}`},Bfe.SFDX_HTTP_HEADERS);try{this.logger.info(`Sending request for Username after successful auth code exchange to URL: ${o}`);let l=await new pN.default().httpRequest({url:o,method:"GET",headers:s});if(l.statusCode>=400)this.throwUserGetException(l);else{let c=(0,$h.parseJsonMap)(l.body),u=`${a.toString()}services/data/${n}/sobjects/User/${c.user_id}`;return this.logger.info(`Sending request for User SObject after successful auth code exchange to URL: ${u}`),l=await new pN.default().httpRequest({url:u,method:"GET",headers:s}),l.statusCode>=400?this.throwUserGetException(l):c.preferred_username=(0,$h.parseJsonMap)(l.body).Username,{username:c.preferred_username,organizationId:c.organization_id}}}catch(l){throw ko.createError("authCodeUsernameRetrievalError",[l.message])}}throwUserGetException(t){let r="",n=t.body??JSON.stringify({message:"UNKNOWN",errorCode:"UNKNOWN"});try{let i=(0,$h.parseJson)(n);(0,Ct.isArray)(i)?r=i.map(a=>a.message??a.errorCode??"UNKNOWN").join(Gdt.EOL):r=i.message??i.errorCode??"UNKNOWN"}catch{r=`${n}`}throw new Ec.SfError(r)}async determineIfDevHub(t,r){let n="v51.0",i=(0,Ct.ensure)(t),o=`${new vl.SfdcUrl(i).toString()}/services/data/${n}/query?q=SELECT%20Id%20FROM%20ScratchOrgInfo%20limit%201`,s=Object.assign({Authorization:`Bearer ${r}`},Bfe.SFDX_HTTP_HEADERS);try{return!((await new pN.default().httpRequest({url:o,method:"GET",headers:s})).statusC
|
|||
|
|
`:""},this._extScope=t,this._scope=new No.Scope({parent:t}),this._nodes=[new jN]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let a=this._scope.toName(r);return n!==void 0&&i&&(this._constants[a.str]=n),this._leafNode(new IN(t,a,n)),a}const(t,r,n){return this._def(No.varKinds.const,t,r,n)}let(t,r,n){return this._def(No.varKinds.let,t,r,n)}var(t,r,n){return this._def(No.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new f8(t,r,n))}add(t,r){return this._leafNode(new AN(t,Ue.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==et.nil&&this._leafNode(new NN(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,et.addCodeArg)(r,i));return r.push("}"),new et._Code(r)}if(t,r,n){if(this._blockNode(new Vp(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Vp(t))}else(){return this._elseNode(new zh)}endIf(){return this._endBlockNode(Vp,zh)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new PN(t),r)}forRange(t,r,n,i,a=this.opts.es5?No.varKinds.var:No.varKinds.let){let o=this._scope.toName(t);return this._for(new MN(a,o,r,n),()=>i(o))}forOf(t,r,n,i=No.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let o=r instanceof et.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,et._)`${o}.length`,s=>{this.var(a,(0,et._)`${o}[${s}]`),n(a)})}return this._for(new m8("of",i,a,r),()=>n(a))}forIn(t,r,n,i=this.opts.es5?No.varKinds.var:No.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,et._)`Object.keys(${r})`,n);let a=this._scope.toName(t);return this._for(new m8("in",i,a,r),()=>n(a))}endFor(){return this._endBlockNode(Wp)}label(t){return this._leafNode(new DN(t))}break(t){return this._leafNode(new LN(t))}return(t){let r=new bb;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(bb)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new RN;if(this._blockNode(i),this.code(t),r){let a=this.name("e");this._currNode=i.catch=new vb(a),r(a)}return n&&(this._currNode=i.finally=new _b,this.code(n)),this._endBlockNode(vb,_b)}throw(t){return this._leafNode(new kN(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=et.nil,n,i){return this._blockNode(new yb(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(yb)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Vp))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Ue.CodeGen=FN;function Zp(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function h8(e,t){return t in
|
|||
|
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(s,(0,Pe._)`+${i}`);return;case"integer":n.elseIf((0,Pe._)`${o} === "boolean" || ${i} === null
|
|||
|
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(s,(0,Pe._)`+${i}`);return;case"boolean":n.elseIf((0,Pe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(s,!1).elseIf((0,Pe._)`${i} === "true" || ${i} === 1`).assign(s,!0);return;case"null":n.elseIf((0,Pe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(s,null);return;case"array":n.elseIf((0,Pe._)`${o} === "string" || ${o} === "number"
|
|||
|
|
|| ${o} === "boolean" || ${i} === null`).assign(s,(0,Pe._)`[${i}]`)}}}function mft({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Pe._)`${t} !== undefined`,()=>e.assign((0,Pe._)`${t}[${r}]`,n))}function ZN(e,t,r,n=Wh.Correct){let i=n===Wh.Correct?Pe.operators.EQ:Pe.operators.NEQ,a;switch(e){case"null":return(0,Pe._)`${t} ${i} null`;case"array":a=(0,Pe._)`Array.isArray(${t})`;break;case"object":a=(0,Pe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=o((0,Pe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=o();break;default:return(0,Pe._)`typeof ${t} ${i} ${e}`}return n===Wh.Correct?a:(0,Pe.not)(a);function o(s=Pe.nil){return(0,Pe.and)((0,Pe._)`typeof ${t} == "number"`,s,r?(0,Pe._)`isFinite(${t})`:Pe.nil)}}Pn.checkDataType=ZN;function HN(e,t,r,n){if(e.length===1)return ZN(e[0],t,r,n);let i,a=(0,Sme.toHash)(e);if(a.array&&a.object){let o=(0,Pe._)`typeof ${t} != "object"`;i=a.null?o:(0,Pe._)`!${t} || ${o}`,delete a.null,delete a.array,delete a.object}else i=Pe.nil;a.number&&delete a.integer;for(let o in a)i=(0,Pe.and)(i,ZN(o,t,r,n));return i}Pn.checkDataTypes=HN;var hft={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Pe._)`{type: ${e}}`:(0,Pe._)`{type: ${t}}`};function GN(e){let t=gft(e);(0,cft.reportError)(t,hft)}Pn.reportTypeError=GN;function gft(e){let{gen:t,data:r,schema:n}=e,i=(0,Sme.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var Cme=h(b8=>{"use strict";Object.defineProperty(b8,"__esModule",{value:!0});b8.assignDefaults=void 0;var Zh=Be(),yft=it();function bft(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)Ome(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,a)=>Ome(e,a,i.default))}b8.assignDefaults=bft;function Ome(e,t,r){let{gen:n,compositeRule:i,data:a,opts:o}=e;if(r===void 0)return;let s=(0,Zh._)`${a}${(0,Zh.getProperty)(t)}`;if(i){(0,yft.checkStrictMode)(e,`default is ignored for: ${s}`);return}let l=(0,Zh._)`${s} === undefined`;o.useDefaults==="empty"&&(l=(0,Zh._)`${l} || ${s} === null || ${s} === ""`),n.if(l,(0,Zh._)`${s} = ${(0,Zh.stringify)(r)}`)}});var Za=h(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.validateUnion=St.validateArray=St.usePattern=St.callValidateCode=St.schemaProperties=St.allSchemaProperties=St.noPropertyInData=St.propertyInData=St.isOwnProperty=St.hasPropFunc=St.reportMissingProp=St.checkMissingProp=St.checkReportMissingProp=void 0;var Ft=Be(),JN=it(),rd=Cc(),vft=it();function _ft(e,t){let{gen:r,data:n,it:i}=e;r.if(XN(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ft._)`${t}`},!0),e.error()})}St.checkReportMissingProp=_ft;function wft({gen:e,data:t,it:{opts:r}},n,i){return(0,Ft.or)(...n.map(a=>(0,Ft.and)(XN(e,t,a,r.ownProperties),(0,Ft._)`${i} = ${a}`)))}St.checkMissingProp=wft;function Sft(e,t){e.setParams({missingProperty:t},!0),e.error()}St.reportMissingProp=Sft;function Tme(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ft._)`Object.prototype.hasOwnProperty`})}St.hasPropFunc=Tme;function KN(e,t,r){return(0,Ft._)`${Tme(e)}.call(${t}, ${r})`}St.isOwnProperty=KN;function Eft(e,t,r,n){let i=(0,Ft._)`${t}${(0,Ft.getProperty)(r)} !== undefined`;return n?(0,Ft._)`${i} && ${KN(e,t,r)}`:i}St.propertyInData=Eft;function XN(e,t,r,n){let i=(0,Ft._)`${t}${(0,Ft.getProperty)(r)} === undefined`;return n?(0,Ft.or)(i,(0,Ft.not)(KN(e,t,r))):i}St.noPropertyInData=XN;function Ime(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}St.allSchemaProperties=Ime;function xft(e,t){return Ime(t).filter(r=>!(0,JN.alwaysValidSchema)(e,t[r]))}St.schemaProperties=xft;function Oft({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:a},it:o},s,l,c){let u=c?(0,Ft._)`${e}, ${t}, ${n}${i}`:t,d=[[rd.default.instancePath,(0,Ft.strConcat)(rd.default.instancePath,a)],[rd.default.parentData,o.parentData],[rd.default.parentDataProperty,o.parentDataProperty],[rd.default.rootData,rd.default.rootDat
|
|||
|
|
missingProperty: ${n},
|
|||
|
|
depsCount: ${t},
|
|||
|
|
deps: ${r}}`};var H1t={keyword:"dependencies",type:"object",schemaType:"object",error:Sl.error,code(e){let[t,r]=G1t(e);n1e(e,t),i1e(e,r)}};function G1t({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function n1e(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let a=r.let("missing");for(let o in t){let s=t[o];if(s.length===0)continue;let l=(0,Ub.propertyInData)(r,n,o,i.opts.ownProperties);e.setParams({property:o,depsCount:s.length,deps:s.join(", ")}),i.allErrors?r.if(l,()=>{for(let c of s)(0,Ub.checkReportMissingProp)(e,c)}):(r.if((0,qj._)`${l} && (${(0,Ub.checkMissingProp)(e,s,a)})`),(0,Ub.reportMissingProp)(e,a),r.else())}}Sl.validatePropertyDeps=n1e;function i1e(e,t=e.schema){let{gen:r,data:n,keyword:i,it:a}=e,o=r.name("valid");for(let s in t)(0,Z1t.alwaysValidSchema)(a,t[s])||(r.if((0,Ub.propertyInData)(r,n,s,a.opts.ownProperties),()=>{let l=e.subschema({keyword:i,schemaProp:s},o);e.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),e.ok(o))}Sl.validateSchemaDeps=i1e;Sl.default=H1t});var s1e=h(Bj=>{"use strict";Object.defineProperty(Bj,"__esModule",{value:!0});var o1e=Be(),J1t=it(),K1t={message:"property name must be valid",params:({params:e})=>(0,o1e._)`{propertyName: ${e.propertyName}}`},X1t={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:K1t,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,J1t.alwaysValidSchema)(i,r))return;let a=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},a),t.if((0,o1e.not)(a),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(a)}};Bj.default=X1t});var Wj=h(Vj=>{"use strict";Object.defineProperty(Vj,"__esModule",{value:!0});var M8=Za(),Mo=Be(),Y1t=Cc(),R8=it(),Q1t={message:"must NOT have additional properties",params:({params:e})=>(0,Mo._)`{additionalProperty: ${e.additionalProperty}}`},egt={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Q1t,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:a,it:o}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:s,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,R8.alwaysValidSchema)(o,r))return;let c=(0,M8.allSchemaProperties)(n.properties),u=(0,M8.allSchemaProperties)(n.patternProperties);d(),e.ok((0,Mo._)`${a} === ${Y1t.default.errors}`);function d(){t.forIn("key",i,v=>{!c.length&&!u.length?m(v):t.if(f(v),()=>m(v))})}function f(v){let S;if(c.length>8){let E=(0,R8.schemaRefOrVal)(o,n.properties,"properties");S=(0,M8.isOwnProperty)(t,E,v)}else c.length?S=(0,Mo.or)(...c.map(E=>(0,Mo._)`${v} === ${E}`)):S=Mo.nil;return u.length&&(S=(0,Mo.or)(S,...u.map(E=>(0,Mo._)`${(0,M8.usePattern)(e,E)}.test(${v})`))),(0,Mo.not)(S)}function p(v){t.code((0,Mo._)`delete ${i}[${v}]`)}function m(v){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){p(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,R8.alwaysValidSchema)(o,r)){let S=t.name("valid");l.removeAdditional==="failing"?(y(v,S,!1),t.if((0,Mo.not)(S),()=>{e.reset(),p(v)})):(y(v,S),s||t.if((0,Mo.not)(S),()=>t.break()))}}function y(v,S,E){let w={keyword:"additionalProperties",dataProp:v,dataPropType:R8.Type.Str};E===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,S)}}};Vj.default=egt});var u1e=h(Hj=>{"use strict";Object.defineProperty(Hj,"__esModule",{value:!0});var tgt=Cb(),l1e=Za(),Zj=it(),c1e=Wj(),rgt={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:a}=e;a.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&c1e.default.code(new tgt.KeywordCxt(a,c1e.default,"additionalProperties"));let o=(0,l1e.allSchemaProperties)(r);for(let d of o)a.definedProperties.add(d);a.opts.unevaluated&&o.length&&a.props!==!0&&(a.props=Zj.mergeEvaluated.props(t,(0,Zj.toHash)(o),a.props));let s=o.filter(d=>!(0,Zj.alwaysValidSchema)(
|
|||
|
|
${l}`,"ValidationSchemaFieldError")}else throw new cP.SfError("Unknown schema validation error","ValidationSchemaUnknownError");return o}loadExternalSchemas(t){return(0,B8.getJsonValuesByName)(t,"$ref").map(r=>r&&RegExp(/([\w\.]+)#/).exec(r)).map(r=>r?.[1]).filter(r=>!!r).map(r=>this.loadExternalSchema(r))}loadExternalSchema(t){let r=M1e.join(this.schemasDir,`${t}.json`);try{return(0,B8.parseJsonMap)(lP.fs.readFileSync(r,"utf8"))}catch(n){throw n.code==="ENOENT"?new cP.SfError(`Schema not found: ${r}`,"ValidationSchemaNotFound"):n}}getErrorsText(t){return t.map(r=>{let n=`${r.schemaPath}: ${r.message??"<no error message>"}`;switch(r.keyword){case"additionalProperties":return`${n} '${r.params.additionalProperty}'`;case"enum":return`${n} '${r.params.allowedValues.join(", ")}'`;default:return n}}).join(`
|
|||
|
|
`)}};Ja.SchemaValidator=uP});var F1e=h(V8=>{"use strict";Object.defineProperty(V8,"__esModule",{value:!0});V8.CometClient=void 0;var o0t=require("node:events"),dP=class extends o0t.EventEmitter{};V8.CometClient=dP});var z1e=h(Ic=>{"use strict";var s0t=Ic&&Ic.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.StreamingClient=Ic.CometClient=void 0;var l0t=require("node:url"),n1=He(),pP=Ke(),fP=s0t(VI()),U1e=yt(),W8=wt(),c0t=bt(),u0t=F1e();Object.defineProperty(Ic,"CometClient",{enumerable:!0,get:function(){return u0t.CometClient}});var zb=new c0t.Messages("@salesforce/core","streaming",new Map([["genericTimeout","Socket timeout occurred while listening for results."],["genericHandshakeTimeout","The streaming request failed to handshake at %s."],["handshakeApiVersionError","Invalid API version specified for streaming connection handshake: %s"],["handshakeApiVersionError.actions",["Set the API version to match the org as an environment variable (e.g., SFDX_API_VERSION=XX.0)."]],["waitParamValidValueError","Invalid value was specified for wait. Please provide a wait value greater than %s minutes."],["invalidApiVersion","Invalid api version is being reported by config (apiVersion=%s)."]]));function $1e(e,t){if(e.milliseconds>=t.milliseconds)return e;throw zb.createError("waitParamValidValueError",[t.minutes])}var qb=class e extends n1.AsyncOptionalCreatable{targetUrl;options;logger;cometClient;constructor(t){super(t),this.options=(0,pP.ensure)(t);let r=(0,pP.ensure)(this.options.org.getConnection().getAuthInfoFields().instanceUrl);this.targetUrl=(0,l0t.resolve)(r,`cometd/${this.options.apiVersion}`),this.cometClient=this.options.streamingImpl.getCometClient(this.targetUrl),this.options.streamingImpl.setLogger(this.log.bind(this)),this.cometClient.on("transport:up",()=>this.log("Transport up event received")),this.cometClient.on("transport:down",()=>this.log("Transport down event received")),this.cometClient.addExtension({incoming:this.incoming.bind(this)}),this.cometClient.disable("websocket")}async init(){let t=this.options.org.getConnection();this.options.apiVersion=this.options.apiVersion||t.getApiVersion(),this.logger=await U1e.Logger.child(this.constructor.name),await this.options.org.refreshAuth();let r=t.getConnectionOptions().accessToken;if(r&&r.length>5)this.logger.debug(`accessToken: XXXXXX${r.substring(r.length-5,r.length-1)}`),this.cometClient.setHeader("Authorization",`OAuth ${r}`);else throw new W8.SfError("Missing or invalid access token","MissingOrInvalidAccessToken");this.log(`Streaming client target url: ${this.targetUrl}`),this.log(`options.subscribeTimeout (ms): ${this.options.subscribeTimeout.milliseconds}`),this.log(`options.handshakeTimeout (ms): ${this.options.handshakeTimeout.milliseconds}`)}replay(t){this.cometClient.addExtension({outgoing:(r,n)=>{if(r.channel==="/meta/subscribe"){r.ext||(r.ext={});let i={};i[this.options.channel]=t,(0,n1.set)(r,"ext.replay",i)}n(r)}})}handshake(){let t;return new Promise((r,n)=>{t=setTimeout(()=>{let i=zb.createError("genericHandshakeTimeout",[this.targetUrl]);this.doTimeout(t,i),n(i)},this.options.handshakeTimeout.milliseconds),this.cometClient.handshake(()=>{this.log("handshake completed"),clearTimeout(t),this.log("cleared handshake timeout"),r(e.ConnectionState.CONNECTED)})})}subscribe(t){let r;return new Promise((n,i)=>new Promise((a,o)=>{r=setTimeout(()=>{let l=zb.createError("genericTimeout");this.doTimeout(r,l),i(l)},this.options.subscribeTimeout.milliseconds);let s=this.cometClient.subscribe(this.options.channel,l=>{try{let c=this.options.streamProcessor(l);c?.completed&&(clearTimeout(r),this.disconnectClient(),n(c.payload))}catch(c){clearTimeout(r),this.disconnectClient(),i(c)}});s.callback(()=>{a()}),s.errback(l=>{o(l)})}).then(()=>t?.()).catch(a=>{this.disconnect(),clearTimeout(r),i(a)}))}incoming(t,r){if(this.log(t),t&&t.channel==="/meta/handshake"&&t.error&&(0,pP.ensureString)(t.error).includes("400::API version in the URI is mandatory"))throw zb.createError("handshakeApiVersionError",
|
|||
|
|
`)}function wP(e,t){return e===404&&/Server definition not found/i.test(t||"")?"inactive":e===401||e===403?"auth":e>=200&&e<300||e===202?"ok":"unreachable"}function Y8(e,t){return`${e||""}::${t||""}`}function i1({slug:e,state:t,detail:r,source:n,httpStatus:i,org:a}){if(Vb.existsSync("sfdx-project.json"))try{let o=oge.join(process.cwd(),".sf","mcp-health");Vb.mkdirSync(o,{recursive:!0});let s={slug:e,state:t,detail:r||null,source:n,httpStatus:typeof i=="number"?i:null,checkedAt:new Date().toISOString(),org:a||null};Vb.writeFileSync(oge.join(o,`${e}.json`),JSON.stringify(s))}catch(o){xr(`failed to write health sidecar for '${e}': ${o&&o.message||o}`)}}async function fge(){let e=process.env.SF_TARGET_ORG||process.env.SFDX_TARGET_ORG;if(e)return e;let t=await K0t.create();await t.reload();let r=t.getInfo(X0t.TARGET_ORG);return r&&r.value?String(r.value):null}async function oyt(e,t){dge.clearInstance();let n=(await uge.create({aliasOrUsername:t})).getConnection(),i=pge(e,n.instanceUrl),a=await Q8(n);return{connection:n,upstreamUrl:i,jwt:a,instanceUrl:n.instanceUrl}}function Lc(e){process.stdout.write(JSON.stringify(e)+`
|
|||
|
|
`)}function syt(e){try{let t=JSON.parse(e);return typeof t.method=="string"?t.method:null}catch{return null}}function sge(e,t,r){try{let n=JSON.parse(e);n.id!==void 0&&n.id!==null&&Lc({jsonrpc:"2.0",id:n.id,error:{code:t,message:r}})}catch{}}async function tf(e,t,r,n){let i={"Content-Type":"application/json",Accept:"application/json, text/event-stream",Authorization:`Bearer ${t}`};return r&&(i["Mcp-Session-Id"]=r),fetch(e,{method:"POST",headers:i,body:n})}async function lyt(e){let t=await e.text();if(!t.trim())return;let r;try{r=JSON.parse(t)}catch{xr(`upstream returned non-JSON body: ${t.slice(0,200)}`);return}if(Array.isArray(r))for(let n of r)Lc(n);else Lc(r)}async function cyt(e){let t="";for await(let r of e.body){t+=typeof r=="string"?r:Buffer.from(r).toString("utf8");let n;for(;(n=t.indexOf(`
|
|||
|
|
|
|||
|
|
`))>=0;){let i=t.slice(0,n);t=t.slice(n+2);let a=[];for(let s of i.split(`
|
|||
|
|
`))s.startsWith("data:")&&a.push(s.slice(5).replace(/^ /,""));if(a.length===0)continue;let o=a.join(`
|
|||
|
|
`);try{Lc(JSON.parse(o))}catch{xr(`SSE event with non-JSON data: ${o.slice(0,200)}`)}}}}async function lge(e){xr(`inactive: ${e} \u2014 serving an empty (zero-tool) MCP session so the client shows no connection error`);let t=cge.createInterface({input:process.stdin});for await(let r of t){if(!r.trim())continue;let n;try{n=JSON.parse(r)}catch{continue}let{id:i,method:a}=n;if(i!=null)if(a==="initialize"){let o=n.params&&n.params.protocolVersion;Lc({jsonrpc:"2.0",id:i,result:{protocolVersion:o||"2025-06-18",capabilities:{tools:{}},serverInfo:{name:"sf-mcp-proxy (inactive)",version:"0.1.0"}}})}else Lc(a==="tools/list"?{jsonrpc:"2.0",id:i,result:{tools:[]}}:a==="ping"?{jsonrpc:"2.0",id:i,result:{}}:{jsonrpc:"2.0",id:i,error:{code:-32601,message:"sf-mcp-proxy inactive in this context (no tools available)"}})}}async function uyt(e,t){let r=e.headers.get("mcp-session-id");if(r&&t(r),e.status===202)return;let n=(e.headers.get("content-type")||"").toLowerCase();if(n.startsWith("application/json")){await lyt(e);return}if(n.startsWith("text/event-stream")){await cyt(e);return}let i=await e.text();if(i.trim())try{Lc(JSON.parse(i))}catch{xr(`unexpected content-type "${n}", body: ${i.slice(0,200)}`)}}async function mge(e){let t=null;if(!Vb.existsSync("sfdx-project.json"))return{session:null,org:t,state:"env-not-ready",detail:"no sfdx-project.json in cwd \u2014 not a Salesforce project"};try{t=await fge()}catch(a){return{session:null,org:t,state:"unreachable",detail:a&&a.message||String(a)}}if(!t)return{session:null,org:t,state:"env-not-ready",detail:"No target org. Set one with: sf config set target-org <alias>"};let r;try{dge.clearInstance(),r=(await uge.create({aliasOrUsername:t})).getConnection()}catch(a){return{session:null,org:t,state:"unreachable",detail:a&&a.message||String(a)}}if(!r.instanceUrl)return{session:null,org:t,state:"env-not-ready",detail:"could not resolve an instance URL for the target org"};let n=pge(e,r.instanceUrl),i;try{i=await Q8(r)}catch(a){return{session:null,org:t,state:"auth",detail:a&&a.message||String(a)}}return{session:{connection:r,upstreamUrl:n,jwt:i},org:t,state:null,detail:null}}async function dyt(e){if(!e){xr("Usage: sf-mcp-proxy --probe <platform-mcp-slug>"),process.exit(2);return}let t=null,r=await mge(e),n=r.org,i=r.state,a=r.detail;if(r.session)try{let o=JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"sf-mcp-proxy-probe",version:"0.1.0"}}}),s=await tf(r.session.upstreamUrl,r.session.jwt,null,o);t=s.status;let l=await s.text().catch(()=>"");i=wP(s.status,l),a=`HTTP ${s.status}${l.trim()?` ${l.trim().slice(0,200)}`:""}`}catch(o){i="unreachable",a=o&&o.message||String(o)}i1({slug:e,state:i,detail:a,source:"probe",httpStatus:t,org:n}),process.stdout.write(`${JSON.stringify({slug:e,state:i,detail:a,httpStatus:t,org:n})}
|
|||
|
|
`,()=>process.exit(0))}async function pyt(){if(process.argv[2]==="--probe"){await dyt(process.argv[3]);return}let e=process.argv[2];if(e||(xr("Usage: sf-mcp-proxy <platform-mcp-slug>"),process.exit(2)),!Vb.existsSync("sfdx-project.json")){i1({slug:e,state:"env-not-ready",detail:"no sfdx-project.json in cwd \u2014 not a Salesforce project",source:"live",httpStatus:null,org:null}),await lge("no sfdx-project.json in cwd \u2014 not a Salesforce project");return}let t=await mge(e),r=t.session,n=t.org;if(!r){i1({slug:e,state:t.state,detail:t.detail,source:"live",httpStatus:null,org:n}),await lge(`failed to initialize (${t.state}): ${t.detail}`);return}xr(`bridging stdio <-> ${r.upstreamUrl} (org: ${n})`);let i=null,a=f=>{i=f},o=null,s=null,l=null;async function c(){if(!s)return!1;let f=await tf(r.upstreamUrl,r.jwt,null,s);if(f.status===401&&(r.jwt=await Q8(r.connection),f=await tf(r.upstreamUrl,r.jwt,null,s)),!f.ok&&f.status!==202){let m=await f.text().catch(()=>"");return xr(`initialize replay failed: upstream ${f.status}: ${m.slice(0,200)}`),!1}let p=f.headers.get("mcp-session-id");return p&&a(p),await f.text().catch(()=>{}),l&&i&&await tf(r.upstreamUrl,r.jwt,i,l).catch(m=>xr(`initialized-notification replay failed: ${m&&m.message||m}`)),xr(`replayed initialize -> session ${i?"established":"MISSING session-id"}`),!!i}async function u(){let f;try{f=await fge()}catch(p){xr(`target-org re-resolve failed, keeping current org: ${p&&p.message||p}`);return}if(!(!f||f===n)){xr(`target org changed: ${n} -> ${f} \u2014 rebuilding session`);try{r=await oyt(e,f),n=f,i=null,xr(`rebuilt session -> ${r.upstreamUrl} (org: ${n})`),await c()}catch(p){xr(`failed to switch to '${f}', keeping '${n}': ${p&&p.message||p}`)}}}let d=cge.createInterface({input:process.stdin});for await(let f of d)if(f.trim())try{let p=syt(f);p==="initialize"?s=f:p==="notifications/initialized"&&(l=f),await u();let m=await tf(r.upstreamUrl,r.jwt,i,f);if(m.status===401&&(xr("upstream 401 \u2014 re-minting JWT and retrying once"),r.jwt=await Q8(r.connection),m=await tf(r.upstreamUrl,r.jwt,i,f)),m.status===400&&p!=="initialize"&&s&&(await m.text().catch(()=>{}),xr("upstream 400 \u2014 re-establishing session and retrying once"),await c()&&(m=await tf(r.upstreamUrl,r.jwt,i,f))),!m.ok&&m.status!==202){let v=await m.text().catch(()=>"");xr(`upstream ${m.status}: ${v.slice(0,300)}`);let S=wP(m.status,v),E=Y8(n,S);o!==E&&(o=E,i1({slug:e,state:S,detail:`HTTP ${m.status}${v.trim()?` ${v.trim().slice(0,200)}`:""}`,source:"live",httpStatus:m.status,org:n}));let w=S==="inactive"?"Server not activated in this org \u2014 activate it in Salesforce Setup, then retry":`upstream HTTP ${m.status}`;sge(f,-32603,w);continue}let y=Y8(n,"ok");o!==y&&(o=y,i1({slug:e,state:"ok",detail:`HTTP ${m.status}`,source:"live",httpStatus:m.status,org:n})),await uyt(m,a)}catch(p){let m=p&&p.message||String(p);xr(`forward error: ${m}`);let y=Y8(n,"unreachable");o!==y&&(o=y,i1({slug:e,state:"unreachable",detail:`request failed: ${m.slice(0,200)}`,source:"live",httpStatus:null,org:n})),sge(f,-32603,`proxy error: ${m}`)}}require.main===module&&pyt().catch(e=>{xr(`fatal: ${e&&e.message||e}`),process.exit(1)});module.exports={classifyUpstream:wP,healthWriteKey:Y8};
|