gemi 0.8.7 → 0.9.0

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.
Files changed (99) hide show
  1. package/dist/app/index.js +2 -2
  2. package/dist/app/index.js.map +1 -1
  3. package/dist/broadcasting/index.js +1 -1
  4. package/dist/{chunk-cznncsqh.js → chunk-09kjpedw.js} +2 -2
  5. package/dist/{chunk-cznncsqh.js.map → chunk-09kjpedw.js.map} +1 -1
  6. package/dist/chunk-15121mab.js +3 -0
  7. package/dist/chunk-15121mab.js.map +23 -0
  8. package/dist/chunk-41ekjwjk.js +3 -0
  9. package/dist/{chunk-wbwvxtpw.js.map → chunk-41ekjwjk.js.map} +6 -6
  10. package/dist/chunk-56rgrraz.js +4 -0
  11. package/dist/{chunk-2860g116.js.map → chunk-56rgrraz.js.map} +7 -7
  12. package/dist/chunk-5757y8bm.js +5 -0
  13. package/dist/chunk-5757y8bm.js.map +65 -0
  14. package/dist/chunk-5khtwy9k.js +8 -0
  15. package/dist/{chunk-wm1z70m6.js.map → chunk-5khtwy9k.js.map} +2 -2
  16. package/dist/chunk-5ynf2rsg.js +11 -0
  17. package/dist/{chunk-ty7wy4r7.js.map → chunk-5ynf2rsg.js.map} +5 -5
  18. package/dist/{chunk-pwz9eve9.js → chunk-6zwq2e83.js} +2 -2
  19. package/dist/{chunk-pwz9eve9.js.map → chunk-6zwq2e83.js.map} +1 -1
  20. package/dist/{chunk-fjtabyv3.js → chunk-72ymmgtz.js} +3 -3
  21. package/dist/{chunk-fjtabyv3.js.map → chunk-72ymmgtz.js.map} +1 -1
  22. package/dist/chunk-8h7xg91g.js +3 -0
  23. package/dist/chunk-8h7xg91g.js.map +15 -0
  24. package/dist/{chunk-yr6xvtrp.js → chunk-8mn27b0d.js} +2 -2
  25. package/dist/{chunk-yr6xvtrp.js.map → chunk-8mn27b0d.js.map} +1 -1
  26. package/dist/chunk-95n0qa4n.js +4 -0
  27. package/dist/{chunk-49dywzcy.js.map → chunk-95n0qa4n.js.map} +2 -2
  28. package/dist/{chunk-1hqgvbcp.js → chunk-c28nrk1f.js} +3 -3
  29. package/dist/{chunk-1hqgvbcp.js.map → chunk-c28nrk1f.js.map} +1 -1
  30. package/dist/chunk-d08fsdk6.js +4 -0
  31. package/dist/{chunk-4t0y39ef.js.map → chunk-d08fsdk6.js.map} +5 -5
  32. package/dist/{chunk-rdqt7ecf.js → chunk-e6q6yr9r.js} +3 -3
  33. package/dist/{chunk-rdqt7ecf.js.map → chunk-e6q6yr9r.js.map} +1 -1
  34. package/dist/chunk-f8w5mnyk.js +4 -0
  35. package/dist/{chunk-vqnq14km.js.map → chunk-f8w5mnyk.js.map} +2 -2
  36. package/dist/chunk-grzk91g3.js +4 -0
  37. package/dist/{chunk-rf5nbn2a.js.map → chunk-grzk91g3.js.map} +2 -2
  38. package/dist/chunk-n84kj7wm.js +4 -0
  39. package/dist/{chunk-z2g2gf9x.js.map → chunk-n84kj7wm.js.map} +2 -2
  40. package/dist/chunk-newr6djh.js +4 -0
  41. package/dist/{chunk-3tvxdda7.js.map → chunk-newr6djh.js.map} +2 -2
  42. package/dist/chunk-nx841nvj.js +20 -0
  43. package/dist/{chunk-d3vb4nr3.js.map → chunk-nx841nvj.js.map} +34 -16
  44. package/dist/chunk-rbx889ps.js +4 -0
  45. package/dist/{chunk-6mnec4xy.js.map → chunk-rbx889ps.js.map} +6 -6
  46. package/dist/{chunk-9sm3y37r.js → chunk-rrb06401.js} +3 -3
  47. package/dist/{chunk-9sm3y37r.js.map → chunk-rrb06401.js.map} +1 -1
  48. package/dist/{chunk-5tb1ayea.js → chunk-rxz71va5.js} +2 -2
  49. package/dist/{chunk-5tb1ayea.js.map → chunk-rxz71va5.js.map} +1 -1
  50. package/dist/{chunk-jprkbg35.js → chunk-vqttt2vp.js} +3 -3
  51. package/dist/{chunk-jprkbg35.js.map → chunk-vqttt2vp.js.map} +1 -1
  52. package/dist/chunk-w7mr84t1.js +4 -0
  53. package/dist/{chunk-kbwfcbmn.js.map → chunk-w7mr84t1.js.map} +1 -1
  54. package/dist/{chunk-hgpa38ny.js → chunk-xam5kps4.js} +2 -2
  55. package/dist/{chunk-hgpa38ny.js.map → chunk-xam5kps4.js.map} +1 -1
  56. package/dist/chunk-zx3ka227.js +4 -0
  57. package/dist/{chunk-qew9b569.js.map → chunk-zx3ka227.js.map} +5 -5
  58. package/dist/email/index.js +2 -2
  59. package/dist/email/index.js.map +1 -1
  60. package/dist/facades/Redirect.d.ts.map +1 -1
  61. package/dist/facades/index.js +2 -2
  62. package/dist/facades/index.js.map +4 -4
  63. package/dist/http/AuthenticationMiddlware.d.ts.map +1 -1
  64. package/dist/http/CorsMiddleware.d.ts +14 -0
  65. package/dist/http/CorsMiddleware.d.ts.map +1 -0
  66. package/dist/http/Middleware.d.ts +3 -1
  67. package/dist/http/Middleware.d.ts.map +1 -1
  68. package/dist/http/index.d.ts +1 -0
  69. package/dist/http/index.d.ts.map +1 -1
  70. package/dist/http/index.js +2 -2
  71. package/dist/http/index.js.map +6 -5
  72. package/dist/kernel/index.js +2 -2
  73. package/dist/kernel/index.js.map +1 -1
  74. package/dist/server/index.js +2 -2
  75. package/dist/server/index.js.map +1 -1
  76. package/dist/services/index.js +5 -5
  77. package/dist/services/index.js.map +5 -6
  78. package/dist/services/router/createFlatApiRoutes.d.ts.map +1 -1
  79. package/package.json +1 -1
  80. package/dist/chunk-2860g116.js +0 -4
  81. package/dist/chunk-3tvxdda7.js +0 -4
  82. package/dist/chunk-49dywzcy.js +0 -4
  83. package/dist/chunk-4t0y39ef.js +0 -4
  84. package/dist/chunk-6mnec4xy.js +0 -4
  85. package/dist/chunk-d3vb4nr3.js +0 -18
  86. package/dist/chunk-kbwfcbmn.js +0 -4
  87. package/dist/chunk-qew9b569.js +0 -4
  88. package/dist/chunk-rf5nbn2a.js +0 -4
  89. package/dist/chunk-tsvex6ak.js +0 -7
  90. package/dist/chunk-tsvex6ak.js.map +0 -67
  91. package/dist/chunk-ty7wy4r7.js +0 -11
  92. package/dist/chunk-v6ccwfr3.js +0 -4
  93. package/dist/chunk-v6ccwfr3.js.map +0 -10
  94. package/dist/chunk-vqnq14km.js +0 -4
  95. package/dist/chunk-vzw3vare.js +0 -4
  96. package/dist/chunk-vzw3vare.js.map +0 -14
  97. package/dist/chunk-wbwvxtpw.js +0 -3
  98. package/dist/chunk-wm1z70m6.js +0 -8
  99. package/dist/chunk-z2g2gf9x.js +0 -4
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{ga as cc,ha as K}from"./chunk-wbwvxtpw.js";import"./chunk-vzw3vare.js";import"./chunk-9sm3y37r.js";import{eb as D}from"./chunk-v6ccwfr3.js";import{Pb as f}from"./chunk-cznncsqh.js";var z=f(D(),1);import{parse as o}from"url";var _=f(D(),1);import{Buffer as a}from"buffer";import{request as n}from"http";function u(c){return new Promise((I,x)=>{let T=n({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new _.ProviderError("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new _.ProviderError("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{let{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new _.ProviderError("Error response received from instance metadata service"),{statusCode:O})),T.destroy();let E=[];N.on("data",(y)=>{E.push(y)}),N.on("end",()=>{I(a.concat(E)),T.destroy()})}),T.end()})}var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",Q=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var Ec=1000,$c=0,X=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var v="AWS_CONTAINER_CREDENTIALS_FULL_URI",L="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN",_c=(c={})=>{let{timeout:I,maxRetries:x}=X(c);return()=>m(async()=>{let T=await d({logger:c.logger}),N=JSON.parse(await s(I,T));if(!G(N))throw new z.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return Q(N)},x)},s=async(c,I)=>{if(process.env[B])I.headers={...I.headers,Authorization:process.env[B]};return(await u({...I,timeout:c})).toString()},g="169.254.170.2",l={localhost:!0,"127.0.0.1":!0},r={"http:":!0,"https:":!0},d=async({logger:c})=>{if(process.env[L])return{hostname:g,path:process.env[L]};if(process.env[v]){let I=o(process.env[v]);if(!I.hostname||!(I.hostname in l))throw new z.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in r))throw new z.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new z.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${L} or ${v} environment variable is set`,{tryNextLink:!1,logger:c})};var q=f(D(),1);var U=f(D(),1);class Z extends U.CredentialsProviderError{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Z.prototype)}}var P=f(cc(),1);var A;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(A||(A={}));var t={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var S;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(S||(S={}));var e="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",i="ec2_metadata_service_endpoint_mode",F={environmentVariableSelector:(c)=>c[e],configFileSelector:(c)=>c[i],default:S.IPv4};var W=async()=>P.parseUrl(await Ic()||await Tc()),Ic=async()=>K(t)(),Tc=async()=>{let c=await K(F)();switch(c){case S.IPv4:return A.IPv4;case S.IPv6:return A.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(S)}`)}};var b=(c,I)=>{let x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var V=(c,I={})=>{let x=I?.logger||console,T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=b(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=b(T,x);else throw O}return T=N,N}};var k="/latest/meta-data/iam/security-credentials/",Nc="/latest/api/token",H="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",oc=(c={})=>V(xc(c),{logger:c.logger}),xc=(c={})=>{let I=!1,{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=X(c),E=async(y,$)=>{if(I||$.headers?.[M]==null){let w=!1,h=!1,C=await K({environmentVariableSelector:(Y)=>{let j=Y[H];if(h=!!j&&j!=="false",j===void 0)throw new q.CredentialsProviderError(`${H} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{let j=Y[R];return w=!!j&&j!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||C){let Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${H})`);throw new Z(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}let p=(await m(async()=>{let w;try{w=await yc($)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return m(async()=>{let w;try{w=await wc(p,$,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{let y=await W();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),E(O,{...y,timeout:N});else{let $;try{$=(await Oc({...y,timeout:N})).toString()}catch(J){if(J?.statusCode===400)throw Object.assign(J,{message:"EC2 Metadata token request returned error"});else if(J.message==="TimeoutError"||[403,404,405].includes(J.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),E(O,{...y,timeout:N})}return E(O,{...y,headers:{[M]:$},timeout:N})}}},Oc=async(c)=>u({...c,path:Nc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),yc=async(c)=>(await u({...c,path:k})).toString(),wc=async(c,I,x)=>{let T=JSON.parse((await u({...I,path:k+c})).toString());if(!G(T))throw new q.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return Q(T)};export{X as providerConfigFromInit,u as httpRequest,W as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,_c as fromContainerMetadata,A as Endpoint,L as ENV_CMDS_RELATIVE_URI,v as ENV_CMDS_FULL_URI,B as ENV_CMDS_AUTH_TOKEN,Ec as DEFAULT_TIMEOUT,$c as DEFAULT_MAX_RETRIES};
3
-
4
- //# debugId=8069BFE6332A60E064756E2164756E21
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{eb as m}from"./chunk-v6ccwfr3.js";import{Pb as t}from"./chunk-cznncsqh.js";var c=t(m(),1);import{readFileSync as S}from"fs";var E=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:i,policyArns:_,policy:N,durationSeconds:d}=e,{roleAssumerWithWebIdentity:s}=e;if(!s){let{getDefaultRoleAssumerWithWebIdentity:l}=await import("./chunk-3tvxdda7.js");s=l({...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:i,PolicyArns:_,Policy:N,DurationSeconds:d})};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");let o=e?.webIdentityTokenFile??process.env[p],r=e?.roleArn??process.env[f],n=e?.roleSessionName??process.env[T];if(!o||!r)throw new c.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});return E({...e,webIdentityToken:S(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{E as fromWebToken,I as fromTokenFile};
3
-
4
- //# debugId=2CC6DF4B5D2892E764756E2164756E21
@@ -1,7 +0,0 @@
1
- import{ab as p}from"./chunk-9sm3y37r.js";import{Pb as W,Qb as N}from"./chunk-cznncsqh.js";var xn=N((Yr,Pn)=>{var{defineProperty:O,getOwnPropertyDescriptor:Uf,getOwnPropertyNames:yf}=Object,If=Object.prototype.hasOwnProperty,z=(n,t)=>O(n,"name",{value:t,configurable:!0}),Lf=(n,t)=>{for(var c in t)O(n,c,{get:t[c],enumerable:!0})},Df=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of yf(t))if(!If.call(n,i)&&i!==c)O(n,i,{get:()=>t[i],enumerable:!(f=Uf(t,i))||f.enumerable})}return n},Nf=(n)=>Df(O({},"__esModule",{value:!0}),n),Hn={};Lf(Hn,{constructStack:()=>$n});Pn.exports=Nf(Hn);var A=z((n,t)=>{let c=[];if(n)c.push(n);if(t)for(let f of t)c.push(f);return c},"getAllAliases"),Q=z((n,t)=>{return`${n||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},"getMiddlewareNameWithAliases"),$n=z(()=>{let n=[],t=[],c=!1,f=new Set,i=z((w)=>w.sort((d,T)=>jn[T.step]-jn[d.step]||en[T.priority||"normal"]-en[d.priority||"normal"]),"sort"),h=z((w)=>{let d=!1,T=z((o)=>{let I=A(o.name,o.aliases);if(I.includes(w)){d=!0;for(let C of I)f.delete(C);return!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),d},"removeByName"),r=z((w)=>{let d=!1,T=z((o)=>{if(o.middleware===w){d=!0;for(let I of A(o.name,o.aliases))f.delete(I);return!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),d},"removeByReference"),s=z((w)=>{var d;return n.forEach((T)=>{w.add(T.middleware,{...T})}),t.forEach((T)=>{w.addRelativeTo(T.middleware,{...T})}),(d=w.identifyOnResolve)==null||d.call(w,y.identifyOnResolve()),w},"cloneTo"),u=z((w)=>{let d=[];return w.before.forEach((T)=>{if(T.before.length===0&&T.after.length===0)d.push(T);else d.push(...u(T))}),d.push(w),w.after.reverse().forEach((T)=>{if(T.before.length===0&&T.after.length===0)d.push(T);else d.push(...u(T))}),d},"expandRelativeMiddlewareList"),x=z((w=!1)=>{let d=[],T=[],o={};return n.forEach((C)=>{let F={...C,before:[],after:[]};for(let $ of A(F.name,F.aliases))o[$]=F;d.push(F)}),t.forEach((C)=>{let F={...C,before:[],after:[]};for(let $ of A(F.name,F.aliases))o[$]=F;T.push(F)}),T.forEach((C)=>{if(C.toMiddleware){let F=o[C.toMiddleware];if(F===void 0){if(w)return;throw new Error(`${C.toMiddleware} is not found when adding ${Q(C.name,C.aliases)} middleware ${C.relation} ${C.toMiddleware}`)}if(C.relation==="after")F.after.push(C);if(C.relation==="before")F.before.push(C)}}),i(d).map(u).reduce((C,F)=>{return C.push(...F),C},[])},"getMiddlewareList"),y={add:(w,d={})=>{let{name:T,override:o,aliases:I}=d,C={step:"initialize",priority:"normal",middleware:w,...d},F=A(T,I);if(F.length>0){if(F.some(($)=>f.has($))){if(!o)throw new Error(`Duplicate middleware name '${Q(T,I)}'`);for(let $ of F){let E=n.findIndex((g)=>{var S;return g.name===$||((S=g.aliases)==null?void 0:S.some((X)=>X===$))});if(E===-1)continue;let U=n[E];if(U.step!==C.step||C.priority!==U.priority)throw new Error(`"${Q(U.name,U.aliases)}" middleware with ${U.priority} priority in ${U.step} step cannot be overridden by "${Q(T,I)}" middleware with ${C.priority} priority in ${C.step} step.`);n.splice(E,1)}}for(let $ of F)f.add($)}n.push(C)},addRelativeTo:(w,d)=>{let{name:T,override:o,aliases:I}=d,C={middleware:w,...d},F=A(T,I);if(F.length>0){if(F.some(($)=>f.has($))){if(!o)throw new Error(`Duplicate middleware name '${Q(T,I)}'`);for(let $ of F){let E=t.findIndex((g)=>{var S;return g.name===$||((S=g.aliases)==null?void 0:S.some((X)=>X===$))});if(E===-1)continue;let U=t[E];if(U.toMiddleware!==C.toMiddleware||U.relation!==C.relation)throw new Error(`"${Q(U.name,U.aliases)}" middleware ${U.relation} "${U.toMiddleware}" middleware cannot be overridden by "${Q(T,I)}" middleware ${C.relation} "${C.toMiddleware}" middleware.`);t.splice(E,1)}}for(let $ of F)f.add($)}t.push(C)},clone:()=>s($n()),use:(w)=>{w.applyToStack(y)},remove:(w)=>{if(typeof w==="string")return h(w);else return r(w)},removeByTag:(w)=>{let d=!1,T=z((o)=>{let{tags:I,name:C,aliases:F}=o;if(I&&I.includes(w)){let $=A(C,F);for(let E of $)f.delete(E);return d=!0,!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),d},concat:(w)=>{var d;let T=s($n());return T.use(w),T.identifyOnResolve(c||T.identifyOnResolve()||(((d=w.identifyOnResolve)==null?void 0:d.call(w))??!1)),T},applyToStack:s,identify:()=>{return x(!0).map((w)=>{let d=w.step??w.relation+" "+w.toMiddleware;return Q(w.name,w.aliases)+" - "+d})},identifyOnResolve(w){if(typeof w==="boolean")c=w;return c},resolve:(w,d)=>{for(let T of x().map((o)=>o.middleware).reverse())w=T(w,d);if(c)console.log(y.identify());return w}};return y},"constructStack"),jn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},en={high:3,normal:2,low:1}});var nt=N((br,_n)=>{var{defineProperty:v,getOwnPropertyDescriptor:Yf,getOwnPropertyNames:zf}=Object,Vf=Object.prototype.hasOwnProperty,Zf=(n,t)=>v(n,"name",{value:t,configurable:!0}),Gf=(n,t)=>{for(var c in t)v(n,c,{get:t[c],enumerable:!0})},Qf=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of zf(t))if(!Vf.call(n,i)&&i!==c)v(n,i,{get:()=>t[i],enumerable:!(f=Yf(t,i))||f.enumerable})}return n},Kf=(n)=>Qf(v({},"__esModule",{value:!0}),n),mn={};Gf(mn,{isArrayBuffer:()=>Xf});_n.exports=Kf(mn);var Xf=Zf((n)=>typeof ArrayBuffer==="function"&&n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]","isArrayBuffer")});var R=N((Wr,ft)=>{var{defineProperty:q,getOwnPropertyDescriptor:Af,getOwnPropertyNames:Jf}=Object,bf=Object.prototype.hasOwnProperty,tt=(n,t)=>q(n,"name",{value:t,configurable:!0}),Wf=(n,t)=>{for(var c in t)q(n,c,{get:t[c],enumerable:!0})},Bf=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Jf(t))if(!bf.call(n,i)&&i!==c)q(n,i,{get:()=>t[i],enumerable:!(f=Af(t,i))||f.enumerable})}return n},Mf=(n)=>Bf(q({},"__esModule",{value:!0}),n),ct={};Wf(ct,{fromArrayBuffer:()=>jf,fromString:()=>ef});ft.exports=Mf(ct);var Rf=nt(),dn=import.meta.require("buffer"),jf=tt((n,t=0,c=n.byteLength-t)=>{if(!Rf.isArrayBuffer(n))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof n} (${n})`);return dn.Buffer.from(n,t,c)},"fromArrayBuffer"),ef=tt((n,t)=>{if(typeof n!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof n} (${n})`);return t?dn.Buffer.from(n,t):dn.Buffer.from(n)},"fromString")});var rt=N((it)=>{Object.defineProperty(it,"__esModule",{value:!0});it.fromBase64=void 0;var Hf=R(),Pf=/^[A-Za-z0-9+/]*={0,2}$/,lf=(n)=>{if(n.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Pf.exec(n))throw new TypeError("Invalid base64 string.");let t=Hf.fromString(n,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};it.fromBase64=lf});var m=N((Mr,Tt)=>{var{defineProperty:a,getOwnPropertyDescriptor:kf,getOwnPropertyNames:Of}=Object,pf=Object.prototype.hasOwnProperty,En=(n,t)=>a(n,"name",{value:t,configurable:!0}),vf=(n,t)=>{for(var c in t)a(n,c,{get:t[c],enumerable:!0})},qf=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Of(t))if(!pf.call(n,i)&&i!==c)a(n,i,{get:()=>t[i],enumerable:!(f=kf(t,i))||f.enumerable})}return n},af=(n)=>qf(a({},"__esModule",{value:!0}),n),st={};vf(st,{fromUtf8:()=>wt,toUint8Array:()=>mf,toUtf8:()=>_f});Tt.exports=af(st);var ut=R(),wt=En((n)=>{let t=ut.fromString(n,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),mf=En((n)=>{if(typeof n==="string")return wt(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(n)},"toUint8Array"),_f=En((n)=>{if(typeof n==="string")return n;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return ut.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("utf8")},"toUtf8")});var dt=N(($t)=>{Object.defineProperty($t,"__esModule",{value:!0});$t.toBase64=void 0;var ni=R(),ti=m(),ci=(n)=>{let t;if(typeof n==="string")t=ti.fromUtf8(n);else t=n;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return ni.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("base64")};$t.toBase64=ci});var nn=N((jr,_)=>{var{defineProperty:Et,getOwnPropertyDescriptor:fi,getOwnPropertyNames:ii}=Object,hi=Object.prototype.hasOwnProperty,Cn=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of ii(t))if(!hi.call(n,i)&&i!==c)Et(n,i,{get:()=>t[i],enumerable:!(f=fi(t,i))||f.enumerable})}return n},Ct=(n,t,c)=>(Cn(n,t,"default"),c&&Cn(c,t,"default")),ri=(n)=>Cn(Et({},"__esModule",{value:!0}),n),Fn={};_.exports=ri(Fn);Ct(Fn,rt(),_.exports);Ct(Fn,dt(),_.exports)});var Ut=N((Ft)=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.getAwsChunkedEncodingStream=void 0;var si=import.meta.require("stream"),ui=(n,t)=>{let{base64Encoder:c,bodyLengthChecker:f,checksumAlgorithmFn:i,checksumLocationName:h,streamHasher:r}=t,s=c!==void 0&&i!==void 0&&h!==void 0&&r!==void 0,u=s?r(i,n):void 0,x=new si.Readable({read:()=>{}});return n.on("data",(y)=>{let w=f(y)||0;x.push(`${w.toString(16)}\r\n`),x.push(y),x.push("\r\n")}),n.on("end",async()=>{if(x.push("0\r\n"),s){let y=c(await u);x.push(`${h}:${y}\r\n`),x.push("\r\n")}x.push(null)}),x};Ft.getAwsChunkedEncodingStream=ui});var on=N((Hr,zt)=>{var{defineProperty:tn,getOwnPropertyDescriptor:wi,getOwnPropertyNames:Ti}=Object,$i=Object.prototype.hasOwnProperty,K=(n,t)=>tn(n,"name",{value:t,configurable:!0}),xi=(n,t)=>{for(var c in t)tn(n,c,{get:t[c],enumerable:!0})},di=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Ti(t))if(!$i.call(n,i)&&i!==c)tn(n,i,{get:()=>t[i],enumerable:!(f=wi(t,i))||f.enumerable})}return n},Ei=(n)=>di(tn({},"__esModule",{value:!0}),n),yt={};xi(yt,{Field:()=>oi,Fields:()=>Ui,HttpRequest:()=>yi,HttpResponse:()=>Ii,IHttpRequest:()=>It.HttpRequest,getHttpHandlerExtensionConfiguration:()=>Ci,isValidHostname:()=>Yt,resolveHttpHandlerRuntimeConfig:()=>Fi});zt.exports=Ei(yt);var Ci=K((n)=>{let t=n.httpHandler;return{setHttpHandler(c){t=c},httpHandler(){return t},updateHttpClientConfig(c,f){t.updateHttpClientConfig(c,f)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),Fi=K((n)=>{return{httpHandler:n.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),It=p(),Lt=class n{constructor({name:t,kind:c=It.FieldPosition.HEADER,values:f=[]}){this.name=t,this.kind=c,this.values=f}add(t){this.values.push(t)}set(t){this.values=t}remove(t){this.values=this.values.filter((c)=>c!==t)}toString(){return this.values.map((t)=>t.includes(",")||t.includes(" ")?`"${t}"`:t).join(", ")}get(){return this.values}};K(Lt,"Field");var oi=Lt,Dt=class n{constructor({fields:t=[],encoding:c="utf-8"}){this.entries={},t.forEach(this.setField.bind(this)),this.encoding=c}setField(t){this.entries[t.name.toLowerCase()]=t}getField(t){return this.entries[t.toLowerCase()]}removeField(t){delete this.entries[t.toLowerCase()]}getByType(t){return Object.values(this.entries).filter((c)=>c.kind===t)}};K(Dt,"Fields");var Ui=Dt,Nt=class n{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 c=new n({...t,headers:{...t.headers}});if(c.query)c.query=gt(c.query);return c}static isInstance(t){if(!t)return!1;let c=t;return"method"in c&&"protocol"in c&&"hostname"in c&&"path"in c&&typeof c.query==="object"&&typeof c.headers==="object"}clone(){return n.clone(this)}};K(Nt,"HttpRequest");var yi=Nt;function gt(n){return Object.keys(n).reduce((t,c)=>{let f=n[c];return{...t,[c]:Array.isArray(f)?[...f]:f}},{})}K(gt,"cloneQuery");var St=class n{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 c=t;return typeof c.statusCode==="number"&&typeof c.headers==="object"}};K(St,"HttpResponse");var Ii=St;function Yt(n){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(n)}K(Yt,"isValidHostname")});var Qt=N((Pr,Gt)=>{var{defineProperty:cn,getOwnPropertyDescriptor:Li,getOwnPropertyNames:Di}=Object,Ni=Object.prototype.hasOwnProperty,Un=(n,t)=>cn(n,"name",{value:t,configurable:!0}),gi=(n,t)=>{for(var c in t)cn(n,c,{get:t[c],enumerable:!0})},Si=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Di(t))if(!Ni.call(n,i)&&i!==c)cn(n,i,{get:()=>t[i],enumerable:!(f=Li(t,i))||f.enumerable})}return n},Yi=(n)=>Si(cn({},"__esModule",{value:!0}),n),Vt={};gi(Vt,{escapeUri:()=>Zt,escapeUriPath:()=>Vi});Gt.exports=Yi(Vt);var Zt=Un((n)=>encodeURIComponent(n).replace(/[!'()*]/g,zi),"escapeUri"),zi=Un((n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Vi=Un((n)=>n.split("/").map(Zt).join("/"),"escapeUriPath")});var In=N((lr,At)=>{var{defineProperty:fn,getOwnPropertyDescriptor:Zi,getOwnPropertyNames:Gi}=Object,Qi=Object.prototype.hasOwnProperty,Ki=(n,t)=>fn(n,"name",{value:t,configurable:!0}),Xi=(n,t)=>{for(var c in t)fn(n,c,{get:t[c],enumerable:!0})},Ai=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Gi(t))if(!Qi.call(n,i)&&i!==c)fn(n,i,{get:()=>t[i],enumerable:!(f=Zi(t,i))||f.enumerable})}return n},Ji=(n)=>Ai(fn({},"__esModule",{value:!0}),n),Kt={};Xi(Kt,{buildQueryString:()=>Xt});At.exports=Ji(Kt);var yn=Qt();function Xt(n){let t=[];for(let c of Object.keys(n).sort()){let f=n[c];if(c=yn.escapeUri(c),Array.isArray(f))for(let i=0,h=f.length;i<h;i++)t.push(`${c}=${yn.escapeUri(f[i])}`);else{let i=c;if(f||typeof f==="string")i+=`=${yn.escapeUri(f)}`;t.push(i)}}return t.join("&")}Ki(Xt,"buildQueryString")});var _t=N((kr,mt)=>{var{create:bi,defineProperty:j,getOwnPropertyDescriptor:Wi,getOwnPropertyNames:Bi,getPrototypeOf:Mi}=Object,Ri=Object.prototype.hasOwnProperty,L=(n,t)=>j(n,"name",{value:t,configurable:!0}),ji=(n,t)=>{for(var c in t)j(n,c,{get:t[c],enumerable:!0})},Mt=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Bi(t))if(!Ri.call(n,i)&&i!==c)j(n,i,{get:()=>t[i],enumerable:!(f=Wi(t,i))||f.enumerable})}return n},ei=(n,t,c)=>(c=n!=null?bi(Mi(n)):{},Mt(t||!n||!n.__esModule?j(c,"default",{value:n,enumerable:!0}):c,n)),Hi=(n)=>Mt(j({},"__esModule",{value:!0}),n),Rt={};ji(Rt,{DEFAULT_REQUEST_TIMEOUT:()=>vi,NodeHttp2Handler:()=>nh,NodeHttpHandler:()=>qi,streamCollector:()=>ch});mt.exports=Hi(Rt);var jt=on(),et=In(),Ln=import.meta.require("http"),Dn=import.meta.require("https"),Pi=["ECONNRESET","EPIPE","ETIMEDOUT"],Ht=L((n)=>{let t={};for(let c of Object.keys(n)){let f=n[c];t[c]=Array.isArray(f)?f.join(","):f}return t},"getTransformedHeaders"),Jt=1000,li=L((n,t,c=0)=>{if(!c)return-1;let f=L((i)=>{let h=setTimeout(()=>{n.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${c} ms`),{name:"TimeoutError"}))},c-i),r=L((s)=>{if(s==null?void 0:s.connecting)s.on("connect",()=>{clearTimeout(h)});else clearTimeout(h)},"doWithSocket");if(n.socket)r(n.socket);else n.on("socket",r)},"registerTimeout");if(c<2000)return f(0),0;return setTimeout(f.bind(null,Jt),Jt)},"setConnectionTimeout"),ki=3000,Oi=L((n,{keepAlive:t,keepAliveMsecs:c},f=ki)=>{if(t!==!0)return-1;let i=L(()=>{if(n.socket)n.socket.setKeepAlive(t,c||0);else n.on("socket",(h)=>{h.setKeepAlive(t,c||0)})},"registerListener");if(f===0)return i(),0;return setTimeout(i,f)},"setSocketKeepAlive"),bt=3000,pi=L((n,t,c=0)=>{let f=L((i)=>{n.setTimeout(c-i,()=>{n.destroy(),t(Object.assign(new Error(`Connection timed out after ${c} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<c&&c<6000)return f(0),0;return setTimeout(f.bind(null,c===0?0:bt),bt)},"setSocketTimeout"),Pt=import.meta.require("stream"),Wt=1000;async function Nn(n,t,c=Wt){let f=t.headers??{},i=f.Expect||f.expect,h=-1,r=!1;if(i==="100-continue")await Promise.race([new Promise((s)=>{h=Number(setTimeout(s,Math.max(Wt,c)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(h),s()}),n.on("error",()=>{r=!0,clearTimeout(h),s()})})]);if(!r)lt(n,t.body)}L(Nn,"writeRequestBody");function lt(n,t){if(t instanceof Pt.Readable){t.pipe(n);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){n.end(t);return}let c=t;if(typeof c==="object"&&c.buffer&&typeof c.byteOffset==="number"&&typeof c.byteLength==="number"){n.end(Buffer.from(c.buffer,c.byteOffset,c.byteLength));return}n.end(Buffer.from(t));return}n.end()}L(lt,"writeBody");var vi=0,kt=class n{constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((c,f)=>{if(typeof t==="function")t().then((i)=>{c(this.resolveDefaultConfig(i))}).catch(f);else c(this.resolveDefaultConfig(t))})}static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}static checkSocketUsage(t,c,f=console){var i,h,r;let{sockets:s,requests:u,maxSockets:x}=t;if(typeof x!=="number"||x===1/0)return c;let y=15000;if(Date.now()-y<c)return c;if(s&&u)for(let w in s){let d=((i=s[w])==null?void 0:i.length)??0,T=((h=u[w])==null?void 0:h.length)??0;if(d>=x&&T>=2*x)return(r=f==null?void 0:f.warn)==null||r.call(f,`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${T} 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 c}resolveDefaultConfig(t){let{requestTimeout:c,connectionTimeout:f,socketTimeout:i,httpAgent:h,httpsAgent:r}=t||{},s=!0,u=50;return{connectionTimeout:f,requestTimeout:c??i,httpAgent:(()=>{if(h instanceof Ln.Agent||typeof(h==null?void 0:h.destroy)==="function")return h;return new Ln.Agent({keepAlive:!0,maxSockets:50,...h})})(),httpsAgent:(()=>{if(r instanceof Dn.Agent||typeof(r==null?void 0:r.destroy)==="function")return r;return new Dn.Agent({keepAlive:!0,maxSockets:50,...r})})(),logger:console}}destroy(){var t,c,f,i;(c=(t=this.config)==null?void 0:t.httpAgent)==null||c.destroy(),(i=(f=this.config)==null?void 0:f.httpsAgent)==null||i.destroy()}async handle(t,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;return new Promise((f,i)=>{let h=void 0,r=[],s=L(async(E)=>{await h,r.forEach(clearTimeout),f(E)},"resolve"),u=L(async(E)=>{await h,r.forEach(clearTimeout),i(E)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(c==null?void 0:c.aborted){let E=new Error("Request aborted");E.name="AbortError",u(E);return}let x=t.protocol==="https:",y=x?this.config.httpsAgent:this.config.httpAgent;r.push(setTimeout(()=>{this.socketWarningTimestamp=n.checkSocketUsage(y,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let w=et.buildQueryString(t.query||{}),d=void 0;if(t.username!=null||t.password!=null){let E=t.username??"",U=t.password??"";d=`${E}:${U}`}let T=t.path;if(w)T+=`?${w}`;if(t.fragment)T+=`#${t.fragment}`;let o=t.hostname??"";if(o[0]==="["&&o.endsWith("]"))o=t.hostname.slice(1,-1);else o=t.hostname;let I={headers:t.headers,host:o,method:t.method,path:T,port:t.port,agent:y,auth:d},F=(x?Dn.request:Ln.request)(I,(E)=>{let U=new jt.HttpResponse({statusCode:E.statusCode||-1,reason:E.statusMessage,headers:Ht(E.headers),body:E});s({response:U})});if(F.on("error",(E)=>{if(Pi.includes(E.code))u(Object.assign(E,{name:"TimeoutError"}));else u(E)}),c){let E=L(()=>{F.destroy();let U=new Error("Request aborted");U.name="AbortError",u(U)},"onAbort");if(typeof c.addEventListener==="function"){let U=c;U.addEventListener("abort",E,{once:!0}),F.once("close",()=>U.removeEventListener("abort",E))}else c.onabort=E}r.push(li(F,u,this.config.connectionTimeout)),r.push(pi(F,u,this.config.requestTimeout));let $=I.agent;if(typeof $==="object"&&"keepAlive"in $)r.push(Oi(F,{keepAlive:$.keepAlive,keepAliveMsecs:$.keepAliveMsecs}));h=Nn(F,t,this.config.requestTimeout).catch((E)=>{return r.forEach(clearTimeout),i(E)})})}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return{...f,[t]:c}})}httpHandlerConfigs(){return this.config??{}}};L(kt,"NodeHttpHandler");var qi=kt,Bt=import.meta.require("http2"),ai=ei(import.meta.require("http2")),Ot=class n{constructor(t){this.sessions=[],this.sessions=t??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(t){this.sessions.push(t)}contains(t){return this.sessions.includes(t)}remove(t){this.sessions=this.sessions.filter((c)=>c!==t)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(t){for(let c of this.sessions)if(c===t){if(!c.destroyed)c.destroy()}}};L(Ot,"NodeHttp2ConnectionPool");var mi=Ot,pt=class n{constructor(t){if(this.sessionCache=new Map,this.config=t,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(t,c){let f=this.getUrlString(t),i=this.sessionCache.get(f);if(i){let u=i.poll();if(u&&!this.config.disableConcurrency)return u}let h=ai.default.connect(f);if(this.config.maxConcurrency)h.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+t.destination.toString())});h.unref();let r=L(()=>{h.destroy(),this.deleteSession(f,h)},"destroySessionCb");if(h.on("goaway",r),h.on("error",r),h.on("frameError",r),h.on("close",()=>this.deleteSession(f,h)),c.requestTimeout)h.setTimeout(c.requestTimeout,r);let s=this.sessionCache.get(f)||new mi;return s.offerLast(h),this.sessionCache.set(f,s),h}deleteSession(t,c){let f=this.sessionCache.get(t);if(!f)return;if(!f.contains(c))return;f.remove(c),this.sessionCache.set(t,f)}release(t,c){var f;let i=this.getUrlString(t);(f=this.sessionCache.get(i))==null||f.offerLast(c)}destroy(){for(let[t,c]of this.sessionCache){for(let f of c){if(!f.destroyed)f.destroy();c.remove(f)}this.sessionCache.delete(t)}}setMaxConcurrentStreams(t){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=t}setDisableConcurrentStreams(t){this.config.disableConcurrency=t}getUrlString(t){return t.destination.toString()}};L(pt,"NodeHttp2ConnectionManager");var _i=pt,vt=class n{constructor(t){this.metadata={handlerProtocol:"h2"},this.connectionManager=new _i({}),this.configProvider=new Promise((c,f)=>{if(typeof t==="function")t().then((i)=>{c(i||{})}).catch(f);else c(t||{})})}static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}destroy(){this.connectionManager.destroy()}async handle(t,{abortSignal:c}={}){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:f,disableConcurrentStreams:i}=this.config;return new Promise((h,r)=>{var s;let u=!1,x=void 0,y=L(async(D)=>{await x,h(D)},"resolve"),w=L(async(D)=>{await x,r(D)},"reject");if(c==null?void 0:c.aborted){u=!0;let D=new Error("Request aborted");D.name="AbortError",w(D);return}let{hostname:d,method:T,port:o,protocol:I,query:C}=t,F="";if(t.username!=null||t.password!=null){let D=t.username??"",V=t.password??"";F=`${D}:${V}@`}let $=`${I}//${F}${d}${o?`:${o}`:""}`,E={destination:new URL($)},U=this.connectionManager.lease(E,{requestTimeout:(s=this.config)==null?void 0:s.sessionTimeout,disableConcurrentStreams:i||!1}),g=L((D)=>{if(i)this.destroySession(U);u=!0,w(D)},"rejectWithDestroy"),S=et.buildQueryString(C||{}),X=t.path;if(S)X+=`?${S}`;if(t.fragment)X+=`#${t.fragment}`;let Y=U.request({...t.headers,[Bt.constants.HTTP2_HEADER_PATH]:X,[Bt.constants.HTTP2_HEADER_METHOD]:T});if(U.ref(),Y.on("response",(D)=>{let V=new jt.HttpResponse({statusCode:D[":status"]||-1,headers:Ht(D),body:Y});if(u=!0,y({response:V}),i)U.close(),this.connectionManager.deleteSession($,U)}),f)Y.setTimeout(f,()=>{Y.close();let D=new Error(`Stream timed out because of no activity for ${f} ms`);D.name="TimeoutError",g(D)});if(c){let D=L(()=>{Y.close();let V=new Error("Request aborted");V.name="AbortError",g(V)},"onAbort");if(typeof c.addEventListener==="function"){let V=c;V.addEventListener("abort",D,{once:!0}),Y.once("close",()=>V.removeEventListener("abort",D))}else c.onabort=D}Y.on("frameError",(D,V,of)=>{g(new Error(`Frame type id ${D} in stream id ${of} has failed with code ${V}.`))}),Y.on("error",g),Y.on("aborted",()=>{g(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${Y.rstCode}.`))}),Y.on("close",()=>{if(U.unref(),i)U.destroy();if(!u)g(new Error("Unexpected error: http2 request did not get a response"))}),x=Nn(Y,t,f)})}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return{...f,[t]:c}})}httpHandlerConfigs(){return this.config??{}}destroySession(t){if(!t.destroyed)t.destroy()}};L(vt,"NodeHttp2Handler");var nh=vt,qt=class n extends Pt.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,c,f){this.bufferedBytes.push(t),f()}};L(qt,"Collector");var th=qt,ch=L((n)=>{if(fh(n))return at(n);return new Promise((t,c)=>{let f=new th;n.pipe(f),n.on("error",(i)=>{f.end(),c(i)}),f.on("error",c),f.on("finish",function(){let i=new Uint8Array(Buffer.concat(this.bufferedBytes));t(i)})})},"streamCollector"),fh=L((n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream,"isReadableStreamInstance");async function at(n){let t=[],c=n.getReader(),f=!1,i=0;while(!f){let{done:s,value:u}=await c.read();if(u)t.push(u),i+=u.length;f=s}let h=new Uint8Array(i),r=0;for(let s of t)h.set(s,r),r+=s.length;return h}L(at,"collectReadableStream")});var uc=N((Or,sc)=>{var{defineProperty:rn,getOwnPropertyDescriptor:ih,getOwnPropertyNames:hh}=Object,rh=Object.prototype.hasOwnProperty,G=(n,t)=>rn(n,"name",{value:t,configurable:!0}),sh=(n,t)=>{for(var c in t)rn(n,c,{get:t[c],enumerable:!0})},uh=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of hh(t))if(!rh.call(n,i)&&i!==c)rn(n,i,{get:()=>t[i],enumerable:!(f=ih(t,i))||f.enumerable})}return n},wh=(n)=>uh(rn({},"__esModule",{value:!0}),n),tc={};sh(tc,{FetchHttpHandler:()=>$h,keepAliveSupport:()=>hn,streamCollector:()=>dh});sc.exports=wh(tc);var nc=on(),Th=In();function cc(n=0){return new Promise((t,c)=>{if(n)setTimeout(()=>{let f=new Error(`Request did not complete within ${n} ms`);f.name="TimeoutError",c(f)},n)})}G(cc,"requestTimeout");var hn={supported:void 0},fc=class n{static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}constructor(t){if(typeof t==="function")this.configProvider=t().then((c)=>c||{});else this.config=t??{},this.configProvider=Promise.resolve(this.config);if(hn.supported===void 0)hn.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(t,{abortSignal:c}={}){var f;if(!this.config)this.config=await this.configProvider;let i=this.config.requestTimeout,h=this.config.keepAlive===!0,r=this.config.credentials;if(c==null?void 0:c.aborted){let $=new Error("Request aborted");return $.name="AbortError",Promise.reject($)}let s=t.path,u=Th.buildQueryString(t.query||{});if(u)s+=`?${u}`;if(t.fragment)s+=`#${t.fragment}`;let x="";if(t.username!=null||t.password!=null){let $=t.username??"",E=t.password??"";x=`${$}:${E}@`}let{port:y,method:w}=t,d=`${t.protocol}//${x}${t.hostname}${y?`:${y}`:""}${s}`,T=w==="GET"||w==="HEAD"?void 0:t.body,o={body:T,headers:new Headers(t.headers),method:w,credentials:r};if((f=this.config)==null?void 0:f.cache)o.cache=this.config.cache;if(T)o.duplex="half";if(typeof AbortController!=="undefined")o.signal=c;if(hn.supported)o.keepalive=h;if(typeof this.config.requestInit==="function")Object.assign(o,this.config.requestInit(t));let I=G(()=>{},"removeSignalEventListener"),C=new Request(d,o),F=[fetch(C).then(($)=>{let E=$.headers,U={};for(let S of E.entries())U[S[0]]=S[1];if($.body==null)return $.blob().then((S)=>({response:new nc.HttpResponse({headers:U,reason:$.statusText,statusCode:$.status,body:S})}));return{response:new nc.HttpResponse({headers:U,reason:$.statusText,statusCode:$.status,body:$.body})}}),cc(i)];if(c)F.push(new Promise(($,E)=>{let U=G(()=>{let g=new Error("Request aborted");g.name="AbortError",E(g)},"onAbort");if(typeof c.addEventListener==="function"){let g=c;g.addEventListener("abort",U,{once:!0}),I=G(()=>g.removeEventListener("abort",U),"removeSignalEventListener")}else c.onabort=U}));return Promise.race(F).finally(I)}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return f[t]=c,f})}httpHandlerConfigs(){return this.config??{}}};G(fc,"FetchHttpHandler");var $h=fc,xh=nn(),dh=G((n)=>{if(typeof Blob==="function"&&n instanceof Blob)return ic(n);return hc(n)},"streamCollector");async function ic(n){let t=await rc(n),c=xh.fromBase64(t);return new Uint8Array(c)}G(ic,"collectBlob");async function hc(n){let t=[],c=n.getReader(),f=!1,i=0;while(!f){let{done:s,value:u}=await c.read();if(u)t.push(u),i+=u.length;f=s}let h=new Uint8Array(i),r=0;for(let s of t)h.set(s,r),r+=s.length;return h}G(hc,"collectStream");function rc(n){return new Promise((t,c)=>{let f=new FileReader;f.onloadend=()=>{if(f.readyState!==2)return c(new Error("Reader aborted too early"));let i=f.result??"",h=i.indexOf(","),r=h>-1?h+1:i.length;t(i.substring(r))},f.onabort=()=>c(new Error("Read aborted")),f.onerror=()=>c(f.error),f.readAsDataURL(n)})}G(rc,"readToBase64")});var Cc=N((pr,Ec)=>{var{defineProperty:sn,getOwnPropertyDescriptor:Eh,getOwnPropertyNames:Ch}=Object,Fh=Object.prototype.hasOwnProperty,wc=(n,t)=>sn(n,"name",{value:t,configurable:!0}),oh=(n,t)=>{for(var c in t)sn(n,c,{get:t[c],enumerable:!0})},Uh=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Ch(t))if(!Fh.call(n,i)&&i!==c)sn(n,i,{get:()=>t[i],enumerable:!(f=Eh(t,i))||f.enumerable})}return n},yh=(n)=>Uh(sn({},"__esModule",{value:!0}),n),Tc={};oh(Tc,{fromHex:()=>xc,toHex:()=>dc});Ec.exports=yh(Tc);var $c={},gn={};for(let n=0;n<256;n++){let t=n.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;$c[n]=t,gn[t]=n}function xc(n){if(n.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let t=new Uint8Array(n.length/2);for(let c=0;c<n.length;c+=2){let f=n.slice(c,c+2).toLowerCase();if(f in gn)t[c/2]=gn[f];else throw new Error(`Cannot decode unrecognized sequence ${f} as hexadecimal`)}return t}wc(xc,"fromHex");function dc(n){let t="";for(let c=0;c<n.byteLength;c++)t+=$c[n[c]];return t}wc(dc,"toHex")});var e=N((Fc)=>{Object.defineProperty(Fc,"__esModule",{value:!0});Fc.isReadableStream=void 0;var Ih=(n)=>{var t;return typeof ReadableStream==="function"&&(((t=n===null||n===void 0?void 0:n.constructor)===null||t===void 0?void 0:t.name)===ReadableStream.name||n instanceof ReadableStream)};Fc.isReadableStream=Ih});var Nc=N((Lc)=>{Object.defineProperty(Lc,"__esModule",{value:!0});Lc.sdkStreamMixin=void 0;var Lh=uc(),Dh=nn(),Nh=Cc(),gh=m(),Uc=e(),yc="The stream has already been transformed.",Sh=(n)=>{var t,c;if(!Ic(n)&&!Uc.isReadableStream(n)){let r=((c=(t=n===null||n===void 0?void 0:n.__proto__)===null||t===void 0?void 0:t.constructor)===null||c===void 0?void 0:c.name)||n;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let f=!1,i=async()=>{if(f)throw new Error(yc);return f=!0,await Lh.streamCollector(n)},h=(r)=>{if(typeof r.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return r.stream()};return Object.assign(n,{transformToByteArray:i,transformToString:async(r)=>{let s=await i();if(r==="base64")return Dh.toBase64(s);else if(r==="hex")return Nh.toHex(s);else if(r===void 0||r==="utf8"||r==="utf-8")return gh.toUtf8(s);else if(typeof TextDecoder==="function")return new TextDecoder(r).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(f)throw new Error(yc);if(f=!0,Ic(n))return h(n);else if(Uc.isReadableStream(n))return n;else throw new Error(`Cannot transform payload to web stream, got ${n}`)}})};Lc.sdkStreamMixin=Sh;var Ic=(n)=>typeof Blob==="function"&&n instanceof Blob});var zc=N((Sc)=>{Object.defineProperty(Sc,"__esModule",{value:!0});Sc.sdkStreamMixin=void 0;var Yh=_t(),zh=R(),Sn=import.meta.require("stream"),Vh=import.meta.require("util"),Zh=Nc(),gc="The stream has already been transformed.",Gh=(n)=>{var t,c;if(!(n instanceof Sn.Readable))try{return Zh.sdkStreamMixin(n)}catch(h){let r=((c=(t=n===null||n===void 0?void 0:n.__proto__)===null||t===void 0?void 0:t.constructor)===null||c===void 0?void 0:c.name)||n;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let f=!1,i=async()=>{if(f)throw new Error(gc);return f=!0,await Yh.streamCollector(n)};return Object.assign(n,{transformToByteArray:i,transformToString:async(h)=>{let r=await i();if(h===void 0||Buffer.isEncoding(h))return zh.fromArrayBuffer(r.buffer,r.byteOffset,r.byteLength).toString(h);else return new Vh.TextDecoder(h).decode(r)},transformToWebStream:()=>{if(f)throw new Error(gc);if(n.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Sn.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 f=!0,Sn.Readable.toWeb(n)}})};Sc.sdkStreamMixin=Gh});var Gc=N((Vc)=>{Object.defineProperty(Vc,"__esModule",{value:!0});Vc.splitStream=void 0;async function Qh(n){if(typeof n.stream==="function")n=n.stream();return n.tee()}Vc.splitStream=Qh});var Ac=N((Kc)=>{Object.defineProperty(Kc,"__esModule",{value:!0});Kc.splitStream=void 0;var Qc=import.meta.require("stream"),Kh=Gc(),Xh=e();async function Ah(n){if(Xh.isReadableStream(n))return Kh.splitStream(n);let t=new Qc.PassThrough,c=new Qc.PassThrough;return n.pipe(t),n.pipe(c),[t,c]}Kc.splitStream=Ah});var Wc=N((Jc)=>{Object.defineProperty(Jc,"__esModule",{value:!0});Jc.headStream=void 0;async function Jh(n,t){var c;let f=0,i=[],h=n.getReader(),r=!1;while(!r){let{done:x,value:y}=await h.read();if(y)i.push(y),f+=(c=y===null||y===void 0?void 0:y.byteLength)!==null&&c!==void 0?c:0;if(f>=t)break;r=x}h.releaseLock();let s=new Uint8Array(Math.min(t,f)),u=0;for(let x of i){if(x.byteLength>s.byteLength-u){s.set(x.subarray(0,s.byteLength-u),u);break}else s.set(x,u);u+=x.length}return s}Jc.headStream=Jh});var jc=N((Mc)=>{Object.defineProperty(Mc,"__esModule",{value:!0});Mc.headStream=void 0;var bh=import.meta.require("stream"),Wh=Wc(),Bh=e(),Mh=(n,t)=>{if(Bh.isReadableStream(n))return Wh.headStream(n,t);return new Promise((c,f)=>{let i=new Bc;i.limit=t,n.pipe(i),n.on("error",(h)=>{i.end(),f(h)}),i.on("error",f),i.on("finish",function(){let h=new Uint8Array(Buffer.concat(this.buffers));c(h)})})};Mc.headStream=Mh;class Bc extends bh.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(n,t,c){var f;if(this.buffers.push(n),this.bytesBuffered+=(f=n.byteLength)!==null&&f!==void 0?f:0,this.bytesBuffered>=this.limit){let i=this.bytesBuffered-this.limit,h=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=h.subarray(0,h.byteLength-i),this.emit("finish")}c()}}});var Oc=N((cs,b)=>{var{defineProperty:un,getOwnPropertyDescriptor:Rh,getOwnPropertyNames:jh}=Object,eh=Object.prototype.hasOwnProperty,Vn=(n,t)=>un(n,"name",{value:t,configurable:!0}),Hh=(n,t)=>{for(var c in t)un(n,c,{get:t[c],enumerable:!0})},Yn=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of jh(t))if(!eh.call(n,i)&&i!==c)un(n,i,{get:()=>t[i],enumerable:!(f=Rh(t,i))||f.enumerable})}return n},H=(n,t,c)=>(Yn(n,t,"default"),c&&Yn(c,t,"default")),Ph=(n)=>Yn(un({},"__esModule",{value:!0}),n),J={};Hh(J,{Uint8ArrayBlobAdapter:()=>zn});b.exports=Ph(J);var ec=nn(),Hc=m();function Pc(n,t="utf-8"){if(t==="base64")return ec.toBase64(n);return Hc.toUtf8(n)}Vn(Pc,"transformToString");function lc(n,t){if(t==="base64")return zn.mutate(ec.fromBase64(n));return zn.mutate(Hc.fromUtf8(n))}Vn(lc,"transformFromString");var kc=class n extends Uint8Array{static fromString(t,c="utf-8"){switch(typeof t){case"string":return lc(t,c);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,n.prototype),t}transformToString(t="utf-8"){return Pc(this,t)}};Vn(kc,"Uint8ArrayBlobAdapter");var zn=kc;H(J,Ut(),b.exports);H(J,zc(),b.exports);H(J,Ac(),b.exports);H(J,jc(),b.exports);H(J,e(),b.exports)});var ln=W(xn(),1);class gf{constructor(n){this.config=n,this.middlewareStack=ln.constructStack()}send(n,t,c){let f=typeof t!=="function"?t:void 0,i=typeof t==="function"?t:c,h=f===void 0&&this.config.cacheMiddleware===!0,r;if(h){if(!this.handlers)this.handlers=new WeakMap;let s=this.handlers;if(s.has(n.constructor))r=s.get(n.constructor);else r=n.resolveMiddleware(this.middlewareStack,this.config,f),s.set(n.constructor,r)}else delete this.handlers,r=n.resolveMiddleware(this.middlewareStack,this.config,f);if(i)r(n).then((s)=>i(null,s.output),(s)=>i(s)).catch(()=>{});else return r(n).then((s)=>s.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var kn=W(xn(),1),On=W(p(),1);class pn{constructor(){this.middlewareStack=kn.constructStack()}static classBuilder(){return new vn}resolveMiddlewareWithContext(n,t,c,{middlewareFn:f,clientName:i,commandName:h,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,smithyContext:u,additionalContext:x,CommandCtor:y}){for(let I of f.bind(this)(y,n,t,c))this.middlewareStack.use(I);let w=n.concat(this.middlewareStack),{logger:d}=t,T={logger:d,clientName:i,commandName:h,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,[On.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...x},{requestHandler:o}=t;return w.resolve((I)=>o.handle(I.request,c||{}),T)}}class vn{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(n)=>n,this._outputFilterSensitiveLog=(n)=>n,this._serializer=null,this._deserializer=null}init(n){this._init=n}ep(n){return this._ep=n,this}m(n){return this._middlewareFn=n,this}s(n,t,c={}){return this._smithyContext={service:n,operation:t,...c},this}c(n={}){return this._additionalContext=n,this}n(n,t){return this._clientName=n,this._commandName=t,this}f(n=(c)=>c,t=(c)=>c){return this._inputFilterSensitiveLog=n,this._outputFilterSensitiveLog=t,this}ser(n){return this._serializer=n,this}de(n){return this._deserializer=n,this}build(){let n=this,t;return t=class extends pn{static getEndpointParameterInstructions(){return n._ep}constructor(...[c]){super();this.serialize=n._serializer,this.deserialize=n._deserializer,this.input=c??{},n._init(this)}resolveMiddleware(c,f,i){return this.resolveMiddlewareWithContext(c,f,i,{CommandCtor:t,middlewareFn:n._middlewareFn,clientName:n._clientName,commandName:n._commandName,inputFilterSensitiveLog:n._inputFilterSensitiveLog,outputFilterSensitiveLog:n._outputFilterSensitiveLog,smithyContext:n._smithyContext,additionalContext:n._additionalContext})}}}}var Gr="***SensitiveInformation***";var Kr=(n,t)=>{for(let c of Object.keys(n)){let f=n[c],i=async function(r,s,u){let x=new f(r);if(typeof s==="function")this.send(x,s);else if(typeof u==="function"){if(typeof s!=="object")throw new Error(`Expected http options but got ${typeof s}`);this.send(x,s||{},u)}else return this.send(x,s)},h=(c[0].toLowerCase()+c.slice(1)).replace(/Command$/,"");t.prototype[h]=i}};class qn extends Error{constructor(n){super(n.message);Object.setPrototypeOf(this,qn.prototype),this.name=n.name,this.$fault=n.$fault,this.$metadata=n.$metadata}}var an=(n,t={})=>{Object.entries(t).filter(([,f])=>f!==void 0).forEach(([f,i])=>{if(n[f]==null||n[f]==="")n[f]=i});let c=n.message||n.Message||"UnknownError";return n.message=c,delete n.Message,n};class Sf{trace(){}debug(){}info(){}warn(){}error(){}}var wn=W(Oc(),1),fs=async(n=new Uint8Array,t)=>{if(n instanceof Uint8Array)return wn.Uint8ArrayBlobAdapter.mutate(n);if(!n)return wn.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let c=t.streamCollector(n);return wn.Uint8ArrayBlobAdapter.mutate(await c)};var hs=(n)=>{switch(n){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${n}"`)}};var lh=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string"){let t=parseFloat(n);if(!Number.isNaN(t)){if(String(t)!==String(n))tf.warn(nf(`Expected number but observed string: ${n}`));return t}}if(typeof n==="number")return n;throw new TypeError(`Expected number, got ${typeof n}: ${n}`)},kh=Math.ceil(340282346638528860000000000000000000000),pc=(n)=>{let t=lh(n);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>kh)throw new TypeError(`Expected 32-bit float, got ${n}`)}return t},Zn=(n)=>{if(n===null||n===void 0)return;if(Number.isInteger(n)&&!Number.isNaN(n))return n;throw new TypeError(`Expected integer, got ${typeof n}: ${n}`)};var vc=(n)=>Gn(n,32),qc=(n)=>Gn(n,16),ac=(n)=>Gn(n,8),Gn=(n,t)=>{let c=Zn(n);if(c!==void 0&&Oh(c,t)!==c)throw new TypeError(`Expected ${t}-bit integer, got ${n}`);return c},Oh=(n,t)=>{switch(t){case 32:return Int32Array.of(n)[0];case 16:return Int16Array.of(n)[0];case 8:return Int8Array.of(n)[0]}},rs=(n,t)=>{if(n===null||n===void 0){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return n},ss=(n)=>{if(n===null||n===void 0)return;if(typeof n==="object"&&!Array.isArray(n))return n;let t=Array.isArray(n)?"array":typeof n;throw new TypeError(`Expected object, got ${t}: ${n}`)},us=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string")return n;if(["boolean","number","bigint"].includes(typeof n))return tf.warn(nf(`Expected string, got ${typeof n}: ${n}`)),String(n);throw new TypeError(`Expected string, got ${typeof n}: ${n}`)};var mc=(n)=>{if(typeof n=="string")return pc(P(n));return pc(n)},ph=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,P=(n)=>{let t=n.match(ph);if(t===null||t[0].length!==n.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(n)};var ws=(n)=>{if(typeof n==="string")return Zn(P(n));return Zn(n)};var Ts=(n)=>{if(typeof n==="string")return vc(P(n));return vc(n)},B=(n)=>{if(typeof n==="string")return qc(P(n));return qc(n)},_c=(n)=>{if(typeof n==="string")return ac(P(n));return ac(n)},nf=(n)=>{return String(new TypeError(n).stack||n).split("\n").slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join("\n")},tf={warn:console.warn};var vh=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Kn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Es(n){let t=n.getUTCFullYear(),c=n.getUTCMonth(),f=n.getUTCDay(),i=n.getUTCDate(),h=n.getUTCHours(),r=n.getUTCMinutes(),s=n.getUTCSeconds(),u=i<10?`0${i}`:`${i}`,x=h<10?`0${h}`:`${h}`,y=r<10?`0${r}`:`${r}`,w=s<10?`0${s}`:`${s}`;return`${vh[f]}, ${u} ${Kn[c]} ${t} ${x}:${y}:${w} GMT`}var qh=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Cs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=qh.exec(n);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[c,f,i,h,r,s,u,x]=t,y=B(M(f)),w=Z(i,"month",1,12),d=Z(h,"day",1,31);return l(y,w,d,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x})},ah=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Fs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=ah.exec(n);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[c,f,i,h,r,s,u,x,y]=t,w=B(M(f)),d=Z(i,"month",1,12),T=Z(h,"day",1,31),o=l(w,d,T,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x});if(y.toUpperCase()!="Z")o.setTime(o.getTime()-ur(y));return o},mh=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$/),_h=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$/),nr=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})$/),os=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=mh.exec(n);if(t){let[c,f,i,h,r,s,u,x]=t;return l(B(M(h)),Qn(i),Z(f,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x})}if(t=_h.exec(n),t){let[c,f,i,h,r,s,u,x]=t;return fr(l(tr(h),Qn(i),Z(f,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x}))}if(t=nr.exec(n),t){let[c,f,i,h,r,s,u,x]=t;return l(B(M(x)),Qn(f),Z(i.trimLeft(),"day",1,31),{hours:h,minutes:r,seconds:s,fractionalMilliseconds:u})}throw new TypeError("Invalid RFC-7231 date-time value")};var l=(n,t,c,f)=>{let i=t-1;return hr(n,i,c),new Date(Date.UTC(n,i,c,Z(f.hours,"hour",0,23),Z(f.minutes,"minute",0,59),Z(f.seconds,"seconds",0,60),sr(f.fractionalMilliseconds)))},tr=(n)=>{let t=new Date().getUTCFullYear(),c=Math.floor(t/100)*100+B(M(n));if(c<t)return c+100;return c},cr=1576800000000,fr=(n)=>{if(n.getTime()-new Date().getTime()>cr)return new Date(Date.UTC(n.getUTCFullYear()-100,n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()));return n},Qn=(n)=>{let t=Kn.indexOf(n);if(t<0)throw new TypeError(`Invalid month: ${n}`);return t+1},ir=[31,28,31,30,31,30,31,31,30,31,30,31],hr=(n,t,c)=>{let f=ir[t];if(t===1&&rr(n))f=29;if(c>f)throw new TypeError(`Invalid day for ${Kn[t]} in ${n}: ${c}`)},rr=(n)=>{return n%4===0&&(n%100!==0||n%400===0)},Z=(n,t,c,f)=>{let i=_c(M(n));if(i<c||i>f)throw new TypeError(`${t} must be between ${c} and ${f}, inclusive`);return i},sr=(n)=>{if(n===null||n===void 0)return 0;return mc("0."+n)*1000},ur=(n)=>{let t=n[0],c=1;if(t=="+")c=1;else if(t=="-")c=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);let f=Number(n.substring(1,3)),i=Number(n.substring(4,6));return c*(f*60+i)*60*1000},M=(n)=>{let t=0;while(t<n.length-1&&n.charAt(t)==="0")t++;if(t===0)return n;return n.slice(t)};var wr=({output:n,parsedBody:t,exceptionCtor:c,errorCode:f})=>{let i=Tr(n),h=i.httpStatusCode?i.httpStatusCode+"":void 0,r=new c({name:t?.code||t?.Code||f||h||"UnknownError",$fault:"client",$metadata:i});throw an(r,t)},Is=(n)=>{return({output:t,parsedBody:c,errorCode:f})=>{wr({output:t,parsedBody:c,exceptionCtor:n,errorCode:f})}},Tr=(n)=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]});var Ds=(n)=>{switch(n){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var cf=!1,gs=(n)=>{if(n&&!cf&&parseInt(n.substring(1,n.indexOf(".")))<16)cf=!0};var Xn=W(p(),1);var ff=(n)=>{let t=[];for(let c in Xn.AlgorithmId){let f=Xn.AlgorithmId[c];if(n[f]===void 0)continue;t.push({algorithmId:()=>f,checksumConstructor:()=>n[f]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(c){this._checksumAlgorithms.push(c)},checksumAlgorithms(){return this._checksumAlgorithms}}},hf=(n)=>{let t={};return n.checksumAlgorithms().forEach((c)=>{t[c.algorithmId()]=c.checksumConstructor()}),t};var rf=(n)=>{let t=n.retryStrategy;return{setRetryStrategy(c){t=c},retryStrategy(){return t}}},sf=(n)=>{let t={};return t.retryStrategy=n.retryStrategy(),t};var Gs=(n)=>{return{...ff(n),...rf(n)}};var Qs=(n)=>{return{...hf(n),...sf(n)}};function $r(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var bs=(n)=>Array.isArray(n)?n:[n];var An=function(){let n=Object.getPrototypeOf(this).constructor,c=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(c,n.prototype),c};An.prototype=Object.create(String.prototype,{constructor:{value:An,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(An,String);function xr(n,t,c){let f,i,h;if(typeof t==="undefined"&&typeof c==="undefined")f={},h=n;else if(f=n,typeof t==="function")return i=t,h=c,dr(f,i,h);else h=t;for(let r of Object.keys(h)){if(!Array.isArray(h[r])){f[r]=h[r];continue}uf(f,null,h,r)}return f}var Rs=(n,t)=>{let c={};for(let f in t)uf(c,n,t,f);return c},dr=(n,t,c)=>{return xr(n,Object.entries(c).reduce((f,[i,h])=>{if(Array.isArray(h))f[i]=h;else if(typeof h==="function")f[i]=[t,h()];else f[i]=[t,h];return f},{}))},uf=(n,t,c,f)=>{if(t!==null){let r=c[f];if(typeof r==="function")r=[,r];let[s=Er,u=Cr,x=f]=r;if(typeof s==="function"&&s(t[x])||typeof s!=="function"&&!!s)n[f]=u(t[x]);return}let[i,h]=c[f];if(typeof h==="function"){let r,s=i===void 0&&(r=h())!=null,u=typeof i==="function"&&!!i(void 0)||typeof i!=="function"&&!!i;if(s)n[f]=r;else if(u)n[f]=h()}else{let r=i===void 0&&h!=null,s=typeof i==="function"&&!!i(h)||typeof i!=="function"&&!!i;if(r||s)n[f]=h}},Er=(n)=>n!=null,Cr=(n)=>n;var Ps=(n)=>n.toISOString().replace(".000Z","Z");var wf=(n)=>{if(n==null)return{};if(Array.isArray(n))return n.filter((t)=>t!=null).map(wf);if(typeof n==="object"){let t={};for(let c of Object.keys(n)){if(n[c]==null)continue;t[c]=wf(n[c])}return t}return n};var o0=(n)=>{let t=n.httpHandler;return{setHttpHandler(c){t=c},httpHandler(){return t},updateHttpClientConfig(c,f){t.updateHttpClientConfig(c,f)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},U0=(n)=>{return{httpHandler:n.httpHandler()}};var Fr=W(p(),1);class Jn{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 t=new Jn({...n,headers:{...n.headers}});if(t.query)t.query=or(t.query);return t}static isInstance(n){if(!n)return!1;let t=n;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return Jn.clone(this)}}function or(n){return Object.keys(n).reduce((t,c)=>{let f=n[c];return{...t,[c]:Array.isArray(f)?[...f]:f}},{})}class Tn{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 t=n;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var k=(n)=>encodeURIComponent(n).replace(/[!'()*]/g,Ur),Ur=(n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`;function bn(n){let t=[];for(let c of Object.keys(n).sort()){let f=n[c];if(c=k(c),Array.isArray(f))for(let i=0,h=f.length;i<h;i++)t.push(`${c}=${k(f[i])}`);else{let i=c;if(f||typeof f==="string")i+=`=${k(f)}`;t.push(i)}}return t.join("&")}import{Agent as Cf,request as Lr}from"http";import{Agent as Ff,request as Dr}from"https";var Tf=["ECONNRESET","EPIPE","ETIMEDOUT"];var Wn=(n)=>{let t={};for(let c of Object.keys(n)){let f=n[c];t[c]=Array.isArray(f)?f.join(","):f}return t};var $f=(n,t,c=0)=>{if(!c)return-1;let f=(i)=>{let h=setTimeout(()=>{n.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${c} ms`),{name:"TimeoutError"}))},c-i),r=(s)=>{if(s?.connecting)s.on("connect",()=>{clearTimeout(h)});else clearTimeout(h)};if(n.socket)r(n.socket);else n.on("socket",r)};if(c<2000)return f(0),0;return setTimeout(f.bind(null,1000),1000)};var xf=(n,{keepAlive:t,keepAliveMsecs:c},f=3000)=>{if(t!==!0)return-1;let i=()=>{if(n.socket)n.socket.setKeepAlive(t,c||0);else n.on("socket",(h)=>{h.setKeepAlive(t,c||0)})};if(f===0)return i(),0;return setTimeout(i,f)};var df=(n,t,c=0)=>{let f=(i)=>{n.setTimeout(c-i,()=>{n.destroy(),t(Object.assign(new Error(`Connection timed out after ${c} ms`),{name:"TimeoutError"}))})};if(0<c&&c<6000)return f(0),0;return setTimeout(f.bind(null,c===0?0:3000),3000)};import{Readable as yr}from"stream";var Ef=1000;async function Bn(n,t,c=Ef){let f=t.headers??{},i=f.Expect||f.expect,h=-1,r=!1;if(i==="100-continue")await Promise.race([new Promise((s)=>{h=Number(setTimeout(s,Math.max(Ef,c)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(h),s()}),n.on("error",()=>{r=!0,clearTimeout(h),s()})})]);if(!r)Ir(n,t.body)}function Ir(n,t){if(t instanceof yr){t.pipe(n);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){n.end(t);return}let c=t;if(typeof c==="object"&&c.buffer&&typeof c.byteOffset==="number"&&typeof c.byteLength==="number"){n.end(Buffer.from(c.buffer,c.byteOffset,c.byteLength));return}n.end(Buffer.from(t));return}n.end()}class Mn{static create(n){if(typeof n?.handle==="function")return n;return new Mn(n)}static checkSocketUsage(n,t,c=console){let{sockets:f,requests:i,maxSockets:h}=n;if(typeof h!=="number"||h===1/0)return t;let r=15000;if(Date.now()-r<t)return t;if(f&&i)for(let s in f){let u=f[s]?.length??0,x=i[s]?.length??0;if(u>=h&&x>=2*h)return c?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${x} additional requests are enqueued.
4
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
5
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,c)=>{if(typeof n==="function")n().then((f)=>{t(this.resolveDefaultConfig(f))}).catch(c);else t(this.resolveDefaultConfig(n))})}resolveDefaultConfig(n){let{requestTimeout:t,connectionTimeout:c,socketTimeout:f,httpAgent:i,httpsAgent:h}=n||{},r=!0,s=50;return{connectionTimeout:c,requestTimeout:t??f,httpAgent:(()=>{if(i instanceof Cf||typeof i?.destroy==="function")return i;return new Cf({keepAlive:!0,maxSockets:50,...i})})(),httpsAgent:(()=>{if(h instanceof Ff||typeof h?.destroy==="function")return h;return new Ff({keepAlive:!0,maxSockets:50,...h})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(n,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;return new Promise((c,f)=>{let i=void 0,h=[],r=async($)=>{await i,h.forEach(clearTimeout),c($)},s=async($)=>{await i,h.forEach(clearTimeout),f($)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){let $=new Error("Request aborted");$.name="AbortError",s($);return}let u=n.protocol==="https:",x=u?this.config.httpsAgent:this.config.httpAgent;h.push(setTimeout(()=>{this.socketWarningTimestamp=Mn.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let y=bn(n.query||{}),w=void 0;if(n.username!=null||n.password!=null){let $=n.username??"",E=n.password??"";w=`${$}:${E}`}let d=n.path;if(y)d+=`?${y}`;if(n.fragment)d+=`#${n.fragment}`;let T=n.hostname??"";if(T[0]==="["&&T.endsWith("]"))T=n.hostname.slice(1,-1);else T=n.hostname;let o={headers:n.headers,host:T,method:n.method,path:d,port:n.port,agent:x,auth:w},C=(u?Dr:Lr)(o,($)=>{let E=new Tn({statusCode:$.statusCode||-1,reason:$.statusMessage,headers:Wn($.headers),body:$});r({response:E})});if(C.on("error",($)=>{if(Tf.includes($.code))s(Object.assign($,{name:"TimeoutError"}));else s($)}),t){let $=()=>{C.destroy();let E=new Error("Request aborted");E.name="AbortError",s(E)};if(typeof t.addEventListener==="function"){let E=t;E.addEventListener("abort",$,{once:!0}),C.once("close",()=>E.removeEventListener("abort",$))}else t.onabort=$}h.push($f(C,s,this.config.connectionTimeout)),h.push(df(C,s,this.config.requestTimeout));let F=o.agent;if(typeof F==="object"&&"keepAlive"in F)h.push(xf(C,{keepAlive:F.keepAlive,keepAliveMsecs:F.keepAliveMsecs}));i=Bn(C,n,this.config.requestTimeout).catch(($)=>{return h.forEach(clearTimeout),f($)})})}updateHttpClientConfig(n,t){this.config=void 0,this.configProvider=this.configProvider.then((c)=>{return{...c,[n]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as Nr}from"stream";class Rn extends Nr{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,t,c){this.bufferedBytes.push(n),c()}}var Du=(n)=>{if(gr(n))return Sr(n);return new Promise((t,c)=>{let f=new Rn;n.pipe(f),n.on("error",(i)=>{f.end(),c(i)}),f.on("error",c),f.on("finish",function(){let i=new Uint8Array(Buffer.concat(this.bufferedBytes));t(i)})})},gr=(n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream;async function Sr(n){let t=[],c=n.getReader(),f=!1,i=0;while(!f){let{done:s,value:u}=await c.read();if(u)t.push(u),i+=u.length;f=s}let h=new Uint8Array(i),r=0;for(let s of t)h.set(s,r),r+=s.length;return h}export{o0 as ia,U0 as ja,Jn as ka,Tn as la,Sf as ma,xn as na,gf as oa,nt as pa,m as qa,on as ra,Qt as sa,Cc as ta,Oc as ua,fs as va,pn as wa,Gr as xa,Kr as ya,hs as za,Zn as Aa,vc as Ba,rs as Ca,ss as Da,us as Ea,ws as Fa,Ts as Ga,Es as Ha,Cs as Ia,Fs as Ja,os as Ka,qn as La,an as Ma,Is as Na,Ds as Oa,gs as Pa,Gs as Qa,Qs as Ra,$r as Sa,bs as Ta,xr as Ua,Rs as Va,Ps as Wa,wf as Xa,k as Ya,Mn as Za,Du as _a};
6
-
7
- //# debugId=373609A18F5780BB64756E2164756E21