gemi 0.4.37 → 0.4.38

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.
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{x as c} from"./chunk-a5c18c07abe8fd9c.js";import{A as _e,D as ee,F as Ae,J as se,K as te,M as re,N as ae,Q as ie,R as le,X as ts,Y as k,ba as z,ca as Ve,da as h,ka as He,la as u,ma as Ne,na as pe,oa as ye,pa as $e,qa as Pe,sa as i,ta as y,va as fe,z as Fe} from"./chunk-3a9fcddbd219223b.js";import{$a as Te,Aa as We,Ea as B,Fa as _,Ga as $,Ha as Ke,Ia as V,Ja as N,Ka as f,La as Qe,Ma as me,Na as he,Oa as ue,Pa as we,Qa as Xe,Ra as Ye,Ta as rs,Ua as as,Va as Ze,Wa as be,Ya as xe,Za as je,_a as ve,bb as x,cb as ke,db as Re,eb as qe,fb as Ee,gb as Je,hb as Ue,xa as Le,ya as Ce,za as Me} from"./chunk-5190b38f06507ee1.js";import"./chunk-442a5b1ec74c72f8.js";import{jb as ps,kb as l} from"./chunk-ab79a2f0d89fbeae.js";import"./chunk-2672477bf396bad8.js";import"./chunk-73c97da8ac4f1d30.js";var p=c(B(),1);var P=c(x(),1);var cs=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}},b=function(e){return{schemeId:"smithy.api#noAuth"}},J=async(e,s,t)=>{return{operation:_(s).operation,region:await $(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},U=(e)=>{const s=[];switch(e.operation){case"GetRoleCredentials":{s.push(b(e));break}case"ListAccountRoles":{s.push(b(e));break}case"ListAccounts":{s.push(b(e));break}case"Logout":{s.push(b(e));break}default:s.push(cs(e))}return s},I=(e)=>{return{...P.resolveAwsSdkSigV4Config(e)}};var L=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},C={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var M={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.629.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@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.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@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-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var Se=c(x(),1);var ne=c(x(),1),de=c(B(),1);var oe=c(ps(),1);var W={["required"]:!1,type:"String"},A={["required"]:!0,default:!1,type:"Boolean"},K={["ref"]:"Endpoint"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},H={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},Q={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},O={["ref"]:"PartitionResult"},X={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[O,"supportsDualStack"]}]},Y=[T],Z=[H],j=[{["ref"]:"Region"}],ls={version:"1.0",parameters:{Region:W,UseDualStack:A,UseFIPS:A,Endpoint:W},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[K]}],rules:[{conditions:Y,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:K,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:j}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:j,assign:"PartitionResult"}],rules:[{conditions:[T,H],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Q]},X],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Y,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Q,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[O,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:d,headers:d},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:Z,rules:[{conditions:[X],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},G=ls;var g=(e,s={})=>{return N(G,{endpointParams:e,logger:s.logger})};V.aws=f;var ce=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??se,base64Encoder:e?.base64Encoder??ae,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??g,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??U,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new ne.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new de.NoAuthSigner}],logger:e?.logger??new ee,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??oe.parseUrl,utf8Decoder:e?.utf8Decoder??te,utf8Encoder:e?.utf8Encoder??re}};var ze=(e)=>{ye(process.version);const s=Ee(e),t=()=>s().then(pe),r=ce(e);return Se.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??qe,defaultUserAgentProvider:e?.defaultUserAgentProvider??ke({serviceId:r.serviceId,clientVersion:M.version}),maxAttempts:e?.maxAttempts??l(xe),region:e?.region??l(ue,we),requestHandler:ie.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...ve,default:async()=>(await t()).retryMode||be}),sha256:e?.sha256??Re.bind(null,"sha256"),streamCollector:e?.streamCollector??le,useDualstackEndpoint:e?.useDualstackEndpoint??l(me),useFipsEndpoint:e?.useFipsEndpoint??l(he)}};var De=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((D)=>D.schemeId===a.schemeId);if(n===-1)s.push(a);else s.splice(n,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){t=a},httpAuthSchemeProvider(){return t},setCredentials(a){r=a},credentials(){return r}}},Be=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var v=(e)=>e,Ie=(e,s)=>{const t={...v(Je(e)),...v($e(e)),...v(Fe(e)),...v(De(e))};return s.forEach((r)=>r.configure(t)),{...e,...Ue(t),...Pe(t),..._e(t),...Be(t)}};class ys extends Ae{constructor(...[e]){const s=ze(e||{}),t=L(s),r=Ke(t),a=je(r),n=Xe(a),D=Le(n),ns=Ze(D),ds=I(ns),F=Ie(ds,e?.extensions||[]);super(F);this.config=F,this.middlewareStack.use(Qe(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Ye(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:async(os)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":os.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class o extends He{constructor(e){super(e);Object.setPrototypeOf(this,o.prototype)}}class R extends o{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,R.prototype)}}class q extends o{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class E extends o{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class S extends o{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}var Oe=(e)=>({...e,...e.accessToken&&{accessToken:k}}),ms=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:k},...e.sessionToken&&{sessionToken:k}}),Ge=(e)=>({...e,...e.roleCredentials&&{roleCredentials:ms(e.roleCredentials)}});var m=c(x(),1),ge=c(B(),1);var es=async(e,s)=>{const t=ge.requestBuilder(e,s),r=i({},ks,{[Ds]:e[qs]});t.bp("/federation/credentials");const a=i({[zs]:[,z(e[Ss],"roleName")],[Es]:[,z(e[Rs],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var ss=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return hs(e,s);const t=i({$metadata:w(e)}),r=z(Ve(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:fe});return Object.assign(t,a),t};var hs=async(e,s)=>{const t={...e,body:await m.parseJsonErrorBody(e.body,s)},r=m.loadRestJsonErrorCode(e,t.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await ws(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await bs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await xs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await vs(t,s);default:const a=t.body;return us({output:e,parsedBody:a,errorCode:r})}},us=Ne(o),ws=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new R({$metadata:w(e),...t});return u(n,e.body)},bs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new q({$metadata:w(e),...t});return u(n,e.body)},xs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new E({$metadata:w(e),...t});return u(n,e.body)},vs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new S({$metadata:w(e),...t});return u(n,e.body)},w=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var ks=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Rs="accountId",qs="accessToken",Es="account_id";var Ss="roleName",zs="role_name",Ds="x-amz-sso_bearer_token";class Bs extends ts.classBuilder().ep({...C}).m(function(e,s,t,r){return[rs(t,this.serialize,this.deserialize),as(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(Oe,Ge).ser(es).de(ss).build(){}export{ys as SSOClient,Bs as GetRoleCredentialsCommand};
@@ -0,0 +1,2 @@
1
+ import{y as D} from"./chunk-a5c18c07abe8fd9c.js";var C=D((h,A)=>{var{defineProperty:Q,getOwnPropertyDescriptor:M,getOwnPropertyNames:J}=Object,V=Object.prototype.hasOwnProperty,I=(j,b)=>Q(j,"name",{value:b,configurable:!0}),w=(j,b)=>{for(var F in b)Q(j,F,{get:b[F],enumerable:!0})},O=(j,b,F,B)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let G of J(b))if(!V.call(j,G)&&G!==F)Q(j,G,{get:()=>b[G],enumerable:!(B=M(b,G))||B.enumerable})}return j},q=(j)=>O(Q({},"__esModule",{value:!0}),j),Y={};w(Y,{CredentialsProviderError:()=>L,ProviderError:()=>U,TokenProviderError:()=>S,chain:()=>T,fromStatic:()=>N,memoize:()=>R});A.exports=q(Y);var Z=class j extends Error{constructor(b,F=!0){var B;let G,H=!0;if(typeof F==="boolean")G=void 0,H=F;else if(F!=null&&typeof F==="object")G=F.logger,H=F.tryNextLink??!0;super(b);this.name="ProviderError",this.tryNextLink=H,Object.setPrototypeOf(this,j.prototype),(B=G==null?void 0:G.debug)==null||B.call(G,`@smithy/property-provider ${H?"->":"(!)"} ${b}`)}static from(b,F=!0){return Object.assign(new this(b.message,F),b)}};I(Z,"ProviderError");var U=Z,$=class j extends U{constructor(b,F=!0){super(b,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,j.prototype)}};I($,"CredentialsProviderError");var L=$,z=class j extends U{constructor(b,F=!0){super(b,F);this.name="TokenProviderError",Object.setPrototypeOf(this,j.prototype)}};I(z,"TokenProviderError");var S=z,T=I((...j)=>async()=>{if(j.length===0)throw new U("No providers in chain");let b;for(let F of j)try{return await F()}catch(B){if(b=B,B==null?void 0:B.tryNextLink)continue;throw B}throw b},"chain"),N=I((j)=>()=>Promise.resolve(j),"fromStatic"),R=I((j,b,F)=>{let B,G,H,W=!1;const X=I(async()=>{if(!G)G=j();try{B=await G,H=!0,W=!1}finally{G=void 0}return B},"coalesceProvider");if(b===void 0)return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();return B};return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();if(W)return B;if(F&&!F(B))return W=!0,B;if(b(B))return await X(),B;return B}},"memoize")});
2
+ export{C as lb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{x as h} from"./chunk-a5c18c07abe8fd9c.js";import"./chunk-442a5b1ec74c72f8.js";import{lb as _} from"./chunk-2672477bf396bad8.js";import{ob as N,pb as W,qb as I,tb as v,ub as P} from"./chunk-73c97da8ac4f1d30.js";var T=h(_(),1);var H=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var u=h(_(),1);var K=300000,g="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var R={},b=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-5c2a5156f6bef0f5.js");if(R[e])return R[e];const s=new r({region:e});return R[e]=s,s};var G=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-5c2a5156f6bef0f5.js");return(await b(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var U=h(_(),1);var D=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new U.TokenProviderError(`Token is expired. ${g}`,!1)};var q=h(_(),1);var p=(e,r,s=!1)=>{if(typeof r==="undefined")throw new q.TokenProviderError(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${g}`,!1)};import{promises as B} from"fs";var{writeFile:Q}=B,j=(e,r)=>{const s=W(e),t=JSON.stringify(r,null,2);return Q(s,t)};var X=new Date(0),z=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await P(e),s=N(e),t=r[s];if(!t)throw new u.TokenProviderError(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new u.TokenProviderError(`Profile '${s}' is missing required property 'sso_session'.`);const i=t.sso_session,a=(await v(e))[i];if(!a)throw new u.TokenProviderError(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!a[n])throw new u.TokenProviderError(`Sso session '${i}' is missing required property '${n}'.`,!1);const{sso_start_url:l,sso_region:f}=a;let o;try{o=await I(i)}catch(n){throw new u.TokenProviderError(`The SSO session token associated with profile=${s} was not found or is invalid. ${g}`,!1)}p("accessToken",o.accessToken),p("expiresAt",o.expiresAt);const{accessToken:E,expiresAt:x}=o,c={token:E,expiration:new Date(x)};if(c.expiration.getTime()-Date.now()>K)return c;if(Date.now()-X.getTime()<30000)return D(c),c;p("clientId",o.clientId,!0),p("clientSecret",o.clientSecret,!0),p("refreshToken",o.refreshToken,!0);try{X.setTime(Date.now());const n=await G(o,f);p("accessToken",n.accessToken),p("expiresIn",n.expiresIn);const w=new Date(Date.now()+n.expiresIn*1000);try{await j(i,{...o,accessToken:n.accessToken,expiresAt:w.toISOString(),refreshToken:n.refreshToken})}catch(C){}return{token:n.accessToken,expiration:w}}catch(n){return D(c),c}};var k=h(_(),1);var y=!1,A=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:S,clientConfig:a,profile:l,logger:f})=>{let o;const E="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const d=await z({profile:l})();o={accessToken:d.token,expiresAt:new Date(d.expiration).toISOString()}}catch(d){throw new k.CredentialsProviderError(d.message,{tryNextLink:y,logger:f})}else try{o=await I(e)}catch(d){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:f})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:f});const{accessToken:x}=o,{SSOClient:c,GetRoleCredentialsCommand:n}=await import("./chunk-00f16704831dd8b0.js"),w=S||new c(Object.assign({},a??{},{region:a?.region??t}));let C;try{C=await w.send(new n({accountId:s,roleName:i,accessToken:x}))}catch(d){throw new k.CredentialsProviderError(d,{tryNextLink:y,logger:f})}const{roleCredentials:{accessKeyId:m,secretAccessKey:O,sessionToken:$,expiration:F,credentialScope:L,accountId:M}={}}=C;if(!m||!O||!$||!F)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:y,logger:f});return{accessKeyId:m,secretAccessKey:O,sessionToken:$,expiration:new Date(F),...L&&{credentialScope:L},...M&&{accountId:M}}};var J=h(_(),1),V=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:i,sso_role_name:S}=e;if(!s||!t||!i||!S)throw new J.CredentialsProviderError('Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", '+`"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:r});return e};var Ee=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoSession:S}=e,{ssoClient:a}=e,l=N(e);if(!r&&!s&&!t&&!i&&!S){const o=(await P(e))[l];if(!o)throw new T.CredentialsProviderError(`Profile ${l} was not found.`,{logger:e.logger});if(!H(o))throw new T.CredentialsProviderError(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const m=(await v(e))[o.sso_session],O=` configurations in profile ${l} and sso-session ${o.sso_session}`;if(t&&t!==m.sso_region)throw new T.CredentialsProviderError("Conflicting SSO region"+O,{tryNextLink:!1,logger:e.logger});if(r&&r!==m.sso_start_url)throw new T.CredentialsProviderError("Conflicting SSO start_url"+O,{tryNextLink:!1,logger:e.logger});o.sso_region=m.sso_region,o.sso_start_url=m.sso_start_url}const{sso_start_url:E,sso_account_id:x,sso_region:c,sso_role_name:n,sso_session:w}=V(o,e.logger);return A({ssoStartUrl:E,ssoSession:w,ssoAccountId:x,ssoRegion:c,ssoRoleName:n,ssoClient:a,clientConfig:e.clientConfig,profile:l})}else if(!r||!s||!t||!i)throw new T.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return A({ssoStartUrl:r,ssoSession:S,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:a,clientConfig:e.clientConfig,profile:l})};export{V as validateSsoProfile,H as isSsoProfile,Ee as fromSSO};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{x as l} from"./chunk-a5c18c07abe8fd9c.js";import{lb as m} from"./chunk-2672477bf396bad8.js";var E=l(m(),1);import{readFileSync as S} from"fs";var t=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:c,policyArns:i,policy:_,durationSeconds:N}=e;let{roleAssumerWithWebIdentity:s}=e;if(!s){const{getDefaultRoleAssumerWithWebIdentity:d}=await import("./chunk-648dff766091372e.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var p="AWS_WEB_IDENTITY_TOKEN_FILE",f="AWS_ROLE_ARN",T="AWS_ROLE_SESSION_NAME",I=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[p],r=e?.roleArn??process.env[f],n=e?.roleSessionName??process.env[T];if(!o||!r)throw new E.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:S(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,I as fromTokenFile};
@@ -0,0 +1,3 @@
1
+ import{x as $,y as B} from"./chunk-a5c18c07abe8fd9c.js";import{ib as X} from"./chunk-442a5b1ec74c72f8.js";var K=B((Br,gt)=>{var{defineProperty:H,getOwnPropertyDescriptor:be,getOwnPropertyNames:Te}=Object,Se=Object.prototype.hasOwnProperty,b=(t,e)=>H(t,"name",{value:e,configurable:!0}),Ce=(t,e)=>{for(var r in e)H(t,r,{get:e[r],enumerable:!0})},Ee=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Te(e))if(!Se.call(t,o)&&o!==r)H(t,o,{get:()=>e[o],enumerable:!(n=be(e,o))||n.enumerable})}return t},$e=(t)=>Ee(H({},"__esModule",{value:!0}),t),mt={};Ce(mt,{constructStack:()=>G});gt.exports=$e(mt);var A=b((t,e)=>{const r=[];if(t)r.push(t);if(e)for(let n of e)r.push(n);return r},"getAllAliases"),E=b((t,e)=>{return`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`},"getMiddlewareNameWithAliases"),G=b(()=>{let t=[],e=[],r=!1;const n=new Set,o=b((f)=>f.sort((p,u)=>dt[u.step]-dt[p.step]||lt[u.priority||"normal"]-lt[p.priority||"normal"]),"sort"),s=b((f)=>{let p=!1;const u=b((y)=>{const g=A(y.name,y.aliases);if(g.includes(f)){p=!0;for(let l of g)n.delete(l);return!1}return!0},"filterCb");return t=t.filter(u),e=e.filter(u),p},"removeByName"),c=b((f)=>{let p=!1;const u=b((y)=>{if(y.middleware===f){p=!0;for(let g of A(y.name,y.aliases))n.delete(g);return!1}return!0},"filterCb");return t=t.filter(u),e=e.filter(u),p},"removeByReference"),i=b((f)=>{var p;return t.forEach((u)=>{f.add(u.middleware,{...u})}),e.forEach((u)=>{f.addRelativeTo(u.middleware,{...u})}),(p=f.identifyOnResolve)==null||p.call(f,w.identifyOnResolve()),f},"cloneTo"),a=b((f)=>{const p=[];return f.before.forEach((u)=>{if(u.before.length===0&&u.after.length===0)p.push(u);else p.push(...a(u))}),p.push(f),f.after.reverse().forEach((u)=>{if(u.before.length===0&&u.after.length===0)p.push(u);else p.push(...a(u))}),p},"expandRelativeMiddlewareList"),d=b((f=!1)=>{const p=[],u=[],y={};return t.forEach((l)=>{const h={...l,before:[],after:[]};for(let m of A(h.name,h.aliases))y[m]=h;p.push(h)}),e.forEach((l)=>{const h={...l,before:[],after:[]};for(let m of A(h.name,h.aliases))y[m]=h;u.push(h)}),u.forEach((l)=>{if(l.toMiddleware){const h=y[l.toMiddleware];if(h===void 0){if(f)return;throw new Error(`${l.toMiddleware} is not found when adding ${E(l.name,l.aliases)} middleware ${l.relation} ${l.toMiddleware}`)}if(l.relation==="after")h.after.push(l);if(l.relation==="before")h.before.push(l)}}),o(p).map(a).reduce((l,h)=>{return l.push(...h),l},[])},"getMiddlewareList"),w={add:(f,p={})=>{const{name:u,override:y,aliases:g}=p,l={step:"initialize",priority:"normal",middleware:f,...p},h=A(u,g);if(h.length>0){if(h.some((m)=>n.has(m))){if(!y)throw new Error(`Duplicate middleware name '${E(u,g)}'`);for(let m of h){const S=t.findIndex((P)=>{var D;return P.name===m||((D=P.aliases)==null?void 0:D.some((Q)=>Q===m))});if(S===-1)continue;const x=t[S];if(x.step!==l.step||l.priority!==x.priority)throw new Error(`"${E(x.name,x.aliases)}" middleware with ${x.priority} priority in ${x.step} step cannot be overridden by "${E(u,g)}" middleware with ${l.priority} priority in ${l.step} step.`);t.splice(S,1)}}for(let m of h)n.add(m)}t.push(l)},addRelativeTo:(f,p)=>{const{name:u,override:y,aliases:g}=p,l={middleware:f,...p},h=A(u,g);if(h.length>0){if(h.some((m)=>n.has(m))){if(!y)throw new Error(`Duplicate middleware name '${E(u,g)}'`);for(let m of h){const S=e.findIndex((P)=>{var D;return P.name===m||((D=P.aliases)==null?void 0:D.some((Q)=>Q===m))});if(S===-1)continue;const x=e[S];if(x.toMiddleware!==l.toMiddleware||x.relation!==l.relation)throw new Error(`"${E(x.name,x.aliases)}" middleware ${x.relation} "${x.toMiddleware}" middleware cannot be overridden by "${E(u,g)}" middleware ${l.relation} "${l.toMiddleware}" middleware.`);e.splice(S,1)}}for(let m of h)n.add(m)}e.push(l)},clone:()=>i(G()),use:(f)=>{f.applyToStack(w)},remove:(f)=>{if(typeof f==="string")return s(f);else return c(f)},removeByTag:(f)=>{let p=!1;const u=b((y)=>{const{tags:g,name:l,aliases:h}=y;if(g&&g.includes(f)){const m=A(l,h);for(let S of m)n.delete(S);return p=!0,!1}return!0},"filterCb");return t=t.filter(u),e=e.filter(u),p},concat:(f)=>{var p;const u=i(G());return u.use(f),u.identifyOnResolve(r||u.identifyOnResolve()||(((p=f.identifyOnResolve)==null?void 0:p.call(f))??!1)),u},applyToStack:i,identify:()=>{return d(!0).map((f)=>{const p=f.step??f.relation+" "+f.toMiddleware;return E(f.name,f.aliases)+" - "+p})},identifyOnResolve(f){if(typeof f==="boolean")r=f;return r},resolve:(f,p)=>{for(let u of d().map((y)=>y.middleware).reverse())f=u(f,p);if(r)console.log(w.identify());return f}};return w},"constructStack"),dt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},lt={high:3,normal:2,low:1}});var $t=B((cn,Et)=>{var{defineProperty:q,getOwnPropertyDescriptor:Fe,getOwnPropertyNames:Ne}=Object,ke=Object.prototype.hasOwnProperty,_=(t,e)=>q(t,"name",{value:e,configurable:!0}),Pe=(t,e)=>{for(var r in e)q(t,r,{get:e[r],enumerable:!0})},De=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Ne(e))if(!ke.call(t,o)&&o!==r)q(t,o,{get:()=>e[o],enumerable:!(n=Fe(e,o))||n.enumerable})}return t},Le=(t)=>De(q({},"__esModule",{value:!0}),t),St={};Pe(St,{escapeUri:()=>Ct,escapeUriPath:()=>Re});Et.exports=Le(St);var Ct=_((t)=>encodeURIComponent(t).replace(/[!'()*]/g,Me),"escapeUri"),Me=_((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Re=_((t)=>t.split("/").map(Ct).join("/"),"escapeUriPath")});var Ht=B((vn,Bt)=>{var{defineProperty:O,getOwnPropertyDescriptor:Je,getOwnPropertyNames:Ve}=Object,Ze=Object.prototype.hasOwnProperty,Qe=(t,e)=>O(t,"name",{value:e,configurable:!0}),Ge=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},Ke=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Ve(e))if(!Ze.call(t,o)&&o!==r)O(t,o,{get:()=>e[o],enumerable:!(n=Je(e,o))||n.enumerable})}return t},Xe=(t)=>Ke(O({},"__esModule",{value:!0}),t),Rt={};Ge(Rt,{isArrayBuffer:()=>ve});Bt.exports=Xe(Rt);var ve=Qe((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var Gt=B((Yo,Qt)=>{var Vt=function(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const n=t.slice(r,r+2).toLowerCase();if(n in st)e[r/2]=st[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e},Zt=function(t){let e="";for(let r=0;r<t.byteLength;r++)e+=Jt[t[r]];return e},Z=Object.defineProperty,or=Object.getOwnPropertyDescriptor,sr=Object.getOwnPropertyNames,ir=Object.prototype.hasOwnProperty,Wt=(t,e)=>Z(t,"name",{value:e,configurable:!0}),cr=(t,e)=>{for(var r in e)Z(t,r,{get:e[r],enumerable:!0})},fr=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of sr(e))if(!ir.call(t,o)&&o!==r)Z(t,o,{get:()=>e[o],enumerable:!(n=or(e,o))||n.enumerable})}return t},ur=(t)=>fr(Z({},"__esModule",{value:!0}),t),zt={};cr(zt,{fromHex:()=>Vt,toHex:()=>Zt});Qt.exports=ur(zt);var Jt={},st={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();if(e.length===1)e=`0${e}`;Jt[t]=e,st[e]=t}Wt(Vt,"fromHex");Wt(Zt,"toHex")});var yt=$(K(),1);class Ae{constructor(t){this.middlewareStack=yt.constructStack(),this.config=t}send(t,e,r){const n=typeof e!=="function"?e:void 0,o=typeof e==="function"?e:r,s=t.resolveMiddleware(this.middlewareStack,this.config,n);if(o)s(t).then((c)=>o(null,c.output),(c)=>o(c)).catch(()=>{});else return s(t).then((c)=>c.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var wt=$(K(),1),xt=$(X(),1);class bt{constructor(){this.middlewareStack=wt.constructStack()}static classBuilder(){return new Tt}resolveMiddlewareWithContext(t,e,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,smithyContext:a,additionalContext:d,CommandCtor:w}){for(let g of n.bind(this)(w,t,e,r))this.middlewareStack.use(g);const f=t.concat(this.middlewareStack),{logger:p}=e,u={logger:p,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,[xt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...a},...d},{requestHandler:y}=e;return f.resolve((g)=>y.handle(g.request,r||{}),u)}}class Tt{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,e,r={}){return this._smithyContext={service:t,operation:e,...r},this}c(t={}){return this._additionalContext=t,this}n(t,e){return this._clientName=t,this._commandName=e,this}f(t=(r)=>r,e=(r)=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=e,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){const t=this;let e;return e=class extends bt{static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=r??{},t._init(this)}resolveMiddleware(r,n,o){return this.resolveMiddlewareWithContext(r,n,o,{CommandCtor:e,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var Yr=(t)=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},Or=(t)=>{return{httpHandler:t.httpHandler()}};var Ie=$(X(),1);var Ue=function(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})};class v{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){const e=new v({...t,headers:{...t.headers}});if(e.query)e.query=Ue(e.query);return e}static isInstance(t){if(!t)return!1;const e=t;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return v.clone(this)}}class L{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;const e=t;return typeof e.statusCode==="number"&&typeof e.headers==="object"}}var j=$($t(),1);function Y(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=j.escapeUri(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)e.push(`${r}=${j.escapeUri(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${j.escapeUri(n)}`;e.push(o)}}return e.join("&")}import{Agent as kt,request as qe} from"http";import{Agent as Pt,request as je} from"https";var At=["ECONNRESET","EPIPE","ETIMEDOUT"];var tt=(t)=>{const e={};for(let r of Object.keys(t)){const n=t[r];e[r]=Array.isArray(n)?n.join(","):n}return e};var It=(t,e,r=0)=>{if(!r)return;const n=setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r);t.on("socket",(o)=>{if(o.connecting)o.on("connect",()=>{clearTimeout(n)});else clearTimeout(n)})};var Ut=(t,{keepAlive:e,keepAliveMsecs:r})=>{if(e!==!0)return;t.on("socket",(n)=>{n.setKeepAlive(e,r||0)})};var Ft=(t,e,r=0)=>{t.setTimeout(r,()=>{t.destroy(),e(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};import{Readable as Be} from"stream";async function et(t,e,r=Nt){const n=e.headers??{},o=n.Expect||n.expect;let s=-1,c=!1;if(o==="100-continue")await Promise.race([new Promise((i)=>{s=Number(setTimeout(i,Math.max(Nt,r)))}),new Promise((i)=>{t.on("continue",()=>{clearTimeout(s),i()}),t.on("error",()=>{c=!0,clearTimeout(s),i()})})]);if(!c)He(t,e.body)}var He=function(t,e){if(e instanceof Be){e.pipe(t);return}if(e){if(Buffer.isBuffer(e)||typeof e==="string"){t.end(e);return}const r=e;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){t.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}t.end(Buffer.from(e));return}t.end()},Nt=1000;class rt{static create(t){if(typeof t?.handle==="function")return t;return new rt(t)}static checkSocketUsage(t,e,r=console){const{sockets:n,requests:o,maxSockets:s}=t;if(typeof s!=="number"||s===Infinity)return e;const c=15000;if(Date.now()-c<e)return e;if(n&&o)for(let i in n){const a=n[i]?.length??0,d=o[i]?.length??0;if(a>=s&&d>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${a} and ${d} 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}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,r)=>{if(typeof t==="function")t().then((n)=>{e(this.resolveDefaultConfig(n))}).catch(r);else e(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){const{requestTimeout:e,connectionTimeout:r,socketTimeout:n,httpAgent:o,httpsAgent:s}=t||{};return{connectionTimeout:r,requestTimeout:e??n,httpAgent:(()=>{if(o instanceof kt||typeof o?.destroy==="function")return o;return new kt({keepAlive:!0,maxSockets:50,...o})})(),httpsAgent:(()=>{if(s instanceof Pt||typeof s?.destroy==="function")return s;return new Pt({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;let r;return new Promise((n,o)=>{let s=void 0;const c=async(h)=>{await s,clearTimeout(r),n(h)},i=async(h)=>{await s,clearTimeout(r),o(h)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e?.aborted){const h=new Error("Request aborted");h.name="AbortError",i(h);return}const a=t.protocol==="https:",d=a?this.config.httpsAgent:this.config.httpAgent;r=setTimeout(()=>{this.socketWarningTimestamp=rt.checkSocketUsage(d,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const w=Y(t.query||{});let f=void 0;if(t.username!=null||t.password!=null){const h=t.username??"",m=t.password??"";f=`${h}:${m}`}let p=t.path;if(w)p+=`?${w}`;if(t.fragment)p+=`#${t.fragment}`;const u={headers:t.headers,host:t.hostname,method:t.method,path:p,port:t.port,agent:d,auth:f},g=(a?je:qe)(u,(h)=>{const m=new L({statusCode:h.statusCode||-1,reason:h.statusMessage,headers:tt(h.headers),body:h});c({response:m})});if(g.on("error",(h)=>{if(At.includes(h.code))i(Object.assign(h,{name:"TimeoutError"}));else i(h)}),It(g,i,this.config.connectionTimeout),Ft(g,i,this.config.requestTimeout),e){const h=()=>{g.destroy();const m=new Error("Request aborted");m.name="AbortError",i(m)};if(typeof e.addEventListener==="function"){const m=e;m.addEventListener("abort",h,{once:!0}),g.once("close",()=>m.removeEventListener("abort",h))}else e.onabort=h}const l=u.agent;if(typeof l==="object"&&"keepAlive"in l)Ut(g,{keepAlive:l.keepAlive,keepAliveMsecs:l.keepAliveMsecs});s=et(g,t,this.config.requestTimeout).catch((h)=>{return clearTimeout(r),o(h)})})}updateHttpClientConfig(t,e){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[t]:e}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as Ye} from"stream";class nt extends Ye{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,e,r){this.bufferedBytes.push(t),r()}}async function We(t){const e=[],r=t.getReader();let n=!1,o=0;while(!n){const{done:i,value:a}=await r.read();if(a)e.push(a),o+=a.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of e)s.set(i,c),c+=i.length;return s}var Dt=(t)=>{if(Oe(t))return We(t);return new Promise((e,r)=>{const n=new nt;t.pipe(n),t.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){const o=new Uint8Array(Buffer.concat(this.bufferedBytes));e(o)})})},Oe=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;var Vn="***SensitiveInformation***";var Qn=(t,e)=>{for(let r of Object.keys(t)){const n=t[r],o=async function(c,i,a){const d=new n(c);if(typeof i==="function")this.send(d,i);else if(typeof a==="function"){if(typeof i!=="object")throw new Error(`Expected http options but got ${typeof i}`);this.send(d,i||{},a)}else return this.send(d,i)},s=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");e.prototype[s]=o}};class Lt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,Lt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Mt=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,o])=>{if(t[n]==null||t[n]==="")t[n]=o});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t};class ze{trace(){}debug(){}info(){}warn(){}error(){}}var qt=$(Ht(),1);import{Buffer as ot} from"buffer";var U=(t,e=0,r=t.byteLength-e)=>{if(!qt.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ot.from(t,e,r)},W=(t,e)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?ot.from(t,e):ot.from(t)};var _e=/^[A-Za-z0-9+/]*={0,2}$/,z=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!_e.exec(t))throw new TypeError("Invalid base64 string.");const e=W(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};var F=(t)=>{const e=W(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var io=(t)=>{if(typeof t==="string")return F(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};var J=(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 U(t.buffer,t.byteOffset,t.byteLength).toString("utf8")};var V=(t)=>{let e;if(typeof t==="string")e=F(t);else e=t;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return U(e.buffer,e.byteOffset,e.byteLength).toString("base64")};function jt(t,e="utf-8"){if(e==="base64")return V(t);return J(t)}function Yt(t,e){if(e==="base64")return C.mutate(z(t));return C.mutate(F(t))}class C extends Uint8Array{static fromString(t,e="utf-8"){switch(typeof t){case"string":return Yt(t,e);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,C.prototype),t}transformToString(t="utf-8"){return jt(this,t)}}import{Readable as tr} from"stream";var Uo=(t,e)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:o,checksumLocationName:s,streamHasher:c}=e,i=r!==void 0&&o!==void 0&&s!==void 0&&c!==void 0,a=i?c(o,t):void 0,d=new tr({read:()=>{}});return t.on("data",(w)=>{const f=n(w)||0;d.push(`${f.toString(16)}\r\n`),d.push(w),d.push("\r\n")}),t.on("end",async()=>{if(d.push("0\r\n"),i){const w=r(await a);d.push(`${s}:${w}\r\n`),d.push("\r\n")}d.push(null)}),d};import{Readable as it} from"stream";import{TextDecoder as hr} from"util";async function er(t){const e=await nr(t),r=z(e);return new Uint8Array(r)}async function rr(t){const e=[],r=t.getReader();let n=!1,o=0;while(!n){const{done:i,value:a}=await r.read();if(a)e.push(a),o+=a.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of e)s.set(i,c),c+=i.length;return s}var nr=function(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",s=o.indexOf(","),c=s>-1?s+1:o.length;e(o.substring(c))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})},Ot=(t)=>{if(typeof Blob==="function"&&t instanceof Blob)return er(t);return rr(t)};var vt=$(Gt(),1);var I=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream);var Kt="The stream has already been transformed.",_t=(t)=>{if(!Xt(t)&&!I(t)){const o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let e=!1;const r=async()=>{if(e)throw new Error(Kt);return e=!0,await Ot(t)},n=(o)=>{if(typeof o.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 o.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(o)=>{const s=await r();if(o==="base64")return V(s);else if(o==="hex")return vt.toHex(s);else if(o===void 0||o==="utf8"||o==="utf-8")return J(s);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(Kt);if(e=!0,Xt(t))return n(t);else if(I(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},Xt=(t)=>typeof Blob==="function"&&t instanceof Blob;var te="The stream has already been transformed.",_o=(t)=>{if(!(t instanceof it))try{return _t(t)}catch(n){const o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let e=!1;const r=async()=>{if(e)throw new Error(te);return e=!0,await Dt(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(n)=>{const o=await r();if(n===void 0||Buffer.isEncoding(n))return U(o.buffer,o.byteOffset,o.byteLength).toString(n);else return new hr(n).decode(o)},transformToWebStream:()=>{if(e)throw new Error(te);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof it.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 e=!0,it.toWeb(t)}})};import{PassThrough as re} from"stream";async function ee(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}async function ss(t){if(I(t))return ee(t);const e=new re,r=new re;return t.pipe(e),t.pipe(r),[e,r]}import{Writable as ar} from"stream";async function ne(t,e){let r=0;const n=[],o=t.getReader();let s=!1;while(!s){const{done:a,value:d}=await o.read();if(d)n.push(d),r+=d?.byteLength??0;if(r>=e)break;s=a}o.releaseLock();const c=new Uint8Array(Math.min(e,r));let i=0;for(let a of n){if(a.byteLength>c.byteLength-i){c.set(a.subarray(0,c.byteLength-i),i);break}else c.set(a,i);i+=a.length}return c}var as=(t,e)=>{if(I(t))return ne(t,e);return new Promise((r,n)=>{const o=new oe;o.limit=e,t.pipe(o),t.on("error",(s)=>{o.end(),n(s)}),o.on("error",n),o.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.buffers));r(s)})})};class oe extends ar{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(t,e,r){if(this.buffers.push(t),this.bytesBuffered+=t.byteLength??0,this.bytesBuffered>=this.limit){const n=this.bytesBuffered-this.limit,o=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=o.subarray(0,o.byteLength-n),this.emit("finish")}r()}}var Ts=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return C.mutate(t);if(!t)return C.mutate(new Uint8Array);const r=e.streamCollector(t);return C.mutate(await r)};var Cs=(t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}};var pr=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){const e=parseFloat(t);if(!Number.isNaN(e)){if(String(e)!==String(t))pe.warn(ae(`Expected number but observed string: ${t}`));return e}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},dr=Math.ceil(340282346638528860000000000000000000000),se=(t)=>{const e=pr(t);if(e!==void 0&&!Number.isNaN(e)&&e!==Infinity&&e!==(-Infinity)){if(Math.abs(e)>dr)throw new TypeError(`Expected 32-bit float, got ${t}`)}return e},ct=(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 ie=(t)=>ft(t,32),ce=(t)=>ft(t,16),fe=(t)=>ft(t,8),ft=(t,e)=>{const r=ct(t);if(r!==void 0&&lr(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},lr=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Es=(t,e)=>{if(t===null||t===void 0){if(e)throw new TypeError(`Expected a non-null value for ${e}`);throw new TypeError("Expected a non-null value")}return t},$s=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;const e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},As=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return pe.warn(ae(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var ue=(t)=>{if(typeof t=="string")return se(M(t));return se(t)},mr=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,M=(t)=>{const e=t.match(mr);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var Is=(t)=>{if(typeof t==="string")return ct(M(t));return ct(t)};var Us=(t)=>{if(typeof t==="string")return ie(M(t));return ie(t)},N=(t)=>{if(typeof t==="string")return ce(M(t));return ce(t)},he=(t)=>{if(typeof t==="string")return fe(M(t));return fe(t)},ae=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((e)=>!e.includes("stackTraceWarning")).join("\n")},pe={warn:console.warn};function Ps(t){const e=t.getUTCFullYear(),r=t.getUTCMonth(),n=t.getUTCDay(),o=t.getUTCDate(),s=t.getUTCHours(),c=t.getUTCMinutes(),i=t.getUTCSeconds(),a=o<10?`0${o}`:`${o}`,d=s<10?`0${s}`:`${s}`,w=c<10?`0${c}`:`${c}`,f=i<10?`0${i}`:`${i}`;return`${gr[n]}, ${a} ${ht[r]} ${e} ${d}:${w}:${f} GMT`}var gr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ht=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ds=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=yr.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,a,d]=e,w=N(k(n)),f=T(o,"month",1,12),p=T(s,"day",1,31);return R(w,f,p,{hours:c,minutes:i,seconds:a,fractionalMilliseconds:d})},wr=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Ls=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=wr.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,a,d,w]=e,f=N(k(n)),p=T(o,"month",1,12),u=T(s,"day",1,31),y=R(f,p,u,{hours:c,minutes:i,seconds:a,fractionalMilliseconds:d});if(w.toUpperCase()!="Z")y.setTime(y.getTime()-Fr(w));return y},xr=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$/),br=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$/),Tr=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})$/),Ms=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=xr.exec(t);if(e){const[r,n,o,s,c,i,a,d]=e;return R(N(k(s)),ut(o),T(n,"day",1,31),{hours:c,minutes:i,seconds:a,fractionalMilliseconds:d})}if(e=br.exec(t),e){const[r,n,o,s,c,i,a,d]=e;return Er(R(Sr(s),ut(o),T(n,"day",1,31),{hours:c,minutes:i,seconds:a,fractionalMilliseconds:d}))}if(e=Tr.exec(t),e){const[r,n,o,s,c,i,a,d]=e;return R(N(k(d)),ut(n),T(o.trimLeft(),"day",1,31),{hours:s,minutes:c,seconds:i,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")};var R=(t,e,r,n)=>{const o=e-1;return Ar(t,o,r),new Date(Date.UTC(t,o,r,T(n.hours,"hour",0,23),T(n.minutes,"minute",0,59),T(n.seconds,"seconds",0,60),Ur(n.fractionalMilliseconds)))},Sr=(t)=>{const e=(new Date()).getUTCFullYear(),r=Math.floor(e/100)*100+N(k(t));if(r<e)return r+100;return r},Cr=1576800000000,Er=(t)=>{if(t.getTime()-(new Date()).getTime()>Cr)return new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()));return t},ut=(t)=>{const e=ht.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},$r=[31,28,31,30,31,30,31,31,30,31,30,31],Ar=(t,e,r)=>{let n=$r[e];if(e===1&&Ir(t))n=29;if(r>n)throw new TypeError(`Invalid day for ${ht[e]} in ${t}: ${r}`)},Ir=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},T=(t,e,r,n)=>{const o=he(k(t));if(o<r||o>n)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return o},Ur=(t)=>{if(t===null||t===void 0)return 0;return ue("0."+t)*1000},Fr=(t)=>{const e=t[0];let r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(t.substring(1,3)),o=Number(t.substring(4,6));return r*(n*60+o)*60*1000},k=(t)=>{let e=0;while(e<t.length-1&&t.charAt(e)==="0")e++;if(e===0)return t;return t.slice(e)};var Nr=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{const o=kr(t),s=o.httpStatusCode?o.httpStatusCode+"":void 0,c=new r({name:e?.code||e?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw Mt(c,e)},Hs=(t)=>{return({output:e,parsedBody:r,errorCode:n})=>{Nr({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})}},kr=(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 js=(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 de=!1,Os=(t)=>{if(t&&!de&&parseInt(t.substring(1,t.indexOf(".")))<16)de=!0};var at=$(X(),1);var le=(t)=>{const e=[];for(let r in at.AlgorithmId){const n=at.AlgorithmId[r];if(t[n]===void 0)continue;e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},me=(t)=>{const e={};return t.checksumAlgorithms().forEach((r)=>{e[r.algorithmId()]=r.checksumConstructor()}),e};var ge=(t)=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},ye=(t)=>{const e={};return e.retryStrategy=t.retryStrategy(),e};var Qs=(t)=>{return{...le(t),...ge(t)}};var Gs=(t)=>{return{...me(t),...ye(t)}};function Pr(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var pt=function(){const t=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,t.prototype),r};pt.prototype=Object.create(String.prototype,{constructor:{value:pt,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(pt,String);function Dr(t,e,r){let n,o,s;if(typeof e==="undefined"&&typeof r==="undefined")n={},s=t;else if(n=t,typeof e==="function")return o=e,s=r,Lr(n,o,s);else s=e;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){n[c]=s[c];continue}we(n,null,s,c)}return n}var ni=(t,e)=>{const r={};for(let n in e)we(r,t,e,n);return r},Lr=(t,e,r)=>{return Dr(t,Object.entries(r).reduce((n,[o,s])=>{if(Array.isArray(s))n[o]=s;else if(typeof s==="function")n[o]=[e,s()];else n[o]=[e,s];return n},{}))},we=(t,e,r,n)=>{if(e!==null){let c=r[n];if(typeof c==="function")c=[,c];const[i=Mr,a=Rr,d=n]=c;if(typeof i==="function"&&i(e[d])||typeof i!=="function"&&!!i)t[n]=a(e[d]);return}let[o,s]=r[n];if(typeof s==="function"){let c;const i=o===void 0&&(c=s())!=null,a=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(i)t[n]=c;else if(a)t[n]=s()}else{const c=o===void 0&&s!=null,i=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(c||i)t[n]=s}},Mr=(t)=>t!=null,Rr=(t)=>t;var ci=(t)=>t.toISOString().replace(".000Z","Z");var xe=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((e)=>e!=null).map(xe);if(typeof t==="object"){const e={};for(let r of Object.keys(t)){if(t[r]==null)continue;e[r]=xe(t[r])}return e}return t};export{Yr as z,Or as A,v as B,L as C,ze as D,K as E,Ae as F,Ht as G,U as H,W as I,z as J,F as K,io as L,J as M,V as N,Uo as O,$t as P,rt as Q,Dt as R,Gt as S,_o as T,ss as U,as as V,Ts as W,bt as X,Vn as Y,Qn as Z,Cs as _,ct as $,ie as aa,Es as ba,$s as ca,As as da,Is as ea,Us as fa,Ps as ga,Ds as ha,Ls as ia,Ms as ja,Lt as ka,Mt as la,Hs as ma,js as na,Os as oa,Qs as pa,Gs as qa,Pr as ra,Dr as sa,ni as ta,ci as ua,xe as va};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{x as _} from"./chunk-a5c18c07abe8fd9c.js";import"./chunk-442a5b1ec74c72f8.js";import{lb as y} from"./chunk-2672477bf396bad8.js";import{ob as K,ub as S} from"./chunk-73c97da8ac4f1d30.js";var o=_(y(),1);import{exec as A} from"child_process";import{promisify as T} from"util";var i=(c,n,s)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){const t=new Date;if(new Date(n.Expiration)<t)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let e=n.AccountId;if(!e&&s?.[c]?.aws_account_id)e=s[c].aws_account_id;return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...e&&{accountId:e}}};var x=async(c,n,s)=>{const e=n[c];if(n[c]){const t=e.credential_process;if(t!==void 0){const u=T(A);try{const{stdout:r}=await u(t);let w;try{w=JSON.parse(r.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return i(c,w,n)}catch(r){throw new o.CredentialsProviderError(r.message,{logger:s})}}else throw new o.CredentialsProviderError(`Profile ${c} did not contain credential_process.`,{logger:s})}else throw new o.CredentialsProviderError(`Profile ${c} could not be found in shared credentials file.`,{logger:s})};var b=(c={})=>async()=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const n=await S(c);return x(K(c),n,c.logger)};export{b as fromProcess};
@@ -0,0 +1,2 @@
1
+ import{y as D} from"./chunk-a5c18c07abe8fd9c.js";var S=D((y,w)=>{var{defineProperty:G,getOwnPropertyDescriptor:v,getOwnPropertyNames:O}=Object,x=Object.prototype.hasOwnProperty,Q=(b,j)=>G(b,"name",{value:j,configurable:!0}),U=(b,j)=>{for(var z in j)G(b,z,{get:j[z],enumerable:!0})},K=(b,j,z,V)=>{if(j&&typeof j==="object"||typeof j==="function"){for(let B of O(j))if(!x.call(b,B)&&B!==z)G(b,B,{get:()=>j[B],enumerable:!(V=v(j,B))||V.enumerable})}return b},q=(b)=>K(G({},"__esModule",{value:!0}),b),W={};U(W,{AlgorithmId:()=>J,EndpointURLScheme:()=>X,FieldPosition:()=>M,HttpApiKeyAuthLocation:()=>$,HttpAuthLocation:()=>Z,IniSectionType:()=>N,RequestHandlerProtocol:()=>Y,SMITHY_CONTEXT_KEY:()=>R,getDefaultClientConfiguration:()=>T,resolveDefaultRuntimeConfig:()=>k});w.exports=q(W);var Z=((b)=>{return b.HEADER="header",b.QUERY="query",b})(Z||{}),$=((b)=>{return b.HEADER="header",b.QUERY="query",b})($||{}),X=((b)=>{return b.HTTP="http",b.HTTPS="https",b})(X||{}),J=((b)=>{return b.MD5="md5",b.CRC32="crc32",b.CRC32C="crc32c",b.SHA1="sha1",b.SHA256="sha256",b})(J||{}),E=Q((b)=>{const j=[];if(b.sha256!==void 0)j.push({algorithmId:()=>"sha256",checksumConstructor:()=>b.sha256});if(b.md5!=null)j.push({algorithmId:()=>"md5",checksumConstructor:()=>b.md5});return{_checksumAlgorithms:j,addChecksumAlgorithm(z){this._checksumAlgorithms.push(z)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),F=Q((b)=>{const j={};return b.checksumAlgorithms().forEach((z)=>{j[z.algorithmId()]=z.checksumConstructor()}),j},"resolveChecksumRuntimeConfig"),T=Q((b)=>{return{...E(b)}},"getDefaultClientConfiguration"),k=Q((b)=>{return{...F(b)}},"resolveDefaultRuntimeConfig"),M=((b)=>{return b[b.HEADER=0]="HEADER",b[b.TRAILER=1]="TRAILER",b})(M||{}),R="__smithy_context",N=((b)=>{return b.PROFILE="profile",b.SSO_SESSION="sso-session",b.SERVICES="services",b})(N||{}),Y=((b)=>{return b.HTTP_0_9="http/0.9",b.HTTP_1_0="http/1.0",b.TDS_8_0="tds/8.0",b})(Y||{})});
2
+ export{S as ib};