create-sailor 1.7.3 → 1.8.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.
- package/README.md +9 -0
- package/dist/aws-kms-EYG3LGYA.js +1 -0
- package/dist/chunk-224RJRPV.js +5 -0
- package/dist/chunk-2YUF6TO6.js +2 -0
- package/dist/chunk-3T4EOSMQ.js +1 -0
- package/dist/chunk-4AGDXYPL.js +1 -0
- package/dist/chunk-76FD5Z7D.js +23 -0
- package/dist/chunk-7OZT53MS.js +1 -0
- package/dist/chunk-AAIUIEEA.js +1 -0
- package/dist/chunk-C6CKWQY5.js +20 -0
- package/dist/chunk-CHWVD37K.js +1 -0
- package/dist/chunk-EBTFPGDR.js +9 -0
- package/dist/chunk-EIQ2HSZP.js +1 -0
- package/dist/chunk-FSRPMVAS.js +1 -0
- package/dist/chunk-IY2KKEUD.js +1 -0
- package/dist/chunk-M3QJPQWS.js +1 -0
- package/dist/chunk-OWZF7P72.js +1 -0
- package/dist/chunk-QSLKOXQ6.js +1 -0
- package/dist/chunk-S4HCBMFP.js +1 -0
- package/dist/chunk-TX7AAHER.js +1 -0
- package/dist/chunk-UU4YUKYZ.js +40 -0
- package/dist/chunk-WI7DO2VU.js +1 -0
- package/dist/chunk-XB6R2VIU.js +1 -0
- package/dist/chunk-XPRSUMI6.js +1 -0
- package/dist/chunk-ZCWB3HFB.js +1 -0
- package/dist/credits-7FJY7HK2.js +2613 -0
- package/dist/dist-LOLT3W3R.js +1 -0
- package/dist/dist-V6L2DNL2.js +5 -0
- package/dist/dist-es-3AHFNYTD.js +5 -0
- package/dist/dist-es-6KZILXYZ.js +1 -0
- package/dist/dist-es-H627TNCU.js +1 -0
- package/dist/dist-es-I6TTSEP7.js +2 -0
- package/dist/dist-es-JATELSE4.js +1 -0
- package/dist/dist-es-NRANDF25.js +2 -0
- package/dist/dist-es-YSAFQMS4.js +1 -0
- package/dist/event-streams-IPTOYMEP.js +1 -0
- package/dist/index.js +358 -419
- package/dist/loadSso-FR7LG5FX.js +1 -0
- package/dist/local-BUKM6VCO.js +1 -0
- package/dist/query_compiler_fast_bg.postgresql-FOSFFKA5.js +2 -0
- package/dist/query_compiler_fast_bg.postgresql.wasm-base64-JU7X67WB.js +1 -0
- package/dist/signin-N4XQB5ZB.js +1 -0
- package/dist/sso-oidc-FXPYRI5I.js +1 -0
- package/dist/sts-SIEJPPW3.js +6 -0
- package/package.json +21 -20
- package/templates/backends/gateway/package.json +4 -3
- package/templates/backends/gateway/src/index.ts +0 -4
- package/templates/backends/gateway/src/node.ts +5 -0
- package/templates/backends/gateway/src/worker.ts +11 -0
- package/templates/deploy/Dockerfile.web +1 -1
- package/templates/deploy/wrangler.gateway.toml +11 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as Ne,b as qe,f as C,g as h}from"./chunk-QSLKOXQ6.js";import{a as E}from"./chunk-76FD5Z7D.js";import{a as it}from"./chunk-7OZT53MS.js";import{a as Xt,b as Vt,g as Ft}from"./chunk-M3QJPQWS.js";import{a as Pt,b as It}from"./chunk-XPRSUMI6.js";import{$ as Lt,A as dt,B as yt,C as mt,D as xt,E as Rt,F as vt,G as k,H as Kt,I as ft,J as gt,K as St,L as _t,M as Ct,N as ht,Q as $t,R as Dt,S as At,T as kt,U as Mt,V as bt,W as Ot,X as wt,Y as M,Z as Tt,_ as Ut,a as Xe,aa as Nt,b as Ve,ba as qt,c as Fe,ca as Ht,d as He,da as jt,e as je,ea as Wt,f as We,fa as zt,g as Ge,ga as Bt,h as ze,ha as Qt,i as Be,ia as Yt,k as ot,l as nt,n as st,o as Te,v as at,w as ct,x as pt,y as lt,z as ut}from"./chunk-C6CKWQY5.js";import{a as rt,c as f}from"./chunk-IY2KKEUD.js";import{a as Et}from"./chunk-ZCWB3HFB.js";import{a as Gt}from"./chunk-WI7DO2VU.js";import{b as Qe,c as Ze,e as et,f as tt}from"./chunk-224RJRPV.js";import{d as Ye,e as Je}from"./chunk-XB6R2VIU.js";import{b as S}from"./chunk-TX7AAHER.js";import{randomUUID as is}from"crypto";var b=class extends it{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,errorTypeRegistries:o,serviceTarget:s,awsQueryCompatible:r,jsonCodec:y}){super({defaultNamespace:t,errorTypeRegistries:o}),this.serviceTarget=s,this.codec=y??new It({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new ht(this.awsQueryCompatible)}async serializeRequest(t,o,s){let r=await super.serializeRequest(t,o,s);return r.path.endsWith("/")||(r.path+="/"),Object.assign(r.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${t.name}`}),this.awsQueryCompatible&&(r.headers["x-amzn-query-mode"]="true"),(ot(t.input)==="unit"||!r.body)&&(r.body="{}"),r}getPayloadCodec(){return this.codec}async handleError(t,o,s,r,y){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,s);let m=Pt(s,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,m,this.options.defaultNamespace);let{errorSchema:x,errorMetadata:g}=await this.mixin.getErrorSchemaOrThrowBaseException(m,this.options.defaultNamespace,s,r,y,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),D=st.of(x),A=r.message??r.Message??"UnknownError",be=this.compositeErrorRegistry.getErrorCtor(x)??Error,Ho=new be(A),Oe={};for(let[we,jo]of D.structIterator())r[we]!=null&&(Oe[we]=this.codec.createDeserializer().readObject(jo,r[we]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,Oe),this.mixin.decorateServiceException(Object.assign(Ho,g,{$fault:D.getMergedTraits().error,message:A},Oe),r)}};var O=class extends b{constructor({defaultNamespace:t,errorTypeRegistries:o,serviceTarget:s,awsQueryCompatible:r,jsonCodec:y}){super({defaultNamespace:t,errorTypeRegistries:o,serviceTarget:s,awsQueryCompatible:r,jsonCodec:y})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}};var Jt=async(e,t,o)=>({operation:We(t).operation,region:await Ge(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Wo(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"kms",region:e.region},propertiesExtractor:(t,o)=>({signingProperties:{config:t,context:o}})}}var Zt=e=>{let t=[];switch(e.operation){default:t.push(Wo(e))}return t},eo=e=>{let t=Rt(e);return Object.assign(t,{authSchemePreference:Ge(e.authSchemePreference??[])})};var to=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"kms"}),w={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oo={name:"@aws-sdk/client-kms",description:"AWS SDK for JavaScript Kms Client for Node.js, Browser and React Native",version:"3.1019.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-kms","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo kms","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts --mode development","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs"},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.973.25","@aws-sdk/credential-provider-node":"^3.972.27","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.9","@aws-sdk/middleware-user-agent":"^3.972.26","@aws-sdk/region-config-resolver":"^3.972.10","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.12","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-utf8":"^4.2.2",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"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-kms",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-kms"}};var ro="AWS_EC2_METADATA_DISABLED",no=async e=>{let{ENV_CMDS_FULL_URI:t,ENV_CMDS_RELATIVE_URI:o,fromContainerMetadata:s,fromInstanceMetadata:r}=await import("./dist-es-NRANDF25.js");if(process.env[o]||process.env[t]){e.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:y}=await import("./dist-es-3AHFNYTD.js");return Et(y(e),s(e))}return process.env[ro]&&process.env[ro]!=="false"?async()=>{throw new S("EC2 Instance Metadata Service access disabled",{logger:e.logger})}:(e.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),r(e))};function so(e,t){let o=Bo(e),s,r,y,m=async x=>{if(x?.forceRefresh)return await o(x);if(y?.expiration&&y?.expiration?.getTime()<Date.now()&&(y=void 0),s)await s;else if(!y||t?.(y))if(y)r||(r=o(x).then(g=>{y=g}).finally(()=>{r=void 0}));else return s=o(x).then(g=>{y=g}).finally(()=>{s=void 0}),m(x);return y};return m}var Bo=e=>async t=>{let o;for(let s of e)try{return await s(t)}catch(r){if(o=r,r?.tryNextLink)continue;throw r}throw o};var io=!1,ao=(e={})=>so([async()=>{if(e.profile??process.env[Gt])throw process.env[Xt]&&process.env[Vt]&&(io||((e.logger?.warn&&e.logger?.constructor?.name!=="NoOpLogger"?e.logger.warn.bind(e.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
2
|
+
Multiple credential sources detected:
|
|
3
|
+
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
4
|
+
This SDK will proceed with the AWS_PROFILE value.
|
|
5
|
+
|
|
6
|
+
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
7
|
+
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
8
|
+
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
9
|
+
`),io=!0)),new S("AWS_PROFILE is set, skipping fromEnv provider.",{logger:e.logger,tryNextLink:!0});return e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),Ft(e)()},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:o,ssoAccountId:s,ssoRegion:r,ssoRoleName:y,ssoSession:m}=e;if(!o&&!s&&!r&&!y&&!m)throw new S("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:e.logger});let{fromSSO:x}=await import("./dist-es-I6TTSEP7.js");return x(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:o}=await import("./dist-es-6KZILXYZ.js");return o(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:o}=await import("./dist-es-H627TNCU.js");return o(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:o}=await import("./dist-es-YSAFQMS4.js");return o(e)(t)},async()=>(e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await no(e))()),async()=>{throw new S("Could not load credentials from any providers",{tryNextLink:!1,logger:e.logger})}],Qo);var Qo=e=>e?.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5;var vo="required";var v="argv";var co="isSet",I="booleanEquals",_="error",P="endpoint",K="tree",Ue="PartitionResult",po={[vo]:!1,type:"string"},lo={[vo]:!0,default:!1,type:"boolean"},uo={ref:"Endpoint"},Ko={fn:I,[v]:[{ref:"UseFIPS"},!0]},fo={fn:I,[v]:[{ref:"UseDualStack"},!0]},R={},yo={fn:"getAttr",[v]:[{ref:Ue},"supportsFIPS"]},mo={fn:I,[v]:[!0,{fn:"getAttr",[v]:[{ref:Ue},"supportsDualStack"]}]},xo=[Ko],Eo=[fo],Ro=[{ref:"Region"}],Yo={version:"1.0",parameters:{Region:po,UseDualStack:lo,UseFIPS:lo,Endpoint:po},rules:[{conditions:[{fn:co,[v]:[uo]}],rules:[{conditions:xo,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:_},{conditions:Eo,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:_},{endpoint:{url:uo,properties:R,headers:R},type:P}],type:K},{conditions:[{fn:co,[v]:Ro}],rules:[{conditions:[{fn:"aws.partition",[v]:Ro,assign:Ue}],rules:[{conditions:[Ko,fo],rules:[{conditions:[{fn:I,[v]:[!0,yo]},mo],rules:[{endpoint:{url:"https://kms-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:R,headers:R},type:P}],type:K},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:_}],type:K},{conditions:xo,rules:[{conditions:[{fn:I,[v]:[yo,!0]}],rules:[{endpoint:{url:"https://kms-fips.{Region}.{PartitionResult#dnsSuffix}",properties:R,headers:R},type:P}],type:K},{error:"FIPS is enabled but this partition does not support FIPS",type:_}],type:K},{conditions:Eo,rules:[{conditions:[mo],rules:[{endpoint:{url:"https://kms.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:R,headers:R},type:P}],type:K},{error:"DualStack is enabled but this partition does not support DualStack",type:_}],type:K},{endpoint:{url:"https://kms.{Region}.{PartitionResult#dnsSuffix}",properties:R,headers:R},type:P}],type:K}],type:K},{error:"Invalid Configuration: Missing Region",type:_}]},go=Yo;var Jo=new pt({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),So=(e,t={})=>Jo.get(e,()=>ut(go,{endpointParams:e,logger:t.logger}));lt.aws=dt;var i=class e extends Kt{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var G=class e extends i{name="AlreadyExistsException";$fault="client";constructor(t){super({name:"AlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},T=class e extends i{name="DependencyTimeoutException";$fault="server";constructor(t){super({name:"DependencyTimeoutException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},U=class e extends i{name="InvalidArnException";$fault="client";constructor(t){super({name:"InvalidArnException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},L=class e extends i{name="KMSInternalException";$fault="server";constructor(t){super({name:"KMSInternalException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},N=class e extends i{name="KMSInvalidStateException";$fault="client";constructor(t){super({name:"KMSInvalidStateException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},q=class e extends i{name="NotFoundException";$fault="client";constructor(t){super({name:"NotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},X=class e extends i{name="CloudHsmClusterInUseException";$fault="client";constructor(t){super({name:"CloudHsmClusterInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},V=class e extends i{name="CloudHsmClusterInvalidConfigurationException";$fault="client";constructor(t){super({name:"CloudHsmClusterInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},F=class e extends i{name="CloudHsmClusterNotActiveException";$fault="client";constructor(t){super({name:"CloudHsmClusterNotActiveException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},H=class e extends i{name="CloudHsmClusterNotFoundException";$fault="client";constructor(t){super({name:"CloudHsmClusterNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},j=class e extends i{name="CloudHsmClusterNotRelatedException";$fault="client";constructor(t){super({name:"CloudHsmClusterNotRelatedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},W=class e extends i{name="ConflictException";$fault="client";constructor(t){super({name:"ConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},z=class e extends i{name="CustomKeyStoreInvalidStateException";$fault="client";constructor(t){super({name:"CustomKeyStoreInvalidStateException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},B=class e extends i{name="CustomKeyStoreNotFoundException";$fault="client";constructor(t){super({name:"CustomKeyStoreNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Q=class e extends i{name="InvalidAliasNameException";$fault="client";constructor(t){super({name:"InvalidAliasNameException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Y=class e extends i{name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},J=class e extends i{name="CustomKeyStoreNameInUseException";$fault="client";constructor(t){super({name:"CustomKeyStoreNameInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Z=class e extends i{name="IncorrectTrustAnchorException";$fault="client";constructor(t){super({name:"IncorrectTrustAnchorException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ee=class e extends i{name="XksProxyIncorrectAuthenticationCredentialException";$fault="client";constructor(t){super({name:"XksProxyIncorrectAuthenticationCredentialException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},te=class e extends i{name="XksProxyInvalidConfigurationException";$fault="client";constructor(t){super({name:"XksProxyInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},oe=class e extends i{name="XksProxyInvalidResponseException";$fault="client";constructor(t){super({name:"XksProxyInvalidResponseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},re=class e extends i{name="XksProxyUriEndpointInUseException";$fault="client";constructor(t){super({name:"XksProxyUriEndpointInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ne=class e extends i{name="XksProxyUriInUseException";$fault="client";constructor(t){super({name:"XksProxyUriInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},se=class e extends i{name="XksProxyUriUnreachableException";$fault="client";constructor(t){super({name:"XksProxyUriUnreachableException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ie=class e extends i{name="XksProxyVpcEndpointServiceInUseException";$fault="client";constructor(t){super({name:"XksProxyVpcEndpointServiceInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ae=class e extends i{name="XksProxyVpcEndpointServiceInvalidConfigurationException";$fault="client";constructor(t){super({name:"XksProxyVpcEndpointServiceInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ce=class e extends i{name="XksProxyVpcEndpointServiceNotFoundException";$fault="client";constructor(t){super({name:"XksProxyVpcEndpointServiceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},pe=class e extends i{name="DisabledException";$fault="client";constructor(t){super({name:"DisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},le=class e extends i{name="DryRunOperationException";$fault="client";constructor(t){super({name:"DryRunOperationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ue=class e extends i{name="InvalidGrantTokenException";$fault="client";constructor(t){super({name:"InvalidGrantTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},de=class e extends i{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ye=class e extends i{name="TagException";$fault="client";constructor(t){super({name:"TagException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},me=class e extends i{name="UnsupportedOperationException";$fault="client";constructor(t){super({name:"UnsupportedOperationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},xe=class e extends i{name="XksKeyAlreadyInUseException";$fault="client";constructor(t){super({name:"XksKeyAlreadyInUseException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ee=class e extends i{name="XksKeyInvalidConfigurationException";$fault="client";constructor(t){super({name:"XksKeyInvalidConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Re=class e extends i{name="XksKeyNotFoundException";$fault="client";constructor(t){super({name:"XksKeyNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ve=class e extends i{name="CustomKeyStoreHasCMKsException";$fault="client";constructor(t){super({name:"CustomKeyStoreHasCMKsException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ke=class e extends i{name="IncorrectKeyException";$fault="client";constructor(t){super({name:"IncorrectKeyException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},fe=class e extends i{name="InvalidCiphertextException";$fault="client";constructor(t){super({name:"InvalidCiphertextException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ge=class e extends i{name="InvalidKeyUsageException";$fault="client";constructor(t){super({name:"InvalidKeyUsageException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Se=class e extends i{name="KeyUnavailableException";$fault="server";constructor(t){super({name:"KeyUnavailableException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype)}},_e=class e extends i{name="InvalidMarkerException";$fault="client";constructor(t){super({name:"InvalidMarkerException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ce=class e extends i{name="ExpiredImportTokenException";$fault="client";constructor(t){super({name:"ExpiredImportTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},he=class e extends i{name="IncorrectKeyMaterialException";$fault="client";constructor(t){super({name:"IncorrectKeyMaterialException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Pe=class e extends i{name="InvalidImportTokenException";$fault="client";constructor(t){super({name:"InvalidImportTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Ie=class e extends i{name="InvalidGrantIdException";$fault="client";constructor(t){super({name:"InvalidGrantIdException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},$e=class e extends i{name="KMSInvalidMacException";$fault="client";constructor(t){super({name:"KMSInvalidMacException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},De=class e extends i{name="KMSInvalidSignatureException";$fault="client";constructor(t){super({name:"KMSInvalidSignatureException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}};var Zo="AttestationDocument",er="AlreadyExistsException";var _o="CiphertextBlob";var tr="ConflictException";var Co="CiphertextForRecipient";var or="CloudHsmClusterInvalidConfigurationException",rr="CloudHsmClusterInUseException",nr="CloudHsmClusterNotActiveException",sr="CloudHsmClusterNotFoundException",ir="CloudHsmClusterNotRelatedException";var ar="CustomKeyStoreHasCMKsException";var cr="CustomKeyStoreInvalidStateException";var pr="CustomKeyStoreNotFoundException",lr="CustomKeyStoreNameInUseException";var ur="DisabledException";var ho="DryRun",dr="DryRunModifiers",yr="DryRunOperationException",mr="DecryptRequest",xr="DecryptResponse";var Er="DependencyTimeoutException",Rr="Decrypt";var Po="EncryptionAlgorithm";var Io="EncryptionContext";var vr="ExpiredImportTokenException";var Kr="GenerateDataKey";var fr="GenerateDataKeyRequest",gr="GenerateDataKeyResponse";var $o="GrantTokens";var Sr="InvalidArnException",_r="InvalidAliasNameException",Cr="InvalidCiphertextException",hr="InvalidGrantIdException",Pr="InvalidGrantTokenException",Ir="InvalidImportTokenException",$r="IncorrectKeyException";var Dr="IncorrectKeyMaterialException";var Ar="InvalidKeyUsageException",kr="InvalidMarkerException";var Mr="IncorrectTrustAnchorException";var br="KeyEncryptionAlgorithm",Ae="KeyId";var Do="KeyMaterialId";var Or="KMSInternalException",wr="KMSInvalidMacException",Gr="KMSInvalidSignatureException",Tr="KMSInvalidStateException";var Ur="KeySpec";var Lr="KeyUnavailableException";var Nr="LimitExceededException";var qr="MalformedPolicyDocumentException";var Xr="NotFoundException";var Vr="NumberOfBytes";var Fr="PlaintextType";var Ao="Plaintext",ko="Recipient";var Hr="RecipientInfo";var jr="TagException";var Wr="UnsupportedOperationException";var zr="XksKeyAlreadyInUseException";var Br="XksKeyInvalidConfigurationException",Qr="XksKeyNotFoundException";var Yr="XksProxyIncorrectAuthenticationCredentialException",Jr="XksProxyInvalidConfigurationException",Zr="XksProxyInvalidResponseException";var en="XksProxyUriEndpointInUseException",tn="XksProxyUriInUseException";var on="XksProxyUriUnreachableException",rn="XksProxyVpcEndpointServiceInvalidConfigurationException",nn="XksProxyVpcEndpointServiceInUseException";var sn="XksProxyVpcEndpointServiceNotFoundException";var c="awsQueryError",d="client",p="error",l="httpError",u="message",Mo="smithy.ts.sdk.synthetic.com.amazonaws.kms",Le="server",n="com.amazonaws.kms",bo=Te.for(Mo),an=[-3,Mo,"KMSServiceException",0,[],[]];bo.registerError(an,i);var a=Te.for(n),cn=[-3,n,er,{[c]:["AlreadyExists",409],[p]:d,[l]:409},[u],[0]];a.registerError(cn,G);var pn=[-3,n,rr,{[c]:["CloudHsmClusterInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(pn,X);var ln=[-3,n,or,{[c]:["CloudHsmClusterInvalidConfigurationException",400],[p]:d,[l]:400},[u],[0]];a.registerError(ln,V);var un=[-3,n,nr,{[c]:["CloudHsmClusterNotActiveException",400],[p]:d,[l]:400},[u],[0]];a.registerError(un,F);var dn=[-3,n,sr,{[c]:["CloudHsmClusterNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(dn,H);var yn=[-3,n,ir,{[c]:["CloudHsmClusterNotRelatedException",400],[p]:d,[l]:400},[u],[0]];a.registerError(yn,j);var mn=[-3,n,tr,{[c]:["ConflictException",409],[p]:d,[l]:409},[u],[0]];a.registerError(mn,W);var xn=[-3,n,ar,{[c]:["CustomKeyStoreHasCMKsException",400],[p]:d,[l]:400},[u],[0]];a.registerError(xn,ve);var En=[-3,n,cr,{[c]:["CustomKeyStoreInvalidStateException",400],[p]:d,[l]:400},[u],[0]];a.registerError(En,z);var Rn=[-3,n,lr,{[c]:["CustomKeyStoreNameInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Rn,J);var vn=[-3,n,pr,{[c]:["CustomKeyStoreNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(vn,B);var Kn=[-3,n,Er,{[c]:["DependencyTimeout",503],[p]:Le,[l]:503},[u],[0]];a.registerError(Kn,T);var fn=[-3,n,ur,{[c]:["Disabled",409],[p]:d,[l]:409},[u],[0]];a.registerError(fn,pe);var gn=[-3,n,yr,{[c]:["DryRunOperation",412],[p]:d,[l]:412},[u],[0]];a.registerError(gn,le);var Sn=[-3,n,vr,{[c]:["ExpiredImportTokenException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Sn,Ce);var _n=[-3,n,$r,{[c]:["IncorrectKeyException",400],[p]:d,[l]:400},[u],[0]];a.registerError(_n,Ke);var Cn=[-3,n,Dr,{[c]:["IncorrectKeyMaterialException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Cn,he);var hn=[-3,n,Mr,{[c]:["IncorrectTrustAnchorException",400],[p]:d,[l]:400},[u],[0]];a.registerError(hn,Z);var Pn=[-3,n,_r,{[c]:["InvalidAliasName",400],[p]:d,[l]:400},[u],[0]];a.registerError(Pn,Q);var In=[-3,n,Sr,{[c]:["InvalidArn",400],[p]:d,[l]:400},[u],[0]];a.registerError(In,U);var $n=[-3,n,Cr,{[c]:["InvalidCiphertext",400],[p]:d,[l]:400},[u],[0]];a.registerError($n,fe);var Dn=[-3,n,hr,{[c]:["InvalidGrantId",400],[p]:d,[l]:400},[u],[0]];a.registerError(Dn,Ie);var An=[-3,n,Pr,{[c]:["InvalidGrantToken",400],[p]:d,[l]:400},[u],[0]];a.registerError(An,ue);var kn=[-3,n,Ir,{[c]:["InvalidImportTokenException",400],[p]:d,[l]:400},[u],[0]];a.registerError(kn,Pe);var Mn=[-3,n,Ar,{[c]:["InvalidKeyUsage",400],[p]:d,[l]:400},[u],[0]];a.registerError(Mn,ge);var bn=[-3,n,kr,{[c]:["InvalidMarker",400],[p]:d,[l]:400},[u],[0]];a.registerError(bn,_e);var On=[-3,n,Lr,{[c]:["KeyUnavailable",500],[p]:Le,[l]:500},[u],[0]];a.registerError(On,Se);var wn=[-3,n,Or,{[c]:["KMSInternal",500],[p]:Le,[l]:500},[u],[0]];a.registerError(wn,L);var Gn=[-3,n,wr,{[c]:["KMSInvalidMac",400],[p]:d,[l]:400},[u],[0]];a.registerError(Gn,$e);var Tn=[-3,n,Gr,{[c]:["KMSInvalidSignature",400],[p]:d,[l]:400},[u],[0]];a.registerError(Tn,De);var Un=[-3,n,Tr,{[c]:["KMSInvalidStateException",409],[p]:d,[l]:409},[u],[0]];a.registerError(Un,N);var Ln=[-3,n,Nr,{[c]:["LimitExceeded",400],[p]:d,[l]:400},[u],[0]];a.registerError(Ln,Y);var Nn=[-3,n,qr,{[c]:["MalformedPolicyDocument",400],[p]:d,[l]:400},[u],[0]];a.registerError(Nn,de);var qn=[-3,n,Xr,{[c]:["NotFound",404],[p]:d,[l]:404},[u],[0]];a.registerError(qn,q);var Xn=[-3,n,jr,{[c]:["TagException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Xn,ye);var Vn=[-3,n,Wr,{[c]:["UnsupportedOperation",400],[p]:d,[l]:400},[u],[0]];a.registerError(Vn,me);var Fn=[-3,n,zr,{[c]:["XksKeyAlreadyInUse",400],[p]:d,[l]:400},[u],[0]];a.registerError(Fn,xe);var Hn=[-3,n,Br,{[c]:["XksKeyInvalidConfiguration",400],[p]:d,[l]:400},[u],[0]];a.registerError(Hn,Ee);var jn=[-3,n,Qr,{[c]:["XksKeyNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(jn,Re);var Wn=[-3,n,Yr,{[c]:["XksProxyIncorrectAuthenticationCredentialException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Wn,ee);var zn=[-3,n,Jr,{[c]:["XksProxyInvalidConfigurationException",400],[p]:d,[l]:400},[u],[0]];a.registerError(zn,te);var Bn=[-3,n,Zr,{[c]:["XksProxyInvalidResponseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Bn,oe);var Qn=[-3,n,en,{[c]:["XksProxyUriEndpointInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Qn,re);var Yn=[-3,n,tn,{[c]:["XksProxyUriInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Yn,ne);var Jn=[-3,n,on,{[c]:["XksProxyUriUnreachableException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Jn,se);var Zn=[-3,n,nn,{[c]:["XksProxyVpcEndpointServiceInUseException",400],[p]:d,[l]:400},[u],[0]];a.registerError(Zn,ie);var es=[-3,n,rn,{[c]:["XksProxyVpcEndpointServiceInvalidConfigurationException",400],[p]:d,[l]:400},[u],[0]];a.registerError(es,ae);var ts=[-3,n,sn,{[c]:["XksProxyVpcEndpointServiceNotFoundException",400],[p]:d,[l]:400},[u],[0]];a.registerError(ts,ce);var Oo=[bo,a];var wo=[0,n,Fr,8,21];var os=[3,n,mr,0,[_o,Io,$o,Ae,Po,ko,ho,dr],[21,128,64,0,0,()=>Go,2,64]],rs=[3,n,xr,0,[Ae,Ao,Po,Co,Do],[0,[()=>wo,0],0,21,0]];var ns=[3,n,fr,0,[Ae,Io,Vr,Ur,$o,ko,ho],[0,128,1,0,64,()=>Go,2],1],ss=[3,n,gr,0,[_o,Ao,Ae,Co,Do],[21,[()=>wo,0],0,21,0]];var Go=[3,n,Hr,0,[br,Zo],[0,21]];var To=[9,n,Rr,0,()=>os,()=>rs];var Uo=[9,n,Kr,0,()=>ns,()=>ss];var Lo=e=>({apiVersion:"2014-11-01",base64Decoder:e?.base64Decoder??Qe,base64Encoder:e?.base64Encoder??Ze,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??So,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new mt}],logger:e?.logger??new Ct,protocol:e?.protocol??O,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.kms",errorTypeRegistries:Oo,xmlNamespace:"https://trent.amazonaws.com/doc/2014-11-01/",version:"2014-11-01",serviceTarget:"TrentService"},serviceId:e?.serviceId??"KMS",urlParser:e?.urlParser??rt,utf8Decoder:e?.utf8Decoder??Ye,utf8Encoder:e?.utf8Encoder??Je});var No=e=>{gt(process.version);let t=Bt(e),o=()=>t().then(ft),s=Lo(e);yt(process.version);let r={profile:e?.profile,logger:s.logger};return{...s,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??f(xt,r),bodyLengthChecker:e?.bodyLengthChecker??zt,credentialDefaultProvider:e?.credentialDefaultProvider??ao,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ht({serviceId:s.serviceId,clientVersion:oo.version}),maxAttempts:e?.maxAttempts??f(Ut,e),region:e?.region??f(Mt,{...bt,...r}),requestHandler:et.create(e?.requestHandler??o),retryMode:e?.retryMode??f({...Nt,default:async()=>(await o()).retryMode||$t},e),sha256:e?.sha256??Wt.bind(null,"sha256"),streamCollector:e?.streamCollector??tt,useDualstackEndpoint:e?.useDualstackEndpoint??f(At,r),useFipsEndpoint:e?.useFipsEndpoint??f(kt,r),userAgentAppId:e?.userAgentAppId??f(jt,r)}};var qo=e=>{let t=e.httpAuthSchemes,o=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(r){let y=t.findIndex(m=>m.schemeId===r.schemeId);y===-1?t.push(r):t.splice(y,1,r)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(r){o=r},httpAuthSchemeProvider(){return o},setCredentials(r){s=r},credentials(){return s}}},Xo=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()});var Vo=(e,t)=>{let o=Object.assign(Qt(e),St(e),Xe(e),qo(e));return t.forEach(s=>s.configure(o)),Object.assign(e,Yt(o),_t(o),Ve(o),Xo(o))};var ke=class extends vt{config;constructor(...[t]){let o=No(t||{});super(o),this.initConfig=o;let s=to(o),r=ct(s),y=Lt(r),m=Ot(y),x=m,g=Tt(x),D=eo(g),A=Vo(D,t?.extensions||[]);this.config=A,this.middlewareStack.use(nt(this.config)),this.middlewareStack.use(Dt(this.config)),this.middlewareStack.use(qt(this.config)),this.middlewareStack.use(wt(this.config)),this.middlewareStack.use(Fe(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(je(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Jt,identityProviderConfigProvider:async be=>new at({"aws.auth#sigv4":be.credentials})})),this.middlewareStack.use(Be(this.config))}destroy(){super.destroy()}};var Me=class extends k.classBuilder().ep(w).m(function(t,o,s,r){return[M(s,t.getEndpointParameterInstructions())]}).s("TrentService","Decrypt",{}).n("KMSClient","DecryptCommand").sc(To).build(){};var $=class extends k.classBuilder().ep(w).m(function(t,o,s,r){return[M(s,t.getEndpointParameterInstructions())]}).s("TrentService","GenerateDataKey",{}).n("KMSClient","GenerateDataKeyCommand").sc(Uo).build(){};var Fo=class{name="aws-kms";client;keyId;keyVersion;constructor(t){let o=t.keyId??process.env.AWS_KMS_KEY_ID??process.env.AWS_KMS_KEY_ARN;if(!o)throw new Error("AWS KMS Key ID or ARN required. Set AWS_KMS_KEY_ID or pass keyId in config.");this.keyId=o,this.keyVersion=t.keyVersion??1;let s=t.region??process.env.AWS_REGION??"us-east-1";this.client=new ke({region:s,...t.credentials&&{credentials:{accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}}}),E.debug("[vault:aws-kms] Initialized",{keyId:o,region:s,keyVersion:this.keyVersion})}async encrypt(t,o){try{let s=await this.client.send(new $({KeyId:this.keyId,KeySpec:"AES_256"})),r=s.Plaintext,y=s.CiphertextBlob;if(!r||!y)throw new Error("AWS KMS GenerateDataKey returned empty DEK");let m=Ne(t,r),x={id:o?.id??is(),ciphertext:C(m.ciphertext),encryptedDek:C(y),iv:C(m.iv),authTag:C(m.authTag),keyVersion:this.keyVersion,algorithm:"aes-256-gcm",...o?.tenantId!==void 0?{tenantId:o.tenantId}:{},metadata:o?.metadata,createdAt:new Date().toISOString()};return E.debug("[vault:aws-kms] Secret encrypted",{id:x.id,tenantId:o?.tenantId}),x}catch(s){throw E.error("[vault:aws-kms] Encryption failed",{error:s}),new Error(`AWS KMS encryption failed: ${s instanceof Error?s.message:String(s)}`)}}async decrypt(t,o){try{if(o?.tenantId&&t.tenantId&&t.tenantId!==o.tenantId)throw new Error("Tenant ID mismatch");let r=(await this.client.send(new Me({CiphertextBlob:h(t.encryptedDek)}))).Plaintext;if(!r)throw new Error("AWS KMS Decrypt returned empty DEK");let y=qe(h(t.ciphertext),r,{iv:h(t.iv),authTag:h(t.authTag)});return E.debug("[vault:aws-kms] Secret decrypted",{id:t.id,tenantId:o?.tenantId}),y.toString("utf-8")}catch(s){throw E.error("[vault:aws-kms] Decryption failed",{error:s}),new Error(`AWS KMS decryption failed: ${s instanceof Error?s.message:String(s)}`)}}async rotateKey(t){try{let o=await this.decrypt(t),s=await this.encrypt(o,{id:t.id,...t.tenantId!==void 0?{tenantId:t.tenantId}:{},metadata:t.metadata});return s.rotatedAt=new Date().toISOString(),E.debug("[vault:aws-kms] Key rotated",{id:t.id}),s}catch(o){throw E.error("[vault:aws-kms] Key rotation failed",{error:o}),new Error(`Key rotation failed: ${o instanceof Error?o.message:String(o)}`)}}async rotateKek(){this.keyVersion+=1,E.info("[vault:aws-kms] KEK rotated",{newVersion:this.keyVersion})}async generateDek(){try{return(await this.client.send(new $({KeyId:this.keyId,KeySpec:"AES_256"}))).Plaintext}catch(t){throw E.error("[vault:aws-kms] DEK generation failed",{error:t}),new Error(`DEK generation failed: ${t instanceof Error?t.message:String(t)}`)}}async close(){this.client.destroy(),E.debug("[vault:aws-kms] Closed")}};export{Fo as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as h,q as b,r as w,s as j,u as x}from"./chunk-C6CKWQY5.js";import{b as l}from"./chunk-224RJRPV.js";import{e as g}from"./chunk-XB6R2VIU.js";var T=class{async sign(t,i,e){return t}};var q={name:"@aws-sdk/nested-clients",version:"3.996.16",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=20.0.0"},sideEffects:!1,author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.25","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.9","@aws-sdk/middleware-user-agent":"^3.972.26","@aws-sdk/region-config-resolver":"^3.972.10","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.12","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-utf8":"^4.2.2",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}}};function z(s){return encodeURIComponent(s).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var C=s=>{let t=s.length,i=[],e=!1,o,r=0;for(let n=0;n<t;++n){let d=s[n];switch(d){case'"':o!=="\\"&&(e=!e);break;case",":e||(i.push(s.slice(r,n)),r=n+1);break;default:}o=d}return i.push(s.slice(r)),i.map(n=>{n=n.trim();let d=n.length;return d<2?n:(n[0]==='"'&&n[d-1]==='"'&&(n=n.slice(1,d-1)),n.replace(/\\"/g,'"'))})};var p="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",f="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",y="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",N="(\\d?\\d)",S="(\\d{4})",U=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),A=new RegExp(`^${p}, ${N} ${f} ${S} ${y} GMT$`),J=new RegExp(`^${p}, ${N}-${f}-(\\d\\d) ${y} GMT$`),v=new RegExp(`^${p} ${f} ( [1-9]|\\d\\d) ${y} ${S}$`),W=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],$=s=>{if(s==null)return;let t=NaN;if(typeof s=="number")t=s;else if(typeof s=="string"){if(!/^-?\d*\.?\d+$/.test(s))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(s)}else typeof s=="object"&&s.tag===1&&(t=s.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},k=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC3339 timestamps must be strings");let t=U.exec(s);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${s}`);let[,i,e,o,r,n,d,,m,a]=t;u(e,1,12),u(o,1,31),u(r,0,23),u(n,0,59),u(d,0,60);let c=new Date(Date.UTC(Number(i),Number(e)-1,Number(o),Number(r),Number(n),Number(d),Number(m)?Math.round(parseFloat(`0.${m}`)*1e3):0));if(c.setUTCFullYear(Number(i)),a.toUpperCase()!="Z"){let[,F,M,R]=/([+-])(\d\d):(\d\d)/.exec(a)||[void 0,"+",0,0],_=F==="-"?1:-1;c.setTime(c.getTime()+_*(Number(M)*60*60*1e3+Number(R)*60*1e3))}return c},E=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,i,e,o,r,n,d,m;if((m=A.exec(s))?[,t,i,e,o,r,n,d]=m:(m=J.exec(s))?([,t,i,e,o,r,n,d]=m,e=(Number(e)+1900).toString()):(m=v.exec(s))&&([,i,t,o,r,n,d,e]=m),e&&n){let a=Date.UTC(Number(e),W.indexOf(i),Number(t),Number(o),Number(r),Number(n),d?Math.round(parseFloat(`0.${d}`)*1e3):0);u(t,1,31),u(o,0,23),u(r,0,59),u(n,0,60);let c=new Date(a);return c.setUTCFullYear(Number(e)),c}throw new TypeError(`Invalid RFC7231 date-time value ${s}.`)};function u(s,t,i){let e=Number(s);if(e<t||e>i)throw new Error(`Value ${e} out of range [${t}, ${i}]`)}var D=class extends j{settings;constructor(t){super(),this.settings=t}read(t,i){let e=h.of(t);if(e.isListSchema())return C(i).map(o=>this.read(e.getValueSchema(),o));if(e.isBlobSchema())return(this.serdeContext?.base64Decoder??l)(i);if(e.isTimestampSchema())switch(x(e,this.settings)){case 5:return k(i);case 6:return E(i);case 7:return $(i);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",i),new Date(i)}if(e.isStringSchema()){let o=e.getMergedTraits().mediaType,r=i;if(o)return e.getMergedTraits().httpHeader&&(r=this.base64ToUtf8(r)),(o==="application/json"||o.endsWith("+json"))&&(r=b.from(r)),r}return e.isNumericSchema()?Number(i):e.isBigIntegerSchema()?BigInt(i):e.isBigDecimalSchema()?new w(i,"bigDecimal"):e.isBooleanSchema()?String(i).toLowerCase()==="true":i}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??g)((this.serdeContext?.base64Decoder??l)(t))}};export{z as a,C as b,D as c,T as d,q as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g}from"./chunk-ZCWB3HFB.js";import{b as d,f as u}from"./chunk-WI7DO2VU.js";import{b as a}from"./chunk-TX7AAHER.js";function h(r){let o={};if(r=r.replace(/^\?/,""),r)for(let n of r.split("&")){let[e,t=null]=n.split("=");e=decodeURIComponent(e),t&&(t=decodeURIComponent(t)),e in o?Array.isArray(o[e])?o[e].push(t):o[e]=[o[e],t]:o[e]=t}return o}var F=r=>{if(typeof r=="string")return F(new URL(r));let{hostname:o,pathname:n,port:e,protocol:t,search:i}=r,f;return i&&(f=h(i)),{hostname:o,port:e?parseInt(e):void 0,protocol:t,path:n,query:f}};var y=r=>()=>Promise.resolve(r);var w=(r,o,n)=>{let e,t,i,f=!1,s=async()=>{t||(t=r());try{e=await t,i=!0,f=!1}finally{t=void 0}return e};return o===void 0?async c=>((!i||c?.forceRefresh)&&(e=await s()),e):async c=>((!i||c?.forceRefresh)&&(e=await s()),f?e:n&&!n(e)?(f=!0,e):(o(e)&&await s(),e))};function m(r){try{let o=new Set(Array.from(r.match(/([A-Z_]){3,}/g)??[]));return o.delete("CONFIG"),o.delete("CONFIG_PREFIX_SEPARATOR"),o.delete("ENV"),[...o].join(", ")}catch{return r}}var C=(r,o)=>async()=>{try{let n=r(process.env,o);if(n===void 0)throw new Error;return n}catch(n){throw new a(n.message||`Not found in ENV: ${m(r.toString())}`,{logger:o?.logger})}};var S=(r,{preferredFile:o="config",...n}={})=>async()=>{let e=d(n),{configFile:t,credentialsFile:i}=await u(n),f=i[e]||{},s=t[e]||{},c=o==="config"?{...f,...s}:{...s,...f};try{let p=r(c,o==="config"?t:i);if(p===void 0)throw new Error;return p}catch(l){throw new a(l.message||`Not found in config files w/ profile [${e}]: ${m(r.toString())}`,{logger:n.logger})}};var N=r=>typeof r=="function",v=r=>N(r)?async()=>await r():y(r);var b=({environmentVariableSelector:r,configFileSelector:o,default:n},e={})=>{let{signingName:t,logger:i}=e;return w(g(C(r,{signingName:t,logger:i}),S(o,e),v(n)))};export{F as a,w as b,b as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _}from"./chunk-3T4EOSMQ.js";import{b as S}from"./chunk-TX7AAHER.js";var p="AWS_ACCESS_KEY_ID",A="AWS_SECRET_ACCESS_KEY",C="AWS_SESSION_TOKEN",N="AWS_CREDENTIAL_EXPIRATION",a="AWS_CREDENTIAL_SCOPE",i="AWS_ACCOUNT_ID",v=e=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[p],r=process.env[A],n=process.env[C],s=process.env[N],t=process.env[a],E=process.env[i];if(o&&r){let c={accessKeyId:o,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...t&&{credentialScope:t},...E&&{accountId:E}};return _(c,"CREDENTIALS_ENV_VARS","g"),c}throw new S("Unable to find environment variable credentials.",{logger:e?.logger})};export{p as a,A as b,C as c,N as d,a as e,i as f,v as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H,b as q,c as O}from"./chunk-EIQ2HSZP.js";import{a as J,b as F}from"./chunk-XPRSUMI6.js";import{N as U,j as z,m as I,n as g,p as $,q as Q,s as T,t as V,u as v}from"./chunk-C6CKWQY5.js";import{a as D}from"./chunk-2YUF6TO6.js";import{c as B,i as j}from"./chunk-224RJRPV.js";import{a as N}from"./chunk-CHWVD37K.js";import{d as R,e as k}from"./chunk-XB6R2VIU.js";function W(b){return(b.includes(",")||b.includes('"'))&&(b=`"${b.replace(/"/g,'\\"')}"`),b}function Z(b,i,t){if(t<=0||!Number.isInteger(t))throw new Error("Invalid number of delimiters ("+t+") for splitEvery.");let e=b.split(i);if(t===1)return e;let r=[],o="";for(let s=0;s<e.length;s++)o===""?o=e[s]:o+=i+e[s],(s+1)%t===0&&(r.push(o),o="");return o!==""&&r.push(o),r}var x=class extends V{async serializeRequest(i,t,e){let r={...t??{}},o=this.serializer,s={},h={},c=await e.endpoint(),d=g.of(i?.input),S=[],p=[],y=!1,m,n=new N({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:s,headers:h,body:void 0});if(c){this.updateServiceEndpoint(n,c),this.setHostPrefix(n,i,r);let a=I(i.traits);if(a.http){n.method=a.http[0];let[f,l]=a.http[1].split("?");n.path=="/"?n.path=f:n.path+=f;let u=new URLSearchParams(l??"");Object.assign(s,Object.fromEntries(u))}}for(let[a,f]of d.structIterator()){let l=f.getMergedTraits()??{},u=r[a];if(u==null&&!f.isIdempotencyToken()){if(l.httpLabel&&(n.path.includes(`{${a}+}`)||n.path.includes(`{${a}}`)))throw new Error(`No value provided for input HTTP label: ${a}.`);continue}if(l.httpPayload)f.isStreaming()?f.isStructSchema()?r[a]&&(m=await this.serializeEventStream({eventStream:r[a],requestSchema:d})):m=u:(o.write(f,u),m=o.flush()),delete r[a];else if(l.httpLabel){o.write(f,u);let w=o.flush();n.path.includes(`{${a}+}`)?n.path=n.path.replace(`{${a}+}`,w.split("/").map(H).join("/")):n.path.includes(`{${a}}`)&&(n.path=n.path.replace(`{${a}}`,H(w))),delete r[a]}else if(l.httpHeader)o.write(f,u),h[l.httpHeader.toLowerCase()]=String(o.flush()),delete r[a];else if(typeof l.httpPrefixHeaders=="string"){for(let[w,P]of Object.entries(u)){let L=l.httpPrefixHeaders+w;o.write([f.getValueSchema(),{httpHeader:L}],P),h[L.toLowerCase()]=o.flush()}delete r[a]}else l.httpQuery||l.httpQueryParams?(this.serializeQuery(f,u,s),delete r[a]):(y=!0,S.push(a),p.push(f))}if(y&&r){let[a,f]=(d.getName(!0)??"#Unknown").split("#"),l=d.getSchema()[6],u=[3,a,f,d.getMergedTraits(),S,p,void 0];l?u[6]=l:u.pop(),o.write(u,r),m=o.flush()}return n.headers=h,n.query=s,n.body=m,n}serializeQuery(i,t,e){let r=this.serializer,o=i.getMergedTraits();if(o.httpQueryParams){for(let[s,h]of Object.entries(t))if(!(s in e)){let c=i.getValueSchema();Object.assign(c.getMergedTraits(),{...o,httpQuery:s,httpQueryParams:void 0}),this.serializeQuery(c,h,e)}return}if(i.isListSchema()){let s=!!i.getMergedTraits().sparse,h=[];for(let c of t){r.write([i.getValueSchema(),o],c);let d=r.flush();(s||d!==void 0)&&h.push(d)}e[o.httpQuery]=h}else r.write([i,o],t),e[o.httpQuery]=r.flush()}async deserializeResponse(i,t,e){let r=this.deserializer,o=g.of(i.output),s={};if(e.statusCode>=300){let c=await z(e.body,t);throw c.byteLength>0&&Object.assign(s,await r.read(15,c)),await this.handleError(i,t,e,s,this.deserializeMetadata(e)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in e.headers){let d=e.headers[c];delete e.headers[c],e.headers[c.toLowerCase()]=d}let h=await this.deserializeHttpMessage(o,t,e,s);if(h.length){let c=await z(e.body,t);if(c.byteLength>0){let d=await r.read(o,c);for(let S of h)d[S]!=null&&(s[S]=d[S])}}else h.discardResponseBody&&await z(e.body,t);return s.$metadata=this.deserializeMetadata(e),s}async deserializeHttpMessage(i,t,e,r,o){let s;r instanceof Set?s=o:s=r;let h=!0,c=this.deserializer,d=g.of(i),S=[];for(let[p,y]of d.structIterator()){let m=y.getMemberTraits();if(m.httpPayload){if(h=!1,y.isStreaming())y.isStructSchema()?s[p]=await this.deserializeEventStream({response:e,responseSchema:d}):s[p]=D(e.body);else if(e.body){let a=await z(e.body,t);a.byteLength>0&&(s[p]=await c.read(y,a))}}else if(m.httpHeader){let n=String(m.httpHeader).toLowerCase(),a=e.headers[n];if(a!=null)if(y.isListSchema()){let f=y.getValueSchema();f.getMergedTraits().httpHeader=n;let l;f.isTimestampSchema()&&f.getSchema()===4?l=Z(a,",",2):l=q(a);let u=[];for(let w of l)u.push(await c.read(f,w.trim()));s[p]=u}else s[p]=await c.read(y,a)}else if(m.httpPrefixHeaders!==void 0){s[p]={};for(let[n,a]of Object.entries(e.headers))if(n.startsWith(m.httpPrefixHeaders)){let f=y.getValueSchema();f.getMergedTraits().httpHeader=n,s[p][n.slice(m.httpPrefixHeaders.length)]=await c.read(f,a)}}else m.httpResponseCode?s[p]=e.statusCode:S.push(p)}return S.discardResponseBody=h,S}};var M=class extends T{codecDeserializer;stringDeserializer;constructor(i,t){super(),this.codecDeserializer=i,this.stringDeserializer=new O(t)}setSerdeContext(i){this.stringDeserializer.setSerdeContext(i),this.codecDeserializer.setSerdeContext(i),this.serdeContext=i}read(i,t){let e=g.of(i),r=e.getMergedTraits(),o=this.serdeContext?.utf8Encoder??k;if(r.httpHeader||r.httpResponseCode)return this.stringDeserializer.read(e,o(t));if(r.httpPayload){if(e.isBlobSchema()){let s=this.serdeContext?.utf8Decoder??R;return typeof t=="string"?s(t):t}else if(e.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(e,t)}};var E=class extends T{settings;stringBuffer="";constructor(i){super(),this.settings=i}write(i,t){let e=g.of(i);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(e.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${e.getName(!0)}`);switch(v(e,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=j(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(e.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??B)(t);return}if(e.isListSchema()&&Array.isArray(t)){let s="";for(let h of t){this.write([e.getValueSchema(),e.getMergedTraits()],h);let c=this.flush(),d=e.getValueSchema().isTimestampSchema()?c:W(c);s!==""&&(s+=", "),s+=d}this.stringBuffer=s;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let r=e.getMergedTraits().mediaType,o=t;if(r&&((r==="application/json"||r.endsWith("+json"))&&(o=Q.from(o)),e.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??B)(o.toString());return}this.stringBuffer=t;break;default:e.isIdempotencyToken()?this.stringBuffer=$():this.stringBuffer=String(t)}}flush(){let i=this.stringBuffer;return this.stringBuffer="",i}};var C=class{codecSerializer;stringSerializer;buffer;constructor(i,t,e=new E(t)){this.codecSerializer=i,this.stringSerializer=e}setSerdeContext(i){this.codecSerializer.setSerdeContext(i),this.stringSerializer.setSerdeContext(i)}write(i,t){let e=g.of(i),r=e.getMergedTraits();if(r.httpHeader||r.httpLabel||r.httpQuery){this.stringSerializer.write(e,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(e,t)}flush(){if(this.buffer!==void 0){let i=this.buffer;return this.buffer=void 0,i}return this.codecSerializer.flush()}};var A=class extends x{serializer;deserializer;codec;mixin=new U;constructor({defaultNamespace:i,errorTypeRegistries:t}){super({defaultNamespace:i,errorTypeRegistries:t});let e={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new F(e),this.serializer=new C(this.codec.createSerializer(),e),this.deserializer=new M(this.codec.createDeserializer(),e)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(i){this.codec.setSerdeContext(i),super.setSerdeContext(i)}async serializeRequest(i,t,e){let r=await super.serializeRequest(i,t,e),o=g.of(i.input);if(!r.headers["content-type"]){let s=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);s&&(r.headers["content-type"]=s)}return r.body==null&&r.headers["content-type"]===this.getDefaultContentType()&&(r.body="{}"),r}async deserializeResponse(i,t,e){let r=await super.deserializeResponse(i,t,e),o=g.of(i.output);for(let[s,h]of o.structIterator())h.getMemberTraits().httpPayload&&!(s in r)&&(r[s]=null);return r}async handleError(i,t,e,r,o){let s=J(e,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);let{errorSchema:h,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,e,r,o),d=g.of(h),S=r.message??r.Message??"UnknownError",p=this.compositeErrorRegistry.getErrorCtor(h)??Error,y=new p(S);await this.deserializeHttpMessage(h,t,e,r);let m={};for(let[n,a]of d.structIterator()){let f=a.getMergedTraits().jsonName??n;m[n]=this.codec.createDeserializer().readObject(a,r[f])}throw this.mixin.decorateServiceException(Object.assign(y,c,{$fault:d.getMergedTraits().error,message:S},m),r)}getDefaultContentType(){return"application/json"}};export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createCipheriv as h,createDecipheriv as p,hkdf as l,randomBytes as s}from"crypto";var a="aes-256-gcm",c=32,g=12,B=16;function T(e,r,n){if(r.length!==c)throw new Error(`Key must be ${c} bytes, got ${r.length}`);let o=s(g),t=h(a,r,o,{authTagLength:B});n!==void 0&&t.setAAD(n);let f=typeof e=="string"?Buffer.from(e,"utf-8"):e,u=t.update(f);u=Buffer.concat([u,t.final()]);let i=t.getAuthTag();return{ciphertext:u,iv:o,authTag:i}}function A(e,r,n,o){if(r.length!==c)throw new Error(`Key must be ${c} bytes, got ${r.length}`);let t=p(a,r,n.iv);t.setAuthTag(n.authTag),o!==void 0&&t.setAAD(o);let f=t.update(e);return f=Buffer.concat([f,t.final()]),f}function d(e,r,n){let o=typeof e=="string"?Buffer.from(e,"utf-8"):e;return new Promise((t,f)=>{l("sha256",o,r??Buffer.alloc(0),n??Buffer.alloc(0),c,(u,i)=>{u?f(u):t(Buffer.from(i))})})}function x(e=c){return s(e)}function E(){return s(g)}function b(e){return e.toString("base64")}function v(e){return Buffer.from(e,"base64")}export{T as a,A as b,d as c,x as d,E as e,b as f,v as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=class{value;next;constructor(t){this.value=t}},a=class{#e;#t;#i;constructor(){this.clear()}enqueue(t){let i=new f(t);this.#e?(this.#t.next=i,this.#t=i):(this.#e=i,this.#t=i),this.#i++}dequeue(){let t=this.#e;if(t)return this.#e=this.#e.next,this.#i--,this.#e||(this.#t=void 0),t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#i=0}get size(){return this.#i}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}*drain(){for(;this.#e;)yield this.dequeue()}};function x(e){let t=!1;if(typeof e=="object"&&({concurrency:e,rejectOnClear:t=!1}=e),c(e),typeof t!="boolean")throw new TypeError("Expected `rejectOnClear` to be a boolean");let i=new a,o=0,h=()=>{o<e&&i.size>0&&(o++,i.dequeue().run())},m=()=>{o--,h()},p=async(s,r,u)=>{let n=(async()=>s(...u))();r(n);try{await n}catch{}m()},b=(s,r,u,n)=>{let l={reject:u};new Promise(w=>{l.run=w,i.enqueue(l)}).then(p.bind(void 0,s,r,n)),o<e&&h()},d=(s,...r)=>new Promise((u,n)=>{b(s,u,n,r)});return Object.defineProperties(d,{activeCount:{get:()=>o},pendingCount:{get:()=>i.size},clearQueue:{value(){if(!t){i.clear();return}let s=AbortSignal.abort().reason;for(;i.size>0;)i.dequeue().reject(s)}},concurrency:{get:()=>e,set(s){c(s),e=s,queueMicrotask(()=>{for(;o<e&&i.size>0;)h()})}},map:{async value(s,r){let u=Array.from(s,(n,l)=>this(r,n,l));return Promise.all(u)}}}),d}function c(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=class s extends Error{name="ProviderError";tryNextLink;constructor(t,e=!0){let u,r=!0;typeof e=="boolean"?(u=void 0,r=e):e!=null&&typeof e=="object"&&(u=e.logger,r=e.tryNextLink??!0),super(t),this.tryNextLink=r,Object.setPrototypeOf(this,s.prototype),u?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,e=!0){return Object.assign(new this(t.message,e),t)}};var i=class s extends o{name="CredentialsProviderError";constructor(t,e=!0){super(t,e),Object.setPrototypeOf(this,s.prototype)}};export{o as a,i as b};
|