gemi 0.4.87 → 0.4.88

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 (35) hide show
  1. package/dist/app/App.d.ts.map +1 -1
  2. package/dist/app/index.js +1 -1
  3. package/dist/bin/index.js +8 -8
  4. package/dist/chunk-0441dc8e5b215b75.js +2 -0
  5. package/dist/chunk-08bf87c7e29141d3.js +9 -0
  6. package/dist/chunk-23b1faa7791ca31d.js +2 -0
  7. package/dist/chunk-36d595d02662f2fa.js +2 -0
  8. package/dist/chunk-3d4e6fdf131bae97.js +2 -0
  9. package/dist/chunk-6e20f463543eec5f.js +2 -0
  10. package/dist/chunk-75aa5e5e2f565737.js +18 -0
  11. package/dist/{chunk-6b18189b2aabf6b7.js → chunk-79f9130d266efc8b.js} +1 -1
  12. package/dist/{chunk-d0b9873261cd82b7.js → chunk-82b3f93a5aac2b2e.js} +1 -1
  13. package/dist/{chunk-5f01223b8fbe1ed8.js → chunk-8f575468b4e4754d.js} +1 -1
  14. package/dist/chunk-92b7f08b6396b0fc.js +2 -0
  15. package/dist/chunk-a4330a47c3806ff1.js +3 -0
  16. package/dist/{chunk-8f2c54f2cd43402a.js → chunk-b35e7bc78a8a613f.js} +1 -1
  17. package/dist/{chunk-b4cbb4706a35f5d5.js → chunk-bd0308763754bf7b.js} +1 -1
  18. package/dist/chunk-d5d491184ec17042.js +2 -0
  19. package/dist/chunk-dc3eae4932658400.js +2 -0
  20. package/dist/chunk-e5db92db378843ab.js +2 -0
  21. package/dist/kernel/index.js +1 -1
  22. package/dist/services/index.js +10 -1
  23. package/package.json +1 -7
  24. package/dist/chunk-519593bc19f7cb9f.js +0 -18
  25. package/dist/chunk-5806220e55ac164c.js +0 -1
  26. package/dist/chunk-6434d2c5758f4125.js +0 -2
  27. package/dist/chunk-69b5648fcd0f0a18.js +0 -3
  28. package/dist/chunk-8e55cff6329b67a9.js +0 -2
  29. package/dist/chunk-9383d727762ecba1.js +0 -2
  30. package/dist/chunk-b38c0c4618d0dd89.js +0 -2
  31. package/dist/chunk-b3eca9338a13f510.js +0 -2
  32. package/dist/chunk-c160211e5cc4c447.js +0 -2
  33. package/dist/chunk-c4b0f134a6b82c51.js +0 -2
  34. package/dist/chunk-cc7158438e52b9ab.js +0 -9
  35. package/dist/chunk-fa61561237819f16.js +0 -1
