gemi 0.4.33 → 0.4.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-073f5b81e98d91fe.js +3 -0
- package/dist/chunk-0a6614fbd65524af.js +2 -0
- package/dist/chunk-100b76ab0ca3e14d.js +1 -0
- package/dist/chunk-1109657ed53fbdc9.js +2 -0
- package/dist/chunk-12ca7224eb6ccf72.js +9 -0
- package/dist/chunk-16a63b2fee0ce9e2.js +2 -0
- package/dist/chunk-328c98321c6ba3d6.js +2 -0
- package/dist/chunk-35ab4be8ca6c67ee.js +2 -0
- package/dist/chunk-370389a68668658a.js +2 -0
- package/dist/chunk-3728fa21e6931333.js +2 -0
- package/dist/chunk-382a513747a9aa52.js +6 -0
- package/dist/chunk-3bd48fb5397a155b.js +5 -0
- package/dist/chunk-51c21d2a3c45fbe1.js +2 -0
- package/dist/chunk-57a61e580c4adf80.js +2 -0
- package/dist/chunk-5a9fa677066f72ac.js +2 -0
- package/dist/chunk-5b836c769c5dad2a.js +2 -0
- package/dist/chunk-5cd0a98345a5d57a.js +2 -0
- package/dist/chunk-6766e66417809e1a.js +2 -0
- package/dist/chunk-70bb003c03f21dad.js +2 -0
- package/dist/chunk-77d5bbc7a9117c21.js +2 -0
- package/dist/chunk-7c62e9d6edc4b418.js +2 -0
- package/dist/chunk-8295e42bcfc910ff.js +16 -0
- package/dist/chunk-8c3e0f5d4a0d6e53.js +2 -0
- package/dist/chunk-8f24cd33e07d02f3.js +2 -0
- package/dist/chunk-9ee2118bd4eb34ae.js +9 -0
- package/dist/chunk-a3526e321ac9d173.js +1 -0
- package/dist/chunk-a57ecc74c0fb9045.js +2 -0
- package/dist/chunk-bcd70a6fc2fd359c.js +1 -0
- package/dist/chunk-c675395110f371b1.js +6 -0
- package/dist/chunk-c8b00b645df96ed5.js +2 -0
- package/dist/chunk-cfa9a65fae5ddaf4.js +2 -0
- package/dist/chunk-d3765f96a689a0c1.js +2 -0
- package/dist/chunk-e0e0f2ee626a6fb3.js +18 -0
- package/dist/chunk-e16b252158474b8c.js +1 -0
- package/dist/client/index.js +1 -1
- package/dist/storage/index.js +1 -10
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{x as F,y as $} from"./chunk-a5c18c07abe8fd9c.js";import{ob as V} from"./chunk-5a9fa677066f72ac.js";var ot=$((zs,Dt)=>{var{defineProperty:W,getOwnPropertyDescriptor:$r,getOwnPropertyNames:Er}=Object,Sr=Object.prototype.hasOwnProperty,C=(t,n)=>W(t,"name",{value:n,configurable:!0}),Ir=(t,n)=>{for(var r in n)W(t,r,{get:n[r],enumerable:!0})},Ur=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of Er(n))if(!Sr.call(t,s)&&s!==r)W(t,s,{get:()=>n[s],enumerable:!(e=$r(n,s))||e.enumerable})}return t},Ar=(t)=>Ur(W({},"__esModule",{value:!0}),t),Lt={};Ir(Lt,{constructStack:()=>st});Dt.exports=Ar(Lt);var L=C((t,n)=>{const r=[];if(t)r.push(t);if(n)for(let e of n)r.push(e);return r},"getAllAliases"),A=C((t,n)=>{return`${t||"anonymous"}${n&&n.length>0?` (a.k.a. ${n.join(",")})`:""}`},"getMiddlewareNameWithAliases"),st=C(()=>{let t=[],n=[],r=!1;const e=new Set,s=C((h)=>h.sort((g,u)=>Ft[u.step]-Ft[g.step]||Nt[u.priority||"normal"]-Nt[g.priority||"normal"]),"sort"),o=C((h)=>{let g=!1;const u=C((T)=>{const x=L(T.name,T.aliases);if(x.includes(h)){g=!0;for(let w of x)e.delete(w);return!1}return!0},"filterCb");return t=t.filter(u),n=n.filter(u),g},"removeByName"),c=C((h)=>{let g=!1;const u=C((T)=>{if(T.middleware===h){g=!0;for(let x of L(T.name,T.aliases))e.delete(x);return!1}return!0},"filterCb");return t=t.filter(u),n=n.filter(u),g},"removeByReference"),i=C((h)=>{var g;return t.forEach((u)=>{h.add(u.middleware,{...u})}),n.forEach((u)=>{h.addRelativeTo(u.middleware,{...u})}),(g=h.identifyOnResolve)==null||g.call(h,l.identifyOnResolve()),h},"cloneTo"),d=C((h)=>{const g=[];return h.before.forEach((u)=>{if(u.before.length===0&&u.after.length===0)g.push(u);else g.push(...d(u))}),g.push(h),h.after.reverse().forEach((u)=>{if(u.before.length===0&&u.after.length===0)g.push(u);else g.push(...d(u))}),g},"expandRelativeMiddlewareList"),y=C((h=!1)=>{const g=[],u=[],T={};return t.forEach((w)=>{const f={...w,before:[],after:[]};for(let p of L(f.name,f.aliases))T[p]=f;g.push(f)}),n.forEach((w)=>{const f={...w,before:[],after:[]};for(let p of L(f.name,f.aliases))T[p]=f;u.push(f)}),u.forEach((w)=>{if(w.toMiddleware){const f=T[w.toMiddleware];if(f===void 0){if(h)return;throw new Error(`${w.toMiddleware} is not found when adding ${A(w.name,w.aliases)} middleware ${w.relation} ${w.toMiddleware}`)}if(w.relation==="after")f.after.push(w);if(w.relation==="before")f.before.push(w)}}),s(g).map(d).reduce((w,f)=>{return w.push(...f),w},[])},"getMiddlewareList"),l={add:(h,g={})=>{const{name:u,override:T,aliases:x}=g,w={step:"initialize",priority:"normal",middleware:h,...g},f=L(u,x);if(f.length>0){if(f.some((p)=>e.has(p))){if(!T)throw new Error(`Duplicate middleware name '${A(u,x)}'`);for(let p of f){const a=t.findIndex((E)=>{var Y;return E.name===p||((Y=E.aliases)==null?void 0:Y.some((et)=>et===p))});if(a===-1)continue;const b=t[a];if(b.step!==w.step||w.priority!==b.priority)throw new Error(`"${A(b.name,b.aliases)}" middleware with ${b.priority} priority in ${b.step} step cannot be overridden by "${A(u,x)}" middleware with ${w.priority} priority in ${w.step} step.`);t.splice(a,1)}}for(let p of f)e.add(p)}t.push(w)},addRelativeTo:(h,g)=>{const{name:u,override:T,aliases:x}=g,w={middleware:h,...g},f=L(u,x);if(f.length>0){if(f.some((p)=>e.has(p))){if(!T)throw new Error(`Duplicate middleware name '${A(u,x)}'`);for(let p of f){const a=n.findIndex((E)=>{var Y;return E.name===p||((Y=E.aliases)==null?void 0:Y.some((et)=>et===p))});if(a===-1)continue;const b=n[a];if(b.toMiddleware!==w.toMiddleware||b.relation!==w.relation)throw new Error(`"${A(b.name,b.aliases)}" middleware ${b.relation} "${b.toMiddleware}" middleware cannot be overridden by "${A(u,x)}" middleware ${w.relation} "${w.toMiddleware}" middleware.`);n.splice(a,1)}}for(let p of f)e.add(p)}n.push(w)},clone:()=>i(st()),use:(h)=>{h.applyToStack(l)},remove:(h)=>{if(typeof h==="string")return o(h);else return c(h)},removeByTag:(h)=>{let g=!1;const u=C((T)=>{const{tags:x,name:w,aliases:f}=T;if(x&&x.includes(h)){const p=L(w,f);for(let a of p)e.delete(a);return g=!0,!1}return!0},"filterCb");return t=t.filter(u),n=n.filter(u),g},concat:(h)=>{var g;const u=i(st());return u.use(h),u.identifyOnResolve(r||u.identifyOnResolve()||(((g=h.identifyOnResolve)==null?void 0:g.call(h))??!1)),u},applyToStack:i,identify:()=>{return y(!0).map((h)=>{const g=h.step??h.relation+" "+h.toMiddleware;return A(h.name,h.aliases)+" - "+g})},identifyOnResolve(h){if(typeof h==="boolean")r=h;return r},resolve:(h,g)=>{for(let u of y().map((T)=>T.middleware).reverse())h=u(h,g);if(r)console.log(l.identify());return h}};return l},"constructStack"),Ft={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Nt={high:3,normal:2,low:1}});var ft=$((co,Wt)=>{var{defineProperty:G,getOwnPropertyDescriptor:Dr,getOwnPropertyNames:mr}=Object,Br=Object.prototype.hasOwnProperty,ct=(t,n)=>G(t,"name",{value:n,configurable:!0}),Mr=(t,n)=>{for(var r in n)G(t,r,{get:n[r],enumerable:!0})},jr=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of mr(n))if(!Br.call(t,s)&&s!==r)G(t,s,{get:()=>n[s],enumerable:!(e=Dr(n,s))||e.enumerable})}return t},Yr=(t)=>jr(G({},"__esModule",{value:!0}),t),Rt={};Mr(Rt,{escapeUri:()=>zt,escapeUriPath:()=>zr});Wt.exports=Yr(Rt);var zt=ct((t)=>encodeURIComponent(t).replace(/[!'()*]/g,Rr),"escapeUri"),Rr=ct((t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),zr=ct((t)=>t.split("/").map(zt).join("/"),"escapeUriPath")});var un=$((Di,hn)=>{var on=function(t){return Object.keys(t).reduce((n,r)=>{const e=t[r];return{...n,[r]:Array.isArray(e)?[...e]:e}},{})},fn=function(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)},J=Object.defineProperty,Pr=Object.getOwnPropertyDescriptor,Or=Object.getOwnPropertyNames,qr=Object.prototype.hasOwnProperty,N=(t,n)=>J(t,"name",{value:n,configurable:!0}),vr=(t,n)=>{for(var r in n)J(t,r,{get:n[r],enumerable:!0})},_r=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of Or(n))if(!qr.call(t,s)&&s!==r)J(t,s,{get:()=>n[s],enumerable:!(e=Pr(n,s))||e.enumerable})}return t},te=(t)=>_r(J({},"__esModule",{value:!0}),t),tn={};vr(tn,{Field:()=>ee,Fields:()=>se,HttpRequest:()=>oe,HttpResponse:()=>ie,IHttpRequest:()=>nn.HttpRequest,getHttpHandlerExtensionConfiguration:()=>ne,isValidHostname:()=>fn,resolveHttpHandlerRuntimeConfig:()=>re});hn.exports=te(tn);var ne=N((t)=>{let n=t.httpHandler;return{setHttpHandler(r){n=r},httpHandler(){return n},updateHttpClientConfig(r,e){n.updateHttpClientConfig(r,e)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),re=N((t)=>{return{httpHandler:t.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),nn=V(),rn=class t{constructor({name:n,kind:r=nn.FieldPosition.HEADER,values:e=[]}){this.name=n,this.kind=r,this.values=e}add(n){this.values.push(n)}set(n){this.values=n}remove(n){this.values=this.values.filter((r)=>r!==n)}toString(){return this.values.map((n)=>n.includes(",")||n.includes(" ")?`"${n}"`:n).join(", ")}get(){return this.values}};N(rn,"Field");var ee=rn,en=class t{constructor({fields:n=[],encoding:r="utf-8"}){this.entries={},n.forEach(this.setField.bind(this)),this.encoding=r}setField(n){this.entries[n.name.toLowerCase()]=n}getField(n){return this.entries[n.toLowerCase()]}removeField(n){delete this.entries[n.toLowerCase()]}getByType(n){return Object.values(this.entries).filter((r)=>r.kind===n)}};N(en,"Fields");var se=en,sn=class t{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){const r=new t({...n,headers:{...n.headers}});if(r.query)r.query=on(r.query);return r}static isInstance(n){if(!n)return!1;const r=n;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)}};N(sn,"HttpRequest");var oe=sn;N(on,"cloneQuery");var cn=class t{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;const r=n;return typeof r.statusCode==="number"&&typeof r.headers==="object"}};N(cn,"HttpResponse");var ie=cn;N(fn,"isValidHostname")});var wn=$((mi,yn)=>{var gn=function(t){const n=[];for(let r of Object.keys(t).sort()){const e=t[r];if(r=pt.escapeUri(r),Array.isArray(e))for(let s=0,o=e.length;s<o;s++)n.push(`${r}=${pt.escapeUri(e[s])}`);else{let s=r;if(e||typeof e==="string")s+=`=${pt.escapeUri(e)}`;n.push(s)}}return n.join("&")},k=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyNames,he=Object.prototype.hasOwnProperty,ue=(t,n)=>k(t,"name",{value:n,configurable:!0}),de=(t,n)=>{for(var r in n)k(t,r,{get:n[r],enumerable:!0})},ge=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of fe(n))if(!he.call(t,s)&&s!==r)k(t,s,{get:()=>n[s],enumerable:!(e=ce(n,s))||e.enumerable})}return t},ye=(t)=>ge(k({},"__esModule",{value:!0}),t),dn={};de(dn,{buildQueryString:()=>gn});yn.exports=ye(dn);var pt=ft();ue(gn,"buildQueryString")});var Tn=$((Bi,xn)=>{var{defineProperty:P,getOwnPropertyDescriptor:we,getOwnPropertyNames:pe}=Object,xe=Object.prototype.hasOwnProperty,Te=(t,n)=>P(t,"name",{value:n,configurable:!0}),le=(t,n)=>{for(var r in n)P(t,r,{get:n[r],enumerable:!0})},be=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of pe(n))if(!xe.call(t,s)&&s!==r)P(t,s,{get:()=>n[s],enumerable:!(e=we(n,s))||e.enumerable})}return t},ae=(t)=>be(P({},"__esModule",{value:!0}),t),pn={};le(pn,{isArrayBuffer:()=>Ce});xn.exports=ae(pn);var Ce=Te((t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var q=$((Mi,an)=>{var{defineProperty:O,getOwnPropertyDescriptor:$e,getOwnPropertyNames:Ee}=Object,Se=Object.prototype.hasOwnProperty,ln=(t,n)=>O(t,"name",{value:n,configurable:!0}),Ie=(t,n)=>{for(var r in n)O(t,r,{get:n[r],enumerable:!0})},Ue=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of Ee(n))if(!Se.call(t,s)&&s!==r)O(t,s,{get:()=>n[s],enumerable:!(e=$e(n,s))||e.enumerable})}return t},Ae=(t)=>Ue(O({},"__esModule",{value:!0}),t),bn={};Ie(bn,{fromArrayBuffer:()=>Ne,fromString:()=>Le});an.exports=Ae(bn);var Fe=Tn(),xt=import.meta.require("buffer"),Ne=ln((t,n=0,r=t.byteLength-n)=>{if(!Fe.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return xt.Buffer.from(t,n,r)},"fromArrayBuffer"),Le=ln((t,n)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return n?xt.Buffer.from(t,n):xt.Buffer.from(t)},"fromString")});var En=$((Cn)=>{Object.defineProperty(Cn,"__esModule",{value:!0});Cn.fromBase64=void 0;var De=q(),me=/^[A-Za-z0-9+/]*={0,2}$/,Be=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!me.exec(t))throw new TypeError("Invalid base64 string.");const n=De.fromString(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)};Cn.fromBase64=Be});var Fn=$((Yi,An)=>{var{defineProperty:v,getOwnPropertyDescriptor:Me,getOwnPropertyNames:je}=Object,Ye=Object.prototype.hasOwnProperty,Tt=(t,n)=>v(t,"name",{value:n,configurable:!0}),Re=(t,n)=>{for(var r in n)v(t,r,{get:n[r],enumerable:!0})},ze=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of je(n))if(!Ye.call(t,s)&&s!==r)v(t,s,{get:()=>n[s],enumerable:!(e=Me(n,s))||e.enumerable})}return t},We=(t)=>ze(v({},"__esModule",{value:!0}),t),Sn={};Re(Sn,{fromUtf8:()=>Un,toUint8Array:()=>Ve,toUtf8:()=>Ze});An.exports=We(Sn);var In=q(),Un=Tt((t)=>{const n=In.fromString(t,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Ve=Tt((t)=>{if(typeof t==="string")return Un(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)},"toUint8Array"),Ze=Tt((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 In.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var Dn=$((Nn)=>{Object.defineProperty(Nn,"__esModule",{value:!0});Nn.toBase64=void 0;var Ge=q(),He=Fn(),Qe=(t)=>{let n;if(typeof t==="string")n=He.fromUtf8(t);else n=t;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return Ge.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("base64")};Nn.toBase64=Qe});var Mn=$((zi,_)=>{var{defineProperty:mn,getOwnPropertyDescriptor:Ke,getOwnPropertyNames:Xe}=Object,Je=Object.prototype.hasOwnProperty,lt=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of Xe(n))if(!Je.call(t,s)&&s!==r)mn(t,s,{get:()=>n[s],enumerable:!(e=Ke(n,s))||e.enumerable})}return t},Bn=(t,n,r)=>(lt(t,n,"default"),r&<(r,n,"default")),ke=(t)=>lt(mn({},"__esModule",{value:!0}),t),bt={};_.exports=ke(bt);Bn(bt,En(),_.exports);Bn(bt,Dn(),_.exports)});var Hn=$((Wi,Gn)=>{var Rn=function(t=0){return new Promise((n,r)=>{if(t)setTimeout(()=>{const e=new Error(`Request did not complete within ${t} ms`);e.name="TimeoutError",r(e)},t)})};async function Wn(t){const n=await Zn(t),r=es.fromBase64(n);return new Uint8Array(r)}async function Vn(t){const n=[],r=t.getReader();let e=!1,s=0;while(!e){const{done:i,value:d}=await r.read();if(d)n.push(d),s+=d.length;e=i}const o=new Uint8Array(s);let c=0;for(let i of n)o.set(i,c),c+=i.length;return o}var Zn=function(t){return new Promise((n,r)=>{const e=new FileReader;e.onloadend=()=>{if(e.readyState!==2)return r(new Error("Reader aborted too early"));const s=e.result??"",o=s.indexOf(","),c=o>-1?o+1:s.length;n(s.substring(c))},e.onabort=()=>r(new Error("Read aborted")),e.onerror=()=>r(e.error),e.readAsDataURL(t)})},nt=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Oe=Object.getOwnPropertyNames,qe=Object.prototype.hasOwnProperty,U=(t,n)=>nt(t,"name",{value:n,configurable:!0}),ve=(t,n)=>{for(var r in n)nt(t,r,{get:n[r],enumerable:!0})},_e=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of Oe(n))if(!qe.call(t,s)&&s!==r)nt(t,s,{get:()=>n[s],enumerable:!(e=Pe(n,s))||e.enumerable})}return t},ts=(t)=>_e(nt({},"__esModule",{value:!0}),t),Yn={};ve(Yn,{FetchHttpHandler:()=>rs,keepAliveSupport:()=>tt,streamCollector:()=>ss});Gn.exports=ts(Yn);var jn=un(),ns=wn();U(Rn,"requestTimeout");var tt={supported:void 0},zn=class t{static create(n){if(typeof(n==null?void 0:n.handle)==="function")return n;return new t(n)}constructor(n){if(typeof n==="function")this.configProvider=n().then((r)=>r||{});else this.config=n??{},this.configProvider=Promise.resolve(this.config);if(tt.supported===void 0)tt.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(n,{abortSignal:r}={}){if(!this.config)this.config=await this.configProvider;const e=this.config.requestTimeout,s=this.config.keepAlive===!0,o=this.config.credentials;if(r==null?void 0:r.aborted){const f=new Error("Request aborted");return f.name="AbortError",Promise.reject(f)}let c=n.path;const i=ns.buildQueryString(n.query||{});if(i)c+=`?${i}`;if(n.fragment)c+=`#${n.fragment}`;let d="";if(n.username!=null||n.password!=null){const f=n.username??"",p=n.password??"";d=`${f}:${p}@`}const{port:y,method:l}=n,h=`${n.protocol}//${d}${n.hostname}${y?`:${y}`:""}${c}`,g=l==="GET"||l==="HEAD"?void 0:n.body,u={body:g,headers:new Headers(n.headers),method:l,credentials:o};if(g)u.duplex="half";if(typeof AbortController!=="undefined")u.signal=r;if(tt.supported)u.keepalive=s;let T=U(()=>{},"removeSignalEventListener");const x=new Request(h,u),w=[fetch(x).then((f)=>{const p=f.headers,a={};for(let E of p.entries())a[E[0]]=E[1];if(f.body==null)return f.blob().then((E)=>({response:new jn.HttpResponse({headers:a,reason:f.statusText,statusCode:f.status,body:E})}));return{response:new jn.HttpResponse({headers:a,reason:f.statusText,statusCode:f.status,body:f.body})}}),Rn(e)];if(r)w.push(new Promise((f,p)=>{const a=U(()=>{const b=new Error("Request aborted");b.name="AbortError",p(b)},"onAbort");if(typeof r.addEventListener==="function"){const b=r;b.addEventListener("abort",a,{once:!0}),T=U(()=>b.removeEventListener("abort",a),"removeSignalEventListener")}else r.onabort=a}));return Promise.race(w).finally(T)}updateHttpClientConfig(n,r){this.config=void 0,this.configProvider=this.configProvider.then((e)=>{return e[n]=r,e})}httpHandlerConfigs(){return this.config??{}}};U(zn,"FetchHttpHandler");var rs=zn,es=Mn(),ss=U((t)=>{if(typeof Blob==="function"&&t instanceof Blob)return Wn(t);return Vn(t)},"streamCollector");U(Wn,"collectBlob");U(Vn,"collectStream");U(Zn,"readToBase64")});var On=$((Vi,Pn)=>{var Jn=function(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2){const e=t.slice(r,r+2).toLowerCase();if(e in at)n[r/2]=at[e];else throw new Error(`Cannot decode unrecognized sequence ${e} as hexadecimal`)}return n},kn=function(t){let n="";for(let r=0;r<t.byteLength;r++)n+=Xn[t[r]];return n},rt=Object.defineProperty,os=Object.getOwnPropertyDescriptor,is=Object.getOwnPropertyNames,cs=Object.prototype.hasOwnProperty,Qn=(t,n)=>rt(t,"name",{value:n,configurable:!0}),fs=(t,n)=>{for(var r in n)rt(t,r,{get:n[r],enumerable:!0})},hs=(t,n,r,e)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let s of is(n))if(!cs.call(t,s)&&s!==r)rt(t,s,{get:()=>n[s],enumerable:!(e=os(n,s))||e.enumerable})}return t},us=(t)=>hs(rt({},"__esModule",{value:!0}),t),Kn={};fs(Kn,{fromHex:()=>Jn,toHex:()=>kn});Pn.exports=us(Kn);var Xn={},at={};for(let t=0;t<256;t++){let n=t.toString(16).toLowerCase();if(n.length===1)n=`0${n}`;Xn[t]=n,at[n]=t}Qn(Jn,"fromHex");Qn(kn,"toHex")});var mt=F(ot(),1);class Fr{constructor(t){this.middlewareStack=mt.constructStack(),this.config=t}send(t,n,r){const e=typeof n!=="function"?n:void 0,s=typeof n==="function"?n:r,o=t.resolveMiddleware(this.middlewareStack,this.config,e);if(s)o(t).then((c)=>s(null,c.output),(c)=>s(c)).catch(()=>{});else return o(t).then((c)=>c.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var Bt=F(ot(),1),Mt=F(V(),1);class jt{constructor(){this.middlewareStack=Bt.constructStack()}static classBuilder(){return new Yt}resolveMiddlewareWithContext(t,n,r,{middlewareFn:e,clientName:s,commandName:o,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,smithyContext:d,additionalContext:y,CommandCtor:l}){for(let x of e.bind(this)(l,t,n,r))this.middlewareStack.use(x);const h=t.concat(this.middlewareStack),{logger:g}=n,u={logger:g,clientName:s,commandName:o,inputFilterSensitiveLog:c,outputFilterSensitiveLog:i,[Mt.SMITHY_CONTEXT_KEY]:{commandInstance:this,...d},...y},{requestHandler:T}=n;return h.resolve((x)=>T.handle(x.request,r||{}),u)}}class Yt{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,n,r={}){return this._smithyContext={service:t,operation:n,...r},this}c(t={}){return this._additionalContext=t,this}n(t,n){return this._clientName=t,this._commandName=n,this}f(t=(r)=>r,n=(r)=>r){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=n,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}build(){const t=this;let n;return n=class extends jt{static getEndpointParameterInstructions(){return t._ep}constructor(...[r]){super();this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=r??{},t._init(this)}resolveMiddleware(r,e,s){return this.resolveMiddlewareWithContext(r,e,s,{CommandCtor:n,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}var Gs=(t)=>{let n=t.httpHandler;return{setHttpHandler(r){n=r},httpHandler(){return n},updateHttpClientConfig(r,e){n.updateHttpClientConfig(r,e)},httpHandlerConfigs(){return n.httpHandlerConfigs()}}},Hs=(t)=>{return{httpHandler:t.httpHandler()}};var Nr=F(V(),1);var Lr=function(t){return Object.keys(t).reduce((n,r)=>{const e=t[r];return{...n,[r]:Array.isArray(e)?[...e]:e}},{})};class it{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 n=new it({...t,headers:{...t.headers}});if(n.query)n.query=Lr(n.query);return n}static isInstance(t){if(!t)return!1;const n=t;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query==="object"&&typeof n.headers==="object"}clone(){return it.clone(this)}}class Z{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 n=t;return typeof n.statusCode==="number"&&typeof n.headers==="object"}}var H=F(ft(),1);function ht(t){const n=[];for(let r of Object.keys(t).sort()){const e=t[r];if(r=H.escapeUri(r),Array.isArray(e))for(let s=0,o=e.length;s<o;s++)n.push(`${r}=${H.escapeUri(e[s])}`);else{let s=r;if(e||typeof e==="string")s+=`=${H.escapeUri(e)}`;n.push(s)}}return n.join("&")}import{Agent as Kt,request as Zr} from"http";import{Agent as Xt,request as Gr} from"https";var Vt=["ECONNRESET","EPIPE","ETIMEDOUT"];var ut=(t)=>{const n={};for(let r of Object.keys(t)){const e=t[r];n[r]=Array.isArray(e)?e.join(","):e}return n};var Zt=(t,n,r=0)=>{if(!r)return;const e=setTimeout(()=>{t.destroy(),n(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r);t.on("socket",(s)=>{if(s.connecting)s.on("connect",()=>{clearTimeout(e)});else clearTimeout(e)})};var Gt=(t,{keepAlive:n,keepAliveMsecs:r})=>{if(n!==!0)return;t.on("socket",(e)=>{e.setKeepAlive(n,r||0)})};var Ht=(t,n,r=0)=>{t.setTimeout(r,()=>{t.destroy(),n(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))})};import{Readable as Wr} from"stream";async function dt(t,n,r=Qt){const e=n.headers??{},s=e.Expect||e.expect;let o=-1,c=!1;if(s==="100-continue")await Promise.race([new Promise((i)=>{o=Number(setTimeout(i,Math.max(Qt,r)))}),new Promise((i)=>{t.on("continue",()=>{clearTimeout(o),i()}),t.on("error",()=>{c=!0,clearTimeout(o),i()})})]);if(!c)Vr(t,n.body)}var Vr=function(t,n){if(n instanceof Wr){n.pipe(t);return}if(n){if(Buffer.isBuffer(n)||typeof n==="string"){t.end(n);return}const r=n;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(n));return}t.end()},Qt=1000;class gt{static create(t){if(typeof t?.handle==="function")return t;return new gt(t)}static checkSocketUsage(t,n,r=console){const{sockets:e,requests:s,maxSockets:o}=t;if(typeof o!=="number"||o===Infinity)return n;const c=15000;if(Date.now()-c<n)return n;if(e&&s)for(let i in e){const d=e[i]?.length??0,y=s[i]?.length??0;if(d>=o&&y>=2*o)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${y} 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 n}constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((n,r)=>{if(typeof t==="function")t().then((e)=>{n(this.resolveDefaultConfig(e))}).catch(r);else n(this.resolveDefaultConfig(t))})}resolveDefaultConfig(t){const{requestTimeout:n,connectionTimeout:r,socketTimeout:e,httpAgent:s,httpsAgent:o}=t||{};return{connectionTimeout:r,requestTimeout:n??e,httpAgent:(()=>{if(s instanceof Kt||typeof s?.destroy==="function")return s;return new Kt({keepAlive:!0,maxSockets:50,...s})})(),httpsAgent:(()=>{if(o instanceof Xt||typeof o?.destroy==="function")return o;return new Xt({keepAlive:!0,maxSockets:50,...o})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:n}={}){if(!this.config)this.config=await this.configProvider;let r;return new Promise((e,s)=>{let o=void 0;const c=async(f)=>{await o,clearTimeout(r),e(f)},i=async(f)=>{await o,clearTimeout(r),s(f)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(n?.aborted){const f=new Error("Request aborted");f.name="AbortError",i(f);return}const d=t.protocol==="https:",y=d?this.config.httpsAgent:this.config.httpAgent;r=setTimeout(()=>{this.socketWarningTimestamp=gt.checkSocketUsage(y,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const l=ht(t.query||{});let h=void 0;if(t.username!=null||t.password!=null){const f=t.username??"",p=t.password??"";h=`${f}:${p}`}let g=t.path;if(l)g+=`?${l}`;if(t.fragment)g+=`#${t.fragment}`;const u={headers:t.headers,host:t.hostname,method:t.method,path:g,port:t.port,agent:y,auth:h},x=(d?Gr:Zr)(u,(f)=>{const p=new Z({statusCode:f.statusCode||-1,reason:f.statusMessage,headers:ut(f.headers),body:f});c({response:p})});if(x.on("error",(f)=>{if(Vt.includes(f.code))i(Object.assign(f,{name:"TimeoutError"}));else i(f)}),Zt(x,i,this.config.connectionTimeout),Ht(x,i,this.config.requestTimeout),n){const f=()=>{x.destroy();const p=new Error("Request aborted");p.name="AbortError",i(p)};if(typeof n.addEventListener==="function"){const p=n;p.addEventListener("abort",f,{once:!0}),x.once("close",()=>p.removeEventListener("abort",f))}else n.onabort=f}const w=u.agent;if(typeof w==="object"&&"keepAlive"in w)Gt(x,{keepAlive:w.keepAlive,keepAliveMsecs:w.keepAliveMsecs});o=dt(x,t,this.config.requestTimeout).catch((f)=>{return clearTimeout(r),s(f)})})}updateHttpClientConfig(t,n){this.config=void 0,this.configProvider=this.configProvider.then((r)=>{return{...r,[t]:n}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as Hr} from"stream";class yt extends Hr{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,n,r){this.bufferedBytes.push(t),r()}}async function Kr(t){const n=[],r=t.getReader();let e=!1,s=0;while(!e){const{done:i,value:d}=await r.read();if(d)n.push(d),s+=d.length;e=i}const o=new Uint8Array(s);let c=0;for(let i of n)o.set(i,c),c+=i.length;return o}var Jt=(t)=>{if(Qr(t))return Kr(t);return new Promise((n,r)=>{const e=new yt;t.pipe(e),t.on("error",(s)=>{e.end(),r(s)}),e.on("error",r),e.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.bufferedBytes));n(s)})})},Qr=(t)=>typeof ReadableStream==="function"&&t instanceof ReadableStream;var Jo="***SensitiveInformation***";var Po=(t,n)=>{for(let r of Object.keys(t)){const e=t[r],s=async function(c,i,d){const y=new e(c);if(typeof i==="function")this.send(y,i);else if(typeof d==="function"){if(typeof i!=="object")throw new Error(`Expected http options but got ${typeof i}`);this.send(y,i||{},d)}else return this.send(y,i)},o=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");n.prototype[o]=s}};class kt extends Error{constructor(t){super(t.message);Object.setPrototypeOf(this,kt.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}}var Pt=(t,n={})=>{Object.entries(n).filter(([,e])=>e!==void 0).forEach(([e,s])=>{if(t[e]==null||t[e]==="")t[e]=s});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t};class Xr{trace(){}debug(){}info(){}warn(){}error(){}}var Ot=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";import{Buffer as wt} from"buffer";var m=(t,n=0,r=t.byteLength-n)=>{if(!Ot(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return wt.from(t,n,r)},Q=(t,n)=>{if(typeof t!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return n?wt.from(t,n):wt.from(t)};var Jr=/^[A-Za-z0-9+/]*={0,2}$/,qt=(t)=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Jr.exec(t))throw new TypeError("Invalid base64 string.");const n=Q(t,"base64");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)};var B=(t)=>{const n=Q(t,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var fi=(t)=>{if(typeof t==="string")return B(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};var K=(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 m(t.buffer,t.byteOffset,t.byteLength).toString("utf8")};var X=(t)=>{let n;if(typeof t==="string")n=B(t);else n=t;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return m(n.buffer,n.byteOffset,n.byteLength).toString("base64")};function vt(t,n="utf-8"){if(n==="base64")return X(t);return K(t)}function _t(t,n){if(n==="base64")return I.mutate(qt(t));return I.mutate(B(t))}class I extends Uint8Array{static fromString(t,n="utf-8"){switch(typeof t){case"string":return _t(t,n);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,I.prototype),t}transformToString(t="utf-8"){return vt(this,t)}}import{Readable as kr} from"stream";var Ni=(t,n)=>{const{base64Encoder:r,bodyLengthChecker:e,checksumAlgorithmFn:s,checksumLocationName:o,streamHasher:c}=n,i=r!==void 0&&s!==void 0&&o!==void 0&&c!==void 0,d=i?c(s,t):void 0,y=new kr({read:()=>{}});return t.on("data",(l)=>{const h=e(l)||0;y.push(`${h.toString(16)}\r\n`),y.push(l),y.push("\r\n")}),t.on("end",async()=>{if(y.push("0\r\n"),i){const l=r(await d);y.push(`${o}:${l}\r\n`),y.push("\r\n")}y.push(null)}),y};import{Readable as Ct} from"stream";import{TextDecoder as ds} from"util";var _n=F(Hn(),1);var tr=F(On(),1);var D=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream);var qn="The stream has already been transformed.",nr=(t)=>{if(!vn(t)&&!D(t)){const s=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${s}`)}let n=!1;const r=async()=>{if(n)throw new Error(qn);return n=!0,await _n.streamCollector(t)},e=(s)=>{if(typeof s.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 s.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async(s)=>{const o=await r();if(s==="base64")return X(o);else if(s==="hex")return tr.toHex(o);else if(s===void 0||s==="utf8"||s==="utf-8")return K(o);else if(typeof TextDecoder==="function")return new TextDecoder(s).decode(o);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(n)throw new Error(qn);if(n=!0,vn(t))return e(t);else if(D(t))return t;else throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},vn=(t)=>typeof Blob==="function"&&t instanceof Blob;var rr="The stream has already been transformed.",qi=(t)=>{if(!(t instanceof Ct))try{return nr(t)}catch(e){const s=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${s}`)}let n=!1;const r=async()=>{if(n)throw new Error(rr);return n=!0,await Jt(t)};return Object.assign(t,{transformToByteArray:r,transformToString:async(e)=>{const s=await r();if(e===void 0||Buffer.isEncoding(e))return m(s.buffer,s.byteOffset,s.byteLength).toString(e);else return new ds(e).decode(s)},transformToWebStream:()=>{if(n)throw new Error(rr);if(t.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Ct.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 n=!0,Ct.toWeb(t)}})};import{PassThrough as sr} from"stream";async function er(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}async function ec(t){if(D(t))return er(t);const n=new sr,r=new sr;return t.pipe(n),t.pipe(r),[n,r]}import{Writable as gs} from"stream";async function or(t,n){let r=0;const e=[],s=t.getReader();let o=!1;while(!o){const{done:d,value:y}=await s.read();if(y)e.push(y),r+=y?.byteLength??0;if(r>=n)break;o=d}s.releaseLock();const c=new Uint8Array(Math.min(n,r));let i=0;for(let d of e){if(d.byteLength>c.byteLength-i){c.set(d.subarray(0,c.byteLength-i),i);break}else c.set(d,i);i+=d.length}return c}var hc=(t,n)=>{if(D(t))return or(t,n);return new Promise((r,e)=>{const s=new ir;s.limit=n,t.pipe(s),t.on("error",(o)=>{s.end(),e(o)}),s.on("error",e),s.on("finish",function(){const o=new Uint8Array(Buffer.concat(this.buffers));r(o)})})};class ir extends gs{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(t,n,r){if(this.buffers.push(t),this.bytesBuffered+=t.byteLength??0,this.bytesBuffered>=this.limit){const e=this.bytesBuffered-this.limit,s=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=s.subarray(0,s.byteLength-e),this.emit("finish")}r()}}var bc=async(t=new Uint8Array,n)=>{if(t instanceof Uint8Array)return I.mutate(t);if(!t)return I.mutate(new Uint8Array);const r=n.streamCollector(t);return I.mutate(await r)};var Cc=(t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${t}"`)}};var ys=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){const n=parseFloat(t);if(!Number.isNaN(n)){if(String(n)!==String(t))wr.warn(yr(`Expected number but observed string: ${t}`));return n}}if(typeof t==="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)},ws=Math.ceil(340282346638528860000000000000000000000),cr=(t)=>{const n=ys(t);if(n!==void 0&&!Number.isNaN(n)&&n!==Infinity&&n!==(-Infinity)){if(Math.abs(n)>ws)throw new TypeError(`Expected 32-bit float, got ${t}`)}return n},$t=(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 fr=(t)=>Et(t,32),hr=(t)=>Et(t,16),ur=(t)=>Et(t,8),Et=(t,n)=>{const r=$t(t);if(r!==void 0&&ps(r,n)!==r)throw new TypeError(`Expected ${n}-bit integer, got ${t}`);return r},ps=(t,n)=>{switch(n){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},$c=(t,n)=>{if(t===null||t===void 0){if(n)throw new TypeError(`Expected a non-null value for ${n}`);throw new TypeError("Expected a non-null value")}return t},Ec=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;const n=Array.isArray(t)?"array":typeof t;throw new TypeError(`Expected object, got ${n}: ${t}`)},Sc=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return wr.warn(yr(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)};var dr=(t)=>{if(typeof t=="string")return cr(R(t));return cr(t)},xs=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,R=(t)=>{const n=t.match(xs);if(n===null||n[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)};var Ic=(t)=>{if(typeof t==="string")return $t(R(t));return $t(t)};var Uc=(t)=>{if(typeof t==="string")return fr(R(t));return fr(t)},M=(t)=>{if(typeof t==="string")return hr(R(t));return hr(t)},gr=(t)=>{if(typeof t==="string")return ur(R(t));return ur(t)},yr=(t)=>{return String(new TypeError(t).stack||t).split("\n").slice(0,5).filter((n)=>!n.includes("stackTraceWarning")).join("\n")},wr={warn:console.warn};function Lc(t){const n=t.getUTCFullYear(),r=t.getUTCMonth(),e=t.getUTCDay(),s=t.getUTCDate(),o=t.getUTCHours(),c=t.getUTCMinutes(),i=t.getUTCSeconds(),d=s<10?`0${s}`:`${s}`,y=o<10?`0${o}`:`${o}`,l=c<10?`0${c}`:`${c}`,h=i<10?`0${i}`:`${i}`;return`${Ts[e]}, ${d} ${It[r]} ${n} ${y}:${l}:${h} GMT`}var Ts=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],It=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ls=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Dc=(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 n=ls.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");const[r,e,s,o,c,i,d,y]=n,l=M(j(e)),h=S(s,"month",1,12),g=S(o,"day",1,31);return z(l,h,g,{hours:c,minutes:i,seconds:d,fractionalMilliseconds:y})},bs=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),mc=(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 n=bs.exec(t);if(!n)throw new TypeError("Invalid RFC-3339 date-time value");const[r,e,s,o,c,i,d,y,l]=n,h=M(j(e)),g=S(s,"month",1,12),u=S(o,"day",1,31),T=z(h,g,u,{hours:c,minutes:i,seconds:d,fractionalMilliseconds:y});if(l.toUpperCase()!="Z")T.setTime(T.getTime()-Ls(l));return T},as=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$/),Cs=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$/),$s=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})$/),Bc=(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 n=as.exec(t);if(n){const[r,e,s,o,c,i,d,y]=n;return z(M(j(o)),St(s),S(e,"day",1,31),{hours:c,minutes:i,seconds:d,fractionalMilliseconds:y})}if(n=Cs.exec(t),n){const[r,e,s,o,c,i,d,y]=n;return Is(z(Es(o),St(s),S(e,"day",1,31),{hours:c,minutes:i,seconds:d,fractionalMilliseconds:y}))}if(n=$s.exec(t),n){const[r,e,s,o,c,i,d,y]=n;return z(M(j(y)),St(e),S(s.trimLeft(),"day",1,31),{hours:o,minutes:c,seconds:i,fractionalMilliseconds:d})}throw new TypeError("Invalid RFC-7231 date-time value")};var z=(t,n,r,e)=>{const s=n-1;return As(t,s,r),new Date(Date.UTC(t,s,r,S(e.hours,"hour",0,23),S(e.minutes,"minute",0,59),S(e.seconds,"seconds",0,60),Ns(e.fractionalMilliseconds)))},Es=(t)=>{const n=(new Date()).getUTCFullYear(),r=Math.floor(n/100)*100+M(j(t));if(r<n)return r+100;return r},Ss=1576800000000,Is=(t)=>{if(t.getTime()-(new Date()).getTime()>Ss)return new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()));return t},St=(t)=>{const n=It.indexOf(t);if(n<0)throw new TypeError(`Invalid month: ${t}`);return n+1},Us=[31,28,31,30,31,30,31,31,30,31,30,31],As=(t,n,r)=>{let e=Us[n];if(n===1&&Fs(t))e=29;if(r>e)throw new TypeError(`Invalid day for ${It[n]} in ${t}: ${r}`)},Fs=(t)=>{return t%4===0&&(t%100!==0||t%400===0)},S=(t,n,r,e)=>{const s=gr(j(t));if(s<r||s>e)throw new TypeError(`${n} must be between ${r} and ${e}, inclusive`);return s},Ns=(t)=>{if(t===null||t===void 0)return 0;return dr("0."+t)*1000},Ls=(t)=>{const n=t[0];let r=1;if(n=="+")r=1;else if(n=="-")r=-1;else throw new TypeError(`Offset direction, ${n}, must be "+" or "-"`);const e=Number(t.substring(1,3)),s=Number(t.substring(4,6));return r*(e*60+s)*60*1000},j=(t)=>{let n=0;while(n<t.length-1&&t.charAt(n)==="0")n++;if(n===0)return t;return t.slice(n)};var Ds=({output:t,parsedBody:n,exceptionCtor:r,errorCode:e})=>{const s=ms(t),o=s.httpStatusCode?s.httpStatusCode+"":void 0,c=new r({name:n?.code||n?.Code||e||o||"UnknownError",$fault:"client",$metadata:s});throw Pt(c,n)},Yc=(t)=>{return({output:n,parsedBody:r,errorCode:e})=>{Ds({output:n,parsedBody:r,exceptionCtor:t,errorCode:e})}},ms=(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 zc=(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 pr=!1,Vc=(t)=>{if(t&&!pr&&parseInt(t.substring(1,t.indexOf(".")))<16)pr=!0};var Ut=F(V(),1);var xr=(t)=>{const n=[];for(let r in Ut.AlgorithmId){const e=Ut.AlgorithmId[r];if(t[e]===void 0)continue;n.push({algorithmId:()=>e,checksumConstructor:()=>t[e]})}return{_checksumAlgorithms:n,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},Tr=(t)=>{const n={};return t.checksumAlgorithms().forEach((r)=>{n[r.algorithmId()]=r.checksumConstructor()}),n};var lr=(t)=>{let n=t.retryStrategy;return{setRetryStrategy(r){n=r},retryStrategy(){return n}}},br=(t)=>{const n={};return n.retryStrategy=t.retryStrategy(),n};var Xc=(t)=>{return{...xr(t),...lr(t)}};var Jc=(t)=>{return{...Tr(t),...br(t)}};function Bs(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})}var At=function(){const t=Object.getPrototypeOf(this).constructor,r=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(r,t.prototype),r};At.prototype=Object.create(String.prototype,{constructor:{value:At,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(At,String);function Ms(t,n,r){let e,s,o;if(typeof n==="undefined"&&typeof r==="undefined")e={},o=t;else if(e=t,typeof n==="function")return s=n,o=r,js(e,s,o);else o=n;for(let c of Object.keys(o)){if(!Array.isArray(o[c])){e[c]=o[c];continue}ar(e,null,o,c)}return e}var nf=(t,n)=>{const r={};for(let e in n)ar(r,t,n,e);return r},js=(t,n,r)=>{return Ms(t,Object.entries(r).reduce((e,[s,o])=>{if(Array.isArray(o))e[s]=o;else if(typeof o==="function")e[s]=[n,o()];else e[s]=[n,o];return e},{}))},ar=(t,n,r,e)=>{if(n!==null){let c=r[e];if(typeof c==="function")c=[,c];const[i=Ys,d=Rs,y=e]=c;if(typeof i==="function"&&i(n[y])||typeof i!=="function"&&!!i)t[e]=d(n[y]);return}let[s,o]=r[e];if(typeof o==="function"){let c;const i=s===void 0&&(c=o())!=null,d=typeof s==="function"&&!!s(void 0)||typeof s!=="function"&&!!s;if(i)t[e]=c;else if(d)t[e]=o()}else{const c=s===void 0&&o!=null,i=typeof s==="function"&&!!s(o)||typeof s!=="function"&&!!s;if(c||i)t[e]=o}},Ys=(t)=>t!=null,Rs=(t)=>t;var of=(t)=>t.toISOString().replace(".000Z","Z");var Cr=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((n)=>n!=null).map(Cr);if(typeof t==="object"){const n={};for(let r of Object.keys(t)){if(t[r]==null)continue;n[r]=Cr(t[r])}return n}return t};export{Gs as z,Hs as A,it as B,Z as C,Xr as D,ot as E,Fr as F,Ot as G,m as H,Q as I,qt as J,B as K,fi as L,K as M,X as N,Ni as O,ft as P,gt as Q,Jt as R,un as S,wn as T,Tn as U,q as V,Fn as W,Mn as X,Hn as Y,On as Z,qi as _,ec as $,hc as aa,bc as ba,jt as ca,Jo as da,Po as ea,Cc as fa,$t as ga,fr as ha,$c as ia,Ec as ja,Sc as ka,Ic as la,Uc as ma,Lc as na,Dc as oa,mc as pa,Bc as qa,kt as ra,Pt as sa,Yc as ta,zc as ua,Vc as va,Xc as wa,Jc as xa,Bs as ya,Ms as za,nf as Aa,of as Ba,Cr as Ca};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as h} from"./chunk-a5c18c07abe8fd9c.js";import"./chunk-a57ecc74c0fb9045.js";import{hb as _} from"./chunk-1109657ed53fbdc9.js";import{kb as N,lb as W,mb as I,pb as v,qb as P} from"./chunk-a3526e321ac9d173.js";var T=h(_(),1);var H=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var u=h(_(),1);var K=300000,g="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var R={},b=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-cfa9a65fae5ddaf4.js");if(R[e])return R[e];const s=new r({region:e});return R[e]=s,s};var G=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-cfa9a65fae5ddaf4.js");return(await b(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var U=h(_(),1);var D=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new U.TokenProviderError(`Token is expired. ${g}`,!1)};var q=h(_(),1);var p=(e,r,s=!1)=>{if(typeof r==="undefined")throw new q.TokenProviderError(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${g}`,!1)};import{promises as B} from"fs";var{writeFile:Q}=B,j=(e,r)=>{const s=W(e),t=JSON.stringify(r,null,2);return Q(s,t)};var X=new Date(0),z=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await P(e),s=N(e),t=r[s];if(!t)throw new u.TokenProviderError(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new u.TokenProviderError(`Profile '${s}' is missing required property 'sso_session'.`);const i=t.sso_session,a=(await v(e))[i];if(!a)throw new u.TokenProviderError(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!a[n])throw new u.TokenProviderError(`Sso session '${i}' is missing required property '${n}'.`,!1);const{sso_start_url:l,sso_region:f}=a;let o;try{o=await I(i)}catch(n){throw new u.TokenProviderError(`The SSO session token associated with profile=${s} was not found or is invalid. ${g}`,!1)}p("accessToken",o.accessToken),p("expiresAt",o.expiresAt);const{accessToken:E,expiresAt:x}=o,c={token:E,expiration:new Date(x)};if(c.expiration.getTime()-Date.now()>K)return c;if(Date.now()-X.getTime()<30000)return D(c),c;p("clientId",o.clientId,!0),p("clientSecret",o.clientSecret,!0),p("refreshToken",o.refreshToken,!0);try{X.setTime(Date.now());const n=await G(o,f);p("accessToken",n.accessToken),p("expiresIn",n.expiresIn);const w=new Date(Date.now()+n.expiresIn*1000);try{await j(i,{...o,accessToken:n.accessToken,expiresAt:w.toISOString(),refreshToken:n.refreshToken})}catch(C){}return{token:n.accessToken,expiration:w}}catch(n){return D(c),c}};var k=h(_(),1);var y=!1,A=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:S,clientConfig:a,profile:l,logger:f})=>{let o;const E="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const d=await z({profile:l})();o={accessToken:d.token,expiresAt:new Date(d.expiration).toISOString()}}catch(d){throw new k.CredentialsProviderError(d.message,{tryNextLink:y,logger:f})}else try{o=await I(e)}catch(d){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:f})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:y,logger:f});const{accessToken:x}=o,{SSOClient:c,GetRoleCredentialsCommand:n}=await import("./chunk-328c98321c6ba3d6.js"),w=S||new c(Object.assign({},a??{},{region:a?.region??t}));let C;try{C=await w.send(new n({accountId:s,roleName:i,accessToken:x}))}catch(d){throw new k.CredentialsProviderError(d,{tryNextLink:y,logger:f})}const{roleCredentials:{accessKeyId:m,secretAccessKey:O,sessionToken:$,expiration:F,credentialScope:L,accountId:M}={}}=C;if(!m||!O||!$||!F)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:y,logger:f});return{accessKeyId:m,secretAccessKey:O,sessionToken:$,expiration:new Date(F),...L&&{credentialScope:L},...M&&{accountId:M}}};var J=h(_(),1),V=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:i,sso_role_name:S}=e;if(!s||!t||!i||!S)throw new J.CredentialsProviderError('Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", '+`"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:r});return e};var Ee=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoSession:S}=e,{ssoClient:a}=e,l=N(e);if(!r&&!s&&!t&&!i&&!S){const o=(await P(e))[l];if(!o)throw new T.CredentialsProviderError(`Profile ${l} was not found.`,{logger:e.logger});if(!H(o))throw new T.CredentialsProviderError(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const m=(await v(e))[o.sso_session],O=` configurations in profile ${l} and sso-session ${o.sso_session}`;if(t&&t!==m.sso_region)throw new T.CredentialsProviderError("Conflicting SSO region"+O,{tryNextLink:!1,logger:e.logger});if(r&&r!==m.sso_start_url)throw new T.CredentialsProviderError("Conflicting SSO start_url"+O,{tryNextLink:!1,logger:e.logger});o.sso_region=m.sso_region,o.sso_start_url=m.sso_start_url}const{sso_start_url:E,sso_account_id:x,sso_region:c,sso_role_name:n,sso_session:w}=V(o,e.logger);return A({ssoStartUrl:E,ssoSession:w,ssoAccountId:x,ssoRegion:c,ssoRoleName:n,ssoClient:a,clientConfig:e.clientConfig,profile:l})}else if(!r||!s||!t||!i)throw new T.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return A({ssoStartUrl:r,ssoSession:S,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:a,clientConfig:e.clientConfig,profile:l})};export{V as validateSsoProfile,H as isSsoProfile,Ee as fromSSO};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class n extends Error{constructor(t,e=!0){let o,r=!0;if(typeof e==="boolean")o=void 0,r=e;else if(e!=null&&typeof e==="object")o=e.logger,r=e.tryNextLink??!0;super(t);this.name="ProviderError",this.tryNextLink=r,Object.setPrototypeOf(this,n.prototype),o?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,e=!0){return Object.assign(new this(t.message,e),t)}}class u extends n{constructor(t,e=!0){super(t,e);this.name="CredentialsProviderError",Object.setPrototypeOf(this,u.prototype)}}class l extends n{constructor(t,e=!0){super(t,e);this.name="TokenProviderError",Object.setPrototypeOf(this,l.prototype)}}var v=(...t)=>async()=>{if(t.length===0)throw new n("No providers in chain");let e;for(let o of t)try{return await o()}catch(r){if(e=r,r?.tryNextLink)continue;throw r}throw e};var w=(t)=>()=>Promise.resolve(t);var b=(t,e,o)=>{let r,i,s,f=!1;const a=async()=>{if(!i)i=t();try{r=await i,s=!0,f=!1}finally{i=void 0}return r};if(e===void 0)return async(c)=>{if(!s||c?.forceRefresh)r=await a();return r};return async(c)=>{if(!s||c?.forceRefresh)r=await a();if(f)return r;if(o&&!o(r))return f=!0,r;if(e(r))return await a(),r;return r}};export{n as rb,u as sb,l as tb,v as ub,w as vb,b as wb};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{y as D} from"./chunk-a5c18c07abe8fd9c.js";var C=D((h,A)=>{var{defineProperty:Q,getOwnPropertyDescriptor:M,getOwnPropertyNames:J}=Object,V=Object.prototype.hasOwnProperty,I=(j,b)=>Q(j,"name",{value:b,configurable:!0}),w=(j,b)=>{for(var F in b)Q(j,F,{get:b[F],enumerable:!0})},O=(j,b,F,B)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let G of J(b))if(!V.call(j,G)&&G!==F)Q(j,G,{get:()=>b[G],enumerable:!(B=M(b,G))||B.enumerable})}return j},q=(j)=>O(Q({},"__esModule",{value:!0}),j),Y={};w(Y,{CredentialsProviderError:()=>L,ProviderError:()=>U,TokenProviderError:()=>S,chain:()=>T,fromStatic:()=>N,memoize:()=>R});A.exports=q(Y);var Z=class j extends Error{constructor(b,F=!0){var B;let G,H=!0;if(typeof F==="boolean")G=void 0,H=F;else if(F!=null&&typeof F==="object")G=F.logger,H=F.tryNextLink??!0;super(b);this.name="ProviderError",this.tryNextLink=H,Object.setPrototypeOf(this,j.prototype),(B=G==null?void 0:G.debug)==null||B.call(G,`@smithy/property-provider ${H?"->":"(!)"} ${b}`)}static from(b,F=!0){return Object.assign(new this(b.message,F),b)}};I(Z,"ProviderError");var U=Z,$=class j extends U{constructor(b,F=!0){super(b,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,j.prototype)}};I($,"CredentialsProviderError");var L=$,z=class j extends U{constructor(b,F=!0){super(b,F);this.name="TokenProviderError",Object.setPrototypeOf(this,j.prototype)}};I(z,"TokenProviderError");var S=z,T=I((...j)=>async()=>{if(j.length===0)throw new U("No providers in chain");let b;for(let F of j)try{return await F()}catch(B){if(b=B,B==null?void 0:B.tryNextLink)continue;throw B}throw b},"chain"),N=I((j)=>()=>Promise.resolve(j),"fromStatic"),R=I((j,b,F)=>{let B,G,H,W=!1;const X=I(async()=>{if(!G)G=j();try{B=await G,H=!0,W=!1}finally{G=void 0}return B},"coalesceProvider");if(b===void 0)return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();return B};return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();if(W)return B;if(F&&!F(B))return W=!0,B;if(b(B))return await X(),B;return B}},"memoize")});
|
|
2
|
+
export{C as hb};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{s as w,t as z,u as B} from"./chunk-3728fa21e6931333.js";import{x as Q} from"./chunk-a5c18c07abe8fd9c.js";import{hb as X} from"./chunk-1109657ed53fbdc9.js";import{jb as $} from"./chunk-a3526e321ac9d173.js";var q=Q(X(),1);var G=Q(X(),1),k="AWS_EC2_METADATA_DISABLED",Y=async(b)=>{const{ENV_CMDS_FULL_URI:j,ENV_CMDS_RELATIVE_URI:x,fromContainerMetadata:y,fromInstanceMetadata:J}=await import("./chunk-77d5bbc7a9117c21.js");if(process.env[x]||process.env[j]){b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");const{fromHttp:K}=await import("./chunk-382a513747a9aa52.js");return G.chain(K(b),y(b))}if(process.env[k])return async()=>{throw new G.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:b.logger})};return b.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),J(b)};var Z=!1,T=(b={})=>q.memoize(q.chain(async()=>{if(b.profile??process.env[$]){if(process.env[w]&&process.env[z]){if(!Z)(b.logger?.warn&&b.logger?.constructor?.name!=="NoOpLogger"?b.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
2
|
+
Multiple credential sources detected:
|
|
3
|
+
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
4
|
+
This SDK will proceed with the AWS_PROFILE value.
|
|
5
|
+
|
|
6
|
+
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
7
|
+
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
8
|
+
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
9
|
+
`),Z=!0}throw new q.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:b.logger,tryNextLink:!0})}return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),B(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");const{ssoStartUrl:j,ssoAccountId:x,ssoRegion:y,ssoRoleName:J,ssoSession:K}=b;if(!j&&!x&&!y&&!J&&!K)throw new q.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:b.logger});const{fromSSO:H}=await import("./chunk-0a6614fbd65524af.js");return H(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-d3765f96a689a0c1.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-51c21d2a3c45fbe1.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-5b836c769c5dad2a.js");return j(b)()},async()=>{return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Y(b))()},async()=>{throw new q.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:b.logger})}),O,v),v=(b)=>b?.expiration!==void 0,O=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{T as ib};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-70bb003c03f21dad.js";import{x as $} from"./chunk-a5c18c07abe8fd9c.js";import{A as er,Aa as o,Ca as I,D as be,F as cr,J as je,K as Fe,M as De,N as qe,Q as Je,R as Ve,ca as v,da as t,ea as Vr,ga as _,ha as b,ia as j,ja as F,ka as h,ra as Sr,sa as a,ta as jr,ua as We,va as fe,wa as rr,xa as sr,z as ue,za as d} from"./chunk-073f5b81e98d91fe.js";import{$a as kr,Da as nr,Ea as or,Fa as dr,Ga as yr,Ka as H,La as ee,Ma as re,Na as tr,Oa as Ie,Pa as Re,Qa as Pe,Ra as ar,Sa as Ae,Ta as Ke,Ua as Me,Va as Be,Wa as mr,Xa as wr,Za as E,_a as S,ab as Le,cb as Qe,db as vr,eb as Xe,fb as Er,hb as q,ib as Ye,jb as Ze,kb as He,lb as Ne,mb as ir,nb as lr} from"./chunk-e0e0f2ee626a6fb3.js";import"./chunk-5a9fa677066f72ac.js";import{pb as R,qb as Ue} from"./chunk-57a61e580c4adf80.js";import"./chunk-100b76ab0ca3e14d.js";import{xb as Ce} from"./chunk-9ee2118bd4eb34ae.js";import"./chunk-e16b252158474b8c.js";var P=$(H(),1);var se=$(q(),1);var Mr=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}},Z=function(e){return{schemeId:"smithy.api#noAuth"}},ie=async(e,s,r)=>{return{operation:ee(s).operation,region:await re(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},le=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(Z(e));break}case"RegisterClient":{s.push(Z(e));break}case"StartDeviceAuthorization":{s.push(Z(e));break}default:s.push(Mr(e))}return s},he=(e)=>{return{...se.resolveAwsSdkSigV4Config(e)}};var ne=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},k={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oe={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","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-oidc"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.629.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-oidc",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso-oidc"}};var _e=$(q(),1);var xe=$(q(),1),ze=$(H(),1);var de={["required"]:!1,type:"String"},ye={["required"]:!0,default:!1,type:"Boolean"},ce={["ref"]:"Endpoint"},ve={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Ee={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},te={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Se={["ref"]:"PartitionResult"},ae={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Se,"supportsDualStack"]}]},me=[ve],we=[Ee],ke=[{["ref"]:"Region"}],Lr={version:"1.0",parameters:{Region:de,UseDualStack:ye,UseFIPS:ye,Endpoint:de},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ce]}],rules:[{conditions:me,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:we,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ce,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:ke}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:ke,assign:"PartitionResult"}],rules:[{conditions:[ve,Ee],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,te]},ae],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:me,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[te,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Se,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:m,headers:m},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:we,rules:[{conditions:[ae],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},$e=Lr;var Te=(e,s={})=>{return Re($e,{endpointParams:e,logger:s.logger})};Ie.aws=Pe;var Ge=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??je,base64Encoder:e?.base64Encoder??qe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Te,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??le,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new xe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze.NoAuthSigner}],logger:e?.logger??new be,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Ue,utf8Decoder:e?.utf8Decoder??Fe,utf8Encoder:e?.utf8Encoder??De}};var pe=(e)=>{fe(process.version);const s=Ne(e),r=()=>s().then(We),i=Ge(e);return _e.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??He,credentialDefaultProvider:e?.credentialDefaultProvider??Ce,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ye({serviceId:i.serviceId,clientVersion:oe.version}),maxAttempts:e?.maxAttempts??R(Qe),region:e?.region??R(Me,Be),requestHandler:Je.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Xe,default:async()=>(await r()).retryMode||Le}),sha256:e?.sha256??Ze.bind(null,"sha256"),streamCollector:e?.streamCollector??Ve,useDualstackEndpoint:e?.useDualstackEndpoint??R(Ae),useFipsEndpoint:e?.useFipsEndpoint??R(Ke)}};var ge=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:r,credentials:i}=e;return{setHttpAuthScheme(l){const n=s.findIndex((T)=>T.schemeId===l.schemeId);if(n===-1)s.push(l);else s.splice(n,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){r=l},httpAuthSchemeProvider(){return r},setCredentials(l){i=l},credentials(){return i}}},Oe=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var U=(e)=>e,hr=(e,s)=>{const r={...U(ir(e)),...U(rr(e)),...U(ue(e)),...U(ge(e))};return s.forEach((i)=>i.configure(r)),{...e,...lr(r),...sr(r),...er(r),...Oe(r)}};class N extends cr{constructor(...[e]){const s=pe(e||{}),r=ne(s),i=tr(r),l=vr(i),n=mr(l),T=nr(n),fr=kr(T),Ar=he(fr),u=hr(Ar,e?.extensions||[]);super(u);this.config=u,this.middlewareStack.use(ar(this.config)),this.middlewareStack.use(Er(this.config)),this.middlewareStack.use(wr(this.config)),this.middlewareStack.use(or(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(yr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ie,identityProviderConfigProvider:async(Kr)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Kr.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class y extends Sr{constructor(e){super(e);Object.setPrototypeOf(this,y.prototype)}}class x extends y{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,x.prototype),this.error=e.error,this.error_description=e.error_description}}class z extends y{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,z.prototype),this.error=e.error,this.error_description=e.error_description}}class G extends y{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends y{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends y{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends y{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class f extends y{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends y{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends y{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends y{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends y{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends y{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Q extends y{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends y{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}var $r=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),Ir=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Rr=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Pr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Tr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),br=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var w=$(q(),1),D=$(H(),1);var Fr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},Dr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");const l=d({[is]:[,"t"]});let n;return n=JSON.stringify(o(e,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(T)=>I(T),subjectToken:[],subjectTokenType:[]})),r.m("POST").h(i).q(l).b(n),r.build()},qr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/client/register");let l;return l=JSON.stringify(o(e,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(n)=>I(n),issuerUrl:[],redirectUris:(n)=>I(n),scopes:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},Ur=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/device_authorization");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],startUrl:[]})),r.m("POST").h(i).b(l),r.build()},xr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,issuedTokenType:h,refreshToken:h,scope:I,tokenType:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:_,clientSecret:h,clientSecretExpiresAt:_,tokenEndpoint:h});return Object.assign(r,l),r},Jr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{deviceCode:h,expiresIn:b,interval:b,userCode:h,verificationUri:h,verificationUriComplete:h});return Object.assign(r,l),r},Y=async(e,s)=>{const r={...e,body:await w.parseJsonErrorBody(e.body,s)},i=w.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Xr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Yr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Zr(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Hr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Nr(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await pr(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await gr(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ur(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await es(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await rs(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await ss(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await Or(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await _r(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Cr(r,s);default:const l=r.body;return Qr({output:e,parsedBody:l,errorCode:i})}},Qr=jr(y),Xr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new x({$metadata:c(e),...r});return a(n,e.body)},Yr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new z({$metadata:c(e),...r});return a(n,e.body)},Zr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new G({$metadata:c(e),...r});return a(n,e.body)},Hr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new J({$metadata:c(e),...r});return a(n,e.body)},Nr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new V({$metadata:c(e),...r});return a(n,e.body)},_r=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new Q({$metadata:c(e),...r});return a(n,e.body)},pr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new W({$metadata:c(e),...r});return a(n,e.body)},Cr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new X({$metadata:c(e),...r});return a(n,e.body)},gr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new f({$metadata:c(e),...r});return a(n,e.body)},Or=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{endpoint:h,error:h,error_description:h,region:h});Object.assign(r,l);const n=new L({$metadata:c(e),...r});return a(n,e.body)},ur=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new A({$metadata:c(e),...r});return a(n,e.body)},es=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new K({$metadata:c(e),...r});return a(n,e.body)},rs=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new M({$metadata:c(e),...r});return a(n,e.body)},ss=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new B({$metadata:c(e),...r});return a(n,e.body)},c=(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 is="aws_iam";class p extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f($r,Ir).ser(Fr).de(xr).build(){}class C extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Rr,Pr).ser(Dr).de(zr).build(){}class g extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Tr).ser(qr).de(Gr).build(){}class O extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(br,void 0).ser(Ur).de(Jr).build(){}var ls={CreateTokenCommand:p,CreateTokenWithIAMCommand:C,RegisterClientCommand:g,StartDeviceAuthorizationCommand:O};class Wr extends N{}Vr(ls,Wr);export{cr as __Client,B as UnsupportedGrantTypeException,M as UnauthorizedClientException,br as StartDeviceAuthorizationRequestFilterSensitiveLog,O as StartDeviceAuthorizationCommand,K as SlowDownException,y as SSOOIDCServiceException,N as SSOOIDCClient,Wr as SSOOIDC,Tr as RegisterClientResponseFilterSensitiveLog,g as RegisterClientCommand,A as InvalidScopeException,L as InvalidRequestRegionException,f as InvalidRequestException,X as InvalidRedirectUriException,W as InvalidGrantException,Q as InvalidClientMetadataException,V as InvalidClientException,J as InternalServerException,G as ExpiredTokenException,Pr as CreateTokenWithIAMResponseFilterSensitiveLog,Rr as CreateTokenWithIAMRequestFilterSensitiveLog,C as CreateTokenWithIAMCommand,Ir as CreateTokenResponseFilterSensitiveLog,$r as CreateTokenRequestFilterSensitiveLog,p as CreateTokenCommand,z as AuthorizationPendingException,x as AccessDeniedException,v as $Command};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as o} from"./chunk-a5c18c07abe8fd9c.js";import{A as Fe,D as g,F as We,N as ss,O as R,T as D,U as Ge,V as h,aa as Te,ba as u,ca as Ve,da as ce,ea as ie,fa as _e,ga as $e,ia as i,ja as y,la as Ne,ma as be,na as xe,z as Be} from"./chunk-3bd48fb5397a155b.js";import{$a as te,Aa as N,Ba as Ke,Ca as le,Da as pe,Ea as ye,Fa as me,Ga as Qe,Ha as Xe,Ja as ts,Ka as rs,La as Ye,Ma as he,Oa as ue,Pa as Ze,Qa as we,Ra as je,Ta as x,Ua as ve,Wa as ee,Ya as se,Za as ke,_a as Re,ab as re,bb as qe,cb as Pe,db as Je,oa as Ie,pa as Le,qa as Ce,ra as Me,sa as os,wa as F,xa as Ae,ya as G,za as V} from"./chunk-8295e42bcfc910ff.js";import"./chunk-a57ecc74c0fb9045.js";import{fb as ps,gb as l} from"./chunk-bcd70a6fc2fd359c.js";import"./chunk-1109657ed53fbdc9.js";import"./chunk-a3526e321ac9d173.js";var p=o(F(),1);var $=o(x(),1),v=o(os(),1),cs=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}},b=function(e){return{schemeId:"smithy.api#noAuth"}},P=async(e,s,t)=>{return{operation:v.getSmithyContext(s).operation,region:await v.normalizeProvider(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(cs(e))}return s},U=(e)=>{return{...$.resolveAwsSdkSigV4Config(e)}};var I=(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 C={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.629.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var Ee=o(x(),1);var ae=o(x(),1),ne=o(F(),1);var de=o(ps(),1);var M={["required"]:!1,type:"String"},W={["required"]:!0,default:!1,type:"Boolean"},A={["ref"]:"Endpoint"},j={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},K={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},H={["ref"]:"PartitionResult"},Q={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[H,"supportsDualStack"]}]},X=[j],Y=[T],Z=[{["ref"]:"Region"}],ls={version:"1.0",parameters:{Region:M,UseDualStack:W,UseFIPS:W,Endpoint:M},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[A]}],rules:[{conditions:X,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Y,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:A,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:Z}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Z,assign:"PartitionResult"}],rules:[{conditions:[j,T],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,K]},Q],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:X,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[K,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[H,"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:Y,rules:[{conditions:[Q],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"}]},O=ls;var f=(e,s={})=>{return V(O,{endpointParams:e,logger:s.logger})};G.aws=N;var oe=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??te,base64Encoder:e?.base64Encoder??re,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??f,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??J,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new ae.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ne.NoAuthSigner}],logger:e?.logger??new g,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??de.parseUrl,utf8Decoder:e?.utf8Decoder??ee,utf8Encoder:e?.utf8Encoder??se}};var Se=(e)=>{ie(process.version);const s=qe(e),t=()=>s().then(ce),r=oe(e);return Ee.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Re,defaultUserAgentProvider:e?.defaultUserAgentProvider??ve({serviceId:r.serviceId,clientVersion:C.version}),maxAttempts:e?.maxAttempts??l(ue),region:e?.region??l(ye,me),requestHandler:be.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...we,default:async()=>(await t()).retryMode||he}),sha256:e?.sha256??ke.bind(null,"sha256"),streamCollector:e?.streamCollector??xe,useDualstackEndpoint:e?.useDualstackEndpoint??l(le),useFipsEndpoint:e?.useFipsEndpoint??l(pe)}};var ze=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((B)=>B.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}}},De=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var k=(e)=>e,Ue=(e,s)=>{const t={...k(Pe(e)),...k(_e(e)),...k(Be(e)),...k(ze(e))};return s.forEach((r)=>r.configure(t)),{...e,...Je(t),...$e(t),...Fe(t),...De(t)}};class ys extends We{constructor(...[e]){const s=Se(e||{}),t=I(s),r=Ae(t),a=Ze(r),n=Qe(a),B=Ie(n),as=Ye(B),ns=U(as),_=Ue(ns,e?.extensions||[]);super(_);this.config=_,this.middlewareStack.use(Ke(this.config)),this.middlewareStack.use(je(this.config)),this.middlewareStack.use(Xe(this.config)),this.middlewareStack.use(Le(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:P,identityProviderConfigProvider:async(ds)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":ds.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class c extends Te{constructor(e){super(e);Object.setPrototypeOf(this,c.prototype)}}class q extends c{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class E extends c{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class S extends c{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}class z extends c{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,z.prototype)}}var He=(e)=>({...e,...e.accessToken&&{accessToken:R}}),ms=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:R},...e.sessionToken&&{sessionToken:R}}),Oe=(e)=>({...e,...e.roleCredentials&&{roleCredentials:ms(e.roleCredentials)}});var m=o(x(),1),fe=o(F(),1);var ge=async(e,s)=>{const t=fe.requestBuilder(e,s),r=i({},ks,{[Ds]:e[qs]});t.bp("/federation/credentials");const a=i({[zs]:[,D(e[Ss],"roleName")],[Es]:[,D(e[Rs],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var es=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return hs(e,s);const t=i({$metadata:w(e)}),r=D(Ge(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:Ne});return Object.assign(t,a),t};var hs=async(e,s)=>{const t={...e,body:await m.parseJsonErrorBody(e.body,s)},r=m.loadRestJsonErrorCode(e,t.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await ws(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await bs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await xs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await vs(t,s);default:const a=t.body;return us({output:e,parsedBody:a,errorCode:r})}},us=Ve(c),ws=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new q({$metadata:w(e),...t});return u(n,e.body)},bs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new E({$metadata:w(e),...t});return u(n,e.body)},xs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new S({$metadata:w(e),...t});return u(n,e.body)},vs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new z({$metadata:w(e),...t});return u(n,e.body)},w=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var ks=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Rs="accountId",qs="accessToken",Es="account_id";var Ss="roleName",zs="role_name",Ds="x-amz-sso_bearer_token";class Bs extends ss.classBuilder().ep({...L}).m(function(e,s,t,r){return[ts(t,this.serialize,this.deserialize),rs(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(He,Oe).ser(ge).de(es).build(){}export{ys as SSOClient,Bs as GetRoleCredentialsCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as i} from"./chunk-a5c18c07abe8fd9c.js";import{A as _e,Aa as y,Ca as fe,D as ee,F as Ae,J as se,K as te,M as re,N as ae,Q as ie,R as le,ca as ts,da as k,ia as z,ja as Ve,ka as h,ra as He,sa as u,ta as Ne,ua as pe,va as ye,wa as $e,xa as Pe,z as Fe,za as c} from"./chunk-073f5b81e98d91fe.js";import{$a as Ze,Da as Le,Ea as Ce,Fa as Me,Ga as We,Ka as B,La as _,Ma as $,Na as Ke,Oa as V,Pa as N,Qa as f,Ra as Qe,Sa as me,Ta as he,Ua as ue,Va as we,Wa as Xe,Xa as Ye,Za as rs,_a as as,ab as be,cb as xe,db as je,eb as ve,fb as Te,hb as x,ib as ke,jb as Re,kb as qe,lb as Ee,mb as Je,nb as Ue} from"./chunk-e0e0f2ee626a6fb3.js";import"./chunk-5a9fa677066f72ac.js";import{pb as l,qb as ne} from"./chunk-57a61e580c4adf80.js";import"./chunk-100b76ab0ca3e14d.js";import"./chunk-e16b252158474b8c.js";var p=i(B(),1);var P=i(x(),1);var cs=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}},b=function(e){return{schemeId:"smithy.api#noAuth"}},J=async(e,s,t)=>{return{operation:_(s).operation,region:await $(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},U=(e)=>{const s=[];switch(e.operation){case"GetRoleCredentials":{s.push(b(e));break}case"ListAccountRoles":{s.push(b(e));break}case"ListAccounts":{s.push(b(e));break}case"Logout":{s.push(b(e));break}default:s.push(cs(e))}return s},I=(e)=>{return{...P.resolveAwsSdkSigV4Config(e)}};var L=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},C={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var M={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.629.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var Se=i(x(),1);var de=i(x(),1),oe=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"}],ls={version:"1.0",parameters:{Region:W,UseDualStack:A,UseFIPS:A,Endpoint:W},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[K]}],rules:[{conditions:Y,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:K,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:j}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:j,assign:"PartitionResult"}],rules:[{conditions:[T,H],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Q]},X],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Y,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Q,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[O,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:d,headers:d},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:Z,rules:[{conditions:[X],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},G=ls;var g=(e,s={})=>{return N(G,{endpointParams:e,logger:s.logger})};V.aws=f;var ce=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??se,base64Encoder:e?.base64Encoder??ae,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??g,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??U,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new de.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new oe.NoAuthSigner}],logger:e?.logger??new ee,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??ne,utf8Decoder:e?.utf8Decoder??te,utf8Encoder:e?.utf8Encoder??re}};var ze=(e)=>{ye(process.version);const s=Ee(e),t=()=>s().then(pe),r=ce(e);return Se.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??qe,defaultUserAgentProvider:e?.defaultUserAgentProvider??ke({serviceId:r.serviceId,clientVersion:M.version}),maxAttempts:e?.maxAttempts??l(xe),region:e?.region??l(ue,we),requestHandler:ie.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...ve,default:async()=>(await t()).retryMode||be}),sha256:e?.sha256??Re.bind(null,"sha256"),streamCollector:e?.streamCollector??le,useDualstackEndpoint:e?.useDualstackEndpoint??l(me),useFipsEndpoint:e?.useFipsEndpoint??l(he)}};var De=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((D)=>D.schemeId===a.schemeId);if(n===-1)s.push(a);else s.splice(n,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){t=a},httpAuthSchemeProvider(){return t},setCredentials(a){r=a},credentials(){return r}}},Be=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var v=(e)=>e,Ie=(e,s)=>{const t={...v(Je(e)),...v($e(e)),...v(Fe(e)),...v(De(e))};return s.forEach((r)=>r.configure(t)),{...e,...Ue(t),...Pe(t),..._e(t),...Be(t)}};class ps extends Ae{constructor(...[e]){const s=ze(e||{}),t=L(s),r=Ke(t),a=je(r),n=Xe(a),D=Le(n),ns=Ze(D),ds=I(ns),F=Ie(ds,e?.extensions||[]);super(F);this.config=F,this.middlewareStack.use(Qe(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Ye(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:async(os)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":os.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class o extends He{constructor(e){super(e);Object.setPrototypeOf(this,o.prototype)}}class R extends o{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,R.prototype)}}class q extends o{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class E extends o{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class S extends o{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}var Oe=(e)=>({...e,...e.accessToken&&{accessToken:k}}),ys=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:k},...e.sessionToken&&{sessionToken:k}}),Ge=(e)=>({...e,...e.roleCredentials&&{roleCredentials:ys(e.roleCredentials)}});var m=i(x(),1),ge=i(B(),1);var es=async(e,s)=>{const t=ge.requestBuilder(e,s),r=c({},vs,{[zs]:e[Rs]});t.bp("/federation/credentials");const a=c({[Ss]:[,z(e[Es],"roleName")],[qs]:[,z(e[ks],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var ss=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return ms(e,s);const t=c({$metadata:w(e)}),r=z(Ve(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:fe});return Object.assign(t,a),t};var ms=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 us(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await ws(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await bs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await xs(t,s);default:const a=t.body;return hs({output:e,parsedBody:a,errorCode:r})}},hs=Ne(o),us=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)},ws=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)},bs=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)},xs=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 vs=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),ks="accountId",Rs="accessToken",qs="account_id";var Es="roleName",Ss="role_name",zs="x-amz-sso_bearer_token";class Ds extends ts.classBuilder().ep({...C}).m(function(e,s,t,r){return[rs(t,this.serialize,this.deserialize),as(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(Oe,Ge).ser(es).de(ss).build(){}export{ps as SSOClient,Ds as GetRoleCredentialsCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-a5c18c07abe8fd9c.js";import"./chunk-5a9fa677066f72ac.js";import{pb as v,qb as B} from"./chunk-57a61e580c4adf80.js";import{rb as z,sb as y} from"./chunk-100b76ab0ca3e14d.js";import"./chunk-e16b252158474b8c.js";import{parse as p} from"url";import{Buffer as M} from"buffer";import{request as k} from"http";function u(c){return new Promise((I,x)=>{const T=k({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new z("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new z("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("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const E=[];N.on("data",(w)=>{E.push(w)}),N.on("end",()=>{I(M.concat(E)),T.destroy()})}),T.end()})}var K=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",_=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var hc=1000,Yc=0,D=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var Q="AWS_CONTAINER_CREDENTIALS_FULL_URI",X="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",b="AWS_CONTAINER_AUTHORIZATION_TOKEN",mc=(c={})=>{const{timeout:I,maxRetries:x}=D(c);return()=>m(async()=>{const T=await s({logger:c.logger}),N=JSON.parse(await C(I,T));if(!K(N))throw new y("Invalid response received from instance metadata service.",{logger:c.logger});return _(N)},x)},C=async(c,I)=>{if(process.env[b])I.headers={...I.headers,Authorization:process.env[b]};return(await u({...I,timeout:c})).toString()},a="169.254.170.2",n={localhost:!0,"127.0.0.1":!0},o={"http:":!0,"https:":!0},s=async({logger:c})=>{if(process.env[X])return{hostname:a,path:process.env[X]};if(process.env[Q]){const I=p(process.env[Q]);if(!I.hostname||!(I.hostname in n))throw new y(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in o))throw new y(`${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 y("The container metadata credential provider cannot be used unless"+` the ${X} or ${Q} environment`+" variable is set",{tryNextLink:!1,logger:c})};class G extends y{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,G.prototype)}}var A;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(A||(A={}));var H={environmentVariableSelector:(c)=>c["AWS_EC2_METADATA_SERVICE_ENDPOINT"],configFileSelector:(c)=>c["ec2_metadata_service_endpoint"],default:void 0};var f;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(f||(f={}));var g="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",l="ec2_metadata_service_endpoint_mode",q={environmentVariableSelector:(c)=>c[g],configFileSelector:(c)=>c[l],default:f.IPv4};var Z=async()=>B(await r()||await d()),r=async()=>v(H)(),d=async()=>{const c=await v(q)();switch(c){case f.IPv4:return A.IPv4;case f.IPv6:return A.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}.`+` Select from ${Object.values(f)}`)}};var L=(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 U=(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=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var P="/latest/meta-data/iam/security-credentials/",e="/latest/api/token",W="AWS_EC2_METADATA_V1_DISABLED",t="ec2_metadata_v1_disabled",F="x-aws-ec2-metadata-token",oc=(c={})=>U(i(c),{logger:c.logger}),i=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=D(c),E=async(w,$)=>{if(I||$.headers?.[F]==null){let h=!1,Y=!1;const R=await v({environmentVariableSelector:(S)=>{const j=S[W];if(Y=!!j&&j!=="false",j===void 0)throw new y(`${W} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{const j=S[t];return h=!!j&&j!=="false",h},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||R){const S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${t})`);if(Y)S.push(`process environment variable (${W})`);throw new G(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}const V=(await m(async()=>{let h;try{h=await Ic($)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return m(async()=>{let h;try{h=await Tc(V,$,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{const w=await Z();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),E(O,{...w,timeout:N});else{let $;try{$=(await cc({...w,timeout:N})).toString()}catch(J){if(J?.statusCode===400)throw Object.assign(J,{message:"EC2 Metadata token request returned error"});else if(J.message==="TimeoutError"||[403,404,405].includes(J.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),E(O,{...w,timeout:N})}return E(O,{...w,headers:{[F]:$},timeout:N})}}},cc=async(c)=>u({...c,path:e,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Ic=async(c)=>(await u({...c,path:P})).toString(),Tc=async(c,I,x)=>{const T=JSON.parse((await u({...I,path:P+c})).toString());if(!K(T))throw new y("Invalid response received from instance metadata service.",{logger:x.logger});return _(T)};export{D as providerConfigFromInit,u as httpRequest,Z as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,mc as fromContainerMetadata,A as Endpoint,X as ENV_CMDS_RELATIVE_URI,Q as ENV_CMDS_FULL_URI,b as ENV_CMDS_AUTH_TOKEN,hc as DEFAULT_TIMEOUT,Yc as DEFAULT_MAX_RETRIES};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as _} from"./chunk-a5c18c07abe8fd9c.js";import{hb as S} from"./chunk-1109657ed53fbdc9.js";var E=_(S(),1),p="AWS_ACCESS_KEY_ID",A="AWS_SECRET_ACCESS_KEY",C="AWS_SESSION_TOKEN",N="AWS_CREDENTIAL_EXPIRATION",I="AWS_CREDENTIAL_SCOPE",a="AWS_ACCOUNT_ID",i=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");const o=process.env[p],r=process.env[A],n=process.env[C],s=process.env[N],t=process.env[I],c=process.env[a];if(o&&r)return{accessKeyId:o,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...t&&{credentialScope:t},...c&&{accountId:c}};throw new E.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{i as fromEnv,C as ENV_SESSION,A as ENV_SECRET,p as ENV_KEY,N as ENV_EXPIRATION,I as ENV_CREDENTIAL_SCOPE,a as ENV_ACCOUNT_ID};export{p as s,A as t,i as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as m} from"./chunk-a5c18c07abe8fd9c.js";import{B as g,L as A,Z as w,ma as P} from"./chunk-3bd48fb5397a155b.js";import"./chunk-a57ecc74c0fb9045.js";import{hb as d} from"./chunk-1109657ed53fbdc9.js";var i=m(d(),1);import O from"fs/promises";var C=m(d(),1);var E="169.254.170.2",R="169.254.170.23",p="[fd00:ec2::23]",S=(e,c)=>{if(e.protocol==="https:")return;if(e.hostname===E||e.hostname===R||e.hostname===p)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const a=e.hostname.split("."),r=(t)=>{const s=parseInt(t,10);return 0<=s&&s<=255};if(a[0]==="127"&&r(a[1])&&r(a[2])&&r(a[3])&&a.length===4)return}throw new C.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
|
+
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
|
+
- ECS container host 169.254.170.2
|
|
5
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:c})};var o=m(d(),1);var I=m(A(),1);function K(e){return new g({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((c,[a,r])=>{return c[a]=r,c},{}),fragment:e.hash})}async function T(e,c){const r=await I.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){const t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new o.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:c});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:w(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new o.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c}),{Code:t.Code,Message:t.Message})}throw new o.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c})}var x=(e,c,a)=>{return async()=>{for(let r=0;r<c;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,a))}return await e()}};var b="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",_="http://169.254.170.2",v="AWS_CONTAINER_CREDENTIALS_FULL_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",D="AWS_CONTAINER_AUTHORIZATION_TOKEN",M=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let c;const a=e.awsContainerCredentialsRelativeUri??process.env[b],r=e.awsContainerCredentialsFullUri??process.env[v],t=e.awsContainerAuthorizationToken??process.env[D],s=e.awsContainerAuthorizationTokenFile??process.env[B],n=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(a&&r)n("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),n("awsContainerCredentialsFullUri will take precedence.");if(t&&s)n("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),n("awsContainerAuthorizationToken will take precedence.");if(r)c=r;else if(a)c=`${_}${a}`;else throw new i.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
6
|
+
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});const y=new URL(c);S(y,e.logger);const u=new P({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return x(async()=>{const f=K(y);if(t)f.headers.Authorization=t;else if(s)f.headers.Authorization=(await O.readFile(s)).toString();try{const h=await u.handle(f);return T(h.response)}catch(h){throw new i.CredentialsProviderError(String(h),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{M as fromHttp};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{x as X,y as D} from"./chunk-a5c18c07abe8fd9c.js";import{eb as l} from"./chunk-a57ecc74c0fb9045.js";var xn=D((Dr,kn)=>{var{defineProperty:O,getOwnPropertyDescriptor:of,getOwnPropertyNames:Ef}=Object,yf=Object.prototype.hasOwnProperty,S=(n,t)=>O(n,"name",{value:t,configurable:!0}),If=(n,t)=>{for(var c in t)O(n,c,{get:t[c],enumerable:!0})},Uf=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Ef(t))if(!yf.call(n,i)&&i!==c)O(n,i,{get:()=>t[i],enumerable:!(f=of(t,i))||f.enumerable})}return n},Lf=(n)=>Uf(O({},"__esModule",{value:!0}),n),Pn={};If(Pn,{constructStack:()=>Tn});kn.exports=Lf(Pn);var K=S((n,t)=>{const c=[];if(n)c.push(n);if(t)for(let f of t)c.push(f);return c},"getAllAliases"),G=S((n,t)=>{return`${n||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},"getMiddlewareNameWithAliases"),Tn=S(()=>{let n=[],t=[],c=!1;const f=new Set,i=S(($)=>$.sort((F,T)=>Rn[T.step]-Rn[F.step]||Hn[T.priority||"normal"]-Hn[F.priority||"normal"]),"sort"),h=S(($)=>{let F=!1;const T=S((E)=>{const y=K(E.name,E.aliases);if(y.includes($)){F=!0;for(let C of y)f.delete(C);return!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),F},"removeByName"),r=S(($)=>{let F=!1;const T=S((E)=>{if(E.middleware===$){F=!0;for(let y of K(E.name,E.aliases))f.delete(y);return!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),F},"removeByReference"),s=S(($)=>{var F;return n.forEach((T)=>{$.add(T.middleware,{...T})}),t.forEach((T)=>{$.addRelativeTo(T.middleware,{...T})}),(F=$.identifyOnResolve)==null||F.call($,o.identifyOnResolve()),$},"cloneTo"),u=S(($)=>{const F=[];return $.before.forEach((T)=>{if(T.before.length===0&&T.after.length===0)F.push(T);else F.push(...u(T))}),F.push($),$.after.reverse().forEach((T)=>{if(T.before.length===0&&T.after.length===0)F.push(T);else F.push(...u(T))}),F},"expandRelativeMiddlewareList"),d=S(($=!1)=>{const F=[],T=[],E={};return n.forEach((C)=>{const w={...C,before:[],after:[]};for(let x of K(w.name,w.aliases))E[x]=w;F.push(w)}),t.forEach((C)=>{const w={...C,before:[],after:[]};for(let x of K(w.name,w.aliases))E[x]=w;T.push(w)}),T.forEach((C)=>{if(C.toMiddleware){const w=E[C.toMiddleware];if(w===void 0){if($)return;throw new Error(`${C.toMiddleware} is not found when adding ${G(C.name,C.aliases)} middleware ${C.relation} ${C.toMiddleware}`)}if(C.relation==="after")w.after.push(C);if(C.relation==="before")w.before.push(C)}}),i(F).map(u).reduce((C,w)=>{return C.push(...w),C},[])},"getMiddlewareList"),o={add:($,F={})=>{const{name:T,override:E,aliases:y}=F,C={step:"initialize",priority:"normal",middleware:$,...F},w=K(T,y);if(w.length>0){if(w.some((x)=>f.has(x))){if(!E)throw new Error(`Duplicate middleware name '${G(T,y)}'`);for(let x of w){const I=n.findIndex((g)=>{var V;return g.name===x||((V=g.aliases)==null?void 0:V.some((M)=>M===x))});if(I===-1)continue;const U=n[I];if(U.step!==C.step||C.priority!==U.priority)throw new Error(`"${G(U.name,U.aliases)}" middleware with ${U.priority} priority in ${U.step} step cannot be overridden by "${G(T,y)}" middleware with ${C.priority} priority in ${C.step} step.`);n.splice(I,1)}}for(let x of w)f.add(x)}n.push(C)},addRelativeTo:($,F)=>{const{name:T,override:E,aliases:y}=F,C={middleware:$,...F},w=K(T,y);if(w.length>0){if(w.some((x)=>f.has(x))){if(!E)throw new Error(`Duplicate middleware name '${G(T,y)}'`);for(let x of w){const I=t.findIndex((g)=>{var V;return g.name===x||((V=g.aliases)==null?void 0:V.some((M)=>M===x))});if(I===-1)continue;const U=t[I];if(U.toMiddleware!==C.toMiddleware||U.relation!==C.relation)throw new Error(`"${G(U.name,U.aliases)}" middleware ${U.relation} "${U.toMiddleware}" middleware cannot be overridden by "${G(T,y)}" middleware ${C.relation} "${C.toMiddleware}" middleware.`);t.splice(I,1)}}for(let x of w)f.add(x)}t.push(C)},clone:()=>s(Tn()),use:($)=>{$.applyToStack(o)},remove:($)=>{if(typeof $==="string")return h($);else return r($)},removeByTag:($)=>{let F=!1;const T=S((E)=>{const{tags:y,name:C,aliases:w}=E;if(y&&y.includes($)){const x=K(C,w);for(let I of x)f.delete(I);return F=!0,!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),F},concat:($)=>{var F;const T=s(Tn());return T.use($),T.identifyOnResolve(c||T.identifyOnResolve()||(((F=$.identifyOnResolve)==null?void 0:F.call($))??!1)),T},applyToStack:s,identify:()=>{return d(!0).map(($)=>{const F=$.step??$.relation+" "+$.toMiddleware;return G($.name,$.aliases)+" - "+F})},identifyOnResolve($){if(typeof $==="boolean")c=$;return c},resolve:($,F)=>{for(let T of d().map((E)=>E.middleware).reverse())$=T($,F);if(c)console.log(o.identify());return $}};return o},"constructStack"),Rn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Hn={high:3,normal:2,low:1}});var tt=D((Qr,nt)=>{var{defineProperty:p,getOwnPropertyDescriptor:gf,getOwnPropertyNames:Yf}=Object,Sf=Object.prototype.hasOwnProperty,ef=(n,t)=>p(n,"name",{value:t,configurable:!0}),zf=(n,t)=>{for(var c in t)p(n,c,{get:t[c],enumerable:!0})},Zf=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Yf(t))if(!Sf.call(n,i)&&i!==c)p(n,i,{get:()=>t[i],enumerable:!(f=gf(t,i))||f.enumerable})}return n},Vf=(n)=>Zf(p({},"__esModule",{value:!0}),n),_n={};zf(_n,{isArrayBuffer:()=>Gf});nt.exports=Vf(_n);var Gf=ef((n)=>typeof ArrayBuffer==="function"&&n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]","isArrayBuffer")});var B=D((Mr,it)=>{var{defineProperty:v,getOwnPropertyDescriptor:Qf,getOwnPropertyNames:Mf}=Object,Kf=Object.prototype.hasOwnProperty,ct=(n,t)=>v(n,"name",{value:t,configurable:!0}),Xf=(n,t)=>{for(var c in t)v(n,c,{get:t[c],enumerable:!0})},Af=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Mf(t))if(!Kf.call(n,i)&&i!==c)v(n,i,{get:()=>t[i],enumerable:!(f=Qf(t,i))||f.enumerable})}return n},Jf=(n)=>Af(v({},"__esModule",{value:!0}),n),ft={};Xf(ft,{fromArrayBuffer:()=>bf,fromString:()=>Bf});it.exports=Jf(ft);var Wf=tt(),dn=import.meta.require("buffer"),bf=ct((n,t=0,c=n.byteLength-t)=>{if(!Wf.isArrayBuffer(n))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof n} (${n})`);return dn.Buffer.from(n,t,c)},"fromArrayBuffer"),Bf=ct((n,t)=>{if(typeof n!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof n} (${n})`);return t?dn.Buffer.from(n,t):dn.Buffer.from(n)},"fromString")});var st=D((ht)=>{Object.defineProperty(ht,"__esModule",{value:!0});ht.fromBase64=void 0;var jf=B(),Rf=/^[A-Za-z0-9+/]*={0,2}$/,Hf=(n)=>{if(n.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Rf.exec(n))throw new TypeError("Invalid base64 string.");const t=jf.fromString(n,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};ht.fromBase64=Hf});var a=D((Xr,Tt)=>{var{defineProperty:q,getOwnPropertyDescriptor:Pf,getOwnPropertyNames:kf}=Object,Of=Object.prototype.hasOwnProperty,Fn=(n,t)=>q(n,"name",{value:t,configurable:!0}),lf=(n,t)=>{for(var c in t)q(n,c,{get:t[c],enumerable:!0})},pf=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of kf(t))if(!Of.call(n,i)&&i!==c)q(n,i,{get:()=>t[i],enumerable:!(f=Pf(t,i))||f.enumerable})}return n},vf=(n)=>pf(q({},"__esModule",{value:!0}),n),ut={};lf(ut,{fromUtf8:()=>$t,toUint8Array:()=>qf,toUtf8:()=>af});Tt.exports=vf(ut);var wt=B(),$t=Fn((n)=>{const t=wt.fromString(n,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),qf=Fn((n)=>{if(typeof n==="string")return $t(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(n)},"toUint8Array"),af=Fn((n)=>{if(typeof n==="string")return n;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return wt.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("utf8")},"toUtf8")});var Ft=D((xt)=>{Object.defineProperty(xt,"__esModule",{value:!0});xt.toBase64=void 0;var mf=B(),_f=a(),ni=(n)=>{let t;if(typeof n==="string")t=_f.fromUtf8(n);else t=n;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return mf.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("base64")};xt.toBase64=ni});var _=D((Jr,m)=>{var{defineProperty:Ct,getOwnPropertyDescriptor:ti,getOwnPropertyNames:ci}=Object,fi=Object.prototype.hasOwnProperty,Cn=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of ci(t))if(!fi.call(n,i)&&i!==c)Ct(n,i,{get:()=>t[i],enumerable:!(f=ti(t,i))||f.enumerable})}return n},ot=(n,t,c)=>(Cn(n,t,"default"),c&&Cn(c,t,"default")),ii=(n)=>Cn(Ct({},"__esModule",{value:!0}),n),on={};m.exports=ii(on);ot(on,st(),m.exports);ot(on,Ft(),m.exports)});var It=D((Et)=>{Object.defineProperty(Et,"__esModule",{value:!0});Et.getAwsChunkedEncodingStream=void 0;var hi=import.meta.require("stream"),ri=(n,t)=>{const{base64Encoder:c,bodyLengthChecker:f,checksumAlgorithmFn:i,checksumLocationName:h,streamHasher:r}=t,s=c!==void 0&&i!==void 0&&h!==void 0&&r!==void 0,u=s?r(i,n):void 0,d=new hi.Readable({read:()=>{}});return n.on("data",(o)=>{const $=f(o)||0;d.push(`${$.toString(16)}\r\n`),d.push(o),d.push("\r\n")}),n.on("end",async()=>{if(d.push("0\r\n"),s){const o=c(await u);d.push(`${h}:${o}\r\n`),d.push("\r\n")}d.push(null)}),d};Et.getAwsChunkedEncodingStream=ri});var En=D((br,zt)=>{var Yt=function(n){return Object.keys(n).reduce((t,c)=>{const f=n[c];return{...t,[c]:Array.isArray(f)?[...f]:f}},{})},et=function(n){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(n)},nn=Object.defineProperty,si=Object.getOwnPropertyDescriptor,ui=Object.getOwnPropertyNames,wi=Object.prototype.hasOwnProperty,Q=(n,t)=>nn(n,"name",{value:t,configurable:!0}),$i=(n,t)=>{for(var c in t)nn(n,c,{get:t[c],enumerable:!0})},Ti=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of ui(t))if(!wi.call(n,i)&&i!==c)nn(n,i,{get:()=>t[i],enumerable:!(f=si(t,i))||f.enumerable})}return n},xi=(n)=>Ti(nn({},"__esModule",{value:!0}),n),Ut={};$i(Ut,{Field:()=>Ci,Fields:()=>oi,HttpRequest:()=>Ei,HttpResponse:()=>yi,IHttpRequest:()=>Lt.HttpRequest,getHttpHandlerExtensionConfiguration:()=>di,isValidHostname:()=>et,resolveHttpHandlerRuntimeConfig:()=>Fi});zt.exports=xi(Ut);var di=Q((n)=>{let t=n.httpHandler;return{setHttpHandler(c){t=c},httpHandler(){return t},updateHttpClientConfig(c,f){t.updateHttpClientConfig(c,f)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),Fi=Q((n)=>{return{httpHandler:n.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),Lt=l(),Dt=class n{constructor({name:t,kind:c=Lt.FieldPosition.HEADER,values:f=[]}){this.name=t,this.kind=c,this.values=f}add(t){this.values.push(t)}set(t){this.values=t}remove(t){this.values=this.values.filter((c)=>c!==t)}toString(){return this.values.map((t)=>t.includes(",")||t.includes(" ")?`"${t}"`:t).join(", ")}get(){return this.values}};Q(Dt,"Field");var Ci=Dt,Nt=class n{constructor({fields:t=[],encoding:c="utf-8"}){this.entries={},t.forEach(this.setField.bind(this)),this.encoding=c}setField(t){this.entries[t.name.toLowerCase()]=t}getField(t){return this.entries[t.toLowerCase()]}removeField(t){delete this.entries[t.toLowerCase()]}getByType(t){return Object.values(this.entries).filter((c)=>c.kind===t)}};Q(Nt,"Fields");var oi=Nt,gt=class n{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const c=new n({...t,headers:{...t.headers}});if(c.query)c.query=Yt(c.query);return c}static isInstance(t){if(!t)return!1;const c=t;return"method"in c&&"protocol"in c&&"hostname"in c&&"path"in c&&typeof c.query==="object"&&typeof c.headers==="object"}clone(){return n.clone(this)}};Q(gt,"HttpRequest");var Ei=gt;Q(Yt,"cloneQuery");var St=class n{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const c=t;return typeof c.statusCode==="number"&&typeof c.headers==="object"}};Q(St,"HttpResponse");var yi=St;Q(et,"isValidHostname")});var In=D((Br,Gt)=>{var{defineProperty:tn,getOwnPropertyDescriptor:Ii,getOwnPropertyNames:Ui}=Object,Li=Object.prototype.hasOwnProperty,yn=(n,t)=>tn(n,"name",{value:t,configurable:!0}),Di=(n,t)=>{for(var c in t)tn(n,c,{get:t[c],enumerable:!0})},Ni=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Ui(t))if(!Li.call(n,i)&&i!==c)tn(n,i,{get:()=>t[i],enumerable:!(f=Ii(t,i))||f.enumerable})}return n},gi=(n)=>Ni(tn({},"__esModule",{value:!0}),n),Zt={};Di(Zt,{escapeUri:()=>Vt,escapeUriPath:()=>Si});Gt.exports=gi(Zt);var Vt=yn((n)=>encodeURIComponent(n).replace(/[!'()*]/g,Yi),"escapeUri"),Yi=yn((n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Si=yn((n)=>n.split("/").map(Vt).join("/"),"escapeUriPath")});var Ln=D((jr,Kt)=>{var Mt=function(n){const t=[];for(let c of Object.keys(n).sort()){const f=n[c];if(c=Un.escapeUri(c),Array.isArray(f))for(let i=0,h=f.length;i<h;i++)t.push(`${c}=${Un.escapeUri(f[i])}`);else{let i=c;if(f||typeof f==="string")i+=`=${Un.escapeUri(f)}`;t.push(i)}}return t.join("&")},cn=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,zi=Object.getOwnPropertyNames,Zi=Object.prototype.hasOwnProperty,Vi=(n,t)=>cn(n,"name",{value:t,configurable:!0}),Gi=(n,t)=>{for(var c in t)cn(n,c,{get:t[c],enumerable:!0})},Qi=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of zi(t))if(!Zi.call(n,i)&&i!==c)cn(n,i,{get:()=>t[i],enumerable:!(f=ei(t,i))||f.enumerable})}return n},Mi=(n)=>Qi(cn({},"__esModule",{value:!0}),n),Qt={};Gi(Qt,{buildQueryString:()=>Mt});Kt.exports=Mi(Qt);var Un=In();Vi(Mt,"buildQueryString")});var at=D((Rr,qt)=>{async function gn(n,t,c=Xt){const f=t.headers??{},i=f.Expect||f.expect;let h=-1,r=!1;if(i==="100-continue")await Promise.race([new Promise((s)=>{h=Number(setTimeout(s,Math.max(Xt,c)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(h),s()}),n.on("error",()=>{r=!0,clearTimeout(h),s()})})]);if(!r)Ht(n,t.body)}var Ht=function(n,t){if(t instanceof Rt.Readable){t.pipe(n);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){n.end(t);return}const c=t;if(typeof c==="object"&&c.buffer&&typeof c.byteOffset==="number"&&typeof c.byteLength==="number"){n.end(Buffer.from(c.buffer,c.byteOffset,c.byteLength));return}n.end(Buffer.from(t));return}n.end()};async function vt(n){const t=[],c=n.getReader();let f=!1,i=0;while(!f){const{done:s,value:u}=await c.read();if(u)t.push(u),i+=u.length;f=s}const h=new Uint8Array(i);let r=0;for(let s of t)h.set(s,r),r+=s.length;return h}var{create:Ki,defineProperty:j,getOwnPropertyDescriptor:Xi,getOwnPropertyNames:Ai,getPrototypeOf:Ji}=Object,Wi=Object.prototype.hasOwnProperty,N=(n,t)=>j(n,"name",{value:t,configurable:!0}),bi=(n,t)=>{for(var c in t)j(n,c,{get:t[c],enumerable:!0})},Jt=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Ai(t))if(!Wi.call(n,i)&&i!==c)j(n,i,{get:()=>t[i],enumerable:!(f=Xi(t,i))||f.enumerable})}return n},Bi=(n,t,c)=>(c=n!=null?Ki(Ji(n)):{},Jt(t||!n||!n.__esModule?j(c,"default",{value:n,enumerable:!0}):c,n)),ji=(n)=>Jt(j({},"__esModule",{value:!0}),n),Wt={};bi(Wt,{DEFAULT_REQUEST_TIMEOUT:()=>Oi,NodeHttp2Handler:()=>ai,NodeHttpHandler:()=>li,streamCollector:()=>_i});qt.exports=ji(Wt);var bt=En(),Bt=Ln(),Dn=import.meta.require("http"),Nn=import.meta.require("https"),Ri=["ECONNRESET","EPIPE","ETIMEDOUT"],jt=N((n)=>{const t={};for(let c of Object.keys(n)){const f=n[c];t[c]=Array.isArray(f)?f.join(","):f}return t},"getTransformedHeaders"),Hi=N((n,t,c=0)=>{if(!c)return;const f=setTimeout(()=>{n.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${c} ms`),{name:"TimeoutError"}))},c);n.on("socket",(i)=>{if(i.connecting)i.on("connect",()=>{clearTimeout(f)});else clearTimeout(f)})},"setConnectionTimeout"),Pi=N((n,{keepAlive:t,keepAliveMsecs:c})=>{if(t!==!0)return;n.on("socket",(f)=>{f.setKeepAlive(t,c||0)})},"setSocketKeepAlive"),ki=N((n,t,c=0)=>{n.setTimeout(c,()=>{n.destroy(),t(Object.assign(new Error(`Connection timed out after ${c} ms`),{name:"TimeoutError"}))})},"setSocketTimeout"),Rt=import.meta.require("stream"),Xt=1000;N(gn,"writeRequestBody");N(Ht,"writeBody");var Oi=0,Pt=class n{constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((c,f)=>{if(typeof t==="function")t().then((i)=>{c(this.resolveDefaultConfig(i))}).catch(f);else c(this.resolveDefaultConfig(t))})}static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}static checkSocketUsage(t,c,f=console){var i,h,r;const{sockets:s,requests:u,maxSockets:d}=t;if(typeof d!=="number"||d===Infinity)return c;const o=15000;if(Date.now()-o<c)return c;if(s&&u)for(let $ in s){const F=((i=s[$])==null?void 0:i.length)??0,T=((h=u[$])==null?void 0:h.length)??0;if(F>=d&&T>=2*d)return(r=f==null?void 0:f.warn)==null||r.call(f,`@smithy/node-http-handler:WARN - socket usage at capacity=${F} and ${T} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return c}resolveDefaultConfig(t){const{requestTimeout:c,connectionTimeout:f,socketTimeout:i,httpAgent:h,httpsAgent:r}=t||{};return{connectionTimeout:f,requestTimeout:c??i,httpAgent:(()=>{if(h instanceof Dn.Agent||typeof(h==null?void 0:h.destroy)==="function")return h;return new Dn.Agent({keepAlive:!0,maxSockets:50,...h})})(),httpsAgent:(()=>{if(r instanceof Nn.Agent||typeof(r==null?void 0:r.destroy)==="function")return r;return new Nn.Agent({keepAlive:!0,maxSockets:50,...r})})(),logger:console}}destroy(){var t,c,f,i;(c=(t=this.config)==null?void 0:t.httpAgent)==null||c.destroy(),(i=(f=this.config)==null?void 0:f.httpsAgent)==null||i.destroy()}async handle(t,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;let f;return new Promise((i,h)=>{let r=void 0;const s=N(async(x)=>{await r,clearTimeout(f),i(x)},"resolve"),u=N(async(x)=>{await r,clearTimeout(f),h(x)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(c==null?void 0:c.aborted){const x=new Error("Request aborted");x.name="AbortError",u(x);return}const d=t.protocol==="https:",o=d?this.config.httpsAgent:this.config.httpAgent;f=setTimeout(()=>{this.socketWarningTimestamp=n.checkSocketUsage(o,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const $=Bt.buildQueryString(t.query||{});let F=void 0;if(t.username!=null||t.password!=null){const x=t.username??"",I=t.password??"";F=`${x}:${I}`}let T=t.path;if($)T+=`?${$}`;if(t.fragment)T+=`#${t.fragment}`;const E={headers:t.headers,host:t.hostname,method:t.method,path:T,port:t.port,agent:o,auth:F},C=(d?Nn.request:Dn.request)(E,(x)=>{const I=new bt.HttpResponse({statusCode:x.statusCode||-1,reason:x.statusMessage,headers:jt(x.headers),body:x});s({response:I})});if(C.on("error",(x)=>{if(Ri.includes(x.code))u(Object.assign(x,{name:"TimeoutError"}));else u(x)}),Hi(C,u,this.config.connectionTimeout),ki(C,u,this.config.requestTimeout),c){const x=N(()=>{C.destroy();const I=new Error("Request aborted");I.name="AbortError",u(I)},"onAbort");if(typeof c.addEventListener==="function"){const I=c;I.addEventListener("abort",x,{once:!0}),C.once("close",()=>I.removeEventListener("abort",x))}else c.onabort=x}const w=E.agent;if(typeof w==="object"&&"keepAlive"in w)Pi(C,{keepAlive:w.keepAlive,keepAliveMsecs:w.keepAliveMsecs});r=gn(C,t,this.config.requestTimeout).catch((x)=>{return clearTimeout(f),h(x)})})}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return{...f,[t]:c}})}httpHandlerConfigs(){return this.config??{}}};N(Pt,"NodeHttpHandler");var li=Pt,At=import.meta.require("http2"),pi=Bi(import.meta.require("http2")),kt=class n{constructor(t){this.sessions=[],this.sessions=t??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(t){this.sessions.push(t)}contains(t){return this.sessions.includes(t)}remove(t){this.sessions=this.sessions.filter((c)=>c!==t)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(t){for(let c of this.sessions)if(c===t){if(!c.destroyed)c.destroy()}}};N(kt,"NodeHttp2ConnectionPool");var vi=kt,Ot=class n{constructor(t){if(this.sessionCache=new Map,this.config=t,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(t,c){const f=this.getUrlString(t),i=this.sessionCache.get(f);if(i){const u=i.poll();if(u&&!this.config.disableConcurrency)return u}const h=pi.default.connect(f);if(this.config.maxConcurrency)h.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+t.destination.toString())});h.unref();const r=N(()=>{h.destroy(),this.deleteSession(f,h)},"destroySessionCb");if(h.on("goaway",r),h.on("error",r),h.on("frameError",r),h.on("close",()=>this.deleteSession(f,h)),c.requestTimeout)h.setTimeout(c.requestTimeout,r);const s=this.sessionCache.get(f)||new vi;return s.offerLast(h),this.sessionCache.set(f,s),h}deleteSession(t,c){const f=this.sessionCache.get(t);if(!f)return;if(!f.contains(c))return;f.remove(c),this.sessionCache.set(t,f)}release(t,c){var f;const i=this.getUrlString(t);(f=this.sessionCache.get(i))==null||f.offerLast(c)}destroy(){for(let[t,c]of this.sessionCache){for(let f of c){if(!f.destroyed)f.destroy();c.remove(f)}this.sessionCache.delete(t)}}setMaxConcurrentStreams(t){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=t}setDisableConcurrentStreams(t){this.config.disableConcurrency=t}getUrlString(t){return t.destination.toString()}};N(Ot,"NodeHttp2ConnectionManager");var qi=Ot,lt=class n{constructor(t){this.metadata={handlerProtocol:"h2"},this.connectionManager=new qi({}),this.configProvider=new Promise((c,f)=>{if(typeof t==="function")t().then((i)=>{c(i||{})}).catch(f);else c(t||{})})}static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}destroy(){this.connectionManager.destroy()}async handle(t,{abortSignal:c}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:f,disableConcurrentStreams:i}=this.config;return new Promise((h,r)=>{var s;let u=!1,d=void 0;const o=N(async(L)=>{await d,h(L)},"resolve"),$=N(async(L)=>{await d,r(L)},"reject");if(c==null?void 0:c.aborted){u=!0;const L=new Error("Request aborted");L.name="AbortError",$(L);return}const{hostname:F,method:T,port:E,protocol:y,query:C}=t;let w="";if(t.username!=null||t.password!=null){const L=t.username??"",e=t.password??"";w=`${L}:${e}@`}const x=`${y}//${w}${F}${E?`:${E}`:""}`,I={destination:new URL(x)},U=this.connectionManager.lease(I,{requestTimeout:(s=this.config)==null?void 0:s.sessionTimeout,disableConcurrentStreams:i||!1}),g=N((L)=>{if(i)this.destroySession(U);u=!0,$(L)},"rejectWithDestroy"),V=Bt.buildQueryString(C||{});let M=t.path;if(V)M+=`?${V}`;if(t.fragment)M+=`#${t.fragment}`;const Y=U.request({...t.headers,[At.constants.HTTP2_HEADER_PATH]:M,[At.constants.HTTP2_HEADER_METHOD]:T});if(U.ref(),Y.on("response",(L)=>{const e=new bt.HttpResponse({statusCode:L[":status"]||-1,headers:jt(L),body:Y});if(u=!0,o({response:e}),i)U.close(),this.connectionManager.deleteSession(x,U)}),f)Y.setTimeout(f,()=>{Y.close();const L=new Error(`Stream timed out because of no activity for ${f} ms`);L.name="TimeoutError",g(L)});if(c){const L=N(()=>{Y.close();const e=new Error("Request aborted");e.name="AbortError",g(e)},"onAbort");if(typeof c.addEventListener==="function"){const e=c;e.addEventListener("abort",L,{once:!0}),Y.once("close",()=>e.removeEventListener("abort",L))}else c.onabort=L}Y.on("frameError",(L,e,Cf)=>{g(new Error(`Frame type id ${L} in stream id ${Cf} has failed with code ${e}.`))}),Y.on("error",g),Y.on("aborted",()=>{g(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${Y.rstCode}.`))}),Y.on("close",()=>{if(U.unref(),i)U.destroy();if(!u)g(new Error("Unexpected error: http2 request did not get a response"))}),d=gn(Y,t,f)})}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return{...f,[t]:c}})}httpHandlerConfigs(){return this.config??{}}destroySession(t){if(!t.destroyed)t.destroy()}};N(lt,"NodeHttp2Handler");var ai=lt,pt=class n extends Rt.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,c,f){this.bufferedBytes.push(t),f()}};N(pt,"Collector");var mi=pt,_i=N((n)=>{if(nh(n))return vt(n);return new Promise((t,c)=>{const f=new mi;n.pipe(f),n.on("error",(i)=>{f.end(),c(i)}),f.on("error",c),f.on("finish",function(){const i=new Uint8Array(Buffer.concat(this.bufferedBytes));t(i)})})},"streamCollector"),nh=N((n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream,"isReadableStreamInstance");N(vt,"collectReadableStream")});var rc=D((Hr,hc)=>{var nc=function(n=0){return new Promise((t,c)=>{if(n)setTimeout(()=>{const f=new Error(`Request did not complete within ${n} ms`);f.name="TimeoutError",c(f)},n)})};async function cc(n){const t=await ic(n),c=wh.fromBase64(t);return new Uint8Array(c)}async function fc(n){const t=[],c=n.getReader();let f=!1,i=0;while(!f){const{done:s,value:u}=await c.read();if(u)t.push(u),i+=u.length;f=s}const h=new Uint8Array(i);let r=0;for(let s of t)h.set(s,r),r+=s.length;return h}var ic=function(n){return new Promise((t,c)=>{const f=new FileReader;f.onloadend=()=>{if(f.readyState!==2)return c(new Error("Reader aborted too early"));const i=f.result??"",h=i.indexOf(","),r=h>-1?h+1:i.length;t(i.substring(r))},f.onabort=()=>c(new Error("Read aborted")),f.onerror=()=>c(f.error),f.readAsDataURL(n)})},hn=Object.defineProperty,th=Object.getOwnPropertyDescriptor,ch=Object.getOwnPropertyNames,fh=Object.prototype.hasOwnProperty,Z=(n,t)=>hn(n,"name",{value:t,configurable:!0}),ih=(n,t)=>{for(var c in t)hn(n,c,{get:t[c],enumerable:!0})},hh=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of ch(t))if(!fh.call(n,i)&&i!==c)hn(n,i,{get:()=>t[i],enumerable:!(f=th(t,i))||f.enumerable})}return n},rh=(n)=>hh(hn({},"__esModule",{value:!0}),n),_t={};ih(_t,{FetchHttpHandler:()=>uh,keepAliveSupport:()=>fn,streamCollector:()=>$h});hc.exports=rh(_t);var mt=En(),sh=Ln();Z(nc,"requestTimeout");var fn={supported:void 0},tc=class n{static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}constructor(t){if(typeof t==="function")this.configProvider=t().then((c)=>c||{});else this.config=t??{},this.configProvider=Promise.resolve(this.config);if(fn.supported===void 0)fn.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(t,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;const f=this.config.requestTimeout,i=this.config.keepAlive===!0,h=this.config.credentials;if(c==null?void 0:c.aborted){const w=new Error("Request aborted");return w.name="AbortError",Promise.reject(w)}let r=t.path;const s=sh.buildQueryString(t.query||{});if(s)r+=`?${s}`;if(t.fragment)r+=`#${t.fragment}`;let u="";if(t.username!=null||t.password!=null){const w=t.username??"",x=t.password??"";u=`${w}:${x}@`}const{port:d,method:o}=t,$=`${t.protocol}//${u}${t.hostname}${d?`:${d}`:""}${r}`,F=o==="GET"||o==="HEAD"?void 0:t.body,T={body:F,headers:new Headers(t.headers),method:o,credentials:h};if(F)T.duplex="half";if(typeof AbortController!=="undefined")T.signal=c;if(fn.supported)T.keepalive=i;let E=Z(()=>{},"removeSignalEventListener");const y=new Request($,T),C=[fetch(y).then((w)=>{const x=w.headers,I={};for(let g of x.entries())I[g[0]]=g[1];if(w.body==null)return w.blob().then((g)=>({response:new mt.HttpResponse({headers:I,reason:w.statusText,statusCode:w.status,body:g})}));return{response:new mt.HttpResponse({headers:I,reason:w.statusText,statusCode:w.status,body:w.body})}}),nc(f)];if(c)C.push(new Promise((w,x)=>{const I=Z(()=>{const U=new Error("Request aborted");U.name="AbortError",x(U)},"onAbort");if(typeof c.addEventListener==="function"){const U=c;U.addEventListener("abort",I,{once:!0}),E=Z(()=>U.removeEventListener("abort",I),"removeSignalEventListener")}else c.onabort=I}));return Promise.race(C).finally(E)}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return f[t]=c,f})}httpHandlerConfigs(){return this.config??{}}};Z(tc,"FetchHttpHandler");var uh=tc,wh=_(),$h=Z((n)=>{if(typeof Blob==="function"&&n instanceof Blob)return cc(n);return fc(n)},"streamCollector");Z(cc,"collectBlob");Z(fc,"collectStream");Z(ic,"readToBase64")});var dc=D((Pr,xc)=>{var $c=function(n){if(n.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(n.length/2);for(let c=0;c<n.length;c+=2){const f=n.slice(c,c+2).toLowerCase();if(f in Yn)t[c/2]=Yn[f];else throw new Error(`Cannot decode unrecognized sequence ${f} as hexadecimal`)}return t},Tc=function(n){let t="";for(let c=0;c<n.byteLength;c++)t+=wc[n[c]];return t},rn=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,xh=Object.getOwnPropertyNames,dh=Object.prototype.hasOwnProperty,sc=(n,t)=>rn(n,"name",{value:t,configurable:!0}),Fh=(n,t)=>{for(var c in t)rn(n,c,{get:t[c],enumerable:!0})},Ch=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of xh(t))if(!dh.call(n,i)&&i!==c)rn(n,i,{get:()=>t[i],enumerable:!(f=Th(t,i))||f.enumerable})}return n},oh=(n)=>Ch(rn({},"__esModule",{value:!0}),n),uc={};Fh(uc,{fromHex:()=>$c,toHex:()=>Tc});xc.exports=oh(uc);var wc={},Yn={};for(let n=0;n<256;n++){let t=n.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;wc[n]=t,Yn[t]=n}sc($c,"fromHex");sc(Tc,"toHex")});var R=D((Fc)=>{Object.defineProperty(Fc,"__esModule",{value:!0});Fc.isReadableStream=void 0;var Eh=(n)=>{var t;return typeof ReadableStream==="function"&&(((t=n===null||n===void 0?void 0:n.constructor)===null||t===void 0?void 0:t.name)===ReadableStream.name||n instanceof ReadableStream)};Fc.isReadableStream=Eh});var Lc=D((Ic)=>{Object.defineProperty(Ic,"__esModule",{value:!0});Ic.sdkStreamMixin=void 0;var yh=rc(),Ih=_(),Uh=dc(),Lh=a(),oc=R(),Ec="The stream has already been transformed.",Dh=(n)=>{var t,c;if(!yc(n)&&!oc.isReadableStream(n)){const r=((c=(t=n===null||n===void 0?void 0:n.__proto__)===null||t===void 0?void 0:t.constructor)===null||c===void 0?void 0:c.name)||n;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let f=!1;const i=async()=>{if(f)throw new Error(Ec);return f=!0,await yh.streamCollector(n)},h=(r)=>{if(typeof r.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return r.stream()};return Object.assign(n,{transformToByteArray:i,transformToString:async(r)=>{const s=await i();if(r==="base64")return Ih.toBase64(s);else if(r==="hex")return Uh.toHex(s);else if(r===void 0||r==="utf8"||r==="utf-8")return Lh.toUtf8(s);else if(typeof TextDecoder==="function")return new TextDecoder(r).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(f)throw new Error(Ec);if(f=!0,yc(n))return h(n);else if(oc.isReadableStream(n))return n;else throw new Error(`Cannot transform payload to web stream, got ${n}`)}})};Ic.sdkStreamMixin=Dh;var yc=(n)=>typeof Blob==="function"&&n instanceof Blob});var Yc=D((Nc)=>{Object.defineProperty(Nc,"__esModule",{value:!0});Nc.sdkStreamMixin=void 0;var Nh=at(),gh=B(),Sn=import.meta.require("stream"),Yh=import.meta.require("util"),Sh=Lc(),Dc="The stream has already been transformed.",eh=(n)=>{var t,c;if(!(n instanceof Sn.Readable))try{return Sh.sdkStreamMixin(n)}catch(h){const r=((c=(t=n===null||n===void 0?void 0:n.__proto__)===null||t===void 0?void 0:t.constructor)===null||c===void 0?void 0:c.name)||n;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let f=!1;const i=async()=>{if(f)throw new Error(Dc);return f=!0,await Nh.streamCollector(n)};return Object.assign(n,{transformToByteArray:i,transformToString:async(h)=>{const r=await i();if(h===void 0||Buffer.isEncoding(h))return gh.fromArrayBuffer(r.buffer,r.byteOffset,r.byteLength).toString(h);else return new Yh.TextDecoder(h).decode(r)},transformToWebStream:()=>{if(f)throw new Error(Dc);if(n.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Sn.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return f=!0,Sn.Readable.toWeb(n)}})};Nc.sdkStreamMixin=eh});var zc=D((Sc)=>{async function zh(n){if(typeof n.stream==="function")n=n.stream();return n.tee()}Object.defineProperty(Sc,"__esModule",{value:!0});Sc.splitStream=void 0;Sc.splitStream=zh});var Qc=D((Vc)=>{async function Gh(n){if(Vh.isReadableStream(n))return Zh.splitStream(n);const t=new Zc.PassThrough,c=new Zc.PassThrough;return n.pipe(t),n.pipe(c),[t,c]}Object.defineProperty(Vc,"__esModule",{value:!0});Vc.splitStream=void 0;var Zc=import.meta.require("stream"),Zh=zc(),Vh=R();Vc.splitStream=Gh});var Xc=D((Mc)=>{async function Qh(n,t){var c;let f=0;const i=[],h=n.getReader();let r=!1;while(!r){const{done:d,value:o}=await h.read();if(o)i.push(o),f+=(c=o===null||o===void 0?void 0:o.byteLength)!==null&&c!==void 0?c:0;if(f>=t)break;r=d}h.releaseLock();const s=new Uint8Array(Math.min(t,f));let u=0;for(let d of i){if(d.byteLength>s.byteLength-u){s.set(d.subarray(0,s.byteLength-u),u);break}else s.set(d,u);u+=d.length}return s}Object.defineProperty(Mc,"__esModule",{value:!0});Mc.headStream=void 0;Mc.headStream=Qh});var bc=D((Jc)=>{Object.defineProperty(Jc,"__esModule",{value:!0});Jc.headStream=void 0;var Mh=import.meta.require("stream"),Kh=Xc(),Xh=R(),Ah=(n,t)=>{if(Xh.isReadableStream(n))return Kh.headStream(n,t);return new Promise((c,f)=>{const i=new Ac;i.limit=t,n.pipe(i),n.on("error",(h)=>{i.end(),f(h)}),i.on("error",f),i.on("finish",function(){const h=new Uint8Array(Buffer.concat(this.buffers));c(h)})})};Jc.headStream=Ah;class Ac extends Mh.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(n,t,c){var f;if(this.buffers.push(n),this.bytesBuffered+=(f=n.byteLength)!==null&&f!==void 0?f:0,this.bytesBuffered>=this.limit){const i=this.bytesBuffered-this.limit,h=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=h.subarray(0,h.byteLength-i),this.emit("finish")}c()}}});var kc=D((mr,J)=>{var Rc=function(n,t="utf-8"){if(t==="base64")return Bc.toBase64(n);return jc.toUtf8(n)},Hc=function(n,t){if(t==="base64")return zn.mutate(Bc.fromBase64(n));return zn.mutate(jc.fromUtf8(n))},sn=Object.defineProperty,Jh=Object.getOwnPropertyDescriptor,Wh=Object.getOwnPropertyNames,bh=Object.prototype.hasOwnProperty,Zn=(n,t)=>sn(n,"name",{value:t,configurable:!0}),Bh=(n,t)=>{for(var c in t)sn(n,c,{get:t[c],enumerable:!0})},en=(n,t,c,f)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of Wh(t))if(!bh.call(n,i)&&i!==c)sn(n,i,{get:()=>t[i],enumerable:!(f=Jh(t,i))||f.enumerable})}return n},H=(n,t,c)=>(en(n,t,"default"),c&&en(c,t,"default")),jh=(n)=>en(sn({},"__esModule",{value:!0}),n),A={};Bh(A,{Uint8ArrayBlobAdapter:()=>zn});J.exports=jh(A);var Bc=_(),jc=a();Zn(Rc,"transformToString");Zn(Hc,"transformFromString");var Pc=class n extends Uint8Array{static fromString(t,c="utf-8"){switch(typeof t){case"string":return Hc(t,c);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,n.prototype),t}transformToString(t="utf-8"){return Rc(this,t)}};Zn(Pc,"Uint8ArrayBlobAdapter");var zn=Pc;H(A,It(),J.exports);H(A,Yc(),J.exports);H(A,Qc(),J.exports);H(A,bc(),J.exports);H(A,R(),J.exports)});var On=X(xn(),1);class Df{constructor(n){this.middlewareStack=On.constructStack(),this.config=n}send(n,t,c){const f=typeof t!=="function"?t:void 0,i=typeof t==="function"?t:c,h=n.resolveMiddleware(this.middlewareStack,this.config,f);if(i)h(n).then((r)=>i(null,r.output),(r)=>i(r)).catch(()=>{});else return h(n).then((r)=>r.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var ln=X(xn(),1),pn=X(l(),1);class vn{constructor(){this.middlewareStack=ln.constructStack()}static classBuilder(){return new qn}resolveMiddlewareWithContext(n,t,c,{middlewareFn:f,clientName:i,commandName:h,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,smithyContext:u,additionalContext:d,CommandCtor:o}){for(let y of f.bind(this)(o,n,t,c))this.middlewareStack.use(y);const $=n.concat(this.middlewareStack),{logger:F}=t,T={logger:F,clientName:i,commandName:h,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,[pn.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...d},{requestHandler:E}=t;return $.resolve((y)=>E.handle(y.request,c||{}),T)}}class qn{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(n)=>n,this._outputFilterSensitiveLog=(n)=>n,this._serializer=null,this._deserializer=null}init(n){this._init=n}ep(n){return this._ep=n,this}m(n){return this._middlewareFn=n,this}s(n,t,c={}){return this._smithyContext={service:n,operation:t,...c},this}c(n={}){return this._additionalContext=n,this}n(n,t){return this._clientName=n,this._commandName=t,this}f(n=(c)=>c,t=(c)=>c){return this._inputFilterSensitiveLog=n,this._outputFilterSensitiveLog=t,this}ser(n){return this._serializer=n,this}de(n){return this._deserializer=n,this}build(){const n=this;let t;return t=class extends vn{static getEndpointParameterInstructions(){return n._ep}constructor(...[c]){super();this.serialize=n._serializer,this.deserialize=n._deserializer,this.input=c??{},n._init(this)}resolveMiddleware(c,f,i){return this.resolveMiddlewareWithContext(c,f,i,{CommandCtor:t,middlewareFn:n._middlewareFn,clientName:n._clientName,commandName:n._commandName,inputFilterSensitiveLog:n._inputFilterSensitiveLog,outputFilterSensitiveLog:n._outputFilterSensitiveLog,smithyContext:n._smithyContext,additionalContext:n._additionalContext})}}}}var Sr="***SensitiveInformation***";var zr=(n,t)=>{for(let c of Object.keys(n)){const f=n[c],i=async function(r,s,u){const d=new f(r);if(typeof s==="function")this.send(d,s);else if(typeof u==="function"){if(typeof s!=="object")throw new Error(`Expected http options but got ${typeof s}`);this.send(d,s||{},u)}else return this.send(d,s)},h=(c[0].toLowerCase()+c.slice(1)).replace(/Command$/,"");t.prototype[h]=i}};class an extends Error{constructor(n){super(n.message);Object.setPrototypeOf(this,an.prototype),this.name=n.name,this.$fault=n.$fault,this.$metadata=n.$metadata}}var mn=(n,t={})=>{Object.entries(t).filter(([,f])=>f!==void 0).forEach(([f,i])=>{if(n[f]==null||n[f]==="")n[f]=i});const c=n.message||n.Message||"UnknownError";return n.message=c,delete n.Message,n};class Nf{trace(){}debug(){}info(){}warn(){}error(){}}var un=X(kc(),1),_r=async(n=new Uint8Array,t)=>{if(n instanceof Uint8Array)return un.Uint8ArrayBlobAdapter.mutate(n);if(!n)return un.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const c=t.streamCollector(n);return un.Uint8ArrayBlobAdapter.mutate(await c)};var ts=(n)=>{switch(n){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${n}"`)}};var Rh=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string"){const t=parseFloat(n);if(!Number.isNaN(t)){if(String(t)!==String(n))_c.warn(mc(`Expected number but observed string: ${n}`));return t}}if(typeof n==="number")return n;throw new TypeError(`Expected number, got ${typeof n}: ${n}`)},Hh=Math.ceil(340282346638528860000000000000000000000),Oc=(n)=>{const t=Rh(n);if(t!==void 0&&!Number.isNaN(t)&&t!==Infinity&&t!==(-Infinity)){if(Math.abs(t)>Hh)throw new TypeError(`Expected 32-bit float, got ${n}`)}return t},Vn=(n)=>{if(n===null||n===void 0)return;if(Number.isInteger(n)&&!Number.isNaN(n))return n;throw new TypeError(`Expected integer, got ${typeof n}: ${n}`)};var lc=(n)=>Gn(n,32),pc=(n)=>Gn(n,16),vc=(n)=>Gn(n,8),Gn=(n,t)=>{const c=Vn(n);if(c!==void 0&&Ph(c,t)!==c)throw new TypeError(`Expected ${t}-bit integer, got ${n}`);return c},Ph=(n,t)=>{switch(t){case 32:return Int32Array.of(n)[0];case 16:return Int16Array.of(n)[0];case 8:return Int8Array.of(n)[0]}},cs=(n,t)=>{if(n===null||n===void 0){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return n},fs=(n)=>{if(n===null||n===void 0)return;if(typeof n==="object"&&!Array.isArray(n))return n;const t=Array.isArray(n)?"array":typeof n;throw new TypeError(`Expected object, got ${t}: ${n}`)},is=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string")return n;if(["boolean","number","bigint"].includes(typeof n))return _c.warn(mc(`Expected string, got ${typeof n}: ${n}`)),String(n);throw new TypeError(`Expected string, got ${typeof n}: ${n}`)};var qc=(n)=>{if(typeof n=="string")return Oc(P(n));return Oc(n)},kh=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,P=(n)=>{const t=n.match(kh);if(t===null||t[0].length!==n.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(n)};var hs=(n)=>{if(typeof n==="string")return Vn(P(n));return Vn(n)};var rs=(n)=>{if(typeof n==="string")return lc(P(n));return lc(n)},W=(n)=>{if(typeof n==="string")return pc(P(n));return pc(n)},ac=(n)=>{if(typeof n==="string")return vc(P(n));return vc(n)},mc=(n)=>{return String(new TypeError(n).stack||n).split("\n").slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join("\n")},_c={warn:console.warn};function $s(n){const t=n.getUTCFullYear(),c=n.getUTCMonth(),f=n.getUTCDay(),i=n.getUTCDate(),h=n.getUTCHours(),r=n.getUTCMinutes(),s=n.getUTCSeconds(),u=i<10?`0${i}`:`${i}`,d=h<10?`0${h}`:`${h}`,o=r<10?`0${r}`:`${r}`,$=s<10?`0${s}`:`${s}`;return`${Oh[f]}, ${u} ${Mn[c]} ${t} ${d}:${o}:${$} GMT`}var Oh=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Mn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lh=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ts=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=lh.exec(n);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[c,f,i,h,r,s,u,d]=t,o=W(b(f)),$=z(i,"month",1,12),F=z(h,"day",1,31);return k(o,$,F,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d})},ph=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),xs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ph.exec(n);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[c,f,i,h,r,s,u,d,o]=t,$=W(b(f)),F=z(i,"month",1,12),T=z(h,"day",1,31),E=k($,F,T,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d});if(o.toUpperCase()!="Z")E.setTime(E.getTime()-hr(o));return E},vh=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$/),qh=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$/),ah=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})$/),ds=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=vh.exec(n);if(t){const[c,f,i,h,r,s,u,d]=t;return k(W(b(h)),Qn(i),z(f,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d})}if(t=qh.exec(n),t){const[c,f,i,h,r,s,u,d]=t;return nr(k(mh(h),Qn(i),z(f,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d}))}if(t=ah.exec(n),t){const[c,f,i,h,r,s,u,d]=t;return k(W(b(d)),Qn(f),z(i.trimLeft(),"day",1,31),{hours:h,minutes:r,seconds:s,fractionalMilliseconds:u})}throw new TypeError("Invalid RFC-7231 date-time value")};var k=(n,t,c,f)=>{const i=t-1;return cr(n,i,c),new Date(Date.UTC(n,i,c,z(f.hours,"hour",0,23),z(f.minutes,"minute",0,59),z(f.seconds,"seconds",0,60),ir(f.fractionalMilliseconds)))},mh=(n)=>{const t=(new Date()).getUTCFullYear(),c=Math.floor(t/100)*100+W(b(n));if(c<t)return c+100;return c},_h=1576800000000,nr=(n)=>{if(n.getTime()-(new Date()).getTime()>_h)return new Date(Date.UTC(n.getUTCFullYear()-100,n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()));return n},Qn=(n)=>{const t=Mn.indexOf(n);if(t<0)throw new TypeError(`Invalid month: ${n}`);return t+1},tr=[31,28,31,30,31,30,31,31,30,31,30,31],cr=(n,t,c)=>{let f=tr[t];if(t===1&&fr(n))f=29;if(c>f)throw new TypeError(`Invalid day for ${Mn[t]} in ${n}: ${c}`)},fr=(n)=>{return n%4===0&&(n%100!==0||n%400===0)},z=(n,t,c,f)=>{const i=ac(b(n));if(i<c||i>f)throw new TypeError(`${t} must be between ${c} and ${f}, inclusive`);return i},ir=(n)=>{if(n===null||n===void 0)return 0;return qc("0."+n)*1000},hr=(n)=>{const t=n[0];let c=1;if(t=="+")c=1;else if(t=="-")c=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const f=Number(n.substring(1,3)),i=Number(n.substring(4,6));return c*(f*60+i)*60*1000},b=(n)=>{let t=0;while(t<n.length-1&&n.charAt(t)==="0")t++;if(t===0)return n;return n.slice(t)};var rr=({output:n,parsedBody:t,exceptionCtor:c,errorCode:f})=>{const i=sr(n),h=i.httpStatusCode?i.httpStatusCode+"":void 0,r=new c({name:t?.code||t?.Code||f||h||"UnknownError",$fault:"client",$metadata:i});throw mn(r,t)},os=(n)=>{return({output:t,parsedBody:c,errorCode:f})=>{rr({output:t,parsedBody:c,exceptionCtor:n,errorCode:f})}},sr=(n)=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]});var ys=(n)=>{switch(n){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var nf=!1,Us=(n)=>{if(n&&!nf&&parseInt(n.substring(1,n.indexOf(".")))<16)nf=!0};var Kn=X(l(),1);var tf=(n)=>{const t=[];for(let c in Kn.AlgorithmId){const f=Kn.AlgorithmId[c];if(n[f]===void 0)continue;t.push({algorithmId:()=>f,checksumConstructor:()=>n[f]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(c){this._checksumAlgorithms.push(c)},checksumAlgorithms(){return this._checksumAlgorithms}}},cf=(n)=>{const t={};return n.checksumAlgorithms().forEach((c)=>{t[c.algorithmId()]=c.checksumConstructor()}),t};var ff=(n)=>{let t=n.retryStrategy;return{setRetryStrategy(c){t=c},retryStrategy(){return t}}},hf=(n)=>{const t={};return t.retryStrategy=n.retryStrategy(),t};var Ss=(n)=>{return{...tf(n),...ff(n)}};var es=(n)=>{return{...cf(n),...hf(n)}};function ur(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var Xn=function(){const n=Object.getPrototypeOf(this).constructor,c=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(c,n.prototype),c};Xn.prototype=Object.create(String.prototype,{constructor:{value:Xn,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Xn,String);function wr(n,t,c){let f,i,h;if(typeof t==="undefined"&&typeof c==="undefined")f={},h=n;else if(f=n,typeof t==="function")return i=t,h=c,$r(f,i,h);else h=t;for(let r of Object.keys(h)){if(!Array.isArray(h[r])){f[r]=h[r];continue}rf(f,null,h,r)}return f}var Xs=(n,t)=>{const c={};for(let f in t)rf(c,n,t,f);return c},$r=(n,t,c)=>{return wr(n,Object.entries(c).reduce((f,[i,h])=>{if(Array.isArray(h))f[i]=h;else if(typeof h==="function")f[i]=[t,h()];else f[i]=[t,h];return f},{}))},rf=(n,t,c,f)=>{if(t!==null){let r=c[f];if(typeof r==="function")r=[,r];const[s=Tr,u=xr,d=f]=r;if(typeof s==="function"&&s(t[d])||typeof s!=="function"&&!!s)n[f]=u(t[d]);return}let[i,h]=c[f];if(typeof h==="function"){let r;const s=i===void 0&&(r=h())!=null,u=typeof i==="function"&&!!i(void 0)||typeof i!=="function"&&!!i;if(s)n[f]=r;else if(u)n[f]=h()}else{const r=i===void 0&&h!=null,s=typeof i==="function"&&!!i(h)||typeof i!=="function"&&!!i;if(r||s)n[f]=h}},Tr=(n)=>n!=null,xr=(n)=>n;var bs=(n)=>n.toISOString().replace(".000Z","Z");var sf=(n)=>{if(n==null)return{};if(Array.isArray(n))return n.filter((t)=>t!=null).map(sf);if(typeof n==="object"){const t={};for(let c of Object.keys(n)){if(n[c]==null)continue;t[c]=sf(n[c])}return t}return n};var xu=(n)=>{let t=n.httpHandler;return{setHttpHandler(c){t=c},httpHandler(){return t},updateHttpClientConfig(c,f){t.updateHttpClientConfig(c,f)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},du=(n)=>{return{httpHandler:n.httpHandler()}};var dr=X(l(),1);var Fr=function(n){return Object.keys(n).reduce((t,c)=>{const f=n[c];return{...t,[c]:Array.isArray(f)?[...f]:f}},{})};class An{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){const t=new An({...n,headers:{...n.headers}});if(t.query)t.query=Fr(t.query);return t}static isInstance(n){if(!n)return!1;const t=n;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return An.clone(this)}}class wn{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;const t=n;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var $n=X(In(),1);function Jn(n){const t=[];for(let c of Object.keys(n).sort()){const f=n[c];if(c=$n.escapeUri(c),Array.isArray(f))for(let i=0,h=f.length;i<h;i++)t.push(`${c}=${$n.escapeUri(f[i])}`);else{let i=c;if(f||typeof f==="string")i+=`=${$n.escapeUri(f)}`;t.push(i)}}return t.join("&")}import{Agent as df,request as Er} from"http";import{Agent as Ff,request as yr} from"https";var uf=["ECONNRESET","EPIPE","ETIMEDOUT"];var Wn=(n)=>{const t={};for(let c of Object.keys(n)){const f=n[c];t[c]=Array.isArray(f)?f.join(","):f}return t};var wf=(n,t,c=0)=>{if(!c)return;const f=setTimeout(()=>{n.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${c} ms`),{name:"TimeoutError"}))},c);n.on("socket",(i)=>{if(i.connecting)i.on("connect",()=>{clearTimeout(f)});else clearTimeout(f)})};var $f=(n,{keepAlive:t,keepAliveMsecs:c})=>{if(t!==!0)return;n.on("socket",(f)=>{f.setKeepAlive(t,c||0)})};var Tf=(n,t,c=0)=>{n.setTimeout(c,()=>{n.destroy(),t(Object.assign(new Error(`Connection timed out after ${c} ms`),{name:"TimeoutError"}))})};import{Readable as Cr} from"stream";async function bn(n,t,c=xf){const f=t.headers??{},i=f.Expect||f.expect;let h=-1,r=!1;if(i==="100-continue")await Promise.race([new Promise((s)=>{h=Number(setTimeout(s,Math.max(xf,c)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(h),s()}),n.on("error",()=>{r=!0,clearTimeout(h),s()})})]);if(!r)or(n,t.body)}var or=function(n,t){if(t instanceof Cr){t.pipe(n);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){n.end(t);return}const c=t;if(typeof c==="object"&&c.buffer&&typeof c.byteOffset==="number"&&typeof c.byteLength==="number"){n.end(Buffer.from(c.buffer,c.byteOffset,c.byteLength));return}n.end(Buffer.from(t));return}n.end()},xf=1000;class Bn{static create(n){if(typeof n?.handle==="function")return n;return new Bn(n)}static checkSocketUsage(n,t,c=console){const{sockets:f,requests:i,maxSockets:h}=n;if(typeof h!=="number"||h===Infinity)return t;const r=15000;if(Date.now()-r<t)return t;if(f&&i)for(let s in f){const u=f[s]?.length??0,d=i[s]?.length??0;if(u>=h&&d>=2*h)return c?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${d} additional requests are enqueued.
|
|
4
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
5
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,c)=>{if(typeof n==="function")n().then((f)=>{t(this.resolveDefaultConfig(f))}).catch(c);else t(this.resolveDefaultConfig(n))})}resolveDefaultConfig(n){const{requestTimeout:t,connectionTimeout:c,socketTimeout:f,httpAgent:i,httpsAgent:h}=n||{};return{connectionTimeout:c,requestTimeout:t??f,httpAgent:(()=>{if(i instanceof df||typeof i?.destroy==="function")return i;return new df({keepAlive:!0,maxSockets:50,...i})})(),httpsAgent:(()=>{if(h instanceof Ff||typeof h?.destroy==="function")return h;return new Ff({keepAlive:!0,maxSockets:50,...h})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(n,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;let c;return new Promise((f,i)=>{let h=void 0;const r=async(w)=>{await h,clearTimeout(c),f(w)},s=async(w)=>{await h,clearTimeout(c),i(w)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const w=new Error("Request aborted");w.name="AbortError",s(w);return}const u=n.protocol==="https:",d=u?this.config.httpsAgent:this.config.httpAgent;c=setTimeout(()=>{this.socketWarningTimestamp=Bn.checkSocketUsage(d,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const o=Jn(n.query||{});let $=void 0;if(n.username!=null||n.password!=null){const w=n.username??"",x=n.password??"";$=`${w}:${x}`}let F=n.path;if(o)F+=`?${o}`;if(n.fragment)F+=`#${n.fragment}`;const T={headers:n.headers,host:n.hostname,method:n.method,path:F,port:n.port,agent:d,auth:$},y=(u?yr:Er)(T,(w)=>{const x=new wn({statusCode:w.statusCode||-1,reason:w.statusMessage,headers:Wn(w.headers),body:w});r({response:x})});if(y.on("error",(w)=>{if(uf.includes(w.code))s(Object.assign(w,{name:"TimeoutError"}));else s(w)}),wf(y,s,this.config.connectionTimeout),Tf(y,s,this.config.requestTimeout),t){const w=()=>{y.destroy();const x=new Error("Request aborted");x.name="AbortError",s(x)};if(typeof t.addEventListener==="function"){const x=t;x.addEventListener("abort",w,{once:!0}),y.once("close",()=>x.removeEventListener("abort",w))}else t.onabort=w}const C=T.agent;if(typeof C==="object"&&"keepAlive"in C)$f(y,{keepAlive:C.keepAlive,keepAliveMsecs:C.keepAliveMsecs});h=bn(y,n,this.config.requestTimeout).catch((w)=>{return clearTimeout(c),i(w)})})}updateHttpClientConfig(n,t){this.config=void 0,this.configProvider=this.configProvider.then((c)=>{return{...c,[n]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as Ir} from"stream";class jn extends Ir{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,t,c){this.bufferedBytes.push(n),c()}}async function Lr(n){const t=[],c=n.getReader();let f=!1,i=0;while(!f){const{done:s,value:u}=await c.read();if(u)t.push(u),i+=u.length;f=s}const h=new Uint8Array(i);let r=0;for(let s of t)h.set(s,r),r+=s.length;return h}var $0=(n)=>{if(Ur(n))return Lr(n);return new Promise((t,c)=>{const f=new jn;n.pipe(f),n.on("error",(i)=>{f.end(),c(i)}),f.on("error",c),f.on("finish",function(){const i=new Uint8Array(Buffer.concat(this.bufferedBytes));t(i)})})},Ur=(n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream;export{xu as z,du as A,An as B,wn as C,Nf as D,xn as E,Df as F,tt as G,a as H,En as I,In as J,dc as K,kc as L,_r as M,vn as N,Sr as O,zr as P,ts as Q,Vn as R,lc as S,cs as T,fs as U,is as V,hs as W,rs as X,$s as Y,Ts as Z,xs as _,ds as $,an as aa,mn as ba,os as ca,ys as da,Us as ea,Ss as fa,es as ga,ur as ha,wr as ia,Xs as ja,bs as ka,sf as la,Bn as ma,$0 as na};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as _} from"./chunk-a5c18c07abe8fd9c.js";import"./chunk-a57ecc74c0fb9045.js";import{hb as y} from"./chunk-1109657ed53fbdc9.js";import{kb as K,qb as S} from"./chunk-a3526e321ac9d173.js";var o=_(y(),1);import{exec as A} from"child_process";import{promisify as T} from"util";var i=(c,n,s)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){const t=new Date;if(new Date(n.Expiration)<t)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let e=n.AccountId;if(!e&&s?.[c]?.aws_account_id)e=s[c].aws_account_id;return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...e&&{accountId:e}}};var x=async(c,n,s)=>{const e=n[c];if(n[c]){const t=e.credential_process;if(t!==void 0){const u=T(A);try{const{stdout:r}=await u(t);let w;try{w=JSON.parse(r.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return i(c,w,n)}catch(r){throw new o.CredentialsProviderError(r.message,{logger:s})}}else throw new o.CredentialsProviderError(`Profile ${c} did not contain credential_process.`,{logger:s})}else throw new o.CredentialsProviderError(`Profile ${c} could not be found in shared credentials file.`,{logger:s})};var b=(c={})=>async()=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const n=await S(c);return x(K(c),n,c.logger)};export{b as fromProcess};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{sb as s,ub as y,vb as u,wb as C} from"./chunk-100b76ab0ca3e14d.js";import{Db as g,zb as d} from"./chunk-e16b252158474b8c.js";function c(o){try{const r=new Set(Array.from(o.match(/([A-Z_]){3,}/g)??[]));return r.delete("CONFIG"),r.delete("CONFIG_PREFIX_SEPARATOR"),r.delete("ENV"),[...r].join(", ")}catch(r){return o}}var l=(o,r)=>async()=>{try{const t=o(process.env);if(t===void 0)throw new Error;return t}catch(t){throw new s(t.message||`Not found in ENV: ${c(o.toString())}`,{logger:r})}};var h=(o,{preferredFile:r="config",...t}={})=>async()=>{const e=d(t),{configFile:n,credentialsFile:i}=await g(t),f=i[e]||{},m=n[e]||{},S=r==="config"?{...f,...m}:{...m,...f};try{const p=o(S,r==="config"?n:i);if(p===void 0)throw new Error;return p}catch(a){throw new s(a.message||`Not found in config files w/ profile [${e}]: ${c(o.toString())}`,{logger:t.logger})}};var E=(o)=>typeof o==="function",w=(o)=>E(o)?async()=>await o():u(o);var k=({environmentVariableSelector:o,configFileSelector:r,default:t},e={})=>C(y(l(o),h(r,e),w(t)));function F(o){const r={};if(o=o.replace(/^\?/,""),o)for(let t of o.split("&")){let[e,n=null]=t.split("=");if(e=decodeURIComponent(e),n)n=decodeURIComponent(n);if(!(e in r))r[e]=n;else if(Array.isArray(r[e]))r[e].push(n);else r[e]=[r[e],n]}return r}var N=(o)=>{if(typeof o==="string")return N(new URL(o));const{hostname:r,pathname:t,port:e,protocol:n,search:i}=o;let f;if(i)f=F(i);return{hostname:r,port:e?parseInt(e):void 0,protocol:n,path:t,query:f}};
|
|
2
|
+
export{k as pb,N as qb};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{y as D} from"./chunk-a5c18c07abe8fd9c.js";var S=D((y,w)=>{var{defineProperty:G,getOwnPropertyDescriptor:v,getOwnPropertyNames:O}=Object,x=Object.prototype.hasOwnProperty,Q=(b,j)=>G(b,"name",{value:j,configurable:!0}),U=(b,j)=>{for(var z in j)G(b,z,{get:j[z],enumerable:!0})},K=(b,j,z,V)=>{if(j&&typeof j==="object"||typeof j==="function"){for(let B of O(j))if(!x.call(b,B)&&B!==z)G(b,B,{get:()=>j[B],enumerable:!(V=v(j,B))||V.enumerable})}return b},q=(b)=>K(G({},"__esModule",{value:!0}),b),W={};U(W,{AlgorithmId:()=>J,EndpointURLScheme:()=>X,FieldPosition:()=>M,HttpApiKeyAuthLocation:()=>$,HttpAuthLocation:()=>Z,IniSectionType:()=>N,RequestHandlerProtocol:()=>Y,SMITHY_CONTEXT_KEY:()=>R,getDefaultClientConfiguration:()=>T,resolveDefaultRuntimeConfig:()=>k});w.exports=q(W);var Z=((b)=>{return b.HEADER="header",b.QUERY="query",b})(Z||{}),$=((b)=>{return b.HEADER="header",b.QUERY="query",b})($||{}),X=((b)=>{return b.HTTP="http",b.HTTPS="https",b})(X||{}),J=((b)=>{return b.MD5="md5",b.CRC32="crc32",b.CRC32C="crc32c",b.SHA1="sha1",b.SHA256="sha256",b})(J||{}),E=Q((b)=>{const j=[];if(b.sha256!==void 0)j.push({algorithmId:()=>"sha256",checksumConstructor:()=>b.sha256});if(b.md5!=null)j.push({algorithmId:()=>"md5",checksumConstructor:()=>b.md5});return{_checksumAlgorithms:j,addChecksumAlgorithm(z){this._checksumAlgorithms.push(z)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),F=Q((b)=>{const j={};return b.checksumAlgorithms().forEach((z)=>{j[z.algorithmId()]=z.checksumConstructor()}),j},"resolveChecksumRuntimeConfig"),T=Q((b)=>{return{...E(b)}},"getDefaultClientConfiguration"),k=Q((b)=>{return{...F(b)}},"resolveDefaultRuntimeConfig"),M=((b)=>{return b[b.HEADER=0]="HEADER",b[b.TRAILER=1]="TRAILER",b})(M||{}),R="__smithy_context",N=((b)=>{return b.PROFILE="profile",b.SSO_SESSION="sso-session",b.SERVICES="services",b})(N||{}),Y=((b)=>{return b.HTTP_0_9="http/0.9",b.HTTP_1_0="http/1.0",b.TDS_8_0="tds/8.0",b})(Y||{})});
|
|
2
|
+
export{S as ob};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{x as l} from"./chunk-a5c18c07abe8fd9c.js";import{hb as m} from"./chunk-1109657ed53fbdc9.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-6766e66417809e1a.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var p="AWS_WEB_IDENTITY_TOKEN_FILE",f="AWS_ROLE_ARN",T="AWS_ROLE_SESSION_NAME",I=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[p],r=e?.roleArn??process.env[f],n=e?.roleSessionName??process.env[T];if(!o||!r)throw new E.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:S(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,I as fromTokenFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-a5c18c07abe8fd9c.js";import"./chunk-5a9fa677066f72ac.js";import{sb as o} from"./chunk-100b76ab0ca3e14d.js";import{Fb as S,zb as K} from"./chunk-e16b252158474b8c.js";import{exec as _} from"child_process";import{promisify as y} from"util";var i=(c,n,s)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){const t=new Date;if(new Date(n.Expiration)<t)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let e=n.AccountId;if(!e&&s?.[c]?.aws_account_id)e=s[c].aws_account_id;return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...e&&{accountId:e}}};var x=async(c,n,s)=>{const e=n[c];if(n[c]){const t=e.credential_process;if(t!==void 0){const u=y(_);try{const{stdout:r}=await u(t);let w;try{w=JSON.parse(r.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return i(c,w,n)}catch(r){throw new o(r.message,{logger:s})}}else throw new o(`Profile ${c} did not contain credential_process.`,{logger:s})}else throw new o(`Profile ${c} could not be found in shared credentials file.`,{logger:s})};var $=(c={})=>async()=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const n=await S(c);return x(K(c),n,c.logger)};export{$ as fromProcess};
|