@stacksjs/buddy 0.68.0 → 0.68.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-0qvaepnz.js +2 -0
- package/dist/chunk-63pxna7y.js +978 -0
- package/dist/chunk-8yky4bsd.js +10 -0
- package/dist/chunk-gjefq0nq.js +2 -0
- package/dist/chunk-js6y6fm1.js +2 -0
- package/dist/chunk-mevackhg.js +9 -0
- package/dist/chunk-n2c2dcxa.js +2 -0
- package/dist/chunk-qq851psj.js +6 -0
- package/dist/chunk-r6rhrt1p.js +2 -0
- package/dist/chunk-rtfeef82.js +2 -0
- package/dist/chunk-ryjbc6dz.js +5 -0
- package/dist/chunk-sk3x55wm.js +2 -0
- package/dist/chunk-v9kknk69.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/stacks +0 -0
- package/package.json +5 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{rb as P}from"./chunk-6yazdvb4.js";import{xb as Z,zb as U}from"./chunk-d2dbhn2h.js";var $n=U((hs,Pn)=>{var{defineProperty:k,getOwnPropertyDescriptor:Vi,getOwnPropertyNames:Xi}=Object,Gi=Object.prototype.hasOwnProperty,Y=(n,c)=>k(n,"name",{value:c,configurable:!0}),ji=(n,c)=>{for(var t in c)k(n,t,{get:c[t],enumerable:!0})},Wi=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Xi(c))if(!Gi.call(n,h)&&h!==t)k(n,h,{get:()=>c[h],enumerable:!(i=Vi(c,h))||i.enumerable})}return n},Ji=(n)=>Wi(k({},"__esModule",{value:!0}),n),kn={};ji(kn,{constructStack:()=>wn});Pn.exports=Ji(kn);var j=Y((n,c)=>{let t=[];if(n)t.push(n);if(c)for(let i of c)t.push(i);return t},"getAllAliases"),V=Y((n,c)=>{return`${n||"anonymous"}${c&&c.length>0?` (a.k.a. ${c.join(",")})`:""}`},"getMiddlewareNameWithAliases"),wn=Y(()=>{let n=[],c=[],t=!1,i=new Set,h=Y((u)=>u.sort((d,$)=>Bn[$.step]-Bn[d.step]||Hn[$.priority||"normal"]-Hn[d.priority||"normal"]),"sort"),f=Y((u)=>{let d=!1,$=Y((E)=>{let I=j(E.name,E.aliases);if(I.includes(u)){d=!0;for(let e of I)i.delete(e);return!1}return!0},"filterCb");return n=n.filter($),c=c.filter($),d},"removeByName"),r=Y((u)=>{let d=!1,$=Y((E)=>{if(E.middleware===u){d=!0;for(let I of j(E.name,E.aliases))i.delete(I);return!1}return!0},"filterCb");return n=n.filter($),c=c.filter($),d},"removeByReference"),s=Y((u)=>{var d;return n.forEach(($)=>{u.add($.middleware,{...$})}),c.forEach(($)=>{u.addRelativeTo($.middleware,{...$})}),(d=u.identifyOnResolve)==null||d.call(u,S.identifyOnResolve()),u},"cloneTo"),w=Y((u)=>{let d=[];return u.before.forEach(($)=>{if($.before.length===0&&$.after.length===0)d.push($);else d.push(...w($))}),d.push(u),u.after.reverse().forEach(($)=>{if($.before.length===0&&$.after.length===0)d.push($);else d.push(...w($))}),d},"expandRelativeMiddlewareList"),x=Y((u=!1)=>{let d=[],$=[],E={};return n.forEach((e)=>{let F={...e,before:[],after:[]};for(let T of j(F.name,F.aliases))E[T]=F;d.push(F)}),c.forEach((e)=>{let F={...e,before:[],after:[]};for(let T of j(F.name,F.aliases))E[T]=F;$.push(F)}),$.forEach((e)=>{if(e.toMiddleware){let F=E[e.toMiddleware];if(F===void 0){if(u)return;throw new Error(`${e.toMiddleware} is not found when adding ${V(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}if(e.relation==="after")F.after.push(e);if(e.relation==="before")F.before.push(e)}}),h(d).map(w).reduce((e,F)=>{return e.push(...F),e},[])},"getMiddlewareList"),S={add:(u,d={})=>{let{name:$,override:E,aliases:I}=d,e={step:"initialize",priority:"normal",middleware:u,...d},F=j($,I);if(F.length>0){if(F.some((T)=>i.has(T))){if(!E)throw new Error(`Duplicate middleware name '${V($,I)}'`);for(let T of F){let C=n.findIndex((g)=>{var o;return g.name===T||((o=g.aliases)==null?void 0:o.some((G)=>G===T))});if(C===-1)continue;let y=n[C];if(y.step!==e.step||e.priority!==y.priority)throw new Error(`"${V(y.name,y.aliases)}" middleware with ${y.priority} priority in ${y.step} step cannot be overridden by "${V($,I)}" middleware with ${e.priority} priority in ${e.step} step.`);n.splice(C,1)}}for(let T of F)i.add(T)}n.push(e)},addRelativeTo:(u,d)=>{let{name:$,override:E,aliases:I}=d,e={middleware:u,...d},F=j($,I);if(F.length>0){if(F.some((T)=>i.has(T))){if(!E)throw new Error(`Duplicate middleware name '${V($,I)}'`);for(let T of F){let C=c.findIndex((g)=>{var o;return g.name===T||((o=g.aliases)==null?void 0:o.some((G)=>G===T))});if(C===-1)continue;let y=c[C];if(y.toMiddleware!==e.toMiddleware||y.relation!==e.relation)throw new Error(`"${V(y.name,y.aliases)}" middleware ${y.relation} "${y.toMiddleware}" middleware cannot be overridden by "${V($,I)}" middleware ${e.relation} "${e.toMiddleware}" middleware.`);c.splice(C,1)}}for(let T of F)i.add(T)}c.push(e)},clone:()=>s(wn()),use:(u)=>{u.applyToStack(S)},remove:(u)=>{if(typeof u==="string")return f(u);else return r(u)},removeByTag:(u)=>{let d=!1,$=Y((E)=>{let{tags:I,name:e,aliases:F}=E;if(I&&I.includes(u)){let T=j(e,F);for(let C of T)i.delete(C);return d=!0,!1}return!0},"filterCb");return n=n.filter($),c=c.filter($),d},concat:(u)=>{var d;let $=s(wn());return $.use(u),$.identifyOnResolve(t||$.identifyOnResolve()||(((d=u.identifyOnResolve)==null?void 0:d.call(u))??!1)),$},applyToStack:s,identify:()=>{return x(!0).map((u)=>{let d=u.step??u.relation+" "+u.toMiddleware;return V(u.name,u.aliases)+" - "+d})},identifyOnResolve(u){if(typeof u==="boolean")t=u;return t},resolve:(u,d)=>{for(let $ of x().map((E)=>E.middleware).reverse())u=$(u,d);if(t)console.log(S.identify());return u}};return S},"constructStack"),Bn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Hn={high:3,normal:2,low:1}});var cc=U((xs,nc)=>{var{defineProperty:l,getOwnPropertyDescriptor:bi,getOwnPropertyNames:Ai}=Object,Ri=Object.prototype.hasOwnProperty,Bi=(n,c)=>l(n,"name",{value:c,configurable:!0}),Hi=(n,c)=>{for(var t in c)l(n,t,{get:c[t],enumerable:!0})},ki=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Ai(c))if(!Ri.call(n,h)&&h!==t)l(n,h,{get:()=>c[h],enumerable:!(i=bi(c,h))||i.enumerable})}return n},Pi=(n)=>ki(l({},"__esModule",{value:!0}),n),_n={};Hi(_n,{isArrayBuffer:()=>li});nc.exports=Pi(_n);var li=Bi((n)=>typeof ArrayBuffer==="function"&&n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]","isArrayBuffer")});var A=U((Cs,hc)=>{var{defineProperty:O,getOwnPropertyDescriptor:Oi,getOwnPropertyNames:pi}=Object,vi=Object.prototype.hasOwnProperty,tc=(n,c)=>O(n,"name",{value:c,configurable:!0}),qi=(n,c)=>{for(var t in c)O(n,t,{get:c[t],enumerable:!0})},ai=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of pi(c))if(!vi.call(n,h)&&h!==t)O(n,h,{get:()=>c[h],enumerable:!(i=Oi(c,h))||i.enumerable})}return n},mi=(n)=>ai(O({},"__esModule",{value:!0}),n),ic={};qi(ic,{fromArrayBuffer:()=>nh,fromString:()=>ch});hc.exports=mi(ic);var _i=cc(),Tn=import.meta.require("buffer"),nh=tc((n,c=0,t=n.byteLength-c)=>{if(!_i.isArrayBuffer(n))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof n} (${n})`);return Tn.Buffer.from(n,c,t)},"fromArrayBuffer"),ch=tc((n,c)=>{if(typeof n!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof n} (${n})`);return c?Tn.Buffer.from(n,c):Tn.Buffer.from(n)},"fromString")});var sc=U((fc)=>{Object.defineProperty(fc,"__esModule",{value:!0});fc.fromBase64=void 0;var th=A(),ih=/^[A-Za-z0-9+/]*={0,2}$/,hh=(n)=>{if(n.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!ih.exec(n))throw new TypeError("Invalid base64 string.");let c=th.fromString(n,"base64");return new Uint8Array(c.buffer,c.byteOffset,c.byteLength)};fc.fromBase64=hh});var v=U((Fs,Tc)=>{var{defineProperty:p,getOwnPropertyDescriptor:fh,getOwnPropertyNames:rh}=Object,sh=Object.prototype.hasOwnProperty,dn=(n,c)=>p(n,"name",{value:c,configurable:!0}),uh=(n,c)=>{for(var t in c)p(n,t,{get:c[t],enumerable:!0})},wh=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of rh(c))if(!sh.call(n,h)&&h!==t)p(n,h,{get:()=>c[h],enumerable:!(i=fh(c,h))||i.enumerable})}return n},$h=(n)=>wh(p({},"__esModule",{value:!0}),n),uc={};uh(uc,{fromUtf8:()=>$c,toUint8Array:()=>Th,toUtf8:()=>dh});Tc.exports=$h(uc);var wc=A(),$c=dn((n)=>{let c=wc.fromString(n,"utf8");return new Uint8Array(c.buffer,c.byteOffset,c.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Th=dn((n)=>{if(typeof n==="string")return $c(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(n)},"toUint8Array"),dh=dn((n)=>{if(typeof n==="string")return n;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return wc.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("utf8")},"toUtf8")});var Cc=U((dc)=>{Object.defineProperty(dc,"__esModule",{value:!0});dc.toBase64=void 0;var xh=A(),Ch=v(),eh=(n)=>{let c;if(typeof n==="string")c=Ch.fromUtf8(n);else c=n;if(typeof c!=="object"||typeof c.byteOffset!=="number"||typeof c.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return xh.fromArrayBuffer(c.buffer,c.byteOffset,c.byteLength).toString("base64")};dc.toBase64=eh});var R=U((Ss,q)=>{var{defineProperty:ec,getOwnPropertyDescriptor:Fh,getOwnPropertyNames:Eh}=Object,Sh=Object.prototype.hasOwnProperty,xn=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Eh(c))if(!Sh.call(n,h)&&h!==t)ec(n,h,{get:()=>c[h],enumerable:!(i=Fh(c,h))||i.enumerable})}return n},Fc=(n,c,t)=>(xn(n,c,"default"),t&&xn(t,c,"default")),yh=(n)=>xn(ec({},"__esModule",{value:!0}),n),Cn={};q.exports=yh(Cn);Fc(Cn,sc(),q.exports);Fc(Cn,Cc(),q.exports)});var yc=U((Ec)=>{Object.defineProperty(Ec,"__esModule",{value:!0});Ec.getAwsChunkedEncodingStream=void 0;var Ih=import.meta.require("stream"),Uh=(n,c)=>{let{base64Encoder:t,bodyLengthChecker:i,checksumAlgorithmFn:h,checksumLocationName:f,streamHasher:r}=c,s=t!==void 0&&h!==void 0&&f!==void 0&&r!==void 0,w=s?r(h,n):void 0,x=new Ih.Readable({read:()=>{}});return n.on("data",(S)=>{let u=i(S)||0;x.push(`${u.toString(16)}\r\n`),x.push(S),x.push("\r\n")}),n.on("end",async()=>{if(x.push("0\r\n"),s){let S=t(await w);x.push(`${f}:${S}\r\n`),x.push("\r\n")}x.push(null)}),x};Ec.getAwsChunkedEncodingStream=Uh});var m=U((Is,zc)=>{var{defineProperty:a,getOwnPropertyDescriptor:Dh,getOwnPropertyNames:Lh}=Object,gh=Object.prototype.hasOwnProperty,X=(n,c)=>a(n,"name",{value:c,configurable:!0}),oh=(n,c)=>{for(var t in c)a(n,t,{get:c[t],enumerable:!0})},Nh=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Lh(c))if(!gh.call(n,h)&&h!==t)a(n,h,{get:()=>c[h],enumerable:!(i=Dh(c,h))||i.enumerable})}return n},Yh=(n)=>Nh(a({},"__esModule",{value:!0}),n),Ic={};oh(Ic,{Field:()=>Qh,Fields:()=>Kh,HttpRequest:()=>Vh,HttpResponse:()=>Xh,IHttpRequest:()=>Uc.HttpRequest,getHttpHandlerExtensionConfiguration:()=>zh,isValidHostname:()=>Yc,resolveHttpHandlerRuntimeConfig:()=>Zh});zc.exports=Yh(Ic);var zh=X((n)=>{let c=n.httpHandler;return{setHttpHandler(t){c=t},httpHandler(){return c},updateHttpClientConfig(t,i){c.updateHttpClientConfig(t,i)},httpHandlerConfigs(){return c.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),Zh=X((n)=>{return{httpHandler:n.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),Uc=P(),Dc=class n{constructor({name:c,kind:t=Uc.FieldPosition.HEADER,values:i=[]}){this.name=c,this.kind=t,this.values=i}add(c){this.values.push(c)}set(c){this.values=c}remove(c){this.values=this.values.filter((t)=>t!==c)}toString(){return this.values.map((c)=>c.includes(",")||c.includes(" ")?`"${c}"`:c).join(", ")}get(){return this.values}};X(Dc,"Field");var Qh=Dc,Lc=class n{constructor({fields:c=[],encoding:t="utf-8"}){this.entries={},c.forEach(this.setField.bind(this)),this.encoding=t}setField(c){this.entries[c.name.toLowerCase()]=c}getField(c){return this.entries[c.toLowerCase()]}removeField(c){delete this.entries[c.toLowerCase()]}getByType(c){return Object.values(this.entries).filter((t)=>t.kind===c)}};X(Lc,"Fields");var Kh=Lc,gc=class n{constructor(c){this.method=c.method||"GET",this.hostname=c.hostname||"localhost",this.port=c.port,this.query=c.query||{},this.headers=c.headers||{},this.body=c.body,this.protocol=c.protocol?c.protocol.slice(-1)!==":"?`${c.protocol}:`:c.protocol:"https:",this.path=c.path?c.path.charAt(0)!=="/"?`/${c.path}`:c.path:"/",this.username=c.username,this.password=c.password,this.fragment=c.fragment}static clone(c){let t=new n({...c,headers:{...c.headers}});if(t.query)t.query=oc(t.query);return t}static isInstance(c){if(!c)return!1;let t=c;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return n.clone(this)}};X(gc,"HttpRequest");var Vh=gc;function oc(n){return Object.keys(n).reduce((c,t)=>{let i=n[t];return{...c,[t]:Array.isArray(i)?[...i]:i}},{})}X(oc,"cloneQuery");var Nc=class n{constructor(c){this.statusCode=c.statusCode,this.reason=c.reason,this.headers=c.headers||{},this.body=c.body}static isInstance(c){if(!c)return!1;let t=c;return typeof t.statusCode==="number"&&typeof t.headers==="object"}};X(Nc,"HttpResponse");var Xh=Nc;function Yc(n){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(n)}X(Yc,"isValidHostname")});var Fn=U((Us,Kc)=>{var{defineProperty:_,getOwnPropertyDescriptor:Gh,getOwnPropertyNames:jh}=Object,Wh=Object.prototype.hasOwnProperty,en=(n,c)=>_(n,"name",{value:c,configurable:!0}),Jh=(n,c)=>{for(var t in c)_(n,t,{get:c[t],enumerable:!0})},Mh=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of jh(c))if(!Wh.call(n,h)&&h!==t)_(n,h,{get:()=>c[h],enumerable:!(i=Gh(c,h))||i.enumerable})}return n},bh=(n)=>Mh(_({},"__esModule",{value:!0}),n),Zc={};Jh(Zc,{escapeUri:()=>Qc,escapeUriPath:()=>Rh});Kc.exports=bh(Zc);var Qc=en((n)=>encodeURIComponent(n).replace(/[!'()*]/g,Ah),"escapeUri"),Ah=en((n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Rh=en((n)=>n.split("/").map(Qc).join("/"),"escapeUriPath")});var Sn=U((Ds,Gc)=>{var{defineProperty:nn,getOwnPropertyDescriptor:Bh,getOwnPropertyNames:Hh}=Object,kh=Object.prototype.hasOwnProperty,Ph=(n,c)=>nn(n,"name",{value:c,configurable:!0}),lh=(n,c)=>{for(var t in c)nn(n,t,{get:c[t],enumerable:!0})},Oh=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Hh(c))if(!kh.call(n,h)&&h!==t)nn(n,h,{get:()=>c[h],enumerable:!(i=Bh(c,h))||i.enumerable})}return n},ph=(n)=>Oh(nn({},"__esModule",{value:!0}),n),Vc={};lh(Vc,{buildQueryString:()=>Xc});Gc.exports=ph(Vc);var En=Fn();function Xc(n){let c=[];for(let t of Object.keys(n).sort()){let i=n[t];if(t=En.escapeUri(t),Array.isArray(i))for(let h=0,f=i.length;h<f;h++)c.push(`${t}=${En.escapeUri(i[h])}`);else{let h=t;if(i||typeof i==="string")h+=`=${En.escapeUri(i)}`;c.push(h)}}return c.join("&")}Ph(Xc,"buildQueryString")});var _c=U((Ls,mc)=>{var{create:vh,defineProperty:B,getOwnPropertyDescriptor:qh,getOwnPropertyNames:ah,getPrototypeOf:mh}=Object,_h=Object.prototype.hasOwnProperty,D=(n,c)=>B(n,"name",{value:c,configurable:!0}),nf=(n,c)=>{for(var t in c)B(n,t,{get:c[t],enumerable:!0})},bc=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of ah(c))if(!_h.call(n,h)&&h!==t)B(n,h,{get:()=>c[h],enumerable:!(i=qh(c,h))||i.enumerable})}return n},cf=(n,c,t)=>(t=n!=null?vh(mh(n)):{},bc(c||!n||!n.__esModule?B(t,"default",{value:n,enumerable:!0}):t,n)),tf=(n)=>bc(B({},"__esModule",{value:!0}),n),Ac={};nf(Ac,{DEFAULT_REQUEST_TIMEOUT:()=>wf,NodeHttp2Handler:()=>Cf,NodeHttpHandler:()=>$f,streamCollector:()=>Ff});mc.exports=tf(Ac);var Rc=m(),Bc=Sn(),yn=import.meta.require("http"),In=import.meta.require("https"),hf=["ECONNRESET","EPIPE","ETIMEDOUT"],Hc=D((n)=>{let c={};for(let t of Object.keys(n)){let i=n[t];c[t]=Array.isArray(i)?i.join(","):i}return c},"getTransformedHeaders"),jc=1000,ff=D((n,c,t=0)=>{if(!t)return-1;let i=D((h)=>{let f=setTimeout(()=>{n.destroy(),c(Object.assign(new Error(`Socket timed out without establishing a connection within ${t} ms`),{name:"TimeoutError"}))},t-h),r=D((s)=>{if(s==null?void 0:s.connecting)s.on("connect",()=>{clearTimeout(f)});else clearTimeout(f)},"doWithSocket");if(n.socket)r(n.socket);else n.on("socket",r)},"registerTimeout");if(t<2000)return i(0),0;return setTimeout(i.bind(null,jc),jc)},"setConnectionTimeout"),rf=3000,sf=D((n,{keepAlive:c,keepAliveMsecs:t},i=rf)=>{if(c!==!0)return-1;let h=D(()=>{if(n.socket)n.socket.setKeepAlive(c,t||0);else n.on("socket",(f)=>{f.setKeepAlive(c,t||0)})},"registerListener");if(i===0)return h(),0;return setTimeout(h,i)},"setSocketKeepAlive"),Wc=3000,uf=D((n,c,t=0)=>{let i=D((h)=>{n.setTimeout(t-h,()=>{n.destroy(),c(Object.assign(new Error(`Connection timed out after ${t} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<t&&t<6000)return i(0),0;return setTimeout(i.bind(null,t===0?0:Wc),Wc)},"setSocketTimeout"),kc=import.meta.require("stream"),Jc=1000;async function Un(n,c,t=Jc){let i=c.headers??{},h=i.Expect||i.expect,f=-1,r=!1;if(h==="100-continue")await Promise.race([new Promise((s)=>{f=Number(setTimeout(s,Math.max(Jc,t)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(f),s()}),n.on("error",()=>{r=!0,clearTimeout(f),s()})})]);if(!r)Pc(n,c.body)}D(Un,"writeRequestBody");function Pc(n,c){if(c instanceof kc.Readable){c.pipe(n);return}if(c){if(Buffer.isBuffer(c)||typeof c==="string"){n.end(c);return}let t=c;if(typeof t==="object"&&t.buffer&&typeof t.byteOffset==="number"&&typeof t.byteLength==="number"){n.end(Buffer.from(t.buffer,t.byteOffset,t.byteLength));return}n.end(Buffer.from(c));return}n.end()}D(Pc,"writeBody");var wf=0,lc=class n{constructor(c){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,i)=>{if(typeof c==="function")c().then((h)=>{t(this.resolveDefaultConfig(h))}).catch(i);else t(this.resolveDefaultConfig(c))})}static create(c){if(typeof(c==null?void 0:c.handle)==="function")return c;return new n(c)}static checkSocketUsage(c,t,i=console){var h,f,r;let{sockets:s,requests:w,maxSockets:x}=c;if(typeof x!=="number"||x===1/0)return t;let S=15000;if(Date.now()-S<t)return t;if(s&&w)for(let u in s){let d=((h=s[u])==null?void 0:h.length)??0,$=((f=w[u])==null?void 0:f.length)??0;if(d>=x&&$>=2*x)return(r=i==null?void 0:i.warn)==null||r.call(i,`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${$} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}resolveDefaultConfig(c){let{requestTimeout:t,connectionTimeout:i,socketTimeout:h,httpAgent:f,httpsAgent:r}=c||{},s=!0,w=50;return{connectionTimeout:i,requestTimeout:t??h,httpAgent:(()=>{if(f instanceof yn.Agent||typeof(f==null?void 0:f.destroy)==="function")return f;return new yn.Agent({keepAlive:!0,maxSockets:50,...f})})(),httpsAgent:(()=>{if(r instanceof In.Agent||typeof(r==null?void 0:r.destroy)==="function")return r;return new In.Agent({keepAlive:!0,maxSockets:50,...r})})(),logger:console}}destroy(){var c,t,i,h;(t=(c=this.config)==null?void 0:c.httpAgent)==null||t.destroy(),(h=(i=this.config)==null?void 0:i.httpsAgent)==null||h.destroy()}async handle(c,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;return new Promise((i,h)=>{let f=void 0,r=[],s=D(async(C)=>{await f,r.forEach(clearTimeout),i(C)},"resolve"),w=D(async(C)=>{await f,r.forEach(clearTimeout),h(C)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t==null?void 0:t.aborted){let C=new Error("Request aborted");C.name="AbortError",w(C);return}let x=c.protocol==="https:",S=x?this.config.httpsAgent:this.config.httpAgent;r.push(setTimeout(()=>{this.socketWarningTimestamp=n.checkSocketUsage(S,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let u=Bc.buildQueryString(c.query||{}),d=void 0;if(c.username!=null||c.password!=null){let C=c.username??"",y=c.password??"";d=`${C}:${y}`}let $=c.path;if(u)$+=`?${u}`;if(c.fragment)$+=`#${c.fragment}`;let E=c.hostname??"";if(E[0]==="["&&E.endsWith("]"))E=c.hostname.slice(1,-1);else E=c.hostname;let I={headers:c.headers,host:E,method:c.method,path:$,port:c.port,agent:S,auth:d},F=(x?In.request:yn.request)(I,(C)=>{let y=new Rc.HttpResponse({statusCode:C.statusCode||-1,reason:C.statusMessage,headers:Hc(C.headers),body:C});s({response:y})});if(F.on("error",(C)=>{if(hf.includes(C.code))w(Object.assign(C,{name:"TimeoutError"}));else w(C)}),t){let C=D(()=>{F.destroy();let y=new Error("Request aborted");y.name="AbortError",w(y)},"onAbort");if(typeof t.addEventListener==="function"){let y=t;y.addEventListener("abort",C,{once:!0}),F.once("close",()=>y.removeEventListener("abort",C))}else t.onabort=C}r.push(ff(F,w,this.config.connectionTimeout)),r.push(uf(F,w,this.config.requestTimeout));let T=I.agent;if(typeof T==="object"&&"keepAlive"in T)r.push(sf(F,{keepAlive:T.keepAlive,keepAliveMsecs:T.keepAliveMsecs}));f=Un(F,c,this.config.requestTimeout).catch((C)=>{return r.forEach(clearTimeout),h(C)})})}updateHttpClientConfig(c,t){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[c]:t}})}httpHandlerConfigs(){return this.config??{}}};D(lc,"NodeHttpHandler");var $f=lc,Mc=import.meta.require("http2"),Tf=cf(import.meta.require("http2")),Oc=class n{constructor(c){this.sessions=[],this.sessions=c??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(c){this.sessions.push(c)}contains(c){return this.sessions.includes(c)}remove(c){this.sessions=this.sessions.filter((t)=>t!==c)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(c){for(let t of this.sessions)if(t===c){if(!t.destroyed)t.destroy()}}};D(Oc,"NodeHttp2ConnectionPool");var df=Oc,pc=class n{constructor(c){if(this.sessionCache=new Map,this.config=c,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(c,t){let i=this.getUrlString(c),h=this.sessionCache.get(i);if(h){let w=h.poll();if(w&&!this.config.disableConcurrency)return w}let f=Tf.default.connect(i);if(this.config.maxConcurrency)f.settings({maxConcurrentStreams:this.config.maxConcurrency},(w)=>{if(w)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+c.destination.toString())});f.unref();let r=D(()=>{f.destroy(),this.deleteSession(i,f)},"destroySessionCb");if(f.on("goaway",r),f.on("error",r),f.on("frameError",r),f.on("close",()=>this.deleteSession(i,f)),t.requestTimeout)f.setTimeout(t.requestTimeout,r);let s=this.sessionCache.get(i)||new df;return s.offerLast(f),this.sessionCache.set(i,s),f}deleteSession(c,t){let i=this.sessionCache.get(c);if(!i)return;if(!i.contains(t))return;i.remove(t),this.sessionCache.set(c,i)}release(c,t){var i;let h=this.getUrlString(c);(i=this.sessionCache.get(h))==null||i.offerLast(t)}destroy(){for(let[c,t]of this.sessionCache){for(let i of t){if(!i.destroyed)i.destroy();t.remove(i)}this.sessionCache.delete(c)}}setMaxConcurrentStreams(c){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=c}setDisableConcurrentStreams(c){this.config.disableConcurrency=c}getUrlString(c){return c.destination.toString()}};D(pc,"NodeHttp2ConnectionManager");var xf=pc,vc=class n{constructor(c){this.metadata={handlerProtocol:"h2"},this.connectionManager=new xf({}),this.configProvider=new Promise((t,i)=>{if(typeof c==="function")c().then((h)=>{t(h||{})}).catch(i);else t(c||{})})}static create(c){if(typeof(c==null?void 0:c.handle)==="function")return c;return new n(c)}destroy(){this.connectionManager.destroy()}async handle(c,{abortSignal:t}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}let{requestTimeout:i,disableConcurrentStreams:h}=this.config;return new Promise((f,r)=>{var s;let w=!1,x=void 0,S=D(async(L)=>{await x,f(L)},"resolve"),u=D(async(L)=>{await x,r(L)},"reject");if(t==null?void 0:t.aborted){w=!0;let L=new Error("Request aborted");L.name="AbortError",u(L);return}let{hostname:d,method:$,port:E,protocol:I,query:e}=c,F="";if(c.username!=null||c.password!=null){let L=c.username??"",z=c.password??"";F=`${L}:${z}@`}let T=`${I}//${F}${d}${E?`:${E}`:""}`,C={destination:new URL(T)},y=this.connectionManager.lease(C,{requestTimeout:(s=this.config)==null?void 0:s.sessionTimeout,disableConcurrentStreams:h||!1}),g=D((L)=>{if(h)this.destroySession(y);w=!0,u(L)},"rejectWithDestroy"),o=Bc.buildQueryString(e||{}),G=c.path;if(o)G+=`?${o}`;if(c.fragment)G+=`#${c.fragment}`;let N=y.request({...c.headers,[Mc.constants.HTTP2_HEADER_PATH]:G,[Mc.constants.HTTP2_HEADER_METHOD]:$});if(y.ref(),N.on("response",(L)=>{let z=new Rc.HttpResponse({statusCode:L[":status"]||-1,headers:Hc(L),body:N});if(w=!0,S({response:z}),h)y.close(),this.connectionManager.deleteSession(T,y)}),i)N.setTimeout(i,()=>{N.close();let L=new Error(`Stream timed out because of no activity for ${i} ms`);L.name="TimeoutError",g(L)});if(t){let L=D(()=>{N.close();let z=new Error("Request aborted");z.name="AbortError",g(z)},"onAbort");if(typeof t.addEventListener==="function"){let z=t;z.addEventListener("abort",L,{once:!0}),N.once("close",()=>z.removeEventListener("abort",L))}else t.onabort=L}N.on("frameError",(L,z,Ki)=>{g(new Error(`Frame type id ${L} in stream id ${Ki} has failed with code ${z}.`))}),N.on("error",g),N.on("aborted",()=>{g(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${N.rstCode}.`))}),N.on("close",()=>{if(y.unref(),h)y.destroy();if(!w)g(new Error("Unexpected error: http2 request did not get a response"))}),x=Un(N,c,i)})}updateHttpClientConfig(c,t){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[c]:t}})}httpHandlerConfigs(){return this.config??{}}destroySession(c){if(!c.destroyed)c.destroy()}};D(vc,"NodeHttp2Handler");var Cf=vc,qc=class n extends kc.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(c,t,i){this.bufferedBytes.push(c),i()}};D(qc,"Collector");var ef=qc,Ff=D((n)=>{if(Ef(n))return ac(n);return new Promise((c,t)=>{let i=new ef;n.pipe(i),n.on("error",(h)=>{i.end(),t(h)}),i.on("error",t),i.on("finish",function(){let h=new Uint8Array(Buffer.concat(this.bufferedBytes));c(h)})})},"streamCollector"),Ef=D((n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream,"isReadableStreamInstance");async function ac(n){let c=[],t=n.getReader(),i=!1,h=0;while(!i){let{done:s,value:w}=await t.read();if(w)c.push(w),h+=w.length;i=s}let f=new Uint8Array(h),r=0;for(let s of c)f.set(s,r),r+=s.length;return f}D(ac,"collectReadableStream")});var rt=U((gs,ft)=>{var{defineProperty:tn,getOwnPropertyDescriptor:Sf,getOwnPropertyNames:yf}=Object,If=Object.prototype.hasOwnProperty,W=(n,c)=>tn(n,"name",{value:c,configurable:!0}),Uf=(n,c)=>{for(var t in c)tn(n,t,{get:c[t],enumerable:!0})},Df=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of yf(c))if(!If.call(n,h)&&h!==t)tn(n,h,{get:()=>c[h],enumerable:!(i=Sf(c,h))||i.enumerable})}return n},Lf=(n)=>Df(tn({},"__esModule",{value:!0}),n),ct={};Uf(ct,{FetchHttpHandler:()=>of,keepAliveSupport:()=>cn,streamCollector:()=>Nf});ft.exports=Lf(ct);var nt=m(),gf=Sn();function tt(n=0){return new Promise((c,t)=>{if(n)setTimeout(()=>{let i=new Error(`Request did not complete within ${n} ms`);i.name="TimeoutError",t(i)},n)})}W(tt,"requestTimeout");var cn={supported:void 0},it=class n{static create(c){if(typeof(c==null?void 0:c.handle)==="function")return c;return new n(c)}constructor(c){if(typeof c==="function")this.configProvider=c().then((t)=>t||{});else this.config=c??{},this.configProvider=Promise.resolve(this.config);if(cn.supported===void 0)cn.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(c,{abortSignal:t}={}){var i;if(!this.config)this.config=await this.configProvider;let h=this.config.requestTimeout,f=this.config.keepAlive===!0,r=this.config.credentials;if(t==null?void 0:t.aborted){let T=new Error("Request aborted");return T.name="AbortError",Promise.reject(T)}let s=c.path,w=gf.buildQueryString(c.query||{});if(w)s+=`?${w}`;if(c.fragment)s+=`#${c.fragment}`;let x="";if(c.username!=null||c.password!=null){let T=c.username??"",C=c.password??"";x=`${T}:${C}@`}let{port:S,method:u}=c,d=`${c.protocol}//${x}${c.hostname}${S?`:${S}`:""}${s}`,$=u==="GET"||u==="HEAD"?void 0:c.body,E={body:$,headers:new Headers(c.headers),method:u,credentials:r};if((i=this.config)==null?void 0:i.cache)E.cache=this.config.cache;if($)E.duplex="half";if(typeof AbortController!=="undefined")E.signal=t;if(cn.supported)E.keepalive=f;if(typeof this.config.requestInit==="function")Object.assign(E,this.config.requestInit(c));let I=W(()=>{},"removeSignalEventListener"),e=new Request(d,E),F=[fetch(e).then((T)=>{let C=T.headers,y={};for(let o of C.entries())y[o[0]]=o[1];if(T.body==null)return T.blob().then((o)=>({response:new nt.HttpResponse({headers:y,reason:T.statusText,statusCode:T.status,body:o})}));return{response:new nt.HttpResponse({headers:y,reason:T.statusText,statusCode:T.status,body:T.body})}}),tt(h)];if(t)F.push(new Promise((T,C)=>{let y=W(()=>{let g=new Error("Request aborted");g.name="AbortError",C(g)},"onAbort");if(typeof t.addEventListener==="function"){let g=t;g.addEventListener("abort",y,{once:!0}),I=W(()=>g.removeEventListener("abort",y),"removeSignalEventListener")}else t.onabort=y}));return Promise.race(F).finally(I)}updateHttpClientConfig(c,t){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return i[c]=t,i})}httpHandlerConfigs(){return this.config??{}}};W(it,"FetchHttpHandler");var of=it,Nf=W(async(n)=>{if(typeof Blob==="function"&&n instanceof Blob)return new Uint8Array(await n.arrayBuffer());return ht(n)},"streamCollector");async function ht(n){let c=[],t=n.getReader(),i=!1,h=0;while(!i){let{done:s,value:w}=await t.read();if(w)c.push(w),h+=w.length;i=s}let f=new Uint8Array(h),r=0;for(let s of c)f.set(s,r),r+=s.length;return f}W(ht,"collectStream")});var xt=U((os,dt)=>{var{defineProperty:hn,getOwnPropertyDescriptor:Yf,getOwnPropertyNames:zf}=Object,Zf=Object.prototype.hasOwnProperty,st=(n,c)=>hn(n,"name",{value:c,configurable:!0}),Qf=(n,c)=>{for(var t in c)hn(n,t,{get:c[t],enumerable:!0})},Kf=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of zf(c))if(!Zf.call(n,h)&&h!==t)hn(n,h,{get:()=>c[h],enumerable:!(i=Yf(c,h))||i.enumerable})}return n},Vf=(n)=>Kf(hn({},"__esModule",{value:!0}),n),ut={};Qf(ut,{fromHex:()=>$t,toHex:()=>Tt});dt.exports=Vf(ut);var wt={},Dn={};for(let n=0;n<256;n++){let c=n.toString(16).toLowerCase();if(c.length===1)c=`0${c}`;wt[n]=c,Dn[c]=n}function $t(n){if(n.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let c=new Uint8Array(n.length/2);for(let t=0;t<n.length;t+=2){let i=n.slice(t,t+2).toLowerCase();if(i in Dn)c[t/2]=Dn[i];else throw new Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return c}st($t,"fromHex");function Tt(n){let c="";for(let t=0;t<n.byteLength;t++)c+=wt[n[t]];return c}st(Tt,"toHex")});var J=U((Ct)=>{Object.defineProperty(Ct,"__esModule",{value:!0});Ct.isReadableStream=void 0;var Xf=(n)=>{var c;return typeof ReadableStream==="function"&&(((c=n===null||n===void 0?void 0:n.constructor)===null||c===void 0?void 0:c.name)===ReadableStream.name||n instanceof ReadableStream)};Ct.isReadableStream=Xf});var Ut=U((yt)=>{Object.defineProperty(yt,"__esModule",{value:!0});yt.sdkStreamMixin=void 0;var Gf=rt(),jf=R(),Wf=xt(),Jf=v(),Ft=J(),Et="The stream has already been transformed.",Mf=(n)=>{var c,t;if(!St(n)&&!Ft.isReadableStream(n)){let r=((t=(c=n===null||n===void 0?void 0:n.__proto__)===null||c===void 0?void 0:c.constructor)===null||t===void 0?void 0:t.name)||n;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let i=!1,h=async()=>{if(i)throw new Error(Et);return i=!0,await Gf.streamCollector(n)},f=(r)=>{if(typeof r.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return r.stream()};return Object.assign(n,{transformToByteArray:h,transformToString:async(r)=>{let s=await h();if(r==="base64")return jf.toBase64(s);else if(r==="hex")return Wf.toHex(s);else if(r===void 0||r==="utf8"||r==="utf-8")return Jf.toUtf8(s);else if(typeof TextDecoder==="function")return new TextDecoder(r).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(i)throw new Error(Et);if(i=!0,St(n))return f(n);else if(Ft.isReadableStream(n))return n;else throw new Error(`Cannot transform payload to web stream, got ${n}`)}})};yt.sdkStreamMixin=Mf;var St=(n)=>typeof Blob==="function"&&n instanceof Blob});var ot=U((Lt)=>{Object.defineProperty(Lt,"__esModule",{value:!0});Lt.sdkStreamMixin=void 0;var bf=_c(),Af=A(),Ln=import.meta.require("stream"),Rf=import.meta.require("util"),Bf=Ut(),Dt="The stream has already been transformed.",Hf=(n)=>{var c,t;if(!(n instanceof Ln.Readable))try{return Bf.sdkStreamMixin(n)}catch(f){let r=((t=(c=n===null||n===void 0?void 0:n.__proto__)===null||c===void 0?void 0:c.constructor)===null||t===void 0?void 0:t.name)||n;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let i=!1,h=async()=>{if(i)throw new Error(Dt);return i=!0,await bf.streamCollector(n)};return Object.assign(n,{transformToByteArray:h,transformToString:async(f)=>{let r=await h();if(f===void 0||Buffer.isEncoding(f))return Af.fromArrayBuffer(r.buffer,r.byteOffset,r.byteLength).toString(f);else return new Rf.TextDecoder(f).decode(r)},transformToWebStream:()=>{if(i)throw new Error(Dt);if(n.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Ln.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return i=!0,Ln.Readable.toWeb(n)}})};Lt.sdkStreamMixin=Hf});var zt=U((Nt)=>{Object.defineProperty(Nt,"__esModule",{value:!0});Nt.splitStream=void 0;async function kf(n){if(typeof n.stream==="function")n=n.stream();return n.tee()}Nt.splitStream=kf});var Vt=U((Qt)=>{Object.defineProperty(Qt,"__esModule",{value:!0});Qt.splitStream=void 0;var Zt=import.meta.require("stream"),Pf=zt(),lf=J();async function Of(n){if(lf.isReadableStream(n))return Pf.splitStream(n);let c=new Zt.PassThrough,t=new Zt.PassThrough;return n.pipe(c),n.pipe(t),[c,t]}Qt.splitStream=Of});var jt=U((Xt)=>{Object.defineProperty(Xt,"__esModule",{value:!0});Xt.headStream=void 0;async function pf(n,c){var t;let i=0,h=[],f=n.getReader(),r=!1;while(!r){let{done:x,value:S}=await f.read();if(S)h.push(S),i+=(t=S===null||S===void 0?void 0:S.byteLength)!==null&&t!==void 0?t:0;if(i>=c)break;r=x}f.releaseLock();let s=new Uint8Array(Math.min(c,i)),w=0;for(let x of h){if(x.byteLength>s.byteLength-w){s.set(x.subarray(0,s.byteLength-w),w);break}else s.set(x,w);w+=x.length}return s}Xt.headStream=pf});var bt=U((Jt)=>{Object.defineProperty(Jt,"__esModule",{value:!0});Jt.headStream=void 0;var vf=import.meta.require("stream"),qf=jt(),af=J(),mf=(n,c)=>{if(af.isReadableStream(n))return qf.headStream(n,c);return new Promise((t,i)=>{let h=new Wt;h.limit=c,n.pipe(h),n.on("error",(f)=>{h.end(),i(f)}),h.on("error",i),h.on("finish",function(){let f=new Uint8Array(Buffer.concat(this.buffers));t(f)})})};Jt.headStream=mf;class Wt extends vf.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(n,c,t){var i;if(this.buffers.push(n),this.bytesBuffered+=(i=n.byteLength)!==null&&i!==void 0?i:0,this.bytesBuffered>=this.limit){let h=this.bytesBuffered-this.limit,f=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=f.subarray(0,f.byteLength-h),this.emit("finish")}t()}}});var gn=U((Rt)=>{Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ChecksumStream=void 0;var _f=R(),nr=import.meta.require("stream");class At extends nr.Duplex{constructor({expectedChecksum:n,checksum:c,source:t,checksumSourceLocation:i,base64Encoder:h}){var f,r;super();if(typeof t.pipe==="function")this.source=t;else throw new Error(`@smithy/util-stream: unsupported source type ${(r=(f=t===null||t===void 0?void 0:t.constructor)===null||f===void 0?void 0:f.name)!==null&&r!==void 0?r:t} in ChecksumStream.`);this.base64Encoder=h!==null&&h!==void 0?h:_f.toBase64,this.expectedChecksum=n,this.checksum=c,this.checksumSourceLocation=i,this.source.pipe(this)}_read(n){}_write(n,c,t){try{this.checksum.update(n),this.push(n)}catch(i){return t(i)}return t()}async _final(n){try{let c=await this.checksum.digest(),t=this.base64Encoder(c);if(this.expectedChecksum!==t)return n(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${t}" in response header "${this.checksumSourceLocation}".`))}catch(c){return n(c)}return this.push(null),n()}}Rt.ChecksumStream=At});var lt=U((kt)=>{Object.defineProperty(kt,"__esModule",{value:!0});kt.ChecksumStream=void 0;var cr=typeof ReadableStream==="function"?ReadableStream:function(){};class Ht extends cr{}kt.ChecksumStream=Ht});var vt=U((Ot)=>{Object.defineProperty(Ot,"__esModule",{value:!0});Ot.createChecksumStream=void 0;var tr=R(),ir=J(),hr=lt(),fr=({expectedChecksum:n,checksum:c,source:t,checksumSourceLocation:i,base64Encoder:h})=>{var f,r;if(!ir.isReadableStream(t))throw new Error(`@smithy/util-stream: unsupported source type ${(r=(f=t===null||t===void 0?void 0:t.constructor)===null||f===void 0?void 0:f.name)!==null&&r!==void 0?r:t} in ChecksumStream.`);let s=h!==null&&h!==void 0?h:tr.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let w=new TransformStream({start(){},async transform(S,u){c.update(S),u.enqueue(S)},async flush(S){let u=await c.digest(),d=s(u);if(n!==d){let $=new Error(`Checksum mismatch: expected "${n}" but received "${d}" in response header "${i}".`);S.error($)}else S.terminate()}});t.pipeThrough(w);let x=w.readable;return Object.setPrototypeOf(x,hr.ChecksumStream.prototype),x};Ot.createChecksumStream=fr});var mt=U((qt)=>{Object.defineProperty(qt,"__esModule",{value:!0});qt.createChecksumStream=void 0;var rr=J(),sr=gn(),ur=vt();function wr(n){if(typeof ReadableStream==="function"&&rr.isReadableStream(n.source))return ur.createChecksumStream(n);return new sr.ChecksumStream(n)}qt.createChecksumStream=wr});var hi=U((Js,K)=>{var{defineProperty:fn,getOwnPropertyDescriptor:$r,getOwnPropertyNames:Tr}=Object,dr=Object.prototype.hasOwnProperty,Yn=(n,c)=>fn(n,"name",{value:c,configurable:!0}),xr=(n,c)=>{for(var t in c)fn(n,t,{get:c[t],enumerable:!0})},on=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Tr(c))if(!dr.call(n,h)&&h!==t)fn(n,h,{get:()=>c[h],enumerable:!(i=$r(c,h))||i.enumerable})}return n},M=(n,c,t)=>(on(n,c,"default"),t&&on(t,c,"default")),Cr=(n)=>on(fn({},"__esModule",{value:!0}),n),Q={};xr(Q,{Uint8ArrayBlobAdapter:()=>Nn});K.exports=Cr(Q);var _t=R(),ni=v();function ci(n,c="utf-8"){if(c==="base64")return _t.toBase64(n);return ni.toUtf8(n)}Yn(ci,"transformToString");function ti(n,c){if(c==="base64")return Nn.mutate(_t.fromBase64(n));return Nn.mutate(ni.fromUtf8(n))}Yn(ti,"transformFromString");var ii=class n extends Uint8Array{static fromString(c,t="utf-8"){switch(typeof c){case"string":return ti(c,t);default:throw new Error(`Unsupported conversion from ${typeof c} to Uint8ArrayBlobAdapter.`)}}static mutate(c){return Object.setPrototypeOf(c,n.prototype),c}transformToString(c="utf-8"){return ci(this,c)}};Yn(ii,"Uint8ArrayBlobAdapter");var Nn=ii;M(Q,yc(),K.exports);M(Q,ot(),K.exports);M(Q,Vt(),K.exports);M(Q,bt(),K.exports);M(Q,J(),K.exports);M(Q,mt(),K.exports);M(Q,gn(),K.exports)});var H=U((Ms,si)=>{var{defineProperty:Qn,getOwnPropertyDescriptor:er,getOwnPropertyNames:Fr}=Object,Er=Object.prototype.hasOwnProperty,Sr=(n,c)=>{for(var t in c)Qn(n,t,{get:c[t],enumerable:!0})},yr=(n,c,t,i)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Fr(c))if(!Er.call(n,h)&&h!==t)Qn(n,h,{get:()=>c[h],enumerable:!(i=er(c,h))||i.enumerable})}return n},Ir=(n)=>yr(Qn({},"__esModule",{value:!0}),n),fi={};Sr(fi,{RequestBuilder:()=>ri,collectBody:()=>Ur,extendedEncodeURIComponent:()=>Zn,requestBuilder:()=>gr,resolvedPath:()=>or});si.exports=Ir(fi);var zn=hi(),Ur=async(n=new Uint8Array,c)=>{if(n instanceof Uint8Array)return zn.Uint8ArrayBlobAdapter.mutate(n);if(!n)return zn.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let t=c.streamCollector(n);return zn.Uint8ArrayBlobAdapter.mutate(await t)};function Zn(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(c){return"%"+c.charCodeAt(0).toString(16).toUpperCase()})}var Dr=H(),Lr=m();function gr(n,c){return new ri(n,c)}var ri=class{constructor(n,c){this.input=n,this.context=c,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:n,protocol:c="https",port:t,path:i}=await this.context.endpoint();this.path=i;for(let h of this.resolvePathStack)h(this.path);return new Lr.HttpRequest({protocol:c,hostname:this.hostname||n,port:t,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(n){return this.hostname=n,this}bp(n){return this.resolvePathStack.push((c)=>{this.path=`${(c==null?void 0:c.endsWith("/"))?c.slice(0,-1):c||""}`+n}),this}p(n,c,t,i){return this.resolvePathStack.push((h)=>{this.path=Dr.resolvedPath(h,this.input,n,c,t,i)}),this}h(n){return this.headers=n,this}q(n){return this.query=n,this}b(n){return this.body=n,this}m(n){return this.method=n,this}},or=(n,c,t,i,h,f)=>{if(c!=null&&c[t]!==void 0){let r=i();if(r.length<=0)throw new Error("Empty value provided for input HTTP label: "+t+".");n=n.replace(h,f?r.split("/").map((s)=>Zn(s)).join("/"):Zn(r))}else throw new Error("No value provided for input HTTP label: "+t+".");return n}});var ln=Z($n(),1);class Mi{constructor(n){this.config=n,this.middlewareStack=ln.constructStack()}send(n,c,t){let i=typeof c!=="function"?c:void 0,h=typeof c==="function"?c:t,f=i===void 0&&this.config.cacheMiddleware===!0,r;if(f){if(!this.handlers)this.handlers=new WeakMap;let s=this.handlers;if(s.has(n.constructor))r=s.get(n.constructor);else r=n.resolveMiddleware(this.middlewareStack,this.config,i),s.set(n.constructor,r)}else delete this.handlers,r=n.resolveMiddleware(this.middlewareStack,this.config,i);if(h)r(n).then((s)=>h(null,s.output),(s)=>h(s)).catch(()=>{});else return r(n).then((s)=>s.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var On=Z($n(),1),pn=Z(P(),1);class vn{constructor(){this.middlewareStack=On.constructStack()}static classBuilder(){return new qn}resolveMiddlewareWithContext(n,c,t,{middlewareFn:i,clientName:h,commandName:f,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,smithyContext:w,additionalContext:x,CommandCtor:S}){for(let I of i.bind(this)(S,n,c,t))this.middlewareStack.use(I);let u=n.concat(this.middlewareStack),{logger:d}=c,$={logger:d,clientName:h,commandName:f,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,[pn.SMITHY_CONTEXT_KEY]:{commandInstance:this,...w},...x},{requestHandler:E}=c;return u.resolve((I)=>E.handle(I.request,t||{}),$)}}class qn{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(n)=>n,this._outputFilterSensitiveLog=(n)=>n,this._serializer=null,this._deserializer=null}init(n){this._init=n}ep(n){return this._ep=n,this}m(n){return this._middlewareFn=n,this}s(n,c,t={}){return this._smithyContext={service:n,operation:c,...t},this}c(n={}){return this._additionalContext=n,this}n(n,c){return this._clientName=n,this._commandName=c,this}f(n=(t)=>t,c=(t)=>t){return this._inputFilterSensitiveLog=n,this._outputFilterSensitiveLog=c,this}ser(n){return this._serializer=n,this}de(n){return this._deserializer=n,this}build(){let n=this,c;return c=class extends vn{static getEndpointParameterInstructions(){return n._ep}constructor(...[t]){super();this.serialize=n._serializer,this.deserialize=n._deserializer,this.input=t??{},n._init(this)}resolveMiddleware(t,i,h){return this.resolveMiddlewareWithContext(t,i,h,{CommandCtor:c,middlewareFn:n._middlewareFn,clientName:n._clientName,commandName:n._commandName,inputFilterSensitiveLog:n._inputFilterSensitiveLog,outputFilterSensitiveLog:n._outputFilterSensitiveLog,smithyContext:n._smithyContext,additionalContext:n._additionalContext})}}}}var us="***SensitiveInformation***";var $s=(n,c)=>{for(let t of Object.keys(n)){let i=n[t],h=async function(r,s,w){let x=new i(r);if(typeof s==="function")this.send(x,s);else if(typeof w==="function"){if(typeof s!=="object")throw new Error(`Expected http options but got ${typeof s}`);this.send(x,s||{},w)}else return this.send(x,s)},f=(t[0].toLowerCase()+t.slice(1)).replace(/Command$/,"");c.prototype[f]=h}};class an extends Error{constructor(n){super(n.message);Object.setPrototypeOf(this,an.prototype),this.name=n.name,this.$fault=n.$fault,this.$metadata=n.$metadata}}var mn=(n,c={})=>{Object.entries(c).filter(([,i])=>i!==void 0).forEach(([i,h])=>{if(n[i]==null||n[i]==="")n[i]=h});let t=n.message||n.Message||"UnknownError";return n.message=t,delete n.Message,n};var Nr=Z(H(),1);var Yr=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string"){let c=parseFloat(n);if(!Number.isNaN(c)){if(String(c)!==String(n))ei.warn(Ci(`Expected number but observed string: ${n}`));return c}}if(typeof n==="number")return n;throw new TypeError(`Expected number, got ${typeof n}: ${n}`)},zr=Math.ceil(340282346638528860000000000000000000000),ui=(n)=>{let c=Yr(n);if(c!==void 0&&!Number.isNaN(c)&&c!==1/0&&c!==-1/0){if(Math.abs(c)>zr)throw new TypeError(`Expected 32-bit float, got ${n}`)}return c},Zr=(n)=>{if(n===null||n===void 0)return;if(Number.isInteger(n)&&!Number.isNaN(n))return n;throw new TypeError(`Expected integer, got ${typeof n}: ${n}`)};var wi=(n)=>Kn(n,32),$i=(n)=>Kn(n,16),Ti=(n)=>Kn(n,8),Kn=(n,c)=>{let t=Zr(n);if(t!==void 0&&Qr(t,c)!==t)throw new TypeError(`Expected ${c}-bit integer, got ${n}`);return t},Qr=(n,c)=>{switch(c){case 32:return Int32Array.of(n)[0];case 16:return Int16Array.of(n)[0];case 8:return Int8Array.of(n)[0]}},Rs=(n,c)=>{if(n===null||n===void 0){if(c)throw new TypeError(`Expected a non-null value for ${c}`);throw new TypeError("Expected a non-null value")}return n},Bs=(n)=>{if(n===null||n===void 0)return;if(typeof n==="object"&&!Array.isArray(n))return n;let c=Array.isArray(n)?"array":typeof n;throw new TypeError(`Expected object, got ${c}: ${n}`)},Hs=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string")return n;if(["boolean","number","bigint"].includes(typeof n))return ei.warn(Ci(`Expected string, got ${typeof n}: ${n}`)),String(n);throw new TypeError(`Expected string, got ${typeof n}: ${n}`)};var di=(n)=>{if(typeof n=="string")return ui(rn(n));return ui(n)},Kr=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,rn=(n)=>{let c=n.match(Kr);if(c===null||c[0].length!==n.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(n)};var ks=(n)=>{if(typeof n==="string")return wi(rn(n));return wi(n)},Vn=(n)=>{if(typeof n==="string")return $i(rn(n));return $i(n)},xi=(n)=>{if(typeof n==="string")return Ti(rn(n));return Ti(n)},Ci=(n)=>{return String(new TypeError(n).stack||n).split("\n").slice(0,5).filter((c)=>!c.includes("stackTraceWarning")).join("\n")},ei={warn:console.warn};var Vr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var Xr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),ps=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let c=Xr.exec(n);if(!c)throw new TypeError("Invalid RFC-3339 date-time value");let[t,i,h,f,r,s,w,x]=c,S=Vn(Xn(i)),u=b(h,"month",1,12),d=b(f,"day",1,31);return Fi(S,u,d,{hours:r,minutes:s,seconds:w,fractionalMilliseconds:x})},Gr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),vs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let c=Gr.exec(n);if(!c)throw new TypeError("Invalid RFC-3339 date-time value");let[t,i,h,f,r,s,w,x,S]=c,u=Vn(Xn(i)),d=b(h,"month",1,12),$=b(f,"day",1,31),E=Fi(u,d,$,{hours:r,minutes:s,seconds:w,fractionalMilliseconds:x});if(S.toUpperCase()!="Z")E.setTime(E.getTime()-br(S));return E},qs=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),as=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ms=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var Fi=(n,c,t,i)=>{let h=c-1;return Wr(n,h,t),new Date(Date.UTC(n,h,t,b(i.hours,"hour",0,23),b(i.minutes,"minute",0,59),b(i.seconds,"seconds",0,60),Mr(i.fractionalMilliseconds)))};var jr=[31,28,31,30,31,30,31,31,30,31,30,31],Wr=(n,c,t)=>{let i=jr[c];if(c===1&&Jr(n))i=29;if(t>i)throw new TypeError(`Invalid day for ${Vr[c]} in ${n}: ${t}`)},Jr=(n)=>{return n%4===0&&(n%100!==0||n%400===0)},b=(n,c,t,i)=>{let h=xi(Xn(n));if(h<t||h>i)throw new TypeError(`${c} must be between ${t} and ${i}, inclusive`);return h},Mr=(n)=>{if(n===null||n===void 0)return 0;return di("0."+n)*1000},br=(n)=>{let c=n[0],t=1;if(c=="+")t=1;else if(c=="-")t=-1;else throw new TypeError(`Offset direction, ${c}, must be "+" or "-"`);let i=Number(n.substring(1,3)),h=Number(n.substring(4,6));return t*(i*60+h)*60*1000},Xn=(n)=>{let c=0;while(c<n.length-1&&n.charAt(c)==="0")c++;if(c===0)return n;return n.slice(c)};var Ar=({output:n,parsedBody:c,exceptionCtor:t,errorCode:i})=>{let h=Rr(n),f=h.httpStatusCode?h.httpStatusCode+"":void 0,r=new t({name:c?.code||c?.Code||i||f||"UnknownError",$fault:"client",$metadata:h});throw mn(r,c)},cu=(n)=>{return({output:c,parsedBody:t,errorCode:i})=>{Ar({output:c,parsedBody:t,exceptionCtor:n,errorCode:i})}},Rr=(n)=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]});var iu=(n)=>{switch(n){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var Ei=!1,fu=(n)=>{if(n&&!Ei&&parseInt(n.substring(1,n.indexOf(".")))<16)Ei=!0};var Br=Z(H(),1);var Gn=Z(P(),1);var Si=(n)=>{let c=[];for(let t in Gn.AlgorithmId){let i=Gn.AlgorithmId[t];if(n[i]===void 0)continue;c.push({algorithmId:()=>i,checksumConstructor:()=>n[i]})}return{_checksumAlgorithms:c,addChecksumAlgorithm(t){this._checksumAlgorithms.push(t)},checksumAlgorithms(){return this._checksumAlgorithms}}},yi=(n)=>{let c={};return n.checksumAlgorithms().forEach((t)=>{c[t.algorithmId()]=t.checksumConstructor()}),c};var Ii=(n)=>{let c=n.retryStrategy;return{setRetryStrategy(t){c=t},retryStrategy(){return c}}},Ui=(n)=>{let c={};return c.retryStrategy=n.retryStrategy(),c};var du=(n)=>{return{...Si(n),...Ii(n)}};var xu=(n)=>{return{...yi(n),...Ui(n)}};var Eu=(n)=>Array.isArray(n)?n:[n];var Iu=(n)=>{return n!=null};var jn=function(){let n=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,n.prototype),t};jn.prototype=Object.create(String.prototype,{constructor:{value:jn,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(jn,String);class Hr{trace(){}debug(){}info(){}warn(){}error(){}}function kr(n,c,t){let i,h,f;if(typeof c==="undefined"&&typeof t==="undefined")i={},f=n;else if(i=n,typeof c==="function")return h=c,f=t,Pr(i,h,f);else f=c;for(let r of Object.keys(f)){if(!Array.isArray(f[r])){i[r]=f[r];continue}Di(i,null,f,r)}return i}var gu=(n,c)=>{let t={};for(let i in c)Di(t,n,c,i);return t},Pr=(n,c,t)=>{return kr(n,Object.entries(t).reduce((i,[h,f])=>{if(Array.isArray(f))i[h]=f;else if(typeof f==="function")i[h]=[c,f()];else i[h]=[c,f];return i},{}))},Di=(n,c,t,i)=>{if(c!==null){let r=t[i];if(typeof r==="function")r=[,r];let[s=lr,w=Or,x=i]=r;if(typeof s==="function"&&s(c[x])||typeof s!=="function"&&!!s)n[i]=w(c[x]);return}let[h,f]=t[i];if(typeof f==="function"){let r,s=h===void 0&&(r=f())!=null,w=typeof h==="function"&&!!h(void 0)||typeof h!=="function"&&!!h;if(s)n[i]=r;else if(w)n[i]=f()}else{let r=h===void 0&&f!=null,s=typeof h==="function"&&!!h(f)||typeof h!=="function"&&!!h;if(r||s)n[i]=f}},lr=(n)=>n!=null,Or=(n)=>n;var pr=Z(H(),1);var Li=(n)=>{if(n==null)return{};if(Array.isArray(n))return n.filter((c)=>c!=null).map(Li);if(typeof n==="object"){let c={};for(let t of Object.keys(n)){if(n[t]==null)continue;c[t]=Li(n[t])}return c}return n};var h0=(n)=>{let c=n.httpHandler;return{setHttpHandler(t){c=t},httpHandler(){return c},updateHttpClientConfig(t,i){c.updateHttpClientConfig(t,i)},httpHandlerConfigs(){return c.httpHandlerConfigs()}}},f0=(n)=>{return{httpHandler:n.httpHandler()}};var vr=Z(P(),1);class Wn{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){let c=new Wn({...n,headers:{...n.headers}});if(c.query)c.query=qr(c.query);return c}static isInstance(n){if(!n)return!1;let c=n;return"method"in c&&"protocol"in c&&"hostname"in c&&"path"in c&&typeof c.query==="object"&&typeof c.headers==="object"}clone(){return Wn.clone(this)}}function qr(n){return Object.keys(n).reduce((c,t)=>{let i=n[t];return{...c,[t]:Array.isArray(i)?[...i]:i}},{})}class sn{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;let c=n;return typeof c.statusCode==="number"&&typeof c.headers==="object"}}var un=Z(Fn(),1);function Jn(n){let c=[];for(let t of Object.keys(n).sort()){let i=n[t];if(t=un.escapeUri(t),Array.isArray(i))for(let h=0,f=i.length;h<f;h++)c.push(`${t}=${un.escapeUri(i[h])}`);else{let h=t;if(i||typeof i==="string")h+=`=${un.escapeUri(i)}`;c.push(h)}}return c.join("&")}import{Agent as Zi,request as _r}from"http";import{Agent as Qi,request as ns}from"https";var gi=["ECONNRESET","EPIPE","ETIMEDOUT"];var Mn=(n)=>{let c={};for(let t of Object.keys(n)){let i=n[t];c[t]=Array.isArray(i)?i.join(","):i}return c};var oi=(n,c,t=0)=>{if(!t)return-1;let i=(h)=>{let f=setTimeout(()=>{n.destroy(),c(Object.assign(new Error(`Socket timed out without establishing a connection within ${t} ms`),{name:"TimeoutError"}))},t-h),r=(s)=>{if(s?.connecting)s.on("connect",()=>{clearTimeout(f)});else clearTimeout(f)};if(n.socket)r(n.socket);else n.on("socket",r)};if(t<2000)return i(0),0;return setTimeout(i.bind(null,1000),1000)};var Ni=(n,{keepAlive:c,keepAliveMsecs:t},i=3000)=>{if(c!==!0)return-1;let h=()=>{if(n.socket)n.socket.setKeepAlive(c,t||0);else n.on("socket",(f)=>{f.setKeepAlive(c,t||0)})};if(i===0)return h(),0;return setTimeout(h,i)};var Yi=(n,c,t=0)=>{let i=(h)=>{n.setTimeout(t-h,()=>{n.destroy(),c(Object.assign(new Error(`Connection timed out after ${t} ms`),{name:"TimeoutError"}))})};if(0<t&&t<6000)return i(0),0;return setTimeout(i.bind(null,t===0?0:3000),3000)};import{Readable as ar}from"stream";var zi=1000;async function bn(n,c,t=zi){let i=c.headers??{},h=i.Expect||i.expect,f=-1,r=!1;if(h==="100-continue")await Promise.race([new Promise((s)=>{f=Number(setTimeout(s,Math.max(zi,t)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(f),s()}),n.on("error",()=>{r=!0,clearTimeout(f),s()})})]);if(!r)mr(n,c.body)}function mr(n,c){if(c instanceof ar){c.pipe(n);return}if(c){if(Buffer.isBuffer(c)||typeof c==="string"){n.end(c);return}let t=c;if(typeof t==="object"&&t.buffer&&typeof t.byteOffset==="number"&&typeof t.byteLength==="number"){n.end(Buffer.from(t.buffer,t.byteOffset,t.byteLength));return}n.end(Buffer.from(c));return}n.end()}class An{static create(n){if(typeof n?.handle==="function")return n;return new An(n)}static checkSocketUsage(n,c,t=console){let{sockets:i,requests:h,maxSockets:f}=n;if(typeof f!=="number"||f===1/0)return c;let r=15000;if(Date.now()-r<c)return c;if(i&&h)for(let s in i){let w=i[s]?.length??0,x=h[s]?.length??0;if(w>=f&&x>=2*f)return t?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${w} and ${x} additional requests are enqueued.
|
|
4
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
5
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return c}constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((c,t)=>{if(typeof n==="function")n().then((i)=>{c(this.resolveDefaultConfig(i))}).catch(t);else c(this.resolveDefaultConfig(n))})}resolveDefaultConfig(n){let{requestTimeout:c,connectionTimeout:t,socketTimeout:i,httpAgent:h,httpsAgent:f}=n||{},r=!0,s=50;return{connectionTimeout:t,requestTimeout:c??i,httpAgent:(()=>{if(h instanceof Zi||typeof h?.destroy==="function")return h;return new Zi({keepAlive:!0,maxSockets:50,...h})})(),httpsAgent:(()=>{if(f instanceof Qi||typeof f?.destroy==="function")return f;return new Qi({keepAlive:!0,maxSockets:50,...f})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(n,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;return new Promise((t,i)=>{let h=void 0,f=[],r=async(T)=>{await h,f.forEach(clearTimeout),t(T)},s=async(T)=>{await h,f.forEach(clearTimeout),i(T)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(c?.aborted){let T=new Error("Request aborted");T.name="AbortError",s(T);return}let w=n.protocol==="https:",x=w?this.config.httpsAgent:this.config.httpAgent;f.push(setTimeout(()=>{this.socketWarningTimestamp=An.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let S=Jn(n.query||{}),u=void 0;if(n.username!=null||n.password!=null){let T=n.username??"",C=n.password??"";u=`${T}:${C}`}let d=n.path;if(S)d+=`?${S}`;if(n.fragment)d+=`#${n.fragment}`;let $=n.hostname??"";if($[0]==="["&&$.endsWith("]"))$=n.hostname.slice(1,-1);else $=n.hostname;let E={headers:n.headers,host:$,method:n.method,path:d,port:n.port,agent:x,auth:u},e=(w?ns:_r)(E,(T)=>{let C=new sn({statusCode:T.statusCode||-1,reason:T.statusMessage,headers:Mn(T.headers),body:T});r({response:C})});if(e.on("error",(T)=>{if(gi.includes(T.code))s(Object.assign(T,{name:"TimeoutError"}));else s(T)}),c){let T=()=>{e.destroy();let C=new Error("Request aborted");C.name="AbortError",s(C)};if(typeof c.addEventListener==="function"){let C=c;C.addEventListener("abort",T,{once:!0}),e.once("close",()=>C.removeEventListener("abort",T))}else c.onabort=T}f.push(oi(e,s,this.config.connectionTimeout)),f.push(Yi(e,s,this.config.requestTimeout));let F=E.agent;if(typeof F==="object"&&"keepAlive"in F)f.push(Ni(e,{keepAlive:F.keepAlive,keepAliveMsecs:F.keepAliveMsecs}));h=bn(e,n,this.config.requestTimeout).catch((T)=>{return f.forEach(clearTimeout),i(T)})})}updateHttpClientConfig(n,c){this.config=void 0,this.configProvider=this.configProvider.then((t)=>{return{...t,[n]:c}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as cs}from"stream";class Rn extends cs{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,c,t){this.bufferedBytes.push(n),t()}}var tw=(n)=>{if(ts(n))return is(n);return new Promise((c,t)=>{let i=new Rn;n.pipe(i),n.on("error",(h)=>{i.end(),t(h)}),i.on("error",t),i.on("finish",function(){let h=new Uint8Array(Buffer.concat(this.bufferedBytes));c(h)})})},ts=(n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream;async function is(n){let c=[],t=n.getReader(),i=!1,h=0;while(!i){let{done:s,value:w}=await t.read();if(w)c.push(w),h+=w.length;i=s}let f=new Uint8Array(h),r=0;for(let s of c)f.set(s,r),r+=s.length;return f}export{h0 as wa,f0 as xa,Wn as ya,sn as za,m as Aa,cc as Ba,A as Ca,v as Da,Fn as Ea,xt as Fa,hi as Ga,H as Ha,$n as Ia,Mi as Ja,vn as Ka,us as La,$s as Ma,Zr as Na,wi as Oa,Rs as Pa,Bs as Qa,Hs as Ra,ks as Sa,ps as Ta,vs as Ua,an as Va,mn as Wa,cu as Xa,iu as Ya,fu as Za,Br as _a,du as $a,xu as ab,Eu as bb,Iu as cb,Hr as db,kr as eb,gu as fb,Li as gb,An as hb,tw as ib};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{kb as u,ob as w}from"./chunk-8gx9at51.js";import{wb as m}from"./chunk-gg80s18j.js";import{xb as s}from"./chunk-d2dbhn2h.js";var a=s(m(),1);var g=s(m(),1);function c(o){try{let r=new Set(Array.from(o.match(/([A-Z_]){3,}/g)??[]));return r.delete("CONFIG"),r.delete("CONFIG_PREFIX_SEPARATOR"),r.delete("ENV"),[...r].join(", ")}catch(r){return o}}var h=(o,r)=>async()=>{try{let t=o(process.env);if(t===void 0)throw new Error;return t}catch(t){throw new g.CredentialsProviderError(t.message||`Not found in ENV: ${c(o.toString())}`,{logger:r})}};var y=s(m(),1);var C=(o,{preferredFile:r="config",...t}={})=>async()=>{let e=u(t),{configFile:n,credentialsFile:i}=await w(t),f=i[e]||{},p=n[e]||{},N=r==="config"?{...f,...p}:{...p,...f};try{let d=o(N,r==="config"?n:i);if(d===void 0)throw new Error;return d}catch(l){throw new y.CredentialsProviderError(l.message||`Not found in config files w/ profile [${e}]: ${c(o.toString())}`,{logger:t.logger})}};var F=s(m(),1),x=(o)=>typeof o==="function",S=(o)=>x(o)?async()=>await o():F.fromStatic(o);var T=({environmentVariableSelector:o,configFileSelector:r,default:t},e={})=>a.memoize(a.chain(h(o),C(r,e),S(t)));function E(o){let r={};if(o=o.replace(/^\?/,""),o)for(let t of o.split("&")){let[e,n=null]=t.split("=");if(e=decodeURIComponent(e),n)n=decodeURIComponent(n);if(!(e in r))r[e]=n;else if(Array.isArray(r[e]))r[e].push(n);else r[e]=[r[e],n]}return r}var v=(o)=>{if(typeof o==="string")return v(new URL(o));let{hostname:r,pathname:t,port:e,protocol:n,search:i}=o,f;if(i)f=E(i);return{hostname:r,port:e?parseInt(e):void 0,protocol:n,path:t,query:f}};
|
|
2
|
+
export{T as ua,v as va};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{L as Ce}from"./chunk-mevackhg.js";import{$ as Je,M as nr,N as or,O as dr,P as yr,Q as Yr,R as H,S as _,T as cr,U as Ie,V as Re,W as Pe,X as Te,Y as D,Z as tr,_ as Ge,aa as Ve,ba as We,ca as ar,da as mr,ea as E,fa as vr,ga as Ae,ha as Ke,ia as wr,ja as Me,ka as Er,la as Ye,ma as Ze,na as fe,oa as He,pa as De,qa as Ue,ra as Ne,sa as ir,ta as lr}from"./chunk-8yky4bsd.js";import{ua as $,va as je}from"./chunk-sk3x55wm.js";import{$a as rr,Da as _r,Ja as kr,Ka as S,La as t,Ma as Mr,Na as C,Oa as T,Pa as b,Qa as j,Ra as h,Va as Sr,Wa as a,Xa as jr,Ya as Be,Za as Le,ab as sr,db as Fe,eb as y,fb as o,gb as I,hb as Qe,ib as Xe,wa as ue,xa as er}from"./chunk-ryjbc6dz.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import{xb as m}from"./chunk-d2dbhn2h.js";var R=m(_(),1);var se=m(D(),1),U=m(Yr(),1),ie=async(e,s,r)=>{return{operation:U.getSmithyContext(s).operation,region:await U.normalizeProvider(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function Zr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}}function N(e){return{schemeId:"smithy.api#noAuth"}}var le=(e)=>{let s=[];switch(e.operation){case"CreateToken":{s.push(N(e));break}case"RegisterClient":{s.push(N(e));break}case"StartDeviceAuthorization":{s.push(N(e));break}default:s.push(Zr(e))}return s},he=(e)=>{return{...se.resolveAwsSdkSigV4Config(e)}};var ne=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},k={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oe={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.679.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso-oidc"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.679.0","@aws-sdk/credential-provider-node":"3.679.0","@aws-sdk/middleware-host-header":"3.679.0","@aws-sdk/middleware-logger":"3.679.0","@aws-sdk/middleware-recursion-detection":"3.679.0","@aws-sdk/middleware-user-agent":"3.679.0","@aws-sdk/region-config-resolver":"3.679.0","@aws-sdk/types":"3.679.0","@aws-sdk/util-endpoints":"3.679.0","@aws-sdk/util-user-agent-browser":"3.679.0","@aws-sdk/util-user-agent-node":"3.679.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.679.0"},browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso-oidc"}};var _e=m(D(),1);var qe=m(D(),1),xe=m(_(),1);var q=m(_r(),1);var de={["required"]:!1,type:"String"},ye={["required"]:!0,default:!1,type:"Boolean"},ce={["ref"]:"Endpoint"},ke={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Ee={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},v={},te={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Se={["ref"]:"PartitionResult"},ae={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Se,"supportsDualStack"]}]},me=[ke],ve=[Ee],we=[{["ref"]:"Region"}],Hr={version:"1.0",parameters:{Region:de,UseDualStack:ye,UseFIPS:ye,Endpoint:de},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ce]}],rules:[{conditions:me,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:ve,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ce,properties:v,headers:v},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:we}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:we,assign:"PartitionResult"}],rules:[{conditions:[ke,Ee],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,te]},ae],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:v,headers:v},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:me,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[te,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Se,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:v,headers:v},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:v,headers:v},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:ve,rules:[{conditions:[ae],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:v,headers:v},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:v,headers:v},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},$e=Hr;var Nr=new Ie({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),be=(e,s={})=>{return Nr.get(e,()=>Pe($e,{endpointParams:e,logger:s.logger}))};Re.aws=Te;var ze=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??De,base64Encoder:e?.base64Encoder??Ue,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??be,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??le,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new qe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new xe.NoAuthSigner}],logger:e?.logger??new Fe,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??je,utf8Decoder:e?.utf8Decoder??q.fromUtf8,utf8Encoder:e?.utf8Encoder??q.toUtf8}};var pe=(e)=>{Le(process.version);let s=Ne(e),r=()=>s().then(Be),i=ze(e);return _e.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??He,credentialDefaultProvider:e?.credentialDefaultProvider??Ce,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ye({serviceId:i.serviceId,clientVersion:oe.version}),maxAttempts:e?.maxAttempts??$(Ke),region:e?.region??$(Ve,We),requestHandler:Qe.create(e?.requestHandler??r),retryMode:e?.retryMode??$({...Me,default:async()=>(await r()).retryMode||Ae}),sha256:e?.sha256??fe.bind(null,"sha256"),streamCollector:e?.streamCollector??Xe,useDualstackEndpoint:e?.useDualstackEndpoint??$(Ge),useFipsEndpoint:e?.useFipsEndpoint??$(Je),userAgentAppId:e?.userAgentAppId??$(Ze)}};var ge=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:r,credentials:i}=e;return{setHttpAuthScheme(l){let n=s.findIndex((P)=>P.schemeId===l.schemeId);if(n===-1)s.push(l);else s.splice(n,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){r=l},httpAuthSchemeProvider(){return r},setCredentials(l){i=l},credentials(){return i}}},Oe=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var x=(e)=>e,hr=(e,s)=>{let r={...x(ir(e)),...x(rr(e)),...x(ue(e)),...x(ge(e))};return s.forEach((i)=>i.configure(r)),{...e,...lr(r),...sr(r),...er(r),...Oe(r)}};class p extends kr{constructor(...[e]){let s=pe(e||{}),r=ne(s),i=cr(r),l=wr(i),n=ar(l),P=nr(n),Lr=vr(P),Qr=he(Lr),re=hr(Qr,e?.extensions||[]);super(re);this.config=re,this.middlewareStack.use(tr(this.config)),this.middlewareStack.use(Er(this.config)),this.middlewareStack.use(mr(this.config)),this.middlewareStack.use(or(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(yr(this.config)),this.middlewareStack.use(R.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ie,identityProviderConfigProvider:async(Xr)=>new R.DefaultIdentityProviderConfig({"aws.auth#sigv4":Xr.credentials})})),this.middlewareStack.use(R.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}var Vr=m(H(),1);class d extends Sr{constructor(e){super(e);Object.setPrototypeOf(this,d.prototype)}}class z extends d{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,z.prototype),this.error=e.error,this.error_description=e.error_description}}class G extends d{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends d{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends d{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends d{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends d{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends d{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends d{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends d{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends d{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description}}class Q extends d{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends d{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Y extends d{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}class Z extends d{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}var $r=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),Ir=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Rr=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Pr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Tr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),br=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var w=m(D(),1),F=m(_(),1);var Fr=async(e,s)=>{let r=F.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},Dr=async(e,s)=>{let r=F.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l=y({[cs]:[,"t"]}),n;return n=JSON.stringify(o(e,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(P)=>I(P),subjectToken:[],subjectTokenType:[]})),r.m("POST").h(i).q(l).b(n),r.build()},Ur=async(e,s)=>{let r=F.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/client/register");let l;return l=JSON.stringify(o(e,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(n)=>I(n),issuerUrl:[],redirectUris:(n)=>I(n),scopes:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},qr=async(e,s)=>{let r=F.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/device_authorization");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],startUrl:[]})),r.m("POST").h(i).b(l),r.build()},xr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=b(j(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:T,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=b(j(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:T,idToken:h,issuedTokenType:h,refreshToken:h,scope:I,tokenType:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=b(j(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:C,clientSecret:h,clientSecretExpiresAt:C,tokenEndpoint:h});return Object.assign(r,l),r},Jr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return f(e,s);let r=y({$metadata:c(e)}),i=b(j(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{deviceCode:h,expiresIn:T,interval:T,userCode:h,verificationUri:h,verificationUriComplete:h});return Object.assign(r,l),r},f=async(e,s)=>{let r={...e,body:await w.parseJsonErrorBody(e.body,s)},i=w.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Cr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await gr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Or(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await ur(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await es(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await ss(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await ls(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ns(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await os(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await ds(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await ys(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await hs(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await rs(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await is(r,s);default:let l=r.body;return pr({output:e,parsedBody:l,errorCode:i})}},pr=jr(d),Cr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new z({$metadata:c(e),...r});return a(n,e.body)},gr=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new G({$metadata:c(e),...r});return a(n,e.body)},Or=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new J({$metadata:c(e),...r});return a(n,e.body)},ur=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new V({$metadata:c(e),...r});return a(n,e.body)},es=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new W({$metadata:c(e),...r});return a(n,e.body)},rs=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new Y({$metadata:c(e),...r});return a(n,e.body)},ss=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new A({$metadata:c(e),...r});return a(n,e.body)},is=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new Z({$metadata:c(e),...r});return a(n,e.body)},ls=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new K({$metadata:c(e),...r});return a(n,e.body)},hs=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{endpoint:h,error:h,error_description:h,region:h});Object.assign(r,l);let n=new X({$metadata:c(e),...r});return a(n,e.body)},ns=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new M({$metadata:c(e),...r});return a(n,e.body)},os=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new B({$metadata:c(e),...r});return a(n,e.body)},ds=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new L({$metadata:c(e),...r});return a(n,e.body)},ys=async(e,s)=>{let r=y({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);let n=new Q({$metadata:c(e),...r});return a(n,e.body)},c=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var cs="aws_iam";class g extends S.classBuilder().ep(k).m(function(e,s,r,i){return[Vr.getSerdePlugin(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f($r,Ir).ser(Fr).de(xr).build(){}var Wr=m(H(),1);class O extends S.classBuilder().ep(k).m(function(e,s,r,i){return[Wr.getSerdePlugin(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Rr,Pr).ser(Dr).de(zr).build(){}var Ar=m(H(),1);class u extends S.classBuilder().ep(k).m(function(e,s,r,i){return[Ar.getSerdePlugin(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Tr).ser(Ur).de(Gr).build(){}var Kr=m(H(),1);class ee extends S.classBuilder().ep(k).m(function(e,s,r,i){return[Kr.getSerdePlugin(r,this.serialize,this.deserialize),E(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(br,void 0).ser(qr).de(Jr).build(){}var ts={CreateTokenCommand:g,CreateTokenWithIAMCommand:O,RegisterClientCommand:u,StartDeviceAuthorizationCommand:ee};class Br extends p{}Mr(ts,Br);export{kr as __Client,Q as UnsupportedGrantTypeException,L as UnauthorizedClientException,br as StartDeviceAuthorizationRequestFilterSensitiveLog,ee as StartDeviceAuthorizationCommand,B as SlowDownException,d as SSOOIDCServiceException,p as SSOOIDCClient,Br as SSOOIDC,Tr as RegisterClientResponseFilterSensitiveLog,u as RegisterClientCommand,M as InvalidScopeException,X as InvalidRequestRegionException,K as InvalidRequestException,Z as InvalidRedirectUriException,A as InvalidGrantException,Y as InvalidClientMetadataException,W as InvalidClientException,V as InternalServerException,J as ExpiredTokenException,Pr as CreateTokenWithIAMResponseFilterSensitiveLog,Rr as CreateTokenWithIAMRequestFilterSensitiveLog,O as CreateTokenWithIAMCommand,Ir as CreateTokenResponseFilterSensitiveLog,$r as CreateTokenRequestFilterSensitiveLog,g as CreateTokenCommand,G as AuthorizationPendingException,z as AccessDeniedException,S as $Command};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A as f,B as j,C as I,D as J,G as g,H as p,J as a,K as m,a as M,b as N,c as O,d as Q,e as R,f as S,h as T,i as U,k as V,l as W,m as X,n as Y,o as Z,p as _,q as $,r as x,s as z,t as C,u as F,v as P,w as h,x as A,y as D,z as k}from"./chunk-
|
|
2
|
+
import{A as f,B as j,C as I,D as J,G as g,H as p,J as a,K as m,a as M,b as N,c as O,d as Q,e as R,f as S,h as T,i as U,k as V,l as W,m as X,n as Y,o as Z,p as _,q as $,r as x,s as z,t as C,u as F,v as P,w as h,x as A,y as D,z as k}from"./chunk-63pxna7y.js";import"./chunk-mevackhg.js";import"./chunk-8yky4bsd.js";import"./chunk-sk3x55wm.js";import"./chunk-ryjbc6dz.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import"./chunk-d2dbhn2h.js";import w from"process";import{runAction as n}from"@stacksjs/actions";import{cli as l,log as v}from"@stacksjs/cli";import{Action as i}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as c}from"@stacksjs/storage";import{ensureProjectIsInitialized as t}from"@stacksjs/utils";w.on("uncaughtException",(q)=>{v.debug("Buddy uncaughtException"),v.error(q),w.exit(1)});w.on("unhandledRejection",(q)=>{v.debug("Buddy unhandledRejection"),v.error(q),w.exit(1)});async function e(){let q=l("buddy");if(J(q),$(q),await t())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");let B=await n(i.KeyGenerate);if(B.isErr())v.error("Failed to set random application key.",B.error),w.exit()}M(q),N(q),O(q),Q(q),R(q),S(q),U(q),W(q),T(q),V(q),h(q),D(q),X(q),Y(q),Z(q),_(q),x(q),z(q),C(q),F(q),P(q),k(q),f(q),j(q),I(q),J(q),g(q),p(q),m(q),A(q),a(q),await o(q),q.help(),q.parse()}await e();async function o(q){let G=L.appPath("Commands"),B=c.readdirSync(G).filter((E)=>E.endsWith(".ts"));for(let E of B){let H=await import(`${G}/${E}`);if(typeof H.default==="function")H.default(q);else console.error(`Expected a default export function in ${E}, but got:`,H.default)}let K=await import(L.listenersPath("Console.ts"));if(typeof K.default==="function")K.default(q)}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,a as e,b as f,c as m,d as p,e as t,f as x,g as a,h as b,i as c,j as d,k as g,l as h,m as i,n as j,o as k,p as l,q as n,r as q,s,t as u,u as v,v as w,w as y,x as z,y as A,z as B}from"./chunk-
|
|
2
|
+
import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,a as e,b as f,c as m,d as p,e as t,f as x,g as a,h as b,i as c,j as d,k as g,l as h,m as i,n as j,o as k,p as l,q as n,r as q,s,t as u,u as v,v as w,w as y,x as z,y as A,z as B}from"./chunk-63pxna7y.js";import"./chunk-mevackhg.js";import"./chunk-8yky4bsd.js";import"./chunk-sk3x55wm.js";import"./chunk-ryjbc6dz.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import"./chunk-d2dbhn2h.js";export{M as version,L as upgrade,K as types,J as tinker,I as test,d as startDevelopmentServer,F as setup,E as seed,D as saas,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,G as optimizePkgxDeps,v as migrate,u as make,s as list,q as lint,n as key,l as install,k as http,j as generate,i as fresh,H as ensureEnvIsSet,h as domains,g as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
|
package/dist/stacks
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.68.
|
|
4
|
+
"version": "0.68.1",
|
|
5
5
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"module": "dist/index.js",
|
|
52
52
|
"types": "dist/index.d.ts",
|
|
53
53
|
"bin": {
|
|
54
|
-
"stacks": "dist/cli.
|
|
55
|
-
"stx": "dist/cli.
|
|
56
|
-
"buddy": "dist/cli.
|
|
57
|
-
"bud": "dist/cli.
|
|
54
|
+
"stacks": "dist/cli.js",
|
|
55
|
+
"stx": "dist/cli.js",
|
|
56
|
+
"buddy": "dist/cli.js",
|
|
57
|
+
"bud": "dist/cli.js"
|
|
58
58
|
},
|
|
59
59
|
"files": ["README.md", "dist"],
|
|
60
60
|
"scripts": {
|