@@ -0,0 +1,3 @@
1
+ import{B as Ke,C as b} from"./chunk-24a86f8f5ddc0cbd.js";import{Db as Ur} from"./chunk-79f9130d266efc8b.js";var ee=b((_c,te)=>{var vt=function(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})},_t=function(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)},Z=Object.defineProperty,Fr=Object.getOwnPropertyDescriptor,Lr=Object.getOwnPropertyNames,Dr=Object.prototype.hasOwnProperty,R=(t,e)=>Z(t,"name",{value:e,configurable:!0}),kr=(t,e)=>{for(var r in e)Z(t,r,{get:e[r],enumerable:!0})},zr=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Lr(e))if(!Dr.call(t,o)&&o!==r)Z(t,o,{get:()=>e[o],enumerable:!(n=Fr(e,o))||n.enumerable})}return t},Br=(t)=>zr(Z({},"__esModule",{value:!0}),t),Qt={};kr(Qt,{Field:()=>jr,Fields:()=>Or,HttpRequest:()=>Vr,HttpResponse:()=>Hr,IHttpRequest:()=>Gt.HttpRequest,getHttpHandlerExtensionConfiguration:()=>Wr,isValidHostname:()=>_t,resolveHttpHandlerRuntimeConfig:()=>Yr});te.exports=Br(Qt);var Wr=R((t)=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),Yr=R((t)=>{return{httpHandler:t.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),Gt=Ur(),Kt=class t{constructor({name:e,kind:r=Gt.FieldPosition.HEADER,values:n=[]}){this.name=e,this.kind=r,this.values=n}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter((r)=>r!==e)}toString(){return this.values.map((e)=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}};R(Kt,"Field");var jr=Kt,Xt=class t{constructor({fields:e=[],encoding:r="utf-8"}){this.entries={},e.forEach(this.setField.bind(this)),this.encoding=r}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter((r)=>r.kind===e)}};R(Xt,"Fields");var Or=Xt,Jt=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const r=new t({...e,headers:{...e.headers}});if(r.query)r.query=vt(r.query);return r}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query==="object"&&typeof r.headers==="object"}clone(){return t.clone(this)}};R(Jt,"HttpRequest");var Vr=Jt;R(vt,"cloneQuery");var qt=class t{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode==="number"&&typeof r.headers==="object"}};R(qt,"HttpResponse");var Hr=qt;R(_t,"isValidHostname")});var se=b((tf,oe)=>{var{defineProperty:P,getOwnPropertyDescriptor:Zr,getOwnPropertyNames:Pr}=Object,Qr=Object.prototype.hasOwnProperty,at=(t,e)=>P(t,"name",{value:e,configurable:!0}),Gr=(t,e)=>{for(var r in e)P(t,r,{get:e[r],enumerable:!0})},Kr=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Pr(e))if(!Qr.call(t,o)&&o!==r)P(t,o,{get:()=>e[o],enumerable:!(n=Zr(e,o))||n.enumerable})}return t},Xr=(t)=>Kr(P({},"__esModule",{value:!0}),t),re={};Gr(re,{escapeUri:()=>ne,escapeUriPath:()=>vr});oe.exports=Xr(re);var ne=at((t)=>encodeURIComponent(t).replace(/[!'()*]/g,Jr),"escapeUri"),Jr=at((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),vr=at((t)=>t.split("/").map(ne).join("/"),"escapeUriPath")});var ae=b((ef,fe)=>{var ce=function(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=ht.escapeUri(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)e.push(`${r}=${ht.escapeUri(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${ht.escapeUri(n)}`;e.push(o)}}return e.join("&")},Q=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,_r=Object.getOwnPropertyNames,tn=Object.prototype.hasOwnProperty,en=(t,e)=>Q(t,"name",{value:e,configurable:!0}),rn=(t,e)=>{for(var r in e)Q(t,r,{get:e[r],enumerable:!0})},nn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of _r(e))if(!tn.call(t,o)&&o!==r)Q(t,o,{get:()=>e[o],enumerable:!(n=qr(e,o))||n.enumerable})}return t},on=(t)=>nn(Q({},"__esModule",{value:!0}),t),ie={};rn(ie,{buildQueryString:()=>ce});fe.exports=on(ie);var ht=se();en(ce,"buildQueryString")});var de=b((rf,ue)=>{var{defineProperty:G,getOwnPropertyDescriptor:sn,getOwnPropertyNames:cn}=Object,fn=Object.prototype.hasOwnProperty,an=(t,e)=>G(t,"name",{value:e,configurable:!0}),hn=(t,e)=>{for(var r in e)G(t,r,{get:e[r],enumerable:!0})},un=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of cn(e))if(!fn.call(t,o)&&o!==r)G(t,o,{get:()=>e[o],enumerable:!(n=sn(e,o))||n.enumerable})}return t},dn=(t)=>un(G({},"__esModule",{value:!0}),t),he={};hn(he,{isArrayBuffer:()=>ln});ue.exports=dn(he);var ln=an((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var X=b((nf,ye)=>{var{defineProperty:K,getOwnPropertyDescriptor:pn,getOwnPropertyNames:yn}=Object,gn=Object.prototype.hasOwnProperty,le=(t,e)=>K(t,"name",{value:e,configurable:!0}),xn=(t,e)=>{for(var r in e)K(t,r,{get:e[r],enumerable:!0})},mn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of yn(e))if(!gn.call(t,o)&&o!==r)K(t,o,{get:()=>e[o],enumerable:!(n=pn(e,o))||n.enumerable})}return t},wn=(t)=>mn(K({},"__esModule",{value:!0}),t),pe={};xn(pe,{fromArrayBuffer:()=>Tn,fromString:()=>bn});ye.exports=wn(pe);var En=de(),ut=import.meta.require("buffer"),Tn=le((t,e=0,r=t.byteLength-e)=>{if(!En.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ut.Buffer.from(t,e,r)},"fromArrayBuffer"),bn=le((t,e)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?ut.Buffer.from(t,e):ut.Buffer.from(t)},"fromString")});var me=b((ge)=>{Object.defineProperty(ge,"__esModule",{value:!0});ge.fromBase64=void 0;var Cn=X(),Sn=/^[A-Za-z0-9+/]*={0,2}$/,$n=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Sn.exec(t))throw new TypeError("Invalid base64 string.");const e=Cn.fromString(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};ge.fromBase64=$n});var Ce=b((sf,be)=>{var{defineProperty:J,getOwnPropertyDescriptor:An,getOwnPropertyNames:In}=Object,Rn=Object.prototype.hasOwnProperty,dt=(t,e)=>J(t,"name",{value:e,configurable:!0}),Nn=(t,e)=>{for(var r in e)J(t,r,{get:e[r],enumerable:!0})},Mn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of In(e))if(!Rn.call(t,o)&&o!==r)J(t,o,{get:()=>e[o],enumerable:!(n=An(e,o))||n.enumerable})}return t},Un=(t)=>Mn(J({},"__esModule",{value:!0}),t),we={};Nn(we,{fromUtf8:()=>Te,toUint8Array:()=>Fn,toUtf8:()=>Ln});be.exports=Un(we);var Ee=X(),Te=dt((t)=>{const e=Ee.fromString(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Fn=dt((t)=>{if(typeof t==="string")return Te(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)},"toUint8Array"),Ln=dt((t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return Ee.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var Ae=b((Se)=>{Object.defineProperty(Se,"__esModule",{value:!0});Se.toBase64=void 0;var Dn=X(),kn=Ce(),zn=(t)=>{let e;if(typeof t==="string")e=kn.fromUtf8(t);else e=t;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return Dn.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength).toString("base64")};Se.toBase64=zn});var Ne=b((ff,v)=>{var{defineProperty:Ie,getOwnPropertyDescriptor:Bn,getOwnPropertyNames:Wn}=Object,Yn=Object.prototype.hasOwnProperty,lt=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Wn(e))if(!Yn.call(t,o)&&o!==r)Ie(t,o,{get:()=>e[o],enumerable:!(n=Bn(e,o))||n.enumerable})}return t},Re=(t,e,r)=>(lt(t,e,"default"),r&&lt(r,e,"default")),jn=(t)=>lt(Ie({},"__esModule",{value:!0}),t),pt={};v.exports=jn(pt);Re(pt,me(),v.exports);Re(pt,Ae(),v.exports)});var We=b((af,Be)=>{var Fe=function(t=0){return new Promise((e,r)=>{if(t)setTimeout(()=>{const n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})};async function De(t){const e=await ze(t),r=Xn.fromBase64(e);return new Uint8Array(r)}async function ke(t){const e=[],r=t.getReader();let n=!1,o=0;while(!n){const{done:i,value:u}=await r.read();if(u)e.push(u),o+=u.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of e)s.set(i,c),c+=i.length;return s}var ze=function(t){return new Promise((e,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",s=o.indexOf(","),c=s>-1?s+1:o.length;e(o.substring(c))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})},_=Object.defineProperty,On=Object.getOwnPropertyDescriptor,Vn=Object.getOwnPropertyNames,Hn=Object.prototype.hasOwnProperty,$=(t,e)=>_(t,"name",{value:e,configurable:!0}),Zn=(t,e)=>{for(var r in e)_(t,r,{get:e[r],enumerable:!0})},Pn=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of Vn(e))if(!Hn.call(t,o)&&o!==r)_(t,o,{get:()=>e[o],enumerable:!(n=On(e,o))||n.enumerable})}return t},Qn=(t)=>Pn(_({},"__esModule",{value:!0}),t),Ue={};Zn(Ue,{FetchHttpHandler:()=>Kn,keepAliveSupport:()=>q,streamCollector:()=>Jn});Be.exports=Qn(Ue);var Me=ee(),Gn=ae();$(Fe,"requestTimeout");var q={supported:void 0},Le=class t{static create(e){if(typeof(e==null?void 0:e.handle)==="function")return e;return new t(e)}constructor(e){if(typeof e==="function")this.configProvider=e().then((r)=>r||{});else this.config=e??{},this.configProvider=Promise.resolve(this.config);if(q.supported===void 0)q.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(e,{abortSignal:r}={}){var n;if(!this.config)this.config=await this.configProvider;const o=this.config.requestTimeout,s=this.config.keepAlive===!0,c=this.config.credentials;if(r==null?void 0:r.aborted){const a=new Error("Request aborted");return a.name="AbortError",Promise.reject(a)}let i=e.path;const u=Gn.buildQueryString(e.query||{});if(u)i+=`?${u}`;if(e.fragment)i+=`#${e.fragment}`;let l="";if(e.username!=null||e.password!=null){const a=e.username??"",x=e.password??"";l=`${a}:${x}@`}const{port:m,method:f}=e,h=`${e.protocol}//${l}${e.hostname}${m?`:${m}`:""}${i}`,d=f==="GET"||f==="HEAD"?void 0:e.body,g={body:d,headers:new Headers(e.headers),method:f,credentials:c};if((n=this.config)==null?void 0:n.cache)g.cache=this.config.cache;if(d)g.duplex="half";if(typeof AbortController!=="undefined")g.signal=r;if(q.supported)g.keepalive=s;if(typeof this.config.requestInit==="function")Object.assign(g,this.config.requestInit(e));let w=$(()=>{},"removeSignalEventListener");const p=new Request(h,g),y=[fetch(p).then((a)=>{const x=a.headers,E={};for(let A of x.entries())E[A[0]]=A[1];if(a.body==null)return a.blob().then((A)=>({response:new Me.HttpResponse({headers:E,reason:a.statusText,statusCode:a.status,body:A})}));return{response:new Me.HttpResponse({headers:E,reason:a.statusText,statusCode:a.status,body:a.body})}}),Fe(o)];if(r)y.push(new Promise((a,x)=>{const E=$(()=>{const T=new Error("Request aborted");T.name="AbortError",x(T)},"onAbort");if(typeof r.addEventListener==="function"){const T=r;T.addEventListener("abort",E,{once:!0}),w=$(()=>T.removeEventListener("abort",E),"removeSignalEventListener")}else r.onabort=E}));return Promise.race(y).finally(w)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then((n)=>{return n[e]=r,n})}httpHandlerConfigs(){return this.config??{}}};$(Le,"FetchHttpHandler");var Kn=Le,Xn=Ne(),Jn=$((t)=>{if(typeof Blob==="function"&&t instanceof Blob)return De(t);return ke(t)},"streamCollector");$(De,"collectBlob");$(ke,"collectStream");$(ze,"readToBase64")});var Pe=b((hf,Ze)=>{var Ve=function(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const n=t.slice(r,r+2).toLowerCase();if(n in yt)e[r/2]=yt[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e},He=function(t){let e="";for(let r=0;r<t.byteLength;r++)e+=Oe[t[r]];return e},tt=Object.defineProperty,vn=Object.getOwnPropertyDescriptor,qn=Object.getOwnPropertyNames,_n=Object.prototype.hasOwnProperty,Ye=(t,e)=>tt(t,"name",{value:e,configurable:!0}),to=(t,e)=>{for(var r in e)tt(t,r,{get:e[r],enumerable:!0})},eo=(t,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let o of qn(e))if(!_n.call(t,o)&&o!==r)tt(t,o,{get:()=>e[o],enumerable:!(n=vn(e,o))||n.enumerable})}return t},ro=(t)=>eo(tt({},"__esModule",{value:!0}),t),je={};to(je,{fromHex:()=>Ve,toHex:()=>He});Ze.exports=ro(je);var Oe={},yt={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();if(e.length===1)e=`0${e}`;Oe[t]=e,yt[e]=t}Ye(Ve,"fromHex");Ye(He,"toHex")});var N=(t,e)=>{const r=[];if(t)r.push(t);if(e)for(let n of e)r.push(n);return r},I=(t,e)=>{return`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`},U=()=>{let t=[],e=[],r=!1;const n=new Set,o=(f)=>f.sort((h,d)=>bt[d.step]-bt[h.step]||Ct[d.priority||"normal"]-Ct[h.priority||"normal"]),s=(f)=>{let h=!1;const d=(g)=>{const w=N(g.name,g.aliases);if(w.includes(f)){h=!0;for(let p of w)n.delete(p);return!1}return!0};return t=t.filter(d),e=e.filter(d),h},c=(f)=>{let h=!1;const d=(g)=>{if(g.middleware===f){h=!0;for(let w of N(g.name,g.aliases))n.delete(w);return!1}return!0};return t=t.filter(d),e=e.filter(d),h},i=(f)=>{return t.forEach((h)=>{f.add(h.middleware,{...h})}),e.forEach((h)=>{f.addRelativeTo(h.middleware,{...h})}),f.identifyOnResolve?.(m.identifyOnResolve()),f},u=(f)=>{const h=[];return f.before.forEach((d)=>{if(d.before.length===0&&d.after.length===0)h.push(d);else h.push(...u(d))}),h.push(f),f.after.reverse().forEach((d)=>{if(d.before.length===0&&d.after.length===0)h.push(d);else h.push(...u(d))}),h},l=(f=!1)=>{const h=[],d=[],g={};return t.forEach((p)=>{const y={...p,before:[],after:[]};for(let a of N(y.name,y.aliases))g[a]=y;h.push(y)}),e.forEach((p)=>{const y={...p,before:[],after:[]};for(let a of N(y.name,y.aliases))g[a]=y;d.push(y)}),d.forEach((p)=>{if(p.toMiddleware){const y=g[p.toMiddleware];if(y===void 0){if(f)return;throw new Error(`${p.toMiddleware} is not found when adding `+`${I(p.name,p.aliases)} `+`middleware ${p.relation} ${p.toMiddleware}`)}if(p.relation==="after")y.after.push(p);if(p.relation==="before")y.before.push(p)}}),o(h).map(u).reduce((p,y)=>{return p.push(...y),p},[])},m={add:(f,h={})=>{const{name:d,override:g,aliases:w}=h,p={step:"initialize",priority:"normal",middleware:f,...h},y=N(d,w);if(y.length>0){if(y.some((a)=>n.has(a))){if(!g)throw new Error(`Duplicate middleware name '${I(d,w)}'`);for(let a of y){const x=t.findIndex((T)=>T.name===a||T.aliases?.some((A)=>A===a));if(x===-1)continue;const E=t[x];if(E.step!==p.step||p.priority!==E.priority)throw new Error(`"${I(E.name,E.aliases)}" middleware with `+`${E.priority} priority in ${E.step} step cannot `+`be overridden by "${I(d,w)}" middleware with `+`${p.priority} priority in ${p.step} step.`);t.splice(x,1)}}for(let a of y)n.add(a)}t.push(p)},addRelativeTo:(f,h)=>{const{name:d,override:g,aliases:w}=h,p={middleware:f,...h},y=N(d,w);if(y.length>0){if(y.some((a)=>n.has(a))){if(!g)throw new Error(`Duplicate middleware name '${I(d,w)}'`);for(let a of y){const x=e.findIndex((T)=>T.name===a||T.aliases?.some((A)=>A===a));if(x===-1)continue;const E=e[x];if(E.toMiddleware!==p.toMiddleware||E.relation!==p.relation)throw new Error(`"${I(E.name,E.aliases)}" middleware `+`${E.relation} "${E.toMiddleware}" middleware cannot be overridden `+`by "${I(d,w)}" middleware ${p.relation} `+`"${p.toMiddleware}" middleware.`);e.splice(x,1)}}for(let a of y)n.add(a)}e.push(p)},clone:()=>i(U()),use:(f)=>{f.applyToStack(m)},remove:(f)=>{if(typeof f==="string")return s(f);else return c(f)},removeByTag:(f)=>{let h=!1;const d=(g)=>{const{tags:w,name:p,aliases:y}=g;if(w&&w.includes(f)){const a=N(p,y);for(let x of a)n.delete(x);return h=!0,!1}return!0};return t=t.filter(d),e=e.filter(d),h},concat:(f)=>{const h=i(U());return h.use(f),h.identifyOnResolve(r||h.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),h},applyToStack:i,identify:()=>{return l(!0).map((f)=>{const h=f.step??f.relation+" "+f.toMiddleware;return I(f.name,f.aliases)+" - "+h})},identifyOnResolve(f){if(typeof f==="boolean")r=f;return r},resolve:(f,h)=>{for(let d of l().map((g)=>g.middleware).reverse())f=d(f,h);if(r)console.log(m.identify());return f}};return m},bt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Ct={high:3,normal:2,low:1};class mr{constructor(t){this.config=t,this.middlewareStack=U()}send(t,e,r){const n=typeof e!=="function"?e:void 0,o=typeof e==="function"?e:r,s=n===void 0&&this.config.cacheMiddleware===!0;let c;if(s){if(!this.handlers)this.handlers=new WeakMap;const i=this.handlers;if(i.has(t.constructor))c=i.get(t.constructor);else c=t.resolveMiddleware(this.middlewareStack,this.config,n),i.set(t.constructor,c)}else delete this.handlers,c=t.resolveMiddleware(this.middlewareStack,this.config,n);if(o)c(t).then((i)=>o(null,i.output),(i)=>o(i)).catch(()=>{});else return c(t).then((i)=>i.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var St;(function(t){t.HEADER="header",t.QUERY="query"})(St||(St={}));var $t;(function(t){t.HEADER="header",t.QUERY="query"})($t||($t={}));var At;(function(t){t.HTTP="http",t.HTTPS="https"})(At||(At={}));var F;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(F||(F={}));var et;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(et||(et={}));var It="__smithy_context";var Rt;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(Rt||(Rt={}));var Nt;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(Nt||(Nt={}));class Mt{constructor(){this.middlewareStack=U()}static classBuilder(){return new Ut}resolveMiddlewareWithContext(t,e,r,{middlewareFn:n,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,smithyContext:u,additionalContext:l,CommandCtor:m}){for(let w of n.bind(this)(m,t,e,r))this.middlewareStack.use(w);const f=t.concat(this.middlewareStack),{logger:h}=e,d={logger:h,clientName:o,commandName:s,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,[It]:{commandInstance:this,...u},...l},{requestHandler:g}=e;return f.resolve((w)=>g.handle(w.request,r||{}),d)}}class Ut{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(t)=>t,this._outputFilterSensitiveLog=(t)=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,e,r={}){return this._smithyContext={service:t,operation:e,...r},this}c(t={}){return this._additionalContext=t,this}n(t,e){return this._clientName=t,this._commandName=e,this}f(t=(r)=>r,e=(r)=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=e,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){const t=this;let e;return e=class extends Mt{static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=r??{},t._init(this)}resolveMiddleware(r,n,o){return this.resolveMiddlewareWithContext(r,n,o,{CommandCtor:e,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var oi=(t)=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},si=(t)=>{return{httpHandler:t.httpHandler()}};var wr=function(t){return Object.keys(t).reduce((e,r)=>{const n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})};class rt{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const e=new rt({...t,headers:{...t.headers}});if(e.query)e.query=wr(e.query);return e}static isInstance(t){if(!t)return!1;const e=t;return"method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&typeof e.query==="object"&&typeof e.headers==="object"}clone(){return rt.clone(this)}}class j{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const e=t;return typeof e.statusCode==="number"&&typeof e.headers==="object"}}var B=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,Er),Er=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function nt(t){const e=[];for(let r of Object.keys(t).sort()){const n=t[r];if(r=B(r),Array.isArray(n))for(let o=0,s=n.length;o<s;o++)e.push(`${r}=${B(n[o])}`);else{let o=r;if(n||typeof n==="string")o+=`=${B(n)}`;e.push(o)}}return e.join("&")}import{Agent as Bt,request as Cr} from"http";import{Agent as Wt,request as Sr} from"https";var Ft=["ECONNRESET","EPIPE","ETIMEDOUT"];var ot=(t)=>{const e={};for(let r of Object.keys(t)){const n=t[r];e[r]=Array.isArray(n)?n.join(","):n}return e};var Lt=(t,e,r=0)=>{if(!r)return-1;const n=(o)=>{const s=setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r-o),c=(i)=>{if(i?.connecting)i.on("connect",()=>{clearTimeout(s)});else clearTimeout(s)};if(t.socket)c(t.socket);else t.on("socket",c)};if(r<2000)return n(0),0;return setTimeout(n.bind(null,1000),1000)};var Dt=(t,{keepAlive:e,keepAliveMsecs:r},n=3000)=>{if(e!==!0)return-1;const o=()=>{if(t.socket)t.socket.setKeepAlive(e,r||0);else t.on("socket",(s)=>{s.setKeepAlive(e,r||0)})};if(n===0)return o(),0;return setTimeout(o,n)};var kt=(t,e,r=0)=>{const n=(o)=>{t.setTimeout(r-o,()=>{t.destroy(),e(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};if(0<r&&r<6000)return n(0),0;return setTimeout(n.bind(null,r===0?0:3000),3000)};import{Readable as Tr} from"stream";async function st(t,e,r=zt){const n=e.headers??{},o=n.Expect||n.expect;let s=-1,c=!1;if(o==="100-continue")await Promise.race([new Promise((i)=>{s=Number(setTimeout(i,Math.max(zt,r)))}),new Promise((i)=>{t.on("continue",()=>{clearTimeout(s),i()}),t.on("error",()=>{c=!0,clearTimeout(s),i()})})]);if(!c)br(t,e.body)}var br=function(t,e){if(e instanceof Tr){e.pipe(t);return}if(e){if(Buffer.isBuffer(e)||typeof e==="string"){t.end(e);return}const r=e;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){t.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}t.end(Buffer.from(e));return}t.end()},zt=1000;class it{static create(t){if(typeof t?.handle==="function")return t;return new it(t)}static checkSocketUsage(t,e,r=console){const{sockets:n,requests:o,maxSockets:s}=t;if(typeof s!=="number"||s===Infinity)return e;const c=15000;if(Date.now()-c<e)return e;if(n&&o)for(let i in n){const u=n[i]?.length??0,l=o[i]?.length??0;if(u>=s&&l>=2*s)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued.
2
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return e}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((e,r)=>{if(typeof t==="function")t().then((n)=>{e(this.resolveDefaultConfig(n))}).catch(r);else e(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){const{requestTimeout:e,connectionTimeout:r,socketTimeout:n,httpAgent:o,httpsAgent:s}=t||{};return{connectionTimeout:r,requestTimeout:e??n,httpAgent:(()=>{if(o instanceof Bt||typeof o?.destroy==="function")return o;return new Bt({keepAlive:!0,maxSockets:50,...o})})(),httpsAgent:(()=>{if(s instanceof Wt||typeof s?.destroy==="function")return s;return new Wt({keepAlive:!0,maxSockets:50,...s})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:e}={}){if(!this.config)this.config=await this.configProvider;return new Promise((r,n)=>{let o=void 0;const s=[],c=async(a)=>{await o,s.forEach(clearTimeout),r(a)},i=async(a)=>{await o,s.forEach(clearTimeout),n(a)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(e?.aborted){const a=new Error("Request aborted");a.name="AbortError",i(a);return}const u=t.protocol==="https:",l=u?this.config.httpsAgent:this.config.httpAgent;s.push(setTimeout(()=>{this.socketWarningTimestamp=it.checkSocketUsage(l,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const m=nt(t.query||{});let f=void 0;if(t.username!=null||t.password!=null){const a=t.username??"",x=t.password??"";f=`${a}:${x}`}let h=t.path;if(m)h+=`?${m}`;if(t.fragment)h+=`#${t.fragment}`;let d=t.hostname??"";if(d[0]==="["&&d.endsWith("]"))d=t.hostname.slice(1,-1);else d=t.hostname;const g={headers:t.headers,host:d,method:t.method,path:h,port:t.port,agent:l,auth:f},p=(u?Sr:Cr)(g,(a)=>{const x=new j({statusCode:a.statusCode||-1,reason:a.statusMessage,headers:ot(a.headers),body:a});c({response:x})});if(p.on("error",(a)=>{if(Ft.includes(a.code))i(Object.assign(a,{name:"TimeoutError"}));else i(a)}),e){const a=()=>{p.destroy();const x=new Error("Request aborted");x.name="AbortError",i(x)};if(typeof e.addEventListener==="function"){const x=e;x.addEventListener("abort",a,{once:!0}),p.once("close",()=>x.removeEventListener("abort",a))}else e.onabort=a}s.push(Lt(p,i,this.config.connectionTimeout)),s.push(kt(p,i,this.config.requestTimeout));const y=g.agent;if(typeof y==="object"&&"keepAlive"in y)s.push(Dt(p,{keepAlive:y.keepAlive,keepAliveMsecs:y.keepAliveMsecs}));o=st(p,t,this.config.requestTimeout).catch((a)=>{return s.forEach(clearTimeout),n(a)})})}updateHttpClientConfig(t,e){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[t]:e}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as $r} from"stream";class ct extends $r{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,e,r){this.bufferedBytes.push(t),r()}}async function Ir(t){const e=[],r=t.getReader();let n=!1,o=0;while(!n){const{done:i,value:u}=await r.read();if(u)e.push(u),o+=u.length;n=i}const s=new Uint8Array(o);let c=0;for(let i of e)s.set(i,c),c+=i.length;return s}var Yt=(t)=>{if(Ar(t))return Ir(t);return new Promise((e,r)=>{const n=new ct;t.pipe(n),t.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){const o=new Uint8Array(Buffer.concat(this.bufferedBytes));e(o)})})},Ar=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;var yc="***SensitiveInformation***";var xc=(t,e)=>{for(let r of Object.keys(t)){const n=t[r],o=async function(c,i,u){const l=new n(c);if(typeof i==="function")this.send(l,i);else if(typeof u==="function"){if(typeof i!=="object")throw new Error(`Expected http options but got ${typeof i}`);this.send(l,i||{},u)}else return this.send(l,i)},s=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");e.prototype[s]=o}};class jt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,jt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Ot=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,o])=>{if(t[n]==null||t[n]==="")t[n]=o});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t};class Rr{trace(){}debug(){}info(){}warn(){}error(){}}var Vt=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";import{Buffer as ft} from"buffer";var L=(t,e=0,r=t.byteLength-e)=>{if(!Vt(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ft.from(t,e,r)},O=(t,e)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?ft.from(t,e):ft.from(t)};var Nr=/^[A-Za-z0-9+/]*={0,2}$/,Ht=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Nr.exec(t))throw new TypeError("Invalid base64 string.");const e=O(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};var D=(t)=>{const e=O(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var Mc=(t)=>{if(typeof t==="string")return D(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};var V=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return L(t.buffer,t.byteOffset,t.byteLength).toString("utf8")};var H=(t)=>{let e;if(typeof t==="string")e=D(t);else e=t;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return L(e.buffer,e.byteOffset,e.byteLength).toString("base64")};function Zt(t,e="utf-8"){if(e==="base64")return H(t);return V(t)}function Pt(t,e){if(e==="base64")return S.mutate(Ht(t));return S.mutate(D(t))}class S extends Uint8Array{static fromString(t,e="utf-8"){switch(typeof t){case"string":return Pt(t,e);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,S.prototype),t}transformToString(t="utf-8"){return Zt(this,t)}}import{Readable as Mr} from"stream";var vc=(t,e)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:o,checksumLocationName:s,streamHasher:c}=e,i=r!==void 0&&o!==void 0&&s!==void 0&&c!==void 0,u=i?c(o,t):void 0,l=new Mr({read:()=>{}});return t.on("data",(m)=>{const f=n(m)||0;l.push(`${f.toString(16)}\r\n`),l.push(m),l.push("\r\n")}),t.on("end",async()=>{if(l.push("0\r\n"),i){const m=r(await u);l.push(`${s}:${m}\r\n`),l.push("\r\n")}l.push(null)}),l};import{Readable as gt} from"stream";import{TextDecoder as no} from"util";var Xe=Ke(We(),1);var Je=Ke(Pe(),1);var M=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream);var Qe="The stream has already been transformed.",ve=(t)=>{if(!Ge(t)&&!M(t)){const o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let e=!1;const r=async()=>{if(e)throw new Error(Qe);return e=!0,await Xe.streamCollector(t)},n=(o)=>{if(typeof o.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return o.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(o)=>{const s=await r();if(o==="base64")return H(s);else if(o==="hex")return Je.toHex(s);else if(o===void 0||o==="utf8"||o==="utf-8")return V(s);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(Qe);if(e=!0,Ge(t))return n(t);else if(M(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},Ge=(t)=>typeof Blob==="function"&&t instanceof Blob;var qe="The stream has already been transformed.",Tf=(t)=>{if(!(t instanceof gt))try{return ve(t)}catch(n){const o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let e=!1;const r=async()=>{if(e)throw new Error(qe);return e=!0,await Yt(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(n)=>{const o=await r();if(n===void 0||Buffer.isEncoding(n))return L(o.buffer,o.byteOffset,o.byteLength).toString(n);else return new no(n).decode(o)},transformToWebStream:()=>{if(e)throw new Error(qe);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof gt.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return e=!0,gt.toWeb(t)}})};import{PassThrough as tr} from"stream";async function _e(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}async function If(t){if(M(t))return _e(t);const e=new tr,r=new tr;return t.pipe(e),t.pipe(r),[e,r]}import{Writable as oo} from"stream";async function er(t,e){let r=0;const n=[],o=t.getReader();let s=!1;while(!s){const{done:u,value:l}=await o.read();if(l)n.push(l),r+=l?.byteLength??0;if(r>=e)break;s=u}o.releaseLock();const c=new Uint8Array(Math.min(e,r));let i=0;for(let u of n){if(u.byteLength>c.byteLength-i){c.set(u.subarray(0,c.byteLength-i),i);break}else c.set(u,i);i+=u.length}return c}var Lf=(t,e)=>{if(M(t))return er(t,e);return new Promise((r,n)=>{const o=new rr;o.limit=e,t.pipe(o),t.on("error",(s)=>{o.end(),n(s)}),o.on("error",n),o.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.buffers));r(s)})})};class rr extends oo{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(t,e,r){if(this.buffers.push(t),this.bytesBuffered+=t.byteLength??0,this.bytesBuffered>=this.limit){const n=this.bytesBuffered-this.limit,o=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=o.subarray(0,o.byteLength-n),this.emit("finish")}r()}}var Hf=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return S.mutate(t);if(!t)return S.mutate(new Uint8Array);const r=e.streamCollector(t);return S.mutate(await r)};var Pf=(t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}};var so=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){const e=parseFloat(t);if(!Number.isNaN(e)){if(String(e)!==String(t))hr.warn(ar(`Expected number but observed string: ${t}`));return e}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},io=Math.ceil(340282346638528860000000000000000000000),nr=(t)=>{const e=so(t);if(e!==void 0&&!Number.isNaN(e)&&e!==Infinity&&e!==(-Infinity)){if(Math.abs(e)>io)throw new TypeError(`Expected 32-bit float, got ${t}`)}return e},xt=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)};var or=(t)=>mt(t,32),sr=(t)=>mt(t,16),ir=(t)=>mt(t,8),mt=(t,e)=>{const r=xt(t);if(r!==void 0&&co(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},co=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Qf=(t,e)=>{if(t===null||t===void 0){if(e)throw new TypeError(`Expected a non-null value for ${e}`);throw new TypeError("Expected a non-null value")}return t},Gf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;const e=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${e}: ${t}`)},Kf=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return hr.warn(ar(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var cr=(t)=>{if(typeof t=="string")return nr(W(t));return nr(t)},fo=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,W=(t)=>{const e=t.match(fo);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var Xf=(t)=>{if(typeof t==="string")return xt(W(t));return xt(t)};var Jf=(t)=>{if(typeof t==="string")return or(W(t));return or(t)},k=(t)=>{if(typeof t==="string")return sr(W(t));return sr(t)},fr=(t)=>{if(typeof t==="string")return ir(W(t));return ir(t)},ar=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((e)=>!e.includes("stackTraceWarning")).join("\n")},hr={warn:console.warn};function ta(t){const e=t.getUTCFullYear(),r=t.getUTCMonth(),n=t.getUTCDay(),o=t.getUTCDate(),s=t.getUTCHours(),c=t.getUTCMinutes(),i=t.getUTCSeconds(),u=o<10?`0${o}`:`${o}`,l=s<10?`0${s}`:`${s}`,m=c<10?`0${c}`:`${c}`,f=i<10?`0${i}`:`${i}`;return`${ao[n]}, ${u} ${Et[r]} ${e} ${l}:${m}:${f} GMT`}var ao=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ho=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),ea=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=ho.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,u,l]=e,m=k(z(n)),f=C(o,"month",1,12),h=C(s,"day",1,31);return Y(m,f,h,{hours:c,minutes:i,seconds:u,fractionalMilliseconds:l})},uo=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),ra=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=uo.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,s,c,i,u,l,m]=e,f=k(z(n)),h=C(o,"month",1,12),d=C(s,"day",1,31),g=Y(f,h,d,{hours:c,minutes:i,seconds:u,fractionalMilliseconds:l});if(m.toUpperCase()!="Z")g.setTime(g.getTime()-Co(m));return g},lo=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),po=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),yo=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),na=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=lo.exec(t);if(e){const[r,n,o,s,c,i,u,l]=e;return Y(k(z(s)),wt(o),C(n,"day",1,31),{hours:c,minutes:i,seconds:u,fractionalMilliseconds:l})}if(e=po.exec(t),e){const[r,n,o,s,c,i,u,l]=e;return mo(Y(go(s),wt(o),C(n,"day",1,31),{hours:c,minutes:i,seconds:u,fractionalMilliseconds:l}))}if(e=yo.exec(t),e){const[r,n,o,s,c,i,u,l]=e;return Y(k(z(l)),wt(n),C(o.trimLeft(),"day",1,31),{hours:s,minutes:c,seconds:i,fractionalMilliseconds:u})}throw new TypeError("Invalid RFC-7231 date-time value")};var Y=(t,e,r,n)=>{const o=e-1;return Eo(t,o,r),new Date(Date.UTC(t,o,r,C(n.hours,"hour",0,23),C(n.minutes,"minute",0,59),C(n.seconds,"seconds",0,60),bo(n.fractionalMilliseconds)))},go=(t)=>{const e=(new Date()).getUTCFullYear(),r=Math.floor(e/100)*100+k(z(t));if(r<e)return r+100;return r},xo=1576800000000,mo=(t)=>{if(t.getTime()-(new Date()).getTime()>xo)return new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()));return t},wt=(t)=>{const e=Et.indexOf(t);if(e<0)throw new TypeError(`Invalid month: ${t}`);return e+1},wo=[31,28,31,30,31,30,31,31,30,31,30,31],Eo=(t,e,r)=>{let n=wo[e];if(e===1&&To(t))n=29;if(r>n)throw new TypeError(`Invalid day for ${Et[e]} in ${t}: ${r}`)},To=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},C=(t,e,r,n)=>{const o=fr(z(t));if(o<r||o>n)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return o},bo=(t)=>{if(t===null||t===void 0)return 0;return cr("0."+t)*1000},Co=(t)=>{const e=t[0];let r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(t.substring(1,3)),o=Number(t.substring(4,6));return r*(n*60+o)*60*1000},z=(t)=>{let e=0;while(e<t.length-1&&t.charAt(e)==="0")e++;if(e===0)return t;return t.slice(e)};var So=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{const o=$o(t),s=o.httpStatusCode?o.httpStatusCode+"":void 0,c=new r({name:e?.code||e?.Code||n||s||"UnknownError",$fault:"client",$metadata:o});throw Ot(c,e)},ia=(t)=>{return({output:e,parsedBody:r,errorCode:n})=>{So({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})}},$o=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]});var fa=(t)=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var ur=!1,ha=(t)=>{if(t&&!ur&&parseInt(t.substring(1,t.indexOf(".")))<16)ur=!0};var dr=(t)=>{const e=[];for(let r in F){const n=F[r];if(t[n]===void 0)continue;e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},lr=(t)=>{const e={};return t.checksumAlgorithms().forEach((r)=>{e[r.algorithmId()]=r.checksumConstructor()}),e};var pr=(t)=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},yr=(t)=>{const e={};return e.retryStrategy=t.retryStrategy(),e};var xa=(t)=>{return{...dr(t),...pr(t)}};var ma=(t)=>{return{...lr(t),...yr(t)}};function Ao(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var Tt=function(){const t=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,t.prototype),r};Tt.prototype=Object.create(String.prototype,{constructor:{value:Tt,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Tt,String);function Io(t,e,r){let n,o,s;if(typeof e==="undefined"&&typeof r==="undefined")n={},s=t;else if(n=t,typeof e==="function")return o=e,s=r,Ro(n,o,s);else s=e;for(let c of Object.keys(s)){if(!Array.isArray(s[c])){n[c]=s[c];continue}gr(n,null,s,c)}return n}var Aa=(t,e)=>{const r={};for(let n in e)gr(r,t,e,n);return r},Ro=(t,e,r)=>{return Io(t,Object.entries(r).reduce((n,[o,s])=>{if(Array.isArray(s))n[o]=s;else if(typeof s==="function")n[o]=[e,s()];else n[o]=[e,s];return n},{}))},gr=(t,e,r,n)=>{if(e!==null){let c=r[n];if(typeof c==="function")c=[,c];const[i=No,u=Mo,l=n]=c;if(typeof i==="function"&&i(e[l])||typeof i!=="function"&&!!i)t[n]=u(e[l]);return}let[o,s]=r[n];if(typeof s==="function"){let c;const i=o===void 0&&(c=s())!=null,u=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(i)t[n]=c;else if(u)t[n]=s()}else{const c=o===void 0&&s!=null,i=typeof o==="function"&&!!o(s)||typeof o!=="function"&&!!o;if(c||i)t[n]=s}},No=(t)=>t!=null,Mo=(t)=>t;var Ma=(t)=>t.toISOString().replace(".000Z","Z");var xr=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((e)=>e!=null).map(xr);if(typeof t==="object"){const e={};for(let r of Object.keys(t)){if(t[r]==null)continue;e[r]=xr(t[r])}return e}return t};export{oi as xa,si as ya,At as za,It as Aa,rt as Ba,j as Ca,Vt as Da,L as Ea,O as Fa,D as Ga,Mc as Ha,V as Ia,Rr as Ja,mr as Ka,Ht as La,H as Ma,vc as Na,B as Oa,it as Pa,Yt as Qa,ee as Ra,se as Sa,ae as Ta,de as Ua,X as Va,Ce as Wa,Ne as Xa,We as Ya,Pe as Za,Tf as _a,If as $a,Lf as ab,Hf as bb,Mt as cb,yc as db,xc as eb,Pf as fb,xt as gb,or as hb,Qf as ib,Gf as jb,Kf as kb,Xf as lb,Jf as mb,ta as nb,ea as ob,ra as pb,na as qb,jt as rb,Ot as sb,ia as tb,fa as ub,ha as vb,xa as wb,ma as xb,Ao as yb,Io as zb,Aa as Ab,Ma as Bb,xr as Cb};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{B as l} from"./chunk-24a86f8f5ddc0cbd.js";import{Fb as m} from"./chunk-b4cbb4706a35f5d5.js";var E=l(m(),1);import{readFileSync as S} from"fs";var t=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:c,policyArns:i,policy:_,durationSeconds:N}=e;let{roleAssumerWithWebIdentity:s}=e;if(!s){const{getDefaultRoleAssumerWithWebIdentity:d}=await import("./chunk-c4b0f134a6b82c51.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var p="AWS_WEB_IDENTITY_TOKEN_FILE",f="AWS_ROLE_ARN",T="AWS_ROLE_SESSION_NAME",I=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[p],r=e?.roleArn??process.env[f],n=e?.roleSessionName??process.env[T];if(!o||!r)throw new E.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:S(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,I as fromTokenFile};
2
+ import{B as l} from"./chunk-24a86f8f5ddc0cbd.js";import{Jb as m} from"./chunk-bd0308763754bf7b.js";var E=l(m(),1);import{readFileSync as S} from"fs";var t=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:c,policyArns:i,policy:_,durationSeconds:N}=e;let{roleAssumerWithWebIdentity:s}=e;if(!s){const{getDefaultRoleAssumerWithWebIdentity:d}=await import("./chunk-dc3eae4932658400.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var p="AWS_WEB_IDENTITY_TOKEN_FILE",f="AWS_ROLE_ARN",T="AWS_ROLE_SESSION_NAME",I=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[p],r=e?.roleArn??process.env[f],n=e?.roleSessionName??process.env[T];if(!o||!r)throw new E.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:S(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,I as fromTokenFile};
@@ -1,2 +1,2 @@
1
1
  import{C as D} from"./chunk-24a86f8f5ddc0cbd.js";var C=D((h,A)=>{var{defineProperty:Q,getOwnPropertyDescriptor:M,getOwnPropertyNames:J}=Object,V=Object.prototype.hasOwnProperty,I=(j,b)=>Q(j,"name",{value:b,configurable:!0}),w=(j,b)=>{for(var F in b)Q(j,F,{get:b[F],enumerable:!0})},O=(j,b,F,B)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let G of J(b))if(!V.call(j,G)&&G!==F)Q(j,G,{get:()=>b[G],enumerable:!(B=M(b,G))||B.enumerable})}return j},q=(j)=>O(Q({},"__esModule",{value:!0}),j),Y={};w(Y,{CredentialsProviderError:()=>L,ProviderError:()=>U,TokenProviderError:()=>S,chain:()=>T,fromStatic:()=>N,memoize:()=>R});A.exports=q(Y);var Z=class j extends Error{constructor(b,F=!0){var B;let G,H=!0;if(typeof F==="boolean")G=void 0,H=F;else if(F!=null&&typeof F==="object")G=F.logger,H=F.tryNextLink??!0;super(b);this.name="ProviderError",this.tryNextLink=H,Object.setPrototypeOf(this,j.prototype),(B=G==null?void 0:G.debug)==null||B.call(G,`@smithy/property-provider ${H?"->":"(!)"} ${b}`)}static from(b,F=!0){return Object.assign(new this(b.message,F),b)}};I(Z,"ProviderError");var U=Z,$=class j extends U{constructor(b,F=!0){super(b,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,j.prototype)}};I($,"CredentialsProviderError");var L=$,z=class j extends U{constructor(b,F=!0){super(b,F);this.name="TokenProviderError",Object.setPrototypeOf(this,j.prototype)}};I(z,"TokenProviderError");var S=z,T=I((...j)=>async()=>{if(j.length===0)throw new U("No providers in chain");let b;for(let F of j)try{return await F()}catch(B){if(b=B,B==null?void 0:B.tryNextLink)continue;throw B}throw b},"chain"),N=I((j)=>()=>Promise.resolve(j),"fromStatic"),R=I((j,b,F)=>{let B,G,H,W=!1;const X=I(async()=>{if(!G)G=j();try{B=await G,H=!0,W=!1}finally{G=void 0}return B},"coalesceProvider");if(b===void 0)return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();return B};return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();if(W)return B;if(F&&!F(B))return W=!0,B;if(b(B))return await X(),B;return B}},"memoize")});
2
- export{C as Fb};
2
+ export{C as Jb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as K} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-79f9130d266efc8b.js";import{Gb as v,Hb as P} from"./chunk-36d595d02662f2fa.js";import"./chunk-92b7f08b6396b0fc.js";import{Jb as _} from"./chunk-bd0308763754bf7b.js";var m=K(_(),1);import{parse as o} from"url";var z=K(_(),1);import{Buffer as a} from"buffer";import{request as n} from"http";function f(c){return new Promise((I,x)=>{const T=n({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new z.ProviderError("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new z.ProviderError("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{const{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new z.ProviderError("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const u=[];N.on("data",(y)=>{u.push(y)}),N.on("end",()=>{I(a.concat(u)),T.destroy()})}),T.end()})}var D=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",G=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var fc=1000,uc=0,Q=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var J=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var Z="AWS_CONTAINER_CREDENTIALS_FULL_URI",L="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN",zc=(c={})=>{const{timeout:I,maxRetries:x}=Q(c);return()=>J(async()=>{const T=await d({logger:c.logger}),N=JSON.parse(await s(I,T));if(!D(N))throw new m.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return G(N)},x)},s=async(c,I)=>{if(process.env[B])I.headers={...I.headers,Authorization:process.env[B]};return(await f({...I,timeout:c})).toString()},g="169.254.170.2",l={localhost:!0,"127.0.0.1":!0},r={"http:":!0,"https:":!0},d=async({logger:c})=>{if(process.env[L])return{hostname:g,path:process.env[L]};if(process.env[Z]){const I=o(process.env[Z]);if(!I.hostname||!(I.hostname in l))throw new m.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in r))throw new m.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new m.CredentialsProviderError("The container metadata credential provider cannot be used unless"+` the ${L} or ${Z} environment`+" variable is set",{tryNextLink:!1,logger:c})};var q=K(_(),1);var U=K(_(),1);class X extends U.CredentialsProviderError{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,X.prototype)}}var j;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(j||(j={}));var t={environmentVariableSelector:(c)=>c["AWS_EC2_METADATA_SERVICE_ENDPOINT"],configFileSelector:(c)=>c["ec2_metadata_service_endpoint"],default:void 0};var S;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(S||(S={}));var e="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",i="ec2_metadata_service_endpoint_mode",F={environmentVariableSelector:(c)=>c[e],configFileSelector:(c)=>c[i],default:S.IPv4};var W=async()=>P(await cc()||await Ic()),cc=async()=>v(t)(),Ic=async()=>{const c=await v(F)();switch(c){case S.IPv4:return j.IPv4;case S.IPv6:return j.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}.`+` Select from ${Object.values(S)}`)}};var b=(c,I)=>{const x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these "+`credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: `+"https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html");const N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var V=(c,I={})=>{const x=I?.logger||console;let T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=b(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=b(T,x);else throw O}return T=N,N}};var k="/latest/meta-data/iam/security-credentials/",Tc="/latest/api/token",H="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",oc=(c={})=>V(Nc(c),{logger:c.logger}),Nc=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=Q(c),u=async(y,E)=>{if(I||E.headers?.[M]==null){let w=!1,h=!1;const C=await v({environmentVariableSelector:(Y)=>{const $=Y[H];if(h=!!$&&$!=="false",$===void 0)throw new q.CredentialsProviderError(`${H} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{const $=Y[R];return w=!!$&&$!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||C){const Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${H})`);throw new X(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}const p=(await J(async()=>{let w;try{w=await Oc(E)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return J(async()=>{let w;try{w=await yc(p,E,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{const y=await W();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),u(O,{...y,timeout:N});else{let E;try{E=(await xc({...y,timeout:N})).toString()}catch(A){if(A?.statusCode===400)throw Object.assign(A,{message:"EC2 Metadata token request returned error"});else if(A.message==="TimeoutError"||[403,404,405].includes(A.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),u(O,{...y,timeout:N})}return u(O,{...y,headers:{[M]:E},timeout:N})}}},xc=async(c)=>f({...c,path:Tc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Oc=async(c)=>(await f({...c,path:k})).toString(),yc=async(c,I,x)=>{const T=JSON.parse((await f({...I,path:k+c})).toString());if(!D(T))throw new q.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return G(T)};export{Q as providerConfigFromInit,f as httpRequest,W as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,zc as fromContainerMetadata,j as Endpoint,L as ENV_CMDS_RELATIVE_URI,Z as ENV_CMDS_FULL_URI,B as ENV_CMDS_AUTH_TOKEN,fc as DEFAULT_TIMEOUT,uc as DEFAULT_MAX_RETRIES};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-8f575468b4e4754d.js";import{B as b} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-28694e5e949df0ff.js";import{$ as Wl,O as Gl,P as dl,Q as K0,R as F0,S as B0,T as U0,W as Qh,X as Q0,Y as zl,Z as Ml,_ as Nl,aa as X0,ba as xl,ca as il,da as cl,ea as el,fa as Y0,ga as Z0,ia as F,ja as B,ka as $0,la as pl,ma as nl,na as V0,oa as ol,pa as P0,qa as Gh,ra as ul,sa as tl,ta as h0,ua as l0,va as D0,wa as E0} from"./chunk-75aa5e5e2f565737.js";import{Ba as L0,Ga as Al,Ia as Ll,Ja as Rl,Ka as y0,La as jl,Ma as al,Pa as fl,Qa as Cl,cb as K,db as Sh,eb as hw,ib as R0,kb as H,mb as u,pb as j0,rb as v0,sb as T,tb as a0,ub as Ol,vb as gl,wb as m0,xa as S0,xb as J0,ya as H0,yb as eh} from"./chunk-a4330a47c3806ff1.js";import"./chunk-79f9130d266efc8b.js";import{Eb as Xh} from"./chunk-08bf87c7e29141d3.js";import{Gb as f,Hb as sl} from"./chunk-36d595d02662f2fa.js";import"./chunk-92b7f08b6396b0fc.js";import"./chunk-bd0308763754bf7b.js";var C=b(Qh(),1);var Il=b(Gh(),1);var Ew=function(h){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:h.region},propertiesExtractor:(w,l)=>({signingProperties:{config:w,context:l}})}},wl=function(h){return{schemeId:"smithy.api#noAuth"}},Sl=async(h,w,l)=>{return{operation:Gl(w).operation,region:await dl(h.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Hl=(h)=>{const w=[];switch(h.operation){case"AssumeRoleWithSAML":{w.push(wl(h));break}case"AssumeRoleWithWebIdentity":{w.push(wl(h));break}default:w.push(Ew(h))}return w},kw=(h)=>({...h,stsClientCtor:A}),ml=(h)=>{const w=kw(h);return{...Il.resolveAwsSdkSigV4Config(w)}};var Jl=(h)=>{return{...h,useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,useGlobalEndpoint:h.useGlobalEndpoint??!1,defaultSigningName:"sts"}},D={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var Dl={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn test:unit","test:unit":"jest"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-node":"^3.0.6","@smithy/invalid-dependency":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}};var dh=b(Gh(),1);var w0=b(Qh(),1);var rl=b(Gh(),1),_l=b(Qh(),1);var El={["required"]:!1,["type"]:"String"},yh={["required"]:!0,default:!1,["type"]:"Boolean"},Yl={["ref"]:"Endpoint"},kl={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},J={["ref"]:"Region"},Kl={["fn"]:"aws.partition",["argv"]:[J],assign:"PartitionResult"},Zl={["ref"]:"UseFIPS"},$l={["ref"]:"UseDualStack"},E={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},X={},Fl={conditions:[{["fn"]:"stringEquals",["argv"]:[J,"aws-global"]}],["endpoint"]:E,["type"]:"endpoint"},Vl={["fn"]:"booleanEquals",["argv"]:[Zl,!0]},Pl={["fn"]:"booleanEquals",["argv"]:[$l,!0]},Bl={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},vl={["ref"]:"PartitionResult"},Ul={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[vl,"supportsDualStack"]}]},yl=[{["fn"]:"isSet",["argv"]:[Yl]}],Ql=[Vl],Xl=[Pl],Fw={version:"1.0",parameters:{Region:El,UseDualStack:yh,UseFIPS:yh,Endpoint:El,UseGlobalEndpoint:yh},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:yl},kl,Kl,{["fn"]:"booleanEquals",["argv"]:[Zl,!1]},{["fn"]:"booleanEquals",["argv"]:[$l,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-northeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-south-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-2"]}],endpoint:E,["type"]:"endpoint"},Fl,{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ca-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-north-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-3"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"sa-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-2"]}],endpoint:E,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:yl,rules:[{conditions:Ql,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:Xl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:Yl,properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[kl],rules:[{conditions:[Kl],rules:[{conditions:[Vl,Pl],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Bl]},Ul],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:Ql,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Bl,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[vl,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:X,headers:X},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:Xl,rules:[{conditions:[Ul],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},Fl,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},ql=Fw;var Bw=new zl({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Tl=(h,w={})=>{return Bw.get(h,()=>Nl(ql,{endpointParams:h,logger:w.logger}))};Ml.aws=Wl;var bl=(h)=>{return{apiVersion:"2011-06-15",base64Decoder:h?.base64Decoder??jl,base64Encoder:h?.base64Encoder??al,disableHostPrefix:h?.disableHostPrefix??!1,endpointProvider:h?.endpointProvider??Tl,extensions:h?.extensions??[],httpAuthSchemeProvider:h?.httpAuthSchemeProvider??Hl,httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(w)=>w.getIdentityProvider("aws.auth#sigv4"),signer:new rl.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(w)=>w.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _l.NoAuthSigner}],logger:h?.logger??new Rl,serviceId:h?.serviceId??"STS",urlParser:h?.urlParser??sl,utf8Decoder:h?.utf8Decoder??Al,utf8Encoder:h?.utf8Encoder??Ll}};var G0=(h)=>{gl(process.version);const w=l0(h),l=()=>w().then(Ol),G=bl(h);return dh.emitWarningIfUnsupportedVersion(process.version),{...G,...h,runtime:"node",defaultsMode:w,bodyLengthChecker:h?.bodyLengthChecker??h0,credentialDefaultProvider:h?.credentialDefaultProvider??Xh,defaultUserAgentProvider:h?.defaultUserAgentProvider??ul({serviceId:G.serviceId,clientVersion:Dl.version}),httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(d)=>d.getIdentityProvider("aws.auth#sigv4")||(async(S)=>await Xh(S?.__config||{})()),signer:new dh.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(d)=>d.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new w0.NoAuthSigner}],maxAttempts:h?.maxAttempts??f(nl),region:h?.region??f(cl,el),requestHandler:fl.create(h?.requestHandler??l),retryMode:h?.retryMode??f({...ol,default:async()=>(await l()).retryMode||pl}),sha256:h?.sha256??tl.bind(null,"sha256"),streamCollector:h?.streamCollector??Cl,useDualstackEndpoint:h?.useDualstackEndpoint??f(xl),useFipsEndpoint:h?.useFipsEndpoint??f(il)}};var d0=(h)=>{const w=h.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:G}=h;return{setHttpAuthScheme(d){const S=w.findIndex((I)=>I.schemeId===d.schemeId);if(S===-1)w.push(d);else w.splice(S,1,d)},httpAuthSchemes(){return w},setHttpAuthSchemeProvider(d){l=d},httpAuthSchemeProvider(){return l},setCredentials(d){G=d},credentials(){return G}}},I0=(h)=>{return{httpAuthSchemes:h.httpAuthSchemes(),httpAuthSchemeProvider:h.httpAuthSchemeProvider(),credentials:h.credentials()}};var Ih=(h)=>h,k0=(h,w)=>{const l={...Ih(D0(h)),...Ih(m0(h)),...Ih(S0(h)),...Ih(d0(h))};return w.forEach((G)=>G.configure(l)),{...h,...E0(l),...J0(l),...H0(l),...I0(l)}};class A extends y0{constructor(...[h]){const w=G0(h||{}),l=Jl(w),G=Q0(l),d=V0(G),S=Y0(d),I=K0(S),Q=$0(I),z=ml(Q),v=k0(z,h?.extensions||[]);super(v);this.config=v,this.middlewareStack.use(X0(this.config)),this.middlewareStack.use(P0(this.config)),this.middlewareStack.use(Z0(this.config)),this.middlewareStack.use(F0(this.config)),this.middlewareStack.use(B0(this.config)),this.middlewareStack.use(U0(this.config)),this.middlewareStack.use(C.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Sl,identityProviderConfigProvider:async(n)=>new C.DefaultIdentityProviderConfig({"aws.auth#sigv4":n.credentials})})),this.middlewareStack.use(C.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class Y extends v0{constructor(h){super(h);Object.setPrototypeOf(this,Y.prototype)}}class Hh extends Y{constructor(h){super({name:"ExpiredTokenException",$fault:"client",...h});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Hh.prototype)}}class mh extends Y{constructor(h){super({name:"MalformedPolicyDocumentException",$fault:"client",...h});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,mh.prototype)}}class Jh extends Y{constructor(h){super({name:"PackedPolicyTooLargeException",$fault:"client",...h});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Jh.prototype)}}class Dh extends Y{constructor(h){super({name:"RegionDisabledException",$fault:"client",...h});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Dh.prototype)}}class Eh extends Y{constructor(h){super({name:"IDPRejectedClaimException",$fault:"client",...h});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Eh.prototype)}}class kh extends Y{constructor(h){super({name:"InvalidIdentityTokenException",$fault:"client",...h});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,kh.prototype)}}class Kh extends Y{constructor(h){super({name:"IDPCommunicationErrorException",$fault:"client",...h});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,Kh.prototype)}}class Fh extends Y{constructor(h){super({name:"InvalidAuthorizationMessageException",$fault:"client",...h});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,Fh.prototype)}}var o=(h)=>({...h,...h.SecretAccessKey&&{SecretAccessKey:Sh}}),q0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),z0=(h)=>({...h,...h.SAMLAssertion&&{SAMLAssertion:Sh}}),M0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),N0=(h)=>({...h,...h.WebIdentityToken&&{WebIdentityToken:Sh}}),W0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),T0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),A0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}});var q=b(Gh(),1);var s0=async(h,w)=>{const l=j;let G;return G=_({...Pw(h,w),[s]:lG,[r]:a}),R(w,l,"/",void 0,G)},r0=async(h,w)=>{const l=j;let G;return G=_({...vw(h,w),[s]:wG,[r]:a}),R(w,l,"/",void 0,G)},_0=async(h,w)=>{const l=j;let G;return G=_({...qw(h,w),[s]:GG,[r]:a}),R(w,l,"/",void 0,G)},b0=async(h,w)=>{const l=j;let G;return G=_({...zw(h,w),[s]:dG,[r]:a}),R(w,l,"/",void 0,G)},f0=async(h,w)=>{const l=j;let G;return G=_({...Mw(h,w),[s]:IG,[r]:a}),R(w,l,"/",void 0,G)},C0=async(h,w)=>{const l=j;let G;return G=_({...Nw(h,w),[s]:SG,[r]:a}),R(w,l,"/",void 0,G)},O0=async(h,w)=>{const l=j;let G;return G=_({...Ww(h,w),[s]:HG,[r]:a}),R(w,l,"/",void 0,G)},g0=async(h,w)=>{const l=j;let G;return G=_({...Tw(h,w),[s]:mG,[r]:a}),R(w,l,"/",void 0,G)},x0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=sw(l.AssumeRoleResult,w),{$metadata:k(h),...G}},i0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=rw(l.AssumeRoleWithSAMLResult,w),{$metadata:k(h),...G}},c0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=_w(l.AssumeRoleWithWebIdentityResult,w),{$metadata:k(h),...G}},e0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=bw(l.DecodeAuthorizationMessageResult,w),{$metadata:k(h),...G}},p0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=Ow(l.GetAccessKeyInfoResult,w),{$metadata:k(h),...G}},n0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=gw(l.GetCallerIdentityResult,w),{$metadata:k(h),...G}},o0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=xw(l.GetFederationTokenResult,w),{$metadata:k(h),...G}},u0=async(h,w)=>{if(h.statusCode>=300)return L(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=iw(l.GetSessionTokenResult,w),{$metadata:k(h),...G}},L=async(h,w)=>{const l={...h,body:await q.parseXmlErrorBody(h.body,w)},G=JG(h,l.body);switch(G){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await Uw(l,w);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Zw(l,w);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await $w(l,w);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await Vw(l,w);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Qw(l,w);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await Yw(l,w);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await yw(l,w);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await Xw(l,w);default:const d=l.body;return hG({output:h,parsedBody:d.Error,errorCode:G})}},Uw=async(h,w)=>{const l=h.body,G=fw(l.Error,w),d=new Hh({$metadata:k(h),...G});return T(d,l)},yw=async(h,w)=>{const l=h.body,G=cw(l.Error,w),d=new Kh({$metadata:k(h),...G});return T(d,l)},Qw=async(h,w)=>{const l=h.body,G=ew(l.Error,w),d=new Eh({$metadata:k(h),...G});return T(d,l)},Xw=async(h,w)=>{const l=h.body,G=pw(l.Error,w),d=new Fh({$metadata:k(h),...G});return T(d,l)},Yw=async(h,w)=>{const l=h.body,G=nw(l.Error,w),d=new kh({$metadata:k(h),...G});return T(d,l)},Zw=async(h,w)=>{const l=h.body,G=ow(l.Error,w),d=new mh({$metadata:k(h),...G});return T(d,l)},$w=async(h,w)=>{const l=h.body,G=uw(l.Error,w),d=new Jh({$metadata:k(h),...G});return T(d,l)},Vw=async(h,w)=>{const l=h.body,G=tw(l.Error,w),d=new Dh({$metadata:k(h),...G});return T(d,l)},Pw=(h,w)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[i]!=null)l[i]=h[i];if(h[$]!=null){const G=Bh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const G=t0(h[e],w);if(h[e]?.length===0)l.Tags=[];Object.entries(G).forEach(([d,S])=>{const I=`Tags.${d}`;l[I]=S})}if(h[Oh]!=null){const G=aw(h[Oh],w);if(h[Oh]?.length===0)l.TransitiveTagKeys=[];Object.entries(G).forEach(([d,S])=>{const I=`TransitiveTagKeys.${d}`;l[I]=S})}if(h[Ph]!=null)l[Ph]=h[Ph];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];if(h[P]!=null)l[P]=h[P];if(h[Rh]!=null){const G=Rw(h[Rh],w);if(h[Rh]?.length===0)l.ProvidedContexts=[];Object.entries(G).forEach(([d,S])=>{const I=`ProvidedContexts.${d}`;l[I]=S})}return l},vw=(h,w)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[Ah]!=null)l[Ah]=h[Ah];if(h[_h]!=null)l[_h]=h[_h];if(h[$]!=null){const G=Bh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},qw=(h,w)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[i]!=null)l[i]=h[i];if(h[ih]!=null)l[ih]=h[ih];if(h[jh]!=null)l[jh]=h[jh];if(h[$]!=null){const G=Bh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},zw=(h,w)=>{const l={};if(h[vh]!=null)l[vh]=h[vh];return l},Mw=(h,w)=>{const l={};if(h[O]!=null)l[O]=h[O];return l},Nw=(h,w)=>{return{}},Ww=(h,w)=>{const l={};if(h[Wh]!=null)l[Wh]=h[Wh];if(h[Z]!=null)l[Z]=h[Z];if(h[$]!=null){const G=Bh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const G=t0(h[e],w);if(h[e]?.length===0)l.Tags=[];Object.entries(G).forEach(([d,S])=>{const I=`Tags.${d}`;l[I]=S})}return l},Tw=(h,w)=>{const l={};if(h[y]!=null)l[y]=h[y];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];return l},Bh=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;const S=Aw(d,w);Object.entries(S).forEach(([I,Q])=>{l[`member.${G}.${I}`]=Q}),G++}return l},Aw=(h,w)=>{const l={};if(h[ch]!=null)l[ch]=h[ch];return l},Lw=(h,w)=>{const l={};if(h[Lh]!=null)l[Lh]=h[Lh];if(h[Zh]!=null)l[Zh]=h[Zh];return l},Rw=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;const S=Lw(d,w);Object.entries(S).forEach(([I,Q])=>{l[`member.${G}.${I}`]=Q}),G++}return l},jw=(h,w)=>{const l={};if(h[Nh]!=null)l[Nh]=h[Nh];if(h[xh]!=null)l[xh]=h[xh];return l},aw=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;l[`member.${G}`]=d,G++}return l},t0=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;const S=jw(d,w);Object.entries(S).forEach(([I,Q])=>{l[`member.${G}.${I}`]=Q}),G++}return l},ph=(h,w)=>{const l={};if(h[Yh]!=null)l[Yh]=H(h[Yh]);if(h[N]!=null)l[N]=H(h[N]);return l},sw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[M]!=null)l[M]=ph(h[M],w);if(h[V]!=null)l[V]=u(h[V]);if(h[P]!=null)l[P]=H(h[P]);return l},rw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[M]!=null)l[M]=ph(h[M],w);if(h[V]!=null)l[V]=u(h[V]);if(h[sh]!=null)l[sh]=H(h[sh]);if(h[fh]!=null)l[fh]=H(h[fh]);if(h[Mh]!=null)l[Mh]=H(h[Mh]);if(h[x]!=null)l[x]=H(h[x]);if(h[Th]!=null)l[Th]=H(h[Th]);if(h[P]!=null)l[P]=H(h[P]);return l},_w=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[bh]!=null)l[bh]=H(h[bh]);if(h[M]!=null)l[M]=ph(h[M],w);if(h[V]!=null)l[V]=u(h[V]);if(h[ah]!=null)l[ah]=H(h[ah]);if(h[x]!=null)l[x]=H(h[x]);if(h[P]!=null)l[P]=H(h[P]);return l},t=(h,w)=>{const l={};if(h[O]!=null)l[O]=H(h[O]);if(h[rh]!=null)l[rh]=H(h[rh]);if(h[Ch]!=null)l[Ch]=H(h[Ch]);if(h[Vh]!=null)l[Vh]=R0(j0(h[Vh]));return l},bw=(h,w)=>{const l={};if(h[$h]!=null)l[$h]=H(h[$h]);return l},fw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},Cw=(h,w)=>{const l={};if(h[zh]!=null)l[zh]=H(h[zh]);if(h[N]!=null)l[N]=H(h[N]);return l},Ow=(h,w)=>{const l={};if(h[g]!=null)l[g]=H(h[g]);return l},gw=(h,w)=>{const l={};if(h[gh]!=null)l[gh]=H(h[gh]);if(h[g]!=null)l[g]=H(h[g]);if(h[N]!=null)l[N]=H(h[N]);return l},xw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[qh]!=null)l[qh]=Cw(h[qh],w);if(h[V]!=null)l[V]=u(h[V]);return l},iw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);return l},cw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},ew=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},pw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},nw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},ow=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},uw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},tw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},k=(h)=>({httpStatusCode:h.statusCode,requestId:h.headers["x-amzn-requestid"]??h.headers["x-amzn-request-id"]??h.headers["x-amz-request-id"],extendedRequestId:h.headers["x-amz-id-2"],cfId:h.headers["x-amz-cf-id"]});var hG=a0(Y),R=async(h,w,l,G,d)=>{const{hostname:S,protocol:I="https",port:Q,path:z}=await h.endpoint(),v={protocol:I,hostname:S,port:Q,method:"POST",path:z.endsWith("/")?z.slice(0,-1)+l:z+l,headers:w};if(G!==void 0)v.hostname=G;if(d!==void 0)v.body=d;return new L0(v)},j={"content-type":"application/x-www-form-urlencoded"},a="2011-06-15",s="Action",O="AccessKeyId",lG="AssumeRole",Yh="AssumedRoleId",M="AssumedRoleUser",wG="AssumeRoleWithSAML",GG="AssumeRoleWithWebIdentity",g="Account",N="Arn",x="Audience",U="Credentials",Zh="ContextAssertion",dG="DecodeAuthorizationMessage",$h="DecodedMessage",y="DurationSeconds",Vh="Expiration",Ph="ExternalId",vh="EncodedMessage",qh="FederatedUser",zh="FederatedUserId",IG="GetAccessKeyInfo",SG="GetCallerIdentity",HG="GetFederationToken",mG="GetSessionToken",Mh="Issuer",Nh="Key",Wh="Name",Th="NameQualifier",Z="Policy",$="PolicyArns",Ah="PrincipalArn",Lh="ProviderArn",Rh="ProvidedContexts",jh="ProviderId",V="PackedPolicySize",ah="Provider",W="RoleArn",i="RoleSessionName",sh="Subject",rh="SecretAccessKey",_h="SAMLAssertion",bh="SubjectFromWebIdentityToken",P="SourceIdentity",c="SerialNumber",fh="SubjectType",Ch="SessionToken",e="Tags",p="TokenCode",Oh="TransitiveTagKeys",gh="UserId",r="Version",xh="Value",ih="WebIdentityToken",ch="arn",m="message",_=(h)=>Object.entries(h).map(([w,l])=>eh(w)+"="+eh(l)).join("&"),JG=(h,w)=>{if(w.Error?.Code!==void 0)return w.Error.Code;if(h.statusCode==404)return"NotFound"};class hh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,q0).ser(s0).de(x0).build(){}class nh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(z0,M0).ser(r0).de(i0).build(){}class lh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(N0,W0).ser(_0).de(c0).build(){}class oh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(b0).de(e0).build(){}class uh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(f0).de(p0).build(){}class th extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(C0).de(n0).build(){}class hl extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,T0).ser(O0).de(o0).build(){}class ll extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,A0).ser(g0).de(u0).build(){}var DG={AssumeRoleCommand:hh,AssumeRoleWithSAMLCommand:nh,AssumeRoleWithWebIdentityCommand:lh,DecodeAuthorizationMessageCommand:oh,GetAccessKeyInfoCommand:uh,GetCallerIdentityCommand:th,GetFederationTokenCommand:hl,GetSessionTokenCommand:ll};class lw extends A{}hw(DG,lw);var ww="us-east-1",Gw=(h)=>{if(typeof h?.Arn==="string"){const w=h.Arn.split(":");if(w.length>4&&w[4]!=="")return w[4]}return},dw=async(h,w,l)=>{const G=typeof h==="function"?await h():h,d=typeof w==="function"?await w():w;return l?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${G} (provider)`,`${d} (parent client)`,`${ww} (STS default)`),G??d??ww},Iw=(h,w)=>{let l,G;return async(d,S)=>{if(G=d,!l){const{logger:v=h?.parentClientConfig?.logger,region:n,requestHandler:wh=h?.parentClientConfig?.requestHandler,credentialProviderLogger:Uh}=h,Jw=await dw(n,h?.parentClientConfig?.region,Uh),Dw=!Hw(wh);l=new w({credentialDefaultProvider:()=>async()=>G,region:Jw,requestHandler:Dw?wh:void 0,logger:v})}const{Credentials:I,AssumedRoleUser:Q}=await l.send(new hh(S));if(!I||!I.AccessKeyId||!I.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${S.RoleArn}`);const z=Gw(Q);return{accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,sessionToken:I.SessionToken,expiration:I.Expiration,...I.CredentialScope&&{credentialScope:I.CredentialScope},...z&&{accountId:z}}}},Sw=(h,w)=>{let l;return async(G)=>{if(!l){const{logger:Q=h?.parentClientConfig?.logger,region:z,requestHandler:v=h?.parentClientConfig?.requestHandler,credentialProviderLogger:n}=h,wh=await dw(z,h?.parentClientConfig?.region,n),Uh=!Hw(v);l=new w({region:wh,requestHandler:Uh?v:void 0,logger:Q})}const{Credentials:d,AssumedRoleUser:S}=await l.send(new lh(G));if(!d||!d.AccessKeyId||!d.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${G.RoleArn}`);const I=Gw(S);return{accessKeyId:d.AccessKeyId,secretAccessKey:d.SecretAccessKey,sessionToken:d.SessionToken,expiration:d.Expiration,...d.CredentialScope&&{credentialScope:d.CredentialScope},...I&&{accountId:I}}}};var Hw=(h)=>{return h?.metadata?.handlerProtocol==="h2"};var mw=(h,w)=>{if(!w)return h;else return class l extends h{constructor(G){super(G);for(let d of w)this.middlewareStack.use(d)}}},EG=(h={},w)=>Iw(h,mw(A,w)),kG=(h={},w)=>Sw(h,mw(A,w)),sI=(h)=>(w)=>h({roleAssumer:EG(w),roleAssumerWithWebIdentity:kG(w),...w});export{kG as getDefaultRoleAssumerWithWebIdentity,EG as getDefaultRoleAssumer,sI as decorateDefaultCredentialProvider,y0 as __Client,Y as STSServiceException,A as STSClient,lw as STS,Dh as RegionDisabledException,Jh as PackedPolicyTooLargeException,mh as MalformedPolicyDocumentException,kh as InvalidIdentityTokenException,Fh as InvalidAuthorizationMessageException,Eh as IDPRejectedClaimException,Kh as IDPCommunicationErrorException,A0 as GetSessionTokenResponseFilterSensitiveLog,ll as GetSessionTokenCommand,T0 as GetFederationTokenResponseFilterSensitiveLog,hl as GetFederationTokenCommand,th as GetCallerIdentityCommand,uh as GetAccessKeyInfoCommand,Hh as ExpiredTokenException,oh as DecodeAuthorizationMessageCommand,o as CredentialsFilterSensitiveLog,W0 as AssumeRoleWithWebIdentityResponseFilterSensitiveLog,N0 as AssumeRoleWithWebIdentityRequestFilterSensitiveLog,lh as AssumeRoleWithWebIdentityCommand,M0 as AssumeRoleWithSAMLResponseFilterSensitiveLog,z0 as AssumeRoleWithSAMLRequestFilterSensitiveLog,nh as AssumeRoleWithSAMLCommand,q0 as AssumeRoleResponseFilterSensitiveLog,hh as AssumeRoleCommand,K as $Command};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as i} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-28694e5e949df0ff.js";import{$ as g,O as U,P as _,Q as Le,R as Me,S as We,T as Ae,W as B,X as Qe,Y as V,Z as N,_ as f,aa as Xe,ba as he,ca as ue,da as we,ea as be,fa as Ye,ga as Ze,ia as as,ja as ns,ka as je,la as xe,ma as ve,na as Te,oa as ke,pa as He,qa as x,ra as Re,sa as Ee,ta as qe,ua as Se,va as Je,wa as Ie} from"./chunk-75aa5e5e2f565737.js";import{Ab as y,Cb as ge,Ga as se,Ia as te,Ja as re,Ka as Ke,La as ae,Ma as ne,Pa as le,Qa as pe,cb as rs,db as k,ib as z,jb as Ne,kb as h,rb as Oe,sb as u,tb as fe,ub as ye,vb as me,wb as $e,xa as Ue,xb as Pe,ya as _e,zb as c} from"./chunk-a4330a47c3806ff1.js";import"./chunk-79f9130d266efc8b.js";import{Gb as l,Hb as de} from"./chunk-36d595d02662f2fa.js";import"./chunk-92b7f08b6396b0fc.js";import"./chunk-bd0308763754bf7b.js";var p=i(B(),1);var $=i(x(),1);var is=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}},b=function(e){return{schemeId:"smithy.api#noAuth"}},P=async(e,s,t)=>{return{operation:U(s).operation,region:await _(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},J=(e)=>{const s=[];switch(e.operation){case"GetRoleCredentials":{s.push(b(e));break}case"ListAccountRoles":{s.push(b(e));break}case"ListAccounts":{s.push(b(e));break}case"Logout":{s.push(b(e));break}default:s.push(is(e))}return s},I=(e)=>{return{...$.resolveAwsSdkSigV4Config(e)}};var C=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},L={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var M={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-node":"^3.0.6","@smithy/invalid-dependency":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var ze=i(x(),1);var oe=i(x(),1),ce=i(B(),1);var W={["required"]:!1,type:"String"},A={["required"]:!0,default:!1,type:"Boolean"},K={["ref"]:"Endpoint"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},H={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},Q={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},O={["ref"]:"PartitionResult"},X={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[O,"supportsDualStack"]}]},Y=[T],Z=[H],j=[{["ref"]:"Region"}],ps={version:"1.0",parameters:{Region:W,UseDualStack:A,UseFIPS:A,Endpoint:W},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[K]}],rules:[{conditions:Y,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:K,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:j}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:j,assign:"PartitionResult"}],rules:[{conditions:[T,H],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Q]},X],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Y,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Q,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[O,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:d,headers:d},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:Z,rules:[{conditions:[X],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},G=ps;var ys=new V({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),ee=(e,s={})=>{return ys.get(e,()=>f(G,{endpointParams:e,logger:s.logger}))};N.aws=g;var ie=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ae,base64Encoder:e?.base64Encoder??ne,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??ee,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??J,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new oe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ce.NoAuthSigner}],logger:e?.logger??new re,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??de,utf8Decoder:e?.utf8Decoder??se,utf8Encoder:e?.utf8Encoder??te}};var De=(e)=>{me(process.version);const s=Se(e),t=()=>s().then(ye),r=ie(e);return ze.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??qe,defaultUserAgentProvider:e?.defaultUserAgentProvider??Re({serviceId:r.serviceId,clientVersion:M.version}),maxAttempts:e?.maxAttempts??l(ve),region:e?.region??l(we,be),requestHandler:le.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...ke,default:async()=>(await t()).retryMode||xe}),sha256:e?.sha256??Ee.bind(null,"sha256"),streamCollector:e?.streamCollector??pe,useDualstackEndpoint:e?.useDualstackEndpoint??l(he),useFipsEndpoint:e?.useFipsEndpoint??l(ue)}};var Be=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((D)=>D.schemeId===a.schemeId);if(n===-1)s.push(a);else s.splice(n,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){t=a},httpAuthSchemeProvider(){return t},setCredentials(a){r=a},credentials(){return r}}},Fe=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var v=(e)=>e,Ce=(e,s)=>{const t={...v(Je(e)),...v($e(e)),...v(Ue(e)),...v(Be(e))};return s.forEach((r)=>r.configure(t)),{...e,...Ie(t),...Pe(t),..._e(t),...Fe(t)}};class ms extends Ke{constructor(...[e]){const s=De(e||{}),t=C(s),r=Qe(t),a=Te(r),n=Ye(a),D=Le(n),ds=je(D),os=I(ds),F=Ce(os,e?.extensions||[]);super(F);this.config=F,this.middlewareStack.use(Xe(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(Ze(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:P,identityProviderConfigProvider:async(cs)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":cs.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class o extends Oe{constructor(e){super(e);Object.setPrototypeOf(this,o.prototype)}}class R extends o{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,R.prototype)}}class E extends o{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class q extends o{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class S extends o{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}var Ge=(e)=>({...e,...e.accessToken&&{accessToken:k}}),hs=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:k},...e.sessionToken&&{sessionToken:k}}),Ve=(e)=>({...e,...e.roleCredentials&&{roleCredentials:hs(e.roleCredentials)}});var m=i(x(),1),es=i(B(),1);var ss=async(e,s)=>{const t=es.requestBuilder(e,s),r=c({},Rs,{[Bs]:e[qs]});t.bp("/federation/credentials");const a=c({[Ds]:[,z(e[zs],"roleName")],[Ss]:[,z(e[Es],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var ts=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return us(e,s);const t=c({$metadata:w(e)}),r=z(Ne(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:ge});return Object.assign(t,a),t};var us=async(e,s)=>{const t={...e,body:await m.parseJsonErrorBody(e.body,s)},r=m.loadRestJsonErrorCode(e,t.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await bs(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await xs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await vs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await ks(t,s);default:const a=t.body;return ws({output:e,parsedBody:a,errorCode:r})}},ws=fe(o),bs=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new R({$metadata:w(e),...t});return u(n,e.body)},xs=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new E({$metadata:w(e),...t});return u(n,e.body)},vs=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new q({$metadata:w(e),...t});return u(n,e.body)},ks=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new S({$metadata:w(e),...t});return u(n,e.body)},w=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var Rs=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Es="accountId",qs="accessToken",Ss="account_id";var zs="roleName",Ds="role_name",Bs="x-amz-sso_bearer_token";class Fs extends rs.classBuilder().ep(L).m(function(e,s,t,r){return[as(t,this.serialize,this.deserialize),ns(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(Ge,Ve).ser(ss).de(ts).build(){}export{ms as SSOClient,Fs as GetRoleCredentialsCommand};