create-sailor 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/aws-kms-W5N62I3Q.js +1 -0
  2. package/dist/{chunk-OWZF7P72.js → chunk-44JV4JDH.js} +1 -1
  3. package/dist/{chunk-4AGDXYPL.js → chunk-5ECPN42W.js} +1 -1
  4. package/dist/{chunk-EBTFPGDR.js → chunk-5LSLUC7O.js} +2 -2
  5. package/dist/{chunk-XPRSUMI6.js → chunk-DATQDZ23.js} +1 -1
  6. package/dist/chunk-IYWUY3VA.js +1 -0
  7. package/dist/{chunk-C6CKWQY5.js → chunk-M2Z4KZL3.js} +2 -2
  8. package/dist/{chunk-EIQ2HSZP.js → chunk-U4BHGI6P.js} +1 -1
  9. package/dist/{chunk-UU4YUKYZ.js → chunk-XE3I3HCZ.js} +1 -1
  10. package/dist/{chunk-7OZT53MS.js → chunk-YHGYZK4L.js} +1 -1
  11. package/dist/chunk-ZIBRKYXP.js +23 -0
  12. package/dist/credits-RR7B3C4K.js +2635 -0
  13. package/dist/{dist-LOLT3W3R.js → dist-27O4E2DL.js} +1 -1
  14. package/dist/{dist-V6L2DNL2.js → dist-NJH3URWV.js} +2 -2
  15. package/dist/{dist-es-3AHFNYTD.js → dist-es-2W7PQEXN.js} +1 -1
  16. package/dist/{dist-es-I6TTSEP7.js → dist-es-CAS2CDUC.js} +1 -1
  17. package/dist/{dist-es-JATELSE4.js → dist-es-DQDVBBVA.js} +1 -1
  18. package/dist/{dist-es-YSAFQMS4.js → dist-es-GO22VTF3.js} +1 -1
  19. package/dist/{dist-es-NRANDF25.js → dist-es-KKEGJGC4.js} +1 -1
  20. package/dist/{dist-es-6KZILXYZ.js → dist-es-LARTXLYL.js} +1 -1
  21. package/dist/{dist-es-H627TNCU.js → dist-es-O2XJNCOH.js} +1 -1
  22. package/dist/{event-streams-IPTOYMEP.js → event-streams-BXAP5G2H.js} +1 -1
  23. package/dist/index.js +184 -185
  24. package/dist/{loadSso-FR7LG5FX.js → loadSso-LSHML5XP.js} +1 -1
  25. package/dist/local-6WWVOMA7.js +1 -0
  26. package/dist/{query_compiler_fast_bg.postgresql-FOSFFKA5.js → query_compiler_fast_bg.postgresql-JA2BFVW5.js} +1 -1
  27. package/dist/{query_compiler_fast_bg.postgresql.wasm-base64-JU7X67WB.js → query_compiler_fast_bg.postgresql.wasm-base64-URHQ2Y3Y.js} +1 -1
  28. package/dist/{signin-N4XQB5ZB.js → signin-3DEIU5DH.js} +1 -1
  29. package/dist/{sso-oidc-FXPYRI5I.js → sso-oidc-5FB6AI4I.js} +1 -1
  30. package/dist/{sts-SIEJPPW3.js → sts-7GUSARTO.js} +1 -1
  31. package/package.json +1 -1
  32. package/templates/deploy/Dockerfile.web +1 -1
  33. package/dist/aws-kms-EYG3LGYA.js +0 -1
  34. package/dist/chunk-76FD5Z7D.js +0 -23
  35. package/dist/chunk-FSRPMVAS.js +0 -1
  36. package/dist/credits-7FJY7HK2.js +0 -2613
  37. package/dist/local-BUKM6VCO.js +0 -1
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-5LSLUC7O.js";import"./chunk-QSLKOXQ6.js";import"./chunk-ZIBRKYXP.js";import"./chunk-YHGYZK4L.js";import"./chunk-M3QJPQWS.js";import"./chunk-DATQDZ23.js";import"./chunk-M2Z4KZL3.js";import"./chunk-IY2KKEUD.js";import"./chunk-ZCWB3HFB.js";import"./chunk-WI7DO2VU.js";import"./chunk-224RJRPV.js";import"./chunk-CHWVD37K.js";import"./chunk-XB6R2VIU.js";import"./chunk-3T4EOSMQ.js";import"./chunk-TX7AAHER.js";import"./chunk-IYWUY3VA.js";export{a as AWSKMSProvider};
@@ -1 +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};
1
+ import{a as H,b as q,c as O}from"./chunk-U4BHGI6P.js";import{a as J,b as F}from"./chunk-DATQDZ23.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-M2Z4KZL3.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};
@@ -1 +1 @@
1
- import{a as c,b as h,c as f,d as y,f as n,g as i}from"./chunk-QSLKOXQ6.js";import{a as r}from"./chunk-76FD5Z7D.js";import{randomUUID as E}from"crypto";var k=32,v=class{name="local";masterKey;salt;keyVersion;constructor(e){let t=e.masterKey??g();if(!t)throw new Error("Master key required. Set VAULT_LOCAL_MASTER_KEY or VAULT_MASTER_KEY env var, or pass masterKey in config.");if(this.masterKey=Buffer.from(t,"utf-8"),this.masterKey.length<k)throw new Error(`Vault master key too short: ${this.masterKey.length} bytes, need at least ${k}. Set VAULT_LOCAL_MASTER_KEY / VAULT_MASTER_KEY to a value with at least 32 bytes of entropy.`);this.salt=e.salt??Buffer.from("nebutra-vault","utf-8"),this.keyVersion=e.keyVersion??1,r.debug("[vault:local] Initialized",{keyVersion:this.keyVersion})}buildAad(e,t){return Buffer.from(`v2|tenant=${e??""}|kek=${t}`,"utf-8")}async deriveKek(){let e=Buffer.from(`nebutra-vault-kek-v${this.keyVersion}`,"utf-8");return f(this.masterKey,this.salt,e)}async encrypt(e,t){try{let a=await this.deriveKek(),u=y(32),o=this.buildAad(t?.tenantId,this.keyVersion),s=c(u,a,o),l=c(e,u,o),m={id:t?.id??E(),ciphertext:n(l.ciphertext),encryptedDek:n(s.ciphertext),iv:n(l.iv),authTag:n(l.authTag),dekIv:n(s.iv),dekAuthTag:n(s.authTag),keyVersion:this.keyVersion,envelopeVersion:2,algorithm:"aes-256-gcm",...t?.tenantId!==void 0?{tenantId:t.tenantId}:{},...t?.metadata!==void 0?{metadata:t.metadata}:{},createdAt:new Date().toISOString()};return r.debug("[vault:local] Secret encrypted",{id:m.id,tenantId:t?.tenantId}),m}catch(a){throw r.error("[vault:local] Encryption failed",{error:a}),new Error(`Local vault encryption failed: ${a instanceof Error?a.message:String(a)}`)}}async decrypt(e,t){try{if(t?.tenantId&&e.tenantId&&e.tenantId!==t.tenantId)throw new Error("Tenant ID mismatch");e.keyVersion!==this.keyVersion&&r.warn("[vault:local] Key version mismatch",{secretVersion:e.keyVersion,currentVersion:this.keyVersion});let a=Buffer.from(`nebutra-vault-kek-v${e.keyVersion}`,"utf-8"),u=await f(this.masterKey,this.salt,a),o=e.envelopeVersion===2?this.buildAad(e.tenantId,e.keyVersion):void 0,s;if(e.dekIv&&e.dekAuthTag)s=h(i(e.encryptedDek),u,{iv:i(e.dekIv),authTag:i(e.dekAuthTag)},o);else throw new Error("Encrypted DEK missing IV/authTag \u2014 cannot decrypt. Re-encrypt with current version.");let l=h(i(e.ciphertext),s,{iv:i(e.iv),authTag:i(e.authTag)},o);return r.debug("[vault:local] Secret decrypted",{id:e.id,tenantId:t?.tenantId}),l.toString("utf-8")}catch(a){throw r.error("[vault:local] Decryption failed",{error:a}),new Error(`Local vault decryption failed: ${a instanceof Error?a.message:String(a)}`)}}async rotateKey(e){try{let t=await this.decrypt(e),a=await this.encrypt(t,{id:e.id,...e.tenantId!==void 0?{tenantId:e.tenantId}:{},...e.metadata!==void 0?{metadata:{name:e.metadata.name,type:e.metadata.type,...e.metadata.expiresAt!==void 0?{expiresAt:e.metadata.expiresAt}:{}}}:{}});return a.rotatedAt=new Date().toISOString(),r.debug("[vault:local] Key rotated",{id:e.id}),a}catch(t){throw r.error("[vault:local] Key rotation failed",{error:t}),new Error(`Key rotation failed: ${t instanceof Error?t.message:String(t)}`)}}async rotateKek(){this.keyVersion+=1,r.info("[vault:local] KEK rotated",{newVersion:this.keyVersion})}async generateDek(){return y(32)}async close(){r.debug("[vault:local] Closed")}};function g(){let d=process.env.VAULT_MASTER_KEY,e=process.env.VAULT_LOCAL_MASTER_KEY;if(d&&e&&d!==e)throw new Error("Vault local key mismatch: VAULT_MASTER_KEY and VAULT_LOCAL_MASTER_KEY are both set but differ.");return e??d}export{v as a};
1
+ import{a as c,b as h,c as f,d as y,f as n,g as i}from"./chunk-QSLKOXQ6.js";import{a as r}from"./chunk-ZIBRKYXP.js";import{randomUUID as E}from"crypto";var k=32,v=class{name="local";masterKey;salt;keyVersion;constructor(e){let t=e.masterKey??g();if(!t)throw new Error("Master key required. Set VAULT_LOCAL_MASTER_KEY or VAULT_MASTER_KEY env var, or pass masterKey in config.");if(this.masterKey=Buffer.from(t,"utf-8"),this.masterKey.length<k)throw new Error(`Vault master key too short: ${this.masterKey.length} bytes, need at least ${k}. Set VAULT_LOCAL_MASTER_KEY / VAULT_MASTER_KEY to a value with at least 32 bytes of entropy.`);this.salt=e.salt??Buffer.from("nebutra-vault","utf-8"),this.keyVersion=e.keyVersion??1,r.debug("[vault:local] Initialized",{keyVersion:this.keyVersion})}buildAad(e,t){return Buffer.from(`v2|tenant=${e??""}|kek=${t}`,"utf-8")}async deriveKek(){let e=Buffer.from(`nebutra-vault-kek-v${this.keyVersion}`,"utf-8");return f(this.masterKey,this.salt,e)}async encrypt(e,t){try{let a=await this.deriveKek(),u=y(32),o=this.buildAad(t?.tenantId,this.keyVersion),s=c(u,a,o),l=c(e,u,o),m={id:t?.id??E(),ciphertext:n(l.ciphertext),encryptedDek:n(s.ciphertext),iv:n(l.iv),authTag:n(l.authTag),dekIv:n(s.iv),dekAuthTag:n(s.authTag),keyVersion:this.keyVersion,envelopeVersion:2,algorithm:"aes-256-gcm",...t?.tenantId!==void 0?{tenantId:t.tenantId}:{},...t?.metadata!==void 0?{metadata:t.metadata}:{},createdAt:new Date().toISOString()};return r.debug("[vault:local] Secret encrypted",{id:m.id,tenantId:t?.tenantId}),m}catch(a){throw r.error("[vault:local] Encryption failed",{error:a}),new Error(`Local vault encryption failed: ${a instanceof Error?a.message:String(a)}`)}}async decrypt(e,t){try{if(t?.tenantId&&e.tenantId&&e.tenantId!==t.tenantId)throw new Error("Tenant ID mismatch");e.keyVersion!==this.keyVersion&&r.warn("[vault:local] Key version mismatch",{secretVersion:e.keyVersion,currentVersion:this.keyVersion});let a=Buffer.from(`nebutra-vault-kek-v${e.keyVersion}`,"utf-8"),u=await f(this.masterKey,this.salt,a),o=e.envelopeVersion===2?this.buildAad(e.tenantId,e.keyVersion):void 0,s;if(e.dekIv&&e.dekAuthTag)s=h(i(e.encryptedDek),u,{iv:i(e.dekIv),authTag:i(e.dekAuthTag)},o);else throw new Error("Encrypted DEK missing IV/authTag \u2014 cannot decrypt. Re-encrypt with current version.");let l=h(i(e.ciphertext),s,{iv:i(e.iv),authTag:i(e.authTag)},o);return r.debug("[vault:local] Secret decrypted",{id:e.id,tenantId:t?.tenantId}),l.toString("utf-8")}catch(a){throw r.error("[vault:local] Decryption failed",{error:a}),new Error(`Local vault decryption failed: ${a instanceof Error?a.message:String(a)}`)}}async rotateKey(e){try{let t=await this.decrypt(e),a=await this.encrypt(t,{id:e.id,...e.tenantId!==void 0?{tenantId:e.tenantId}:{},...e.metadata!==void 0?{metadata:{name:e.metadata.name,type:e.metadata.type,...e.metadata.expiresAt!==void 0?{expiresAt:e.metadata.expiresAt}:{}}}:{}});return a.rotatedAt=new Date().toISOString(),r.debug("[vault:local] Key rotated",{id:e.id}),a}catch(t){throw r.error("[vault:local] Key rotation failed",{error:t}),new Error(`Key rotation failed: ${t instanceof Error?t.message:String(t)}`)}}async rotateKek(){this.keyVersion+=1,r.info("[vault:local] KEK rotated",{newVersion:this.keyVersion})}async generateDek(){return y(32)}async close(){r.debug("[vault:local] Closed")}};function g(){let d=process.env.VAULT_MASTER_KEY,e=process.env.VAULT_LOCAL_MASTER_KEY;if(d&&e&&d!==e)throw new Error("Vault local key mismatch: VAULT_MASTER_KEY and VAULT_LOCAL_MASTER_KEY are both set but differ.");return e??d}export{v as a};
@@ -1,4 +1,4 @@
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:
1
+ import{a as Ne,b as qe,f as C,g as h}from"./chunk-QSLKOXQ6.js";import{a as E}from"./chunk-ZIBRKYXP.js";import{a as it}from"./chunk-YHGYZK4L.js";import{a as Xt,b as Vt,g as Ft}from"./chunk-M3QJPQWS.js";import{a as Pt,b as It}from"./chunk-DATQDZ23.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-M2Z4KZL3.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-KKEGJGC4.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-2W7PQEXN.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
2
  Multiple credential sources detected:
