@stacksjs/buddy 0.70.0 → 0.70.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-6wnzdvc6.js → chunk-2pj0cr49.js} +1 -1
- package/dist/chunk-2xrqj8ap.js +2 -0
- package/dist/{chunk-fbbvmxn3.js → chunk-5eh2tfep.js} +1 -1
- package/dist/chunk-5vhayxpk.js +25 -0
- package/dist/{chunk-mwdfdvqk.js → chunk-5x7y4ng3.js} +1 -1
- package/dist/chunk-5yawz4bx.js +2 -0
- package/dist/{chunk-rkh5r5e6.js → chunk-7mjm5rg8.js} +2 -2
- package/dist/{chunk-18byef1w.js → chunk-8acb2bq0.js} +1 -1
- package/dist/chunk-9gzvq5jq.js +2 -0
- package/dist/{chunk-atc0z327.js → chunk-bgqy98qw.js} +2 -2
- package/dist/{chunk-h3wmrbf0.js → chunk-c8n8bj03.js} +169 -169
- package/dist/chunk-e1kefb68.js +2 -0
- package/dist/{chunk-6v3bs3nq.js → chunk-fds99vbx.js} +1 -1
- package/dist/chunk-jky37dv1.js +5 -0
- package/dist/{chunk-2mzt8mks.js → chunk-ks9kq37e.js} +1 -1
- package/dist/chunk-mzgfvbmm.js +2 -0
- package/dist/chunk-tv4f0d0g.js +2 -0
- package/dist/{chunk-1j4se9g6.js → chunk-tx5yb9wb.js} +1 -1
- package/dist/chunk-v3a5yzn6.js +3 -0
- package/dist/chunk-vrd8j1ky.js +3 -0
- package/dist/{chunk-jx6tpg9f.js → chunk-ww48v0ap.js} +1 -1
- package/dist/chunk-wz2wxp9f.js +6 -0
- package/dist/chunk-y4k8k1by.js +3 -0
- package/dist/chunk-yatzvt36.js +2 -0
- package/dist/{chunk-38x86x4z.js → chunk-yv49ttdw.js} +1 -1
- package/dist/chunk-z80nypa9.js +1 -0
- package/dist/chunk-zm0j2nyb.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +45 -45
- package/dist/chunk-0wzn5tma.js +0 -2
- package/dist/chunk-15sp93dn.js +0 -2
- package/dist/chunk-21ynv2kp.js +0 -5
- package/dist/chunk-2az51wff.js +0 -2
- package/dist/chunk-2hfepv08.js +0 -2
- package/dist/chunk-3n3ay1vc.js +0 -3
- package/dist/chunk-eknt1w59.js +0 -6
- package/dist/chunk-enfggzq6.js +0 -2
- package/dist/chunk-gt8zekyh.js +0 -3
- package/dist/chunk-hrr9f8tw.js +0 -25
- package/dist/chunk-j3596ccv.js +0 -2
- package/dist/chunk-jm49r4wr.js +0 -2
- package/dist/chunk-p4sjnjkt.js +0 -2
- package/dist/chunk-rt83e4sa.js +0 -2
- package/dist/chunk-z1gkssny.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Gc as l6}from"./chunk-
|
|
1
|
+
import{Gc as l6}from"./chunk-5eh2tfep.js";import{Tc as U,Wc as N}from"./chunk-2pj0cr49.js";var u=U((Ew,M0)=>{var{defineProperty:l,getOwnPropertyDescriptor:u6,getOwnPropertyNames:d6}=Object,i6=Object.prototype.hasOwnProperty,y=($,w)=>l($,"name",{value:w,configurable:!0}),p6=($,w)=>{for(var z in w)l($,z,{get:w[z],enumerable:!0})},_6=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of d6(w))if(!i6.call($,Z)&&Z!==z)l($,Z,{get:()=>w[Z],enumerable:!(L=u6(w,Z))||L.enumerable})}return $},a6=($)=>_6(l({},"__esModule",{value:!0}),$),A0={};p6(A0,{Field:()=>s6,Fields:()=>r6,HttpRequest:()=>t6,HttpResponse:()=>o6,IHttpRequest:()=>R0.HttpRequest,getHttpHandlerExtensionConfiguration:()=>n6,isValidHostname:()=>I0,resolveHttpHandlerRuntimeConfig:()=>m6});M0.exports=a6(A0);var n6=y(($)=>{let w=$.httpHandler;return{setHttpHandler(z){w=z},httpHandler(){return w},updateHttpClientConfig(z,L){w.updateHttpClientConfig(z,L)},httpHandlerConfigs(){return w.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),m6=y(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),R0=l6(),s6=class{static{y(this,"Field")}constructor({name:$,kind:w=R0.FieldPosition.HEADER,values:z=[]}){this.name=$,this.kind=w,this.values=z}add($){this.values.push($)}set($){this.values=$}remove($){this.values=this.values.filter((w)=>w!==$)}toString(){return this.values.map(($)=>$.includes(",")||$.includes(" ")?`"${$}"`:$).join(", ")}get(){return this.values}},r6=class{constructor({fields:$=[],encoding:w="utf-8"}){this.entries={},$.forEach(this.setField.bind(this)),this.encoding=w}static{y(this,"Fields")}setField($){this.entries[$.name.toLowerCase()]=$}getField($){return this.entries[$.toLowerCase()]}removeField($){delete this.entries[$.toLowerCase()]}getByType($){return Object.values(this.entries).filter((w)=>w.kind===$)}},t6=class ${static{y(this,"HttpRequest")}constructor(w){this.method=w.method||"GET",this.hostname=w.hostname||"localhost",this.port=w.port,this.query=w.query||{},this.headers=w.headers||{},this.body=w.body,this.protocol=w.protocol?w.protocol.slice(-1)!==":"?`${w.protocol}:`:w.protocol:"https:",this.path=w.path?w.path.charAt(0)!=="/"?`/${w.path}`:w.path:"/",this.username=w.username,this.password=w.password,this.fragment=w.fragment}static clone(w){let z=new $({...w,headers:{...w.headers}});if(z.query)z.query=N0(z.query);return z}static isInstance(w){if(!w)return!1;let z=w;return"method"in z&&"protocol"in z&&"hostname"in z&&"path"in z&&typeof z.query==="object"&&typeof z.headers==="object"}clone(){return $.clone(this)}};function N0($){return Object.keys($).reduce((w,z)=>{let L=$[z];return{...w,[z]:Array.isArray(L)?[...L]:L}},{})}y(N0,"cloneQuery");var o6=class{static{y(this,"HttpResponse")}constructor($){this.statusCode=$.statusCode,this.reason=$.reason,this.headers=$.headers||{},this.body=$.body}static isInstance($){if(!$)return!1;let w=$;return typeof w.statusCode==="number"&&typeof w.headers==="object"}};function I0($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)}y(I0,"isValidHostname")});var x0=U((gw,S0)=>{var{defineProperty:d,getOwnPropertyDescriptor:e6,getOwnPropertyNames:$4}=Object,w4=Object.prototype.hasOwnProperty,w0=($,w)=>d($,"name",{value:w,configurable:!0}),z4=($,w)=>{for(var z in w)d($,z,{get:w[z],enumerable:!0})},Z4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of $4(w))if(!w4.call($,Z)&&Z!==z)d($,Z,{get:()=>w[Z],enumerable:!(L=e6(w,Z))||L.enumerable})}return $},L4=($)=>Z4(d({},"__esModule",{value:!0}),$),O0={};z4(O0,{escapeUri:()=>b0,escapeUriPath:()=>K4});S0.exports=L4(O0);var b0=w0(($)=>encodeURIComponent($).replace(/[!'()*]/g,Y4),"escapeUri"),Y4=w0(($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),K4=w0(($)=>$.split("/").map(b0).join("/"),"escapeUriPath")});var Z0=U((lw,k0)=>{var{defineProperty:i,getOwnPropertyDescriptor:Q4,getOwnPropertyNames:X4}=Object,G4=Object.prototype.hasOwnProperty,B4=($,w)=>i($,"name",{value:w,configurable:!0}),F4=($,w)=>{for(var z in w)i($,z,{get:w[z],enumerable:!0})},U4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of X4(w))if(!G4.call($,Z)&&Z!==z)i($,Z,{get:()=>w[Z],enumerable:!(L=Q4(w,Z))||L.enumerable})}return $},V4=($)=>U4(i({},"__esModule",{value:!0}),$),T0={};F4(T0,{buildQueryString:()=>y0});k0.exports=V4(T0);var z0=x0();function y0($){let w=[];for(let z of Object.keys($).sort()){let L=$[z];if(z=z0.escapeUri(z),Array.isArray(L))for(let Z=0,Q=L.length;Z<Q;Z++)w.push(`${z}=${z0.escapeUri(L[Z])}`);else{let Z=z;if(L||typeof L==="string")Z+=`=${z0.escapeUri(L)}`;w.push(Z)}}return w.join("&")}B4(y0,"buildQueryString")});var m0=U((uw,n0)=>{var{create:h4,defineProperty:q,getOwnPropertyDescriptor:W4,getOwnPropertyNames:J4,getPrototypeOf:j4}=Object,D4=Object.prototype.hasOwnProperty,V=($,w)=>q($,"name",{value:w,configurable:!0}),v4=($,w)=>{for(var z in w)q($,z,{get:w[z],enumerable:!0})},q0=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of J4(w))if(!D4.call($,Z)&&Z!==z)q($,Z,{get:()=>w[Z],enumerable:!(L=W4(w,Z))||L.enumerable})}return $},C4=($,w,z)=>(z=$!=null?h4(j4($)):{},q0(w||!$||!$.__esModule?q(z,"default",{value:$,enumerable:!0}):z,$)),H4=($)=>q0(q({},"__esModule",{value:!0}),$),g0={};v4(g0,{DEFAULT_REQUEST_TIMEOUT:()=>_0,NodeHttp2Handler:()=>T4,NodeHttpHandler:()=>O4,streamCollector:()=>k4});n0.exports=H4(g0);var l0=u(),u0=Z0(),L0=N("http"),Y0=N("https"),A4=["ECONNRESET","EPIPE","ETIMEDOUT"],d0=V(($)=>{let w={};for(let z of Object.keys($)){let L=$[z];w[z]=Array.isArray(L)?L.join(","):L}return w},"getTransformedHeaders"),H={setTimeout:($,w)=>setTimeout($,w),clearTimeout:($)=>clearTimeout($)},f0=1000,R4=V(($,w,z=0)=>{if(!z)return-1;let L=V((Z)=>{let Q=H.setTimeout(()=>{$.destroy(),w(Object.assign(new Error(`Socket timed out without establishing a connection within ${z} ms`),{name:"TimeoutError"}))},z-Z),Y=V((K)=>{if(K?.connecting)K.on("connect",()=>{H.clearTimeout(Q)});else H.clearTimeout(Q)},"doWithSocket");if($.socket)Y($.socket);else $.on("socket",Y)},"registerTimeout");if(z<2000)return L(0),0;return H.setTimeout(L.bind(null,f0),f0)},"setConnectionTimeout"),N4=3000,I4=V(($,{keepAlive:w,keepAliveMsecs:z},L=N4)=>{if(w!==!0)return-1;let Z=V(()=>{if($.socket)$.socket.setKeepAlive(w,z||0);else $.on("socket",(Q)=>{Q.setKeepAlive(w,z||0)})},"registerListener");if(L===0)return Z(),0;return H.setTimeout(Z,L)},"setSocketKeepAlive"),E0=3000,M4=V(($,w,z=_0)=>{let L=V((Z)=>{let Q=z-Z,Y=V(()=>{$.destroy(),w(Object.assign(new Error(`Connection timed out after ${z} ms`),{name:"TimeoutError"}))},"onTimeout");if($.socket)$.socket.setTimeout(Q,Y),$.on("close",()=>$.socket?.removeListener("timeout",Y));else $.setTimeout(Q,Y)},"registerTimeout");if(0<z&&z<6000)return L(0),0;return H.setTimeout(L.bind(null,z===0?0:E0),E0)},"setSocketTimeout"),i0=N("stream"),P0=6000;async function K0($,w,z=P0){let L=w.headers??{},Z=L.Expect||L.expect,Q=-1,Y=!0;if(Z==="100-continue")Y=await Promise.race([new Promise((K)=>{Q=Number(H.setTimeout(()=>K(!0),Math.max(P0,z)))}),new Promise((K)=>{$.on("continue",()=>{H.clearTimeout(Q),K(!0)}),$.on("response",()=>{H.clearTimeout(Q),K(!1)}),$.on("error",()=>{H.clearTimeout(Q),K(!1)})})]);if(Y)p0($,w.body)}V(K0,"writeRequestBody");function p0($,w){if(w instanceof i0.Readable){w.pipe($);return}if(w){if(Buffer.isBuffer(w)||typeof w==="string"){$.end(w);return}let z=w;if(typeof z==="object"&&z.buffer&&typeof z.byteOffset==="number"&&typeof z.byteLength==="number"){$.end(Buffer.from(z.buffer,z.byteOffset,z.byteLength));return}$.end(Buffer.from(w));return}$.end()}V(p0,"writeBody");var _0=0,O4=class ${constructor(w){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((z,L)=>{if(typeof w==="function")w().then((Z)=>{z(this.resolveDefaultConfig(Z))}).catch(L);else z(this.resolveDefaultConfig(w))})}static{V(this,"NodeHttpHandler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}static checkSocketUsage(w,z,L=console){let{sockets:Z,requests:Q,maxSockets:Y}=w;if(typeof Y!=="number"||Y===1/0)return z;let K=15000;if(Date.now()-K<z)return z;if(Z&&Q)for(let X in Z){let G=Z[X]?.length??0,F=Q[X]?.length??0;if(G>=Y&&F>=2*Y)return L?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${G} and ${F} additional requests are enqueued.
|
|
2
2
|
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
3
|
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return z}resolveDefaultConfig(w){let{requestTimeout:z,connectionTimeout:L,socketTimeout:Z,socketAcquisitionWarningTimeout:Q,httpAgent:Y,httpsAgent:K}=w||{},X=!0,G=50;return{connectionTimeout:L,requestTimeout:z??Z,socketAcquisitionWarningTimeout:Q,httpAgent:(()=>{if(Y instanceof L0.Agent||typeof Y?.destroy==="function")return Y;return new L0.Agent({keepAlive:!0,maxSockets:50,...Y})})(),httpsAgent:(()=>{if(K instanceof Y0.Agent||typeof K?.destroy==="function")return K;return new Y0.Agent({keepAlive:!0,maxSockets:50,...K})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(w,{abortSignal:z}={}){if(!this.config)this.config=await this.configProvider;return new Promise((L,Z)=>{let Q=void 0,Y=[],K=V(async(B)=>{await Q,Y.forEach(H.clearTimeout),L(B)},"resolve"),X=V(async(B)=>{await Q,Y.forEach(H.clearTimeout),Z(B)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(z?.aborted){let B=new Error("Request aborted");B.name="AbortError",X(B);return}let G=w.protocol==="https:",F=G?this.config.httpsAgent:this.config.httpAgent;Y.push(H.setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(F,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let v=u0.buildQueryString(w.query||{}),D=void 0;if(w.username!=null||w.password!=null){let B=w.username??"",W=w.password??"";D=`${B}:${W}`}let j=w.path;if(v)j+=`?${v}`;if(w.fragment)j+=`#${w.fragment}`;let C=w.hostname??"";if(C[0]==="["&&C.endsWith("]"))C=w.hostname.slice(1,-1);else C=w.hostname;let x={headers:w.headers,host:C,method:w.method,path:j,port:w.port,agent:F,auth:D},h=(G?Y0.request:L0.request)(x,(B)=>{let W=new l0.HttpResponse({statusCode:B.statusCode||-1,reason:B.statusMessage,headers:d0(B.headers),body:B});K({response:W})});if(h.on("error",(B)=>{if(A4.includes(B.code))X(Object.assign(B,{name:"TimeoutError"}));else X(B)}),z){let B=V(()=>{h.destroy();let W=new Error("Request aborted");W.name="AbortError",X(W)},"onAbort");if(typeof z.addEventListener==="function"){let W=z;W.addEventListener("abort",B,{once:!0}),h.once("close",()=>W.removeEventListener("abort",B))}else z.onabort=B}Y.push(R4(h,X,this.config.connectionTimeout)),Y.push(M4(h,X,this.config.requestTimeout));let A=x.agent;if(typeof A==="object"&&"keepAlive"in A)Y.push(I4(h,{keepAlive:A.keepAlive,keepAliveMsecs:A.keepAliveMsecs}));Q=K0(h,w,this.config.requestTimeout).catch((B)=>{return Y.forEach(H.clearTimeout),Z(B)})})}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((L)=>{return{...L,[w]:z}})}httpHandlerConfigs(){return this.config??{}}},c0=N("http2"),b4=C4(N("http2")),S4=class{constructor($){this.sessions=[],this.sessions=$??[]}static{V(this,"NodeHttp2ConnectionPool")}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast($){this.sessions.push($)}contains($){return this.sessions.includes($)}remove($){this.sessions=this.sessions.filter((w)=>w!==$)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy($){for(let w of this.sessions)if(w===$){if(!w.destroyed)w.destroy()}}},x4=class{constructor($){if(this.sessionCache=new Map,this.config=$,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}static{V(this,"NodeHttp2ConnectionManager")}lease($,w){let z=this.getUrlString($),L=this.sessionCache.get(z);if(L){let K=L.poll();if(K&&!this.config.disableConcurrency)return K}let Z=b4.default.connect(z);if(this.config.maxConcurrency)Z.settings({maxConcurrentStreams:this.config.maxConcurrency},(K)=>{if(K)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+$.destination.toString())});Z.unref();let Q=V(()=>{Z.destroy(),this.deleteSession(z,Z)},"destroySessionCb");if(Z.on("goaway",Q),Z.on("error",Q),Z.on("frameError",Q),Z.on("close",()=>this.deleteSession(z,Z)),w.requestTimeout)Z.setTimeout(w.requestTimeout,Q);let Y=this.sessionCache.get(z)||new S4;return Y.offerLast(Z),this.sessionCache.set(z,Y),Z}deleteSession($,w){let z=this.sessionCache.get($);if(!z)return;if(!z.contains(w))return;z.remove(w),this.sessionCache.set($,z)}release($,w){let z=this.getUrlString($);this.sessionCache.get(z)?.offerLast(w)}destroy(){for(let[$,w]of this.sessionCache){for(let z of w){if(!z.destroyed)z.destroy();w.remove(z)}this.sessionCache.delete($)}}setMaxConcurrentStreams($){if($&&$<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=$}setDisableConcurrentStreams($){this.config.disableConcurrency=$}getUrlString($){return $.destination.toString()}},T4=class ${constructor(w){this.metadata={handlerProtocol:"h2"},this.connectionManager=new x4({}),this.configProvider=new Promise((z,L)=>{if(typeof w==="function")w().then((Z)=>{z(Z||{})}).catch(L);else z(w||{})})}static{V(this,"NodeHttp2Handler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}destroy(){this.connectionManager.destroy()}async handle(w,{abortSignal:z}={}){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:L,disableConcurrentStreams:Z}=this.config;return new Promise((Q,Y)=>{let K=!1,X=void 0,G=V(async(J)=>{await X,Q(J)},"resolve"),F=V(async(J)=>{await X,Y(J)},"reject");if(z?.aborted){K=!0;let J=new Error("Request aborted");J.name="AbortError",F(J);return}let{hostname:v,method:D,port:j,protocol:C,query:x}=w,T="";if(w.username!=null||w.password!=null){let J=w.username??"",I=w.password??"";T=`${J}:${I}@`}let h=`${C}//${T}${v}${j?`:${j}`:""}`,A={destination:new URL(h)},B=this.connectionManager.lease(A,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:Z||!1}),W=V((J)=>{if(Z)this.destroySession(B);K=!0,F(J)},"rejectWithDestroy"),E=u0.buildQueryString(x||{}),$0=w.path;if(E)$0+=`?${E}`;if(w.fragment)$0+=`#${w.fragment}`;let R=B.request({...w.headers,[c0.constants.HTTP2_HEADER_PATH]:$0,[c0.constants.HTTP2_HEADER_METHOD]:D});if(B.ref(),R.on("response",(J)=>{let I=new l0.HttpResponse({statusCode:J[":status"]||-1,headers:d0(J),body:R});if(K=!0,G({response:I}),Z)B.close(),this.connectionManager.deleteSession(h,B)}),L)R.setTimeout(L,()=>{R.close();let J=new Error(`Stream timed out because of no activity for ${L} ms`);J.name="TimeoutError",W(J)});if(z){let J=V(()=>{R.close();let I=new Error("Request aborted");I.name="AbortError",W(I)},"onAbort");if(typeof z.addEventListener==="function"){let I=z;I.addEventListener("abort",J,{once:!0}),R.once("close",()=>I.removeEventListener("abort",J))}else z.onabort=J}R.on("frameError",(J,I,g6)=>{W(new Error(`Frame type id ${J} in stream id ${g6} has failed with code ${I}.`))}),R.on("error",W),R.on("aborted",()=>{W(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${R.rstCode}.`))}),R.on("close",()=>{if(B.unref(),Z)B.destroy();if(!K)W(new Error("Unexpected error: http2 request did not get a response"))}),X=K0(R,w,L)})}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((L)=>{return{...L,[w]:z}})}httpHandlerConfigs(){return this.config??{}}destroySession(w){if(!w.destroyed)w.destroy()}},y4=class extends i0.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}static{V(this,"Collector")}_write($,w,z){this.bufferedBytes.push($),z()}},k4=V(($)=>{if(f4($))return a0($);return new Promise((w,z)=>{let L=new y4;$.pipe(L),$.on("error",(Z)=>{L.end(),z(Z)}),L.on("error",z),L.on("finish",function(){let Z=new Uint8Array(Buffer.concat(this.bufferedBytes));w(Z)})})},"streamCollector"),f4=V(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");async function a0($){let w=[],z=$.getReader(),L=!1,Z=0;while(!L){let{done:K,value:X}=await z.read();if(X)w.push(X),Z+=X.length;L=K}let Q=new Uint8Array(Z),Y=0;for(let K of w)Q.set(K,Y),Y+=K.length;return Q}V(a0,"collectReadableStream")});var t0=U((_w,r0)=>{var{defineProperty:p,getOwnPropertyDescriptor:E4,getOwnPropertyNames:P4}=Object,c4=Object.prototype.hasOwnProperty,q4=($,w)=>p($,"name",{value:w,configurable:!0}),g4=($,w)=>{for(var z in w)p($,z,{get:w[z],enumerable:!0})},l4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of P4(w))if(!c4.call($,Z)&&Z!==z)p($,Z,{get:()=>w[Z],enumerable:!(L=E4(w,Z))||L.enumerable})}return $},u4=($)=>l4(p({},"__esModule",{value:!0}),$),s0={};g4(s0,{isArrayBuffer:()=>d4});r0.exports=u4(s0);var d4=q4(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var g=U((aw,$1)=>{var{defineProperty:_,getOwnPropertyDescriptor:i4,getOwnPropertyNames:p4}=Object,_4=Object.prototype.hasOwnProperty,o0=($,w)=>_($,"name",{value:w,configurable:!0}),a4=($,w)=>{for(var z in w)_($,z,{get:w[z],enumerable:!0})},n4=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of p4(w))if(!_4.call($,Z)&&Z!==z)_($,Z,{get:()=>w[Z],enumerable:!(L=i4(w,Z))||L.enumerable})}return $},m4=($)=>n4(_({},"__esModule",{value:!0}),$),e0={};a4(e0,{fromArrayBuffer:()=>r4,fromString:()=>t4});$1.exports=m4(e0);var s4=t0(),Q0=N("buffer"),r4=o0(($,w=0,z=$.byteLength-w)=>{if(!s4.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return Q0.Buffer.from($,w,z)},"fromArrayBuffer"),t4=o0(($,w)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return w?Q0.Buffer.from($,w):Q0.Buffer.from($)},"fromString")});var Z1=U((w1)=>{Object.defineProperty(w1,"__esModule",{value:!0});w1.fromBase64=void 0;var o4=g(),e4=/^[A-Za-z0-9+/]*={0,2}$/,$$=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!e4.exec($))throw new TypeError("Invalid base64 string.");let w=o4.fromString($,"base64");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength)};w1.fromBase64=$$});var n=U((mw,Q1)=>{var{defineProperty:a,getOwnPropertyDescriptor:w$,getOwnPropertyNames:z$}=Object,Z$=Object.prototype.hasOwnProperty,X0=($,w)=>a($,"name",{value:w,configurable:!0}),L$=($,w)=>{for(var z in w)a($,z,{get:w[z],enumerable:!0})},Y$=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of z$(w))if(!Z$.call($,Z)&&Z!==z)a($,Z,{get:()=>w[Z],enumerable:!(L=w$(w,Z))||L.enumerable})}return $},K$=($)=>Y$(a({},"__esModule",{value:!0}),$),L1={};L$(L1,{fromUtf8:()=>K1,toUint8Array:()=>Q$,toUtf8:()=>X$});Q1.exports=K$(L1);var Y1=g(),K1=X0(($)=>{let w=Y1.fromString($,"utf8");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Q$=X0(($)=>{if(typeof $==="string")return K1($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),X$=X0(($)=>{if(typeof $==="string")return $;if(typeof $!=="object"||typeof $.byteOffset!=="number"||typeof $.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return Y1.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var B1=U((X1)=>{Object.defineProperty(X1,"__esModule",{value:!0});X1.toBase64=void 0;var G$=g(),B$=n(),F$=($)=>{let w;if(typeof $==="string")w=B$.fromUtf8($);else w=$;if(typeof w!=="object"||typeof w.byteOffset!=="number"||typeof w.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return G$.fromArrayBuffer(w.buffer,w.byteOffset,w.byteLength).toString("base64")};X1.toBase64=F$});var P=U((rw,m)=>{var{defineProperty:F1,getOwnPropertyDescriptor:U$,getOwnPropertyNames:V$}=Object,h$=Object.prototype.hasOwnProperty,G0=($,w,z,L)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of V$(w))if(!h$.call($,Z)&&Z!==z)F1($,Z,{get:()=>w[Z],enumerable:!(L=U$(w,Z))||L.enumerable})}return $},U1=($,w,z)=>(G0($,w,"default"),z&&G0(z,w,"default")),W$=($)=>G0(F1({},"__esModule",{value:!0}),$),B0={};m.exports=W$(B0);U1(B0,Z1(),m.exports);U1(B0,B1(),m.exports)});var F0=U((h1)=>{Object.defineProperty(h1,"__esModule",{value:!0});h1.ChecksumStream=void 0;var J$=P(),j$=N("stream");class V1 extends j$.Duplex{constructor({expectedChecksum:$,checksum:w,source:z,checksumSourceLocation:L,base64Encoder:Z}){var Q,Y;super();if(typeof z.pipe==="function")this.source=z;else throw new Error(`@smithy/util-stream: unsupported source type ${(Y=(Q=z===null||z===void 0?void 0:z.constructor)===null||Q===void 0?void 0:Q.name)!==null&&Y!==void 0?Y:z} in ChecksumStream.`);this.base64Encoder=Z!==null&&Z!==void 0?Z:J$.toBase64,this.expectedChecksum=$,this.checksum=w,this.checksumSourceLocation=L,this.source.pipe(this)}_read($){}_write($,w,z){try{this.checksum.update($),this.push($)}catch(L){return z(L)}return z()}async _final($){try{let w=await this.checksum.digest(),z=this.base64Encoder(w);if(this.expectedChecksum!==z)return $(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${z}" in response header "${this.checksumSourceLocation}".`))}catch(w){return $(w)}return this.push(null),$()}}h1.ChecksumStream=V1});var k=U((J1)=>{Object.defineProperty(J1,"__esModule",{value:!0});J1.isBlob=J1.isReadableStream=void 0;var D$=($)=>{var w;return typeof ReadableStream==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===ReadableStream.name||$ instanceof ReadableStream)};J1.isReadableStream=D$;var v$=($)=>{var w;return typeof Blob==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===Blob.name||$ instanceof Blob)};J1.isBlob=v$});var H1=U((v1)=>{Object.defineProperty(v1,"__esModule",{value:!0});v1.ChecksumStream=void 0;var H$=typeof ReadableStream==="function"?ReadableStream:function(){};class D1 extends H${}v1.ChecksumStream=D1});var N1=U((A1)=>{Object.defineProperty(A1,"__esModule",{value:!0});A1.createChecksumStream=void 0;var A$=P(),R$=k(),N$=H1(),I$=({expectedChecksum:$,checksum:w,source:z,checksumSourceLocation:L,base64Encoder:Z})=>{var Q,Y;if(!R$.isReadableStream(z))throw new Error(`@smithy/util-stream: unsupported source type ${(Y=(Q=z===null||z===void 0?void 0:z.constructor)===null||Q===void 0?void 0:Q.name)!==null&&Y!==void 0?Y:z} in ChecksumStream.`);let K=Z!==null&&Z!==void 0?Z:A$.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let X=new TransformStream({start(){},async transform(F,v){w.update(F),v.enqueue(F)},async flush(F){let v=await w.digest(),D=K(v);if($!==D){let j=new Error(`Checksum mismatch: expected "${$}" but received "${D}" in response header "${L}".`);F.error(j)}else F.terminate()}});z.pipeThrough(X);let G=X.readable;return Object.setPrototypeOf(G,N$.ChecksumStream.prototype),G};A1.createChecksumStream=I$});var O1=U((I1)=>{Object.defineProperty(I1,"__esModule",{value:!0});I1.createChecksumStream=void 0;var M$=k(),O$=F0(),b$=N1();function S$($){if(typeof ReadableStream==="function"&&M$.isReadableStream($.source))return b$.createChecksumStream($);return new O$.ChecksumStream($)}I1.createChecksumStream=S$});var U0=U((S1)=>{Object.defineProperty(S1,"__esModule",{value:!0});S1.ByteArrayCollector=void 0;class b1{constructor($){this.allocByteArray=$,this.byteLength=0,this.byteArrays=[]}push($){this.byteArrays.push($),this.byteLength+=$.byteLength}flush(){if(this.byteArrays.length===1){let z=this.byteArrays[0];return this.reset(),z}let $=this.allocByteArray(this.byteLength),w=0;for(let z=0;z<this.byteArrays.length;++z){let L=this.byteArrays[z];$.set(L,w),w+=L.byteLength}return this.reset(),$}reset(){this.byteArrays=[],this.byteLength=0}}S1.ByteArrayCollector=b1});var P1=U((f1)=>{Object.defineProperty(f1,"__esModule",{value:!0});f1.modeOf=f1.sizeOf=f1.flush=f1.merge=f1.createBufferedReadable=f1.createBufferedReadableStream=void 0;var x$=U0();function T1($,w,z){let L=$.getReader(),Z=!1,Q=0,Y=["",new x$.ByteArrayCollector((G)=>new Uint8Array(G))],K=-1,X=async(G)=>{let{value:F,done:v}=await L.read(),D=F;if(v){if(K!==-1){let j=s(Y,K);if(c(j)>0)G.enqueue(j)}G.close()}else{let j=k1(D);if(K!==j){if(K>=0)G.enqueue(s(Y,K));K=j}if(K===-1){G.enqueue(D);return}let C=c(D);Q+=C;let x=c(Y[K]);if(C>=w&&x===0)G.enqueue(D);else{let T=y1(Y,K,D);if(!Z&&Q>w*2)Z=!0,z===null||z===void 0||z.warn(`@smithy/util-stream - stream chunk size ${C} is below threshold of ${w}, automatically buffering.`);if(T>=w)G.enqueue(s(Y,K));else await X(G)}}};return new ReadableStream({pull:X})}f1.createBufferedReadableStream=T1;f1.createBufferedReadable=T1;function y1($,w,z){switch(w){case 0:return $[0]+=z,c($[0]);case 1:case 2:return $[w].push(z),c($[w])}}f1.merge=y1;function s($,w){switch(w){case 0:let z=$[0];return $[0]="",z;case 1:case 2:return $[w].flush()}throw new Error(`@smithy/util-stream - invalid index ${w} given to flush()`)}f1.flush=s;function c($){var w,z;return(z=(w=$===null||$===void 0?void 0:$.byteLength)!==null&&w!==void 0?w:$===null||$===void 0?void 0:$.length)!==null&&z!==void 0?z:0}f1.sizeOf=c;function k1($){if(typeof Buffer!=="undefined"&&$ instanceof Buffer)return 2;if($ instanceof Uint8Array)return 1;if(typeof $==="string")return 0;return-1}f1.modeOf=k1});var l1=U((q1)=>{Object.defineProperty(q1,"__esModule",{value:!0});q1.createBufferedReadable=void 0;var P$=N("stream"),c1=U0(),S=P1(),c$=k();function q$($,w,z){if(c$.isReadableStream($))return S.createBufferedReadableStream($,w,z);let L=new P$.Readable({read(){}}),Z=!1,Q=0,Y=["",new c1.ByteArrayCollector((X)=>new Uint8Array(X)),new c1.ByteArrayCollector((X)=>Buffer.from(new Uint8Array(X)))],K=-1;return $.on("data",(X)=>{let G=S.modeOf(X);if(K!==G){if(K>=0)L.push(S.flush(Y,K));K=G}if(K===-1){L.push(X);return}let F=S.sizeOf(X);Q+=F;let v=S.sizeOf(Y[K]);if(F>=w&&v===0)L.push(X);else{let D=S.merge(Y,K,X);if(!Z&&Q>w*2)Z=!0,z===null||z===void 0||z.warn(`@smithy/util-stream - stream chunk size ${F} is below threshold of ${w}, automatically buffering.`);if(D>=w)L.push(S.flush(Y,K))}}),$.on("end",()=>{if(K!==-1){let X=S.flush(Y,K);if(S.sizeOf(X)>0)L.push(X)}L.push(null)}),L}q1.createBufferedReadable=q$});var i1=U((u1)=>{Object.defineProperty(u1,"__esModule",{value:!0});u1.getAwsChunkedEncodingStream=void 0;var g$=N("stream"),l$=($,w)=>{let{base64Encoder:z,bodyLengthChecker:L,checksumAlgorithmFn:Z,checksumLocationName:Q,streamHasher:Y}=w,K=z!==void 0&&Z!==void 0&&Q!==void 0&&Y!==void 0,X=K?Y(Z,$):void 0,G=new g$.Readable({read:()=>{}});return $.on("data",(F)=>{let v=L(F)||0;G.push(`${v.toString(16)}\r
|
|
4
4
|
`),G.push(F),G.push(`\r
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ib as y,Rb as C,ec as P}from"./chunk-jky37dv1.js";import{wc as u}from"./chunk-ww48v0ap.js";import"./chunk-5eh2tfep.js";import{Lc as n}from"./chunk-z80nypa9.js";import{Qc as A}from"./chunk-bgqy98qw.js";import{Rc as d}from"./chunk-2pj0cr49.js";var K=d(A(),1);import O from"fs/promises";var E="169.254.170.2",R="169.254.170.23",p="[fd00:ec2::23]",i=(e,a)=>{if(e.protocol==="https:")return;if(e.hostname===E||e.hostname===R||e.hostname===p)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let c=e.hostname.split("."),r=(t)=>{let s=parseInt(t,10);return 0<=s&&s<=255};if(c[0]==="127"&&r(c[1])&&r(c[2])&&r(c[3])&&c.length===4)return}throw new n(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
|
+
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
|
+
- ECS container host 169.254.170.2
|
|
5
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:a})};var S=d(u(),1);function g(e){return new y({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((a,[c,r])=>{return a[c]=r,a},{}),fragment:e.hash})}async function w(e,a){let r=await S.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){let t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new n("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:a});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:C(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new n(`Server responded with status: ${e.statusCode}`,{logger:a}),{Code:t.Code,Message:t.Message})}throw new n(`Server responded with status: ${e.statusCode}`,{logger:a})}var I=(e,a,c)=>{return async()=>{for(let r=0;r<a;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,c))}return await e()}};var b="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",v="http://169.254.170.2",_="AWS_CONTAINER_CREDENTIALS_FULL_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",D="AWS_CONTAINER_AUTHORIZATION_TOKEN",M=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let a,c=e.awsContainerCredentialsRelativeUri??process.env[b],r=e.awsContainerCredentialsFullUri??process.env[_],t=e.awsContainerAuthorizationToken??process.env[D],s=e.awsContainerAuthorizationTokenFile??process.env[B],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(c&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)a=r;else if(c)a=`${v}${c}`;else throw new n(`No HTTP credential provider host provided.
|
|
6
|
+
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let h=new URL(a);i(h,e.logger);let T=new P({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return I(async()=>{let o=g(h);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await O.readFile(s)).toString();try{let f=await T.handle(o);return w(f.response).then((x)=>K.setCredentialFeature(x,"CREDENTIALS_HTTP","z"))}catch(f){throw new n(String(f),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{M as fromHttp};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ac as q,Bc as N,Ec as I,Fc as R,zc as C}from"./chunk-8acb2bq0.js";import"./chunk-5eh2tfep.js";import{Lc as a,Mc as m}from"./chunk-z80nypa9.js";import{Qc as Y}from"./chunk-bgqy98qw.js";import{Rc as O,Wc as A}from"./chunk-2pj0cr49.js";var K=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var D=O(Y(),1);var b=300000,u="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var H=async(e,s={})=>{let{SSOOIDCClient:o}=await import("./chunk-9gzvq5jq.js");return new o(Object.assign({},s.clientConfig??{},{region:e??s.clientConfig?.region,logger:s.clientConfig?.logger??s.parentClientConfig?.logger}))};var U=async(e,s,o={})=>{let{CreateTokenCommand:i}=await import("./chunk-9gzvq5jq.js");return(await H(s,o)).send(new i({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new m(`Token is expired. ${u}`,!1)};var w=(e,s,o=!1)=>{if(typeof s==="undefined")throw new m(`Value not present for '${e}' in SSO Token${o?". Cannot refresh":""}. ${u}`,!1)};import{promises as J}from"fs";var{writeFile:V}=J,W=(e,s)=>{let o=q(e),i=JSON.stringify(s,null,2);return V(o,i)};var j=new Date(0),X=(e={})=>async({callerClientConfig:s}={})=>{let o={...e,parentClientConfig:{...s,...e.parentClientConfig}};o.logger?.debug("@aws-sdk/token-providers - fromSso");let i=await R(o),r=C({profile:o.profile??s?.profile}),p=i[r];if(!p)throw new m(`Profile '${r}' could not be found in shared credentials file.`,!1);else if(!p.sso_session)throw new m(`Profile '${r}' is missing required property 'sso_session'.`);let c=p.sso_session,l=(await I(o))[c];if(!l)throw new m(`Sso session '${c}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!l[n])throw new m(`Sso session '${c}' is missing required property '${n}'.`,!1);let{sso_start_url:d,sso_region:t}=l,f;try{f=await N(c)}catch(n){throw new m(`The SSO session token associated with profile=${r} was not found or is invalid. ${u}`,!1)}w("accessToken",f.accessToken),w("expiresAt",f.expiresAt);let{accessToken:k,expiresAt:T}=f,S={token:k,expiration:new Date(T)};if(S.expiration.getTime()-Date.now()>b)return S;if(Date.now()-j.getTime()<30000)return P(S),S;w("clientId",f.clientId,!0),w("clientSecret",f.clientSecret,!0),w("refreshToken",f.refreshToken,!0);try{j.setTime(Date.now());let n=await U(f,t,o);w("accessToken",n.accessToken),w("expiresIn",n.expiresIn);let h=new Date(Date.now()+n.expiresIn*1000);try{await W(c,{...f,accessToken:n.accessToken,expiresAt:h.toISOString(),refreshToken:n.refreshToken})}catch(g){}return{token:n.accessToken,expiration:h}}catch(n){return P(S),S}};var E=!1,$=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:o,ssoRegion:i,ssoRoleName:r,ssoClient:p,clientConfig:c,parentClientConfig:x,profile:l,logger:d})=>{let t,f="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{let _=await X({profile:l})();t={accessToken:_.token,expiresAt:new Date(_.expiration).toISOString()}}catch(_){throw new a(_.message,{tryNextLink:E,logger:d})}else try{t=await N(e)}catch(_){throw new a("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:d})}if(new Date(t.expiresAt).getTime()-Date.now()<=0)throw new a("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:d});let{accessToken:k}=t,{SSOClient:T,GetRoleCredentialsCommand:S}=await import("./chunk-fds99vbx.js"),n=p||new T(Object.assign({},c??{},{logger:c?.logger??x?.logger,region:c?.region??i})),h;try{h=await n.send(new S({accountId:o,roleName:r,accessToken:k}))}catch(_){throw new a(_,{tryNextLink:E,logger:d})}let{roleCredentials:{accessKeyId:g,secretAccessKey:y,sessionToken:F,expiration:L,credentialScope:M,accountId:G}={}}=h;if(!g||!y||!F||!L)throw new a("SSO returns an invalid temporary credential.",{tryNextLink:E,logger:d});let v={accessKeyId:g,secretAccessKey:y,sessionToken:F,expiration:new Date(L),...M&&{credentialScope:M},...G&&{accountId:G}};if(s)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var z=(e,s)=>{let{sso_start_url:o,sso_account_id:i,sso_region:r,sso_role_name:p}=e;if(!o||!i||!r||!p)throw new a(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
|
|
3
|
+
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e};var ve=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:o,ssoAccountId:i,ssoRegion:r,ssoRoleName:p,ssoSession:c}=e,{ssoClient:x}=e,l=C({profile:e.profile??s?.profile});if(!o&&!i&&!r&&!p&&!c){let t=(await R(e))[l];if(!t)throw new a(`Profile ${l} was not found.`,{logger:e.logger});if(!K(t))throw new a(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(t?.sso_session){let g=(await I(e))[t.sso_session],y=` configurations in profile ${l} and sso-session ${t.sso_session}`;if(r&&r!==g.sso_region)throw new a("Conflicting SSO region"+y,{tryNextLink:!1,logger:e.logger});if(o&&o!==g.sso_start_url)throw new a("Conflicting SSO start_url"+y,{tryNextLink:!1,logger:e.logger});t.sso_region=g.sso_region,t.sso_start_url=g.sso_start_url}let{sso_start_url:f,sso_account_id:k,sso_region:T,sso_role_name:S,sso_session:n}=z(t,e.logger);return $({ssoStartUrl:f,ssoSession:n,ssoAccountId:k,ssoRegion:T,ssoRoleName:S,ssoClient:x,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:l})}else if(!o||!i||!r||!p)throw new a('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return $({ssoStartUrl:o,ssoSession:c,ssoAccountId:i,ssoRegion:r,ssoRoleName:p,ssoClient:x,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:l})};export{z as validateSsoProfile,K as isSsoProfile,ve as fromSSO};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Lc as c}from"./chunk-z80nypa9.js";import{Qc as T}from"./chunk-bgqy98qw.js";import{Rc as E,Wc as p}from"./chunk-2pj0cr49.js";var N=E(T(),1);import{readFileSync as f}from"fs";var i=(e)=>async(o)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:r,roleSessionName:s,webIdentityToken:n,providerId:S,policyArns:d,policy:l,durationSeconds:m}=e,{roleAssumerWithWebIdentity:t}=e;if(!t){let{getDefaultRoleAssumerWithWebIdentity:a}=await import("./chunk-5yawz4bx.js");t=a({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...o?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return t({RoleArn:r,RoleSessionName:s??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:S,PolicyArns:d,Policy:l,DurationSeconds:m})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",A="AWS_ROLE_ARN",I="AWS_ROLE_SESSION_NAME",k=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[A],s=e?.roleSessionName??process.env[I];if(!o||!r)throw new c("Web identity configuration not specified",{logger:e.logger});let n=await i({...e,webIdentityToken:f(o,{encoding:"ascii"}),roleArn:r,roleSessionName:s})();if(o===process.env[_])N.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{i as fromWebToken,k as fromTokenFile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Rc as sJ,Tc as X,Wc as Q}from"./chunk-2pj0cr49.js";var u=X((SE)=>{SE.fromCallback=function(q){return Object.defineProperty(function(...n){if(typeof n[n.length-1]==="function")q.apply(this,n);else return new Promise((E,y)=>{n.push((J,O)=>J!=null?y(J):E(O)),q.apply(this,n)})},"name",{value:q.name})};SE.fromPromise=function(q){return Object.defineProperty(function(...n){let E=n[n.length-1];if(typeof E!=="function")return q.apply(this,n);else n.pop(),q.apply(this,n).then((y)=>E(null,y),E)},"name",{value:q.name})}});var hq=X((UO,iq)=>{var f=Q("constants"),iE=process.cwd,Pq=null,hE=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Pq)Pq=iE.call(process);return Pq};try{process.cwd()}catch(q){}if(typeof process.chdir==="function"){if(Aq=process.chdir,process.chdir=function(q){Pq=null,Aq.call(process,q)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,Aq)}var Aq;iq.exports=lE;function lE(q){if(f.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))n(q);if(!q.lutimes)E(q);if(q.chown=O(q.chown),q.fchown=O(q.fchown),q.lchown=O(q.lchown),q.chmod=y(q.chmod),q.fchmod=y(q.fchmod),q.lchmod=y(q.lchmod),q.chownSync=_(q.chownSync),q.fchownSync=_(q.fchownSync),q.lchownSync=_(q.lchownSync),q.chmodSync=J(q.chmodSync),q.fchmodSync=J(q.fchmodSync),q.lchmodSync=J(q.lchmodSync),q.stat=U(q.stat),q.fstat=U(q.fstat),q.lstat=U(q.lstat),q.statSync=j(q.statSync),q.fstatSync=j(q.fstatSync),q.lstatSync=j(q.lstatSync),q.chmod&&!q.lchmod)q.lchmod=function(V,A,L){if(L)process.nextTick(L)},q.lchmodSync=function(){};if(q.chown&&!q.lchown)q.lchown=function(V,A,L,K){if(K)process.nextTick(K)},q.lchownSync=function(){};if(hE==="win32")q.rename=typeof q.rename!=="function"?q.rename:function(V){function A(L,K,P){var N=Date.now(),C=0;V(L,K,function R(h){if(h&&(h.code==="EACCES"||h.code==="EPERM"||h.code==="EBUSY")&&Date.now()-N<60000){if(setTimeout(function(){q.stat(K,function(m,Jq){if(m&&m.code==="ENOENT")V(L,K,R);else P(h)})},C),C<100)C+=10;return}if(P)P(h)})}if(Object.setPrototypeOf)Object.setPrototypeOf(A,V);return A}(q.rename);q.read=typeof q.read!=="function"?q.read:function(V){function A(L,K,P,N,C,R){var h;if(R&&typeof R==="function"){var m=0;h=function(Jq,gq,bq){if(Jq&&Jq.code==="EAGAIN"&&m<10)return m++,V.call(q,L,K,P,N,C,h);R.apply(this,arguments)}}return V.call(q,L,K,P,N,C,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(A,V);return A}(q.read),q.readSync=typeof q.readSync!=="function"?q.readSync:function(V){return function(A,L,K,P,N){var C=0;while(!0)try{return V.call(q,A,L,K,P,N)}catch(R){if(R.code==="EAGAIN"&&C<10){C++;continue}throw R}}}(q.readSync);function n(V){V.lchmod=function(A,L,K){V.open(A,f.O_WRONLY|f.O_SYMLINK,L,function(P,N){if(P){if(K)K(P);return}V.fchmod(N,L,function(C){V.close(N,function(R){if(K)K(C||R)})})})},V.lchmodSync=function(A,L){var K=V.openSync(A,f.O_WRONLY|f.O_SYMLINK,L),P=!0,N;try{N=V.fchmodSync(K,L),P=!1}finally{if(P)try{V.closeSync(K)}catch(C){}else V.closeSync(K)}return N}}function E(V){if(f.hasOwnProperty("O_SYMLINK")&&V.futimes)V.lutimes=function(A,L,K,P){V.open(A,f.O_SYMLINK,function(N,C){if(N){if(P)P(N);return}V.futimes(C,L,K,function(R){V.close(C,function(h){if(P)P(R||h)})})})},V.lutimesSync=function(A,L,K){var P=V.openSync(A,f.O_SYMLINK),N,C=!0;try{N=V.futimesSync(P,L,K),C=!1}finally{if(C)try{V.closeSync(P)}catch(R){}else V.closeSync(P)}return N};else if(V.futimes)V.lutimes=function(A,L,K,P){if(P)process.nextTick(P)},V.lutimesSync=function(){}}function y(V){if(!V)return V;return function(A,L,K){return V.call(q,A,L,function(P){if($(P))P=null;if(K)K.apply(this,arguments)})}}function J(V){if(!V)return V;return function(A,L){try{return V.call(q,A,L)}catch(K){if(!$(K))throw K}}}function O(V){if(!V)return V;return function(A,L,K,P){return V.call(q,A,L,K,function(N){if($(N))N=null;if(P)P.apply(this,arguments)})}}function _(V){if(!V)return V;return function(A,L,K){try{return V.call(q,A,L,K)}catch(P){if(!$(P))throw P}}}function U(V){if(!V)return V;return function(A,L,K){if(typeof L==="function")K=L,L=null;function P(N,C){if(C){if(C.uid<0)C.uid+=4294967296;if(C.gid<0)C.gid+=4294967296}if(K)K.apply(this,arguments)}return L?V.call(q,A,L,P):V.call(q,A,P)}}function j(V){if(!V)return V;return function(A,L){var K=L?V.call(q,A,L):V.call(q,A);if(K){if(K.uid<0)K.uid+=4294967296;if(K.gid<0)K.gid+=4294967296}return K}}function $(V){if(!V)return!0;if(V.code==="ENOSYS")return!0;var A=!process.getuid||process.getuid()!==0;if(A){if(V.code==="EINVAL"||V.code==="EPERM")return!0}return!1}}});var cq=X((zO,pq)=>{var lq=Q("stream").Stream;pq.exports=pE;function pE(q){return{ReadStream:n,WriteStream:E};function n(y,J){if(!(this instanceof n))return new n(y,J);lq.call(this);var O=this;this.path=y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var _=Object.keys(J);for(var U=0,j=_.length;U<j;U++){var $=_[U];this[$]=J[$]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){O._read()});return}q.open(this.path,this.flags,this.mode,function(V,A){if(V){O.emit("error",V),O.readable=!1;return}O.fd=A,O.emit("open",A),O._read()})}function E(y,J){if(!(this instanceof E))return new E(y,J);lq.call(this),this.path=y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var O=Object.keys(J);for(var _=0,U=O.length;_<U;_++){var j=O[_];this[j]=J[j]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=q.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var fq=X((LO,oq)=>{oq.exports=oE;var cE=Object.getPrototypeOf||function(q){return q.__proto__};function oE(q){if(q===null||typeof q!=="object")return q;if(q instanceof Object)var n={__proto__:cE(q)};else var n=Object.create(null);return Object.getOwnPropertyNames(q).forEach(function(E){Object.defineProperty(n,E,Object.getOwnPropertyDescriptor(q,E))}),n}});var qq=X((PO,Iq)=>{var B=Q("fs"),fE=hq(),dE=cq(),rE=fq(),Gq=Q("util"),F,Yq;if(typeof Symbol==="function"&&typeof Symbol.for==="function")F=Symbol.for("graceful-fs.queue"),Yq=Symbol.for("graceful-fs.previous");else F="___graceful-fs.queue",Yq="___graceful-fs.previous";function aE(){}function rq(q,n){Object.defineProperty(q,F,{get:function(){return n}})}var e=aE;if(Gq.debuglog)e=Gq.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))e=function(){var q=Gq.format.apply(Gq,arguments);q="GFS4: "+q.split(/\n/).join(`
|
|
3
3
|
GFS4: `),console.error(q)};if(!B[F]){if(wq=global[F]||[],rq(B,wq),B.close=function(q){function n(E,y){return q.call(B,E,function(J){if(!J)dq();if(typeof y==="function")y.apply(this,arguments)})}return Object.defineProperty(n,Yq,{value:q}),n}(B.close),B.closeSync=function(q){function n(E){q.apply(B,arguments),dq()}return Object.defineProperty(n,Yq,{value:q}),n}(B.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){e(B[F]),Q("assert").equal(B[F].length,0)})}var wq;if(!global[F])rq(global,B[F]);Iq.exports=Bq(rE(B));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!B.__patched)Iq.exports=Bq(B),B.__patched=!0;function Bq(q){fE(q),q.gracefulify=Bq,q.createReadStream=gq,q.createWriteStream=bq;var n=q.readFile;q.readFile=E;function E(z,Z,Y){if(typeof Z==="function")Y=Z,Z=null;return M(z,Z,Y);function M(T,I,w,D){return n(T,I,function(H){if(H&&(H.code==="EMFILE"||H.code==="ENFILE"))s([M,[T,I,w],H,D||Date.now(),Date.now()]);else if(typeof w==="function")w.apply(this,arguments)})}}var y=q.writeFile;q.writeFile=J;function J(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=null;return T(z,Z,Y,M);function T(I,w,D,H,k){return y(I,w,D,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var O=q.appendFile;if(O)q.appendFile=_;function _(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=null;return T(z,Z,Y,M);function T(I,w,D,H,k){return O(I,w,D,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var U=q.copyFile;if(U)q.copyFile=j;function j(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=0;return T(z,Z,Y,M);function T(I,w,D,H,k){return U(I,w,D,function(x){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var $=q.readdir;q.readdir=A;var V=/^v[0-5]\./;function A(z,Z,Y){if(typeof Z==="function")Y=Z,Z=null;var M=V.test(process.version)?function I(w,D,H,k){return $(w,T(w,D,H,k))}:function I(w,D,H,k){return $(w,D,T(w,D,H,k))};return M(z,Z,Y);function T(I,w,D,H){return function(k,x){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))s([M,[I,w,D],k,H||Date.now(),Date.now()]);else{if(x&&x.sort)x.sort();if(typeof D==="function")D.call(this,k,x)}}}}if(process.version.substr(0,4)==="v0.8"){var L=dE(q);R=L.ReadStream,m=L.WriteStream}var K=q.ReadStream;if(K)R.prototype=Object.create(K.prototype),R.prototype.open=h;var P=q.WriteStream;if(P)m.prototype=Object.create(P.prototype),m.prototype.open=Jq;Object.defineProperty(q,"ReadStream",{get:function(){return R},set:function(z){R=z},enumerable:!0,configurable:!0}),Object.defineProperty(q,"WriteStream",{get:function(){return m},set:function(z){m=z},enumerable:!0,configurable:!0});var N=R;Object.defineProperty(q,"FileReadStream",{get:function(){return N},set:function(z){N=z},enumerable:!0,configurable:!0});var C=m;Object.defineProperty(q,"FileWriteStream",{get:function(){return C},set:function(z){C=z},enumerable:!0,configurable:!0});function R(z,Z){if(this instanceof R)return K.apply(this,arguments),this;else return R.apply(Object.create(R.prototype),arguments)}function h(){var z=this;Rq(z.path,z.flags,z.mode,function(Z,Y){if(Z){if(z.autoClose)z.destroy();z.emit("error",Z)}else z.fd=Y,z.emit("open",Y),z.read()})}function m(z,Z){if(this instanceof m)return P.apply(this,arguments),this;else return m.apply(Object.create(m.prototype),arguments)}function Jq(){var z=this;Rq(z.path,z.flags,z.mode,function(Z,Y){if(Z)z.destroy(),z.emit("error",Z);else z.fd=Y,z.emit("open",Y)})}function gq(z,Z){return new q.ReadStream(z,Z)}function bq(z,Z){return new q.WriteStream(z,Z)}var mE=q.open;q.open=Rq;function Rq(z,Z,Y,M){if(typeof Y==="function")M=Y,Y=null;return T(z,Z,Y,M);function T(I,w,D,H,k){return mE(I,w,D,function(x,VO){if(x&&(x.code==="EMFILE"||x.code==="ENFILE"))s([T,[I,w,D,H],x,k||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}return q}function s(q){e("ENQUEUE",q[0].name,q[1]),B[F].push(q),Dq()}var Xq;function dq(){var q=Date.now();for(var n=0;n<B[F].length;++n)if(B[F][n].length>2)B[F][n][3]=q,B[F][n][4]=q;Dq()}function Dq(){if(clearTimeout(Xq),Xq=void 0,B[F].length===0)return;var q=B[F].shift(),n=q[0],E=q[1],y=q[2],J=q[3],O=q[4];if(J===void 0)e("RETRY",n.name,E),n.apply(null,E);else if(Date.now()-J>=60000){e("TIMEOUT",n.name,E);var _=E.pop();if(typeof _==="function")_.call(null,y)}else{var U=Date.now()-O,j=Math.max(O-J,1),$=Math.min(j*1.2,100);if(U>=$)e("RETRY",n.name,E),n.apply(null,E.concat([J]));else B[F].push(q)}if(Xq===void 0)Xq=setTimeout(Dq,0)}});var g=X((uq)=>{var aq=u().fromCallback,S=qq(),eE=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter((q)=>{return typeof S[q]==="function"});Object.assign(uq,S);eE.forEach((q)=>{uq[q]=aq(S[q])});uq.exists=function(q,n){if(typeof n==="function")return S.exists(q,n);return new Promise((E)=>{return S.exists(q,E)})};uq.read=function(q,n,E,y,J,O){if(typeof O==="function")return S.read(q,n,E,y,J,O);return new Promise((_,U)=>{S.read(q,n,E,y,J,(j,$,V)=>{if(j)return U(j);_({bytesRead:$,buffer:V})})})};uq.write=function(q,n,...E){if(typeof E[E.length-1]==="function")return S.write(q,n,...E);return new Promise((y,J)=>{S.write(q,n,...E,(O,_,U)=>{if(O)return J(O);y({bytesWritten:_,buffer:U})})})};uq.readv=function(q,n,...E){if(typeof E[E.length-1]==="function")return S.readv(q,n,...E);return new Promise((y,J)=>{S.readv(q,n,...E,(O,_,U)=>{if(O)return J(O);y({bytesRead:_,buffers:U})})})};uq.writev=function(q,n,...E){if(typeof E[E.length-1]==="function")return S.writev(q,n,...E);return new Promise((y,J)=>{S.writev(q,n,...E,(O,_,U)=>{if(O)return J(O);y({bytesWritten:_,buffers:U})})})};if(typeof S.realpath.native==="function")uq.realpath.native=aq(S.realpath.native);else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var tq=X((Jy,eq)=>{var yy=Q("path");Jy.checkPath=function q(n){if(process.platform==="win32"){if(/[<>:"|?*]/.test(n.replace(yy.parse(n).root,""))){let y=new Error(`Path contains invalid characters: ${n}`);throw y.code="EINVAL",y}}}});var En=X((_y,Qq)=>{var sq=g(),{checkPath:qn}=tq(),nn=(q)=>{let n={mode:511};if(typeof q==="number")return q;return{...n,...q}.mode};_y.makeDir=async(q,n)=>{return qn(q),sq.mkdir(q,{mode:nn(n),recursive:!0})};_y.makeDirSync=(q,n)=>{return qn(q),sq.mkdirSync(q,{mode:nn(n),recursive:!0})}});var l=X((XO,yn)=>{var Uy=u().fromPromise,{makeDir:zy,makeDirSync:Wq}=En(),Mq=Uy(zy);yn.exports={mkdirs:Mq,mkdirsSync:Wq,mkdirp:Mq,mkdirpSync:Wq,ensureDir:Mq,ensureDirSync:Wq}});var d=X((YO,On)=>{var Ly=u().fromPromise,Jn=g();function Py(q){return Jn.access(q).then(()=>!0).catch(()=>!1)}On.exports={pathExists:Ly(Py),pathExistsSync:Jn.existsSync}});var Tq=X((ZO,_n)=>{var nq=g(),Ay=u().fromPromise;async function Gy(q,n,E){let y=await nq.open(q,"r+"),J=null;try{await nq.futimes(y,n,E)}finally{try{await nq.close(y)}catch(O){J=O}}if(J)throw J}function Xy(q,n,E){let y=nq.openSync(q,"r+");return nq.futimesSync(y,n,E),nq.closeSync(y)}_n.exports={utimesMillis:Ay(Gy),utimesMillisSync:Xy}});var t=X((CO,zn)=>{var Eq=g(),W=Q("path"),Vn=u().fromPromise;function Yy(q,n,E){let y=E.dereference?(J)=>Eq.stat(J,{bigint:!0}):(J)=>Eq.lstat(J,{bigint:!0});return Promise.all([y(q),y(n).catch((J)=>{if(J.code==="ENOENT")return null;throw J})]).then(([J,O])=>({srcStat:J,destStat:O}))}function Zy(q,n,E){let y,J=E.dereference?(_)=>Eq.statSync(_,{bigint:!0}):(_)=>Eq.lstatSync(_,{bigint:!0}),O=J(q);try{y=J(n)}catch(_){if(_.code==="ENOENT")return{srcStat:O,destStat:null};throw _}return{srcStat:O,destStat:y}}async function Cy(q,n,E,y){let{srcStat:J,destStat:O}=await Yy(q,n,y);if(O){if(Oq(J,O)){let _=W.basename(q),U=W.basename(n);if(E==="move"&&_!==U&&_.toLowerCase()===U.toLowerCase())return{srcStat:J,destStat:O,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(J.isDirectory()&&!O.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${q}'.`);if(!J.isDirectory()&&O.isDirectory())throw new Error(`Cannot overwrite directory '${n}' with non-directory '${q}'.`)}if(J.isDirectory()&&kq(q,n))throw new Error(Zq(q,n,E));return{srcStat:J,destStat:O}}function Hy(q,n,E,y){let{srcStat:J,destStat:O}=Zy(q,n,y);if(O){if(Oq(J,O)){let _=W.basename(q),U=W.basename(n);if(E==="move"&&_!==U&&_.toLowerCase()===U.toLowerCase())return{srcStat:J,destStat:O,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(J.isDirectory()&&!O.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${q}'.`);if(!J.isDirectory()&&O.isDirectory())throw new Error(`Cannot overwrite directory '${n}' with non-directory '${q}'.`)}if(J.isDirectory()&&kq(q,n))throw new Error(Zq(q,n,E));return{srcStat:J,destStat:O}}async function Kn(q,n,E,y){let J=W.resolve(W.dirname(q)),O=W.resolve(W.dirname(E));if(O===J||O===W.parse(O).root)return;let _;try{_=await Eq.stat(O,{bigint:!0})}catch(U){if(U.code==="ENOENT")return;throw U}if(Oq(n,_))throw new Error(Zq(q,E,y));return Kn(q,n,O,y)}function Un(q,n,E,y){let J=W.resolve(W.dirname(q)),O=W.resolve(W.dirname(E));if(O===J||O===W.parse(O).root)return;let _;try{_=Eq.statSync(O,{bigint:!0})}catch(U){if(U.code==="ENOENT")return;throw U}if(Oq(n,_))throw new Error(Zq(q,E,y));return Un(q,n,O,y)}function Oq(q,n){return n.ino&&n.dev&&n.ino===q.ino&&n.dev===q.dev}function kq(q,n){let E=W.resolve(q).split(W.sep).filter((J)=>J),y=W.resolve(n).split(W.sep).filter((J)=>J);return E.every((J,O)=>y[O]===J)}function Zq(q,n,E){return`Cannot ${E} '${q}' to a subdirectory of itself, '${n}'.`}zn.exports={checkPaths:Vn(Cy),checkPathsSync:Hy,checkParentPaths:Vn(Kn),checkParentPathsSync:Un,isSrcSubdir:kq,areIdentical:Oq}});var Xn=X((HO,Gn)=>{var v=g(),_q=Q("path"),{mkdirs:Ny}=l(),{pathExists:xy}=d(),{utimesMillis:jy}=Tq(),Vq=t();async function Ry(q,n,E={}){if(typeof E==="function")E={filter:E};if(E.clobber="clobber"in E?!!E.clobber:!0,E.overwrite="overwrite"in E?!!E.overwrite:E.clobber,E.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
4
4
|
|
|
5
5
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:y,destStat:J}=await Vq.checkPaths(q,n,"copy",E);if(await Vq.checkParentPaths(q,y,n,"copy"),!await Pn(q,n,E))return;let _=_q.dirname(n);if(!await xy(_))await Ny(_);await An(J,q,n,E)}async function Pn(q,n,E){if(!E.filter)return!0;return E.filter(q,n)}async function An(q,n,E,y){let O=await(y.dereference?v.stat:v.lstat)(n);if(O.isDirectory())return Iy(O,q,n,E,y);if(O.isFile()||O.isCharacterDevice()||O.isBlockDevice())return wy(O,q,n,E,y);if(O.isSymbolicLink())return uy(q,n,E,y);if(O.isSocket())throw new Error(`Cannot copy a socket file: ${n}`);if(O.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${n}`);throw new Error(`Unknown file: ${n}`)}async function wy(q,n,E,y,J){if(!n)return Ln(q,E,y,J);if(J.overwrite)return await v.unlink(y),Ln(q,E,y,J);if(J.errorOnExist)throw new Error(`'${y}' already exists`)}async function Ln(q,n,E,y){if(await v.copyFile(n,E),y.preserveTimestamps){if(By(q.mode))await Dy(E,q.mode);let J=await v.stat(n);await jy(E,J.atime,J.mtime)}return v.chmod(E,q.mode)}function By(q){return(q&128)===0}function Dy(q,n){return v.chmod(q,n|128)}async function Iy(q,n,E,y,J){if(!n)await v.mkdir(y);let O=[];for await(let _ of await v.opendir(E)){let U=_q.join(E,_.name),j=_q.join(y,_.name);O.push(Pn(U,j,J).then(($)=>{if($)return Vq.checkPaths(U,j,"copy",J).then(({destStat:V})=>{return An(V,U,j,J)})}))}if(await Promise.all(O),!n)await v.chmod(y,q.mode)}async function uy(q,n,E,y){let J=await v.readlink(n);if(y.dereference)J=_q.resolve(process.cwd(),J);if(!q)return v.symlink(J,E);let O=null;try{O=await v.readlink(E)}catch(_){if(_.code==="EINVAL"||_.code==="UNKNOWN")return v.symlink(J,E);throw _}if(y.dereference)O=_q.resolve(process.cwd(),O);if(Vq.isSrcSubdir(J,O))throw new Error(`Cannot copy '${J}' to a subdirectory of itself, '${O}'.`);if(Vq.isSrcSubdir(O,J))throw new Error(`Cannot overwrite '${O}' with '${J}'.`);return await v.unlink(E),v.symlink(J,E)}Gn.exports=Ry});var Nn=X((NO,Hn)=>{var b=qq(),Kq=Q("path"),Qy=l().mkdirsSync,Wy=Tq().utimesMillisSync,Uq=t();function My(q,n,E){if(typeof E==="function")E={filter:E};if(E=E||{},E.clobber="clobber"in E?!!E.clobber:!0,E.overwrite="overwrite"in E?!!E.overwrite:E.clobber,E.preserveTimestamps&&process.arch==="ia32")process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class n extends Error{constructor(t,e=!0){let o,r=!0;if(typeof e==="boolean")o=void 0,r=e;else if(e!=null&&typeof e==="object")o=e.logger,r=e.tryNextLink??!0;super(t);this.name="ProviderError",this.tryNextLink=r,Object.setPrototypeOf(this,n.prototype),o?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,e=!0){return Object.assign(new this(t.message,e),t)}}class u extends n{constructor(t,e=!0){super(t,e);this.name="CredentialsProviderError",Object.setPrototypeOf(this,u.prototype)}}class l extends n{constructor(t,e=!0){super(t,e);this.name="TokenProviderError",Object.setPrototypeOf(this,l.prototype)}}var v=(...t)=>async()=>{if(t.length===0)throw new n("No providers in chain");let e;for(let o of t)try{return await o()}catch(r){if(e=r,r?.tryNextLink)continue;throw r}throw e};var w=(t)=>()=>Promise.resolve(t);var b=(t,e,o)=>{let r,i,s,f=!1,a=async()=>{if(!i)i=t();try{r=await i,s=!0,f=!1}finally{i=void 0}return r};if(e===void 0)return async(c)=>{if(!s||c?.forceRefresh)r=await a();return r};return async(c)=>{if(!s||c?.forceRefresh)r=await a();if(f)return r;if(o&&!o(r))return f=!0,r;if(e(r))return await a(),r;return r}};export{n as Kc,u as Lc,l as Mc,v as Nc,w as Oc,b as Pc};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Eb as F,Fb as Ee}from"./chunk-e1kefb68.js";import{Ib as m,Jb as Te,ac as wt}from"./chunk-jky37dv1.js";import{hc as _r,ic as be,mc as or,nc as Or}from"./chunk-5vhayxpk.js";import{Cc as me}from"./chunk-8acb2bq0.js";import{Gc as Le}from"./chunk-5eh2tfep.js";import{Pc as Mt}from"./chunk-z80nypa9.js";import{Rc as S,Wc as Yr}from"./chunk-2pj0cr49.js";function Zr(e){return e}var Gt=(e)=>(t)=>async(r)=>{if(!m.isInstance(r.request))return t(r);let{request:o}=r,{handlerProtocol:n=""}=e.requestHandler.metadata||{};if(n.indexOf("h2")>=0&&!o.headers[":authority"])delete o.headers.host,o.headers[":authority"]=o.hostname+(o.port?":"+o.port:"");else if(!o.headers.host){let s=o.hostname;if(o.port!=null)s+=`:${o.port}`;o.headers.host=s}return t(r)},Vt={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Jr=(e)=>({applyToStack:(t)=>{t.add(Gt(e),Vt)}});var Bt=()=>(e,t)=>async(r)=>{try{let o=await e(r),{clientName:n,commandName:s,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:f}=a,u=c??t.inputFilterSensitiveLog,R=f??t.outputFilterSensitiveLog,{$metadata:l,...d}=o.output;return i?.info?.({clientName:n,commandName:s,input:u(r.input),output:R(d),metadata:l}),o}catch(o){let{clientName:n,commandName:s,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c}=a,f=c??t.inputFilterSensitiveLog;throw i?.error?.({clientName:n,commandName:s,input:f(r.input),error:o,metadata:o.$metadata}),o}},Wt={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Qr=(e)=>({applyToStack:(t)=>{t.add(Bt(),Wt)}});var ne="X-Amzn-Trace-Id",Yt="AWS_LAMBDA_FUNCTION_NAME",jt="_X_AMZN_TRACE_ID",zt=(e)=>(t)=>async(r)=>{let{request:o}=r;if(!m.isInstance(o)||e.runtime!=="node")return t(r);let n=Object.keys(o.headers??{}).find((c)=>c.toLowerCase()===ne.toLowerCase())??ne;if(o.headers.hasOwnProperty(n))return t(r);let s=process.env[Yt],i=process.env[jt],a=(c)=>typeof c==="string"&&c.length>0;if(a(s)&&a(i))o.headers[ne]=i;return t({...r,request:o})},Xt={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},no=(e)=>({applyToStack:(t)=>{t.add(zt(e),Xt)}});var Ce=S(be(),1),se=void 0;function Ht(e){if(e===void 0)return!0;return typeof e==="string"&&e.length<=50}function io(e){let t=Ce.normalizeProvider(e.userAgentAppId??se);return{...e,customUserAgent:typeof e.customUserAgent==="string"?[[e.customUserAgent]]:e.customUserAgent,userAgentAppId:async()=>{let r=await t();if(!Ht(r)){let o=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;if(typeof r!=="string")o?.warn("userAgentAppId must be a string or undefined.");else if(r.length>50)o?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}}}class qt{constructor({size:e,params:t}){if(this.data=new Map,this.parameters=[],this.capacity=e??50,t)this.parameters=t}get(e,t){let r=this.hash(e);if(r===!1)return t();if(!this.data.has(r)){if(this.data.size>this.capacity+10){let o=this.data.keys(),n=0;while(!0){let{value:s,done:i}=o.next();if(this.data.delete(s),i||++n>10)break}}this.data.set(r,t())}return this.data.get(r)}size(){return this.data.size}hash(e){let t="",{parameters:r}=this;if(r.length===0)return!1;for(let o of r){let n=String(e[o]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}var Zt=new RegExp("^(?: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}$"),L=(e)=>Zt.test(e)||e.startsWith("[")&&e.endsWith("]");var Jt=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),M=(e,t=!1)=>{if(!t)return Jt.test(e);let r=e.split(".");for(let o of r)if(!M(o))return!1;return!0};var $={};var h="endpoints";function E(e){if(typeof e!=="object"||e==null)return e;if("ref"in e)return`$${E(e.ref)}`;if("fn"in e)return`${e.fn}(${(e.argv||[]).map(E).join(", ")})`;return JSON.stringify(e,null,2)}class p extends Error{constructor(e){super(e);this.name="EndpointError"}}var De=(e,t)=>e===t;var Ue=(e)=>{let t=e.split("."),r=[];for(let o of t){let n=o.indexOf("[");if(n!==-1){if(o.indexOf("]")!==o.length-1)throw new p(`Path: '${e}' does not end with ']'`);let s=o.slice(n+1,-1);if(Number.isNaN(parseInt(s)))throw new p(`Invalid array index: '${s}' in path: '${e}'`);if(n!==0)r.push(o.slice(0,n));r.push(s)}else r.push(o)}return r};var B=(e,t)=>Ue(t).reduce((r,o)=>{if(typeof r!=="object")throw new p(`Index '${o}' in '${t}' not found in '${JSON.stringify(e)}'`);else if(Array.isArray(r))return r[parseInt(o)];return r[o]},e);var Pe=(e)=>e!=null;var ve=(e)=>!e;var W=S(Le(),1);var ie={[W.EndpointURLScheme.HTTP]:80,[W.EndpointURLScheme.HTTPS]:443},Me=(e)=>{let t=(()=>{try{if(e instanceof URL)return e;if(typeof e==="object"&&"hostname"in e){let{hostname:l,port:d,protocol:I="",path:V="",query:$t={}}=e,Ie=new URL(`${I}//${l}${d?`:${d}`:""}${V}`);return Ie.search=Object.entries($t).map(([Ft,kt])=>`${Ft}=${kt}`).join("&"),Ie}return new URL(e)}catch(l){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let r=t.href,{host:o,hostname:n,pathname:s,protocol:i,search:a}=t;if(a)return null;let c=i.slice(0,-1);if(!Object.values(W.EndpointURLScheme).includes(c))return null;let f=L(n),u=r.includes(`${o}:${ie[c]}`)||typeof e==="string"&&e.includes(`${o}:${ie[c]}`),R=`${o}${u?`:${ie[c]}`:""}`;return{scheme:c,authority:R,path:s,normalizedPath:s.endsWith("/")?s:`${s}/`,isIp:f}};var $e=(e,t)=>e===t;var Fe=(e,t,r,o)=>{if(t>=r||e.length<r)return null;if(!o)return e.substring(t,r);return e.substring(e.length-r,e.length-t)};var ke=(e)=>encodeURIComponent(e).replace(/[!*'()]/g,(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`);var Ge={booleanEquals:De,getAttr:B,isSet:Pe,isValidHostLabel:M,not:ve,parseURL:Me,stringEquals:$e,substring:Fe,uriEncode:ke};var Y=(e,t)=>{let r=[],o={...t.endpointParams,...t.referenceRecord},n=0;while(n<e.length){let s=e.indexOf("{",n);if(s===-1){r.push(e.slice(n));break}r.push(e.slice(n,s));let i=e.indexOf("}",s);if(i===-1){r.push(e.slice(s));break}if(e[s+1]==="{"&&e[i+1]==="}")r.push(e.slice(s+1,i)),n=i+2;let a=e.substring(s+1,i);if(a.includes("#")){let[c,f]=a.split("#");r.push(B(o[c],f))}else r.push(o[a]);n=i+1}return r.join("")};var Ve=({ref:e},t)=>{return{...t.endpointParams,...t.referenceRecord}[e]};var T=(e,t,r)=>{if(typeof e==="string")return Y(e,r);else if(e.fn)return j(e,r);else if(e.ref)return Ve(e,r);throw new p(`'${t}': ${String(e)} is not a string, function or reference.`)};var j=({fn:e,argv:t},r)=>{let o=t.map((s)=>["boolean","number"].includes(typeof s)?s:T(s,"arg",r)),n=e.split(".");if(n[0]in $&&n[1]!=null)return $[n[0]][n[1]](...o);return Ge[e](...o)};var Be=({assign:e,...t},r)=>{if(e&&e in r.referenceRecord)throw new p(`'${e}' is already defined in Reference Record.`);let o=j(t,r);return r.logger?.debug?.(`${h} evaluateCondition: ${E(t)} = ${E(o)}`),{result:o===""?!0:!!o,...e!=null&&{toAssign:{name:e,value:o}}}};var b=(e=[],t)=>{let r={};for(let o of e){let{result:n,toAssign:s}=Be(o,{...t,referenceRecord:{...t.referenceRecord,...r}});if(!n)return{result:n};if(s)r[s.name]=s.value,t.logger?.debug?.(`${h} assign: ${s.name} := ${E(s.value)}`)}return{result:!0,referenceRecord:r}};var We=(e,t)=>Object.entries(e).reduce((r,[o,n])=>({...r,[o]:n.map((s)=>{let i=T(s,"Header value entry",t);if(typeof i!=="string")throw new p(`Header '${o}' value '${i}' is not a string`);return i})}),{});var ae=(e,t)=>{if(Array.isArray(e))return e.map((r)=>ae(r,t));switch(typeof e){case"string":return Y(e,t);case"object":if(e===null)throw new p(`Unexpected endpoint property: ${e}`);return z(e,t);case"boolean":return e;default:throw new p(`Unexpected endpoint property type: ${typeof e}`)}};var z=(e,t)=>Object.entries(e).reduce((r,[o,n])=>({...r,[o]:ae(n,t)}),{});var Ye=(e,t)=>{let r=T(e,"Endpoint URL",t);if(typeof r==="string")try{return new URL(r)}catch(o){throw console.error(`Failed to construct URL with ${r}`,o),o}throw new p(`Endpoint URL must be a string, got ${typeof r}`)};var je=(e,t)=>{let{conditions:r,endpoint:o}=e,{result:n,referenceRecord:s}=b(r,t);if(!n)return;let i={...t,referenceRecord:{...t.referenceRecord,...s}},{url:a,properties:c,headers:f}=o;return t.logger?.debug?.(`${h} Resolving endpoint from template: ${E(o)}`),{...f!=null&&{headers:We(f,i)},...c!=null&&{properties:z(c,i)},url:Ye(a,i)}};var ze=(e,t)=>{let{conditions:r,error:o}=e,{result:n,referenceRecord:s}=b(r,t);if(!n)return;throw new p(T(o,"Error",{...t,referenceRecord:{...t.referenceRecord,...s}}))};var Xe=(e,t)=>{let{conditions:r,rules:o}=e,{result:n,referenceRecord:s}=b(r,t);if(!n)return;return X(o,{...t,referenceRecord:{...t.referenceRecord,...s}})};var X=(e,t)=>{for(let r of e)if(r.type==="endpoint"){let o=je(r,t);if(o)return o}else if(r.type==="error")ze(r,t);else if(r.type==="tree"){let o=Xe(r,t);if(o)return o}else throw new p(`Unknown endpoint rule: ${r}`);throw new p("Rules evaluation failed")};var Kt=(e,t)=>{let{endpointParams:r,logger:o}=t,{parameters:n,rules:s}=e;t.logger?.debug?.(`${h} Initial EndpointParams: ${E(r)}`);let i=Object.entries(n).filter(([,f])=>f.default!=null).map(([f,u])=>[f,u.default]);if(i.length>0)for(let[f,u]of i)r[f]=r[f]??u;let a=Object.entries(n).filter(([,f])=>f.required).map(([f])=>f);for(let f of a)if(r[f]==null)throw new p(`Missing required parameter: '${f}'`);let c=X(s,{endpointParams:r,logger:o,referenceRecord:{}});return t.logger?.debug?.(`${h} Resolved endpoint: ${E(c)}`),c};var ce=(e,t=!1)=>{if(t){for(let r of e.split("."))if(!ce(r))return!1;return!0}if(!M(e))return!1;if(e.length<3||e.length>63)return!1;if(e!==e.toLowerCase())return!1;if(L(e))return!1;return!0};var He=(e)=>{let t=e.split(":");if(t.length<6)return null;let[r,o,n,s,i,...a]=t;if(r!=="arn"||o===""||n===""||a.join(":")==="")return null;let c=a.map((f)=>f.split("/")).flat();return{partition:o,service:n,region:s,accountId:i,resourceId:c}};var qe={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"AWS ISOF global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}}],version:"1.1"};var er=qe,tr="",Ze=(e)=>{let{partitions:t}=er;for(let o of t){let{regions:n,outputs:s}=o;for(let[i,a]of Object.entries(n))if(i===e)return{...s,...a}}for(let o of t){let{regionRegex:n,outputs:s}=o;if(new RegExp(n).test(e))return{...s}}let r=t.find((o)=>o.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}};var Je=()=>tr;var rr={isVirtualHostableS3Bucket:ce,parseArn:He,partition:Ze};$.aws=rr;var x=S(or(),1),nr=/\d{12}\.ddb/;async function Ke(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")x.setFeature(e,"PROTOCOL_RPC_V2_CBOR","M");if(typeof t.retryStrategy==="function"){let s=await t.retryStrategy();if(typeof s.acquireInitialRetryToken==="function")if(s.constructor?.name?.includes("Adaptive"))x.setFeature(e,"RETRY_MODE_ADAPTIVE","F");else x.setFeature(e,"RETRY_MODE_STANDARD","E");else x.setFeature(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode==="function"){let s=e.endpointV2;if(String(s?.url?.hostname).match(nr))x.setFeature(e,"ACCOUNT_ID_ENDPOINT","O");switch(await t.accountIdEndpointMode?.()){case"disabled":x.setFeature(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":x.setFeature(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":x.setFeature(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let n=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(n?.$source){let s=n;if(s.accountId)x.setFeature(e,"RESOLVED_ACCOUNT_ID","T");for(let[i,a]of Object.entries(s.$source??{}))x.setFeature(e,i,a)}}var fe="user-agent",H="x-amz-user-agent",pe=" ",q="/",Qe=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,et=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,ue="-";function tt(e){let t="";for(let r in e){let o=e[r];if(t.length+o.length+1<=1024){if(t.length)t+=","+o;else t+=o;continue}break}return t}var sr=(e)=>(t,r)=>async(o)=>{let{request:n}=o;if(!m.isInstance(n))return t(o);let{headers:s}=n,i=r?.userAgent?.map(Z)||[],a=(await e.defaultUserAgentProvider()).map(Z);await Ke(r,e,o);let c=r;a.push(`m/${tt(Object.assign({},r.__smithy_context?.features,c.__aws_sdk_context?.features))}`);let f=e?.customUserAgent?.map(Z)||[],u=await e.userAgentAppId();if(u)a.push(Z([`app/${u}`]));let R=Je(),l=(R?[R]:[]).concat([...a,...i,...f]).join(pe),d=[...a.filter((I)=>I.startsWith("aws-sdk-")),...f].join(pe);if(e.runtime!=="browser"){if(d)s[H]=s[H]?`${s[fe]} ${d}`:d;s[fe]=l}else s[H]=l;return t({...o,request:n})},Z=(e)=>{let t=e[0].split(q).map((i)=>i.replace(Qe,ue)).join(q),r=e[1]?.replace(et,ue),o=t.indexOf(q),n=t.substring(0,o),s=t.substring(o+1);if(n==="api")s=s.toLowerCase();return[n,s,r].filter((i)=>i&&i.length>0).reduce((i,a,c)=>{switch(c){case 0:return a;case 1:return`${i}/${a}`;default:return`${i}#${a}`}},"")},ir={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Xs=(e)=>({applyToStack:(t)=>{t.add(sr(e),ir)}});var J=(e)=>typeof e==="string"&&(e.startsWith("fips-")||e.endsWith("-fips"));var de=(e)=>J(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e;var oi=(e)=>{let{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if(typeof t==="string")return de(t);let o=await t();return de(o)},useFipsEndpoint:async()=>{let o=typeof t==="string"?t:await t();if(J(o))return!0;return typeof r!=="function"?Promise.resolve(!!r):r()}}};var C=(e,t,r)=>{if(!(t in e))return;if(e[t]==="true")return!0;if(e[t]==="false")return!1;throw new Error(`Cannot load ${r} "${t}". Expected "true" or "false", got ${e[t]}.`)};var O;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(O||(O={}));var ar="AWS_USE_DUALSTACK_ENDPOINT",cr="use_dualstack_endpoint";var li={environmentVariableSelector:(e)=>C(e,ar,O.ENV),configFileSelector:(e)=>C(e,cr,O.CONFIG),default:!1};var fr="AWS_USE_FIPS_ENDPOINT",pr="use_fips_endpoint";var gi={environmentVariableSelector:(e)=>C(e,fr,O.ENV),configFileSelector:(e)=>C(e,pr,O.CONFIG),default:!1};var le=S(Le(),1),rt=(e)=>e[le.SMITHY_CONTEXT_KEY]||(e[le.SMITHY_CONTEXT_KEY]={});var A=(e)=>{if(typeof e==="function")return e;let t=Promise.resolve(e);return()=>t};var ot={environmentVariableSelector:(e)=>e.AWS_REGION,configFileSelector:(e)=>e.region,default:()=>{throw new Error("Region is missing")}},Li={preferredFile:"credentials"};var nt="content-length";function ur(e){return(t)=>async(r)=>{let o=r.request;if(m.isInstance(o)){let{body:n,headers:s}=o;if(n&&Object.keys(s).map((i)=>i.toLowerCase()).indexOf(nt)===-1)try{let i=e(n);o.headers={...o.headers,[nt]:String(i)}}catch(i){}}return t({...r,request:o})}}var dr={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},ca=(e)=>({applyToStack:(t)=>{t.add(ur(e.bodyLengthChecker),dr)}});var lt=S(_r(),1);var ut=S(be(),1);var st=async(e)=>{let t=e?.Bucket||"";if(typeof e.Bucket==="string")e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(xr(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!gr(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)e.ForcePathStyle=!0;if(e.DisableMultiRegionAccessPoints)e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0;return e},lr=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,mr=/(\d+\.){3}\d+/,Er=/\.\./;var gr=(e)=>lr.test(e)&&!mr.test(e)&&!Er.test(e),xr=(e)=>{let[t,r,o,,,n]=e.split(":"),s=t==="arn"&&e.split(":").length>=6,i=Boolean(s&&r&&o&&n);if(s&&!i)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return i};var it=(e,t,r)=>{let o=async()=>{let n=r[e]??r[t];if(typeof n==="function")return n();return n};if(e==="credentialScope"||t==="CredentialScope")return async()=>{let n=typeof r.credentials==="function"?await r.credentials():r.credentials;return n?.credentialScope??n?.CredentialScope};if(e==="accountId"||t==="AccountId")return async()=>{let n=typeof r.credentials==="function"?await r.credentials():r.credentials;return n?.accountId??n?.AccountId};if(e==="endpoint"||t==="endpoint")return async()=>{let n=await o();if(n&&typeof n==="object"){if("url"in n)return n.url.href;if("hostname"in n){let{protocol:s,hostname:i,port:a,path:c}=n;return`${s}//${i}${a?":"+a:""}${c}`}}return n};return o};var at="AWS_ENDPOINT_URL",ct="endpoint_url",ft=(e)=>({environmentVariableSelector:(t)=>{let r=e.split(" ").map((s)=>s.toUpperCase()),o=t[[at,...r].join("_")];if(o)return o;let n=t[at];if(n)return n;return},configFileSelector:(t,r)=>{if(r&&t.services){let n=r[["services",t.services].join(me)];if(n){let s=e.split(" ").map((a)=>a.toLowerCase()),i=n[[s.join("_"),ct].join(me)];if(i)return i}}let o=t[ct];if(o)return o;return},default:void 0});var K=async(e)=>F(ft(e??""))();var Q=(e)=>{if(typeof e==="object"){if("url"in e)return Ee(e.url);return e}return Ee(e)};var pt=async(e,t,r,o)=>{if(!r.endpoint){let i;if(r.serviceConfiguredEndpoint)i=await r.serviceConfiguredEndpoint();else i=await K(r.serviceId);if(i)r.endpoint=()=>Promise.resolve(Q(i))}let n=await Rr(e,t,r);if(typeof r.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(n,o)},Rr=async(e,t,r)=>{let o={},n=t?.getEndpointParameterInstructions?.()||{};for(let[s,i]of Object.entries(n))switch(i.type){case"staticContextParams":o[s]=i.value;break;case"contextParams":o[s]=e[i.name];break;case"clientContextParams":case"builtInParams":o[s]=await it(i.name,s,r)();break;case"operationContextParams":o[s]=i.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(i))}if(Object.keys(n).length===0)Object.assign(o,r);if(String(r.serviceId).toLowerCase()==="s3")await st(o);return o};var dt=({config:e,instructions:t})=>{return(r,o)=>async(n)=>{if(e.endpoint)ut.setFeature(o,"ENDPOINT_OVERRIDE","N");let s=await pt(n.input,{getEndpointParameterInstructions(){return t}},{...e},o);o.endpointV2=s,o.authSchemes=s.properties?.authSchemes;let i=o.authSchemes?.[0];if(i){o.signing_region=i.signingRegion,o.signing_service=i.signingName;let c=rt(o)?.selectedHttpAuthScheme?.httpAuthOption;if(c)c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:i.signingRegion,signingRegion:i.signingRegion,signing_service:i.signingName,signingName:i.signingName,signingRegionSet:i.signingRegionSet},i.properties)}return r({...n})}};var hr={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:lt.serializerMiddlewareOption.name},Ca=(e,t)=>({applyToStack:(r)=>{r.addRelativeTo(dt({config:e,instructions:t}),hr)}});var La=(e)=>{let t=e.tls??!0,{endpoint:r}=e,o=r!=null?async()=>Q(await A(r)()):void 0,s={...e,endpoint:o,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:A(e.useDualstackEndpoint??!1),useFipsEndpoint:A(e.useFipsEndpoint??!1)},i=void 0;return s.serviceConfiguredEndpoint=async()=>{if(e.serviceId&&!i)i=K(e.serviceId);return i},s};var g;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(g||(g={}));var w=3,mt=g.STANDARD;var Et=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],gt=["TimeoutError","RequestTimeout","RequestTimeoutException"],xt=[500,502,503,504],Rt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];var Ar=(e)=>e.$metadata?.clockSkewCorrected,D=(e)=>e.$metadata?.httpStatusCode===429||Et.includes(e.name)||e.$retryable?.throttling==!0,k=(e,t=0)=>Ar(e)||gt.includes(e.name)||Rt.includes(e?.code||"")||xt.includes(e.$metadata?.httpStatusCode||0)||e.cause!==void 0&&t<=10&&k(e.cause,t+1),_t=(e)=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;if(500<=t&&t<=599&&!k(e))return!0;return!1}return!1};class U{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??0.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??0.5,this.scaleConstant=e?.scaleConstant??0.4,this.smooth=e?.smooth??0.8;let t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(!this.enabled)return;if(this.refillTokenBucket(),e>this.currentCapacity){let t=(e-this.currentCapacity)/this.fillRate*1000;await new Promise((r)=>U.setTimeoutFn(r,t))}this.currentCapacity=this.currentCapacity-e}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),D(e)){let o=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=o,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(o),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());let r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){let r=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(r*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}U.setTimeoutFn=setTimeout;var y=100,G=20000,ge=500,ee=500,xe=5,Re=10,_e=1,te="amz-sdk-invocation-id",re="amz-sdk-request";var ht=()=>{let e=y;return{computeNextBackoffDelay:(o)=>{return Math.floor(Math.min(G,Math.random()*2**o*e))},setDelayBase:(o)=>{e=o}}};var he=({retryDelay:e,retryCount:t,retryCost:r})=>{return{getRetryCount:()=>t,getRetryDelay:()=>Math.min(G,e),getRetryCost:()=>r}};class P{constructor(e){this.maxAttempts=e,this.mode=g.STANDARD,this.capacity=ee,this.retryBackoffStrategy=ht(),this.maxAttemptsProvider=typeof e==="function"?e:async()=>e}async acquireInitialRetryToken(e){return he({retryDelay:y,retryCount:0})}async refreshRetryTokenForRetry(e,t){let r=await this.getMaxAttempts();if(this.shouldRetry(e,t,r)){let o=t.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?ge:y);let n=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),s=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,n):n,i=this.getCapacityCost(o);return this.capacity-=i,he({retryDelay:s,retryCount:e.getRetryCount()+1,retryCost:i})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(ee,this.capacity+(e.getRetryCost()??_e))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn(`Max attempts provider could not resolve. Using default of ${w}`),w}}shouldRetry(e,t,r){return e.getRetryCount()+1<r&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e==="TRANSIENT"?Re:xe}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class Ae{constructor(e,t){this.maxAttemptsProvider=e,this.mode=g.ADAPTIVE;let{rateLimiter:r}=t??{};this.rateLimiter=r??new U,this.standardRetryStrategy=new P(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}var At="AWS_MAX_ATTEMPTS",St="max_attempts",yc={environmentVariableSelector:(e)=>{let t=e[At];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw new Error(`Environment variable ${At} mast be a number, got "${t}"`);return r},configFileSelector:(e)=>{let t=e[St];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw new Error(`Shared config file entry ${St} mast be a number, got "${t}"`);return r},default:w},Nc=(e)=>{let{retryStrategy:t}=e,r=A(e.maxAttempts??w);return{...e,maxAttempts:r,retryStrategy:async()=>{if(t)return t;if(await A(e.retryMode)()===g.ADAPTIVE)return new Ae(r);return new P(r)}}},Sr="AWS_RETRY_MODE",Tr="retry_mode",Ic={environmentVariableSelector:(e)=>e[Sr],configFileSelector:(e)=>e[Tr],default:mt};var _=S(Or(),1),Cc=_.default.v1,Dc=_.default.v3,Tt=_.default.v4,Uc=_.default.v5,Pc=_.default.NIL,vc=_.default.version,Lc=_.default.validate,Mc=_.default.stringify,$c=_.default.parse;import{Readable as wr}from"stream";var Ot=(e)=>e?.body instanceof wr||typeof ReadableStream!=="undefined"&&e?.body instanceof ReadableStream;var Se=(e)=>{if(e instanceof Error)return e;if(e instanceof Object)return Object.assign(new Error,e);if(typeof e==="string")return new Error(e);return new Error(`AWS SDK error wrapper for ${e}`)};var yr=(e)=>(t,r)=>async(o)=>{let n=await e.retryStrategy(),s=await e.maxAttempts();if(Nr(n)){n=n;let i=await n.acquireInitialRetryToken(r.partition_id),a=new Error,c=0,f=0,{request:u}=o,R=m.isInstance(u);if(R)u.headers[te]=Tt();while(!0)try{if(R)u.headers[re]=`attempt=${c+1}; max=${s}`;let{response:l,output:d}=await t(o);return n.recordSuccess(i),d.$metadata.attempts=c+1,d.$metadata.totalRetryDelay=f,{response:l,output:d}}catch(l){let d=Ir(l);if(a=Se(l),R&&Ot(u))throw(r.logger instanceof wt?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),a;try{i=await n.refreshRetryTokenForRetry(i,d)}catch(V){if(!a.$metadata)a.$metadata={};throw a.$metadata.attempts=c+1,a.$metadata.totalRetryDelay=f,a}c=i.getRetryCount();let I=i.getRetryDelay();f+=I,await new Promise((V)=>setTimeout(V,I))}}else{if(n=n,n?.mode)r.userAgent=[...r.userAgent||[],["cfg/retry-mode",n.mode]];return n.retry(t,o)}},Nr=(e)=>typeof e.acquireInitialRetryToken!=="undefined"&&typeof e.refreshRetryTokenForRetry!=="undefined"&&typeof e.recordSuccess!=="undefined",Ir=(e)=>{let t={error:e,errorType:br(e)},r=Dr(e.$response);if(r)t.retryAfterHint=r;return t},br=(e)=>{if(D(e))return"THROTTLING";if(k(e))return"TRANSIENT";if(_t(e))return"SERVER_ERROR";return"CLIENT_ERROR"},Cr={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},qc=(e)=>({applyToStack:(t)=>{t.add(yr(e),Cr)}}),Dr=(e)=>{if(!Te.isInstance(e))return;let t=Object.keys(e.headers).find((s)=>s.toLowerCase()==="retry-after");if(!t)return;let r=e.headers[t],o=Number(r);if(!Number.isNaN(o))return new Date(o*1000);return new Date(r)};import{platform as Ur,release as Pr}from"os";import{env as Nt,versions as vr}from"process";var Oe={isCrtAvailable:!1};var yt=()=>{if(Oe.isCrtAvailable)return["md/crt-avail"];return null};var Ff=({serviceId:e,clientVersion:t})=>{return async(r)=>{let o=[["aws-sdk-js",t],["ua","2.1"],[`os/${Ur()}`,Pr()],["lang/js"],["md/nodejs",`${vr.node}`]],n=yt();if(n)o.push(n);if(e)o.push([`api/${e}`,t]);if(Nt.AWS_EXECUTION_ENV)o.push([`exec-env/${Nt.AWS_EXECUTION_ENV}`]);let s=await r?.userAgentAppId?.();return s?[...o,[`app/${s}`]]:[...o]}};var Lr="AWS_SDK_UA_APP_ID",Mr="sdk_ua_app_id",$r="sdk-ua-app-id",Bf={environmentVariableSelector:(e)=>e[Lr],configFileSelector:(e)=>e[Mr]??e[$r],default:se};var It=(e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";import{Buffer as we}from"buffer";var N=(e,t=0,r=e.byteLength-t)=>{if(!It(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return we.from(e,t,r)},v=(e,t)=>{if(typeof e!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?we.from(e,t):we.from(e)};var oe=(e)=>{let t=v(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var bt=(e)=>{if(typeof e==="string")return oe(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)};var rp=(e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return N(e.buffer,e.byteOffset,e.byteLength).toString("utf8")};import{Buffer as Fr}from"buffer";import{createHash as kr,createHmac as Gr}from"crypto";class Vr{constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(bt(Ct(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?Gr(this.algorithmIdentifier,Ct(this.secret)):kr(this.algorithmIdentifier)}}function Ct(e,t){if(Fr.isBuffer(e))return e;if(typeof e==="string")return v(e,t);if(ArrayBuffer.isView(e))return N(e.buffer,e.byteOffset,e.byteLength);return N(e)}import{fstatSync as Br,lstatSync as Wr}from"fs";var mp=(e)=>{if(!e)return 0;if(typeof e==="string")return Buffer.byteLength(e);else if(typeof e.byteLength==="number")return e.byteLength;else if(typeof e.size==="number")return e.size;else if(typeof e.start==="number"&&typeof e.end==="number")return e.end+1-e.start;else if(typeof e.path==="string"||Buffer.isBuffer(e.path))return Wr(e.path).size;else if(typeof e.fd==="number")return Br(e.fd).size;throw new Error(`Body Length computation failed for ${e}`)};var Dt="AWS_EXECUTION_ENV",ye="AWS_REGION",Ne="AWS_DEFAULT_REGION",Ut="AWS_EC2_METADATA_DISABLED",Pt=["in-region","cross-region","mobile","standard","legacy"],vt="/latest/meta-data/placement/region";var Lt={environmentVariableSelector:(e)=>{return e.AWS_DEFAULTS_MODE},configFileSelector:(e)=>{return e.defaults_mode},default:"legacy"};var wp=({region:e=F(ot),defaultsMode:t=F(Lt)}={})=>Mt(async()=>{let r=typeof t==="function"?await t():t;switch(r?.toLowerCase()){case"auto":return jr(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(r?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Pt.join(", ")}, got ${r}`)}}),jr=async(e)=>{if(e){let t=typeof e==="function"?await e():e,r=await zr();if(!r)return"standard";if(t===r)return"in-region";else return"cross-region"}return"standard"},zr=async()=>{if(process.env[Dt]&&(process.env[ye]||process.env[Ne]))return process.env[ye]??process.env[Ne];if(!process.env[Ut])try{let{getInstanceMetadataEndpoint:e,httpRequest:t}=await import("./chunk-vrd8j1ky.js"),r=await e();return(await t({...r,path:vt})).toString()}catch(e){}};var bp=(e)=>{let t=async()=>{if(e.region===void 0)throw new Error("Region is missing from runtimeConfig");let r=e.region;if(typeof r==="string")return r;return r()};return{setRegion(r){t=r},region(){return t}}},Cp=(e)=>{return{region:e.region()}};var Hr=/^[A-Za-z0-9+/]*={0,2}$/,Xp=(e)=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Hr.exec(e))throw new TypeError("Invalid base64 string.");let t=v(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var Jp=(e)=>{let t;if(typeof e==="string")t=oe(e);else t=e;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return N(t.buffer,t.byteOffset,t.byteLength).toString("base64")};export{Zr as Wa,Jr as Xa,Qr as Ya,no as Za,io as _a,qt as $a,$ as ab,Kt as bb,rr as cb,Xs as db,li as eb,gi as fb,rt as gb,A as hb,ot as ib,Li as jb,oi as kb,ca as lb,Ca as mb,La as nb,mt as ob,yc as pb,Nc as qb,Ic as rb,qc as sb,Ff as tb,Bf as ub,oe as vb,rp as wb,Vr as xb,mp as yb,Xp as zb,Jp as Ab,wp as Bb,bp as Cb,Cp as Db};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$ as X,Aa as i,Ba as c,P as M,Q as N,R as O,S as Q,T as R,U as S,W as T,X as U,Z as V,_ as W,aa as Y,ba as Z,ca as _,da as $,ea as x,fa as z,ga as C,ha as F,ia as P,ja as h,ka as A,la as D,ma as k,na as f,oa as j,pa as I,qa as g,ra as p,sa as a,ta as m,ua as J,xa as n,ya as l}from"./chunk-
|
|
2
|
+
import{$ as X,Aa as i,Ba as c,P as M,Q as N,R as O,S as Q,T as R,U as S,W as T,X as U,Z as V,_ as W,aa as Y,ba as Z,ca as _,da as $,ea as x,fa as z,ga as C,ha as F,ia as P,ja as h,ka as A,la as D,ma as k,na as f,oa as j,pa as I,qa as g,ra as p,sa as a,ta as m,ua as J,xa as n,ya as l}from"./chunk-c8n8bj03.js";import"./chunk-yv49ttdw.js";import"./chunk-ks9kq37e.js";import"./chunk-zm0j2nyb.js";import"./chunk-e1kefb68.js";import"./chunk-jky37dv1.js";import"./chunk-5vhayxpk.js";import"./chunk-ww48v0ap.js";import"./chunk-8acb2bq0.js";import"./chunk-5eh2tfep.js";import"./chunk-2xrqj8ap.js";import"./chunk-z80nypa9.js";import"./chunk-bgqy98qw.js";import"./chunk-2pj0cr49.js";import w from"process";import{runAction as t}from"@stacksjs/actions";import{cli as e,log as v}from"@stacksjs/cli";import{Action as o}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as r}from"@stacksjs/storage";import{ensureProjectIsInitialized as b}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 s(){let q=e("buddy");if(J(q),x(q),await b())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");let B=await t(o.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),A(q),k(q),Y(q),Z(q),_(q),$(q),z(q),C(q),F(q),P(q),h(q),f(q),j(q),I(q),g(q),a(q),X(q),m(q),J(q),p(q),n(q),l(q),c(q),D(q),i(q),await y(q),q.help(),q.parse()}await s();async function y(q){let G=L.appPath("Commands"),B=r.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{$ as i,Aa as P,Ba as Q,P as e,Q as f,R as m,S as p,T as t,U as x,V as a,W as b,X as c,Y as d,Z as g,_ as h,aa as j,ba as k,ca as l,da as n,ea as q,fa as s,ga as u,ha as v,ia as w,ja as y,ka as z,la as A,ma as B,na as C,oa as D,pa as E,qa as F,ra as G,sa as H,ta as I,ua as J,va as K,wa as L,xa as M,ya as N,za as O}from"./chunk-
|
|
2
|
+
import{$ as i,Aa as P,Ba as Q,P as e,Q as f,R as m,S as p,T as t,U as x,V as a,W as b,X as c,Y as d,Z as g,_ as h,aa as j,ba as k,ca as l,da as n,ea as q,fa as s,ga as u,ha as v,ia as w,ja as y,ka as z,la as A,ma as B,na as C,oa as D,pa as E,qa as F,ra as G,sa as H,ta as I,ua as J,va as K,wa as L,xa as M,ya as N,za as O}from"./chunk-c8n8bj03.js";import"./chunk-yv49ttdw.js";import"./chunk-ks9kq37e.js";import"./chunk-zm0j2nyb.js";import"./chunk-e1kefb68.js";import"./chunk-jky37dv1.js";import"./chunk-5vhayxpk.js";import"./chunk-ww48v0ap.js";import"./chunk-8acb2bq0.js";import"./chunk-5eh2tfep.js";import"./chunk-2xrqj8ap.js";import"./chunk-z80nypa9.js";import"./chunk-bgqy98qw.js";import"./chunk-2pj0cr49.js";export{Q as version,P as upgrade,O as types,N as tinker,M as test,d as startDevelopmentServer,J as setup,I as seed,H as search,G as schedule,F as saas,E as route,D as release,C as queue,B as projects,A as prepublish,z as ports,y as outdated,K as optimizePkgxDeps,w as migrate,v as make,u as list,s as lint,q as key,n as install,l as http,k as generate,j as fresh,i as env,L 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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.1",
|
|
5
5
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -71,52 +71,52 @@
|
|
|
71
71
|
"prepublishOnly": "bun run build && bun run compile:all"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@stacksjs/actions": "0.70.
|
|
75
|
-
"@stacksjs/ai": "0.70.
|
|
76
|
-
"@stacksjs/alias": "0.70.
|
|
77
|
-
"@stacksjs/arrays": "0.70.
|
|
78
|
-
"@stacksjs/auth": "0.70.
|
|
79
|
-
"@stacksjs/build": "0.70.
|
|
80
|
-
"@stacksjs/cache": "0.70.
|
|
81
|
-
"@stacksjs/cli": "0.70.
|
|
82
|
-
"@stacksjs/cloud": "0.70.
|
|
83
|
-
"@stacksjs/collections": "0.70.
|
|
84
|
-
"@stacksjs/config": "0.70.
|
|
85
|
-
"@stacksjs/database": "0.70.
|
|
86
|
-
"@stacksjs/desktop": "0.70.
|
|
87
|
-
"@stacksjs/development": "0.70.
|
|
88
|
-
"@stacksjs/dns": "0.70.
|
|
89
|
-
"@stacksjs/docs": "0.70.
|
|
90
|
-
"@stacksjs/email": "0.70.
|
|
91
|
-
"@stacksjs/enums": "0.70.
|
|
92
|
-
"@stacksjs/error-handling": "0.70.
|
|
93
|
-
"@stacksjs/events": "0.70.
|
|
94
|
-
"@stacksjs/faker": "0.70.
|
|
95
|
-
"@stacksjs/git": "0.70.
|
|
96
|
-
"@stacksjs/health": "0.70.
|
|
97
|
-
"@stacksjs/lint": "0.70.
|
|
98
|
-
"@stacksjs/logging": "0.70.
|
|
99
|
-
"@stacksjs/notifications": "0.70.
|
|
100
|
-
"@stacksjs/objects": "0.70.
|
|
101
|
-
"@stacksjs/orm": "0.70.
|
|
102
|
-
"@stacksjs/path": "0.70.
|
|
103
|
-
"@stacksjs/payments": "0.70.
|
|
104
|
-
"@stacksjs/realtime": "0.70.
|
|
105
|
-
"@stacksjs/router": "0.70.
|
|
106
|
-
"@stacksjs/search-engine": "0.70.
|
|
107
|
-
"@stacksjs/security": "0.70.
|
|
108
|
-
"@stacksjs/server": "0.70.
|
|
109
|
-
"@stacksjs/storage": "0.70.
|
|
110
|
-
"@stacksjs/strings": "0.70.
|
|
111
|
-
"@stacksjs/testing": "0.70.
|
|
112
|
-
"@stacksjs/tunnel": "0.70.
|
|
113
|
-
"@stacksjs/types": "0.70.
|
|
114
|
-
"@stacksjs/ui": "0.70.
|
|
115
|
-
"@stacksjs/utils": "0.70.
|
|
116
|
-
"@stacksjs/validation": "0.70.
|
|
74
|
+
"@stacksjs/actions": "0.70.1",
|
|
75
|
+
"@stacksjs/ai": "0.70.1",
|
|
76
|
+
"@stacksjs/alias": "0.70.1",
|
|
77
|
+
"@stacksjs/arrays": "0.70.1",
|
|
78
|
+
"@stacksjs/auth": "0.70.1",
|
|
79
|
+
"@stacksjs/build": "0.70.1",
|
|
80
|
+
"@stacksjs/cache": "0.70.1",
|
|
81
|
+
"@stacksjs/cli": "0.70.1",
|
|
82
|
+
"@stacksjs/cloud": "0.70.1",
|
|
83
|
+
"@stacksjs/collections": "0.70.1",
|
|
84
|
+
"@stacksjs/config": "0.70.1",
|
|
85
|
+
"@stacksjs/database": "0.70.1",
|
|
86
|
+
"@stacksjs/desktop": "0.70.1",
|
|
87
|
+
"@stacksjs/development": "0.70.1",
|
|
88
|
+
"@stacksjs/dns": "0.70.1",
|
|
89
|
+
"@stacksjs/docs": "0.70.1",
|
|
90
|
+
"@stacksjs/email": "0.70.1",
|
|
91
|
+
"@stacksjs/enums": "0.70.1",
|
|
92
|
+
"@stacksjs/error-handling": "0.70.1",
|
|
93
|
+
"@stacksjs/events": "0.70.1",
|
|
94
|
+
"@stacksjs/faker": "0.70.1",
|
|
95
|
+
"@stacksjs/git": "0.70.1",
|
|
96
|
+
"@stacksjs/health": "0.70.1",
|
|
97
|
+
"@stacksjs/lint": "0.70.1",
|
|
98
|
+
"@stacksjs/logging": "0.70.1",
|
|
99
|
+
"@stacksjs/notifications": "0.70.1",
|
|
100
|
+
"@stacksjs/objects": "0.70.1",
|
|
101
|
+
"@stacksjs/orm": "0.70.1",
|
|
102
|
+
"@stacksjs/path": "0.70.1",
|
|
103
|
+
"@stacksjs/payments": "0.70.1",
|
|
104
|
+
"@stacksjs/realtime": "0.70.1",
|
|
105
|
+
"@stacksjs/router": "0.70.1",
|
|
106
|
+
"@stacksjs/search-engine": "0.70.1",
|
|
107
|
+
"@stacksjs/security": "0.70.1",
|
|
108
|
+
"@stacksjs/server": "0.70.1",
|
|
109
|
+
"@stacksjs/storage": "0.70.1",
|
|
110
|
+
"@stacksjs/strings": "0.70.1",
|
|
111
|
+
"@stacksjs/testing": "0.70.1",
|
|
112
|
+
"@stacksjs/tunnel": "0.70.1",
|
|
113
|
+
"@stacksjs/types": "0.70.1",
|
|
114
|
+
"@stacksjs/ui": "0.70.1",
|
|
115
|
+
"@stacksjs/utils": "0.70.1",
|
|
116
|
+
"@stacksjs/validation": "0.70.1"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
|
-
"@stacksjs/development": "0.70.
|
|
119
|
+
"@stacksjs/development": "0.70.1"
|
|
120
120
|
},
|
|
121
121
|
"config": {
|
|
122
122
|
"commitizen": {
|
package/dist/chunk-0wzn5tma.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Kc as T}from"./chunk-atc0z327.js";import{Lc as f}from"./chunk-2hfepv08.js";import{Mc as E,Rc as p}from"./chunk-6wnzdvc6.js";var c=E(T(),1),N=E(f(),1);import{readFileSync as A}from"fs";var i=(e)=>async(o)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:r,roleSessionName:s,webIdentityToken:n,providerId:S,policyArns:d,policy:l,durationSeconds:m}=e,{roleAssumerWithWebIdentity:t}=e;if(!t){let{getDefaultRoleAssumerWithWebIdentity:a}=await import("./chunk-jm49r4wr.js");t=a({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...o?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return t({RoleArn:r,RoleSessionName:s??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:S,PolicyArns:d,Policy:l,DurationSeconds:m})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",I="AWS_ROLE_ARN",O="AWS_ROLE_SESSION_NAME",k=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[I],s=e?.roleSessionName??process.env[O];if(!o||!r)throw new N.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await i({...e,webIdentityToken:A(o,{encoding:"ascii"}),roleArn:r,roleSessionName:s})();if(o===process.env[_])c.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{i as fromWebToken,k as fromTokenFile};
|
package/dist/chunk-15sp93dn.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Dc as w,zc as u}from"./chunk-18byef1w.js";import{Lc as m}from"./chunk-2hfepv08.js";import{Mc as s}from"./chunk-6wnzdvc6.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 Fb,v as Gb};
|
package/dist/chunk-21ynv2kp.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{xc as O}from"./chunk-jx6tpg9f.js";import{Gc as P}from"./chunk-fbbvmxn3.js";import{Mc as A}from"./chunk-6wnzdvc6.js";var b=(e,t)=>{let r=[];if(e)r.push(e);if(t)for(let n of t)r.push(n);return r},S=(e,t)=>{return`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},$=()=>{let e=[],t=[],r=!1,n=new Set,o=(a)=>a.sort((f,d)=>q[d.step]-q[f.step]||V[d.priority||"normal"]-V[f.priority||"normal"]),s=(a)=>{let f=!1,d=(m)=>{let g=b(m.name,m.aliases);if(g.includes(a)){f=!0;for(let l of g)n.delete(l);return!1}return!0};return e=e.filter(d),t=t.filter(d),f},i=(a)=>{let f=!1,d=(m)=>{if(m.middleware===a){f=!0;for(let g of b(m.name,m.aliases))n.delete(g);return!1}return!0};return e=e.filter(d),t=t.filter(d),f},c=(a)=>{return e.forEach((f)=>{a.add(f.middleware,{...f})}),t.forEach((f)=>{a.addRelativeTo(f.middleware,{...f})}),a.identifyOnResolve?.(E.identifyOnResolve()),a},p=(a)=>{let f=[];return a.before.forEach((d)=>{if(d.before.length===0&&d.after.length===0)f.push(d);else f.push(...p(d))}),f.push(a),a.after.reverse().forEach((d)=>{if(d.before.length===0&&d.after.length===0)f.push(d);else f.push(...p(d))}),f},x=(a=!1)=>{let f=[],d=[],m={};return e.forEach((l)=>{let h={...l,before:[],after:[]};for(let u of b(h.name,h.aliases))m[u]=h;f.push(h)}),t.forEach((l)=>{let h={...l,before:[],after:[]};for(let u of b(h.name,h.aliases))m[u]=h;d.push(h)}),d.forEach((l)=>{if(l.toMiddleware){let h=m[l.toMiddleware];if(h===void 0){if(a)return;throw new Error(`${l.toMiddleware} is not found when adding ${S(l.name,l.aliases)} middleware ${l.relation} ${l.toMiddleware}`)}if(l.relation==="after")h.after.push(l);if(l.relation==="before")h.before.push(l)}}),o(f).map(p).reduce((l,h)=>{return l.push(...h),l},[])},E={add:(a,f={})=>{let{name:d,override:m,aliases:g}=f,l={step:"initialize",priority:"normal",middleware:a,...f},h=b(d,g);if(h.length>0){if(h.some((u)=>n.has(u))){if(!m)throw new Error(`Duplicate middleware name '${S(d,g)}'`);for(let u of h){let y=e.findIndex((I)=>I.name===u||I.aliases?.some((F)=>F===u));if(y===-1)continue;let T=e[y];if(T.step!==l.step||l.priority!==T.priority)throw new Error(`"${S(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${S(d,g)}" middleware with ${l.priority} priority in ${l.step} step.`);e.splice(y,1)}}for(let u of h)n.add(u)}e.push(l)},addRelativeTo:(a,f)=>{let{name:d,override:m,aliases:g}=f,l={middleware:a,...f},h=b(d,g);if(h.length>0){if(h.some((u)=>n.has(u))){if(!m)throw new Error(`Duplicate middleware name '${S(d,g)}'`);for(let u of h){let y=t.findIndex((I)=>I.name===u||I.aliases?.some((F)=>F===u));if(y===-1)continue;let T=t[y];if(T.toMiddleware!==l.toMiddleware||T.relation!==l.relation)throw new Error(`"${S(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${S(d,g)}" middleware ${l.relation} "${l.toMiddleware}" middleware.`);t.splice(y,1)}}for(let u of h)n.add(u)}t.push(l)},clone:()=>c($()),use:(a)=>{a.applyToStack(E)},remove:(a)=>{if(typeof a==="string")return s(a);else return i(a)},removeByTag:(a)=>{let f=!1,d=(m)=>{let{tags:g,name:l,aliases:h}=m;if(g&&g.includes(a)){let u=b(l,h);for(let y of u)n.delete(y);return f=!0,!1}return!0};return e=e.filter(d),t=t.filter(d),f},concat:(a)=>{let f=c($());return f.use(a),f.identifyOnResolve(r||f.identifyOnResolve()||(a.identifyOnResolve?.()??!1)),f},applyToStack:c,identify:()=>{return x(!0).map((a)=>{let f=a.step??a.relation+" "+a.toMiddleware;return S(a.name,a.aliases)+" - "+f})},identifyOnResolve(a){if(typeof a==="boolean")r=a;return r},resolve:(a,f)=>{for(let d of x().map((m)=>m.middleware).reverse())a=d(a,f);if(r)console.log(E.identify());return a}};return E},q={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},V={high:3,normal:2,low:1};class Ce{constructor(e){this.config=e,this.middlewareStack=$()}send(e,t,r){let n=typeof t!=="function"?t:void 0,o=typeof t==="function"?t:r,s=n===void 0&&this.config.cacheMiddleware===!0,i;if(s){if(!this.handlers)this.handlers=new WeakMap;let c=this.handlers;if(c.has(e.constructor))i=c.get(e.constructor);else i=e.resolveMiddleware(this.middlewareStack,this.config,n),c.set(e.constructor,i)}else delete this.handlers,i=e.resolveMiddleware(this.middlewareStack,this.config,n);if(o)i(e).then((c)=>o(null,c.output),(c)=>o(c)).catch(()=>{});else return i(e).then((c)=>c.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Q=A(P(),1);class G{constructor(){this.middlewareStack=$()}static classBuilder(){return new Z}resolveMiddlewareWithContext(e,t,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,smithyContext:p,additionalContext:x,CommandCtor:E}){for(let g of n.bind(this)(E,e,t,r))this.middlewareStack.use(g);let a=e.concat(this.middlewareStack),{logger:f}=t,d={logger:f,clientName:o,commandName:s,inputFilterSensitiveLog:i,outputFilterSensitiveLog:c,[Q.SMITHY_CONTEXT_KEY]:{commandInstance:this,...p},...x},{requestHandler:m}=t;return a.resolve((g)=>m.handle(g.request,r||{}),d)}}class Z{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(e)=>e,this._outputFilterSensitiveLog=(e)=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){let e=this,t;return t=class extends G{static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=r??{},e._init(this)}resolveMiddleware(r,n,o){return this.resolveMiddlewareWithContext(r,n,o,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}var $e=A(O(),1);var mt="***SensitiveInformation***";var Ae=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){let t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))oe.warn(ne(`Expected number but observed string: ${e}`));return t}}if(typeof e==="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)},Me=Math.ceil(340282346638528860000000000000000000000),X=(e)=>{let t=Ae(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>Me)throw new TypeError(`Expected 32-bit float, got ${e}`)}return t},Ie=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)};var K=(e)=>D(e,32),v=(e)=>D(e,16),ee=(e)=>D(e,8),D=(e,t)=>{let r=Ie(e);if(r!==void 0&&Ne(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},Ne=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},yt=(e,t)=>{if(e===null||e===void 0){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},wt=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},xt=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return oe.warn(ne(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)};var te=(e)=>{if(typeof e=="string")return X(k(e));return X(e)},_e=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,k=(e)=>{let t=e.match(_e);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var Et=(e)=>{if(typeof e==="string")return K(k(e));return K(e)},U=(e)=>{if(typeof e==="string")return v(k(e));return v(e)},re=(e)=>{if(typeof e==="string")return ee(k(e));return ee(e)},ne=(e)=>{return String(new TypeError(e).stack||e).split(`
|
|
2
|
-
`).slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join(`
|
|
3
|
-
`)},oe={warn:console.warn};var ke=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var Re=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ct=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Re.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,s,i,c,p,x]=t,E=U(L(n)),a=C(o,"month",1,12),f=C(s,"day",1,31);return se(E,a,f,{hours:i,minutes:c,seconds:p,fractionalMilliseconds:x})},Fe=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),$t=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Fe.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,s,i,c,p,x,E]=t,a=U(L(n)),f=C(o,"month",1,12),d=C(s,"day",1,31),m=se(a,f,d,{hours:i,minutes:c,seconds:p,fractionalMilliseconds:x});if(E.toUpperCase()!="Z")m.setTime(m.getTime()-Le(E));return m},At=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$/),Mt=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$/),It=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 se=(e,t,r,n)=>{let o=t-1;return Oe(e,o,r),new Date(Date.UTC(e,o,r,C(n.hours,"hour",0,23),C(n.minutes,"minute",0,59),C(n.seconds,"seconds",0,60),Ue(n.fractionalMilliseconds)))};var Pe=[31,28,31,30,31,30,31,31,30,31,30,31],Oe=(e,t,r)=>{let n=Pe[t];if(t===1&&De(e))n=29;if(r>n)throw new TypeError(`Invalid day for ${ke[t]} in ${e}: ${r}`)},De=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},C=(e,t,r,n)=>{let o=re(L(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},Ue=(e)=>{if(e===null||e===void 0)return 0;return te("0."+e)*1000},Le=(e)=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);let n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1000},L=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)};class N extends Error{constructor(e){super(e.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let t=e;return N.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let t=e;if(this===N)return N.isInstance(e);if(N.isInstance(e)){if(t.name&&this.name)return this.prototype.isPrototypeOf(e)||t.name===this.name;return this.prototype.isPrototypeOf(e)}return!1}}var ie=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,o])=>{if(e[n]==null||e[n]==="")e[n]=o});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e};var ze=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{let o=He(e),s=o.httpStatusCode?o.httpStatusCode+"":void 0,i=new r({name:t?.code||t?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw ie(i,t)},Rt=(e)=>{return({output:t,parsedBody:r,errorCode:n})=>{ze({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})}},He=(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 Pt=(e)=>{switch(e){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 ce=!1,Dt=(e)=>{if(e&&!ce&&parseInt(e.substring(1,e.indexOf(".")))<16)ce=!0};var Be=A(O(),1);var z=A(P(),1);var ae=(e)=>{let t=[];for(let r in z.AlgorithmId){let n=z.AlgorithmId[r];if(e[n]===void 0)continue;t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},fe=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{t[r.algorithmId()]=r.checksumConstructor()}),t};var de=(e)=>{let t=e.retryStrategy;return{setRetryStrategy(r){t=r},retryStrategy(){return t}}},ue=(e)=>{let t={};return t.retryStrategy=e.retryStrategy(),t};var Jt=(e)=>{return{...ae(e),...de(e)}};var jt=(e)=>{return{...fe(e),...ue(e)}};var Qt=(e)=>Array.isArray(e)?e:[e];var Xt=(e)=>{return e!=null};var M=function e(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};M.from=(e)=>{if(e&&typeof e==="object"&&(e instanceof M||("deserializeJSON"in e)))return e;else if(typeof e==="string"||Object.getPrototypeOf(e)===String.prototype)return M(String(e));return M(JSON.stringify(e))};M.fromObject=M.from;class We{trace(){}debug(){}info(){}warn(){}error(){}}function Je(e,t,r){let n,o,s;if(typeof t==="undefined"&&typeof r==="undefined")n={},s=e;else if(n=e,typeof t==="function")return o=t,s=r,je(n,o,s);else s=t;for(let i of Object.keys(s)){if(!Array.isArray(s[i])){n[i]=s[i];continue}le(n,null,s,i)}return n}var tr=(e,t)=>{let r={};for(let n in t)le(r,e,t,n);return r},je=(e,t,r)=>{return Je(e,Object.entries(r).reduce((n,[o,s])=>{if(Array.isArray(s))n[o]=s;else if(typeof s==="function")n[o]=[t,s()];else n[o]=[t,s];return n},{}))},le=(e,t,r,n)=>{if(t!==null){let i=r[n];if(typeof i==="function")i=[,i];let[c=Ye,p=qe,x=n]=i;if(typeof c==="function"&&c(t[x])||typeof c!=="function"&&!!c)e[n]=p(t[x]);return}let[o,s]=r[n];if(typeof s==="function"){let i,c=o===void 0&&(i=s())!=null,p=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(c)e[n]=i;else if(p)e[n]=s()}else{let i=o===void 0&&s!=null,c=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(i||c)e[n]=s}},Ye=(e)=>e!=null,qe=(e)=>e;var Ve=A(O(),1);var he=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map(he);if(typeof e==="object"){let t={};for(let r of Object.keys(e)){if(e[r]==null)continue;t[r]=he(e[r])}return t}return e};var Or=(e)=>{let t=e.httpHandler;return{setHttpHandler(r){t=r},httpHandler(){return t},updateHttpClientConfig(r,n){t.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},Dr=(e)=>{return{httpHandler:e.httpHandler()}};var Qe=A(P(),1);class H{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let t=new H({...e,headers:{...e.headers}});if(t.query)t.query=Ge(t.query);return t}static isInstance(e){if(!e)return!1;let t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return H.clone(this)}}function Ge(e){return Object.keys(e).reduce((t,r)=>{let n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class R{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let t=e;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var _=(e)=>encodeURIComponent(e).replace(/[!'()*]/g,Ze),Ze=(e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function B(e){let t=[];for(let r of Object.keys(e).sort()){let n=e[r];if(r=_(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)t.push(`${r}=${_(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${_(n)}`;t.push(o)}}return t.join("&")}import{Agent as Se,request as et}from"http";import{Agent as be,request as tt}from"https";var me=["ECONNRESET","EPIPE","ETIMEDOUT"];var W=(e)=>{let t={};for(let r of Object.keys(e)){let n=e[r];t[r]=Array.isArray(n)?n.join(","):n}return t};var w={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:(e)=>clearTimeout(e)};var pe=1000,ge=(e,t,r=0)=>{if(!r)return-1;let n=(o)=>{let s=w.setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r-o),i=(c)=>{if(c?.connecting)c.on("connect",()=>{w.clearTimeout(s)});else w.clearTimeout(s)};if(e.socket)i(e.socket);else e.on("socket",i)};if(r<2000)return n(0),0;return w.setTimeout(n.bind(null,pe),pe)};var Xe=3000,ye=(e,{keepAlive:t,keepAliveMsecs:r},n=Xe)=>{if(t!==!0)return-1;let o=()=>{if(e.socket)e.socket.setKeepAlive(t,r||0);else e.on("socket",(s)=>{s.setKeepAlive(t,r||0)})};if(n===0)return o(),0;return w.setTimeout(o,n)};var we=3000,xe=(e,t,r=Ee)=>{let n=(o)=>{let s=r-o,i=()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))};if(e.socket)e.socket.setTimeout(s,i),e.on("close",()=>e.socket?.removeListener("timeout",i));else e.setTimeout(s,i)};if(0<r&&r<6000)return n(0),0;return w.setTimeout(n.bind(null,r===0?0:we),we)};import{Readable as Ke}from"stream";var Te=6000;async function J(e,t,r=Te){let n=t.headers??{},o=n.Expect||n.expect,s=-1,i=!0;if(o==="100-continue")i=await Promise.race([new Promise((c)=>{s=Number(w.setTimeout(()=>c(!0),Math.max(Te,r)))}),new Promise((c)=>{e.on("continue",()=>{w.clearTimeout(s),c(!0)}),e.on("response",()=>{w.clearTimeout(s),c(!1)}),e.on("error",()=>{w.clearTimeout(s),c(!1)})})]);if(i)ve(e,t.body)}function ve(e,t){if(t instanceof Ke){t.pipe(e);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){e.end(t);return}let r=t;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()}var Ee=0;class j{static create(e){if(typeof e?.handle==="function")return e;return new j(e)}static checkSocketUsage(e,t,r=console){let{sockets:n,requests:o,maxSockets:s}=e;if(typeof s!=="number"||s===1/0)return t;let i=15000;if(Date.now()-i<t)return t;if(n&&o)for(let c in n){let p=n[c]?.length??0,x=o[c]?.length??0;if(p>=s&&x>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${p} 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 t}constructor(e){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,r)=>{if(typeof e==="function")e().then((n)=>{t(this.resolveDefaultConfig(n))}).catch(r);else t(this.resolveDefaultConfig(e))})}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:r,socketTimeout:n,socketAcquisitionWarningTimeout:o,httpAgent:s,httpsAgent:i}=e||{},c=!0,p=50;return{connectionTimeout:r,requestTimeout:t??n,socketAcquisitionWarningTimeout:o,httpAgent:(()=>{if(s instanceof Se||typeof s?.destroy==="function")return s;return new Se({keepAlive:!0,maxSockets:50,...s})})(),httpsAgent:(()=>{if(i instanceof be||typeof i?.destroy==="function")return i;return new be({keepAlive:!0,maxSockets:50,...i})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;return new Promise((r,n)=>{let o=void 0,s=[],i=async(u)=>{await o,s.forEach(w.clearTimeout),r(u)},c=async(u)=>{await o,s.forEach(w.clearTimeout),n(u)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){let u=new Error("Request aborted");u.name="AbortError",c(u);return}let p=e.protocol==="https:",x=p?this.config.httpsAgent:this.config.httpAgent;s.push(w.setTimeout(()=>{this.socketWarningTimestamp=j.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let E=B(e.query||{}),a=void 0;if(e.username!=null||e.password!=null){let u=e.username??"",y=e.password??"";a=`${u}:${y}`}let f=e.path;if(E)f+=`?${E}`;if(e.fragment)f+=`#${e.fragment}`;let d=e.hostname??"";if(d[0]==="["&&d.endsWith("]"))d=e.hostname.slice(1,-1);else d=e.hostname;let m={headers:e.headers,host:d,method:e.method,path:f,port:e.port,agent:x,auth:a},l=(p?tt:et)(m,(u)=>{let y=new R({statusCode:u.statusCode||-1,reason:u.statusMessage,headers:W(u.headers),body:u});i({response:y})});if(l.on("error",(u)=>{if(me.includes(u.code))c(Object.assign(u,{name:"TimeoutError"}));else c(u)}),t){let u=()=>{l.destroy();let y=new Error("Request aborted");y.name="AbortError",c(y)};if(typeof t.addEventListener==="function"){let y=t;y.addEventListener("abort",u,{once:!0}),l.once("close",()=>y.removeEventListener("abort",u))}else t.onabort=u}s.push(ge(l,c,this.config.connectionTimeout)),s.push(xe(l,c,this.config.requestTimeout));let h=m.agent;if(typeof h==="object"&&"keepAlive"in h)s.push(ye(l,{keepAlive:h.keepAlive,keepAliveMsecs:h.keepAliveMsecs}));o=J(l,e,this.config.requestTimeout).catch((u)=>{return s.forEach(w.clearTimeout),n(u)})})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[e]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as rt}from"stream";class Y extends rt{constructor(){super(...arguments);this.bufferedBytes=[]}_write(e,t,r){this.bufferedBytes.push(e),r()}}var Qn=(e)=>{if(nt(e))return ot(e);return new Promise((t,r)=>{let n=new Y;e.pipe(n),e.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){let o=new Uint8Array(Buffer.concat(this.bufferedBytes));t(o)})})},nt=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;async function ot(e){let t=[],r=e.getReader(),n=!1,o=0;while(!n){let{done:c,value:p}=await r.read();if(p)t.push(p),o+=p.length;n=c}let s=new Uint8Array(o),i=0;for(let c of t)s.set(c,i),i+=c.length;return s}export{Or as Hb,Dr as Ib,H as Jb,R as Kb,Ce as Lb,G as Mb,mt as Nb,yt as Ob,wt as Pb,xt as Qb,Et as Rb,Ct as Sb,$t as Tb,N as Ub,ie as Vb,Rt as Wb,Pt as Xb,Dt as Yb,Jt as Zb,jt as _b,Qt as $b,Xt as ac,We as bc,Je as cc,tr as dc,he as ec,j as fc,Qn as gc};
|
package/dist/chunk-2az51wff.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fc as E,zc as A}from"./chunk-18byef1w.js";import"./chunk-fbbvmxn3.js";import{Kc as K}from"./chunk-atc0z327.js";import{Lc as T}from"./chunk-2hfepv08.js";import{Mc as w}from"./chunk-6wnzdvc6.js";var o=w(T(),1);import{exec as y}from"child_process";import{promisify as I}from"util";var S=w(K(),1),x=(c,n,e)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){let i=new Date;if(new Date(n.Expiration)<i)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let s=n.AccountId;if(!s&&e?.[c]?.aws_account_id)s=e[c].aws_account_id;let t={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...s&&{accountId:s}};return S.setCredentialFeature(t,"CREDENTIALS_PROCESS","w"),t};var _=async(c,n,e)=>{let s=n[c];if(n[c]){let t=s.credential_process;if(t!==void 0){let i=I(y);try{let{stdout:r}=await i(t),u;try{u=JSON.parse(r.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return x(c,u,n)}catch(r){throw new o.CredentialsProviderError(r.message,{logger:e})}}else throw new o.CredentialsProviderError(`Profile ${c} did not contain credential_process.`,{logger:e})}else throw new o.CredentialsProviderError(`Profile ${c} could not be found in shared credentials file.`,{logger:e})};var F=(c={})=>async({callerClientConfig:n}={})=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let e=await E(c);return _(A({profile:c.profile??n?.profile}),e,c.logger)};export{F as fromProcess};
|
package/dist/chunk-2hfepv08.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Oc as $}from"./chunk-6wnzdvc6.js";var S=$((N,Z)=>{var{defineProperty:I,getOwnPropertyDescriptor:z,getOwnPropertyNames:A}=Object,D=Object.prototype.hasOwnProperty,H=(j,b)=>I(j,"name",{value:b,configurable:!0}),M=(j,b)=>{for(var F in b)I(j,F,{get:b[F],enumerable:!0})},J=(j,b,F,B)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let G of A(b))if(!D.call(j,G)&&G!==F)I(j,G,{get:()=>b[G],enumerable:!(B=z(b,G))||B.enumerable})}return j},T=(j)=>J(I({},"__esModule",{value:!0}),j),Y={};M(Y,{CredentialsProviderError:()=>V,ProviderError:()=>K,TokenProviderError:()=>w,chain:()=>O,fromStatic:()=>q,memoize:()=>L});Z.exports=T(Y);var K=class j extends Error{constructor(b,F=!0){let B,G=!0;if(typeof F==="boolean")B=void 0,G=F;else if(F!=null&&typeof F==="object")B=F.logger,G=F.tryNextLink??!0;super(b);this.name="ProviderError",this.tryNextLink=G,Object.setPrototypeOf(this,j.prototype),B?.debug?.(`@smithy/property-provider ${G?"->":"(!)"} ${b}`)}static{H(this,"ProviderError")}static from(b,F=!0){return Object.assign(new this(b.message,F),b)}},V=class j extends K{constructor(b,F=!0){super(b,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,j.prototype)}static{H(this,"CredentialsProviderError")}},w=class j extends K{constructor(b,F=!0){super(b,F);this.name="TokenProviderError",Object.setPrototypeOf(this,j.prototype)}static{H(this,"TokenProviderError")}},O=H((...j)=>async()=>{if(j.length===0)throw new K("No providers in chain");let b;for(let F of j)try{return await F()}catch(B){if(b=B,B?.tryNextLink)continue;throw B}throw b},"chain"),q=H((j)=>()=>Promise.resolve(j),"fromStatic"),L=H((j,b,F)=>{let B,G,Q,U=!1,W=H(async()=>{if(!G)G=j();try{B=await G,Q=!0,U=!1}finally{G=void 0}return B},"coalesceProvider");if(b===void 0)return async(X)=>{if(!Q||X?.forceRefresh)B=await W();return B};return async(X)=>{if(!Q||X?.forceRefresh)B=await W();if(U)return B;if(F&&!F(B))return U=!0,B;if(b(B))return await W(),B;return B}},"memoize")});
|
|
2
|
-
export{S as Lc};
|
package/dist/chunk-3n3ay1vc.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fb as z,Gb as P}from"./chunk-15sp93dn.js";import"./chunk-18byef1w.js";import"./chunk-fbbvmxn3.js";import{Lc as D}from"./chunk-2hfepv08.js";import{Mc as _}from"./chunk-6wnzdvc6.js";var m=_(D(),1);import{parse as o}from"url";var K=_(D(),1);import{Buffer as a}from"buffer";import{request as n}from"http";function u(c){return new Promise((I,x)=>{let T=n({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new K.ProviderError("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new K.ProviderError("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{let{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new K.ProviderError("Error response received from instance metadata service"),{statusCode:O})),T.destroy();let E=[];N.on("data",(y)=>{E.push(y)}),N.on("end",()=>{I(a.concat(E)),T.destroy()})}),T.end()})}var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",Q=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var uc=1000,Ec=0,X=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var f=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var v="AWS_CONTAINER_CREDENTIALS_FULL_URI",L="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN",Kc=(c={})=>{let{timeout:I,maxRetries:x}=X(c);return()=>f(async()=>{let T=await d({logger:c.logger}),N=JSON.parse(await s(I,T));if(!G(N))throw new m.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return Q(N)},x)},s=async(c,I)=>{if(process.env[B])I.headers={...I.headers,Authorization:process.env[B]};return(await u({...I,timeout:c})).toString()},g="169.254.170.2",l={localhost:!0,"127.0.0.1":!0},r={"http:":!0,"https:":!0},d=async({logger:c})=>{if(process.env[L])return{hostname:g,path:process.env[L]};if(process.env[v]){let I=o(process.env[v]);if(!I.hostname||!(I.hostname in l))throw new m.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in r))throw new m.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new m.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${L} or ${v} environment variable is set`,{tryNextLink:!1,logger:c})};var q=_(D(),1);var U=_(D(),1);class Z extends U.CredentialsProviderError{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Z.prototype)}}var A;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(A||(A={}));var t={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var S;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(S||(S={}));var e="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",i="ec2_metadata_service_endpoint_mode",F={environmentVariableSelector:(c)=>c[e],configFileSelector:(c)=>c[i],default:S.IPv4};var W=async()=>P(await cc()||await Ic()),cc=async()=>z(t)(),Ic=async()=>{let c=await z(F)();switch(c){case S.IPv4:return A.IPv4;case S.IPv6:return A.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(S)}`)}};var b=(c,I)=>{let x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.
|
|
3
|
-
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var V=(c,I={})=>{let x=I?.logger||console,T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=b(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=b(T,x);else throw O}return T=N,N}};var k="/latest/meta-data/iam/security-credentials/",Tc="/latest/api/token",H="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",oc=(c={})=>V(Nc(c),{logger:c.logger}),Nc=(c={})=>{let I=!1,{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=X(c),E=async(y,$)=>{if(I||$.headers?.[M]==null){let w=!1,h=!1,C=await z({environmentVariableSelector:(Y)=>{let j=Y[H];if(h=!!j&&j!=="false",j===void 0)throw new q.CredentialsProviderError(`${H} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{let j=Y[R];return w=!!j&&j!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||C){let Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${H})`);throw new Z(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}let p=(await f(async()=>{let w;try{w=await Oc($)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return f(async()=>{let w;try{w=await yc(p,$,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{let y=await W();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),E(O,{...y,timeout:N});else{let $;try{$=(await xc({...y,timeout:N})).toString()}catch(J){if(J?.statusCode===400)throw Object.assign(J,{message:"EC2 Metadata token request returned error"});else if(J.message==="TimeoutError"||[403,404,405].includes(J.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),E(O,{...y,timeout:N})}return E(O,{...y,headers:{[M]:$},timeout:N})}}},xc=async(c)=>u({...c,path:Tc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Oc=async(c)=>(await u({...c,path:k})).toString(),yc=async(c,I,x)=>{let T=JSON.parse((await u({...I,path:k+c})).toString());if(!G(T))throw new q.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return Q(T)};export{X as providerConfigFromInit,u as httpRequest,W as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,Kc as fromContainerMetadata,A as Endpoint,L as ENV_CMDS_RELATIVE_URI,v as ENV_CMDS_FULL_URI,B as ENV_CMDS_AUTH_TOKEN,uc as DEFAULT_TIMEOUT,Ec as DEFAULT_MAX_RETRIES};
|