@stacksjs/buddy 0.68.1 → 0.68.2
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-akkmfscs.js +978 -0
- package/dist/chunk-c4msw6hf.js +2 -0
- package/dist/chunk-gezc36zy.js +2 -0
- package/dist/chunk-jbpgmjzs.js +2 -0
- package/dist/chunk-jms0s1vh.js +6 -0
- package/dist/chunk-m6regb6b.js +2 -0
- package/dist/chunk-qpdxnnf8.js +10 -0
- package/dist/chunk-qzxab3cn.js +2 -0
- package/dist/chunk-scc3z70n.js +2 -0
- package/dist/chunk-y5vqt054.js +5 -0
- package/dist/chunk-zanq4wm3.js +9 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/stacks +0 -0
- package/package.json +45 -45
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{L as Vh}from"./chunk-zanq4wm3.js";import{$ as Sl,M as Q0,N as X0,O as Y0,P as Z0,Q as $h,R as y0,S as Nl,T as Tl,U as Al,V as jl,W as Gh,X as F0,Y as Cl,Z as Ol,_ as Hl,aa as gl,ba as xl,ca as $0,da as V0,ea as B,fa as E,ga as v0,ha as il,ia as cl,ja as U0,ka as el,la as q0,ma as tl,na as h0,oa as l0,pa as w0,qa as sl,ra as rl,sa as G0,ta as K0,ua as B0}from"./chunk-qpdxnnf8.js";import{va as f,wa as Rl}from"./chunk-a4g1e1n0.js";import{$a as D0,Ea as Zw,Ja as P0,Ka as Q,La as Sh,Ma as ww,Pa as a0,Ra as S,Sa as u,Ua as s0,Va as z0,Wa as A,Xa as r0,Ya as pl,Za as ol,_a as nh,ab as k0,db as al,hb as nl,ib as ul,xa as m0,ya as J0,za as R0}from"./chunk-y5vqt054.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import{vb as EG}from"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import{xb as M}from"./chunk-d2dbhn2h.js";var O=M($h(),1);var ml=M(Gh(),1);var Jl=async(h,w,l)=>{return{operation:Hl(w).operation,region:await Sl(h.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function Bw(h){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:h.region},propertiesExtractor:(w,l)=>({signingProperties:{config:w,context:l}})}}function dl(h){return{schemeId:"smithy.api#noAuth"}}var Dl=(h)=>{let w=[];switch(h.operation){case"AssumeRoleWithSAML":{w.push(dl(h));break}case"AssumeRoleWithWebIdentity":{w.push(dl(h));break}default:w.push(Bw(h))}return w},Ew=(h)=>({...h,stsClientCtor:j}),kl=(h)=>{let w=Ew(h);return{...ml.resolveAwsSdkSigV4Config(w)}};var Kl=(h)=>{return{...h,useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,useGlobalEndpoint:h.useGlobalEndpoint??!1,defaultSigningName:"sts"}},D={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var Bl={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.679.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"vitest run","test:watch":"vitest watch"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.679.0","@aws-sdk/core":"3.679.0","@aws-sdk/credential-provider-node":"3.679.0","@aws-sdk/middleware-host-header":"3.679.0","@aws-sdk/middleware-logger":"3.679.0","@aws-sdk/middleware-recursion-detection":"3.679.0","@aws-sdk/middleware-user-agent":"3.679.0","@aws-sdk/region-config-resolver":"3.679.0","@aws-sdk/types":"3.679.0","@aws-sdk/util-endpoints":"3.679.0","@aws-sdk/util-user-agent-browser":"3.679.0","@aws-sdk/util-user-agent-node":"3.679.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}};var dh=M(Gh(),1);var I0=M($h(),1);var _l=M(Gh(),1),bl=M($h(),1);var Ih=M(Zw(),1);var El={["required"]:!1,["type"]:"String"},Fh={["required"]:!0,default:!1,["type"]:"Boolean"},vl={["ref"]:"Endpoint"},Ql={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},J={["ref"]:"Region"},Xl={["fn"]:"aws.partition",["argv"]:[J],assign:"PartitionResult"},Ul={["ref"]:"UseFIPS"},Pl={["ref"]:"UseDualStack"},k={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},F={},Yl={conditions:[{["fn"]:"stringEquals",["argv"]:[J,"aws-global"]}],["endpoint"]:k,["type"]:"endpoint"},ql={["fn"]:"booleanEquals",["argv"]:[Ul,!0]},zl={["fn"]:"booleanEquals",["argv"]:[Pl,!0]},Zl={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Ml={["ref"]:"PartitionResult"},yl={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Ml,"supportsDualStack"]}]},Fl=[{["fn"]:"isSet",["argv"]:[vl]}],$l=[ql],Vl=[zl],Xw={version:"1.0",parameters:{Region:El,UseDualStack:Fh,UseFIPS:Fh,Endpoint:El,UseGlobalEndpoint:Fh},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:Fl},Ql,Xl,{["fn"]:"booleanEquals",["argv"]:[Ul,!1]},{["fn"]:"booleanEquals",["argv"]:[Pl,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-northeast-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-south-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-2"]}],endpoint:k,["type"]:"endpoint"},Yl,{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ca-central-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-central-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-north-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-2"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-3"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"sa-east-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-2"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-1"]}],endpoint:k,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-2"]}],endpoint:k,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:F},["type"]:"endpoint"}],["type"]:"tree"},{conditions:Fl,rules:[{conditions:$l,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:Vl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:vl,properties:F,headers:F},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[Ql],rules:[{conditions:[Xl],rules:[{conditions:[ql,zl],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Zl]},yl],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:F,headers:F},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:$l,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Zl,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ml,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:F,headers:F},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:F,headers:F},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:Vl,rules:[{conditions:[yl],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:F,headers:F},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},Yl,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:F,headers:F},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},Wl=Xw;var Yw=new Nl({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Ll=(h,w={})=>{return Yw.get(h,()=>Al(Wl,{endpointParams:h,logger:w.logger}))};Tl.aws=jl;var fl=(h)=>{return{apiVersion:"2011-06-15",base64Decoder:h?.base64Decoder??sl,base64Encoder:h?.base64Encoder??rl,disableHostPrefix:h?.disableHostPrefix??!1,endpointProvider:h?.endpointProvider??Ll,extensions:h?.extensions??[],httpAuthSchemeProvider:h?.httpAuthSchemeProvider??Dl,httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(w)=>w.getIdentityProvider("aws.auth#sigv4"),signer:new _l.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(w)=>w.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new bl.NoAuthSigner}],logger:h?.logger??new al,serviceId:h?.serviceId??"STS",urlParser:h?.urlParser??Rl,utf8Decoder:h?.utf8Decoder??Ih.fromUtf8,utf8Encoder:h?.utf8Encoder??Ih.toUtf8}};var d0=(h)=>{ol(process.version);let w=G0(h),l=()=>w().then(pl),G=fl(h);return dh.emitWarningIfUnsupportedVersion(process.version),{...G,...h,runtime:"node",defaultsMode:w,bodyLengthChecker:h?.bodyLengthChecker??w0,credentialDefaultProvider:h?.credentialDefaultProvider??Vh,defaultUserAgentProvider:h?.defaultUserAgentProvider??tl({serviceId:G.serviceId,clientVersion:Bl.version}),httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(I)=>I.getIdentityProvider("aws.auth#sigv4")||(async(H)=>await Vh(H?.__config||{})()),signer:new dh.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(I)=>I.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new I0.NoAuthSigner}],maxAttempts:h?.maxAttempts??f(cl),region:h?.region??f(gl,xl),requestHandler:nl.create(h?.requestHandler??l),retryMode:h?.retryMode??f({...el,default:async()=>(await l()).retryMode||il}),sha256:h?.sha256??l0.bind(null,"sha256"),streamCollector:h?.streamCollector??ul,useDualstackEndpoint:h?.useDualstackEndpoint??f(Cl),useFipsEndpoint:h?.useFipsEndpoint??f(Ol),userAgentAppId:h?.userAgentAppId??f(h0)}};var H0=(h)=>{let{httpAuthSchemes:w,httpAuthSchemeProvider:l,credentials:G}=h;return{setHttpAuthScheme(I){let H=w.findIndex((d)=>d.schemeId===I.schemeId);if(H===-1)w.push(I);else w.splice(H,1,I)},httpAuthSchemes(){return w},setHttpAuthSchemeProvider(I){l=I},httpAuthSchemeProvider(){return l},setCredentials(I){G=I},credentials(){return G}}},S0=(h)=>{return{httpAuthSchemes:h.httpAuthSchemes(),httpAuthSchemeProvider:h.httpAuthSchemeProvider(),credentials:h.credentials()}};var Hh=(h)=>h,E0=(h,w)=>{let l={...Hh(K0(h)),...Hh(D0(h)),...Hh(m0(h)),...Hh(H0(h))};return w.forEach((G)=>G.configure(l)),{...h,...B0(l),...k0(l),...J0(l),...S0(l)}};class j extends P0{constructor(...[h]){let w=d0(h||{}),l=Kl(w),G=y0(l),I=U0(G),H=$0(I),d=Q0(H),X=v0(d),z=kl(X),P=E0(z,h?.extensions||[]);super(P);this.config=P,this.middlewareStack.use(F0(this.config)),this.middlewareStack.use(q0(this.config)),this.middlewareStack.use(V0(this.config)),this.middlewareStack.use(X0(this.config)),this.middlewareStack.use(Y0(this.config)),this.middlewareStack.use(Z0(this.config)),this.middlewareStack.use(O.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Jl,identityProviderConfigProvider:async(C)=>new O.DefaultIdentityProviderConfig({"aws.auth#sigv4":C.credentials})})),this.middlewareStack.use(O.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class y extends z0{constructor(h){super(h);Object.setPrototypeOf(this,y.prototype)}}class mh extends y{constructor(h){super({name:"ExpiredTokenException",$fault:"client",...h});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,mh.prototype)}}class Jh extends y{constructor(h){super({name:"MalformedPolicyDocumentException",$fault:"client",...h});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,Jh.prototype)}}class Dh extends y{constructor(h){super({name:"PackedPolicyTooLargeException",$fault:"client",...h});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Dh.prototype)}}class kh extends y{constructor(h){super({name:"RegionDisabledException",$fault:"client",...h});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,kh.prototype)}}class Kh extends y{constructor(h){super({name:"IDPRejectedClaimException",$fault:"client",...h});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Kh.prototype)}}class Bh extends y{constructor(h){super({name:"InvalidIdentityTokenException",$fault:"client",...h});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,Bh.prototype)}}class Eh extends y{constructor(h){super({name:"IDPCommunicationErrorException",$fault:"client",...h});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,Eh.prototype)}}class Qh extends y{constructor(h){super({name:"InvalidAuthorizationMessageException",$fault:"client",...h});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,Qh.prototype)}}var n=(h)=>({...h,...h.SecretAccessKey&&{SecretAccessKey:Sh}}),M0=(h)=>({...h,...h.Credentials&&{Credentials:n(h.Credentials)}}),W0=(h)=>({...h,...h.SAMLAssertion&&{SAMLAssertion:Sh}}),N0=(h)=>({...h,...h.Credentials&&{Credentials:n(h.Credentials)}}),T0=(h)=>({...h,...h.WebIdentityToken&&{WebIdentityToken:Sh}}),A0=(h)=>({...h,...h.Credentials&&{Credentials:n(h.Credentials)}}),j0=(h)=>({...h,...h.Credentials&&{Credentials:n(h.Credentials)}}),L0=(h)=>({...h,...h.Credentials&&{Credentials:n(h.Credentials)}});var q=M(Gh(),1);var _0=async(h,w)=>{let l=a,G;return G=b({...zw(h,w),[r]:IG,[_]:s}),R(w,l,"/",void 0,G)},b0=async(h,w)=>{let l=a,G;return G=b({...Mw(h,w),[r]:dG,[_]:s}),R(w,l,"/",void 0,G)},f0=async(h,w)=>{let l=a,G;return G=b({...Ww(h,w),[r]:HG,[_]:s}),R(w,l,"/",void 0,G)},C0=async(h,w)=>{let l=a,G;return G=b({...Nw(h,w),[r]:SG,[_]:s}),R(w,l,"/",void 0,G)},O0=async(h,w)=>{let l=a,G;return G=b({...Tw(h,w),[r]:mG,[_]:s}),R(w,l,"/",void 0,G)},g0=async(h,w)=>{let l=a,G;return G=b({...Aw(h,w),[r]:JG,[_]:s}),R(w,l,"/",void 0,G)},x0=async(h,w)=>{let l=a,G;return G=b({...jw(h,w),[r]:DG,[_]:s}),R(w,l,"/",void 0,G)},i0=async(h,w)=>{let l=a,G;return G=b({...Lw(h,w),[r]:kG,[_]:s}),R(w,l,"/",void 0,G)},c0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=bw(l.AssumeRoleResult,w),{$metadata:K(h),...G}},e0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=fw(l.AssumeRoleWithSAMLResult,w),{$metadata:K(h),...G}},p0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=Cw(l.AssumeRoleWithWebIdentityResult,w),{$metadata:K(h),...G}},o0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=Ow(l.DecodeAuthorizationMessageResult,w),{$metadata:K(h),...G}},n0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=iw(l.GetAccessKeyInfoResult,w),{$metadata:K(h),...G}},u0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=cw(l.GetCallerIdentityResult,w),{$metadata:K(h),...G}},t0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=ew(l.GetFederationTokenResult,w),{$metadata:K(h),...G}},hw=async(h,w)=>{if(h.statusCode>=300)return L(h,w);let l=await q.parseXmlBody(h.body,w),G={};return G=pw(l.GetSessionTokenResult,w),{$metadata:K(h),...G}},L=async(h,w)=>{let l={...h,body:await q.parseXmlErrorBody(h.body,w)},G=KG(h,l.body);switch(G){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await yw(l,w);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Uw(l,w);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Pw(l,w);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await qw(l,w);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await $w(l,w);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await vw(l,w);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Fw(l,w);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await Vw(l,w);default:let I=l.body;return GG({output:h,parsedBody:I.Error,errorCode:G})}},yw=async(h,w)=>{let l=h.body,G=gw(l.Error,w),I=new mh({$metadata:K(h),...G});return A(I,l)},Fw=async(h,w)=>{let l=h.body,G=ow(l.Error,w),I=new Eh({$metadata:K(h),...G});return A(I,l)},$w=async(h,w)=>{let l=h.body,G=nw(l.Error,w),I=new Kh({$metadata:K(h),...G});return A(I,l)},Vw=async(h,w)=>{let l=h.body,G=uw(l.Error,w),I=new Qh({$metadata:K(h),...G});return A(I,l)},vw=async(h,w)=>{let l=h.body,G=tw(l.Error,w),I=new Bh({$metadata:K(h),...G});return A(I,l)},Uw=async(h,w)=>{let l=h.body,G=hG(l.Error,w),I=new Jh({$metadata:K(h),...G});return A(I,l)},Pw=async(h,w)=>{let l=h.body,G=lG(l.Error,w),I=new Dh({$metadata:K(h),...G});return A(I,l)},qw=async(h,w)=>{let l=h.body,G=wG(l.Error,w),I=new kh({$metadata:K(h),...G});return A(I,l)},zw=(h,w)=>{let l={};if(h[T]!=null)l[T]=h[T];if(h[c]!=null)l[c]=h[c];if(h[V]!=null){let G=Xh(h[V],w);if(h[V]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{let d=`PolicyArns.${I}`;l[d]=H})}if(h[$]!=null)l[$]=h[$];if(h[Z]!=null)l[Z]=h[Z];if(h[p]!=null){let G=lw(h[p],w);if(h[p]?.length===0)l.Tags=[];Object.entries(G).forEach(([I,H])=>{let d=`Tags.${I}`;l[d]=H})}if(h[ih]!=null){let G=_w(h[ih],w);if(h[ih]?.length===0)l.TransitiveTagKeys=[];Object.entries(G).forEach(([I,H])=>{let d=`TransitiveTagKeys.${I}`;l[d]=H})}if(h[zh]!=null)l[zh]=h[zh];if(h[e]!=null)l[e]=h[e];if(h[o]!=null)l[o]=h[o];if(h[U]!=null)l[U]=h[U];if(h[sh]!=null){let G=sw(h[sh],w);if(h[sh]?.length===0)l.ProvidedContexts=[];Object.entries(G).forEach(([I,H])=>{let d=`ProvidedContexts.${I}`;l[d]=H})}return l},Mw=(h,w)=>{let l={};if(h[T]!=null)l[T]=h[T];if(h[Rh]!=null)l[Rh]=h[Rh];if(h[Ch]!=null)l[Ch]=h[Ch];if(h[V]!=null){let G=Xh(h[V],w);if(h[V]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{let d=`PolicyArns.${I}`;l[d]=H})}if(h[$]!=null)l[$]=h[$];if(h[Z]!=null)l[Z]=h[Z];return l},Ww=(h,w)=>{let l={};if(h[T]!=null)l[T]=h[T];if(h[c]!=null)l[c]=h[c];if(h[ph]!=null)l[ph]=h[ph];if(h[rh]!=null)l[rh]=h[rh];if(h[V]!=null){let G=Xh(h[V],w);if(h[V]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{let d=`PolicyArns.${I}`;l[d]=H})}if(h[$]!=null)l[$]=h[$];if(h[Z]!=null)l[Z]=h[Z];return l},Nw=(h,w)=>{let l={};if(h[Mh]!=null)l[Mh]=h[Mh];return l},Tw=(h,w)=>{let l={};if(h[g]!=null)l[g]=h[g];return l},Aw=(h,w)=>{return{}},jw=(h,w)=>{let l={};if(h[jh]!=null)l[jh]=h[jh];if(h[$]!=null)l[$]=h[$];if(h[V]!=null){let G=Xh(h[V],w);if(h[V]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([I,H])=>{let d=`PolicyArns.${I}`;l[d]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[p]!=null){let G=lw(h[p],w);if(h[p]?.length===0)l.Tags=[];Object.entries(G).forEach(([I,H])=>{let d=`Tags.${I}`;l[d]=H})}return l},Lw=(h,w)=>{let l={};if(h[Z]!=null)l[Z]=h[Z];if(h[e]!=null)l[e]=h[e];if(h[o]!=null)l[o]=h[o];return l},Xh=(h,w)=>{let l={},G=1;for(let I of h){if(I===null)continue;let H=Rw(I,w);Object.entries(H).forEach(([d,X])=>{l[`member.${G}.${d}`]=X}),G++}return l},Rw=(h,w)=>{let l={};if(h[oh]!=null)l[oh]=h[oh];return l},aw=(h,w)=>{let l={};if(h[ah]!=null)l[ah]=h[ah];if(h[Uh]!=null)l[Uh]=h[Uh];return l},sw=(h,w)=>{let l={},G=1;for(let I of h){if(I===null)continue;let H=aw(I,w);Object.entries(H).forEach(([d,X])=>{l[`member.${G}.${d}`]=X}),G++}return l},rw=(h,w)=>{let l={};if(h[Ah]!=null)l[Ah]=h[Ah];if(h[eh]!=null)l[eh]=h[eh];return l},_w=(h,w)=>{let l={},G=1;for(let I of h){if(I===null)continue;l[`member.${G}`]=I,G++}return l},lw=(h,w)=>{let l={},G=1;for(let I of h){if(I===null)continue;let H=rw(I,w);Object.entries(H).forEach(([d,X])=>{l[`member.${G}.${d}`]=X}),G++}return l},uh=(h,w)=>{let l={};if(h[vh]!=null)l[vh]=S(h[vh]);if(h[N]!=null)l[N]=S(h[N]);return l},bw=(h,w)=>{let l={};if(h[Y]!=null)l[Y]=t(h[Y],w);if(h[W]!=null)l[W]=uh(h[W],w);if(h[v]!=null)l[v]=u(h[v]);if(h[U]!=null)l[U]=S(h[U]);return l},fw=(h,w)=>{let l={};if(h[Y]!=null)l[Y]=t(h[Y],w);if(h[W]!=null)l[W]=uh(h[W],w);if(h[v]!=null)l[v]=u(h[v]);if(h[bh]!=null)l[bh]=S(h[bh]);if(h[gh]!=null)l[gh]=S(h[gh]);if(h[Th]!=null)l[Th]=S(h[Th]);if(h[i]!=null)l[i]=S(h[i]);if(h[Lh]!=null)l[Lh]=S(h[Lh]);if(h[U]!=null)l[U]=S(h[U]);return l},Cw=(h,w)=>{let l={};if(h[Y]!=null)l[Y]=t(h[Y],w);if(h[Oh]!=null)l[Oh]=S(h[Oh]);if(h[W]!=null)l[W]=uh(h[W],w);if(h[v]!=null)l[v]=u(h[v]);if(h[_h]!=null)l[_h]=S(h[_h]);if(h[i]!=null)l[i]=S(h[i]);if(h[U]!=null)l[U]=S(h[U]);return l},t=(h,w)=>{let l={};if(h[g]!=null)l[g]=S(h[g]);if(h[fh]!=null)l[fh]=S(h[fh]);if(h[xh]!=null)l[xh]=S(h[xh]);if(h[qh]!=null)l[qh]=a0(s0(h[qh]));return l},Ow=(h,w)=>{let l={};if(h[Ph]!=null)l[Ph]=S(h[Ph]);return l},gw=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},xw=(h,w)=>{let l={};if(h[Nh]!=null)l[Nh]=S(h[Nh]);if(h[N]!=null)l[N]=S(h[N]);return l},iw=(h,w)=>{let l={};if(h[x]!=null)l[x]=S(h[x]);return l},cw=(h,w)=>{let l={};if(h[ch]!=null)l[ch]=S(h[ch]);if(h[x]!=null)l[x]=S(h[x]);if(h[N]!=null)l[N]=S(h[N]);return l},ew=(h,w)=>{let l={};if(h[Y]!=null)l[Y]=t(h[Y],w);if(h[Wh]!=null)l[Wh]=xw(h[Wh],w);if(h[v]!=null)l[v]=u(h[v]);return l},pw=(h,w)=>{let l={};if(h[Y]!=null)l[Y]=t(h[Y],w);return l},ow=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},nw=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},uw=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},tw=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},hG=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},lG=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},wG=(h,w)=>{let l={};if(h[m]!=null)l[m]=S(h[m]);return l},K=(h)=>({httpStatusCode:h.statusCode,requestId:h.headers["x-amzn-requestid"]??h.headers["x-amzn-request-id"]??h.headers["x-amz-request-id"],extendedRequestId:h.headers["x-amz-id-2"],cfId:h.headers["x-amz-cf-id"]});var GG=r0(y),R=async(h,w,l,G,I)=>{let{hostname:H,protocol:d="https",port:X,path:z}=await h.endpoint(),P={protocol:d,hostname:H,port:X,method:"POST",path:z.endsWith("/")?z.slice(0,-1)+l:z+l,headers:w};if(G!==void 0)P.hostname=G;if(I!==void 0)P.body=I;return new R0(P)},a={"content-type":"application/x-www-form-urlencoded"},s="2011-06-15",r="Action",g="AccessKeyId",IG="AssumeRole",vh="AssumedRoleId",W="AssumedRoleUser",dG="AssumeRoleWithSAML",HG="AssumeRoleWithWebIdentity",x="Account",N="Arn",i="Audience",Y="Credentials",Uh="ContextAssertion",SG="DecodeAuthorizationMessage",Ph="DecodedMessage",Z="DurationSeconds",qh="Expiration",zh="ExternalId",Mh="EncodedMessage",Wh="FederatedUser",Nh="FederatedUserId",mG="GetAccessKeyInfo",JG="GetCallerIdentity",DG="GetFederationToken",kG="GetSessionToken",Th="Issuer",Ah="Key",jh="Name",Lh="NameQualifier",$="Policy",V="PolicyArns",Rh="PrincipalArn",ah="ProviderArn",sh="ProvidedContexts",rh="ProviderId",v="PackedPolicySize",_h="Provider",T="RoleArn",c="RoleSessionName",bh="Subject",fh="SecretAccessKey",Ch="SAMLAssertion",Oh="SubjectFromWebIdentityToken",U="SourceIdentity",e="SerialNumber",gh="SubjectType",xh="SessionToken",p="Tags",o="TokenCode",ih="TransitiveTagKeys",ch="UserId",_="Version",eh="Value",ph="WebIdentityToken",oh="arn",m="message",b=(h)=>Object.entries(h).map(([w,l])=>nh.extendedEncodeURIComponent(w)+"="+nh.extendedEncodeURIComponent(l)).join("&"),KG=(h,w)=>{if(w.Error?.Code!==void 0)return w.Error.Code;if(h.statusCode==404)return"NotFound"};class hh extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,M0).ser(_0).de(c0).build(){}class th extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(W0,N0).ser(b0).de(e0).build(){}class lh extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(T0,A0).ser(f0).de(p0).build(){}class hl extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(C0).de(o0).build(){}class ll extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(O0).de(n0).build(){}class wl extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(g0).de(u0).build(){}class Gl extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,j0).ser(x0).de(t0).build(){}class Il extends Q.classBuilder().ep(D).m(function(h,w,l,G){return[B(l,this.serialize,this.deserialize),E(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,L0).ser(i0).de(hw).build(){}var BG={AssumeRoleCommand:hh,AssumeRoleWithSAMLCommand:th,AssumeRoleWithWebIdentityCommand:lh,DecodeAuthorizationMessageCommand:hl,GetAccessKeyInfoCommand:ll,GetCallerIdentityCommand:wl,GetFederationTokenCommand:Gl,GetSessionTokenCommand:Il};class Gw extends j{}ww(BG,Gw);var Yh=M(EG(),1);var Iw="us-east-1",dw=(h)=>{if(typeof h?.Arn==="string"){let w=h.Arn.split(":");if(w.length>4&&w[4]!=="")return w[4]}return},Hw=async(h,w,l)=>{let G=typeof h==="function"?await h():h,I=typeof w==="function"?await w():w;return l?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${G} (provider)`,`${I} (parent client)`,`${Iw} (STS default)`),G??I??Iw},Sw=(h,w)=>{let l,G;return async(I,H)=>{if(G=I,!l){let{logger:C=h?.parentClientConfig?.logger,region:Zh,requestHandler:wh=h?.parentClientConfig?.requestHandler,credentialProviderLogger:yh}=h,kw=await Hw(Zh,h?.parentClientConfig?.region,yh),Kw=!Jw(wh);l=new w({credentialDefaultProvider:()=>async()=>G,region:kw,requestHandler:Kw?wh:void 0,logger:C})}let{Credentials:d,AssumedRoleUser:X}=await l.send(new hh(H));if(!d||!d.AccessKeyId||!d.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${H.RoleArn}`);let z=dw(X),P={accessKeyId:d.AccessKeyId,secretAccessKey:d.SecretAccessKey,sessionToken:d.SessionToken,expiration:d.Expiration,...d.CredentialScope&&{credentialScope:d.CredentialScope},...z&&{accountId:z}};return Yh.setCredentialFeature(P,"CREDENTIALS_STS_ASSUME_ROLE","i"),P}},mw=(h,w)=>{let l;return async(G)=>{if(!l){let{logger:z=h?.parentClientConfig?.logger,region:P,requestHandler:C=h?.parentClientConfig?.requestHandler,credentialProviderLogger:Zh}=h,wh=await Hw(P,h?.parentClientConfig?.region,Zh),yh=!Jw(C);l=new w({region:wh,requestHandler:yh?C:void 0,logger:z})}let{Credentials:I,AssumedRoleUser:H}=await l.send(new lh(G));if(!I||!I.AccessKeyId||!I.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${G.RoleArn}`);let d=dw(H),X={accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,sessionToken:I.SessionToken,expiration:I.Expiration,...I.CredentialScope&&{credentialScope:I.CredentialScope},...d&&{accountId:d}};if(d)Yh.setCredentialFeature(X,"RESOLVED_ACCOUNT_ID","T");return Yh.setCredentialFeature(X,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),X}};var Jw=(h)=>{return h?.metadata?.handlerProtocol==="h2"};var Dw=(h,w)=>{if(!w)return h;else return class l extends h{constructor(G){super(G);for(let I of w)this.middlewareStack.use(I)}}},QG=(h={},w)=>Sw(h,Dw(j,w)),XG=(h={},w)=>mw(h,Dw(j,w)),b3=(h)=>(w)=>h({roleAssumer:QG(w),roleAssumerWithWebIdentity:XG(w),...w});export{XG as getDefaultRoleAssumerWithWebIdentity,QG as getDefaultRoleAssumer,b3 as decorateDefaultCredentialProvider,P0 as __Client,y as STSServiceException,j as STSClient,Gw as STS,kh as RegionDisabledException,Dh as PackedPolicyTooLargeException,Jh as MalformedPolicyDocumentException,Bh as InvalidIdentityTokenException,Qh as InvalidAuthorizationMessageException,Kh as IDPRejectedClaimException,Eh as IDPCommunicationErrorException,L0 as GetSessionTokenResponseFilterSensitiveLog,Il as GetSessionTokenCommand,j0 as GetFederationTokenResponseFilterSensitiveLog,Gl as GetFederationTokenCommand,wl as GetCallerIdentityCommand,ll as GetAccessKeyInfoCommand,mh as ExpiredTokenException,hl as DecodeAuthorizationMessageCommand,n as CredentialsFilterSensitiveLog,A0 as AssumeRoleWithWebIdentityResponseFilterSensitiveLog,T0 as AssumeRoleWithWebIdentityRequestFilterSensitiveLog,lh as AssumeRoleWithWebIdentityCommand,N0 as AssumeRoleWithSAMLResponseFilterSensitiveLog,W0 as AssumeRoleWithSAMLRequestFilterSensitiveLog,th as AssumeRoleWithSAMLCommand,M0 as AssumeRoleResponseFilterSensitiveLog,hh as AssumeRoleCommand,Q as $Command};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{rb as J}from"./chunk-6yazdvb4.js";import{xb as A,zb as g}from"./chunk-d2dbhn2h.js";var Ht=g((rf,kt)=>{var{defineProperty:B,getOwnPropertyDescriptor:Li,getOwnPropertyNames:zi}=Object,Mi=Object.prototype.hasOwnProperty,bi=(t,n)=>B(t,"name",{value:n,configurable:!0}),Ri=(t,n)=>{for(var e in n)B(t,e,{get:n[e],enumerable:!0})},Ui=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of zi(n))if(!Mi.call(t,r)&&r!==e)B(t,r,{get:()=>n[r],enumerable:!(i=Li(n,r))||i.enumerable})}return t},Di=(t)=>Ui(B({},"__esModule",{value:!0}),t),pt={};Ri(pt,{isArrayBuffer:()=>Ai});kt.exports=Di(pt);var Ai=bi((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var V=g((sf,Pt)=>{var{defineProperty:p,getOwnPropertyDescriptor:Yi,getOwnPropertyNames:Wi}=Object,Zi=Object.prototype.hasOwnProperty,Ot=(t,n)=>p(t,"name",{value:n,configurable:!0}),Qi=(t,n)=>{for(var e in n)p(t,e,{get:n[e],enumerable:!0})},Ki=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Wi(n))if(!Zi.call(t,r)&&r!==e)p(t,r,{get:()=>n[r],enumerable:!(i=Yi(n,r))||i.enumerable})}return t},Vi=(t)=>Ki(p({},"__esModule",{value:!0}),t),vt={};Qi(vt,{fromArrayBuffer:()=>Gi,fromString:()=>ji});Pt.exports=Vi(vt);var Xi=Ht(),ft=import.meta.require("buffer"),Gi=Ot((t,n=0,e=t.byteLength-n)=>{if(!Xi.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ft.Buffer.from(t,n,e)},"fromArrayBuffer"),ji=Ot((t,n)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return n?ft.Buffer.from(t,n):ft.Buffer.from(t)},"fromString")});var _t=g((mt)=>{Object.defineProperty(mt,"__esModule",{value:!0});mt.fromBase64=void 0;var Ji=V(),Bi=/^[A-Za-z0-9+/]*={0,2}$/,pi=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Bi.exec(t))throw new TypeError("Invalid base64 string.");let n=Ji.fromString(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)};mt.fromBase64=pi});var H=g((ff,rn)=>{var{defineProperty:k,getOwnPropertyDescriptor:ki,getOwnPropertyNames:Hi}=Object,Oi=Object.prototype.hasOwnProperty,ht=(t,n)=>k(t,"name",{value:n,configurable:!0}),vi=(t,n)=>{for(var e in n)k(t,e,{get:n[e],enumerable:!0})},Pi=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Hi(n))if(!Oi.call(t,r)&&r!==e)k(t,r,{get:()=>n[r],enumerable:!(i=ki(n,r))||i.enumerable})}return t},mi=(t)=>Pi(k({},"__esModule",{value:!0}),t),tn={};vi(tn,{fromUtf8:()=>en,toUint8Array:()=>qi,toUtf8:()=>_i});rn.exports=mi(tn);var nn=V(),en=ht((t)=>{let n=nn.fromString(t,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),qi=ht((t)=>{if(typeof t==="string")return en(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)},"toUint8Array"),_i=ht((t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return nn.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var fn=g((sn)=>{Object.defineProperty(sn,"__esModule",{value:!0});sn.toBase64=void 0;var tr=V(),nr=H(),er=(t)=>{let n;if(typeof t==="string")n=nr.fromUtf8(t);else n=t;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return tr.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("base64")};sn.toBase64=er});var X=g((of,O)=>{var{defineProperty:hn,getOwnPropertyDescriptor:ir,getOwnPropertyNames:rr}=Object,sr=Object.prototype.hasOwnProperty,ot=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of rr(n))if(!sr.call(t,r)&&r!==e)hn(t,r,{get:()=>n[r],enumerable:!(i=ir(n,r))||i.enumerable})}return t},on=(t,n,e)=>(ot(t,n,"default"),e&&ot(e,n,"default")),cr=(t)=>ot(hn({},"__esModule",{value:!0}),t),dt={};O.exports=cr(dt);on(dt,_t(),O.exports);on(dt,fn(),O.exports)});var ln=g((dn)=>{Object.defineProperty(dn,"__esModule",{value:!0});dn.getAwsChunkedEncodingStream=void 0;var fr=import.meta.require("stream"),hr=(t,n)=>{let{base64Encoder:e,bodyLengthChecker:i,checksumAlgorithmFn:r,checksumLocationName:s,streamHasher:c}=n,f=e!==void 0&&r!==void 0&&s!==void 0&&c!==void 0,o=f?c(r,t):void 0,a=new fr.Readable({read:()=>{}});return t.on("data",(x)=>{let h=i(x)||0;a.push(`${h.toString(16)}\r\n`),a.push(x),a.push("\r\n")}),t.on("end",async()=>{if(a.push("0\r\n"),f){let x=e(await o);a.push(`${s}:${x}\r\n`),a.push("\r\n")}a.push(null)}),a};dn.getAwsChunkedEncodingStream=hr});var P=g((uf,gn)=>{var{defineProperty:v,getOwnPropertyDescriptor:or,getOwnPropertyNames:dr}=Object,ur=Object.prototype.hasOwnProperty,U=(t,n)=>v(t,"name",{value:n,configurable:!0}),lr=(t,n)=>{for(var e in n)v(t,e,{get:n[e],enumerable:!0})},ar=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of dr(n))if(!ur.call(t,r)&&r!==e)v(t,r,{get:()=>n[r],enumerable:!(i=or(n,r))||i.enumerable})}return t},wr=(t)=>ar(v({},"__esModule",{value:!0}),t),an={};lr(an,{Field:()=>Er,Fields:()=>xr,HttpRequest:()=>Tr,HttpResponse:()=>Cr,IHttpRequest:()=>wn.HttpRequest,getHttpHandlerExtensionConfiguration:()=>yr,isValidHostname:()=>Cn,resolveHttpHandlerRuntimeConfig:()=>$r});gn.exports=wr(an);var yr=U((t)=>{let n=t.httpHandler;return{setHttpHandler(e){n=e},httpHandler(){return n},updateHttpClientConfig(e,i){n.updateHttpClientConfig(e,i)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),$r=U((t)=>{return{httpHandler:t.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),wn=J(),yn=class t{constructor({name:n,kind:e=wn.FieldPosition.HEADER,values:i=[]}){this.name=n,this.kind=e,this.values=i}add(n){this.values.push(n)}set(n){this.values=n}remove(n){this.values=this.values.filter((e)=>e!==n)}toString(){return this.values.map((n)=>n.includes(",")||n.includes(" ")?`"${n}"`:n).join(", ")}get(){return this.values}};U(yn,"Field");var Er=yn,$n=class t{constructor({fields:n=[],encoding:e="utf-8"}){this.entries={},n.forEach(this.setField.bind(this)),this.encoding=e}setField(n){this.entries[n.name.toLowerCase()]=n}getField(n){return this.entries[n.toLowerCase()]}removeField(n){delete this.entries[n.toLowerCase()]}getByType(n){return Object.values(this.entries).filter((e)=>e.kind===n)}};U($n,"Fields");var xr=$n,En=class t{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){let e=new t({...n,headers:{...n.headers}});if(e.query)e.query=xn(e.query);return e}static isInstance(n){if(!n)return!1;let e=n;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return t.clone(this)}};U(En,"HttpRequest");var Tr=En;function xn(t){return Object.keys(t).reduce((n,e)=>{let i=t[e];return{...n,[e]:Array.isArray(i)?[...i]:i}},{})}U(xn,"cloneQuery");var Tn=class t{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;let e=n;return typeof e.statusCode==="number"&&typeof e.headers==="object"}};U(Tn,"HttpResponse");var Cr=Tn;function Cn(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)}U(Cn,"isValidHostname")});var lt=g((lf,In)=>{var{defineProperty:m,getOwnPropertyDescriptor:gr,getOwnPropertyNames:Sr}=Object,Fr=Object.prototype.hasOwnProperty,ut=(t,n)=>m(t,"name",{value:n,configurable:!0}),Ir=(t,n)=>{for(var e in n)m(t,e,{get:n[e],enumerable:!0})},Nr=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Sr(n))if(!Fr.call(t,r)&&r!==e)m(t,r,{get:()=>n[r],enumerable:!(i=gr(n,r))||i.enumerable})}return t},Lr=(t)=>Nr(m({},"__esModule",{value:!0}),t),Sn={};Ir(Sn,{escapeUri:()=>Fn,escapeUriPath:()=>Mr});In.exports=Lr(Sn);var Fn=ut((t)=>encodeURIComponent(t).replace(/[!'()*]/g,zr),"escapeUri"),zr=ut((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Mr=ut((t)=>t.split("/").map(Fn).join("/"),"escapeUriPath")});var wt=g((af,zn)=>{var{defineProperty:q,getOwnPropertyDescriptor:br,getOwnPropertyNames:Rr}=Object,Ur=Object.prototype.hasOwnProperty,Dr=(t,n)=>q(t,"name",{value:n,configurable:!0}),Ar=(t,n)=>{for(var e in n)q(t,e,{get:n[e],enumerable:!0})},Yr=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Rr(n))if(!Ur.call(t,r)&&r!==e)q(t,r,{get:()=>n[r],enumerable:!(i=br(n,r))||i.enumerable})}return t},Wr=(t)=>Yr(q({},"__esModule",{value:!0}),t),Nn={};Ar(Nn,{buildQueryString:()=>Ln});zn.exports=Wr(Nn);var at=lt();function Ln(t){let n=[];for(let e of Object.keys(t).sort()){let i=t[e];if(e=at.escapeUri(e),Array.isArray(i))for(let r=0,s=i.length;r<s;r++)n.push(`${e}=${at.escapeUri(i[r])}`);else{let r=e;if(i||typeof i==="string")r+=`=${at.escapeUri(i)}`;n.push(r)}}return n.join("&")}Dr(Ln,"buildQueryString")});var kn=g((wf,pn)=>{var{create:Zr,defineProperty:G,getOwnPropertyDescriptor:Qr,getOwnPropertyNames:Kr,getPrototypeOf:Vr}=Object,Xr=Object.prototype.hasOwnProperty,S=(t,n)=>G(t,"name",{value:n,configurable:!0}),Gr=(t,n)=>{for(var e in n)G(t,e,{get:n[e],enumerable:!0})},Dn=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of Kr(n))if(!Xr.call(t,r)&&r!==e)G(t,r,{get:()=>n[r],enumerable:!(i=Qr(n,r))||i.enumerable})}return t},jr=(t,n,e)=>(e=t!=null?Zr(Vr(t)):{},Dn(n||!t||!t.__esModule?G(e,"default",{value:t,enumerable:!0}):e,t)),Jr=(t)=>Dn(G({},"__esModule",{value:!0}),t),An={};Gr(An,{DEFAULT_REQUEST_TIMEOUT:()=>vr,NodeHttp2Handler:()=>ts,NodeHttpHandler:()=>Pr,streamCollector:()=>es});pn.exports=Jr(An);var Yn=P(),Wn=wt(),yt=import.meta.require("http"),$t=import.meta.require("https"),Br=["ECONNRESET","EPIPE","ETIMEDOUT"],Zn=S((t)=>{let n={};for(let e of Object.keys(t)){let i=t[e];n[e]=Array.isArray(i)?i.join(","):i}return n},"getTransformedHeaders"),Mn=1000,pr=S((t,n,e=0)=>{if(!e)return-1;let i=S((r)=>{let s=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-r),c=S((f)=>{if(f==null?void 0:f.connecting)f.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)},"doWithSocket");if(t.socket)c(t.socket);else t.on("socket",c)},"registerTimeout");if(e<2000)return i(0),0;return setTimeout(i.bind(null,Mn),Mn)},"setConnectionTimeout"),kr=3000,Hr=S((t,{keepAlive:n,keepAliveMsecs:e},i=kr)=>{if(n!==!0)return-1;let r=S(()=>{if(t.socket)t.socket.setKeepAlive(n,e||0);else t.on("socket",(s)=>{s.setKeepAlive(n,e||0)})},"registerListener");if(i===0)return r(),0;return setTimeout(r,i)},"setSocketKeepAlive"),bn=3000,Or=S((t,n,e=0)=>{let i=S((r)=>{t.setTimeout(e-r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<e&&e<6000)return i(0),0;return setTimeout(i.bind(null,e===0?0:bn),bn)},"setSocketTimeout"),Qn=import.meta.require("stream"),Rn=1000;async function Et(t,n,e=Rn){let i=n.headers??{},r=i.Expect||i.expect,s=-1,c=!1;if(r==="100-continue")await Promise.race([new Promise((f)=>{s=Number(setTimeout(f,Math.max(Rn,e)))}),new Promise((f)=>{t.on("continue",()=>{clearTimeout(s),f()}),t.on("error",()=>{c=!0,clearTimeout(s),f()})})]);if(!c)Kn(t,n.body)}S(Et,"writeRequestBody");function Kn(t,n){if(n instanceof Qn.Readable){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}let e=n;if(typeof e==="object"&&e.buffer&&typeof e.byteOffset==="number"&&typeof e.byteLength==="number"){t.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}t.end(Buffer.from(n));return}t.end()}S(Kn,"writeBody");var vr=0,Vn=class t{constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,i)=>{if(typeof n==="function")n().then((r)=>{e(this.resolveDefaultConfig(r))}).catch(i);else e(this.resolveDefaultConfig(n))})}static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}static checkSocketUsage(n,e,i=console){var r,s,c;let{sockets:f,requests:o,maxSockets:a}=n;if(typeof a!=="number"||a===1/0)return e;let x=15000;if(Date.now()-x<e)return e;if(f&&o)for(let h in f){let u=((r=f[h])==null?void 0:r.length)??0,l=((s=o[h])==null?void 0:s.length)??0;if(u>=a&&l>=2*a)return(c=i==null?void 0:i.warn)==null||c.call(i,`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}resolveDefaultConfig(n){let{requestTimeout:e,connectionTimeout:i,socketTimeout:r,httpAgent:s,httpsAgent:c}=n||{},f=!0,o=50;return{connectionTimeout:i,requestTimeout:e??r,httpAgent:(()=>{if(s instanceof yt.Agent||typeof(s==null?void 0:s.destroy)==="function")return s;return new yt.Agent({keepAlive:!0,maxSockets:50,...s})})(),httpsAgent:(()=>{if(c instanceof $t.Agent||typeof(c==null?void 0:c.destroy)==="function")return c;return new $t.Agent({keepAlive:!0,maxSockets:50,...c})})(),logger:console}}destroy(){var n,e,i,r;(e=(n=this.config)==null?void 0:n.httpAgent)==null||e.destroy(),(r=(i=this.config)==null?void 0:i.httpsAgent)==null||r.destroy()}async handle(n,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;return new Promise((i,r)=>{let s=void 0,c=[],f=S(async(w)=>{await s,c.forEach(clearTimeout),i(w)},"resolve"),o=S(async(w)=>{await s,c.forEach(clearTimeout),r(w)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e==null?void 0:e.aborted){let w=new Error("Request aborted");w.name="AbortError",o(w);return}let a=n.protocol==="https:",x=a?this.config.httpsAgent:this.config.httpAgent;c.push(setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let h=Wn.buildQueryString(n.query||{}),u=void 0;if(n.username!=null||n.password!=null){let w=n.username??"",T=n.password??"";u=`${w}:${T}`}let l=n.path;if(h)l+=`?${h}`;if(n.fragment)l+=`#${n.fragment}`;let E=n.hostname??"";if(E[0]==="["&&E.endsWith("]"))E=n.hostname.slice(1,-1);else E=n.hostname;let C={headers:n.headers,host:E,method:n.method,path:l,port:n.port,agent:x,auth:u},$=(a?$t.request:yt.request)(C,(w)=>{let T=new Yn.HttpResponse({statusCode:w.statusCode||-1,reason:w.statusMessage,headers:Zn(w.headers),body:w});f({response:T})});if($.on("error",(w)=>{if(Br.includes(w.code))o(Object.assign(w,{name:"TimeoutError"}));else o(w)}),e){let w=S(()=>{$.destroy();let T=new Error("Request aborted");T.name="AbortError",o(T)},"onAbort");if(typeof e.addEventListener==="function"){let T=e;T.addEventListener("abort",w,{once:!0}),$.once("close",()=>T.removeEventListener("abort",w))}else e.onabort=w}c.push(pr($,o,this.config.connectionTimeout)),c.push(Or($,o,this.config.requestTimeout));let d=C.agent;if(typeof d==="object"&&"keepAlive"in d)c.push(Hr($,{keepAlive:d.keepAlive,keepAliveMsecs:d.keepAliveMsecs}));s=Et($,n,this.config.requestTimeout).catch((w)=>{return c.forEach(clearTimeout),r(w)})})}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[n]:e}})}httpHandlerConfigs(){return this.config??{}}};S(Vn,"NodeHttpHandler");var Pr=Vn,Un=import.meta.require("http2"),mr=jr(import.meta.require("http2")),Xn=class t{constructor(n){this.sessions=[],this.sessions=n??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(n){this.sessions.push(n)}contains(n){return this.sessions.includes(n)}remove(n){this.sessions=this.sessions.filter((e)=>e!==n)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(n){for(let e of this.sessions)if(e===n){if(!e.destroyed)e.destroy()}}};S(Xn,"NodeHttp2ConnectionPool");var qr=Xn,Gn=class t{constructor(n){if(this.sessionCache=new Map,this.config=n,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(n,e){let i=this.getUrlString(n),r=this.sessionCache.get(i);if(r){let o=r.poll();if(o&&!this.config.disableConcurrency)return o}let s=mr.default.connect(i);if(this.config.maxConcurrency)s.settings({maxConcurrentStreams:this.config.maxConcurrency},(o)=>{if(o)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+n.destination.toString())});s.unref();let c=S(()=>{s.destroy(),this.deleteSession(i,s)},"destroySessionCb");if(s.on("goaway",c),s.on("error",c),s.on("frameError",c),s.on("close",()=>this.deleteSession(i,s)),e.requestTimeout)s.setTimeout(e.requestTimeout,c);let f=this.sessionCache.get(i)||new qr;return f.offerLast(s),this.sessionCache.set(i,f),s}deleteSession(n,e){let i=this.sessionCache.get(n);if(!i)return;if(!i.contains(e))return;i.remove(e),this.sessionCache.set(n,i)}release(n,e){var i;let r=this.getUrlString(n);(i=this.sessionCache.get(r))==null||i.offerLast(e)}destroy(){for(let[n,e]of this.sessionCache){for(let i of e){if(!i.destroyed)i.destroy();e.remove(i)}this.sessionCache.delete(n)}}setMaxConcurrentStreams(n){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=n}setDisableConcurrentStreams(n){this.config.disableConcurrency=n}getUrlString(n){return n.destination.toString()}};S(Gn,"NodeHttp2ConnectionManager");var _r=Gn,jn=class t{constructor(n){this.metadata={handlerProtocol:"h2"},this.connectionManager=new _r({}),this.configProvider=new Promise((e,i)=>{if(typeof n==="function")n().then((r)=>{e(r||{})}).catch(i);else e(n||{})})}static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}destroy(){this.connectionManager.destroy()}async handle(n,{abortSignal:e}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}let{requestTimeout:i,disableConcurrentStreams:r}=this.config;return new Promise((s,c)=>{var f;let o=!1,a=void 0,x=S(async(F)=>{await a,s(F)},"resolve"),h=S(async(F)=>{await a,c(F)},"reject");if(e==null?void 0:e.aborted){o=!0;let F=new Error("Request aborted");F.name="AbortError",h(F);return}let{hostname:u,method:l,port:E,protocol:C,query:y}=n,$="";if(n.username!=null||n.password!=null){let F=n.username??"",z=n.password??"";$=`${F}:${z}@`}let d=`${C}//${$}${u}${E?`:${E}`:""}`,w={destination:new URL(d)},T=this.connectionManager.lease(w,{requestTimeout:(f=this.config)==null?void 0:f.sessionTimeout,disableConcurrentStreams:r||!1}),I=S((F)=>{if(r)this.destroySession(T);o=!0,h(F)},"rejectWithDestroy"),L=Wn.buildQueryString(y||{}),ct=n.path;if(L)ct+=`?${L}`;if(n.fragment)ct+=`#${n.fragment}`;let N=T.request({...n.headers,[Un.constants.HTTP2_HEADER_PATH]:ct,[Un.constants.HTTP2_HEADER_METHOD]:l});if(T.ref(),N.on("response",(F)=>{let z=new Yn.HttpResponse({statusCode:F[":status"]||-1,headers:Zn(F),body:N});if(o=!0,x({response:z}),r)T.close(),this.connectionManager.deleteSession(d,T)}),i)N.setTimeout(i,()=>{N.close();let F=new Error(`Stream timed out because of no activity for ${i} ms`);F.name="TimeoutError",I(F)});if(e){let F=S(()=>{N.close();let z=new Error("Request aborted");z.name="AbortError",I(z)},"onAbort");if(typeof e.addEventListener==="function"){let z=e;z.addEventListener("abort",F,{once:!0}),N.once("close",()=>z.removeEventListener("abort",F))}else e.onabort=F}N.on("frameError",(F,z,Ii)=>{I(new Error(`Frame type id ${F} in stream id ${Ii} has failed with code ${z}.`))}),N.on("error",I),N.on("aborted",()=>{I(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${N.rstCode}.`))}),N.on("close",()=>{if(T.unref(),r)T.destroy();if(!o)I(new Error("Unexpected error: http2 request did not get a response"))}),a=Et(N,n,i)})}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[n]:e}})}httpHandlerConfigs(){return this.config??{}}destroySession(n){if(!n.destroyed)n.destroy()}};S(jn,"NodeHttp2Handler");var ts=jn,Jn=class t extends Qn.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,e,i){this.bufferedBytes.push(n),i()}};S(Jn,"Collector");var ns=Jn,es=S((t)=>{if(is(t))return Bn(t);return new Promise((n,e)=>{let i=new ns;t.pipe(i),t.on("error",(r)=>{i.end(),e(r)}),i.on("error",e),i.on("finish",function(){let r=new Uint8Array(Buffer.concat(this.bufferedBytes));n(r)})})},"streamCollector"),is=S((t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream,"isReadableStreamInstance");async function Bn(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}S(Bn,"collectReadableStream")});var _n=g((yf,qn)=>{var{defineProperty:tt,getOwnPropertyDescriptor:rs,getOwnPropertyNames:ss}=Object,cs=Object.prototype.hasOwnProperty,Y=(t,n)=>tt(t,"name",{value:n,configurable:!0}),fs=(t,n)=>{for(var e in n)tt(t,e,{get:n[e],enumerable:!0})},hs=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ss(n))if(!cs.call(t,r)&&r!==e)tt(t,r,{get:()=>n[r],enumerable:!(i=rs(n,r))||i.enumerable})}return t},os=(t)=>hs(tt({},"__esModule",{value:!0}),t),On={};fs(On,{FetchHttpHandler:()=>us,keepAliveSupport:()=>_,streamCollector:()=>ls});qn.exports=os(On);var Hn=P(),ds=wt();function vn(t=0){return new Promise((n,e)=>{if(t)setTimeout(()=>{let i=new Error(`Request did not complete within ${t} ms`);i.name="TimeoutError",e(i)},t)})}Y(vn,"requestTimeout");var _={supported:void 0},Pn=class t{static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}constructor(n){if(typeof n==="function")this.configProvider=n().then((e)=>e||{});else this.config=n??{},this.configProvider=Promise.resolve(this.config);if(_.supported===void 0)_.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(n,{abortSignal:e}={}){var i;if(!this.config)this.config=await this.configProvider;let r=this.config.requestTimeout,s=this.config.keepAlive===!0,c=this.config.credentials;if(e==null?void 0:e.aborted){let d=new Error("Request aborted");return d.name="AbortError",Promise.reject(d)}let f=n.path,o=ds.buildQueryString(n.query||{});if(o)f+=`?${o}`;if(n.fragment)f+=`#${n.fragment}`;let a="";if(n.username!=null||n.password!=null){let d=n.username??"",w=n.password??"";a=`${d}:${w}@`}let{port:x,method:h}=n,u=`${n.protocol}//${a}${n.hostname}${x?`:${x}`:""}${f}`,l=h==="GET"||h==="HEAD"?void 0:n.body,E={body:l,headers:new Headers(n.headers),method:h,credentials:c};if((i=this.config)==null?void 0:i.cache)E.cache=this.config.cache;if(l)E.duplex="half";if(typeof AbortController!=="undefined")E.signal=e;if(_.supported)E.keepalive=s;if(typeof this.config.requestInit==="function")Object.assign(E,this.config.requestInit(n));let C=Y(()=>{},"removeSignalEventListener"),y=new Request(u,E),$=[fetch(y).then((d)=>{let w=d.headers,T={};for(let L of w.entries())T[L[0]]=L[1];if(d.body==null)return d.blob().then((L)=>({response:new Hn.HttpResponse({headers:T,reason:d.statusText,statusCode:d.status,body:L})}));return{response:new Hn.HttpResponse({headers:T,reason:d.statusText,statusCode:d.status,body:d.body})}}),vn(r)];if(e)$.push(new Promise((d,w)=>{let T=Y(()=>{let I=new Error("Request aborted");I.name="AbortError",w(I)},"onAbort");if(typeof e.addEventListener==="function"){let I=e;I.addEventListener("abort",T,{once:!0}),C=Y(()=>I.removeEventListener("abort",T),"removeSignalEventListener")}else e.onabort=T}));return Promise.race($).finally(C)}updateHttpClientConfig(n,e){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return i[n]=e,i})}httpHandlerConfigs(){return this.config??{}}};Y(Pn,"FetchHttpHandler");var us=Pn,ls=Y(async(t)=>{if(typeof Blob==="function"&&t instanceof Blob)return new Uint8Array(await t.arrayBuffer());return mn(t)},"streamCollector");async function mn(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}Y(mn,"collectStream")});var ce=g(($f,se)=>{var{defineProperty:nt,getOwnPropertyDescriptor:as,getOwnPropertyNames:ws}=Object,ys=Object.prototype.hasOwnProperty,te=(t,n)=>nt(t,"name",{value:n,configurable:!0}),$s=(t,n)=>{for(var e in n)nt(t,e,{get:n[e],enumerable:!0})},Es=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ws(n))if(!ys.call(t,r)&&r!==e)nt(t,r,{get:()=>n[r],enumerable:!(i=as(n,r))||i.enumerable})}return t},xs=(t)=>Es(nt({},"__esModule",{value:!0}),t),ne={};$s(ne,{fromHex:()=>ie,toHex:()=>re});se.exports=xs(ne);var ee={},xt={};for(let t=0;t<256;t++){let n=t.toString(16).toLowerCase();if(n.length===1)n=`0${n}`;ee[t]=n,xt[n]=t}function ie(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2){let i=t.slice(e,e+2).toLowerCase();if(i in xt)n[e/2]=xt[i];else throw new Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return n}te(ie,"fromHex");function re(t){let n="";for(let e=0;e<t.byteLength;e++)n+=ee[t[e]];return n}te(re,"toHex")});var W=g((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.isReadableStream=void 0;var Ts=(t)=>{var n;return typeof ReadableStream==="function"&&(((n=t===null||t===void 0?void 0:t.constructor)===null||n===void 0?void 0:n.name)===ReadableStream.name||t instanceof ReadableStream)};fe.isReadableStream=Ts});var we=g((le)=>{Object.defineProperty(le,"__esModule",{value:!0});le.sdkStreamMixin=void 0;var Cs=_n(),gs=X(),Ss=ce(),Fs=H(),oe=W(),de="The stream has already been transformed.",Is=(t)=>{var n,e;if(!ue(t)&&!oe.isReadableStream(t)){let c=((e=(n=t===null||t===void 0?void 0:t.__proto__)===null||n===void 0?void 0:n.constructor)===null||e===void 0?void 0:e.name)||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${c}`)}let i=!1,r=async()=>{if(i)throw new Error(de);return i=!0,await Cs.streamCollector(t)},s=(c)=>{if(typeof c.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return c.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(c)=>{let f=await r();if(c==="base64")return gs.toBase64(f);else if(c==="hex")return Ss.toHex(f);else if(c===void 0||c==="utf8"||c==="utf-8")return Fs.toUtf8(f);else if(typeof TextDecoder==="function")return new TextDecoder(c).decode(f);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(i)throw new Error(de);if(i=!0,ue(t))return s(t);else if(oe.isReadableStream(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})};le.sdkStreamMixin=Is;var ue=(t)=>typeof Blob==="function"&&t instanceof Blob});var xe=g(($e)=>{Object.defineProperty($e,"__esModule",{value:!0});$e.sdkStreamMixin=void 0;var Ns=kn(),Ls=V(),Tt=import.meta.require("stream"),zs=import.meta.require("util"),Ms=we(),ye="The stream has already been transformed.",bs=(t)=>{var n,e;if(!(t instanceof Tt.Readable))try{return Ms.sdkStreamMixin(t)}catch(s){let c=((e=(n=t===null||t===void 0?void 0:t.__proto__)===null||n===void 0?void 0:n.constructor)===null||e===void 0?void 0:e.name)||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${c}`)}let i=!1,r=async()=>{if(i)throw new Error(ye);return i=!0,await Ns.streamCollector(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(s)=>{let c=await r();if(s===void 0||Buffer.isEncoding(s))return Ls.fromArrayBuffer(c.buffer,c.byteOffset,c.byteLength).toString(s);else return new zs.TextDecoder(s).decode(c)},transformToWebStream:()=>{if(i)throw new Error(ye);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Tt.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return i=!0,Tt.Readable.toWeb(t)}})};$e.sdkStreamMixin=bs});var ge=g((Te)=>{Object.defineProperty(Te,"__esModule",{value:!0});Te.splitStream=void 0;async function Rs(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}Te.splitStream=Rs});var Ne=g((Fe)=>{Object.defineProperty(Fe,"__esModule",{value:!0});Fe.splitStream=void 0;var Se=import.meta.require("stream"),Us=ge(),Ds=W();async function As(t){if(Ds.isReadableStream(t))return Us.splitStream(t);let n=new Se.PassThrough,e=new Se.PassThrough;return t.pipe(n),t.pipe(e),[n,e]}Fe.splitStream=As});var Me=g((Le)=>{Object.defineProperty(Le,"__esModule",{value:!0});Le.headStream=void 0;async function Ys(t,n){var e;let i=0,r=[],s=t.getReader(),c=!1;while(!c){let{done:a,value:x}=await s.read();if(x)r.push(x),i+=(e=x===null||x===void 0?void 0:x.byteLength)!==null&&e!==void 0?e:0;if(i>=n)break;c=a}s.releaseLock();let f=new Uint8Array(Math.min(n,i)),o=0;for(let a of r){if(a.byteLength>f.byteLength-o){f.set(a.subarray(0,f.byteLength-o),o);break}else f.set(a,o);o+=a.length}return f}Le.headStream=Ys});var De=g((Re)=>{Object.defineProperty(Re,"__esModule",{value:!0});Re.headStream=void 0;var Ws=import.meta.require("stream"),Zs=Me(),Qs=W(),Ks=(t,n)=>{if(Qs.isReadableStream(t))return Zs.headStream(t,n);return new Promise((e,i)=>{let r=new be;r.limit=n,t.pipe(r),t.on("error",(s)=>{r.end(),i(s)}),r.on("error",i),r.on("finish",function(){let s=new Uint8Array(Buffer.concat(this.buffers));e(s)})})};Re.headStream=Ks;class be extends Ws.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(t,n,e){var i;if(this.buffers.push(t),this.bytesBuffered+=(i=t.byteLength)!==null&&i!==void 0?i:0,this.bytesBuffered>=this.limit){let r=this.bytesBuffered-this.limit,s=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=s.subarray(0,s.byteLength-r),this.emit("finish")}e()}}});var Ct=g((Ye)=>{Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ChecksumStream=void 0;var Vs=X(),Xs=import.meta.require("stream");class Ae extends Xs.Duplex{constructor({expectedChecksum:t,checksum:n,source:e,checksumSourceLocation:i,base64Encoder:r}){var s,c;super();if(typeof e.pipe==="function")this.source=e;else throw new Error(`@smithy/util-stream: unsupported source type ${(c=(s=e===null||e===void 0?void 0:e.constructor)===null||s===void 0?void 0:s.name)!==null&&c!==void 0?c:e} in ChecksumStream.`);this.base64Encoder=r!==null&&r!==void 0?r:Vs.toBase64,this.expectedChecksum=t,this.checksum=n,this.checksumSourceLocation=i,this.source.pipe(this)}_read(t){}_write(t,n,e){try{this.checksum.update(t),this.push(t)}catch(i){return e(i)}return e()}async _final(t){try{let n=await this.checksum.digest(),e=this.base64Encoder(n);if(this.expectedChecksum!==e)return t(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${e}" in response header "${this.checksumSourceLocation}".`))}catch(n){return t(n)}return this.push(null),t()}}Ye.ChecksumStream=Ae});var Ve=g((Qe)=>{Object.defineProperty(Qe,"__esModule",{value:!0});Qe.ChecksumStream=void 0;var Gs=typeof ReadableStream==="function"?ReadableStream:function(){};class Ze extends Gs{}Qe.ChecksumStream=Ze});var je=g((Xe)=>{Object.defineProperty(Xe,"__esModule",{value:!0});Xe.createChecksumStream=void 0;var js=X(),Js=W(),Bs=Ve(),ps=({expectedChecksum:t,checksum:n,source:e,checksumSourceLocation:i,base64Encoder:r})=>{var s,c;if(!Js.isReadableStream(e))throw new Error(`@smithy/util-stream: unsupported source type ${(c=(s=e===null||e===void 0?void 0:e.constructor)===null||s===void 0?void 0:s.name)!==null&&c!==void 0?c:e} in ChecksumStream.`);let f=r!==null&&r!==void 0?r:js.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let o=new TransformStream({start(){},async transform(x,h){n.update(x),h.enqueue(x)},async flush(x){let h=await n.digest(),u=f(h);if(t!==u){let l=new Error(`Checksum mismatch: expected "${t}" but received "${u}" in response header "${i}".`);x.error(l)}else x.terminate()}});e.pipeThrough(o);let a=o.readable;return Object.setPrototypeOf(a,Bs.ChecksumStream.prototype),a};Xe.createChecksumStream=ps});var pe=g((Je)=>{Object.defineProperty(Je,"__esModule",{value:!0});Je.createChecksumStream=void 0;var ks=W(),Hs=Ct(),Os=je();function vs(t){if(typeof ReadableStream==="function"&&ks.isReadableStream(t.source))return Os.createChecksumStream(t);return new Hs.ChecksumStream(t)}Je.createChecksumStream=vs});var me=g((Mf,b)=>{var{defineProperty:et,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:ms}=Object,qs=Object.prototype.hasOwnProperty,Ft=(t,n)=>et(t,"name",{value:n,configurable:!0}),_s=(t,n)=>{for(var e in n)et(t,e,{get:n[e],enumerable:!0})},gt=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ms(n))if(!qs.call(t,r)&&r!==e)et(t,r,{get:()=>n[r],enumerable:!(i=Ps(n,r))||i.enumerable})}return t},Z=(t,n,e)=>(gt(t,n,"default"),e&>(e,n,"default")),tc=(t)=>gt(et({},"__esModule",{value:!0}),t),M={};_s(M,{Uint8ArrayBlobAdapter:()=>St});b.exports=tc(M);var ke=X(),He=H();function Oe(t,n="utf-8"){if(n==="base64")return ke.toBase64(t);return He.toUtf8(t)}Ft(Oe,"transformToString");function ve(t,n){if(n==="base64")return St.mutate(ke.fromBase64(t));return St.mutate(He.fromUtf8(t))}Ft(ve,"transformFromString");var Pe=class t extends Uint8Array{static fromString(n,e="utf-8"){switch(typeof n){case"string":return ve(n,e);default:throw new Error(`Unsupported conversion from ${typeof n} to Uint8ArrayBlobAdapter.`)}}static mutate(n){return Object.setPrototypeOf(n,t.prototype),n}transformToString(n="utf-8"){return Oe(this,n)}};Ft(Pe,"Uint8ArrayBlobAdapter");var St=Pe;Z(M,ln(),b.exports);Z(M,xe(),b.exports);Z(M,Ne(),b.exports);Z(M,De(),b.exports);Z(M,W(),b.exports);Z(M,pe(),b.exports);Z(M,Ct(),b.exports)});var j=g((bf,ti)=>{var{defineProperty:Lt,getOwnPropertyDescriptor:nc,getOwnPropertyNames:ec}=Object,ic=Object.prototype.hasOwnProperty,rc=(t,n)=>{for(var e in n)Lt(t,e,{get:n[e],enumerable:!0})},sc=(t,n,e,i)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let r of ec(n))if(!ic.call(t,r)&&r!==e)Lt(t,r,{get:()=>n[r],enumerable:!(i=nc(n,r))||i.enumerable})}return t},cc=(t)=>sc(Lt({},"__esModule",{value:!0}),t),qe={};rc(qe,{RequestBuilder:()=>_e,collectBody:()=>fc,extendedEncodeURIComponent:()=>Nt,requestBuilder:()=>dc,resolvedPath:()=>uc});ti.exports=cc(qe);var It=me(),fc=async(t=new Uint8Array,n)=>{if(t instanceof Uint8Array)return It.Uint8ArrayBlobAdapter.mutate(t);if(!t)return It.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let e=n.streamCollector(t);return It.Uint8ArrayBlobAdapter.mutate(await e)};function Nt(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})}var hc=j(),oc=P();function dc(t,n){return new _e(t,n)}var _e=class{constructor(t,n){this.input=t,this.context=n,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:t,protocol:n="https",port:e,path:i}=await this.context.endpoint();this.path=i;for(let r of this.resolvePathStack)r(this.path);return new oc.HttpRequest({protocol:n,hostname:this.hostname||t,port:e,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push((n)=>{this.path=`${(n==null?void 0:n.endsWith("/"))?n.slice(0,-1):n||""}`+t}),this}p(t,n,e,i){return this.resolvePathStack.push((r)=>{this.path=hc.resolvedPath(r,this.input,t,n,e,i)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}},uc=(t,n,e,i,r,s)=>{if(n!=null&&n[e]!==void 0){let c=i();if(c.length<=0)throw new Error("Empty value provided for input HTTP label: "+e+".");t=t.replace(r,s?c.split("/").map((f)=>Nt(f)).join("/"):Nt(c))}else throw new Error("No value provided for input HTTP label: "+e+".");return t}});var D=(t,n)=>{let e=[];if(t)e.push(t);if(n)for(let i of n)e.push(i);return e},R=(t,n)=>{return`${t||"anonymous"}${n&&n.length>0?` (a.k.a. ${n.join(",")})`:""}`},K=()=>{let t=[],n=[],e=!1,i=new Set,r=(h)=>h.sort((u,l)=>Kt[l.step]-Kt[u.step]||Vt[l.priority||"normal"]-Vt[u.priority||"normal"]),s=(h)=>{let u=!1,l=(E)=>{let C=D(E.name,E.aliases);if(C.includes(h)){u=!0;for(let y of C)i.delete(y);return!1}return!0};return t=t.filter(l),n=n.filter(l),u},c=(h)=>{let u=!1,l=(E)=>{if(E.middleware===h){u=!0;for(let C of D(E.name,E.aliases))i.delete(C);return!1}return!0};return t=t.filter(l),n=n.filter(l),u},f=(h)=>{return t.forEach((u)=>{h.add(u.middleware,{...u})}),n.forEach((u)=>{h.addRelativeTo(u.middleware,{...u})}),h.identifyOnResolve?.(x.identifyOnResolve()),h},o=(h)=>{let u=[];return h.before.forEach((l)=>{if(l.before.length===0&&l.after.length===0)u.push(l);else u.push(...o(l))}),u.push(h),h.after.reverse().forEach((l)=>{if(l.before.length===0&&l.after.length===0)u.push(l);else u.push(...o(l))}),u},a=(h=!1)=>{let u=[],l=[],E={};return t.forEach((y)=>{let $={...y,before:[],after:[]};for(let d of D($.name,$.aliases))E[d]=$;u.push($)}),n.forEach((y)=>{let $={...y,before:[],after:[]};for(let d of D($.name,$.aliases))E[d]=$;l.push($)}),l.forEach((y)=>{if(y.toMiddleware){let $=E[y.toMiddleware];if($===void 0){if(h)return;throw new Error(`${y.toMiddleware} is not found when adding ${R(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")$.after.push(y);if(y.relation==="before")$.before.push(y)}}),r(u).map(o).reduce((y,$)=>{return y.push(...$),y},[])},x={add:(h,u={})=>{let{name:l,override:E,aliases:C}=u,y={step:"initialize",priority:"normal",middleware:h,...u},$=D(l,C);if($.length>0){if($.some((d)=>i.has(d))){if(!E)throw new Error(`Duplicate middleware name '${R(l,C)}'`);for(let d of $){let w=t.findIndex((I)=>I.name===d||I.aliases?.some((L)=>L===d));if(w===-1)continue;let T=t[w];if(T.step!==y.step||y.priority!==T.priority)throw new Error(`"${R(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${R(l,C)}" middleware with ${y.priority} priority in ${y.step} step.`);t.splice(w,1)}}for(let d of $)i.add(d)}t.push(y)},addRelativeTo:(h,u)=>{let{name:l,override:E,aliases:C}=u,y={middleware:h,...u},$=D(l,C);if($.length>0){if($.some((d)=>i.has(d))){if(!E)throw new Error(`Duplicate middleware name '${R(l,C)}'`);for(let d of $){let w=n.findIndex((I)=>I.name===d||I.aliases?.some((L)=>L===d));if(w===-1)continue;let T=n[w];if(T.toMiddleware!==y.toMiddleware||T.relation!==y.relation)throw new Error(`"${R(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${R(l,C)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);n.splice(w,1)}}for(let d of $)i.add(d)}n.push(y)},clone:()=>f(K()),use:(h)=>{h.applyToStack(x)},remove:(h)=>{if(typeof h==="string")return s(h);else return c(h)},removeByTag:(h)=>{let u=!1,l=(E)=>{let{tags:C,name:y,aliases:$}=E;if(C&&C.includes(h)){let d=D(y,$);for(let w of d)i.delete(w);return u=!0,!1}return!0};return t=t.filter(l),n=n.filter(l),u},concat:(h)=>{let u=f(K());return u.use(h),u.identifyOnResolve(e||u.identifyOnResolve()||(h.identifyOnResolve?.()??!1)),u},applyToStack:f,identify:()=>{return a(!0).map((h)=>{let u=h.step??h.relation+" "+h.toMiddleware;return R(h.name,h.aliases)+" - "+u})},identifyOnResolve(h){if(typeof h==="boolean")e=h;return e},resolve:(h,u)=>{for(let l of a().map((E)=>E.middleware).reverse())h=l(h,u);if(e)console.log(x.identify());return h}};return x},Kt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Vt={high:3,normal:2,low:1};class Ni{constructor(t){this.config=t,this.middlewareStack=K()}send(t,n,e){let i=typeof n!=="function"?n:void 0,r=typeof n==="function"?n:e,s=i===void 0&&this.config.cacheMiddleware===!0,c;if(s){if(!this.handlers)this.handlers=new WeakMap;let f=this.handlers;if(f.has(t.constructor))c=f.get(t.constructor);else c=t.resolveMiddleware(this.middlewareStack,this.config,i),f.set(t.constructor,c)}else delete this.handlers,c=t.resolveMiddleware(this.middlewareStack,this.config,i);if(r)c(t).then((f)=>r(null,f.output),(f)=>r(f)).catch(()=>{});else return c(t).then((f)=>f.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Xt=A(J(),1);class Gt{constructor(){this.middlewareStack=K()}static classBuilder(){return new jt}resolveMiddlewareWithContext(t,n,e,{middlewareFn:i,clientName:r,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:f,smithyContext:o,additionalContext:a,CommandCtor:x}){for(let C of i.bind(this)(x,t,n,e))this.middlewareStack.use(C);let h=t.concat(this.middlewareStack),{logger:u}=n,l={logger:u,clientName:r,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:f,[Xt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...o},...a},{requestHandler:E}=n;return h.resolve((C)=>E.handle(C.request,e||{}),l)}}class jt{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(t)=>t,this._outputFilterSensitiveLog=(t)=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,n,e={}){return this._smithyContext={service:t,operation:n,...e},this}c(t={}){return this._additionalContext=t,this}n(t,n){return this._clientName=t,this._commandName=n,this}f(t=(e)=>e,n=(e)=>e){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=n,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){let t=this,n;return n=class extends Gt{static getEndpointParameterInstructions(){return t._ep}constructor(...[e]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=e??{},t._init(this)}resolveMiddleware(e,i,r){return this.resolveMiddlewareWithContext(e,i,r,{CommandCtor:n,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var qc="***SensitiveInformation***";var tf=(t,n)=>{for(let e of Object.keys(t)){let i=t[e],r=async function(c,f,o){let a=new i(c);if(typeof f==="function")this.send(a,f);else if(typeof o==="function"){if(typeof f!=="object")throw new Error(`Expected http options but got ${typeof f}`);this.send(a,f||{},o)}else return this.send(a,f)},s=(e[0].toLowerCase()+e.slice(1)).replace(/Command$/,"");n.prototype[s]=r}};class Jt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,Jt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Bt=(t,n={})=>{Object.entries(n).filter(([,i])=>i!==void 0).forEach(([i,r])=>{if(t[i]==null||t[i]==="")t[i]=r});let e=t.message||t.Message||"UnknownError";return t.message=e,delete t.Message,t};var lc=A(j(),1);var ac=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){let n=parseFloat(t);if(!Number.isNaN(n)){if(String(n)!==String(t))hi.warn(fi(`Expected number but observed string: ${t}`));return n}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},wc=Math.ceil(340282346638528860000000000000000000000),ni=(t)=>{let n=ac(t);if(n!==void 0&&!Number.isNaN(n)&&n!==1/0&&n!==-1/0){if(Math.abs(n)>wc)throw new TypeError(`Expected 32-bit float, got ${t}`)}return n},yc=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)};var ei=(t)=>zt(t,32),ii=(t)=>zt(t,16),ri=(t)=>zt(t,8),zt=(t,n)=>{let e=yc(t);if(e!==void 0&&$c(e,n)!==e)throw new TypeError(`Expected ${n}-bit integer, got ${t}`);return e},$c=(t,n)=>{switch(n){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Df=(t,n)=>{if(t===null||t===void 0){if(n)throw new TypeError(`Expected a non-null value for ${n}`);throw new TypeError("Expected a non-null value")}return t},Af=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;let n=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${n}: ${t}`)},Yf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return hi.warn(fi(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var si=(t)=>{if(typeof t=="string")return ni(it(t));return ni(t)},Ec=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,it=(t)=>{let n=t.match(Ec);if(n===null||n[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var Wf=(t)=>{if(typeof t==="string")return ei(it(t));return ei(t)},Mt=(t)=>{if(typeof t==="string")return ii(it(t));return ii(t)},ci=(t)=>{if(typeof t==="string")return ri(it(t));return ri(t)},fi=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((n)=>!n.includes("stackTraceWarning")).join("\n")},hi={warn:console.warn};var xc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var Tc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Vf=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let n=Tc.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");let[e,i,r,s,c,f,o,a]=n,x=Mt(bt(i)),h=Q(r,"month",1,12),u=Q(s,"day",1,31);return oi(x,h,u,{hours:c,minutes:f,seconds:o,fractionalMilliseconds:a})},Cc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Xf=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let n=Cc.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");let[e,i,r,s,c,f,o,a,x]=n,h=Mt(bt(i)),u=Q(r,"month",1,12),l=Q(s,"day",1,31),E=oi(h,u,l,{hours:c,minutes:f,seconds:o,fractionalMilliseconds:a});if(x.toUpperCase()!="Z")E.setTime(E.getTime()-Nc(x));return E},Gf=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$/),jf=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$/),Jf=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 oi=(t,n,e,i)=>{let r=n-1;return Sc(t,r,e),new Date(Date.UTC(t,r,e,Q(i.hours,"hour",0,23),Q(i.minutes,"minute",0,59),Q(i.seconds,"seconds",0,60),Ic(i.fractionalMilliseconds)))};var gc=[31,28,31,30,31,30,31,31,30,31,30,31],Sc=(t,n,e)=>{let i=gc[n];if(n===1&&Fc(t))i=29;if(e>i)throw new TypeError(`Invalid day for ${xc[n]} in ${t}: ${e}`)},Fc=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},Q=(t,n,e,i)=>{let r=ci(bt(t));if(r<e||r>i)throw new TypeError(`${n} must be between ${e} and ${i}, inclusive`);return r},Ic=(t)=>{if(t===null||t===void 0)return 0;return si("0."+t)*1000},Nc=(t)=>{let n=t[0],e=1;if(n=="+")e=1;else if(n=="-")e=-1;else throw new TypeError(`Offset direction, ${n}, must be "+" or "-"`);let i=Number(t.substring(1,3)),r=Number(t.substring(4,6));return e*(i*60+r)*60*1000},bt=(t)=>{let n=0;while(n<t.length-1&&t.charAt(n)==="0")n++;if(n===0)return t;return t.slice(n)};var Lc=({output:t,parsedBody:n,exceptionCtor:e,errorCode:i})=>{let r=zc(t),s=r.httpStatusCode?r.httpStatusCode+"":void 0,c=new e({name:n?.code||n?.Code||i||s||"UnknownError",$fault:"client",$metadata:r});throw Bt(c,n)},kf=(t)=>{return({output:n,parsedBody:e,errorCode:i})=>{Lc({output:n,parsedBody:e,exceptionCtor:t,errorCode:i})}},zc=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});var Of=(t)=>{switch(t){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 di=!1,Pf=(t)=>{if(t&&!di&&parseInt(t.substring(1,t.indexOf(".")))<16)di=!0};var Mc=A(j(),1);var Rt=A(J(),1);var ui=(t)=>{let n=[];for(let e in Rt.AlgorithmId){let i=Rt.AlgorithmId[e];if(t[i]===void 0)continue;n.push({algorithmId:()=>i,checksumConstructor:()=>t[i]})}return{_checksumAlgorithms:n,addChecksumAlgorithm(e){this._checksumAlgorithms.push(e)},checksumAlgorithms(){return this._checksumAlgorithms}}},li=(t)=>{let n={};return t.checksumAlgorithms().forEach((e)=>{n[e.algorithmId()]=e.checksumConstructor()}),n};var ai=(t)=>{let n=t.retryStrategy;return{setRetryStrategy(e){n=e},retryStrategy(){return n}}},wi=(t)=>{let n={};return n.retryStrategy=t.retryStrategy(),n};var ih=(t)=>{return{...ui(t),...ai(t)}};var rh=(t)=>{return{...li(t),...wi(t)}};var hh=(t)=>Array.isArray(t)?t:[t];var uh=(t)=>{return t!=null};var Ut=function(){let t=Object.getPrototypeOf(this).constructor,e=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(e,t.prototype),e};Ut.prototype=Object.create(String.prototype,{constructor:{value:Ut,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Ut,String);class bc{trace(){}debug(){}info(){}warn(){}error(){}}function Rc(t,n,e){let i,r,s;if(typeof n==="undefined"&&typeof e==="undefined")i={},s=t;else if(i=t,typeof n==="function")return r=n,s=e,Uc(i,r,s);else s=n;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){i[c]=s[c];continue}yi(i,null,s,c)}return i}var yh=(t,n)=>{let e={};for(let i in n)yi(e,t,n,i);return e},Uc=(t,n,e)=>{return Rc(t,Object.entries(e).reduce((i,[r,s])=>{if(Array.isArray(s))i[r]=s;else if(typeof s==="function")i[r]=[n,s()];else i[r]=[n,s];return i},{}))},yi=(t,n,e,i)=>{if(n!==null){let c=e[i];if(typeof c==="function")c=[,c];let[f=Dc,o=Ac,a=i]=c;if(typeof f==="function"&&f(n[a])||typeof f!=="function"&&!!f)t[i]=o(n[a]);return}let[r,s]=e[i];if(typeof s==="function"){let c,f=r===void 0&&(c=s())!=null,o=typeof r==="function"&&!!r(void 0)||typeof r!=="function"&&!!r;if(f)t[i]=c;else if(o)t[i]=s()}else{let c=r===void 0&&s!=null,f=typeof r==="function"&&!!r(s)||typeof r!=="function"&&!!r;if(c||f)t[i]=s}},Dc=(t)=>t!=null,Ac=(t)=>t;var Yc=A(j(),1);var $i=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((n)=>n!=null).map($i);if(typeof t==="object"){let n={};for(let e of Object.keys(t)){if(t[e]==null)continue;n[e]=$i(t[e])}return n}return t};var vh=(t)=>{let n=t.httpHandler;return{setHttpHandler(e){n=e},httpHandler(){return n},updateHttpClientConfig(e,i){n.updateHttpClientConfig(e,i)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},Ph=(t)=>{return{httpHandler:t.httpHandler()}};var Wc=A(J(),1);class Dt{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){let n=new Dt({...t,headers:{...t.headers}});if(n.query)n.query=Zc(n.query);return n}static isInstance(t){if(!t)return!1;let n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query==="object"&&typeof n.headers==="object"}clone(){return Dt.clone(this)}}function Zc(t){return Object.keys(t).reduce((n,e)=>{let i=t[e];return{...n,[e]:Array.isArray(i)?[...i]:i}},{})}class rt{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;let n=t;return typeof n.statusCode==="number"&&typeof n.headers==="object"}}var st=A(lt(),1);function At(t){let n=[];for(let e of Object.keys(t).sort()){let i=t[e];if(e=st.escapeUri(e),Array.isArray(i))for(let r=0,s=i.length;r<s;r++)n.push(`${e}=${st.escapeUri(i[r])}`);else{let r=e;if(i||typeof i==="string")r+=`=${st.escapeUri(i)}`;n.push(r)}}return n.join("&")}import{Agent as Si,request as Vc}from"http";import{Agent as Fi,request as Xc}from"https";var Ei=["ECONNRESET","EPIPE","ETIMEDOUT"];var Yt=(t)=>{let n={};for(let e of Object.keys(t)){let i=t[e];n[e]=Array.isArray(i)?i.join(","):i}return n};var xi=(t,n,e=0)=>{if(!e)return-1;let i=(r)=>{let s=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${e} ms`),{name:"TimeoutError"}))},e-r),c=(f)=>{if(f?.connecting)f.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)};if(t.socket)c(t.socket);else t.on("socket",c)};if(e<2000)return i(0),0;return setTimeout(i.bind(null,1000),1000)};var Ti=(t,{keepAlive:n,keepAliveMsecs:e},i=3000)=>{if(n!==!0)return-1;let r=()=>{if(t.socket)t.socket.setKeepAlive(n,e||0);else t.on("socket",(s)=>{s.setKeepAlive(n,e||0)})};if(i===0)return r(),0;return setTimeout(r,i)};var Ci=(t,n,e=0)=>{let i=(r)=>{t.setTimeout(e-r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${e} ms`),{name:"TimeoutError"}))})};if(0<e&&e<6000)return i(0),0;return setTimeout(i.bind(null,e===0?0:3000),3000)};import{Readable as Qc}from"stream";var gi=1000;async function Wt(t,n,e=gi){let i=n.headers??{},r=i.Expect||i.expect,s=-1,c=!1;if(r==="100-continue")await Promise.race([new Promise((f)=>{s=Number(setTimeout(f,Math.max(gi,e)))}),new Promise((f)=>{t.on("continue",()=>{clearTimeout(s),f()}),t.on("error",()=>{c=!0,clearTimeout(s),f()})})]);if(!c)Kc(t,n.body)}function Kc(t,n){if(n instanceof Qc){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}let e=n;if(typeof e==="object"&&e.buffer&&typeof e.byteOffset==="number"&&typeof e.byteLength==="number"){t.end(Buffer.from(e.buffer,e.byteOffset,e.byteLength));return}t.end(Buffer.from(n));return}t.end()}class Zt{static create(t){if(typeof t?.handle==="function")return t;return new Zt(t)}static checkSocketUsage(t,n,e=console){let{sockets:i,requests:r,maxSockets:s}=t;if(typeof s!=="number"||s===1/0)return n;let c=15000;if(Date.now()-c<n)return n;if(i&&r)for(let f in i){let o=i[f]?.length??0,a=r[f]?.length??0;if(o>=s&&a>=2*s)return e?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${o} and ${a} 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 n}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((n,e)=>{if(typeof t==="function")t().then((i)=>{n(this.resolveDefaultConfig(i))}).catch(e);else n(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){let{requestTimeout:n,connectionTimeout:e,socketTimeout:i,httpAgent:r,httpsAgent:s}=t||{},c=!0,f=50;return{connectionTimeout:e,requestTimeout:n??i,httpAgent:(()=>{if(r instanceof Si||typeof r?.destroy==="function")return r;return new Si({keepAlive:!0,maxSockets:50,...r})})(),httpsAgent:(()=>{if(s instanceof Fi||typeof s?.destroy==="function")return s;return new Fi({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:n}={}){if(!this.config)this.config=await this.configProvider;return new Promise((e,i)=>{let r=void 0,s=[],c=async(d)=>{await r,s.forEach(clearTimeout),e(d)},f=async(d)=>{await r,s.forEach(clearTimeout),i(d)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(n?.aborted){let d=new Error("Request aborted");d.name="AbortError",f(d);return}let o=t.protocol==="https:",a=o?this.config.httpsAgent:this.config.httpAgent;s.push(setTimeout(()=>{this.socketWarningTimestamp=Zt.checkSocketUsage(a,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let x=At(t.query||{}),h=void 0;if(t.username!=null||t.password!=null){let d=t.username??"",w=t.password??"";h=`${d}:${w}`}let u=t.path;if(x)u+=`?${x}`;if(t.fragment)u+=`#${t.fragment}`;let l=t.hostname??"";if(l[0]==="["&&l.endsWith("]"))l=t.hostname.slice(1,-1);else l=t.hostname;let E={headers:t.headers,host:l,method:t.method,path:u,port:t.port,agent:a,auth:h},y=(o?Xc:Vc)(E,(d)=>{let w=new rt({statusCode:d.statusCode||-1,reason:d.statusMessage,headers:Yt(d.headers),body:d});c({response:w})});if(y.on("error",(d)=>{if(Ei.includes(d.code))f(Object.assign(d,{name:"TimeoutError"}));else f(d)}),n){let d=()=>{y.destroy();let w=new Error("Request aborted");w.name="AbortError",f(w)};if(typeof n.addEventListener==="function"){let w=n;w.addEventListener("abort",d,{once:!0}),y.once("close",()=>w.removeEventListener("abort",d))}else n.onabort=d}s.push(xi(y,f,this.config.connectionTimeout)),s.push(Ci(y,f,this.config.requestTimeout));let $=E.agent;if(typeof $==="object"&&"keepAlive"in $)s.push(Ti(y,{keepAlive:$.keepAlive,keepAliveMsecs:$.keepAliveMsecs}));r=Wt(y,t,this.config.requestTimeout).catch((d)=>{return s.forEach(clearTimeout),i(d)})})}updateHttpClientConfig(t,n){this.config=void 0,this.configProvider=this.configProvider.then((e)=>{return{...e,[t]:n}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as Gc}from"stream";class Qt extends Gc{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,n,e){this.bufferedBytes.push(t),e()}}var Oo=(t)=>{if(jc(t))return Jc(t);return new Promise((n,e)=>{let i=new Qt;t.pipe(i),t.on("error",(r)=>{i.end(),e(r)}),i.on("error",e),i.on("finish",function(){let r=new Uint8Array(Buffer.concat(this.bufferedBytes));n(r)})})},jc=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;async function Jc(t){let n=[],e=t.getReader(),i=!1,r=0;while(!i){let{done:f,value:o}=await e.read();if(o)n.push(o),r+=o.length;i=f}let s=new Uint8Array(r),c=0;for(let f of n)s.set(f,c),c+=f.length;return s}export{vh as xa,Ph as ya,Dt as za,rt as Aa,P as Ba,Ht as Ca,V as Da,H as Ea,lt as Fa,ce as Ga,me as Ha,j as Ia,Ni as Ja,Gt as Ka,qc as La,tf as Ma,yc as Na,ei as Oa,Df as Pa,Af as Qa,Yf as Ra,Wf as Sa,Vf as Ta,Xf as Ua,Jt as Va,Bt as Wa,kf as Xa,Of as Ya,Pf as Za,Mc as _a,ih as $a,rh as ab,hh as bb,uh as cb,bc as db,Rc as eb,yh as fb,$i as gb,Zt as hb,Oo as ib};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{jb as $}from"./chunk-8gx9at51.js";import{sb as w,tb as z,ub as B}from"./chunk-cm7bwdk9.js";import{wb as X}from"./chunk-gg80s18j.js";import{xb as q}from"./chunk-d2dbhn2h.js";var x=q(X(),1);var J=q(X(),1),k="AWS_EC2_METADATA_DISABLED",Y=async(b)=>{let{ENV_CMDS_FULL_URI:j,ENV_CMDS_RELATIVE_URI:y,fromContainerMetadata:G,fromInstanceMetadata:K}=await import("./chunk-hzfqtj82.js");if(process.env[y]||process.env[j]){b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:Q}=await import("./chunk-jms0s1vh.js");return J.chain(Q(b),G(b))}if(process.env[k])return async()=>{throw new J.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:b.logger})};return b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),K(b)};var Z=!1,T=(b={})=>x.memoize(x.chain(async()=>{if(b.profile??process.env[$]){if(process.env[w]&&process.env[z]){if(!Z)(b.logger?.warn&&b.logger?.constructor?.name!=="NoOpLogger"?b.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
2
|
+
Multiple credential sources detected:
|
|
3
|
+
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
4
|
+
This SDK will proceed with the AWS_PROFILE value.
|
|
5
|
+
|
|
6
|
+
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
7
|
+
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
8
|
+
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
9
|
+
`),Z=!0}throw new x.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:b.logger,tryNextLink:!0})}return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),B(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:j,ssoAccountId:y,ssoRegion:G,ssoRoleName:K,ssoSession:Q}=b;if(!j&&!y&&!G&&!K&&!Q)throw new x.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:b.logger});let{fromSSO:H}=await import("./chunk-qzxab3cn.js");return H(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:j}=await import("./chunk-jbpgmjzs.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:j}=await import("./chunk-5ewcj9vd.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:j}=await import("./chunk-gezc36zy.js");return j(b)()},async()=>{return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Y(b))()},async()=>{throw new x.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:b.logger})}),O,v),v=(b)=>b?.expiration!==void 0,O=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{T as L};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A as f,B as j,C as I,D as J,G as g,H as p,J as a,K as m,a as M,b as N,c as O,d as Q,e as R,f as S,h as T,i as U,k as V,l as W,m as X,n as Y,o as Z,p as _,q as $,r as x,s as z,t as C,u as F,v as P,w as h,x as A,y as D,z as k}from"./chunk-
|
|
2
|
+
import{A as f,B as j,C as I,D as J,G as g,H as p,J as a,K as m,a as M,b as N,c as O,d as Q,e as R,f as S,h as T,i as U,k as V,l as W,m as X,n as Y,o as Z,p as _,q as $,r as x,s as z,t as C,u as F,v as P,w as h,x as A,y as D,z as k}from"./chunk-akkmfscs.js";import"./chunk-zanq4wm3.js";import"./chunk-qpdxnnf8.js";import"./chunk-a4g1e1n0.js";import"./chunk-y5vqt054.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import"./chunk-d2dbhn2h.js";import w from"process";import{runAction as n}from"@stacksjs/actions";import{cli as l,log as v}from"@stacksjs/cli";import{Action as i}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as c}from"@stacksjs/storage";import{ensureProjectIsInitialized as t}from"@stacksjs/utils";w.on("uncaughtException",(q)=>{v.debug("Buddy uncaughtException"),v.error(q),w.exit(1)});w.on("unhandledRejection",(q)=>{v.debug("Buddy unhandledRejection"),v.error(q),w.exit(1)});async function e(){let q=l("buddy");if(J(q),$(q),await t())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");let B=await n(i.KeyGenerate);if(B.isErr())v.error("Failed to set random application key.",B.error),w.exit()}M(q),N(q),O(q),Q(q),R(q),S(q),U(q),W(q),T(q),V(q),h(q),D(q),X(q),Y(q),Z(q),_(q),x(q),z(q),C(q),F(q),P(q),k(q),f(q),j(q),I(q),J(q),g(q),p(q),m(q),A(q),a(q),await o(q),q.help(),q.parse()}await e();async function o(q){let G=L.appPath("Commands"),B=c.readdirSync(G).filter((E)=>E.endsWith(".ts"));for(let E of B){let H=await import(`${G}/${E}`);if(typeof H.default==="function")H.default(q);else console.error(`Expected a default export function in ${E}, but got:`,H.default)}let K=await import(L.listenersPath("Console.ts"));if(typeof K.default==="function")K.default(q)}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,a as e,b as f,c as m,d as p,e as t,f as x,g as a,h as b,i as c,j as d,k as g,l as h,m as i,n as j,o as k,p as l,q as n,r as q,s,t as u,u as v,v as w,w as y,x as z,y as A,z as B}from"./chunk-
|
|
2
|
+
import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,K as M,a as e,b as f,c as m,d as p,e as t,f as x,g as a,h as b,i as c,j as d,k as g,l as h,m as i,n as j,o as k,p as l,q as n,r as q,s,t as u,u as v,v as w,w as y,x as z,y as A,z as B}from"./chunk-akkmfscs.js";import"./chunk-zanq4wm3.js";import"./chunk-qpdxnnf8.js";import"./chunk-a4g1e1n0.js";import"./chunk-y5vqt054.js";import"./chunk-8gx9at51.js";import"./chunk-6yazdvb4.js";import"./chunk-cm7bwdk9.js";import"./chunk-ha75r57f.js";import"./chunk-gg80s18j.js";import"./chunk-d2dbhn2h.js";export{M as version,L as upgrade,K as types,J as tinker,I as test,d as startDevelopmentServer,F as setup,E as seed,D as saas,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,G as optimizePkgxDeps,v as migrate,u as make,s as list,q as lint,n as key,l as install,k as http,j as generate,i as fresh,H as ensureEnvIsSet,h as domains,g as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
|
package/dist/stacks
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.68.
|
|
4
|
+
"version": "0.68.2",
|
|
5
5
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -72,52 +72,52 @@
|
|
|
72
72
|
"prepublishOnly": "bun run build"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@stacksjs/actions": "0.
|
|
76
|
-
"@stacksjs/ai": "0.
|
|
77
|
-
"@stacksjs/alias": "0.
|
|
78
|
-
"@stacksjs/arrays": "0.
|
|
79
|
-
"@stacksjs/auth": "0.
|
|
80
|
-
"@stacksjs/build": "0.
|
|
81
|
-
"@stacksjs/cache": "0.
|
|
82
|
-
"@stacksjs/cli": "0.
|
|
83
|
-
"@stacksjs/cloud": "0.
|
|
84
|
-
"@stacksjs/collections": "0.
|
|
85
|
-
"@stacksjs/config": "0.
|
|
86
|
-
"@stacksjs/database": "0.
|
|
87
|
-
"@stacksjs/desktop": "0.
|
|
88
|
-
"@stacksjs/development": "0.
|
|
89
|
-
"@stacksjs/dns": "0.
|
|
90
|
-
"@stacksjs/docs": "0.
|
|
91
|
-
"@stacksjs/email": "0.
|
|
92
|
-
"@stacksjs/enums": "0.
|
|
93
|
-
"@stacksjs/error-handling": "0.
|
|
94
|
-
"@stacksjs/events": "0.
|
|
95
|
-
"@stacksjs/faker": "0.
|
|
96
|
-
"@stacksjs/git": "0.
|
|
97
|
-
"@stacksjs/health": "0.
|
|
98
|
-
"@stacksjs/lint": "0.
|
|
99
|
-
"@stacksjs/logging": "0.
|
|
100
|
-
"@stacksjs/notifications": "0.
|
|
101
|
-
"@stacksjs/objects": "0.
|
|
102
|
-
"@stacksjs/orm": "0.
|
|
103
|
-
"@stacksjs/path": "0.
|
|
104
|
-
"@stacksjs/payments": "0.
|
|
105
|
-
"@stacksjs/realtime": "0.
|
|
106
|
-
"@stacksjs/router": "0.
|
|
107
|
-
"@stacksjs/search-engine": "0.
|
|
108
|
-
"@stacksjs/security": "0.
|
|
109
|
-
"@stacksjs/server": "0.
|
|
110
|
-
"@stacksjs/storage": "0.
|
|
111
|
-
"@stacksjs/strings": "0.
|
|
112
|
-
"@stacksjs/testing": "0.
|
|
113
|
-
"@stacksjs/tunnel": "0.
|
|
114
|
-
"@stacksjs/types": "0.
|
|
115
|
-
"@stacksjs/ui": "0.
|
|
116
|
-
"@stacksjs/utils": "0.
|
|
117
|
-
"@stacksjs/validation": "0.
|
|
75
|
+
"@stacksjs/actions": "0.68.1",
|
|
76
|
+
"@stacksjs/ai": "0.68.1",
|
|
77
|
+
"@stacksjs/alias": "0.68.1",
|
|
78
|
+
"@stacksjs/arrays": "0.68.1",
|
|
79
|
+
"@stacksjs/auth": "0.68.1",
|
|
80
|
+
"@stacksjs/build": "0.68.1",
|
|
81
|
+
"@stacksjs/cache": "0.68.1",
|
|
82
|
+
"@stacksjs/cli": "0.68.1",
|
|
83
|
+
"@stacksjs/cloud": "0.68.1",
|
|
84
|
+
"@stacksjs/collections": "0.68.1",
|
|
85
|
+
"@stacksjs/config": "0.68.1",
|
|
86
|
+
"@stacksjs/database": "0.68.1",
|
|
87
|
+
"@stacksjs/desktop": "0.68.1",
|
|
88
|
+
"@stacksjs/development": "0.68.1",
|
|
89
|
+
"@stacksjs/dns": "0.68.1",
|
|
90
|
+
"@stacksjs/docs": "0.68.1",
|
|
91
|
+
"@stacksjs/email": "0.68.1",
|
|
92
|
+
"@stacksjs/enums": "0.68.1",
|
|
93
|
+
"@stacksjs/error-handling": "0.68.1",
|
|
94
|
+
"@stacksjs/events": "0.68.1",
|
|
95
|
+
"@stacksjs/faker": "0.68.1",
|
|
96
|
+
"@stacksjs/git": "0.68.1",
|
|
97
|
+
"@stacksjs/health": "0.68.1",
|
|
98
|
+
"@stacksjs/lint": "0.68.1",
|
|
99
|
+
"@stacksjs/logging": "0.68.1",
|
|
100
|
+
"@stacksjs/notifications": "0.68.1",
|
|
101
|
+
"@stacksjs/objects": "0.68.1",
|
|
102
|
+
"@stacksjs/orm": "0.68.1",
|
|
103
|
+
"@stacksjs/path": "0.68.1",
|
|
104
|
+
"@stacksjs/payments": "0.68.1",
|
|
105
|
+
"@stacksjs/realtime": "0.68.1",
|
|
106
|
+
"@stacksjs/router": "0.68.1",
|
|
107
|
+
"@stacksjs/search-engine": "0.68.1",
|
|
108
|
+
"@stacksjs/security": "0.68.1",
|
|
109
|
+
"@stacksjs/server": "0.68.1",
|
|
110
|
+
"@stacksjs/storage": "0.68.1",
|
|
111
|
+
"@stacksjs/strings": "0.68.1",
|
|
112
|
+
"@stacksjs/testing": "0.68.1",
|
|
113
|
+
"@stacksjs/tunnel": "0.68.1",
|
|
114
|
+
"@stacksjs/types": "0.68.1",
|
|
115
|
+
"@stacksjs/ui": "0.68.1",
|
|
116
|
+
"@stacksjs/utils": "0.68.1",
|
|
117
|
+
"@stacksjs/validation": "0.68.1"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@stacksjs/development": "0.
|
|
120
|
+
"@stacksjs/development": "0.68.1"
|
|
121
121
|
},
|
|
122
122
|
"config": {
|
|
123
123
|
"commitizen": {
|