gemi 0.4.53 → 0.4.54
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/app/index.js +1 -1
- package/dist/auth/AuthenticationServiceProvider.d.ts.map +1 -1
- package/dist/chunk-01ffccc19e8ef862.js +3 -0
- package/dist/chunk-16dbe3a15379140b.js +2 -0
- package/dist/chunk-4f5b07a6a6fd5cc6.js +2 -0
- package/dist/chunk-53b7d6267c9172bc.js +2 -0
- package/dist/chunk-53c39aca36ece018.js +2 -0
- package/dist/chunk-59980167a4c574b3.js +2 -0
- package/dist/chunk-77d1b26236f5feec.js +2 -0
- package/dist/chunk-795a1bd1d89efce1.js +2 -0
- package/dist/chunk-a991fdce275f1256.js +2 -0
- package/dist/chunk-adb4e1e222eb1d20.js +2 -0
- package/dist/chunk-b97189ea9588db36.js +9 -0
- package/dist/chunk-ba051a98cd651063.js +1 -0
- package/dist/chunk-bdf4f2b1862899bb.js +2 -0
- package/dist/chunk-c83b39b7178003da.js +2 -0
- package/dist/chunk-cdfa2adeddc1a8e1.js +2 -0
- package/dist/chunk-d3033805e98482dc.js +6 -0
- package/dist/chunk-d43b3f444e738dd1.js +1 -0
- package/dist/chunk-dc23bfb4fd92e2f0.js +2 -0
- package/dist/chunk-f0d3ed16a520ecf1.js +18 -0
- package/dist/chunk-f316793e4ec0f386.js +2 -0
- package/dist/client/index.js +35 -17
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/client/useQuery.d.ts +2 -2
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/email/index.js +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/index.js +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/server/index.js +1 -1
- package/dist/storage/index.js +2 -2
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
package/dist/app/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{b as D1,e as I1,
|
|
2
|
+
import{b as D1,e as I1,h as i0,i as R1,l as H7,n as A7} from"../http/index.js";import{x as Y3,y as F4} from"../chunk-53b7d6267c9172bc.js";import{A as s1,z as QX} from"../chunk-bdf4f2b1862899bb.js";var j4=s1((a6,K4)=>{var R7=function(w){return typeof w=="function"?w:(H)=>H.$extends(w)},T7=function(w){return w},M7=function(...w){return(H)=>H},y=function(w,H){let A=new RegExp(`\\x1b\\[${H}m`,"g"),X=`\x1B[${w}m`,V=`\x1B[${H}m`;return function(W){return!_5.enabled||W==null?W:X+(~(""+W).indexOf(V)?W.replace(A,V+X):W)+V}},s7=function(w){let H={color:O4[l7++%O4.length],enabled:e0.enabled(w),namespace:w,log:e0.log,extend:()=>{}};return new Proxy((...X)=>{let{enabled:V,namespace:W,color:$,log:J}=H;if(X.length!==0&&t0.push([W,...X]),t0.length>u7&&t0.shift(),e0.enabled(W)||V){let Y=X.map((K)=>typeof K=="string"?K:a7(K)),Z=`+${Date.now()-L4}ms`;L4=Date.now(),globalThis.DEBUG_COLORS?J(O3[$]($0(W)),...Y,O3[$](Z)):J(W,...Y,Z)}},{get:(X,V)=>H[V],set:(X,V,W)=>H[V]=W})},a7=function(w,H=2){let A=new Set;return JSON.stringify(w,(X,V)=>{if(typeof V=="object"&&V!==null){if(A.has(V))return"[Circular *]";A.add(V)}else if(typeof V=="bigint")return V.toString();return V},H)},o7=function(w=7500){let H=t0.map(([A,...X])=>`${A} ${X.map((V)=>typeof V=="string"?V:JSON.stringify(V)).join(" ")}`).join(`
|
|
3
3
|
`);return H.length<w?H:H.slice(-w)},i7=function(){t0.length=0},r7=function(){let w=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(w&&n7.default.existsSync(w))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)')},e7=function(w,H){let A=H==="url";return w.includes("windows")?A?"query_engine.dll.node":`query_engine-${w}.dll.node`:w.includes("darwin")?A?`${T1}.dylib.node`:`${T1}-${w}.dylib.node`:A?`${T1}.so.node`:`${T1}-${w}.so.node`},X0=function(w){return Object.assign(w,{optional:()=>A8(w),and:(H)=>P(w,H),or:(H)=>X8(w,H),select:(H)=>H===void 0?_4(w):_4(H,w)})},A8=function(w){return X0({[U0]:()=>({match:(H)=>{let A={},X=(V,W)=>{A[V]=W};return H===void 0?(v0(w).forEach((V)=>X(V,void 0)),{matched:!0,selections:A}):{matched:z0(w,H,X),selections:A}},getSelectionKeys:()=>v0(w),matcherType:"optional"})})},P=function(...w){return X0({[U0]:()=>({match:(H)=>{let A={},X=(V,W)=>{A[V]=W};return{matched:w.every((V)=>z0(V,H,X)),selections:A}},getSelectionKeys:()=>V1(w,v0),matcherType:"and"})})},X8=function(...w){return X0({[U0]:()=>({match:(H)=>{let A={},X=(V,W)=>{A[V]=W};return V1(w,v0).forEach((V)=>X(V,void 0)),{matched:w.some((V)=>z0(V,H,X)),selections:A}},getSelectionKeys:()=>V1(w,v0),matcherType:"or"})})},S=function(w){return{[U0]:()=>({match:(H)=>({matched:!!w(H)})})}},_4=function(...w){let H=typeof w[0]=="string"?w[0]:void 0,A=w.length===2?w[1]:typeof w[0]=="string"?void 0:w[0];return X0({[U0]:()=>({match:(X)=>{let V={[H??E1]:X};return{matched:A===void 0||z0(A,X,(W,$)=>{V[W]=$}),selections:V}},getSelectionKeys:()=>[H??E1].concat(A===void 0?[]:v0(A))})})},Z0=function(w){return typeof w=="number"},R0=function(w){return typeof w=="string"},T0=function(w){return typeof w=="bigint"},o1=function(w){return new V8(w,x3)},Z3=function(w,...H){J8.warn()&&console.warn(`${$8.warn} ${w}`,...H)};async function K8(){let w=Q3.default.platform(),H=process.arch;if(w==="freebsd"){let $=await h1("freebsd-version");if($&&$.trim().length>0){let J=/^(\d+)\.?/.exec($);if(J)return{platform:"freebsd",targetDistro:`freebsd${J[1]}`,arch:H}}}if(w!=="linux")return{platform:w,arch:H};let A=await z8(),X=await x8(),V=F8({arch:H,archFromUname:X,familyDistro:A.familyDistro}),{libssl:W}=await G8(V);return{platform:"linux",libssl:W,arch:H,archFromUname:X,...A}}var j8=function(w){let H=/^ID="?([^"\n]*)"?$/im,A=/^ID_LIKE="?([^"\n]*)"?$/im,X=H.exec(w),V=X&&X[1]&&X[1].toLowerCase()||"",W=A.exec(w),$=W&&W[1]&&W[1].toLowerCase()||"",J=o1({id:V,idLike:$}).with({id:"alpine"},({id:Y})=>({targetDistro:"musl",familyDistro:Y,originalDistro:Y})).with({id:"raspbian"},({id:Y})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:Y})).with({id:"nixos"},({id:Y})=>({targetDistro:"nixos",originalDistro:Y,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:Y})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:Y})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:Y})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:Y})).when(({idLike:Y})=>Y.includes("debian")||Y.includes("ubuntu"),({id:Y})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:Y})).when(({idLike:Y})=>V==="arch"||Y.includes("arch"),({id:Y})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:Y})).when(({idLike:Y})=>Y.includes("centos")||Y.includes("fedora")||Y.includes("rhel")||Y.includes("suse"),({id:Y})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:Y})).otherwise(({id:Y})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:Y}));return i(`Found distro info:
|
|
4
4
|
${JSON.stringify(J,null,2)}`),J};async function z8(){let w="/etc/os-release";try{let H=await U5.default.readFile(w,{encoding:"utf-8"});return j8(H)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}var B8=function(w){let H=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(w);if(H){let A=`${H[1]}.x`;return x5(A)}},Q4=function(w){let H=/libssl\.so\.(\d)(\.\d)?/.exec(w);if(H){let A=`${H[1]}${H[2]??".0"}.x`;return x5(A)}},x5=function(w){let H=(()=>{if(I5(w))return w;let A=w.split(".");return A[1]="0",A.join(".")})();if(Z8.includes(H))return H},F8=function(w){return o1(w).with({familyDistro:"musl"},()=>(i('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:H})=>(i('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${H}-linux-gnu`,`/lib/${H}-linux-gnu`])).with({familyDistro:"rhel"},()=>(i('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:H,arch:A,archFromUname:X})=>(i(`Don't know any platform-specific paths for "${H}" on ${A} (${X})`),[]))};async function G8(w){let H='grep -v "libssl.so.0"',A=await U4(w);if(A){i(`Found libssl.so file using platform-specific paths: ${A}`);let W=Q4(A);if(i(`The parsed libssl version is: ${W}`),W)return{libssl:W,strategy:"libssl-specific-path"}}i('Falling back to "ldconfig" and other generic paths');let X=await h1(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${H}`);if(X||(X=await U4(["/lib64","/usr/lib64","/lib"])),X){i(`Found libssl.so file using "ldconfig" or other generic paths: ${X}`);let W=Q4(X);if(i(`The parsed libssl version is: ${W}`),W)return{libssl:W,strategy:"ldconfig"}}let V=await h1("openssl version -v");if(V){i(`Found openssl binary with version: ${V}`);let W=B8(V);if(i(`The parsed openssl version is: ${W}`),W)return{libssl:W,strategy:"openssl-binary"}}return i("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function U4(w){for(let H of w){let A=await O8(H);if(A)return A}}async function O8(w){try{return(await U5.default.readdir(w)).find((H)=>H.startsWith("libssl.so.")&&!H.startsWith("libssl.so.0"))}catch(H){if(H.code==="ENOENT")return;throw H}}async function l3(){let{binaryTarget:w}=await D5();return w}var L8=function(w){return w.binaryTarget!==void 0};async function _8(){let{memoized:w,...H}=await D5();return H}async function D5(){if(L8(M1))return Promise.resolve({...M1,memoized:!0});let w=await K8(),H=Q8(w);return M1={...w,binaryTarget:H},{...M1,memoized:!1}}var Q8=function(w){let{platform:H,arch:A,archFromUname:X,libssl:V,targetDistro:W,familyDistro:$,originalDistro:J}=w;H==="linux"&&!["x64","arm64"].includes(A)&&Z3(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${A}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${X}".`);let Y="1.1.x";if(H==="linux"&&V===void 0){let K=o1({familyDistro:$}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");Z3(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${Y}".
|
|
5
5
|
${K}`)}let Z="debian";if(H==="linux"&&W===void 0&&i(`Distro is "${J}". Falling back to Prisma engines built for "${Z}".`),H==="darwin"&&A==="arm64")return"darwin-arm64";if(H==="darwin")return"darwin";if(H==="win32")return"windows";if(H==="freebsd")return W;if(H==="openbsd")return"openbsd";if(H==="netbsd")return"netbsd";if(H==="linux"&&W==="nixos")return"linux-nixos";if(H==="linux"&&A==="arm64")return`${W==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${V||Y}`;if(H==="linux"&&A==="arm")return`linux-arm-openssl-${V||Y}`;if(H==="linux"&&W==="musl"){let K="linux-musl";return!V||I5(V)?K:`${K}-openssl-${V}`}return H==="linux"&&W&&V?`${W}-openssl-${V}`:(H!=="linux"&&Z3(`Prisma detected unknown OS "${H}" and may not work as expected. Defaulting to "linux".`),V?`${Z}-openssl-${V}`:W?`${W}-openssl-${Y}`:`${Z}-openssl-${Y}`)};async function U8(w){try{return await w()}catch{return}}var h1=function(w){return U8(async()=>{let H=await Y8(w);return i(`Command "${w}" successfully returned "${H.stdout}"`),H.stdout})};async function x8(){return typeof Q3.default.machine=="function"?Q3.default.machine():(await h1("uname -m"))?.trim()}var I5=function(w){return w.startsWith("1.")},I8=function(w){return D8.default(w,w,{fallback:H0})},R8=function(){return f.default.join(__dirname,"../")},T8=function(w){if(process.platform==="win32")return;let H=x4.default.statSync(w),A=H.mode|64|8|1;if(H.mode===A){D4(`Execution permissions of ${w} are fine`);return}let X=A.toString(8).slice(-3);D4(`Have to call chmodPlusX on ${w}`),x4.default.chmodSync(w,X)},M8=function(w){let H=w.e,A=(J)=>`Prisma cannot find the required \`${J}\` system library in your system`,X=H.message.includes("cannot open shared object file"),V=`Please refer to the documentation about Prisma's system requirements: ${I8("https://pris.ly/d/system-requirements")}`,W=`Unable to require(\`${j1(w.id)}\`).`,$=o1({message:H.message,code:H.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:J})=>X&&J.includes("libz"),()=>`${A("libz")}. Please install it and try again.`).when(({message:J})=>X&&J.includes("libgcc_s"),()=>`${A("libgcc_s")}. Please install it and try again.`).when(({message:J})=>X&&J.includes("libssl"),()=>{let J=w.platformInfo.libssl?`openssl-${w.platformInfo.libssl}`:"openssl";return`${A("libssl")}. Please install ${J} and try again.`}).when(({message:J})=>J.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${V}`).when(({message:J})=>w.platformInfo.platform==="linux"&&J.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${w.platformInfo.originalDistro} on (${w.platformInfo.archFromUname}) which uses the \`${w.platformInfo.binaryTarget}\` binaryTarget by default. ${V}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${V}`);return`${W}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationServiceProvider.d.ts","sourceRoot":"","sources":["../../auth/AuthenticationServiceProvider.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthenticationServiceProvider.d.ts","sourceRoot":"","sources":["../../auth/AuthenticationServiceProvider.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA4PrE,qBAAa,aAAc,SAAQ,SAAS;IAC1C,MAAM;;mBAtPG,MAAM;sBACH,MAAM;;;;;kBAkBV,MAAM;mBACL,MAAM;sBACH,MAAM;;;;;;;;;;MAwOhB;CACH;AAED,qBAAa,cAAe,SAAQ,UAAU;IAC5C,MAAM;;;;;MAKJ;CACH;AAED,qBAAa,6BAA6B;IACxC,QAAQ,SAAW;IACnB,OAAO;;;MAGL;IAEF,qBAAqB,SAAM;IAC3B,6BAA6B,SAAc;IAG3C,OAAO,EAAE,sBAAsB,CAAsB;IAE/C,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/C,2BAA2B,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAM9D,QAAQ,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IACxD,QAAQ,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IACxD,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IACzD,gBAAgB,CAAC,CAAC,SAAS,IAAI,EAC7B,KAAK,EAAE,CAAC,EACR,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IACvB,eAAe,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CAChE"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{A as $,z as F} from"./chunk-bdf4f2b1862899bb.js";import{pb as V} from"./chunk-dc23bfb4fd92e2f0.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 B,Hs as C,it as D,Z as E,Xr as F,ot as G,Fr as H,Ot as I,m as J,Q as K,qt as L,B as M,fi as N,K as O,X as P,Ni as Q,ft as R,gt as S,Jt as T,un as U,wn as V,Tn as W,q as X,Fn as Y,Mn as Z,Hn as _,On as $,qi as aa,ec as ba,hc as ca,bc as da,jt as ea,Jo as fa,Po as ga,Cc as ha,$t as ia,fr as ja,$c as ka,Ec as la,Sc as ma,Ic as na,Uc as oa,Lc as pa,Dc as qa,mc as ra,Bc as sa,kt as ta,Pt as ua,Yc as va,zc as wa,Vc as xa,Xc as ya,Jc as za,Bs as Aa,Ms as Ba,nf as Ca,of as Da,Cr as Ea};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-c83b39b7178003da.js";import{z} from"./chunk-bdf4f2b1862899bb.js";import{Aa as eh,B as w0,C as G0,D as W0,F as Nl,H as F0,L as Wl,M as Tl,O as Al,P as Rl,S as sl,T as _l,ea as K,fa as Hh,ga as o0,ka as T0,ma as S,oa as u,ra as A0,ta as $0,ua as A,va as R0,wa as bl,xa as fl,ya as I0,za as H0} from"./chunk-01ffccc19e8ef862.js";import{$a as B,Ga as D0,Ha as E0,Ia as k0,Ja as K0,Ka as Sd,Na as Qh,Oa as B0,Pa as Pl,Qa as vl,Ra as Ml,Sa as q0,Ta as Cl,Ua as Ol,Va as gl,Wa as xl,Xa as y0,Ya as Q0,_a as F,ab as X0,bb as il,db as cl,eb as Y0,fb as el,gb as Z0,ib as dh,jb as pl,kb as nl,lb as ol,mb as ul,nb as S0,ob as m0} from"./chunk-f0d3ed16a520ecf1.js";import"./chunk-dc23bfb4fd92e2f0.js";import{qb as kd,rb as f} from"./chunk-d43b3f444e738dd1.js";import"./chunk-f316793e4ec0f386.js";import{tb as Xh} from"./chunk-b97189ea9588db36.js";import"./chunk-ba051a98cd651063.js";var C=z(Qh(),1);var wl=z(dh(),1),wh=z(Sd(),1);var md=function(h){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:h.region},propertiesExtractor:(d,l)=>({signingProperties:{config:d,context:l}})}},dl=function(h){return{schemeId:"smithy.api#noAuth"}},Gl=async(h,d,l)=>{return{operation:wh.getSmithyContext(d).operation,region:await wh.normalizeProvider(h.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Il=(h)=>{const d=[];switch(h.operation){case"AssumeRoleWithSAML":{d.push(dl(h));break}case"AssumeRoleWithWebIdentity":{d.push(dl(h));break}default:d.push(md(h))}return d},Jd=(h)=>({...h,stsClientCtor:R}),Hl=(h)=>{const d=Jd(h);return{...wl.resolveAwsSdkSigV4Config(d)}};var Sl=(h)=>{return{...h,useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,useGlobalEndpoint:h.useGlobalEndpoint??!1,defaultSigningName:"sts"}},D={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var ml={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts 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-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn test:unit","test:unit":"jest"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.629.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",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}};var Gh=z(dh(),1);var tl=z(Qh(),1);var Ll=z(dh(),1),jl=z(Qh(),1);var al=z(kd(),1);var Jl={["required"]:!1,["type"]:"String"},yh={["required"]:!0,default:!1,["type"]:"Boolean"},Ql={["ref"]:"Endpoint"},Dl={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},J={["ref"]:"Region"},El={["fn"]:"aws.partition",["argv"]:[J],assign:"PartitionResult"},Xl={["ref"]:"UseFIPS"},Yl={["ref"]:"UseDualStack"},E={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},X={},kl={conditions:[{["fn"]:"stringEquals",["argv"]:[J,"aws-global"]}],["endpoint"]:E,["type"]:"endpoint"},Zl={["fn"]:"booleanEquals",["argv"]:[Xl,!0]},$l={["fn"]:"booleanEquals",["argv"]:[Yl,!0]},Kl={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Ul={["ref"]:"PartitionResult"},Fl={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Ul,"supportsDualStack"]}]},Bl=[{["fn"]:"isSet",["argv"]:[Ql]}],ql=[Zl],yl=[$l],Ed={version:"1.0",parameters:{Region:Jl,UseDualStack:yh,UseFIPS:yh,Endpoint:Jl,UseGlobalEndpoint:yh},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:Bl},Dl,El,{["fn"]:"booleanEquals",["argv"]:[Xl,!1]},{["fn"]:"booleanEquals",["argv"]:[Yl,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-northeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-south-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-2"]}],endpoint:E,["type"]:"endpoint"},kl,{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ca-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-north-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-3"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"sa-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-2"]}],endpoint:E,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:Bl,rules:[{conditions:ql,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:yl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:Ql,properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[Dl],rules:[{conditions:[El],rules:[{conditions:[Zl,$l],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Kl]},Fl],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:ql,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Kl,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ul,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:X,headers:X},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:yl,rules:[{conditions:[Fl],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},kl,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},Vl=Ed;var zl=(h,d={})=>{return vl(Vl,{endpointParams:h,logger:d.logger})};Pl.aws=Ml;var rl=(h)=>{return{apiVersion:"2011-06-15",base64Decoder:h?.base64Decoder??Wl,base64Encoder:h?.base64Encoder??Rl,disableHostPrefix:h?.disableHostPrefix??!1,endpointProvider:h?.endpointProvider??zl,extensions:h?.extensions??[],httpAuthSchemeProvider:h?.httpAuthSchemeProvider??Il,httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(d)=>d.getIdentityProvider("aws.auth#sigv4"),signer:new Ll.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(d)=>d.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new jl.NoAuthSigner}],logger:h?.logger??new Nl,serviceId:h?.serviceId??"STS",urlParser:h?.urlParser??al.parseUrl,utf8Decoder:h?.utf8Decoder??Tl,utf8Encoder:h?.utf8Encoder??Al}};var h0=(h)=>{fl(process.version);const d=ul(h),l=()=>d().then(bl),w=rl(h);return Gh.emitWarningIfUnsupportedVersion(process.version),{...w,...h,runtime:"node",defaultsMode:d,bodyLengthChecker:h?.bodyLengthChecker??ol,credentialDefaultProvider:h?.credentialDefaultProvider??Xh,defaultUserAgentProvider:h?.defaultUserAgentProvider??pl({serviceId:w.serviceId,clientVersion:ml.version}),httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(G)=>G.getIdentityProvider("aws.auth#sigv4")||(async(H)=>await Xh(H?.__config||{})()),signer:new Gh.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(G)=>G.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new tl.NoAuthSigner}],maxAttempts:h?.maxAttempts??f(cl),region:h?.region??f(gl,xl),requestHandler:sl.create(h?.requestHandler??l),retryMode:h?.retryMode??f({...el,default:async()=>(await l()).retryMode||il}),sha256:h?.sha256??nl.bind(null,"sha256"),streamCollector:h?.streamCollector??_l,useDualstackEndpoint:h?.useDualstackEndpoint??f(Cl),useFipsEndpoint:h?.useFipsEndpoint??f(Ol)}};var l0=(h)=>{const d=h.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:w}=h;return{setHttpAuthScheme(G){const H=d.findIndex((I)=>I.schemeId===G.schemeId);if(H===-1)d.push(G);else d.splice(H,1,G)},httpAuthSchemes(){return d},setHttpAuthSchemeProvider(G){l=G},httpAuthSchemeProvider(){return l},setCredentials(G){w=G},credentials(){return w}}},d0=(h)=>{return{httpAuthSchemes:h.httpAuthSchemes(),httpAuthSchemeProvider:h.httpAuthSchemeProvider(),credentials:h.credentials()}};var Ih=(h)=>h,J0=(h,d)=>{const l={...Ih(S0(h)),...Ih(I0(h)),...Ih(w0(h)),...Ih(l0(h))};return d.forEach((w)=>w.configure(l)),{...h,...m0(l),...H0(l),...G0(l),...d0(l)}};class R extends F0{constructor(...[h]){const d=h0(h||{}),l=Sl(d),w=B0(l),G=Y0(w),H=y0(G),I=D0(H),Q=X0(I),v=Hl(Q),M=J0(v,h?.extensions||[]);super(M);this.config=M,this.middlewareStack.use(q0(this.config)),this.middlewareStack.use(Z0(this.config)),this.middlewareStack.use(Q0(this.config)),this.middlewareStack.use(E0(this.config)),this.middlewareStack.use(k0(this.config)),this.middlewareStack.use(K0(this.config)),this.middlewareStack.use(C.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Gl,identityProviderConfigProvider:async(n)=>new C.DefaultIdentityProviderConfig({"aws.auth#sigv4":n.credentials})})),this.middlewareStack.use(C.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class Y extends $0{constructor(h){super(h);Object.setPrototypeOf(this,Y.prototype)}}class Sh extends Y{constructor(h){super({name:"ExpiredTokenException",$fault:"client",...h});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Sh.prototype)}}class mh extends Y{constructor(h){super({name:"MalformedPolicyDocumentException",$fault:"client",...h});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,mh.prototype)}}class Jh extends Y{constructor(h){super({name:"PackedPolicyTooLargeException",$fault:"client",...h});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Jh.prototype)}}class Dh extends Y{constructor(h){super({name:"RegionDisabledException",$fault:"client",...h});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Dh.prototype)}}class Eh extends Y{constructor(h){super({name:"IDPRejectedClaimException",$fault:"client",...h});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Eh.prototype)}}class kh extends Y{constructor(h){super({name:"InvalidIdentityTokenException",$fault:"client",...h});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,kh.prototype)}}class Kh extends Y{constructor(h){super({name:"IDPCommunicationErrorException",$fault:"client",...h});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,Kh.prototype)}}class Fh extends Y{constructor(h){super({name:"InvalidAuthorizationMessageException",$fault:"client",...h});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,Fh.prototype)}}var o=(h)=>({...h,...h.SecretAccessKey&&{SecretAccessKey:Hh}}),U0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),V0=(h)=>({...h,...h.SAMLAssertion&&{SAMLAssertion:Hh}}),P0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),v0=(h)=>({...h,...h.WebIdentityToken&&{WebIdentityToken:Hh}}),M0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),z0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),N0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}});var P=z(dh(),1);var L0=async(h,d)=>{const l=a;let w;return w=b({...Zd(h,d),[s]:ud,[_]:r}),j(d,l,"/",void 0,w)},j0=async(h,d)=>{const l=a;let w;return w=b({...$d(h,d),[s]:td,[_]:r}),j(d,l,"/",void 0,w)},a0=async(h,d)=>{const l=a;let w;return w=b({...Ud(h,d),[s]:hw,[_]:r}),j(d,l,"/",void 0,w)},r0=async(h,d)=>{const l=a;let w;return w=b({...Vd(h,d),[s]:lw,[_]:r}),j(d,l,"/",void 0,w)},s0=async(h,d)=>{const l=a;let w;return w=b({...Pd(h,d),[s]:dw,[_]:r}),j(d,l,"/",void 0,w)},_0=async(h,d)=>{const l=a;let w;return w=b({...vd(h,d),[s]:ww,[_]:r}),j(d,l,"/",void 0,w)},b0=async(h,d)=>{const l=a;let w;return w=b({...Md(h,d),[s]:Gw,[_]:r}),j(d,l,"/",void 0,w)},f0=async(h,d)=>{const l=a;let w;return w=b({...zd(h,d),[s]:Iw,[_]:r}),j(d,l,"/",void 0,w)},C0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=Ld(l.AssumeRoleResult,d),{$metadata:k(h),...w}},O0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=jd(l.AssumeRoleWithSAMLResult,d),{$metadata:k(h),...w}},g0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=ad(l.AssumeRoleWithWebIdentityResult,d),{$metadata:k(h),...w}},x0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=rd(l.DecodeAuthorizationMessageResult,d),{$metadata:k(h),...w}},i0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=bd(l.GetAccessKeyInfoResult,d),{$metadata:k(h),...w}},c0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=fd(l.GetCallerIdentityResult,d),{$metadata:k(h),...w}},e0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=Cd(l.GetFederationTokenResult,d),{$metadata:k(h),...w}},p0=async(h,d)=>{if(h.statusCode>=300)return L(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=Od(l.GetSessionTokenResult,d),{$metadata:k(h),...w}},L=async(h,d)=>{const l={...h,body:await P.parseXmlErrorBody(h.body,d)},w=Hw(h,l.body);switch(w){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await Kd(l,d);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Qd(l,d);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Xd(l,d);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await Yd(l,d);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Bd(l,d);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await yd(l,d);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Fd(l,d);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await qd(l,d);default:const G=l.body;return od({output:h,parsedBody:G.Error,errorCode:w})}},Kd=async(h,d)=>{const l=h.body,w=sd(l.Error,d),G=new Sh({$metadata:k(h),...w});return A(G,l)},Fd=async(h,d)=>{const l=h.body,w=gd(l.Error,d),G=new Kh({$metadata:k(h),...w});return A(G,l)},Bd=async(h,d)=>{const l=h.body,w=xd(l.Error,d),G=new Eh({$metadata:k(h),...w});return A(G,l)},qd=async(h,d)=>{const l=h.body,w=id(l.Error,d),G=new Fh({$metadata:k(h),...w});return A(G,l)},yd=async(h,d)=>{const l=h.body,w=cd(l.Error,d),G=new kh({$metadata:k(h),...w});return A(G,l)},Qd=async(h,d)=>{const l=h.body,w=ed(l.Error,d),G=new mh({$metadata:k(h),...w});return A(G,l)},Xd=async(h,d)=>{const l=h.body,w=pd(l.Error,d),G=new Jh({$metadata:k(h),...w});return A(G,l)},Yd=async(h,d)=>{const l=h.body,w=nd(l.Error,d),G=new Dh({$metadata:k(h),...w});return A(G,l)},Zd=(h,d)=>{const l={};if(h[T]!=null)l[T]=h[T];if(h[i]!=null)l[i]=h[i];if(h[$]!=null){const w=Bh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const w=n0(h[e],d);if(h[e]?.length===0)l.Tags=[];Object.entries(w).forEach(([G,H])=>{const I=`Tags.${G}`;l[I]=H})}if(h[Oh]!=null){const w=Rd(h[Oh],d);if(h[Oh]?.length===0)l.TransitiveTagKeys=[];Object.entries(w).forEach(([G,H])=>{const I=`TransitiveTagKeys.${G}`;l[I]=H})}if(h[Vh]!=null)l[Vh]=h[Vh];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];if(h[V]!=null)l[V]=h[V];if(h[Lh]!=null){const w=Td(h[Lh],d);if(h[Lh]?.length===0)l.ProvidedContexts=[];Object.entries(w).forEach(([G,H])=>{const I=`ProvidedContexts.${G}`;l[I]=H})}return l},$d=(h,d)=>{const l={};if(h[T]!=null)l[T]=h[T];if(h[Ah]!=null)l[Ah]=h[Ah];if(h[_h]!=null)l[_h]=h[_h];if(h[$]!=null){const w=Bh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},Ud=(h,d)=>{const l={};if(h[T]!=null)l[T]=h[T];if(h[i]!=null)l[i]=h[i];if(h[ih]!=null)l[ih]=h[ih];if(h[jh]!=null)l[jh]=h[jh];if(h[$]!=null){const w=Bh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},Vd=(h,d)=>{const l={};if(h[Ph]!=null)l[Ph]=h[Ph];return l},Pd=(h,d)=>{const l={};if(h[O]!=null)l[O]=h[O];return l},vd=(h,d)=>{return{}},Md=(h,d)=>{const l={};if(h[Wh]!=null)l[Wh]=h[Wh];if(h[Z]!=null)l[Z]=h[Z];if(h[$]!=null){const w=Bh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const w=n0(h[e],d);if(h[e]?.length===0)l.Tags=[];Object.entries(w).forEach(([G,H])=>{const I=`Tags.${G}`;l[I]=H})}return l},zd=(h,d)=>{const l={};if(h[y]!=null)l[y]=h[y];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];return l},Bh=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;const H=Nd(G,d);Object.entries(H).forEach(([I,Q])=>{l[`member.${w}.${I}`]=Q}),w++}return l},Nd=(h,d)=>{const l={};if(h[ch]!=null)l[ch]=h[ch];return l},Wd=(h,d)=>{const l={};if(h[Rh]!=null)l[Rh]=h[Rh];if(h[Zh]!=null)l[Zh]=h[Zh];return l},Td=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;const H=Wd(G,d);Object.entries(H).forEach(([I,Q])=>{l[`member.${w}.${I}`]=Q}),w++}return l},Ad=(h,d)=>{const l={};if(h[Nh]!=null)l[Nh]=h[Nh];if(h[xh]!=null)l[xh]=h[xh];return l},Rd=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;l[`member.${w}`]=G,w++}return l},n0=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;const H=Ad(G,d);Object.entries(H).forEach(([I,Q])=>{l[`member.${w}.${I}`]=Q}),w++}return l},ph=(h,d)=>{const l={};if(h[Yh]!=null)l[Yh]=S(h[Yh]);if(h[W]!=null)l[W]=S(h[W]);return l},Ld=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[N]!=null)l[N]=ph(h[N],d);if(h[U]!=null)l[U]=u(h[U]);if(h[V]!=null)l[V]=S(h[V]);return l},jd=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[N]!=null)l[N]=ph(h[N],d);if(h[U]!=null)l[U]=u(h[U]);if(h[rh]!=null)l[rh]=S(h[rh]);if(h[fh]!=null)l[fh]=S(h[fh]);if(h[zh]!=null)l[zh]=S(h[zh]);if(h[x]!=null)l[x]=S(h[x]);if(h[Th]!=null)l[Th]=S(h[Th]);if(h[V]!=null)l[V]=S(h[V]);return l},ad=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[bh]!=null)l[bh]=S(h[bh]);if(h[N]!=null)l[N]=ph(h[N],d);if(h[U]!=null)l[U]=u(h[U]);if(h[ah]!=null)l[ah]=S(h[ah]);if(h[x]!=null)l[x]=S(h[x]);if(h[V]!=null)l[V]=S(h[V]);return l},t=(h,d)=>{const l={};if(h[O]!=null)l[O]=S(h[O]);if(h[sh]!=null)l[sh]=S(h[sh]);if(h[Ch]!=null)l[Ch]=S(h[Ch]);if(h[Uh]!=null)l[Uh]=T0(A0(h[Uh]));return l},rd=(h,d)=>{const l={};if(h[$h]!=null)l[$h]=S(h[$h]);return l},sd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},_d=(h,d)=>{const l={};if(h[Mh]!=null)l[Mh]=S(h[Mh]);if(h[W]!=null)l[W]=S(h[W]);return l},bd=(h,d)=>{const l={};if(h[g]!=null)l[g]=S(h[g]);return l},fd=(h,d)=>{const l={};if(h[gh]!=null)l[gh]=S(h[gh]);if(h[g]!=null)l[g]=S(h[g]);if(h[W]!=null)l[W]=S(h[W]);return l},Cd=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[vh]!=null)l[vh]=_d(h[vh],d);if(h[U]!=null)l[U]=u(h[U]);return l},Od=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);return l},gd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},xd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},id=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},cd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},ed=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},pd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},nd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},k=(h)=>({httpStatusCode:h.statusCode,requestId:h.headers["x-amzn-requestid"]??h.headers["x-amzn-request-id"]??h.headers["x-amz-request-id"],extendedRequestId:h.headers["x-amz-id-2"],cfId:h.headers["x-amz-cf-id"]});var od=R0(Y),j=async(h,d,l,w,G)=>{const{hostname:H,protocol:I="https",port:Q,path:v}=await h.endpoint(),M={protocol:I,hostname:H,port:Q,method:"POST",path:v.endsWith("/")?v.slice(0,-1)+l:v+l,headers:d};if(w!==void 0)M.hostname=w;if(G!==void 0)M.body=G;return new W0(M)},a={"content-type":"application/x-www-form-urlencoded"},r="2011-06-15",s="Action",O="AccessKeyId",ud="AssumeRole",Yh="AssumedRoleId",N="AssumedRoleUser",td="AssumeRoleWithSAML",hw="AssumeRoleWithWebIdentity",g="Account",W="Arn",x="Audience",q="Credentials",Zh="ContextAssertion",lw="DecodeAuthorizationMessage",$h="DecodedMessage",y="DurationSeconds",Uh="Expiration",Vh="ExternalId",Ph="EncodedMessage",vh="FederatedUser",Mh="FederatedUserId",dw="GetAccessKeyInfo",ww="GetCallerIdentity",Gw="GetFederationToken",Iw="GetSessionToken",zh="Issuer",Nh="Key",Wh="Name",Th="NameQualifier",Z="Policy",$="PolicyArns",Ah="PrincipalArn",Rh="ProviderArn",Lh="ProvidedContexts",jh="ProviderId",U="PackedPolicySize",ah="Provider",T="RoleArn",i="RoleSessionName",rh="Subject",sh="SecretAccessKey",_h="SAMLAssertion",bh="SubjectFromWebIdentityToken",V="SourceIdentity",c="SerialNumber",fh="SubjectType",Ch="SessionToken",e="Tags",p="TokenCode",Oh="TransitiveTagKeys",gh="UserId",_="Version",xh="Value",ih="WebIdentityToken",ch="arn",m="message",b=(h)=>Object.entries(h).map(([d,l])=>eh(d)+"="+eh(l)).join("&"),Hw=(h,d)=>{if(d.Error?.Code!==void 0)return d.Error.Code;if(h.statusCode==404)return"NotFound"};class hh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,U0).ser(L0).de(C0).build(){}class nh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(V0,P0).ser(j0).de(O0).build(){}class lh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(v0,M0).ser(a0).de(g0).build(){}class oh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(r0).de(x0).build(){}class uh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(s0).de(i0).build(){}class th extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(_0).de(c0).build(){}class hl extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,z0).ser(b0).de(e0).build(){}class ll extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,N0).ser(f0).de(p0).build(){}var Sw={AssumeRoleCommand:hh,AssumeRoleWithSAMLCommand:nh,AssumeRoleWithWebIdentityCommand:lh,DecodeAuthorizationMessageCommand:oh,GetAccessKeyInfoCommand:uh,GetCallerIdentityCommand:th,GetFederationTokenCommand:hl,GetSessionTokenCommand:ll};class u0 extends R{}o0(Sw,u0);var t0="us-east-1",hd=(h)=>{if(typeof h?.Arn==="string"){const d=h.Arn.split(":");if(d.length>4&&d[4]!=="")return d[4]}return},ld=async(h,d,l)=>{const w=typeof h==="function"?await h():h,G=typeof d==="function"?await d():d;return l?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${w} (provider)`,`${G} (parent client)`,`${t0} (STS default)`),w??G??t0},dd=(h,d)=>{let l,w;return async(G,H)=>{if(w=G,!l){const{logger:M=h?.parentClientConfig?.logger,region:n,requestHandler:qh=h?.parentClientConfig?.requestHandler,credentialProviderLogger:Id}=h,Hd=await ld(n,h?.parentClientConfig?.region,Id);l=new d({credentialDefaultProvider:()=>async()=>w,region:Hd,requestHandler:qh,logger:M})}const{Credentials:I,AssumedRoleUser:Q}=await l.send(new hh(H));if(!I||!I.AccessKeyId||!I.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${H.RoleArn}`);const v=hd(Q);return{accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,sessionToken:I.SessionToken,expiration:I.Expiration,...I.CredentialScope&&{credentialScope:I.CredentialScope},...v&&{accountId:v}}}},wd=(h,d)=>{let l;return async(w)=>{if(!l){const{logger:Q=h?.parentClientConfig?.logger,region:v,requestHandler:M=h?.parentClientConfig?.requestHandler,credentialProviderLogger:n}=h,qh=await ld(v,h?.parentClientConfig?.region,n);l=new d({region:qh,requestHandler:M,logger:Q})}const{Credentials:G,AssumedRoleUser:H}=await l.send(new lh(w));if(!G||!G.AccessKeyId||!G.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${w.RoleArn}`);const I=hd(H);return{accessKeyId:G.AccessKeyId,secretAccessKey:G.SecretAccessKey,sessionToken:G.SessionToken,expiration:G.Expiration,...G.CredentialScope&&{credentialScope:G.CredentialScope},...I&&{accountId:I}}}};var Gd=(h,d)=>{if(!d)return h;else return class l extends h{constructor(w){super(w);for(let G of d)this.middlewareStack.use(G)}}},mw=(h={},d)=>dd(h,Gd(R,d)),Jw=(h={},d)=>wd(h,Gd(R,d)),AG=(h)=>(d)=>h({roleAssumer:mw(d),roleAssumerWithWebIdentity:Jw(d),...d});export{Jw as getDefaultRoleAssumerWithWebIdentity,mw as getDefaultRoleAssumer,AG as decorateDefaultCredentialProvider,F0 as __Client,Y as STSServiceException,R as STSClient,u0 as STS,Dh as RegionDisabledException,Jh as PackedPolicyTooLargeException,mh as MalformedPolicyDocumentException,kh as InvalidIdentityTokenException,Fh as InvalidAuthorizationMessageException,Eh as IDPRejectedClaimException,Kh as IDPCommunicationErrorException,N0 as GetSessionTokenResponseFilterSensitiveLog,ll as GetSessionTokenCommand,z0 as GetFederationTokenResponseFilterSensitiveLog,hl as GetFederationTokenCommand,th as GetCallerIdentityCommand,uh as GetAccessKeyInfoCommand,Sh as ExpiredTokenException,oh as DecodeAuthorizationMessageCommand,o as CredentialsFilterSensitiveLog,M0 as AssumeRoleWithWebIdentityResponseFilterSensitiveLog,v0 as AssumeRoleWithWebIdentityRequestFilterSensitiveLog,lh as AssumeRoleWithWebIdentityCommand,P0 as AssumeRoleWithSAMLResponseFilterSensitiveLog,V0 as AssumeRoleWithSAMLRequestFilterSensitiveLog,nh as AssumeRoleWithSAMLCommand,U0 as AssumeRoleResponseFilterSensitiveLog,hh as AssumeRoleCommand,K as $Command};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as l} from"./chunk-bdf4f2b1862899bb.js";import{sb as m} from"./chunk-f316793e4ec0f386.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-16dbe3a15379140b.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
|
+
var et=function(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)},F=function(t,e=!1){let s=[],i=0;for(;i<t.length;){let a=t[i],u=function(o){if(!e)throw new TypeError(o);s.push({type:"INVALID_CHAR",index:i,value:t[i++]})};if(a==="*"){s.push({type:"ASTERISK",index:i,value:t[i++]});continue}if(a==="+"||a==="?"){s.push({type:"OTHER_MODIFIER",index:i,value:t[i++]});continue}if(a==="\\"){s.push({type:"ESCAPED_CHAR",index:i++,value:t[i++]});continue}if(a==="{"){s.push({type:"OPEN",index:i,value:t[i++]});continue}if(a==="}"){s.push({type:"CLOSE",index:i,value:t[i++]});continue}if(a===":"){let o="",r=i+1;for(;r<t.length;){let h=t.substr(r,1);if(r===i+1&&Y.test(h)||r!==i+1&&tt.test(h)){o+=t[r++];continue}break}if(!o){u(`Missing parameter name at ${i}`);continue}s.push({type:"NAME",index:i,value:o}),i=r;continue}if(a==="("){let o=1,r="",h=i+1,n=!1;if(t[h]==="?"){u(`Pattern cannot start with "?" at ${h}`);continue}for(;h<t.length;){if(!et(t[h],!1)){u(`Invalid character '${t[h]}' at ${h}.`),n=!0;break}if(t[h]==="\\"){r+=t[h++]+t[h++];continue}if(t[h]===")"){if(o--,o===0){h++;break}}else if(t[h]==="("&&(o++,t[h+1]!=="?")){u(`Capturing groups are not allowed at ${h}`),n=!0;break}r+=t[h++]}if(n)continue;if(o){u(`Unbalanced pattern at ${i}`);continue}if(!r){u(`Missing pattern at ${i}`);continue}s.push({type:"REGEX",index:i,value:r}),i=h;continue}s.push({type:"CHAR",index:i,value:t[i++]})}return s.push({type:"END",index:i,value:""}),s},M=function(t,e={}){let s=F(t);e.delimiter??="/#?",e.prefixes??="./";let i=`[^${d(e.delimiter)}]+?`,a=[],u=0,o=0,r="",h=new Set,n=(p)=>{if(o<s.length&&s[o].type===p)return s[o++].value},f=()=>n("OTHER_MODIFIER")??n("ASTERISK"),w=(p)=>{let c=n(p);if(c!==void 0)return c;let{type:l,index:R}=s[o];throw new TypeError(`Unexpected ${l} at ${R}, expected ${p}`)},E=()=>{let p="",c;for(;c=n("CHAR")??n("ESCAPED_CHAR");)p+=c;return p},Q=(p)=>p,T=e.encodePart||Q,U="",O=(p)=>{U+=p},I=()=>{U.length&&(a.push(new P(3,"","",T(U),"",3)),U="")},_=(p,c,l,R,v)=>{let g=3;switch(v){case"?":g=1;break;case"*":g=0;break;case"+":g=2;break}if(!c&&!l&&g===3){O(p);return}if(I(),!c&&!l){if(!p)return;a.push(new P(3,"","",T(p),"",g));return}let m;l?l==="*"?m=D:m=l:m=i;let C=2;m===i?(C=1,m=""):m===D&&(C=0,m="");let b;if(c?b=c:l&&(b=u++),h.has(b))throw new TypeError(`Duplicate name '${b}'.`);h.add(b),a.push(new P(C,b,T(p),m,T(R),g))};for(;o<s.length;){let p=n("CHAR"),c=n("NAME"),l=n("REGEX");if(!c&&!l&&(l=n("ASTERISK")),c||l){let v=p??"";e.prefixes.indexOf(v)===-1&&(O(v),v=""),I();let g=f();_(v,c,l,"",g);continue}let R=p??n("ESCAPED_CHAR");if(R){O(R);continue}if(n("OPEN")){let v=E(),g=n("NAME"),m=n("REGEX");!g&&!m&&(m=n("ASTERISK"));let C=E();w("CLOSE");let b=f();_(v,g,m,C,b);continue}I(),w("END")}return a},d=function(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")},j=function(t){return t&&t.ignoreCase?"ui":"u"},st=function(t,e,s){return W(M(t,s),e,s)},k=function(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}},W=function(t,e,s={}){s.delimiter??="/#?",s.prefixes??="./",s.sensitive??=!1,s.strict??=!1,s.end??=!0,s.start??=!0,s.endsWith="";let i=s.start?"^":"";for(let r of t){if(r.type===3){r.modifier===3?i+=d(r.value):i+=`(?:${d(r.value)})${k(r.modifier)}`;continue}e&&e.push(r.name);let h=`[^${d(s.delimiter)}]+?`,n=r.value;if(r.type===1?n=h:r.type===0&&(n=D),!r.prefix.length&&!r.suffix.length){r.modifier===3||r.modifier===1?i+=`(${n})${k(r.modifier)}`:i+=`((?:${n})${k(r.modifier)})`;continue}if(r.modifier===3||r.modifier===1){i+=`(?:${d(r.prefix)}(${n})${d(r.suffix)})`,i+=k(r.modifier);continue}i+=`(?:${d(r.prefix)}`,i+=`((?:${n})(?:`,i+=d(r.suffix),i+=d(r.prefix),i+=`(?:${n}))*)${d(r.suffix)})`,r.modifier===0&&(i+="?")}let a=`[${d(s.endsWith)}]|\$`,u=`[${d(s.delimiter)}]`;if(s.end)return s.strict||(i+=`${u}?`),s.endsWith.length?i+=`(?=${a})`:i+="$",new RegExp(i,j(s));s.strict||(i+=`(?:${u}(?=${a}))?`);let o=!1;if(t.length){let r=t[t.length-1];r.type===3&&r.modifier===3&&(o=s.delimiter.indexOf(r)>-1)}return o||(i+=`(?=${u}|${a})`),new RegExp(i,j(s))},nt=function(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1},G=function(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t},ot=function(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t},K=function(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["},V=function(t){if(!t)return!0;for(let e of X)if(t.test(e))return!0;return!1},ht=function(t,e){if(t=G(t,"#"),e||t==="")return t;let s=new URL("https://example.com");return s.hash=t,s.hash?s.hash.substring(1,s.hash.length):""},at=function(t,e){if(t=G(t,"?"),e||t==="")return t;let s=new URL("https://example.com");return s.search=t,s.search?s.search.substring(1,s.search.length):""},ut=function(t,e){return e||t===""?t:K(t)?q(t):Z(t)},pt=function(t,e){if(e||t==="")return t;let s=new URL("https://example.com");return s.password=t,s.password},ct=function(t,e){if(e||t==="")return t;let s=new URL("https://example.com");return s.username=t,s.username},ft=function(t,e,s){if(s||t==="")return t;if(e&&!X.includes(e))return new URL(`${e}:${t}`).pathname;let i=t[0]=="/";return t=new URL(i?t:"/-"+t,"https://example.com").pathname,i||(t=t.substring(2,t.length)),t},lt=function(t,e,s){return z(e)===t&&(t=""),s||t===""?t:B(t)},mt=function(t,e){return t=ot(t,":"),e||t===""?t:N(t)},z=function(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}},N=function(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)},dt=function(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username},gt=function(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password},Z=function(t){if(t==="")return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname},q=function(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()},B=function(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)},wt=function(t){if(t==="")return t;let e=new URL("https://example.com");return e.pathname=t[0]!=="/"?"/-"+t:t,t[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname},yt=function(t){return t===""?t:new URL(`data:${t}`).pathname},vt=function(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)},bt=function(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)},H=function(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type 'string'.");let s=new URL(t,e);return{protocol:s.protocol.substring(0,s.protocol.length-1),username:s.username,password:s.password,hostname:s.hostname,port:s.port,pathname:s.pathname,search:s.search!==""?s.search.substring(1,s.search.length):void 0,hash:s.hash!==""?s.hash.substring(1,s.hash.length):void 0}},y=function(t,e){return e?A(t):t},L=function(t,e,s){let i;if(typeof e.baseURL=="string")try{i=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=y(i.protocol.substring(0,i.protocol.length-1),s)),!s&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=y(i.username,s)),!s&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=y(i.password,s)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=y(i.hostname,s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=y(i.port,s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=y(i.pathname,s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=y(i.search.substring(1,i.search.length),s)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=y(i.hash.substring(1,i.hash.length),s))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=mt(e.protocol,s)),typeof e.username=="string"&&(t.username=ct(e.username,s)),typeof e.password=="string"&&(t.password=pt(e.password,s)),typeof e.hostname=="string"&&(t.hostname=ut(e.hostname,s)),typeof e.port=="string"&&(t.port=lt(e.port,t.protocol,s)),typeof e.pathname=="string"){if(t.pathname=e.pathname,i&&!nt(t.pathname,s)){let a=i.pathname.lastIndexOf("/");a>=0&&(t.pathname=y(i.pathname.substring(0,a+1),s)+t.pathname)}t.pathname=ft(t.pathname,t.protocol,s)}return typeof e.search=="string"&&(t.search=at(e.search,s)),typeof e.hash=="string"&&(t.hash=ht(e.hash,s)),t},A=function(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")},$t=function(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")},Et=function(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let s=".*",i=`[^${$t(e.delimiter)}]+?`,a=/[$_\u200C\u200D\p{ID_Continue}]/u,u="";for(let o=0;o<t.length;++o){let r=t[o];if(r.type===3){if(r.modifier===3){u+=A(r.value);continue}u+=`{${A(r.value)}}${k(r.modifier)}`;continue}let h=r.hasCustomName(),n=!!r.suffix.length||!!r.prefix.length&&(r.prefix.length!==1||!e.prefixes.includes(r.prefix)),f=o>0?t[o-1]:null,w=o<t.length-1?t[o+1]:null;if(!n&&h&&r.type===1&&r.modifier===3&&w&&!w.prefix.length&&!w.suffix.length)if(w.type===3){let E=w.value.length>0?w.value[0]:"";n=a.test(E)}else n=!w.hasCustomName();if(!n&&!r.prefix.length&&f&&f.type===3){let E=f.value[f.value.length-1];n=e.prefixes.includes(E)}n&&(u+="{"),u+=A(r.prefix),h&&(u+=`:${r.name}`),r.type===2?u+=`(${r.value})`:r.type===1?h||(u+=`(${i})`):r.type===0&&(!h&&(!f||f.type===3||f.modifier!==3||n||r.prefix!=="")?u+="*":u+=`(${s})`),r.type===1&&h&&r.suffix.length&&a.test(r.suffix[0])&&(u+="\\"),u+=A(r.suffix),n&&(u+="}"),r.modifier!==3&&(u+=k(r.modifier))}return u},P=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,s,i,a,u){this.type=t,this.name=e,this.prefix=s,this.value=i,this.suffix=a,this.modifier=u}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},Y=/[$_\p{ID_Start}]/u,tt=/[$_\u200C\u200D\p{ID_Continue}]/u,D=".*",$={delimiter:"",prefixes:"",sensitive:!0,strict:!0},rt={delimiter:".",prefixes:"",sensitive:!0,strict:!0},it={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0},X=["ftp","file","http","https","ws","wss"],xt=class{#n;#r=[];#e={};#t=0;#i=1;#u=0;#h=0;#l=0;#m=0;#d=!1;constructor(t){this.#n=t}get result(){return this.#e}parse(){for(this.#r=F(this.#n,!0);this.#t<this.#r.length;this.#t+=this.#i){if(this.#i=1,this.#r[this.#t].type==="END"){if(this.#h===0){this.#v(),this.#p()?this.#s(9,1):this.#c()?this.#s(8,1):this.#s(7,0);continue}else if(this.#h===2){this.#f(5);continue}this.#s(10,0);break}if(this.#l>0)if(this.#C())this.#l-=1;else continue;if(this.#k()){this.#l+=1;continue}switch(this.#h){case 0:this.#b()&&this.#f(1);break;case 1:if(this.#b()){this.#P();let t=7,e=1;this.#$()?(t=2,e=3):this.#d&&(t=2),this.#s(t,e)}break;case 2:this.#w()?this.#f(3):(this.#y()||this.#c()||this.#p())&&this.#f(5);break;case 3:this.#E()?this.#s(4,1):this.#w()&&this.#s(5,1);break;case 4:this.#w()&&this.#s(5,1);break;case 5:this.#L()?this.#m+=1:this.#A()&&(this.#m-=1),this.#R()&&!this.#m?this.#s(6,1):this.#y()?this.#s(7,0):this.#c()?this.#s(8,1):this.#p()&&this.#s(9,1);break;case 6:this.#y()?this.#s(7,0):this.#c()?this.#s(8,1):this.#p()&&this.#s(9,1);break;case 7:this.#c()?this.#s(8,1):this.#p()&&this.#s(9,1);break;case 8:this.#p()&&this.#s(9,1);break;case 9:break;case 10:break}}this.#e.hostname!==void 0&&this.#e.port===void 0&&(this.#e.port="")}#s(t,e){switch(this.#h){case 0:break;case 1:this.#e.protocol=this.#a();break;case 2:break;case 3:this.#e.username=this.#a();break;case 4:this.#e.password=this.#a();break;case 5:this.#e.hostname=this.#a();break;case 6:this.#e.port=this.#a();break;case 7:this.#e.pathname=this.#a();break;case 8:this.#e.search=this.#a();break;case 9:this.#e.hash=this.#a();break;case 10:break}this.#h!==0&&t!==10&&([1,2,3,4].includes(this.#h)&&[6,7,8,9].includes(t)&&(this.#e.hostname??=""),[1,2,3,4,5,6].includes(this.#h)&&[8,9].includes(t)&&(this.#e.pathname??=this.#d?"/":""),[1,2,3,4,5,6,7].includes(this.#h)&&t===9&&(this.#e.search??="")),this.#x(t,e)}#x(t,e){this.#h=t,this.#u=this.#t+e,this.#t+=e,this.#i=0}#v(){this.#t=this.#u,this.#i=0}#f(t){this.#v(),this.#h=t}#g(t){return t<0&&(t=this.#r.length-t),t<this.#r.length?this.#r[t]:this.#r[this.#r.length-1]}#o(t,e){let s=this.#g(t);return s.value===e&&(s.type==="CHAR"||s.type==="ESCAPED_CHAR"||s.type==="INVALID_CHAR")}#b(){return this.#o(this.#t,":")}#$(){return this.#o(this.#t+1,"/")&&this.#o(this.#t+2,"/")}#w(){return this.#o(this.#t,"@")}#E(){return this.#o(this.#t,":")}#R(){return this.#o(this.#t,":")}#y(){return this.#o(this.#t,"/")}#c(){if(this.#o(this.#t,"?"))return!0;if(this.#r[this.#t].value!=="?")return!1;let t=this.#g(this.#t-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#p(){return this.#o(this.#t,"#")}#k(){return this.#r[this.#t].type=="OPEN"}#C(){return this.#r[this.#t].type=="CLOSE"}#L(){return this.#o(this.#t,"[")}#A(){return this.#o(this.#t,"]")}#a(){let t=this.#r[this.#t],e=this.#g(this.#u).index;return this.#n.substring(e,t.index)}#P(){let t={};Object.assign(t,$),t.encodePart=N;let e=st(this.#a(),void 0,t);this.#d=V(e)}},S=["protocol","username","password","hostname","port","pathname","search","hash"],x="*",J=class{#n;#r={};#e={};#t={};#i={};#u=!1;constructor(t={},e,s){try{let i;if(typeof e=="string"?i=e:s=e,typeof t=="string"){let r=new xt(t);if(r.parse(),t=r.result,i===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=i}else{if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(i)throw new TypeError("parameter 1 is not of type 'string'.")}typeof s>"u"&&(s={ignoreCase:!1});let a={ignoreCase:s.ignoreCase===!0},u={pathname:x,protocol:x,username:x,password:x,hostname:x,port:x,search:x,hash:x};this.#n=L(u,t,!0),z(this.#n.protocol)===this.#n.port&&(this.#n.port="");let o;for(o of S){if(!(o in this.#n))continue;let r={},h=this.#n[o];switch(this.#e[o]=[],o){case"protocol":Object.assign(r,$),r.encodePart=N;break;case"username":Object.assign(r,$),r.encodePart=dt;break;case"password":Object.assign(r,$),r.encodePart=gt;break;case"hostname":Object.assign(r,rt),K(h)?r.encodePart=q:r.encodePart=Z;break;case"port":Object.assign(r,$),r.encodePart=B;break;case"pathname":V(this.#r.protocol)?(Object.assign(r,it,a),r.encodePart=wt):(Object.assign(r,$,a),r.encodePart=yt);break;case"search":Object.assign(r,$,a),r.encodePart=vt;break;case"hash":Object.assign(r,$,a),r.encodePart=bt;break}try{this.#i[o]=M(h,r),this.#r[o]=W(this.#i[o],this.#e[o],r),this.#t[o]=Et(this.#i[o],r),this.#u=this.#u||this.#i[o].some((n)=>n.type===2)}catch{throw new TypeError(`invalid ${o} pattern '${this.#n[o]}'.`)}}}catch(i){throw new TypeError(`Failed to construct 'URLPattern': ${i.message}`)}}test(t={},e){let s={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{typeof t=="object"?s=L(s,t,!1):s=L(s,H(t,e),!1)}catch{return!1}let i;for(i of S)if(!this.#r[i].exec(s[i]))return!1;return!0}exec(t={},e){let s={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?s=L(s,t,!1):s=L(s,H(t,e),!1)}catch{return null}let i={};e?i.inputs=[t,e]:i.inputs=[t];let a;for(a of S){let u=this.#r[a].exec(s[a]);if(!u)return null;let o={};for(let[r,h]of this.#e[a].entries())if(typeof h=="string"||typeof h=="number"){let n=u[r+1];o[h]=n}i[a]={input:s[a]??"",groups:o}}return i}static compareComponent(t,e,s){let i=(r,h)=>{for(let n of["type","modifier","prefix","value","suffix"]){if(r[n]<h[n])return-1;if(r[n]===h[n])continue;return 1}return 0},a=new P(3,"","","","",3),u=new P(0,"","","","",3),o=(r,h)=>{let n=0;for(;n<Math.min(r.length,h.length);++n){let f=i(r[n],h[n]);if(f)return f}return r.length===h.length?0:i(r[n]??a,h[n]??a)};return!e.#t[t]&&!s.#t[t]?0:e.#t[t]&&!s.#t[t]?o(e.#i[t],[u]):!e.#t[t]&&s.#t[t]?o([u],s.#i[t]):o(e.#i[t],s.#i[t])}get protocol(){return this.#t.protocol}get username(){return this.#t.username}get password(){return this.#t.password}get hostname(){return this.#t.hostname}get port(){return this.#t.port}get pathname(){return this.#t.pathname}get search(){return this.#t.search}get hash(){return this.#t.hash}get hasRegExpGroups(){return this.#u}};if(!globalThis.URLPattern)globalThis.URLPattern=J;function Tt(t){const e=t.toString(),s=new Bun.CryptoHasher("sha1");return s.update(e),s.digest("hex")}
|
|
2
|
+
export{J as x,Tt as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as _} from"./chunk-bdf4f2b1862899bb.js";import"./chunk-dc23bfb4fd92e2f0.js";import{sb as a} from"./chunk-f316793e4ec0f386.js";import{Bb as h,vb as l} from"./chunk-ba051a98cd651063.js";var R=_(a(),1);var m=_(a(),1);var c=_(a(),1),C=(e,s,r)=>{const i={EcsContainer:async(t)=>{const{fromHttp:n}=await import("./chunk-d3033805e98482dc.js"),{fromContainerMetadata:d}=await import("./chunk-adb4e1e222eb1d20.js");return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),c.chain(n(t??{}),d(t))},Ec2InstanceMetadata:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:n}=await import("./chunk-adb4e1e222eb1d20.js");return n(t)},Environment:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:n}=await import("./chunk-c83b39b7178003da.js");return n(t)}};if(e in i)return i[e];else throw new c.CredentialsProviderError(`Unsupported credential source in profile ${s}. Got ${e}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:r})};var P=(e,{profile:s="default",logger:r}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(j(e,{profile:s,logger:r})||O(e,{profile:s,logger:r}))},j=(e,{profile:s,logger:r})=>{const i=typeof e.source_profile==="string"&&typeof e.credential_source==="undefined";if(i)r?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return i},O=(e,{profile:s,logger:r})=>{const i=typeof e.credential_source==="string"&&typeof e.source_profile==="undefined";if(i)r?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return i},v=async(e,s,r,i={})=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const t=s[e];if(!r.roleAssumer){const{getDefaultRoleAssumer:I}=await import("./chunk-16dbe3a15379140b.js");r.roleAssumer=I({...r.clientConfig,credentialProviderLogger:r.logger,parentClientConfig:r?.parentClientConfig},r.clientPlugins)}const{source_profile:n}=t;if(n&&n in i)throw new m.CredentialsProviderError("Detected a cycle attempting to resolve credentials for profile"+` ${l(r)}. Profiles visited: `+Object.keys(i).join(", "),{logger:r.logger});r.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${n?`source_profile=[${n}]`:`profile=[${e}]`}`);const d=n?o(n,{...s,[n]:{...s[n],role_arn:t.role_arn??s[n].role_arn}},r,{...i,[n]:!0}):(await C(t.credential_source,e,r.logger)(r))(),u={RoleArn:t.role_arn,RoleSessionName:t.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:t.external_id,DurationSeconds:parseInt(t.duration_seconds||"3600",10)},{mfa_serial:f}=t;if(f){if(!r.mfaCodeProvider)throw new m.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:r.logger,tryNextLink:!1});u.SerialNumber=f,u.TokenCode=await r.mfaCodeProvider(f)}const D=await d;return r.roleAssumer(D,u)};var x=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.credential_process==="string",b=async(e,s)=>import("./chunk-59980167a4c574b3.js").then(({fromProcess:r})=>r({...e,profile:s})());var A=async(e,s={})=>{const{fromSSO:r}=await import("./chunk-a991fdce275f1256.js");return r({profile:e,logger:s.logger})()},k=(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 w=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.aws_access_key_id==="string"&&typeof e.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,y=(e,s)=>{return s?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"),Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}})};var S=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.web_identity_token_file==="string"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,$=async(e,s)=>import("./chunk-4f5b07a6a6fd5cc6.js").then(({fromTokenFile:r})=>r({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:s.roleAssumerWithWebIdentity,logger:s.logger,parentClientConfig:s.parentClientConfig})());var o=async(e,s,r,i={})=>{const t=s[e];if(Object.keys(i).length>0&&w(t))return y(t,r);if(P(t,{profile:e,logger:r.logger}))return v(e,s,r,i);if(w(t))return y(t,r);if(S(t))return $(t,r);if(x(t))return b(r,e);if(k(t))return await A(e,r);throw new R.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})};var H=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const s=await h(e);return o(l(e),s,e)};export{H as fromIni};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as _} from"./chunk-bdf4f2b1862899bb.js";import"./chunk-dc23bfb4fd92e2f0.js";import{sb as y} from"./chunk-f316793e4ec0f386.js";import{Bb as S,vb as K} from"./chunk-ba051a98cd651063.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
|
+
// @bun
|
|
2
|
+
import{z as o} from"./chunk-bdf4f2b1862899bb.js";import{B as Be,Ba as i,C as Fe,Ca as y,Ea as Ne,F as g,H as We,L as ee,M as se,O as te,P as re,S as ce,T as ie,ea as ss,fa as R,ka as D,la as Ge,ma as h,ta as Te,ua as u,va as Ve,wa as le,xa as pe,ya as _e,za as $e} from"./chunk-01ffccc19e8ef862.js";import{$a as rs,Ga as Ie,Ha as Le,Ia as Ce,Ja as Me,Ka as os,Na as F,Oa as Ae,Pa as G,Qa as V,Ra as N,Sa as Ke,Ta as ye,Ua as me,Va as he,Wa as ue,Xa as Qe,Ya as Xe,_a as ts,ab as Ye,bb as we,db as be,eb as Ze,fb as xe,gb as je,ib as x,jb as ve,kb as ke,lb as Re,mb as qe,nb as Pe,ob as Je} from"./chunk-f0d3ed16a520ecf1.js";import"./chunk-dc23bfb4fd92e2f0.js";import{qb as ps,rb as l} from"./chunk-d43b3f444e738dd1.js";import"./chunk-f316793e4ec0f386.js";import"./chunk-ba051a98cd651063.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??ee,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??se,utf8Encoder:e?.utf8Encoder??te}};var Se=(e)=>{pe(process.version);const s=qe(e),t=()=>s().then(le),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(be),region:e?.region??l(he,ue),requestHandler:ce.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...xe,default:async()=>(await t()).retryMode||we}),sha256:e?.sha256??ke.bind(null,"sha256"),streamCollector:e?.streamCollector??ie,useDualstackEndpoint:e?.useDualstackEndpoint??l(ye),useFipsEndpoint:e?.useFipsEndpoint??l(me)}};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"./chunk-c83b39b7178003da.js";import{z as w} from"./chunk-bdf4f2b1862899bb.js";import{B as Oe,Ba as d,C as ue,Ca as o,Ea as I,F as Te,H as yr,L as be,M as je,O as Fe,P as De,S as Ge,T as Je,ea as E,fa as t,ga as Jr,ia as p,ja as b,ka as j,la as F,ma as h,ta as Er,ua as a,va as br,wa as Ve,xa as We,ya as er,za as rr} from"./chunk-01ffccc19e8ef862.js";import{$a as $,Ga as hr,Ha as nr,Ia as or,Ja as dr,Ka as Kr,Na as N,Oa as cr,Pa as $e,Qa as Ie,Ra as Re,Sa as tr,Ta as fe,Ua as Ae,Va as Ke,Wa as Me,Xa as ar,Ya as mr,_a as S,ab as wr,bb as Be,db as Le,eb as kr,fb as Qe,gb as vr,ib as q,jb as Xe,kb as Ye,lb as Ze,mb as He,nb as sr,ob as ir} from"./chunk-f0d3ed16a520ecf1.js";import"./chunk-dc23bfb4fd92e2f0.js";import{qb as Qr,rb as R} from"./chunk-d43b3f444e738dd1.js";import"./chunk-f316793e4ec0f386.js";import{tb as pe} from"./chunk-b97189ea9588db36.js";import"./chunk-ba051a98cd651063.js";var P=w(N(),1);var re=w(q(),1),U=w(Kr(),1),Mr=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}},H=function(e){return{schemeId:"smithy.api#noAuth"}},se=async(e,s,r)=>{return{operation:U.getSmithyContext(s).operation,region:await U.normalizeProvider(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ie=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(H(e));break}case"RegisterClient":{s.push(H(e));break}case"StartDeviceAuthorization":{s.push(H(e));break}default:s.push(Mr(e))}return s},le=(e)=>{return{...re.resolveAwsSdkSigV4Config(e)}};var he=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},v={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var ne={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 Ne=w(q(),1);var qe=w(q(),1),Ue=w(N(),1);var xe=w(Qr(),1);var oe={["required"]:!1,type:"String"},de={["required"]:!0,default:!1,type:"Boolean"},ye={["ref"]:"Endpoint"},ke={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},ve={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},ce={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Ee={["ref"]:"PartitionResult"},te={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Ee,"supportsDualStack"]}]},ae=[ke],me=[ve],we=[{["ref"]:"Region"}],Lr={version:"1.0",parameters:{Region:oe,UseDualStack:de,UseFIPS:de,Endpoint:oe},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ye]}],rules:[{conditions:ae,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:me,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ye,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:we}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:we,assign:"PartitionResult"}],rules:[{conditions:[ke,ve],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,ce]},te],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:ae,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[ce,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ee,"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:me,rules:[{conditions:[te],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"}]},Se=Lr;var Pe=(e,s={})=>{return Ie(Se,{endpointParams:e,logger:s.logger})};$e.aws=Re;var ze=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??be,base64Encoder:e?.base64Encoder??De,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Pe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ie,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new qe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ue.NoAuthSigner}],logger:e?.logger??new Te,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??xe.parseUrl,utf8Decoder:e?.utf8Decoder??je,utf8Encoder:e?.utf8Encoder??Fe}};var _e=(e)=>{We(process.version);const s=He(e),r=()=>s().then(Ve),i=ze(e);return Ne.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Ze,credentialDefaultProvider:e?.credentialDefaultProvider??pe,defaultUserAgentProvider:e?.defaultUserAgentProvider??Xe({serviceId:i.serviceId,clientVersion:ne.version}),maxAttempts:e?.maxAttempts??R(Le),region:e?.region??R(Ke,Me),requestHandler:Ge.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Qe,default:async()=>(await r()).retryMode||Be}),sha256:e?.sha256??Ye.bind(null,"sha256"),streamCollector:e?.streamCollector??Je,useDualstackEndpoint:e?.useDualstackEndpoint??R(fe),useFipsEndpoint:e?.useFipsEndpoint??R(Ae)}};var Ce=(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}}},ge=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var x=(e)=>e,lr=(e,s)=>{const r={...x(sr(e)),...x(er(e)),...x(Oe(e)),...x(Ce(e))};return s.forEach((i)=>i.configure(r)),{...e,...ir(r),...rr(r),...ue(r),...ge(r)}};class _ extends yr{constructor(...[e]){const s=_e(e||{}),r=he(s),i=cr(r),l=kr(i),n=ar(l),T=hr(n),Wr=wr(T),fr=le(Wr),ee=lr(fr,e?.extensions||[]);super(ee);this.config=ee,this.middlewareStack.use(tr(this.config)),this.middlewareStack.use(vr(this.config)),this.middlewareStack.use(mr(this.config)),this.middlewareStack.use(nr(this.config)),this.middlewareStack.use(or(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:se,identityProviderConfigProvider:async(Ar)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Ar.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class y extends Er{constructor(e){super(e);Object.setPrototypeOf(this,y.prototype)}}class z extends y{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",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:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",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:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends y{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends y{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",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:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",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:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",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:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",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:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",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:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",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:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description}}class Q extends y{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class X extends y{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}class Y extends y{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}var Sr=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),$r=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Ir=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Rr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Pr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),Tr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var k=w(q(),1),D=w(N(),1);var jr=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()},Fr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");const l=d({[ls]:[,"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()},Dr=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()},qr=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()},Ur=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},xr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.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},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:p,clientSecret:h,clientSecretExpiresAt:p,tokenEndpoint:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.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},Z=async(e,s)=>{const r={...e,body:await k.parseJsonErrorBody(e.body,s)},i=k.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Yr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Zr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Hr(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Nr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await _r(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Cr(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await Or(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await es(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await rs(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await ss(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await is(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await ur(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await pr(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await gr(r,s);default:const l=r.body;return Xr({output:e,parsedBody:l,errorCode:i})}},Xr=br(y),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 W({$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 X({$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 f({$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 Y({$metadata:c(e),...r});return a(n,e.body)},Or=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)},ur=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 Q({$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)},is=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new L({$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 ls="aws_iam";class C extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Sr,$r).ser(jr).de(Ur).build(){}class g extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Ir,Rr).ser(Fr).de(xr).build(){}class O extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Pr).ser(Dr).de(zr).build(){}class u extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(Tr,void 0).ser(qr).de(Gr).build(){}var hs={CreateTokenCommand:C,CreateTokenWithIAMCommand:g,RegisterClientCommand:O,StartDeviceAuthorizationCommand:u};class Vr extends _{}Jr(hs,Vr);export{yr as __Client,L as UnsupportedGrantTypeException,B as UnauthorizedClientException,Tr as StartDeviceAuthorizationRequestFilterSensitiveLog,u as StartDeviceAuthorizationCommand,M as SlowDownException,y as SSOOIDCServiceException,_ as SSOOIDCClient,Vr as SSOOIDC,Pr as RegisterClientResponseFilterSensitiveLog,O as RegisterClientCommand,K as InvalidScopeException,Q as InvalidRequestRegionException,A as InvalidRequestException,Y as InvalidRedirectUriException,f as InvalidGrantException,X as InvalidClientMetadataException,W as InvalidClientException,V as InternalServerException,J as ExpiredTokenException,Rr as CreateTokenWithIAMResponseFilterSensitiveLog,Ir as CreateTokenWithIAMRequestFilterSensitiveLog,g as CreateTokenWithIAMCommand,$r as CreateTokenResponseFilterSensitiveLog,Sr as CreateTokenRequestFilterSensitiveLog,C as CreateTokenCommand,G as AuthorizationPendingException,z as AccessDeniedException,E as $Command};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as h} from"./chunk-bdf4f2b1862899bb.js";import"./chunk-dc23bfb4fd92e2f0.js";import{sb as _} from"./chunk-f316793e4ec0f386.js";import{Ab as v,Bb as P,vb as N,wb as W,xb as I} from"./chunk-ba051a98cd651063.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-795a1bd1d89efce1.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-795a1bd1d89efce1.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-77d1b26236f5feec.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,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as J} from"./chunk-bdf4f2b1862899bb.js";import"./chunk-dc23bfb4fd92e2f0.js";import{qb as cc,rb as z} from"./chunk-d43b3f444e738dd1.js";import{sb as _} from"./chunk-f316793e4ec0f386.js";import"./chunk-ba051a98cd651063.js";var v=J(_(),1);import{parse as o} from"url";var K=J(_(),1);import{Buffer as a} from"buffer";import{request as n} from"http";function f(c){return new Promise((I,x)=>{const T=n({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new K.ProviderError("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new K.ProviderError("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{const{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new K.ProviderError("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const u=[];N.on("data",(y)=>{u.push(y)}),N.on("end",()=>{I(a.concat(u)),T.destroy()})}),T.end()})}var D=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",G=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var uc=1000,Ec=0,Q=({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 Z="AWS_CONTAINER_CREDENTIALS_FULL_URI",L="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN",Kc=(c={})=>{const{timeout:I,maxRetries:x}=Q(c);return()=>m(async()=>{const T=await d({logger:c.logger}),N=JSON.parse(await s(I,T));if(!D(N))throw new v.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return G(N)},x)},s=async(c,I)=>{if(process.env[B])I.headers={...I.headers,Authorization:process.env[B]};return(await f({...I,timeout:c})).toString()},g="169.254.170.2",l={localhost:!0,"127.0.0.1":!0},r={"http:":!0,"https:":!0},d=async({logger:c})=>{if(process.env[L])return{hostname:g,path:process.env[L]};if(process.env[Z]){const I=o(process.env[Z]);if(!I.hostname||!(I.hostname in l))throw new v.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in r))throw new v.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new v.CredentialsProviderError("The container metadata credential provider cannot be used unless"+` the ${L} or ${Z} environment`+" variable is set",{tryNextLink:!1,logger:c})};var q=J(_(),1);var U=J(_(),1);class X extends U.CredentialsProviderError{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,X.prototype)}}var P=J(cc(),1);var j;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(j||(j={}));var t={environmentVariableSelector:(c)=>c["AWS_EC2_METADATA_SERVICE_ENDPOINT"],configFileSelector:(c)=>c["ec2_metadata_service_endpoint"],default:void 0};var S;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(S||(S={}));var e="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",i="ec2_metadata_service_endpoint_mode",F={environmentVariableSelector:(c)=>c[e],configFileSelector:(c)=>c[i],default:S.IPv4};var W=async()=>P.parseUrl(await Ic()||await Tc()),Ic=async()=>z(t)(),Tc=async()=>{const c=await z(F)();switch(c){case S.IPv4:return j.IPv4;case S.IPv6:return j.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}.`+` Select from ${Object.values(S)}`)}};var b=(c,I)=>{const x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these "+`credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: `+"https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html");const N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var V=(c,I={})=>{const x=I?.logger||console;let T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=b(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=b(T,x);else throw O}return T=N,N}};var k="/latest/meta-data/iam/security-credentials/",Nc="/latest/api/token",H="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",oc=(c={})=>V(xc(c),{logger:c.logger}),xc=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=Q(c),u=async(y,E)=>{if(I||E.headers?.[M]==null){let w=!1,h=!1;const C=await z({environmentVariableSelector:(Y)=>{const $=Y[H];if(h=!!$&&$!=="false",$===void 0)throw new q.CredentialsProviderError(`${H} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{const $=Y[R];return w=!!$&&$!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||C){const Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${H})`);throw new X(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}const p=(await m(async()=>{let w;try{w=await yc(E)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return m(async()=>{let w;try{w=await wc(p,E,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{const y=await W();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),u(O,{...y,timeout:N});else{let E;try{E=(await Oc({...y,timeout:N})).toString()}catch(A){if(A?.statusCode===400)throw Object.assign(A,{message:"EC2 Metadata token request returned error"});else if(A.message==="TimeoutError"||[403,404,405].includes(A.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),u(O,{...y,timeout:N})}return u(O,{...y,headers:{[M]:E},timeout:N})}}},Oc=async(c)=>f({...c,path:Nc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),yc=async(c)=>(await f({...c,path:k})).toString(),wc=async(c,I,x)=>{const T=JSON.parse((await f({...I,path:k+c})).toString());if(!D(T))throw new q.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return G(T)};export{Q as providerConfigFromInit,f as httpRequest,W as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,Kc as fromContainerMetadata,j as Endpoint,L as ENV_CMDS_RELATIVE_URI,Z as ENV_CMDS_FULL_URI,B as ENV_CMDS_AUTH_TOKEN,uc as DEFAULT_TIMEOUT,Ec as DEFAULT_MAX_RETRIES};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{u as w,v as z,w as B} from"./chunk-c83b39b7178003da.js";import{z as Q} from"./chunk-bdf4f2b1862899bb.js";import{sb as X} from"./chunk-f316793e4ec0f386.js";import{ub as $} from"./chunk-ba051a98cd651063.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-adb4e1e222eb1d20.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-d3033805e98482dc.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-a991fdce275f1256.js");return H(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-53c39aca36ece018.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-59980167a4c574b3.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-4f5b07a6a6fd5cc6.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 tb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as x} from"./chunk-bdf4f2b1862899bb.js";import{pb as S} from"./chunk-dc23bfb4fd92e2f0.js";var q="AWS_PROFILE";var B=(o)=>o.profile||process.env["AWS_PROFILE"]||"default";import{join as b} from"path";import{homedir as N} from"os";import{sep as L} from"path";var d={},w=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},f=()=>{const{HOME:o,USERPROFILE:e,HOMEPATH:t,HOMEDRIVE:r=`C:${L}`}=process.env;if(o)return o;if(e)return e;if(t)return`${r}${t}`;const i=w();if(!d[i])d[i]=N();return d[i]};var v="AWS_CONFIG_FILE",g=()=>process.env[v]||b(f(),".aws","config");var D=x(S(),1);import{join as I} from"path";var h=x(S(),1);var O=(o)=>Object.entries(o).filter(([e])=>{const t=e.indexOf(c);if(t===-1)return!1;return Object.values(h.IniSectionType).includes(e.substring(0,t))}).reduce((e,[t,r])=>{const i=t.indexOf(c),s=t.substring(0,i)===h.IniSectionType.PROFILE?t.substring(i+1):t;return e[s]=r,e},{...o.default&&{default:o.default}});import{join as j} from"path";var y="AWS_SHARED_CREDENTIALS_FILE",_=()=>process.env[y]||j(f(),".aws","credentials");var C=x(S(),1);var $=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,G=["__proto__","profile __proto__"],a=(o)=>{const e={};let t,r;for(let i of o.split(/\r?\n/)){const s=i.split(/(^|\s)[;#]/)[0].trim();if(s[0]==="["&&s[s.length-1]==="]"){t=void 0,r=void 0;const n=s.substring(1,s.length-1),m=$.exec(n);if(m){const[,p,,F]=m;if(Object.values(C.IniSectionType).includes(p))t=[p,F].join(c)}else t=n;if(G.includes(n))throw new Error(`Found invalid profile name "${n}"`)}else if(t){const n=s.indexOf("=");if(![0,-1].includes(n)){const[m,p]=[s.substring(0,n).trim(),s.substring(n+1).trim()];if(p==="")r=m;else{if(r&&i.trimStart()===i)r=void 0;e[t]=e[t]||{};const F=r?[r,m].join(c):m;e[t][F]=p}}}}return e};import{promises as W} from"fs";var{readFile:K}=W,E={},l=(o,e)=>{if(!E[o]||e?.ignoreCache)E[o]=K(o,"utf8");return E[o]};var P=()=>({}),c=".",R=async(o={})=>{const{filepath:e=_(),configFilepath:t=g()}=o,r=f();let s=e;if(e.startsWith("~/"))s=I(r,e.slice(2));let u=t;if(t.startsWith("~/"))u=I(r,t.slice(2));const n=await Promise.all([l(u,{ignoreCache:o.ignoreCache}).then(a).then(O).catch(P),l(s,{ignoreCache:o.ignoreCache}).then(a).catch(P)]);return{configFile:n[0],credentialsFile:n[1]}};var T=(o)=>Object.entries(o).filter(([e])=>e.startsWith(D.IniSectionType.SSO_SESSION+c)).reduce((e,[t,r])=>({...e,[t.substring(t.indexOf(c)+1)]:r}),{});var V=()=>({}),Pe=async(o={})=>l(o.configFilepath??g()).then(a).then(T).catch(V);var A=(...o)=>{const e={};for(let t of o)for(let[r,i]of Object.entries(t))if(e[r]!==void 0)Object.assign(e[r],i);else e[r]=i;return e};var He=async(o)=>{const e=await R(o);return A(e.configFile,e.credentialsFile)};import{createHash as U} from"crypto";import{join as X} from"path";var H=(o)=>{const t=U("sha1").update(o).digest("hex");return X(f(),".aws","sso","cache",`${t}.json`)};import{promises as k} from"fs";var{readFile:M}=k,$e=async(o)=>{const e=H(o),t=await M(e,"utf8");return JSON.parse(t)};export{q as ub,B as vb,H as wb,$e as xb,c as yb,R as zb,Pe as Ab,He as Bb};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var g=Object.create;var{defineProperty:f,getPrototypeOf:h,getOwnPropertyNames:i}=Object;var j=Object.prototype.hasOwnProperty;var k=(a,b,c)=>{c=a!=null?g(h(a)):{};const d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of i(a))if(!j.call(d,e))f(d,e,{get:()=>a[e],enumerable:!0});return d};var l=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);
|
|
2
|
+
export{k as z,l as A};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as _} from"./chunk-bdf4f2b1862899bb.js";import{sb as S} from"./chunk-f316793e4ec0f386.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 u,A as v,i as w};
|