3
3
  Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
4
4
  This SDK will proceed with the AWS_PROFILE value.
@@ -6,4 +6,4 @@ import{a as Ne,b as qe,f as C,g as h}from"./chunk-QSLKOXQ6.js";import{a as E}fro
6
6
  However, a future version may change this behavior to prefer the ENV static credentials.
7
7
  Please ensure that your environment only sets either the AWS_PROFILE or the
8
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};
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-CAS2CDUC.js");return x(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:o}=await import("./dist-es-LARTXLYL.js");return o(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:o}=await import("./dist-es-O2XJNCOH.js");return o(e)(t)},async t=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:o}=await import("./dist-es-GO22VTF3.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};
@@ -1 +1 @@
1
- import{O as S,P as I,j as T,n as y,p as E,q as b,r as p,u as l}from"./chunk-C6CKWQY5.js";import{b as j,c as x,i as O,k as M,l as R,m as k}from"./chunk-224RJRPV.js";import{e as C}from"./chunk-XB6R2VIU.js";var J=(h,r)=>T(h,r).then(e=>(r?.utf8Encoder??C)(e));var B=(h,r)=>J(h,r).then(e=>{if(e.length)try{return JSON.parse(e)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}return{}});var W=(h,r)=>{let e=(s,t)=>Object.keys(s).find(i=>i.toLowerCase()===t.toLowerCase()),n=s=>{let t=s;return typeof t=="number"&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=e(h.headers,"x-amzn-errortype");if(o!==void 0)return n(h.headers[o]);if(r&&typeof r=="object"){let s=e(r,"code");if(s&&r[s]!==void 0)return n(r[s]);if(r.__type!==void 0)return n(r.__type)}};function D(h,r,e){if(e?.source){let n=e.source;if(typeof r=="number"&&(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||n!==String(r)))return n.includes(".")?new p(n,"bigDecimal"):BigInt(n)}return r}var w=class extends S{settings;constructor(r){super(),this.settings=r}async read(r,e){return this._read(r,typeof e=="string"?JSON.parse(e,D):await B(e,this.serdeContext))}readObject(r,e){return this._read(r,e)}_read(r,e){let n=e!==null&&typeof e=="object",o=y.of(r);if(n){if(o.isStructSchema()){let t=e,i=o.isUnionSchema(),c={},a,{jsonName:f}=this.settings;f&&(a={});let u;i&&(u=new I(t,c));for(let[m,g]of o.structIterator()){let d=m;f&&(d=g.getMergedTraits().jsonName??d,a[d]=m),i&&u.mark(d),t[d]!=null&&(c[m]=this._read(g,t[d]))}if(i)u.writeUnknown();else if(typeof t.__type=="string")for(let[m,g]of Object.entries(t)){let d=f?a[m]??m:m;d in c||(c[d]=g)}return c}if(Array.isArray(e)&&o.isListSchema()){let t=o.getValueSchema(),i=[];for(let c of e)i.push(this._read(t,c));return i}if(o.isMapSchema()){let t=o.getValueSchema(),i={};for(let[c,a]of Object.entries(e))i[c]=this._read(t,a);return i}}if(o.isBlobSchema()&&typeof e=="string")return j(e);let s=o.getMergedTraits().mediaType;if(o.isStringSchema()&&typeof e=="string"&&s)return s==="application/json"||s.endsWith("+json")?b.from(e):e;if(o.isTimestampSchema()&&e!=null)switch(l(o,this.settings)){case 5:return M(e);case 6:return R(e);case 7:return k(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(o.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(o.isBigDecimalSchema()&&e!=null){if(e instanceof p)return e;let t=e;return t.type==="bigDecimal"&&"string"in t?new p(t.string,t.type):new p(String(e),"bigDecimal")}if(o.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(o.isDocumentSchema())if(n){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?t[i]=c:t[i]=this._read(o,c);return t}else return structuredClone(e);return e}};var A="\u039D",_=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(r,e)=>{if(e instanceof p){let n=`${A+"nv"+this.counter++}_`+e.string;return this.values.set(`"${n}"`,e.string),n}if(typeof e=="bigint"){let n=e.toString(),o=`${A+"b"+this.counter++}_`+n;return this.values.set(`"${o}"`,n),o}return e}}replaceInJson(r){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return r;for(let[e,n]of this.values)r=r.replace(e,n);return r}};var N=class extends S{settings;buffer;useReplacer=!1;rootSchema;constructor(r){super(),this.settings=r}write(r,e){this.rootSchema=y.of(r),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(r,e){this.write(r,e),typeof this.buffer=="object"&&(this.buffer.__type=y.of(r).getName(!0))}flush(){let{rootSchema:r,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,r?.isStructSchema()||r?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);let n=new _;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(r,e,n){let o=e!==null&&typeof e=="object",s=y.of(r);if(o){if(s.isStructSchema()){let t=e,i={},{jsonName:c}=this.settings,a;c&&(a={});for(let[f,u]of s.structIterator()){let m=this._write(u,t[f],s);if(m!==void 0){let g=f;c&&(g=u.getMergedTraits().jsonName??f,a[f]=g),i[g]=m}}if(s.isUnionSchema()&&Object.keys(i).length===0){let{$unknown:f}=t;if(Array.isArray(f)){let[u,m]=f;i[u]=this._write(15,m)}}else if(typeof t.__type=="string")for(let[f,u]of Object.entries(t)){let m=c?a[f]??f:f;m in i||(i[m]=this._write(15,u))}return i}if(Array.isArray(e)&&s.isListSchema()){let t=s.getValueSchema(),i=[],c=!!s.getMergedTraits().sparse;for(let a of e)(c||a!=null)&&i.push(this._write(t,a));return i}if(s.isMapSchema()){let t=s.getValueSchema(),i={},c=!!s.getMergedTraits().sparse;for(let[a,f]of Object.entries(e))(c||f!=null)&&(i[a]=this._write(t,f));return i}if(e instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema()))return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(e instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema()))switch(l(s,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return O(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof p&&(this.useReplacer=!0)}if(!(e===null&&n?.isStructSchema())){if(s.isStringSchema()){if(typeof e>"u"&&s.isIdempotencyToken())return E();let t=s.getMergedTraits().mediaType;return e!=null&&t&&(t==="application/json"||t.endsWith("+json"))?b.from(e):e}if(typeof e=="number"&&s.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&s.isBlobSchema())return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),s.isDocumentSchema())if(o){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?(this.useReplacer=!0,t[i]=c):t[i]=this._write(s,c);return t}else return structuredClone(e);return e}}};var z=class extends S{settings;constructor(r){super(),this.settings=r}createSerializer(){let r=new N(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){let r=new w(this.settings);return r.setSerdeContext(this.serdeContext),r}};export{W as a,z as b};
1
+ import{O as S,P as I,j as T,n as y,p as E,q as b,r as p,u as l}from"./chunk-M2Z4KZL3.js";import{b as j,c as x,i as O,k as M,l as R,m as k}from"./chunk-224RJRPV.js";import{e as C}from"./chunk-XB6R2VIU.js";var J=(h,r)=>T(h,r).then(e=>(r?.utf8Encoder??C)(e));var B=(h,r)=>J(h,r).then(e=>{if(e.length)try{return JSON.parse(e)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}return{}});var W=(h,r)=>{let e=(s,t)=>Object.keys(s).find(i=>i.toLowerCase()===t.toLowerCase()),n=s=>{let t=s;return typeof t=="number"&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=e(h.headers,"x-amzn-errortype");if(o!==void 0)return n(h.headers[o]);if(r&&typeof r=="object"){let s=e(r,"code");if(s&&r[s]!==void 0)return n(r[s]);if(r.__type!==void 0)return n(r.__type)}};function D(h,r,e){if(e?.source){let n=e.source;if(typeof r=="number"&&(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||n!==String(r)))return n.includes(".")?new p(n,"bigDecimal"):BigInt(n)}return r}var w=class extends S{settings;constructor(r){super(),this.settings=r}async read(r,e){return this._read(r,typeof e=="string"?JSON.parse(e,D):await B(e,this.serdeContext))}readObject(r,e){return this._read(r,e)}_read(r,e){let n=e!==null&&typeof e=="object",o=y.of(r);if(n){if(o.isStructSchema()){let t=e,i=o.isUnionSchema(),c={},a,{jsonName:f}=this.settings;f&&(a={});let u;i&&(u=new I(t,c));for(let[m,g]of o.structIterator()){let d=m;f&&(d=g.getMergedTraits().jsonName??d,a[d]=m),i&&u.mark(d),t[d]!=null&&(c[m]=this._read(g,t[d]))}if(i)u.writeUnknown();else if(typeof t.__type=="string")for(let[m,g]of Object.entries(t)){let d=f?a[m]??m:m;d in c||(c[d]=g)}return c}if(Array.isArray(e)&&o.isListSchema()){let t=o.getValueSchema(),i=[];for(let c of e)i.push(this._read(t,c));return i}if(o.isMapSchema()){let t=o.getValueSchema(),i={};for(let[c,a]of Object.entries(e))i[c]=this._read(t,a);return i}}if(o.isBlobSchema()&&typeof e=="string")return j(e);let s=o.getMergedTraits().mediaType;if(o.isStringSchema()&&typeof e=="string"&&s)return s==="application/json"||s.endsWith("+json")?b.from(e):e;if(o.isTimestampSchema()&&e!=null)switch(l(o,this.settings)){case 5:return M(e);case 6:return R(e);case 7:return k(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(o.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(o.isBigDecimalSchema()&&e!=null){if(e instanceof p)return e;let t=e;return t.type==="bigDecimal"&&"string"in t?new p(t.string,t.type):new p(String(e),"bigDecimal")}if(o.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(o.isDocumentSchema())if(n){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?t[i]=c:t[i]=this._read(o,c);return t}else return structuredClone(e);return e}};var A="\u039D",_=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(r,e)=>{if(e instanceof p){let n=`${A+"nv"+this.counter++}_`+e.string;return this.values.set(`"${n}"`,e.string),n}if(typeof e=="bigint"){let n=e.toString(),o=`${A+"b"+this.counter++}_`+n;return this.values.set(`"${o}"`,n),o}return e}}replaceInJson(r){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return r;for(let[e,n]of this.values)r=r.replace(e,n);return r}};var N=class extends S{settings;buffer;useReplacer=!1;rootSchema;constructor(r){super(),this.settings=r}write(r,e){this.rootSchema=y.of(r),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(r,e){this.write(r,e),typeof this.buffer=="object"&&(this.buffer.__type=y.of(r).getName(!0))}flush(){let{rootSchema:r,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,r?.isStructSchema()||r?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);let n=new _;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(r,e,n){let o=e!==null&&typeof e=="object",s=y.of(r);if(o){if(s.isStructSchema()){let t=e,i={},{jsonName:c}=this.settings,a;c&&(a={});for(let[f,u]of s.structIterator()){let m=this._write(u,t[f],s);if(m!==void 0){let g=f;c&&(g=u.getMergedTraits().jsonName??f,a[f]=g),i[g]=m}}if(s.isUnionSchema()&&Object.keys(i).length===0){let{$unknown:f}=t;if(Array.isArray(f)){let[u,m]=f;i[u]=this._write(15,m)}}else if(typeof t.__type=="string")for(let[f,u]of Object.entries(t)){let m=c?a[f]??f:f;m in i||(i[m]=this._write(15,u))}return i}if(Array.isArray(e)&&s.isListSchema()){let t=s.getValueSchema(),i=[],c=!!s.getMergedTraits().sparse;for(let a of e)(c||a!=null)&&i.push(this._write(t,a));return i}if(s.isMapSchema()){let t=s.getValueSchema(),i={},c=!!s.getMergedTraits().sparse;for(let[a,f]of Object.entries(e))(c||f!=null)&&(i[a]=this._write(t,f));return i}if(e instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema()))return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(e instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema()))switch(l(s,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return O(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof p&&(this.useReplacer=!0)}if(!(e===null&&n?.isStructSchema())){if(s.isStringSchema()){if(typeof e>"u"&&s.isIdempotencyToken())return E();let t=s.getMergedTraits().mediaType;return e!=null&&t&&(t==="application/json"||t.endsWith("+json"))?b.from(e):e}if(typeof e=="number"&&s.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&s.isBlobSchema())return s===this.rootSchema?e:(this.serdeContext?.base64Encoder??x)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),s.isDocumentSchema())if(o){let t=Array.isArray(e)?[]:{};for(let[i,c]of Object.entries(e))c instanceof p?(this.useReplacer=!0,t[i]=c):t[i]=this._write(s,c);return t}else return structuredClone(e);return e}}};var z=class extends S{settings;constructor(r){super(),this.settings=r}createSerializer(){let r=new N(this.settings);return r.setSerdeContext(this.serdeContext),r}createDeserializer(){let r=new w(this.settings);return r.setSerdeContext(this.serdeContext),r}};export{W as a,z as b};
@@ -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)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}},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};