gemi 0.4.91 → 0.4.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/app/App.d.ts.map +1 -1
  2. package/dist/app/index.js +1 -1
  3. package/dist/chunk-07ad6201a5864cd0.js +2 -0
  4. package/dist/chunk-156c827bf8d5029c.js +5 -0
  5. package/dist/chunk-2c5ecf8dc0a97aba.js +2 -0
  6. package/dist/chunk-542b3c90f0ff4ded.js +2 -0
  7. package/dist/chunk-63884944ac5ce0f0.js +2 -0
  8. package/dist/{chunk-201d67e6e22cc14b.js → chunk-6a2141dd4169ce0e.js} +1 -1
  9. package/dist/chunk-6b58f7c76c2a738c.js +2 -0
  10. package/dist/chunk-83938f41a5342f87.js +2 -0
  11. package/dist/chunk-880cfc21ce7cc2c6.js +2 -0
  12. package/dist/chunk-9d5c096c43928b37.js +1 -0
  13. package/dist/chunk-9dc5c9b7a885d0bc.js +9 -0
  14. package/dist/chunk-a1ef3b11adc01140.js +6 -0
  15. package/dist/chunk-ad396345e8e74292.js +2 -0
  16. package/dist/{chunk-fcd9eb76c67113d3.js → chunk-b13ef9b23e30af91.js} +1 -1
  17. package/dist/chunk-e1a4203ece554bc3.js +2 -0
  18. package/dist/chunk-e4a19367b5596f21.js +2 -0
  19. package/dist/chunk-fe8cfc6e6c3ce826.js +16 -0
  20. package/dist/client/ServerDataProvider.d.ts +5 -1
  21. package/dist/client/ServerDataProvider.d.ts.map +1 -1
  22. package/dist/client/i18n/I18nContext.d.ts.map +1 -1
  23. package/dist/client/index.js +13 -14
  24. package/dist/kernel/index.js +1 -1
  25. package/dist/services/index.js +10 -1
  26. package/package.json +1 -1
  27. package/dist/chunk-19790c50198f1898.js +0 -2
  28. package/dist/chunk-2b9b6009ebe271d3.js +0 -2
  29. package/dist/chunk-32d1342f9f8391c0.js +0 -2
  30. package/dist/chunk-3a6838d9e6866471.js +0 -2
  31. package/dist/chunk-7085d9454a422181.js +0 -2
  32. package/dist/chunk-809308720fc22418.js +0 -2
  33. package/dist/chunk-900bf3955cb1bbab.js +0 -2
  34. package/dist/chunk-931a005d4bb28ffe.js +0 -2
  35. package/dist/chunk-967cb54562e3d29b.js +0 -3
  36. package/dist/chunk-b94896500a1345bf.js +0 -2
  37. package/dist/chunk-bce765dc10669cd0.js +0 -6
  38. package/dist/chunk-bdac4694bbb37064.js +0 -1
  39. package/dist/chunk-c3c17a7115770391.js +0 -2
  40. package/dist/chunk-d1e1b959b1124e74.js +0 -18
  41. package/dist/chunk-f6a9cd06681eb0dc.js +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../app/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAY5C,OAAO,EAAE,aAAa,EAA2B,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,UAAU,SAAS;IACjB,UAAU,EAAE,UAAU,UAAU,CAAC;IACjC,SAAS,EAAE,UAAU,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,EAAE,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,UAAU,CAAC,CAAC;IACzD,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,UAAU,MAAM,CAAC;CAC1B;AAED,qBAAa,GAAG;IACd,OAAO,CAAC,YAAY,CAKlB;IACF,OAAO,CAAC,cAAc,CAGf;IAEP,OAAO,CAAC,aAAa,CAAgC;IAC9C,IAAI,SAAS;IACpB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,aAAa,CAAgB;IAC9B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,UAAU,CAAC,CAAM;IAC7D,UAAU,SAAK;IACtB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,iBAAiB,CAAgB;gBAE7B,MAAM,EAAE,SAAS;IAc7B,OAAO,CAAC,OAAO;IA+CR,gBAAgB;IAIhB,eAAe,CAAC,MAAM,EAAE,YAAY;IAIrC,iBAAiB,CAAC,GAAG,EAAE,OAAO;IA0P9B,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAgBrC,SAAS,EAAE,gBAAgB,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAoBtD;IAEK,SAAS,CACd,EAAE,EAAE,CACF,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,iBAAiB,EAChE,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI;CAIZ"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../app/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAY5C,OAAO,EAAE,aAAa,EAA2B,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,UAAU,SAAS;IACjB,UAAU,EAAE,UAAU,UAAU,CAAC;IACjC,SAAS,EAAE,UAAU,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,EAAE,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,UAAU,CAAC,CAAC;IACzD,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,UAAU,MAAM,CAAC;CAC1B;AAED,qBAAa,GAAG;IACd,OAAO,CAAC,YAAY,CAKlB;IACF,OAAO,CAAC,cAAc,CAGf;IAEP,OAAO,CAAC,aAAa,CAAgC;IAC9C,IAAI,SAAS;IACpB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,aAAa,CAAgB;IAC9B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,UAAU,CAAC,CAAM;IAC7D,UAAU,SAAK;IACtB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,iBAAiB,CAAgB;gBAE7B,MAAM,EAAE,SAAS;IAc7B,OAAO,CAAC,OAAO;IA+CR,gBAAgB;IAIhB,eAAe,CAAC,MAAM,EAAE,YAAY;IAIrC,iBAAiB,CAAC,GAAG,EAAE,OAAO;IA8P9B,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAgBrC,SAAS,EAAE,gBAAgB,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAoBtD;IAEK,SAAS,CACd,EAAE,EAAE,CACF,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,iBAAiB,EAChE,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI;CAIZ"}
package/dist/app/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{e as h,h as F,i as P,l as r} from"../http/index.js";import{x as v,y as D} from"../chunk-53b7d6267c9172bc.js";import{A as L} from"../chunk-9475c6ed18013dc8.js";import{B as Jo,C as d} from"../chunk-24a86f8f5ddc0cbd.js";var _=d((qo,N)=>{var Yo=function(o){if(typeof o==="function")return o;return(n)=>n.$extends(o)},Zo=function(o){return o},S=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,Vo=Object.getOwnPropertyNames,Ho=Object.prototype.hasOwnProperty,To=(o,n)=>{for(var i in n)S(o,i,{get:n[i],enumerable:!0})},zo=(o,n,i,c)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let y of Vo(n))if(!Ho.call(o,y)&&y!==i)S(o,y,{get:()=>n[y],enumerable:!(c=fo(n,y))||c.enumerable})}return o},Ao=(o)=>zo(S({},"__esModule",{value:!0}),o),q={};To(q,{Prisma:()=>t,PrismaClient:()=>Xo,default:()=>Qo});N.exports=Ao(q);var Go={enginesVersion:"393aa359c9ad4a4bb28630fb5613f9c281cde053"},Lo="5.17.0",Wo=Lo,Xo=class{constructor(){throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.')}},t={defineExtension:Yo,getExtensionContext:Zo,prismaVersion:{client:Wo,engine:Go.enginesVersion}},Qo={Prisma:t}});var l=d((No,p)=>{p.exports={..._()}});function E(o){let n=[];for(let[i,c]of o)n.push(i,...E(c).flat());return Array.from(new Set(n))}function Q(o){const n=[];for(let[i,c]of Object.entries(o))if("run"in c){const y=c.viewPath;if("children"in c){const b=new c.children,$=Q(b.routes);n.push([y,$])}else n.push([y,[]])}else{const y=new c,b=Q(y.routes);n.push(...b)}return n}function J(o){const n={};for(let[i,c]of Object.entries(o))if("run"in c){const y=c;if("children"in y){const b=new y.children,$=J(b.routes);for(let[O,{exec:V,middleware:f}]of Object.entries($)){const A=i==="/"?O:`${i}${O}`,W=O==="/"&&i!=="/"?i:A;n[W]={exec:[y.run.bind(y),...V],middleware:[...y.middlewares,...f]}}}else n[i]={exec:[y.run.bind(y)],middleware:y.middlewares}}else{const y=new c,b=J(y.routes);for(let[$,{exec:O,middleware:V}]of Object.entries(b)){const f=i==="/"?$:`${i}${$}`,A=$==="/"&&i!=="/"?i:f;n[A]={exec:O,middleware:[...y.middlewares,...V]}}}return Object.fromEntries(Object.entries(n).sort(([i],[c])=>{const y=i.split("/").length+i.split(":").length,b=c.split("/").length+c.split(":").length;return y-b}))}function U(o){const n={};for(let[i,c]of Object.entries(o))if("run"in c){const y=c.viewPath;if("children"in c)n[i]=[y];if("children"in c){const b=new c.children,$=U(b.routes);for(let[O,V]of Object.entries($)){const f=i==="/"?O:`${i}${O}`,A=O==="/"&&i!=="/"?i:f;n[A]=[y,...V]}}else n[i]=[y]}else{const y=new c,b=U(y.routes);for(let[$,O]of Object.entries(b)){const V=i==="/"?$:`${i}${$}`,f=$==="/"&&i!=="/"?i:V;n[f]=O}}return n}import{renderToReadableStream as jo} from"react-dom/server.browser";import{createElement as g,Fragment as Oo} from"react";class R{renderParams={styles:[],manifest:{},serverManifest:{},bootstrapModules:[]};flatViewRoutes={};routeManifest={};name="APP";appId;componentTree;middlewareAliases={};devVersion=0;params;apiRouter;viewRouter;Root;kernel;i18nServiceContainer;flatComponentTree=[];constructor(o){this.params=o,this.apiRouter=o.apiRouter,this.viewRouter=o.viewRouter,this.Root=o.root,this.kernel=new o.kernel,this.prepare(),this.appId=D(Date.now()),this.i18nServiceContainer=this.kernel.getServices().i18nServiceContainer,this.i18nServiceContainer.boot()}prepare(){const o=this.params;this.middlewareAliases=o.middlewareAliases??{};const n=this.kernel.getServices(),i=n.authenticationServiceContainer.provider.basePath;let c={"/":this.viewRouter,[i]:n.authenticationServiceContainer.provider.routers.view},y={"/":this.apiRouter,[i]:n.authenticationServiceContainer.provider.routers.api,"/__gemi__/services/i18n":n.i18nServiceContainer.routers.api};for(let b of o.plugins??[]){const $=new b;if($.viewRouter)c={...c,[$.viewRoutesBasePath]:$.viewRouter};if($.apiRouter)y={...y,[$.apiRoutesBasePath]:$.apiRouter}}this.kernel.getServices().apiRouterServiceContainer.service.boot(y),this.flatViewRoutes=J(c),this.componentTree=Q(c),this.flatComponentTree=E(this.componentTree),this.routeManifest=U(c)}getComponentTree(){return this.componentTree}setRenderParams(o){this.renderParams=o}async handleViewRequest(o){const n=new URL(o.url),i=n.searchParams.get("json");let c=null;try{let w=[],j=[],H=null,z={};for(let[T,Y]of Object.entries(this.flatViewRoutes)){const Z=new v({pathname:T});if(Z.test({pathname:n.pathname})){H=T,z=Z.exec({pathname:n.pathname})?.pathname.groups,w=Y.exec,j=Y.middleware;break}}const G=new P(o,z),{data:u,cookies:io,headers:co,user:yo,prefetchedData:wo}=await F.run(G,async()=>{const T=F.getStore();T.setRequest(G),await L.getStore().middlewareServiceContainer.runMiddleware(j,H);const Y=await Promise.all([...w.map((C)=>C(G)),...Array.from(T.prefetchPromiseQueue).map((C)=>C())]),Z=T.cookies,$o=T.headers,bo=T.prefetchedResources;return{data:Y,cookies:Z,headers:$o,user:T.user,prefetchedData:Object.fromEntries(bo.entries())}});c={data:u,prefetchedData:wo,currentPathName:H,user:yo,params:z,cookies:io,headers:co}}catch(w){if(w.kind===h)if(i){const{status:j=400,data:H,directive:z,headers:G}=w.payload.api;return new Response(JSON.stringify({data:H,directive:z}),{headers:G,status:j})}else{const{status:j=400,error:H}=w.payload.view;return new Response(H?.message,{...w.payload.view,status:j})}else throw w}const{data:y,params:b,currentPathName:$,user:O,cookies:V}=c,f=y.reduce((w,j)=>{return{...w,...j}},{}),A=this.i18nServiceContainer.isEnabled;let W={};if(A){const w=this.i18nServiceContainer.detectLocale(new P(o,b)),j=this.i18nServiceContainer.getPageTranslations(w,$);W={[w]:j}}if(i){const w=new Headers;return w.set("Content-Type","application/json"),V.forEach((j)=>w.append("Set-Cookie",j.toString())),w.append("Cache-Control",O?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),new Response(JSON.stringify({data:{[n.pathname]:f},prefetchedData:c.prefetchedData,i18n:W,is404:!$}),{headers:w})}const{styles:e,manifest:M,serverManifest:x,bootstrapModules:a}=this.renderParams,B={};let K=null;const k=(w,j)=>`"${w}": () => import("${j}")`,I=[];for(let w of["404",...this.flatComponentTree])if(!M){K=`${process.env.APP_DIR}`;const j=await import(`${K}/views/${w}.tsx?t=${this.appId}`);B[w]=j.default,I.push(k(w,`${K}/views/${w}.tsx?t=${this.appId}`))}else{const j=x[`app/views/${w}.tsx`];if(!j?.file){console.log(`Server file not found for ${w}`),console.log(j);const G=Object.keys(x),u=`app/views/${w}.tsx`;console.log(`${u} not found in server manifest`),console.log(G)}const H=await import(`${process.env.DIST_DIR}/server/${j?.file}?t=${this.appId}`);B[w]=H.default;const z=M[`app/views/${w}.tsx`];if(z)I.push(k(w,`/${z?.file}?t=${this.appId}`))}const oo=`{${I.join(",")}}`,X=new Headers;X.set("Content-Type","text/html"),X.set("Cache-Control",O?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),X.set("ETag",this.appId),c.cookies.forEach((w)=>X.append("Set-Cookie",w.toString()));const s={kind:"view",data:{pageData:{[n.pathname]:f},prefetchedData:c.prefetchedData,i18n:W,auth:{user:O},routeManifest:this.routeManifest,router:{pathname:$,params:b,currentPath:n.pathname,searchParams:n.search,is404:!$?!0:!1},componentTree:[["404",[]],...this.componentTree]},head:{}},no=await jo(g(Oo,{children:[e,g(this.Root,{data:s.data,viewImportMap:B})]}),{bootstrapScriptContent:`window.__GEMI_DATA__ = ${JSON.stringify(s.data)}; window.loaders=${oo}`,bootstrapModules:a});return new Response(no,{status:!$?404:200,headers:X})}async fetch(o){const n=new URL(o.url);return this.kernel.run.bind(this.kernel)(async()=>{if(n.pathname.startsWith("/api"))return await this.kernel.services.apiRouterServiceContainer.handleApiRequest(o);else return await this.handleViewRequest(o)})}websocket={message:(o,n)=>{this.kernel.run.bind(this.kernel)(()=>{L.getStore().broadcastingServiceContainer.run(o.data.headers,()=>{L.getStore().broadcastingServiceContainer.handleMessage(o,n)})})},open:(o)=>{},close:(o)=>{console.log("closed ws"),o.terminate()}};onPublish(o){this.kernel.services.broadcastingServiceContainer.onPublish(o)}}var m=Jo(l(),1);var Uo=m.Prisma.defineExtension({name:"Gemi Policies",query:{async $allOperations({args:o,operation:n,query:i,model:c}){const b=L.getStore().policiesServiceProvider.policiesList[`${c}Policies`];if(!b)return await i(o);if(!await b.all.call(b,n,o))throw new r;return await i(o)}}});export{Uo as prismaExtension,R as App};
2
+ import{e as h,h as F,i as P,l as r} from"../http/index.js";import{x as v,y as D} from"../chunk-53b7d6267c9172bc.js";import{A as L} from"../chunk-9475c6ed18013dc8.js";import{B as Jo,C as d} from"../chunk-24a86f8f5ddc0cbd.js";var _=d((qo,N)=>{var Yo=function(o){if(typeof o==="function")return o;return(n)=>n.$extends(o)},Zo=function(o){return o},S=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,Vo=Object.getOwnPropertyNames,Ho=Object.prototype.hasOwnProperty,To=(o,n)=>{for(var i in n)S(o,i,{get:n[i],enumerable:!0})},zo=(o,n,i,c)=>{if(n&&typeof n==="object"||typeof n==="function"){for(let y of Vo(n))if(!Ho.call(o,y)&&y!==i)S(o,y,{get:()=>n[y],enumerable:!(c=fo(n,y))||c.enumerable})}return o},Ao=(o)=>zo(S({},"__esModule",{value:!0}),o),q={};To(q,{Prisma:()=>t,PrismaClient:()=>Xo,default:()=>Qo});N.exports=Ao(q);var Go={enginesVersion:"393aa359c9ad4a4bb28630fb5613f9c281cde053"},Lo="5.17.0",Wo=Lo,Xo=class{constructor(){throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.')}},t={defineExtension:Yo,getExtensionContext:Zo,prismaVersion:{client:Wo,engine:Go.enginesVersion}},Qo={Prisma:t}});var l=d((No,p)=>{p.exports={..._()}});function E(o){let n=[];for(let[i,c]of o)n.push(i,...E(c).flat());return Array.from(new Set(n))}function Q(o){const n=[];for(let[i,c]of Object.entries(o))if("run"in c){const y=c.viewPath;if("children"in c){const b=new c.children,$=Q(b.routes);n.push([y,$])}else n.push([y,[]])}else{const y=new c,b=Q(y.routes);n.push(...b)}return n}function J(o){const n={};for(let[i,c]of Object.entries(o))if("run"in c){const y=c;if("children"in y){const b=new y.children,$=J(b.routes);for(let[O,{exec:V,middleware:f}]of Object.entries($)){const A=i==="/"?O:`${i}${O}`,W=O==="/"&&i!=="/"?i:A;n[W]={exec:[y.run.bind(y),...V],middleware:[...y.middlewares,...f]}}}else n[i]={exec:[y.run.bind(y)],middleware:y.middlewares}}else{const y=new c,b=J(y.routes);for(let[$,{exec:O,middleware:V}]of Object.entries(b)){const f=i==="/"?$:`${i}${$}`,A=$==="/"&&i!=="/"?i:f;n[A]={exec:O,middleware:[...y.middlewares,...V]}}}return Object.fromEntries(Object.entries(n).sort(([i],[c])=>{const y=i.split("/").length+i.split(":").length,b=c.split("/").length+c.split(":").length;return y-b}))}function U(o){const n={};for(let[i,c]of Object.entries(o))if("run"in c){const y=c.viewPath;if("children"in c)n[i]=[y];if("children"in c){const b=new c.children,$=U(b.routes);for(let[O,V]of Object.entries($)){const f=i==="/"?O:`${i}${O}`,A=O==="/"&&i!=="/"?i:f;n[A]=[y,...V]}}else n[i]=[y]}else{const y=new c,b=U(y.routes);for(let[$,O]of Object.entries(b)){const V=i==="/"?$:`${i}${$}`,f=$==="/"&&i!=="/"?i:V;n[f]=O}}return n}import{renderToReadableStream as jo} from"react-dom/server.browser";import{createElement as g,Fragment as Oo} from"react";class R{renderParams={styles:[],manifest:{},serverManifest:{},bootstrapModules:[]};flatViewRoutes={};routeManifest={};name="APP";appId;componentTree;middlewareAliases={};devVersion=0;params;apiRouter;viewRouter;Root;kernel;i18nServiceContainer;flatComponentTree=[];constructor(o){this.params=o,this.apiRouter=o.apiRouter,this.viewRouter=o.viewRouter,this.Root=o.root,this.kernel=new o.kernel,this.prepare(),this.appId=D(Date.now()),this.i18nServiceContainer=this.kernel.getServices().i18nServiceContainer,this.i18nServiceContainer.boot()}prepare(){const o=this.params;this.middlewareAliases=o.middlewareAliases??{};const n=this.kernel.getServices(),i=n.authenticationServiceContainer.provider.basePath;let c={"/":this.viewRouter,[i]:n.authenticationServiceContainer.provider.routers.view},y={"/":this.apiRouter,[i]:n.authenticationServiceContainer.provider.routers.api,"/__gemi__/services/i18n":n.i18nServiceContainer.routers.api};for(let b of o.plugins??[]){const $=new b;if($.viewRouter)c={...c,[$.viewRoutesBasePath]:$.viewRouter};if($.apiRouter)y={...y,[$.apiRoutesBasePath]:$.apiRouter}}this.kernel.getServices().apiRouterServiceContainer.service.boot(y),this.flatViewRoutes=J(c),this.componentTree=Q(c),this.flatComponentTree=E(this.componentTree),this.routeManifest=U(c)}getComponentTree(){return this.componentTree}setRenderParams(o){this.renderParams=o}async handleViewRequest(o){const n=new URL(o.url),i=n.searchParams.get("json");let c=null;try{let w=[],j=[],H=null,z={};for(let[T,Y]of Object.entries(this.flatViewRoutes)){const Z=new v({pathname:T});if(Z.test({pathname:n.pathname})){H=T,z=Z.exec({pathname:n.pathname})?.pathname.groups,w=Y.exec,j=Y.middleware;break}}const G=new P(o,z),{data:u,cookies:io,headers:co,user:yo,prefetchedData:wo}=await F.run(G,async()=>{const T=F.getStore();T.setRequest(G),await L.getStore().middlewareServiceContainer.runMiddleware(j,H);const Y=await Promise.all([...w.map((C)=>C(G)),...Array.from(T.prefetchPromiseQueue).map((C)=>C())]),Z=T.cookies,$o=T.headers,bo=T.prefetchedResources;return{data:Y,cookies:Z,headers:$o,user:T.user,prefetchedData:Object.fromEntries(bo.entries())}});c={data:u,prefetchedData:wo,currentPathName:H,user:yo,params:z,cookies:io,headers:co}}catch(w){if(w.kind===h)if(i){const{status:j=400,data:H,directive:z,headers:G}=w.payload.api;return new Response(JSON.stringify({data:H,directive:z}),{headers:G,status:j})}else{const{status:j=400,error:H}=w.payload.view;return new Response(H?.message,{...w.payload.view,status:j})}else throw w}const{data:y,params:b,currentPathName:$,user:O,cookies:V}=c,f=y.reduce((w,j)=>{return{...w,...j}},{}),A=this.i18nServiceContainer.isEnabled;let W={};if(A){const w=this.i18nServiceContainer.detectLocale(new P(o,b)),j=this.i18nServiceContainer.getPageTranslations(w,$);W={supportedLocales:this.i18nServiceContainer.supportedLocales,currentLocale:w,dictionary:{[w]:j}}}if(i){const w=new Headers;return w.set("Content-Type","application/json"),V.forEach((j)=>w.append("Set-Cookie",j.toString())),w.append("Cache-Control",O?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),new Response(JSON.stringify({data:{[n.pathname]:f},prefetchedData:c.prefetchedData,i18n:W,is404:!$}),{headers:w})}const{styles:e,manifest:M,serverManifest:x,bootstrapModules:a}=this.renderParams,B={};let K=null;const k=(w,j)=>`"${w}": () => import("${j}")`,I=[];for(let w of["404",...this.flatComponentTree])if(!M){K=`${process.env.APP_DIR}`;const j=await import(`${K}/views/${w}.tsx?t=${this.appId}`);B[w]=j.default,I.push(k(w,`${K}/views/${w}.tsx?t=${this.appId}`))}else{const j=x[`app/views/${w}.tsx`];if(!j?.file){console.log(`Server file not found for ${w}`),console.log(j);const G=Object.keys(x),u=`app/views/${w}.tsx`;console.log(`${u} not found in server manifest`),console.log(G)}const H=await import(`${process.env.DIST_DIR}/server/${j?.file}?t=${this.appId}`);B[w]=H.default;const z=M[`app/views/${w}.tsx`];if(z)I.push(k(w,`/${z?.file}?t=${this.appId}`))}const oo=`{${I.join(",")}}`,X=new Headers;X.set("Content-Type","text/html"),X.set("Cache-Control",O?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),X.set("ETag",this.appId),c.cookies.forEach((w)=>X.append("Set-Cookie",w.toString()));const s={kind:"view",data:{pageData:{[n.pathname]:f},prefetchedData:c.prefetchedData,i18n:W,auth:{user:O},routeManifest:this.routeManifest,router:{pathname:$,params:b,currentPath:n.pathname,searchParams:n.search,is404:!$?!0:!1},componentTree:[["404",[]],...this.componentTree]},head:{}},no=await jo(g(Oo,{children:[e,g(this.Root,{data:s.data,viewImportMap:B})]}),{bootstrapScriptContent:`window.__GEMI_DATA__ = ${JSON.stringify(s.data)}; window.loaders=${oo}`,bootstrapModules:a});return new Response(no,{status:!$?404:200,headers:X})}async fetch(o){const n=new URL(o.url);return this.kernel.run.bind(this.kernel)(async()=>{if(n.pathname.startsWith("/api"))return await this.kernel.services.apiRouterServiceContainer.handleApiRequest(o);else return await this.handleViewRequest(o)})}websocket={message:(o,n)=>{this.kernel.run.bind(this.kernel)(()=>{L.getStore().broadcastingServiceContainer.run(o.data.headers,()=>{L.getStore().broadcastingServiceContainer.handleMessage(o,n)})})},open:(o)=>{},close:(o)=>{console.log("closed ws"),o.terminate()}};onPublish(o){this.kernel.services.broadcastingServiceContainer.onPublish(o)}}var m=Jo(l(),1);var Uo=m.Prisma.defineExtension({name:"Gemi Policies",query:{async $allOperations({args:o,operation:n,query:i,model:c}){const b=L.getStore().policiesServiceProvider.policiesList[`${c}Policies`];if(!b)return await i(o);if(!await b.all.call(b,n,o))throw new r;return await i(o)}}});export{Uo as prismaExtension,R as App};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as _} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-6a2141dd4169ce0e.js";import{rb as y} from"./chunk-880cfc21ce7cc2c6.js";import{Ab as S,ub as K} from"./chunk-b13ef9b23e30af91.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,5 @@
1
+ import{B as Q,C as N} from"./chunk-24a86f8f5ddc0cbd.js";import{ob as p} from"./chunk-6a2141dd4169ce0e.js";var xn=N((Sr,Hn)=>{var{defineProperty:O,getOwnPropertyDescriptor:Uf,getOwnPropertyNames:If}=Object,yf=Object.prototype.hasOwnProperty,z=(n,c)=>O(n,"name",{value:c,configurable:!0}),of=(n,c)=>{for(var t in c)O(n,t,{get:c[t],enumerable:!0})},Lf=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of If(c))if(!yf.call(n,h)&&h!==t)O(n,h,{get:()=>c[h],enumerable:!(f=Uf(c,h))||f.enumerable})}return n},Df=(n)=>Lf(O({},"__esModule",{value:!0}),n),jn={};of(jn,{constructStack:()=>$n});Hn.exports=Df(jn);var A=z((n,c)=>{const t=[];if(n)t.push(n);if(c)for(let f of c)t.push(f);return t},"getAllAliases"),K=z((n,c)=>{return`${n||"anonymous"}${c&&c.length>0?` (a.k.a. ${c.join(",")})`:""}`},"getMiddlewareNameWithAliases"),$n=z(()=>{let n=[],c=[],t=!1;const f=new Set,h=z((w)=>w.sort((d,T)=>Mn[T.step]-Mn[d.step]||Rn[T.priority||"normal"]-Rn[d.priority||"normal"]),"sort"),i=z((w)=>{let d=!1;const T=z((U)=>{const o=A(U.name,U.aliases);if(o.includes(w)){d=!0;for(let F of o)f.delete(F);return!1}return!0},"filterCb");return n=n.filter(T),c=c.filter(T),d},"removeByName"),r=z((w)=>{let d=!1;const T=z((U)=>{if(U.middleware===w){d=!0;for(let o of A(U.name,U.aliases))f.delete(o);return!1}return!0},"filterCb");return n=n.filter(T),c=c.filter(T),d},"removeByReference"),s=z((w)=>{var d;return n.forEach((T)=>{w.add(T.middleware,{...T})}),c.forEach((T)=>{w.addRelativeTo(T.middleware,{...T})}),(d=w.identifyOnResolve)==null||d.call(w,y.identifyOnResolve()),w},"cloneTo"),u=z((w)=>{const d=[];return w.before.forEach((T)=>{if(T.before.length===0&&T.after.length===0)d.push(T);else d.push(...u(T))}),d.push(w),w.after.reverse().forEach((T)=>{if(T.before.length===0&&T.after.length===0)d.push(T);else d.push(...u(T))}),d},"expandRelativeMiddlewareList"),x=z((w=!1)=>{const d=[],T=[],U={};return n.forEach((F)=>{const C={...F,before:[],after:[]};for(let $ of A(C.name,C.aliases))U[$]=C;d.push(C)}),c.forEach((F)=>{const C={...F,before:[],after:[]};for(let $ of A(C.name,C.aliases))U[$]=C;T.push(C)}),T.forEach((F)=>{if(F.toMiddleware){const C=U[F.toMiddleware];if(C===void 0){if(w)return;throw new Error(`${F.toMiddleware} is not found when adding ${K(F.name,F.aliases)} middleware ${F.relation} ${F.toMiddleware}`)}if(F.relation==="after")C.after.push(F);if(F.relation==="before")C.before.push(F)}}),h(d).map(u).reduce((F,C)=>{return F.push(...C),F},[])},"getMiddlewareList"),y={add:(w,d={})=>{const{name:T,override:U,aliases:o}=d,F={step:"initialize",priority:"normal",middleware:w,...d},C=A(T,o);if(C.length>0){if(C.some(($)=>f.has($))){if(!U)throw new Error(`Duplicate middleware name '${K(T,o)}'`);for(let $ of C){const E=n.findIndex((g)=>{var S;return g.name===$||((S=g.aliases)==null?void 0:S.some((J)=>J===$))});if(E===-1)continue;const I=n[E];if(I.step!==F.step||F.priority!==I.priority)throw new Error(`"${K(I.name,I.aliases)}" middleware with ${I.priority} priority in ${I.step} step cannot be overridden by "${K(T,o)}" middleware with ${F.priority} priority in ${F.step} step.`);n.splice(E,1)}}for(let $ of C)f.add($)}n.push(F)},addRelativeTo:(w,d)=>{const{name:T,override:U,aliases:o}=d,F={middleware:w,...d},C=A(T,o);if(C.length>0){if(C.some(($)=>f.has($))){if(!U)throw new Error(`Duplicate middleware name '${K(T,o)}'`);for(let $ of C){const E=c.findIndex((g)=>{var S;return g.name===$||((S=g.aliases)==null?void 0:S.some((J)=>J===$))});if(E===-1)continue;const I=c[E];if(I.toMiddleware!==F.toMiddleware||I.relation!==F.relation)throw new Error(`"${K(I.name,I.aliases)}" middleware ${I.relation} "${I.toMiddleware}" middleware cannot be overridden by "${K(T,o)}" middleware ${F.relation} "${F.toMiddleware}" middleware.`);c.splice(E,1)}}for(let $ of C)f.add($)}c.push(F)},clone:()=>s($n()),use:(w)=>{w.applyToStack(y)},remove:(w)=>{if(typeof w==="string")return i(w);else return r(w)},removeByTag:(w)=>{let d=!1;const T=z((U)=>{const{tags:o,name:F,aliases:C}=U;if(o&&o.includes(w)){const $=A(F,C);for(let E of $)f.delete(E);return d=!0,!1}return!0},"filterCb");return n=n.filter(T),c=c.filter(T),d},concat:(w)=>{var d;const T=s($n());return T.use(w),T.identifyOnResolve(t||T.identifyOnResolve()||(((d=w.identifyOnResolve)==null?void 0:d.call(w))??!1)),T},applyToStack:s,identify:()=>{return x(!0).map((w)=>{const d=w.step??w.relation+" "+w.toMiddleware;return K(w.name,w.aliases)+" - "+d})},identifyOnResolve(w){if(typeof w==="boolean")t=w;return t},resolve:(w,d)=>{for(let T of x().map((U)=>U.middleware).reverse())w=T(w,d);if(t)console.log(y.identify());return w}};return y},"constructStack"),Mn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Rn={high:3,normal:2,low:1}});var mn=N((Ar,an)=>{var{defineProperty:v,getOwnPropertyDescriptor:Sf,getOwnPropertyNames:Yf}=Object,zf=Object.prototype.hasOwnProperty,Vf=(n,c)=>v(n,"name",{value:c,configurable:!0}),Zf=(n,c)=>{for(var t in c)v(n,t,{get:c[t],enumerable:!0})},Gf=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Yf(c))if(!zf.call(n,h)&&h!==t)v(n,h,{get:()=>c[h],enumerable:!(f=Sf(c,h))||f.enumerable})}return n},Kf=(n)=>Gf(v({},"__esModule",{value:!0}),n),qn={};Zf(qn,{isArrayBuffer:()=>Qf});an.exports=Kf(qn);var Qf=Vf((n)=>typeof ArrayBuffer==="function"&&n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]","isArrayBuffer")});var R=N((Wr,cc)=>{var{defineProperty:q,getOwnPropertyDescriptor:Xf,getOwnPropertyNames:Jf}=Object,Af=Object.prototype.hasOwnProperty,_n=(n,c)=>q(n,"name",{value:c,configurable:!0}),Wf=(n,c)=>{for(var t in c)q(n,t,{get:c[t],enumerable:!0})},bf=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Jf(c))if(!Af.call(n,h)&&h!==t)q(n,h,{get:()=>c[h],enumerable:!(f=Xf(c,h))||f.enumerable})}return n},Bf=(n)=>bf(q({},"__esModule",{value:!0}),n),nc={};Wf(nc,{fromArrayBuffer:()=>Rf,fromString:()=>jf});cc.exports=Bf(nc);var Mf=mn(),dn=import.meta.require("buffer"),Rf=_n((n,c=0,t=n.byteLength-c)=>{if(!Mf.isArrayBuffer(n))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof n} (${n})`);return dn.Buffer.from(n,c,t)},"fromArrayBuffer"),jf=_n((n,c)=>{if(typeof n!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof n} (${n})`);return c?dn.Buffer.from(n,c):dn.Buffer.from(n)},"fromString")});var hc=N((tc)=>{Object.defineProperty(tc,"__esModule",{value:!0});tc.fromBase64=void 0;var Hf=R(),Pf=/^[A-Za-z0-9+/]*={0,2}$/,ef=(n)=>{if(n.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Pf.exec(n))throw new TypeError("Invalid base64 string.");const c=Hf.fromString(n,"base64");return new Uint8Array(c.buffer,c.byteOffset,c.byteLength)};tc.fromBase64=ef});var m=N((Br,uc)=>{var{defineProperty:a,getOwnPropertyDescriptor:lf,getOwnPropertyNames:kf}=Object,Of=Object.prototype.hasOwnProperty,En=(n,c)=>a(n,"name",{value:c,configurable:!0}),pf=(n,c)=>{for(var t in c)a(n,t,{get:c[t],enumerable:!0})},vf=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of kf(c))if(!Of.call(n,h)&&h!==t)a(n,h,{get:()=>c[h],enumerable:!(f=lf(c,h))||f.enumerable})}return n},qf=(n)=>vf(a({},"__esModule",{value:!0}),n),ic={};pf(ic,{fromUtf8:()=>sc,toUint8Array:()=>af,toUtf8:()=>mf});uc.exports=qf(ic);var rc=R(),sc=En((n)=>{const c=rc.fromString(n,"utf8");return new Uint8Array(c.buffer,c.byteOffset,c.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),af=En((n)=>{if(typeof n==="string")return sc(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(n)},"toUint8Array"),mf=En((n)=>{if(typeof n==="string")return n;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return rc.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("utf8")},"toUtf8")});var $c=N((wc)=>{Object.defineProperty(wc,"__esModule",{value:!0});wc.toBase64=void 0;var _f=R(),nh=m(),ch=(n)=>{let c;if(typeof n==="string")c=nh.fromUtf8(n);else c=n;if(typeof c!=="object"||typeof c.byteOffset!=="number"||typeof c.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return _f.fromArrayBuffer(c.buffer,c.byteOffset,c.byteLength).toString("base64")};wc.toBase64=ch});var nn=N((Rr,_)=>{var{defineProperty:xc,getOwnPropertyDescriptor:th,getOwnPropertyNames:fh}=Object,hh=Object.prototype.hasOwnProperty,Fn=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of fh(c))if(!hh.call(n,h)&&h!==t)xc(n,h,{get:()=>c[h],enumerable:!(f=th(c,h))||f.enumerable})}return n},dc=(n,c,t)=>(Fn(n,c,"default"),t&&Fn(t,c,"default")),ih=(n)=>Fn(xc({},"__esModule",{value:!0}),n),Cn={};_.exports=ih(Cn);dc(Cn,hc(),_.exports);dc(Cn,$c(),_.exports)});var Cc=N((Ec)=>{Object.defineProperty(Ec,"__esModule",{value:!0});Ec.getAwsChunkedEncodingStream=void 0;var rh=import.meta.require("stream"),sh=(n,c)=>{const{base64Encoder:t,bodyLengthChecker:f,checksumAlgorithmFn:h,checksumLocationName:i,streamHasher:r}=c,s=t!==void 0&&h!==void 0&&i!==void 0&&r!==void 0,u=s?r(h,n):void 0,x=new rh.Readable({read:()=>{}});return n.on("data",(y)=>{const w=f(y)||0;x.push(`${w.toString(16)}\r\n`),x.push(y),x.push("\r\n")}),n.on("end",async()=>{if(x.push("0\r\n"),s){const y=t(await u);x.push(`${i}:${y}\r\n`),x.push("\r\n")}x.push(null)}),x};Ec.getAwsChunkedEncodingStream=sh});var Un=N((Hr,Sc)=>{var Dc=function(n){return Object.keys(n).reduce((c,t)=>{const f=n[t];return{...c,[t]:Array.isArray(f)?[...f]:f}},{})},gc=function(n){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(n)},cn=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,wh=Object.getOwnPropertyNames,Th=Object.prototype.hasOwnProperty,X=(n,c)=>cn(n,"name",{value:c,configurable:!0}),$h=(n,c)=>{for(var t in c)cn(n,t,{get:c[t],enumerable:!0})},xh=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of wh(c))if(!Th.call(n,h)&&h!==t)cn(n,h,{get:()=>c[h],enumerable:!(f=uh(c,h))||f.enumerable})}return n},dh=(n)=>xh(cn({},"__esModule",{value:!0}),n),Uc={};$h(Uc,{Field:()=>Ch,Fields:()=>Uh,HttpRequest:()=>Ih,HttpResponse:()=>yh,IHttpRequest:()=>Ic.HttpRequest,getHttpHandlerExtensionConfiguration:()=>Eh,isValidHostname:()=>gc,resolveHttpHandlerRuntimeConfig:()=>Fh});Sc.exports=dh(Uc);var Eh=X((n)=>{let c=n.httpHandler;return{setHttpHandler(t){c=t},httpHandler(){return c},updateHttpClientConfig(t,f){c.updateHttpClientConfig(t,f)},httpHandlerConfigs(){return c.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),Fh=X((n)=>{return{httpHandler:n.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),Ic=p(),yc=class n{constructor({name:c,kind:t=Ic.FieldPosition.HEADER,values:f=[]}){this.name=c,this.kind=t,this.values=f}add(c){this.values.push(c)}set(c){this.values=c}remove(c){this.values=this.values.filter((t)=>t!==c)}toString(){return this.values.map((c)=>c.includes(",")||c.includes(" ")?`"${c}"`:c).join(", ")}get(){return this.values}};X(yc,"Field");var Ch=yc,oc=class n{constructor({fields:c=[],encoding:t="utf-8"}){this.entries={},c.forEach(this.setField.bind(this)),this.encoding=t}setField(c){this.entries[c.name.toLowerCase()]=c}getField(c){return this.entries[c.toLowerCase()]}removeField(c){delete this.entries[c.toLowerCase()]}getByType(c){return Object.values(this.entries).filter((t)=>t.kind===c)}};X(oc,"Fields");var Uh=oc,Lc=class n{constructor(c){this.method=c.method||"GET",this.hostname=c.hostname||"localhost",this.port=c.port,this.query=c.query||{},this.headers=c.headers||{},this.body=c.body,this.protocol=c.protocol?c.protocol.slice(-1)!==":"?`${c.protocol}:`:c.protocol:"https:",this.path=c.path?c.path.charAt(0)!=="/"?`/${c.path}`:c.path:"/",this.username=c.username,this.password=c.password,this.fragment=c.fragment}static clone(c){const t=new n({...c,headers:{...c.headers}});if(t.query)t.query=Dc(t.query);return t}static isInstance(c){if(!c)return!1;const t=c;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return n.clone(this)}};X(Lc,"HttpRequest");var Ih=Lc;X(Dc,"cloneQuery");var Nc=class n{constructor(c){this.statusCode=c.statusCode,this.reason=c.reason,this.headers=c.headers||{},this.body=c.body}static isInstance(c){if(!c)return!1;const t=c;return typeof t.statusCode==="number"&&typeof t.headers==="object"}};X(Nc,"HttpResponse");var yh=Nc;X(gc,"isValidHostname")});var Zc=N((Pr,Vc)=>{var{defineProperty:tn,getOwnPropertyDescriptor:oh,getOwnPropertyNames:Lh}=Object,Dh=Object.prototype.hasOwnProperty,In=(n,c)=>tn(n,"name",{value:c,configurable:!0}),Nh=(n,c)=>{for(var t in c)tn(n,t,{get:c[t],enumerable:!0})},gh=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Lh(c))if(!Dh.call(n,h)&&h!==t)tn(n,h,{get:()=>c[h],enumerable:!(f=oh(c,h))||f.enumerable})}return n},Sh=(n)=>gh(tn({},"__esModule",{value:!0}),n),Yc={};Nh(Yc,{escapeUri:()=>zc,escapeUriPath:()=>zh});Vc.exports=Sh(Yc);var zc=In((n)=>encodeURIComponent(n).replace(/[!'()*]/g,Yh),"escapeUri"),Yh=In((n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),zh=In((n)=>n.split("/").map(zc).join("/"),"escapeUriPath")});var j=N((er,Qc)=>{var Kc=function(n){const c=[];for(let t of Object.keys(n).sort()){const f=n[t];if(t=yn.escapeUri(t),Array.isArray(f))for(let h=0,i=f.length;h<i;h++)c.push(`${t}=${yn.escapeUri(f[h])}`);else{let h=t;if(f||typeof f==="string")h+=`=${yn.escapeUri(f)}`;c.push(h)}}return c.join("&")},fn=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,Zh=Object.getOwnPropertyNames,Gh=Object.prototype.hasOwnProperty,Kh=(n,c)=>fn(n,"name",{value:c,configurable:!0}),Qh=(n,c)=>{for(var t in c)fn(n,t,{get:c[t],enumerable:!0})},Xh=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Zh(c))if(!Gh.call(n,h)&&h!==t)fn(n,h,{get:()=>c[h],enumerable:!(f=Vh(c,h))||f.enumerable})}return n},Jh=(n)=>Xh(fn({},"__esModule",{value:!0}),n),Gc={};Qh(Gc,{buildQueryString:()=>Kc});Qc.exports=Jh(Gc);var yn=Zc();Kh(Kc,"buildQueryString")});var ac=N((lr,qc)=>{async function Dn(n,c,t=Ac){const f=c.headers??{},h=f.Expect||f.expect;let i=-1,r=!1;if(h==="100-continue")await Promise.race([new Promise((s)=>{i=Number(setTimeout(s,Math.max(Ac,t)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(i),s()}),n.on("error",()=>{r=!0,clearTimeout(i),s()})})]);if(!r)Pc(n,c.body)}var Pc=function(n,c){if(c instanceof Hc.Readable){c.pipe(n);return}if(c){if(Buffer.isBuffer(c)||typeof c==="string"){n.end(c);return}const t=c;if(typeof t==="object"&&t.buffer&&typeof t.byteOffset==="number"&&typeof t.byteLength==="number"){n.end(Buffer.from(t.buffer,t.byteOffset,t.byteLength));return}n.end(Buffer.from(c));return}n.end()};async function vc(n){const c=[],t=n.getReader();let f=!1,h=0;while(!f){const{done:s,value:u}=await t.read();if(u)c.push(u),h+=u.length;f=s}const i=new Uint8Array(h);let r=0;for(let s of c)i.set(s,r),r+=s.length;return i}var{create:Ah,defineProperty:H,getOwnPropertyDescriptor:Wh,getOwnPropertyNames:bh,getPrototypeOf:Bh}=Object,Mh=Object.prototype.hasOwnProperty,L=(n,c)=>H(n,"name",{value:c,configurable:!0}),Rh=(n,c)=>{for(var t in c)H(n,t,{get:c[t],enumerable:!0})},bc=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of bh(c))if(!Mh.call(n,h)&&h!==t)H(n,h,{get:()=>c[h],enumerable:!(f=Wh(c,h))||f.enumerable})}return n},jh=(n,c,t)=>(t=n!=null?Ah(Bh(n)):{},bc(c||!n||!n.__esModule?H(t,"default",{value:n,enumerable:!0}):t,n)),Hh=(n)=>bc(H({},"__esModule",{value:!0}),n),Bc={};Rh(Bc,{DEFAULT_REQUEST_TIMEOUT:()=>ph,NodeHttp2Handler:()=>_h,NodeHttpHandler:()=>vh,streamCollector:()=>ci});qc.exports=Hh(Bc);var Mc=Un(),Rc=j(),on=import.meta.require("http"),Ln=import.meta.require("https"),Ph=["ECONNRESET","EPIPE","ETIMEDOUT"],jc=L((n)=>{const c={};for(let t of Object.keys(n)){const f=n[t];c[t]=Array.isArray(f)?f.join(","):f}return c},"getTransformedHeaders"),Xc=1000,eh=L((n,c,t=0)=>{if(!t)return-1;const f=L((h)=>{const i=setTimeout(()=>{n.destroy(),c(Object.assign(new Error(`Socket timed out without establishing a connection within ${t} ms`),{name:"TimeoutError"}))},t-h),r=L((s)=>{if(s==null?void 0:s.connecting)s.on("connect",()=>{clearTimeout(i)});else clearTimeout(i)},"doWithSocket");if(n.socket)r(n.socket);else n.on("socket",r)},"registerTimeout");if(t<2000)return f(0),0;return setTimeout(f.bind(null,Xc),Xc)},"setConnectionTimeout"),lh=3000,kh=L((n,{keepAlive:c,keepAliveMsecs:t},f=lh)=>{if(c!==!0)return-1;const h=L(()=>{if(n.socket)n.socket.setKeepAlive(c,t||0);else n.on("socket",(i)=>{i.setKeepAlive(c,t||0)})},"registerListener");if(f===0)return h(),0;return setTimeout(h,f)},"setSocketKeepAlive"),Jc=3000,Oh=L((n,c,t=0)=>{const f=L((h)=>{n.setTimeout(t-h,()=>{n.destroy(),c(Object.assign(new Error(`Connection timed out after ${t} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<t&&t<6000)return f(0),0;return setTimeout(f.bind(null,t===0?0:Jc),Jc)},"setSocketTimeout"),Hc=import.meta.require("stream"),Ac=1000;L(Dn,"writeRequestBody");L(Pc,"writeBody");var ph=0,ec=class n{constructor(c){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,f)=>{if(typeof c==="function")c().then((h)=>{t(this.resolveDefaultConfig(h))}).catch(f);else t(this.resolveDefaultConfig(c))})}static create(c){if(typeof(c==null?void 0:c.handle)==="function")return c;return new n(c)}static checkSocketUsage(c,t,f=console){var h,i,r;const{sockets:s,requests:u,maxSockets:x}=c;if(typeof x!=="number"||x===Infinity)return t;const y=15000;if(Date.now()-y<t)return t;if(s&&u)for(let w in s){const d=((h=s[w])==null?void 0:h.length)??0,T=((i=u[w])==null?void 0:i.length)??0;if(d>=x&&T>=2*x)return(r=f==null?void 0:f.warn)==null||r.call(f,`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${T} additional requests are enqueued.
2
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}resolveDefaultConfig(c){const{requestTimeout:t,connectionTimeout:f,socketTimeout:h,httpAgent:i,httpsAgent:r}=c||{};return{connectionTimeout:f,requestTimeout:t??h,httpAgent:(()=>{if(i instanceof on.Agent||typeof(i==null?void 0:i.destroy)==="function")return i;return new on.Agent({keepAlive:!0,maxSockets:50,...i})})(),httpsAgent:(()=>{if(r instanceof Ln.Agent||typeof(r==null?void 0:r.destroy)==="function")return r;return new Ln.Agent({keepAlive:!0,maxSockets:50,...r})})(),logger:console}}destroy(){var c,t,f,h;(t=(c=this.config)==null?void 0:c.httpAgent)==null||t.destroy(),(h=(f=this.config)==null?void 0:f.httpsAgent)==null||h.destroy()}async handle(c,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;return new Promise((f,h)=>{let i=void 0;const r=[],s=L(async(E)=>{await i,r.forEach(clearTimeout),f(E)},"resolve"),u=L(async(E)=>{await i,r.forEach(clearTimeout),h(E)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t==null?void 0:t.aborted){const E=new Error("Request aborted");E.name="AbortError",u(E);return}const x=c.protocol==="https:",y=x?this.config.httpsAgent:this.config.httpAgent;r.push(setTimeout(()=>{this.socketWarningTimestamp=n.checkSocketUsage(y,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const w=Rc.buildQueryString(c.query||{});let d=void 0;if(c.username!=null||c.password!=null){const E=c.username??"",I=c.password??"";d=`${E}:${I}`}let T=c.path;if(w)T+=`?${w}`;if(c.fragment)T+=`#${c.fragment}`;let U=c.hostname??"";if(U[0]==="["&&U.endsWith("]"))U=c.hostname.slice(1,-1);else U=c.hostname;const o={headers:c.headers,host:U,method:c.method,path:T,port:c.port,agent:y,auth:d},C=(x?Ln.request:on.request)(o,(E)=>{const I=new Mc.HttpResponse({statusCode:E.statusCode||-1,reason:E.statusMessage,headers:jc(E.headers),body:E});s({response:I})});if(C.on("error",(E)=>{if(Ph.includes(E.code))u(Object.assign(E,{name:"TimeoutError"}));else u(E)}),t){const E=L(()=>{C.destroy();const I=new Error("Request aborted");I.name="AbortError",u(I)},"onAbort");if(typeof t.addEventListener==="function"){const I=t;I.addEventListener("abort",E,{once:!0}),C.once("close",()=>I.removeEventListener("abort",E))}else t.onabort=E}r.push(eh(C,u,this.config.connectionTimeout)),r.push(Oh(C,u,this.config.requestTimeout));const $=o.agent;if(typeof $==="object"&&"keepAlive"in $)r.push(kh(C,{keepAlive:$.keepAlive,keepAliveMsecs:$.keepAliveMsecs}));i=Dn(C,c,this.config.requestTimeout).catch((E)=>{return r.forEach(clearTimeout),h(E)})})}updateHttpClientConfig(c,t){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return{...f,[c]:t}})}httpHandlerConfigs(){return this.config??{}}};L(ec,"NodeHttpHandler");var vh=ec,Wc=import.meta.require("http2"),qh=jh(import.meta.require("http2")),lc=class n{constructor(c){this.sessions=[],this.sessions=c??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(c){this.sessions.push(c)}contains(c){return this.sessions.includes(c)}remove(c){this.sessions=this.sessions.filter((t)=>t!==c)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(c){for(let t of this.sessions)if(t===c){if(!t.destroyed)t.destroy()}}};L(lc,"NodeHttp2ConnectionPool");var ah=lc,kc=class n{constructor(c){if(this.sessionCache=new Map,this.config=c,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(c,t){const f=this.getUrlString(c),h=this.sessionCache.get(f);if(h){const u=h.poll();if(u&&!this.config.disableConcurrency)return u}const i=qh.default.connect(f);if(this.config.maxConcurrency)i.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+c.destination.toString())});i.unref();const r=L(()=>{i.destroy(),this.deleteSession(f,i)},"destroySessionCb");if(i.on("goaway",r),i.on("error",r),i.on("frameError",r),i.on("close",()=>this.deleteSession(f,i)),t.requestTimeout)i.setTimeout(t.requestTimeout,r);const s=this.sessionCache.get(f)||new ah;return s.offerLast(i),this.sessionCache.set(f,s),i}deleteSession(c,t){const f=this.sessionCache.get(c);if(!f)return;if(!f.contains(t))return;f.remove(t),this.sessionCache.set(c,f)}release(c,t){var f;const h=this.getUrlString(c);(f=this.sessionCache.get(h))==null||f.offerLast(t)}destroy(){for(let[c,t]of this.sessionCache){for(let f of t){if(!f.destroyed)f.destroy();t.remove(f)}this.sessionCache.delete(c)}}setMaxConcurrentStreams(c){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=c}setDisableConcurrentStreams(c){this.config.disableConcurrency=c}getUrlString(c){return c.destination.toString()}};L(kc,"NodeHttp2ConnectionManager");var mh=kc,Oc=class n{constructor(c){this.metadata={handlerProtocol:"h2"},this.connectionManager=new mh({}),this.configProvider=new Promise((t,f)=>{if(typeof c==="function")c().then((h)=>{t(h||{})}).catch(f);else t(c||{})})}static create(c){if(typeof(c==null?void 0:c.handle)==="function")return c;return new n(c)}destroy(){this.connectionManager.destroy()}async handle(c,{abortSignal:t}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:f,disableConcurrentStreams:h}=this.config;return new Promise((i,r)=>{var s;let u=!1,x=void 0;const y=L(async(D)=>{await x,i(D)},"resolve"),w=L(async(D)=>{await x,r(D)},"reject");if(t==null?void 0:t.aborted){u=!0;const D=new Error("Request aborted");D.name="AbortError",w(D);return}const{hostname:d,method:T,port:U,protocol:o,query:F}=c;let C="";if(c.username!=null||c.password!=null){const D=c.username??"",V=c.password??"";C=`${D}:${V}@`}const $=`${o}//${C}${d}${U?`:${U}`:""}`,E={destination:new URL($)},I=this.connectionManager.lease(E,{requestTimeout:(s=this.config)==null?void 0:s.sessionTimeout,disableConcurrentStreams:h||!1}),g=L((D)=>{if(h)this.destroySession(I);u=!0,w(D)},"rejectWithDestroy"),S=Rc.buildQueryString(F||{});let J=c.path;if(S)J+=`?${S}`;if(c.fragment)J+=`#${c.fragment}`;const Y=I.request({...c.headers,[Wc.constants.HTTP2_HEADER_PATH]:J,[Wc.constants.HTTP2_HEADER_METHOD]:T});if(I.ref(),Y.on("response",(D)=>{const V=new Mc.HttpResponse({statusCode:D[":status"]||-1,headers:jc(D),body:Y});if(u=!0,y({response:V}),h)I.close(),this.connectionManager.deleteSession($,I)}),f)Y.setTimeout(f,()=>{Y.close();const D=new Error(`Stream timed out because of no activity for ${f} ms`);D.name="TimeoutError",g(D)});if(t){const D=L(()=>{Y.close();const V=new Error("Request aborted");V.name="AbortError",g(V)},"onAbort");if(typeof t.addEventListener==="function"){const V=t;V.addEventListener("abort",D,{once:!0}),Y.once("close",()=>V.removeEventListener("abort",D))}else t.onabort=D}Y.on("frameError",(D,V,Cf)=>{g(new Error(`Frame type id ${D} in stream id ${Cf} has failed with code ${V}.`))}),Y.on("error",g),Y.on("aborted",()=>{g(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${Y.rstCode}.`))}),Y.on("close",()=>{if(I.unref(),h)I.destroy();if(!u)g(new Error("Unexpected error: http2 request did not get a response"))}),x=Dn(Y,c,f)})}updateHttpClientConfig(c,t){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return{...f,[c]:t}})}httpHandlerConfigs(){return this.config??{}}destroySession(c){if(!c.destroyed)c.destroy()}};L(Oc,"NodeHttp2Handler");var _h=Oc,pc=class n extends Hc.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(c,t,f){this.bufferedBytes.push(c),f()}};L(pc,"Collector");var ni=pc,ci=L((n)=>{if(ti(n))return vc(n);return new Promise((c,t)=>{const f=new ni;n.pipe(f),n.on("error",(h)=>{f.end(),t(h)}),f.on("error",t),f.on("finish",function(){const h=new Uint8Array(Buffer.concat(this.bufferedBytes));c(h)})})},"streamCollector"),ti=L((n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream,"isReadableStreamInstance");L(vc,"collectReadableStream")});var rt=N((kr,it)=>{var nt=function(n=0){return new Promise((c,t)=>{if(n)setTimeout(()=>{const f=new Error(`Request did not complete within ${n} ms`);f.name="TimeoutError",t(f)},n)})};async function tt(n){const c=await ht(n),t=$i.fromBase64(c);return new Uint8Array(t)}async function ft(n){const c=[],t=n.getReader();let f=!1,h=0;while(!f){const{done:s,value:u}=await t.read();if(u)c.push(u),h+=u.length;f=s}const i=new Uint8Array(h);let r=0;for(let s of c)i.set(s,r),r+=s.length;return i}var ht=function(n){return new Promise((c,t)=>{const f=new FileReader;f.onloadend=()=>{if(f.readyState!==2)return t(new Error("Reader aborted too early"));const h=f.result??"",i=h.indexOf(","),r=i>-1?i+1:h.length;c(h.substring(r))},f.onabort=()=>t(new Error("Read aborted")),f.onerror=()=>t(f.error),f.readAsDataURL(n)})},rn=Object.defineProperty,fi=Object.getOwnPropertyDescriptor,hi=Object.getOwnPropertyNames,ii=Object.prototype.hasOwnProperty,G=(n,c)=>rn(n,"name",{value:c,configurable:!0}),ri=(n,c)=>{for(var t in c)rn(n,t,{get:c[t],enumerable:!0})},si=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of hi(c))if(!ii.call(n,h)&&h!==t)rn(n,h,{get:()=>c[h],enumerable:!(f=fi(c,h))||f.enumerable})}return n},ui=(n)=>si(rn({},"__esModule",{value:!0}),n),_c={};ri(_c,{FetchHttpHandler:()=>Ti,keepAliveSupport:()=>hn,streamCollector:()=>xi});it.exports=ui(_c);var mc=Un(),wi=j();G(nt,"requestTimeout");var hn={supported:void 0},ct=class n{static create(c){if(typeof(c==null?void 0:c.handle)==="function")return c;return new n(c)}constructor(c){if(typeof c==="function")this.configProvider=c().then((t)=>t||{});else this.config=c??{},this.configProvider=Promise.resolve(this.config);if(hn.supported===void 0)hn.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(c,{abortSignal:t}={}){var f;if(!this.config)this.config=await this.configProvider;const h=this.config.requestTimeout,i=this.config.keepAlive===!0,r=this.config.credentials;if(t==null?void 0:t.aborted){const $=new Error("Request aborted");return $.name="AbortError",Promise.reject($)}let s=c.path;const u=wi.buildQueryString(c.query||{});if(u)s+=`?${u}`;if(c.fragment)s+=`#${c.fragment}`;let x="";if(c.username!=null||c.password!=null){const $=c.username??"",E=c.password??"";x=`${$}:${E}@`}const{port:y,method:w}=c,d=`${c.protocol}//${x}${c.hostname}${y?`:${y}`:""}${s}`,T=w==="GET"||w==="HEAD"?void 0:c.body,U={body:T,headers:new Headers(c.headers),method:w,credentials:r};if((f=this.config)==null?void 0:f.cache)U.cache=this.config.cache;if(T)U.duplex="half";if(typeof AbortController!=="undefined")U.signal=t;if(hn.supported)U.keepalive=i;if(typeof this.config.requestInit==="function")Object.assign(U,this.config.requestInit(c));let o=G(()=>{},"removeSignalEventListener");const F=new Request(d,U),C=[fetch(F).then(($)=>{const E=$.headers,I={};for(let S of E.entries())I[S[0]]=S[1];if($.body==null)return $.blob().then((S)=>({response:new mc.HttpResponse({headers:I,reason:$.statusText,statusCode:$.status,body:S})}));return{response:new mc.HttpResponse({headers:I,reason:$.statusText,statusCode:$.status,body:$.body})}}),nt(h)];if(t)C.push(new Promise(($,E)=>{const I=G(()=>{const g=new Error("Request aborted");g.name="AbortError",E(g)},"onAbort");if(typeof t.addEventListener==="function"){const g=t;g.addEventListener("abort",I,{once:!0}),o=G(()=>g.removeEventListener("abort",I),"removeSignalEventListener")}else t.onabort=I}));return Promise.race(C).finally(o)}updateHttpClientConfig(c,t){this.config=void 0,this.configProvider=this.configProvider.then((f)=>{return f[c]=t,f})}httpHandlerConfigs(){return this.config??{}}};G(ct,"FetchHttpHandler");var Ti=ct,$i=nn(),xi=G((n)=>{if(typeof Blob==="function"&&n instanceof Blob)return tt(n);return ft(n)},"streamCollector");G(tt,"collectBlob");G(ft,"collectStream");G(ht,"readToBase64")});var dt=N((Or,xt)=>{var Tt=function(n){if(n.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const c=new Uint8Array(n.length/2);for(let t=0;t<n.length;t+=2){const f=n.slice(t,t+2).toLowerCase();if(f in Nn)c[t/2]=Nn[f];else throw new Error(`Cannot decode unrecognized sequence ${f} as hexadecimal`)}return c},$t=function(n){let c="";for(let t=0;t<n.byteLength;t++)c+=wt[n[t]];return c},sn=Object.defineProperty,di=Object.getOwnPropertyDescriptor,Ei=Object.getOwnPropertyNames,Fi=Object.prototype.hasOwnProperty,st=(n,c)=>sn(n,"name",{value:c,configurable:!0}),Ci=(n,c)=>{for(var t in c)sn(n,t,{get:c[t],enumerable:!0})},Ui=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Ei(c))if(!Fi.call(n,h)&&h!==t)sn(n,h,{get:()=>c[h],enumerable:!(f=di(c,h))||f.enumerable})}return n},Ii=(n)=>Ui(sn({},"__esModule",{value:!0}),n),ut={};Ci(ut,{fromHex:()=>Tt,toHex:()=>$t});xt.exports=Ii(ut);var wt={},Nn={};for(let n=0;n<256;n++){let c=n.toString(16).toLowerCase();if(c.length===1)c=`0${c}`;wt[n]=c,Nn[c]=n}st(Tt,"fromHex");st($t,"toHex")});var P=N((Et)=>{Object.defineProperty(Et,"__esModule",{value:!0});Et.isReadableStream=void 0;var yi=(n)=>{var c;return typeof ReadableStream==="function"&&(((c=n===null||n===void 0?void 0:n.constructor)===null||c===void 0?void 0:c.name)===ReadableStream.name||n instanceof ReadableStream)};Et.isReadableStream=yi});var Lt=N((yt)=>{Object.defineProperty(yt,"__esModule",{value:!0});yt.sdkStreamMixin=void 0;var oi=rt(),Li=nn(),Di=dt(),Ni=m(),Ct=P(),Ut="The stream has already been transformed.",gi=(n)=>{var c,t;if(!It(n)&&!Ct.isReadableStream(n)){const r=((t=(c=n===null||n===void 0?void 0:n.__proto__)===null||c===void 0?void 0:c.constructor)===null||t===void 0?void 0:t.name)||n;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let f=!1;const h=async()=>{if(f)throw new Error(Ut);return f=!0,await oi.streamCollector(n)},i=(r)=>{if(typeof r.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return r.stream()};return Object.assign(n,{transformToByteArray:h,transformToString:async(r)=>{const s=await h();if(r==="base64")return Li.toBase64(s);else if(r==="hex")return Di.toHex(s);else if(r===void 0||r==="utf8"||r==="utf-8")return Ni.toUtf8(s);else if(typeof TextDecoder==="function")return new TextDecoder(r).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(f)throw new Error(Ut);if(f=!0,It(n))return i(n);else if(Ct.isReadableStream(n))return n;else throw new Error(`Cannot transform payload to web stream, got ${n}`)}})};yt.sdkStreamMixin=gi;var It=(n)=>typeof Blob==="function"&&n instanceof Blob});var St=N((Nt)=>{Object.defineProperty(Nt,"__esModule",{value:!0});Nt.sdkStreamMixin=void 0;var Si=ac(),Yi=R(),gn=import.meta.require("stream"),zi=import.meta.require("util"),Vi=Lt(),Dt="The stream has already been transformed.",Zi=(n)=>{var c,t;if(!(n instanceof gn.Readable))try{return Vi.sdkStreamMixin(n)}catch(i){const r=((t=(c=n===null||n===void 0?void 0:n.__proto__)===null||c===void 0?void 0:c.constructor)===null||t===void 0?void 0:t.name)||n;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let f=!1;const h=async()=>{if(f)throw new Error(Dt);return f=!0,await Si.streamCollector(n)};return Object.assign(n,{transformToByteArray:h,transformToString:async(i)=>{const r=await h();if(i===void 0||Buffer.isEncoding(i))return Yi.fromArrayBuffer(r.buffer,r.byteOffset,r.byteLength).toString(i);else return new zi.TextDecoder(i).decode(r)},transformToWebStream:()=>{if(f)throw new Error(Dt);if(n.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof gn.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return f=!0,gn.Readable.toWeb(n)}})};Nt.sdkStreamMixin=Zi});var Vt=N((Yt)=>{async function Gi(n){if(typeof n.stream==="function")n=n.stream();return n.tee()}Object.defineProperty(Yt,"__esModule",{value:!0});Yt.splitStream=void 0;Yt.splitStream=Gi});var Qt=N((Gt)=>{async function Xi(n){if(Qi.isReadableStream(n))return Ki.splitStream(n);const c=new Zt.PassThrough,t=new Zt.PassThrough;return n.pipe(c),n.pipe(t),[c,t]}Object.defineProperty(Gt,"__esModule",{value:!0});Gt.splitStream=void 0;var Zt=import.meta.require("stream"),Ki=Vt(),Qi=P();Gt.splitStream=Xi});var At=N((Xt)=>{async function Ji(n,c){var t;let f=0;const h=[],i=n.getReader();let r=!1;while(!r){const{done:x,value:y}=await i.read();if(y)h.push(y),f+=(t=y===null||y===void 0?void 0:y.byteLength)!==null&&t!==void 0?t:0;if(f>=c)break;r=x}i.releaseLock();const s=new Uint8Array(Math.min(c,f));let u=0;for(let x of h){if(x.byteLength>s.byteLength-u){s.set(x.subarray(0,s.byteLength-u),u);break}else s.set(x,u);u+=x.length}return s}Object.defineProperty(Xt,"__esModule",{value:!0});Xt.headStream=void 0;Xt.headStream=Ji});var Mt=N((bt)=>{Object.defineProperty(bt,"__esModule",{value:!0});bt.headStream=void 0;var Ai=import.meta.require("stream"),Wi=At(),bi=P(),Bi=(n,c)=>{if(bi.isReadableStream(n))return Wi.headStream(n,c);return new Promise((t,f)=>{const h=new Wt;h.limit=c,n.pipe(h),n.on("error",(i)=>{h.end(),f(i)}),h.on("error",f),h.on("finish",function(){const i=new Uint8Array(Buffer.concat(this.buffers));t(i)})})};bt.headStream=Bi;class Wt extends Ai.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(n,c,t){var f;if(this.buffers.push(n),this.bytesBuffered+=(f=n.byteLength)!==null&&f!==void 0?f:0,this.bytesBuffered>=this.limit){const h=this.bytesBuffered-this.limit,i=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=i.subarray(0,i.byteLength-h),this.emit("finish")}t()}}});var lt=N((cs,b)=>{var Ht=function(n,c="utf-8"){if(c==="base64")return Rt.toBase64(n);return jt.toUtf8(n)},Pt=function(n,c){if(c==="base64")return Yn.mutate(Rt.fromBase64(n));return Yn.mutate(jt.fromUtf8(n))},un=Object.defineProperty,Mi=Object.getOwnPropertyDescriptor,Ri=Object.getOwnPropertyNames,ji=Object.prototype.hasOwnProperty,zn=(n,c)=>un(n,"name",{value:c,configurable:!0}),Hi=(n,c)=>{for(var t in c)un(n,t,{get:c[t],enumerable:!0})},Sn=(n,c,t,f)=>{if(c&&typeof c==="object"||typeof c==="function"){for(let h of Ri(c))if(!ji.call(n,h)&&h!==t)un(n,h,{get:()=>c[h],enumerable:!(f=Mi(c,h))||f.enumerable})}return n},e=(n,c,t)=>(Sn(n,c,"default"),t&&Sn(t,c,"default")),Pi=(n)=>Sn(un({},"__esModule",{value:!0}),n),W={};Hi(W,{Uint8ArrayBlobAdapter:()=>Yn});b.exports=Pi(W);var Rt=nn(),jt=m();zn(Ht,"transformToString");zn(Pt,"transformFromString");var et=class n extends Uint8Array{static fromString(c,t="utf-8"){switch(typeof c){case"string":return Pt(c,t);default:throw new Error(`Unsupported conversion from ${typeof c} to Uint8ArrayBlobAdapter.`)}}static mutate(c){return Object.setPrototypeOf(c,n.prototype),c}transformToString(c="utf-8"){return Ht(this,c)}};zn(et,"Uint8ArrayBlobAdapter");var Yn=et;e(W,Cc(),b.exports);e(W,St(),b.exports);e(W,Qt(),b.exports);e(W,Mt(),b.exports);e(W,P(),b.exports)});var Pn=Q(xn(),1);class Nf{constructor(n){this.config=n,this.middlewareStack=Pn.constructStack()}send(n,c,t){const f=typeof c!=="function"?c:void 0,h=typeof c==="function"?c:t,i=f===void 0&&this.config.cacheMiddleware===!0;let r;if(i){if(!this.handlers)this.handlers=new WeakMap;const s=this.handlers;if(s.has(n.constructor))r=s.get(n.constructor);else r=n.resolveMiddleware(this.middlewareStack,this.config,f),s.set(n.constructor,r)}else delete this.handlers,r=n.resolveMiddleware(this.middlewareStack,this.config,f);if(h)r(n).then((s)=>h(null,s.output),(s)=>h(s)).catch(()=>{});else return r(n).then((s)=>s.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var en=Q(xn(),1),ln=Q(p(),1);class kn{constructor(){this.middlewareStack=en.constructStack()}static classBuilder(){return new On}resolveMiddlewareWithContext(n,c,t,{middlewareFn:f,clientName:h,commandName:i,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,smithyContext:u,additionalContext:x,CommandCtor:y}){for(let o of f.bind(this)(y,n,c,t))this.middlewareStack.use(o);const w=n.concat(this.middlewareStack),{logger:d}=c,T={logger:d,clientName:h,commandName:i,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,[ln.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...x},{requestHandler:U}=c;return w.resolve((o)=>U.handle(o.request,t||{}),T)}}class On{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(n)=>n,this._outputFilterSensitiveLog=(n)=>n,this._serializer=null,this._deserializer=null}init(n){this._init=n}ep(n){return this._ep=n,this}m(n){return this._middlewareFn=n,this}s(n,c,t={}){return this._smithyContext={service:n,operation:c,...t},this}c(n={}){return this._additionalContext=n,this}n(n,c){return this._clientName=n,this._commandName=c,this}f(n=(t)=>t,c=(t)=>t){return this._inputFilterSensitiveLog=n,this._outputFilterSensitiveLog=c,this}ser(n){return this._serializer=n,this}de(n){return this._deserializer=n,this}build(){const n=this;let c;return c=class extends kn{static getEndpointParameterInstructions(){return n._ep}constructor(...[t]){super();this.serialize=n._serializer,this.deserialize=n._deserializer,this.input=t??{},n._init(this)}resolveMiddleware(t,f,h){return this.resolveMiddlewareWithContext(t,f,h,{CommandCtor:c,middlewareFn:n._middlewareFn,clientName:n._clientName,commandName:n._commandName,inputFilterSensitiveLog:n._inputFilterSensitiveLog,outputFilterSensitiveLog:n._outputFilterSensitiveLog,smithyContext:n._smithyContext,additionalContext:n._additionalContext})}}}}var Zr="***SensitiveInformation***";var Kr=(n,c)=>{for(let t of Object.keys(n)){const f=n[t],h=async function(r,s,u){const x=new f(r);if(typeof s==="function")this.send(x,s);else if(typeof u==="function"){if(typeof s!=="object")throw new Error(`Expected http options but got ${typeof s}`);this.send(x,s||{},u)}else return this.send(x,s)},i=(t[0].toLowerCase()+t.slice(1)).replace(/Command$/,"");c.prototype[i]=h}};class pn extends Error{constructor(n){super(n.message);Object.setPrototypeOf(this,pn.prototype),this.name=n.name,this.$fault=n.$fault,this.$metadata=n.$metadata}}var vn=(n,c={})=>{Object.entries(c).filter(([,f])=>f!==void 0).forEach(([f,h])=>{if(n[f]==null||n[f]==="")n[f]=h});const t=n.message||n.Message||"UnknownError";return n.message=t,delete n.Message,n};class gf{trace(){}debug(){}info(){}warn(){}error(){}}var wn=Q(lt(),1),ts=async(n=new Uint8Array,c)=>{if(n instanceof Uint8Array)return wn.Uint8ArrayBlobAdapter.mutate(n);if(!n)return wn.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const t=c.streamCollector(n);return wn.Uint8ArrayBlobAdapter.mutate(await t)};var hs=(n)=>{switch(n){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${n}"`)}};var ei=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string"){const c=parseFloat(n);if(!Number.isNaN(c)){if(String(c)!==String(n))_t.warn(mt(`Expected number but observed string: ${n}`));return c}}if(typeof n==="number")return n;throw new TypeError(`Expected number, got ${typeof n}: ${n}`)},li=Math.ceil(340282346638528860000000000000000000000),kt=(n)=>{const c=ei(n);if(c!==void 0&&!Number.isNaN(c)&&c!==Infinity&&c!==(-Infinity)){if(Math.abs(c)>li)throw new TypeError(`Expected 32-bit float, got ${n}`)}return c},Vn=(n)=>{if(n===null||n===void 0)return;if(Number.isInteger(n)&&!Number.isNaN(n))return n;throw new TypeError(`Expected integer, got ${typeof n}: ${n}`)};var Ot=(n)=>Zn(n,32),pt=(n)=>Zn(n,16),vt=(n)=>Zn(n,8),Zn=(n,c)=>{const t=Vn(n);if(t!==void 0&&ki(t,c)!==t)throw new TypeError(`Expected ${c}-bit integer, got ${n}`);return t},ki=(n,c)=>{switch(c){case 32:return Int32Array.of(n)[0];case 16:return Int16Array.of(n)[0];case 8:return Int8Array.of(n)[0]}},is=(n,c)=>{if(n===null||n===void 0){if(c)throw new TypeError(`Expected a non-null value for ${c}`);throw new TypeError("Expected a non-null value")}return n},rs=(n)=>{if(n===null||n===void 0)return;if(typeof n==="object"&&!Array.isArray(n))return n;const c=Array.isArray(n)?"array":typeof n;throw new TypeError(`Expected object, got ${c}: ${n}`)},ss=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string")return n;if(["boolean","number","bigint"].includes(typeof n))return _t.warn(mt(`Expected string, got ${typeof n}: ${n}`)),String(n);throw new TypeError(`Expected string, got ${typeof n}: ${n}`)};var qt=(n)=>{if(typeof n=="string")return kt(l(n));return kt(n)},Oi=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,l=(n)=>{const c=n.match(Oi);if(c===null||c[0].length!==n.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(n)};var us=(n)=>{if(typeof n==="string")return Vn(l(n));return Vn(n)};var ws=(n)=>{if(typeof n==="string")return Ot(l(n));return Ot(n)},B=(n)=>{if(typeof n==="string")return pt(l(n));return pt(n)},at=(n)=>{if(typeof n==="string")return vt(l(n));return vt(n)},mt=(n)=>{return String(new TypeError(n).stack||n).split("\n").slice(0,5).filter((c)=>!c.includes("stackTraceWarning")).join("\n")},_t={warn:console.warn};function ds(n){const c=n.getUTCFullYear(),t=n.getUTCMonth(),f=n.getUTCDay(),h=n.getUTCDate(),i=n.getUTCHours(),r=n.getUTCMinutes(),s=n.getUTCSeconds(),u=h<10?`0${h}`:`${h}`,x=i<10?`0${i}`:`${i}`,y=r<10?`0${r}`:`${r}`,w=s<10?`0${s}`:`${s}`;return`${pi[f]}, ${u} ${Kn[t]} ${c} ${x}:${y}:${w} GMT`}var pi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Kn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vi=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Es=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const c=vi.exec(n);if(!c)throw new TypeError("Invalid RFC-3339 date-time value");const[t,f,h,i,r,s,u,x]=c,y=B(M(f)),w=Z(h,"month",1,12),d=Z(i,"day",1,31);return k(y,w,d,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x})},qi=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Fs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const c=qi.exec(n);if(!c)throw new TypeError("Invalid RFC-3339 date-time value");const[t,f,h,i,r,s,u,x,y]=c,w=B(M(f)),d=Z(h,"month",1,12),T=Z(i,"day",1,31),U=k(w,d,T,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x});if(y.toUpperCase()!="Z")U.setTime(U.getTime()-sr(y));return U},ai=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$/),mi=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$/),_i=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})$/),Cs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let c=ai.exec(n);if(c){const[t,f,h,i,r,s,u,x]=c;return k(B(M(i)),Gn(h),Z(f,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x})}if(c=mi.exec(n),c){const[t,f,h,i,r,s,u,x]=c;return tr(k(nr(i),Gn(h),Z(f,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:x}))}if(c=_i.exec(n),c){const[t,f,h,i,r,s,u,x]=c;return k(B(M(x)),Gn(f),Z(h.trimLeft(),"day",1,31),{hours:i,minutes:r,seconds:s,fractionalMilliseconds:u})}throw new TypeError("Invalid RFC-7231 date-time value")};var k=(n,c,t,f)=>{const h=c-1;return hr(n,h,t),new Date(Date.UTC(n,h,t,Z(f.hours,"hour",0,23),Z(f.minutes,"minute",0,59),Z(f.seconds,"seconds",0,60),rr(f.fractionalMilliseconds)))},nr=(n)=>{const c=(new Date()).getUTCFullYear(),t=Math.floor(c/100)*100+B(M(n));if(t<c)return t+100;return t},cr=1576800000000,tr=(n)=>{if(n.getTime()-(new Date()).getTime()>cr)return new Date(Date.UTC(n.getUTCFullYear()-100,n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()));return n},Gn=(n)=>{const c=Kn.indexOf(n);if(c<0)throw new TypeError(`Invalid month: ${n}`);return c+1},fr=[31,28,31,30,31,30,31,31,30,31,30,31],hr=(n,c,t)=>{let f=fr[c];if(c===1&&ir(n))f=29;if(t>f)throw new TypeError(`Invalid day for ${Kn[c]} in ${n}: ${t}`)},ir=(n)=>{return n%4===0&&(n%100!==0||n%400===0)},Z=(n,c,t,f)=>{const h=at(M(n));if(h<t||h>f)throw new TypeError(`${c} must be between ${t} and ${f}, inclusive`);return h},rr=(n)=>{if(n===null||n===void 0)return 0;return qt("0."+n)*1000},sr=(n)=>{const c=n[0];let t=1;if(c=="+")t=1;else if(c=="-")t=-1;else throw new TypeError(`Offset direction, ${c}, must be "+" or "-"`);const f=Number(n.substring(1,3)),h=Number(n.substring(4,6));return t*(f*60+h)*60*1000},M=(n)=>{let c=0;while(c<n.length-1&&n.charAt(c)==="0")c++;if(c===0)return n;return n.slice(c)};var ur=({output:n,parsedBody:c,exceptionCtor:t,errorCode:f})=>{const h=wr(n),i=h.httpStatusCode?h.httpStatusCode+"":void 0,r=new t({name:c?.code||c?.Code||f||i||"UnknownError",$fault:"client",$metadata:h});throw vn(r,c)},ys=(n)=>{return({output:c,parsedBody:t,errorCode:f})=>{ur({output:c,parsedBody:t,exceptionCtor:n,errorCode:f})}},wr=(n)=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]});var Ls=(n)=>{switch(n){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var nf=!1,Ns=(n)=>{if(n&&!nf&&parseInt(n.substring(1,n.indexOf(".")))<16)nf=!0};var Qn=Q(p(),1);var cf=(n)=>{const c=[];for(let t in Qn.AlgorithmId){const f=Qn.AlgorithmId[t];if(n[f]===void 0)continue;c.push({algorithmId:()=>f,checksumConstructor:()=>n[f]})}return{_checksumAlgorithms:c,addChecksumAlgorithm(t){this._checksumAlgorithms.push(t)},checksumAlgorithms(){return this._checksumAlgorithms}}},tf=(n)=>{const c={};return n.checksumAlgorithms().forEach((t)=>{c[t.algorithmId()]=t.checksumConstructor()}),c};var ff=(n)=>{let c=n.retryStrategy;return{setRetryStrategy(t){c=t},retryStrategy(){return c}}},hf=(n)=>{const c={};return c.retryStrategy=n.retryStrategy(),c};var Zs=(n)=>{return{...cf(n),...ff(n)}};var Gs=(n)=>{return{...tf(n),...hf(n)}};function Tr(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(c){return"%"+c.charCodeAt(0).toString(16).toUpperCase()})}var Xn=function(){const n=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,n.prototype),t};Xn.prototype=Object.create(String.prototype,{constructor:{value:Xn,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(Xn,String);function $r(n,c,t){let f,h,i;if(typeof c==="undefined"&&typeof t==="undefined")f={},i=n;else if(f=n,typeof c==="function")return h=c,i=t,xr(f,h,i);else i=c;for(let r of Object.keys(i)){if(!Array.isArray(i[r])){f[r]=i[r];continue}rf(f,null,i,r)}return f}var Bs=(n,c)=>{const t={};for(let f in c)rf(t,n,c,f);return t},xr=(n,c,t)=>{return $r(n,Object.entries(t).reduce((f,[h,i])=>{if(Array.isArray(i))f[h]=i;else if(typeof i==="function")f[h]=[c,i()];else f[h]=[c,i];return f},{}))},rf=(n,c,t,f)=>{if(c!==null){let r=t[f];if(typeof r==="function")r=[,r];const[s=dr,u=Er,x=f]=r;if(typeof s==="function"&&s(c[x])||typeof s!=="function"&&!!s)n[f]=u(c[x]);return}let[h,i]=t[f];if(typeof i==="function"){let r;const s=h===void 0&&(r=i())!=null,u=typeof h==="function"&&!!h(void 0)||typeof h!=="function"&&!!h;if(s)n[f]=r;else if(u)n[f]=i()}else{const r=h===void 0&&i!=null,s=typeof h==="function"&&!!h(i)||typeof h!=="function"&&!!h;if(r||s)n[f]=i}},dr=(n)=>n!=null,Er=(n)=>n;var Hs=(n)=>n.toISOString().replace(".000Z","Z");var sf=(n)=>{if(n==null)return{};if(Array.isArray(n))return n.filter((c)=>c!=null).map(sf);if(typeof n==="object"){const c={};for(let t of Object.keys(n)){if(n[t]==null)continue;c[t]=sf(n[t])}return c}return n};var F0=(n)=>{let c=n.httpHandler;return{setHttpHandler(t){c=t},httpHandler(){return c},updateHttpClientConfig(t,f){c.updateHttpClientConfig(t,f)},httpHandlerConfigs(){return c.httpHandlerConfigs()}}},C0=(n)=>{return{httpHandler:n.httpHandler()}};var Fr=Q(p(),1);var Cr=function(n){return Object.keys(n).reduce((c,t)=>{const f=n[t];return{...c,[t]:Array.isArray(f)?[...f]:f}},{})};class Jn{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 c=new Jn({...n,headers:{...n.headers}});if(c.query)c.query=Cr(c.query);return c}static isInstance(n){if(!n)return!1;const c=n;return"method"in c&&"protocol"in c&&"hostname"in c&&"path"in c&&typeof c.query==="object"&&typeof c.headers==="object"}clone(){return Jn.clone(this)}}class Tn{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 c=n;return typeof c.statusCode==="number"&&typeof c.headers==="object"}}var Ff=Q(j(),1);import{Agent as df,request as yr} from"http";import{Agent as Ef,request as or} from"https";var uf=["ECONNRESET","EPIPE","ETIMEDOUT"];var An=(n)=>{const c={};for(let t of Object.keys(n)){const f=n[t];c[t]=Array.isArray(f)?f.join(","):f}return c};var wf=(n,c,t=0)=>{if(!t)return-1;const f=(h)=>{const i=setTimeout(()=>{n.destroy(),c(Object.assign(new Error(`Socket timed out without establishing a connection within ${t} ms`),{name:"TimeoutError"}))},t-h),r=(s)=>{if(s?.connecting)s.on("connect",()=>{clearTimeout(i)});else clearTimeout(i)};if(n.socket)r(n.socket);else n.on("socket",r)};if(t<2000)return f(0),0;return setTimeout(f.bind(null,1000),1000)};var Tf=(n,{keepAlive:c,keepAliveMsecs:t},f=3000)=>{if(c!==!0)return-1;const h=()=>{if(n.socket)n.socket.setKeepAlive(c,t||0);else n.on("socket",(i)=>{i.setKeepAlive(c,t||0)})};if(f===0)return h(),0;return setTimeout(h,f)};var $f=(n,c,t=0)=>{const f=(h)=>{n.setTimeout(t-h,()=>{n.destroy(),c(Object.assign(new Error(`Connection timed out after ${t} ms`),{name:"TimeoutError"}))})};if(0<t&&t<6000)return f(0),0;return setTimeout(f.bind(null,t===0?0:3000),3000)};import{Readable as Ur} from"stream";async function Wn(n,c,t=xf){const f=c.headers??{},h=f.Expect||f.expect;let i=-1,r=!1;if(h==="100-continue")await Promise.race([new Promise((s)=>{i=Number(setTimeout(s,Math.max(xf,t)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(i),s()}),n.on("error",()=>{r=!0,clearTimeout(i),s()})})]);if(!r)Ir(n,c.body)}var Ir=function(n,c){if(c instanceof Ur){c.pipe(n);return}if(c){if(Buffer.isBuffer(c)||typeof c==="string"){n.end(c);return}const t=c;if(typeof t==="object"&&t.buffer&&typeof t.byteOffset==="number"&&typeof t.byteLength==="number"){n.end(Buffer.from(t.buffer,t.byteOffset,t.byteLength));return}n.end(Buffer.from(c));return}n.end()},xf=1000;class bn{static create(n){if(typeof n?.handle==="function")return n;return new bn(n)}static checkSocketUsage(n,c,t=console){const{sockets:f,requests:h,maxSockets:i}=n;if(typeof i!=="number"||i===Infinity)return c;const r=15000;if(Date.now()-r<c)return c;if(f&&h)for(let s in f){const u=f[s]?.length??0,x=h[s]?.length??0;if(u>=i&&x>=2*i)return t?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${x} additional requests are enqueued.
4
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
5
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return c}constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((c,t)=>{if(typeof n==="function")n().then((f)=>{c(this.resolveDefaultConfig(f))}).catch(t);else c(this.resolveDefaultConfig(n))})}resolveDefaultConfig(n){const{requestTimeout:c,connectionTimeout:t,socketTimeout:f,httpAgent:h,httpsAgent:i}=n||{};return{connectionTimeout:t,requestTimeout:c??f,httpAgent:(()=>{if(h instanceof df||typeof h?.destroy==="function")return h;return new df({keepAlive:!0,maxSockets:50,...h})})(),httpsAgent:(()=>{if(i instanceof Ef||typeof i?.destroy==="function")return i;return new Ef({keepAlive:!0,maxSockets:50,...i})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(n,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;return new Promise((t,f)=>{let h=void 0;const i=[],r=async($)=>{await h,i.forEach(clearTimeout),t($)},s=async($)=>{await h,i.forEach(clearTimeout),f($)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(c?.aborted){const $=new Error("Request aborted");$.name="AbortError",s($);return}const u=n.protocol==="https:",x=u?this.config.httpsAgent:this.config.httpAgent;i.push(setTimeout(()=>{this.socketWarningTimestamp=bn.checkSocketUsage(x,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const y=Ff.buildQueryString(n.query||{});let w=void 0;if(n.username!=null||n.password!=null){const $=n.username??"",E=n.password??"";w=`${$}:${E}`}let d=n.path;if(y)d+=`?${y}`;if(n.fragment)d+=`#${n.fragment}`;let T=n.hostname??"";if(T[0]==="["&&T.endsWith("]"))T=n.hostname.slice(1,-1);else T=n.hostname;const U={headers:n.headers,host:T,method:n.method,path:d,port:n.port,agent:x,auth:w},F=(u?or:yr)(U,($)=>{const E=new Tn({statusCode:$.statusCode||-1,reason:$.statusMessage,headers:An($.headers),body:$});r({response:E})});if(F.on("error",($)=>{if(uf.includes($.code))s(Object.assign($,{name:"TimeoutError"}));else s($)}),c){const $=()=>{F.destroy();const E=new Error("Request aborted");E.name="AbortError",s(E)};if(typeof c.addEventListener==="function"){const E=c;E.addEventListener("abort",$,{once:!0}),F.once("close",()=>E.removeEventListener("abort",$))}else c.onabort=$}i.push(wf(F,s,this.config.connectionTimeout)),i.push($f(F,s,this.config.requestTimeout));const C=U.agent;if(typeof C==="object"&&"keepAlive"in C)i.push(Tf(F,{keepAlive:C.keepAlive,keepAliveMsecs:C.keepAliveMsecs}));h=Wn(F,n,this.config.requestTimeout).catch(($)=>{return i.forEach(clearTimeout),f($)})})}updateHttpClientConfig(n,c){this.config=void 0,this.configProvider=this.configProvider.then((t)=>{return{...t,[n]:c}})}httpHandlerConfigs(){return this.config??{}}}var Lr=Q(j(),1);import{Writable as Dr} from"stream";class Bn extends Dr{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,c,t){this.bufferedBytes.push(n),t()}}async function gr(n){const c=[],t=n.getReader();let f=!1,h=0;while(!f){const{done:s,value:u}=await t.read();if(u)c.push(u),h+=u.length;f=s}const i=new Uint8Array(h);let r=0;for(let s of c)i.set(s,r),r+=s.length;return i}var Tu=(n)=>{if(Nr(n))return gr(n);return new Promise((c,t)=>{const f=new Bn;n.pipe(f),n.on("error",(h)=>{f.end(),t(h)}),f.on("error",t),f.on("finish",function(){const h=new Uint8Array(Buffer.concat(this.bufferedBytes));c(h)})})},Nr=(n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream;export{F0 as xa,C0 as ya,Jn as za,Tn as Aa,mn as Ba,R as Ca,m as Da,gf as Ea,xn as Fa,Nf as Ga,nn as Ha,Un as Ia,Zc as Ja,dt as Ka,lt as La,ts as Ma,kn as Na,Zr as Oa,Kr as Pa,hs as Qa,Vn as Ra,Ot as Sa,is as Ta,rs as Ua,ss as Va,us as Wa,ws as Xa,ds as Ya,Es as Za,Fs as _a,Cs as $a,pn as ab,vn as bb,ys as cb,Ls as db,Ns as eb,Zs as fb,Gs as gb,Tr as hb,$r as ib,Bs as jb,Hs as kb,sf as lb,bn as mb,Tu as nb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as _} from"./chunk-24a86f8f5ddc0cbd.js";import{rb as S} from"./chunk-880cfc21ce7cc2c6.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};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as l} from"./chunk-24a86f8f5ddc0cbd.js";import{rb as m} from"./chunk-880cfc21ce7cc2c6.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-63884944ac5ce0f0.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var p="AWS_WEB_IDENTITY_TOKEN_FILE",f="AWS_ROLE_ARN",T="AWS_ROLE_SESSION_NAME",I=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[p],r=e?.roleArn??process.env[f],n=e?.roleSessionName??process.env[T];if(!o||!r)throw new E.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:S(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,I as fromTokenFile};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-2c5ecf8dc0a97aba.js";import{B as M} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-28694e5e949df0ff.js";import{$ as Al,O as Il,P as Sl,Q as E0,R as k0,S as K0,T as F0,W as Yh,X as U0,Y as Nl,Z as Wl,_ as Tl,aa as y0,ba as fl,ca as Cl,da as Ol,ea as gl,fa as Q0,ga as X0,ia as F,ja as B,ka as Y0,la as xl,ma as il,na as Z0,oa as cl,pa as $0,qa as Gh,ra as nl,sa as ol,ta as ul,ua as tl,va as m0,wa as J0} from"./chunk-fe8cfc6e6c3ce826.js";import{Da as Fw,Ea as Rl,Ga as B0,Ha as Bw,Na as K,Oa as mh,Pa as u0,Ta as A0,Va as H,Xa as u,_a as L0,ab as V0,bb as A,cb as R0,db as _l,eb as bl,fb as S0,gb as H0,hb as nh,mb as el,nb as pl,xa as d0,ya as I0,za as T0} from"./chunk-156c827bf8d5029c.js";import"./chunk-6a2141dd4169ce0e.js";import{pb as Uw,qb as f} from"./chunk-9d5c096c43928b37.js";import"./chunk-880cfc21ce7cc2c6.js";import{sb as Zh} from"./chunk-9dc5c9b7a885d0bc.js";import"./chunk-b13ef9b23e30af91.js";var C=M(Yh(),1);var Hl=M(Gh(),1);var Jw=function(h){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:h.region},propertiesExtractor:(w,l)=>({signingProperties:{config:w,context:l}})}},dl=function(h){return{schemeId:"smithy.api#noAuth"}},ml=async(h,w,l)=>{return{operation:Il(w).operation,region:await Sl(h.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Jl=(h)=>{const w=[];switch(h.operation){case"AssumeRoleWithSAML":{w.push(dl(h));break}case"AssumeRoleWithWebIdentity":{w.push(dl(h));break}default:w.push(Jw(h))}return w},Dw=(h)=>({...h,stsClientCtor:L}),Dl=(h)=>{const w=Dw(h);return{...Hl.resolveAwsSdkSigV4Config(w)}};var El=(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 kl={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn test:unit","test:unit":"jest"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-node":"^3.0.6","@smithy/invalid-dependency":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}};var Sh=M(Gh(),1);var h0=M(Yh(),1);var jl=M(Gh(),1),al=M(Yh(),1);var sl=M(Uw(),1),dh=M(Bw(),1),Ih=M(Fw(),1);var Kl={["required"]:!1,["type"]:"String"},Xh={["required"]:!0,default:!1,["type"]:"Boolean"},$l={["ref"]:"Endpoint"},Fl={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},J={["ref"]:"Region"},Bl={["fn"]:"aws.partition",["argv"]:[J],assign:"PartitionResult"},Vl={["ref"]:"UseFIPS"},Pl={["ref"]:"UseDualStack"},E={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},X={},Ul={conditions:[{["fn"]:"stringEquals",["argv"]:[J,"aws-global"]}],["endpoint"]:E,["type"]:"endpoint"},vl={["fn"]:"booleanEquals",["argv"]:[Vl,!0]},ql={["fn"]:"booleanEquals",["argv"]:[Pl,!0]},yl={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},zl={["ref"]:"PartitionResult"},Ql={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[zl,"supportsDualStack"]}]},Xl=[{["fn"]:"isSet",["argv"]:[$l]}],Yl=[vl],Zl=[ql],kw={version:"1.0",parameters:{Region:Kl,UseDualStack:Xh,UseFIPS:Xh,Endpoint:Kl,UseGlobalEndpoint:Xh},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:Xl},Fl,Bl,{["fn"]:"booleanEquals",["argv"]:[Vl,!1]},{["fn"]:"booleanEquals",["argv"]:[Pl,!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"},Ul,{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:Xl,rules:[{conditions:Yl,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:Zl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:$l,properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[Fl],rules:[{conditions:[Bl],rules:[{conditions:[vl,ql],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,yl]},Ql],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:Yl,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[yl,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[zl,"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:Zl,rules:[{conditions:[Ql],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"},Ul,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},Ml=kw;var Kw=new Nl({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Ll=(h,w={})=>{return Kw.get(h,()=>Tl(Ml,{endpointParams:h,logger:w.logger}))};Wl.aws=Al;var rl=(h)=>{return{apiVersion:"2011-06-15",base64Decoder:h?.base64Decoder??dh.fromBase64,base64Encoder:h?.base64Encoder??dh.toBase64,disableHostPrefix:h?.disableHostPrefix??!1,endpointProvider:h?.endpointProvider??Ll,extensions:h?.extensions??[],httpAuthSchemeProvider:h?.httpAuthSchemeProvider??Jl,httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(w)=>w.getIdentityProvider("aws.auth#sigv4"),signer:new jl.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(w)=>w.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new al.NoAuthSigner}],logger:h?.logger??new Rl,serviceId:h?.serviceId??"STS",urlParser:h?.urlParser??sl.parseUrl,utf8Decoder:h?.utf8Decoder??Ih.fromUtf8,utf8Encoder:h?.utf8Encoder??Ih.toUtf8}};var l0=(h)=>{bl(process.version);const w=tl(h),l=()=>w().then(_l),G=rl(h);return Sh.emitWarningIfUnsupportedVersion(process.version),{...G,...h,runtime:"node",defaultsMode:w,bodyLengthChecker:h?.bodyLengthChecker??ul,credentialDefaultProvider:h?.credentialDefaultProvider??Zh,defaultUserAgentProvider:h?.defaultUserAgentProvider??nl({serviceId:G.serviceId,clientVersion:kl.version}),httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(d)=>d.getIdentityProvider("aws.auth#sigv4")||(async(S)=>await Zh(S?.__config||{})()),signer:new Sh.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(d)=>d.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new h0.NoAuthSigner}],maxAttempts:h?.maxAttempts??f(il),region:h?.region??f(Ol,gl),requestHandler:el.create(h?.requestHandler??l),retryMode:h?.retryMode??f({...cl,default:async()=>(await l()).retryMode||xl}),sha256:h?.sha256??ol.bind(null,"sha256"),streamCollector:h?.streamCollector??pl,useDualstackEndpoint:h?.useDualstackEndpoint??f(fl),useFipsEndpoint:h?.useFipsEndpoint??f(Cl)}};var w0=(h)=>{const w=h.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:G}=h;return{setHttpAuthScheme(d){const S=w.findIndex((I)=>I.schemeId===d.schemeId);if(S===-1)w.push(d);else w.splice(S,1,d)},httpAuthSchemes(){return w},setHttpAuthSchemeProvider(d){l=d},httpAuthSchemeProvider(){return l},setCredentials(d){G=d},credentials(){return G}}},G0=(h)=>{return{httpAuthSchemes:h.httpAuthSchemes(),httpAuthSchemeProvider:h.httpAuthSchemeProvider(),credentials:h.credentials()}};var Hh=(h)=>h,D0=(h,w)=>{const l={...Hh(m0(h)),...Hh(S0(h)),...Hh(d0(h)),...Hh(w0(h))};return w.forEach((G)=>G.configure(l)),{...h,...J0(l),...H0(l),...I0(l),...G0(l)}};class L extends B0{constructor(...[h]){const w=l0(h||{}),l=El(w),G=U0(l),d=Z0(G),S=Q0(d),I=E0(S),Q=Y0(I),z=Dl(Q),v=D0(z,h?.extensions||[]);super(v);this.config=v,this.middlewareStack.use(y0(this.config)),this.middlewareStack.use($0(this.config)),this.middlewareStack.use(X0(this.config)),this.middlewareStack.use(k0(this.config)),this.middlewareStack.use(K0(this.config)),this.middlewareStack.use(F0(this.config)),this.middlewareStack.use(C.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ml,identityProviderConfigProvider:async(n)=>new C.DefaultIdentityProviderConfig({"aws.auth#sigv4":n.credentials})})),this.middlewareStack.use(C.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class Y extends V0{constructor(h){super(h);Object.setPrototypeOf(this,Y.prototype)}}class Jh extends Y{constructor(h){super({name:"ExpiredTokenException",$fault:"client",...h});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Jh.prototype)}}class Dh extends Y{constructor(h){super({name:"MalformedPolicyDocumentException",$fault:"client",...h});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,Dh.prototype)}}class Eh extends Y{constructor(h){super({name:"PackedPolicyTooLargeException",$fault:"client",...h});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Eh.prototype)}}class kh extends Y{constructor(h){super({name:"RegionDisabledException",$fault:"client",...h});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,kh.prototype)}}class Kh extends Y{constructor(h){super({name:"IDPRejectedClaimException",$fault:"client",...h});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Kh.prototype)}}class Fh extends Y{constructor(h){super({name:"InvalidIdentityTokenException",$fault:"client",...h});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,Fh.prototype)}}class Bh extends Y{constructor(h){super({name:"IDPCommunicationErrorException",$fault:"client",...h});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,Bh.prototype)}}class Uh extends Y{constructor(h){super({name:"InvalidAuthorizationMessageException",$fault:"client",...h});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,Uh.prototype)}}var o=(h)=>({...h,...h.SecretAccessKey&&{SecretAccessKey:mh}}),P0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),v0=(h)=>({...h,...h.SAMLAssertion&&{SAMLAssertion:mh}}),q0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),z0=(h)=>({...h,...h.WebIdentityToken&&{WebIdentityToken:mh}}),M0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),N0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),W0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}});var q=M(Gh(),1);var j0=async(h,w)=>{const l=a;let G;return G=b({...vw(h,w),[r]:wG,[_]:s}),j(w,l,"/",void 0,G)},a0=async(h,w)=>{const l=a;let G;return G=b({...qw(h,w),[r]:GG,[_]:s}),j(w,l,"/",void 0,G)},s0=async(h,w)=>{const l=a;let G;return G=b({...zw(h,w),[r]:dG,[_]:s}),j(w,l,"/",void 0,G)},r0=async(h,w)=>{const l=a;let G;return G=b({...Mw(h,w),[r]:IG,[_]:s}),j(w,l,"/",void 0,G)},_0=async(h,w)=>{const l=a;let G;return G=b({...Nw(h,w),[r]:SG,[_]:s}),j(w,l,"/",void 0,G)},b0=async(h,w)=>{const l=a;let G;return G=b({...Ww(h,w),[r]:HG,[_]:s}),j(w,l,"/",void 0,G)},f0=async(h,w)=>{const l=a;let G;return G=b({...Tw(h,w),[r]:mG,[_]:s}),j(w,l,"/",void 0,G)},C0=async(h,w)=>{const l=a;let G;return G=b({...Aw(h,w),[r]:JG,[_]:s}),j(w,l,"/",void 0,G)},O0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=rw(l.AssumeRoleResult,w),{$metadata:k(h),...G}},g0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=_w(l.AssumeRoleWithSAMLResult,w),{$metadata:k(h),...G}},x0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=bw(l.AssumeRoleWithWebIdentityResult,w),{$metadata:k(h),...G}},i0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=fw(l.DecodeAuthorizationMessageResult,w),{$metadata:k(h),...G}},c0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=gw(l.GetAccessKeyInfoResult,w),{$metadata:k(h),...G}},e0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=xw(l.GetCallerIdentityResult,w),{$metadata:k(h),...G}},p0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=iw(l.GetFederationTokenResult,w),{$metadata:k(h),...G}},n0=async(h,w)=>{if(h.statusCode>=300)return R(h,w);const l=await q.parseXmlBody(h.body,w);let G={};return G=cw(l.GetSessionTokenResult,w),{$metadata:k(h),...G}},R=async(h,w)=>{const l={...h,body:await q.parseXmlErrorBody(h.body,w)},G=DG(h,l.body);switch(G){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await yw(l,w);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await $w(l,w);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Vw(l,w);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await Pw(l,w);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Xw(l,w);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await Zw(l,w);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Qw(l,w);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await Yw(l,w);default:const d=l.body;return lG({output:h,parsedBody:d.Error,errorCode:G})}},yw=async(h,w)=>{const l=h.body,G=Cw(l.Error,w),d=new Jh({$metadata:k(h),...G});return A(d,l)},Qw=async(h,w)=>{const l=h.body,G=ew(l.Error,w),d=new Bh({$metadata:k(h),...G});return A(d,l)},Xw=async(h,w)=>{const l=h.body,G=pw(l.Error,w),d=new Kh({$metadata:k(h),...G});return A(d,l)},Yw=async(h,w)=>{const l=h.body,G=nw(l.Error,w),d=new Uh({$metadata:k(h),...G});return A(d,l)},Zw=async(h,w)=>{const l=h.body,G=ow(l.Error,w),d=new Fh({$metadata:k(h),...G});return A(d,l)},$w=async(h,w)=>{const l=h.body,G=uw(l.Error,w),d=new Dh({$metadata:k(h),...G});return A(d,l)},Vw=async(h,w)=>{const l=h.body,G=tw(l.Error,w),d=new Eh({$metadata:k(h),...G});return A(d,l)},Pw=async(h,w)=>{const l=h.body,G=hG(l.Error,w),d=new kh({$metadata:k(h),...G});return A(d,l)},vw=(h,w)=>{const l={};if(h[T]!=null)l[T]=h[T];if(h[i]!=null)l[i]=h[i];if(h[$]!=null){const G=yh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const G=o0(h[e],w);if(h[e]?.length===0)l.Tags=[];Object.entries(G).forEach(([d,S])=>{const I=`Tags.${d}`;l[I]=S})}if(h[xh]!=null){const G=sw(h[xh],w);if(h[xh]?.length===0)l.TransitiveTagKeys=[];Object.entries(G).forEach(([d,S])=>{const I=`TransitiveTagKeys.${d}`;l[I]=S})}if(h[qh]!=null)l[qh]=h[qh];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];if(h[P]!=null)l[P]=h[P];if(h[ah]!=null){const G=jw(h[ah],w);if(h[ah]?.length===0)l.ProvidedContexts=[];Object.entries(G).forEach(([d,S])=>{const I=`ProvidedContexts.${d}`;l[I]=S})}return l},qw=(h,w)=>{const l={};if(h[T]!=null)l[T]=h[T];if(h[Rh]!=null)l[Rh]=h[Rh];if(h[fh]!=null)l[fh]=h[fh];if(h[$]!=null){const G=yh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},zw=(h,w)=>{const l={};if(h[T]!=null)l[T]=h[T];if(h[i]!=null)l[i]=h[i];if(h[eh]!=null)l[eh]=h[eh];if(h[sh]!=null)l[sh]=h[sh];if(h[$]!=null){const G=yh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},Mw=(h,w)=>{const l={};if(h[zh]!=null)l[zh]=h[zh];return l},Nw=(h,w)=>{const l={};if(h[O]!=null)l[O]=h[O];return l},Ww=(h,w)=>{return{}},Tw=(h,w)=>{const l={};if(h[Ah]!=null)l[Ah]=h[Ah];if(h[Z]!=null)l[Z]=h[Z];if(h[$]!=null){const G=yh(h[$],w);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(G).forEach(([d,S])=>{const I=`PolicyArns.${d}`;l[I]=S})}if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const G=o0(h[e],w);if(h[e]?.length===0)l.Tags=[];Object.entries(G).forEach(([d,S])=>{const I=`Tags.${d}`;l[I]=S})}return l},Aw=(h,w)=>{const l={};if(h[y]!=null)l[y]=h[y];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];return l},yh=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;const S=Lw(d,w);Object.entries(S).forEach(([I,Q])=>{l[`member.${G}.${I}`]=Q}),G++}return l},Lw=(h,w)=>{const l={};if(h[ph]!=null)l[ph]=h[ph];return l},Rw=(h,w)=>{const l={};if(h[jh]!=null)l[jh]=h[jh];if(h[Vh]!=null)l[Vh]=h[Vh];return l},jw=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;const S=Rw(d,w);Object.entries(S).forEach(([I,Q])=>{l[`member.${G}.${I}`]=Q}),G++}return l},aw=(h,w)=>{const l={};if(h[Th]!=null)l[Th]=h[Th];if(h[ch]!=null)l[ch]=h[ch];return l},sw=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;l[`member.${G}`]=d,G++}return l},o0=(h,w)=>{const l={};let G=1;for(let d of h){if(d===null)continue;const S=aw(d,w);Object.entries(S).forEach(([I,Q])=>{l[`member.${G}.${I}`]=Q}),G++}return l},oh=(h,w)=>{const l={};if(h[$h]!=null)l[$h]=H(h[$h]);if(h[W]!=null)l[W]=H(h[W]);return l},rw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[N]!=null)l[N]=oh(h[N],w);if(h[V]!=null)l[V]=u(h[V]);if(h[P]!=null)l[P]=H(h[P]);return l},_w=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[N]!=null)l[N]=oh(h[N],w);if(h[V]!=null)l[V]=u(h[V]);if(h[_h]!=null)l[_h]=H(h[_h]);if(h[Oh]!=null)l[Oh]=H(h[Oh]);if(h[Wh]!=null)l[Wh]=H(h[Wh]);if(h[x]!=null)l[x]=H(h[x]);if(h[Lh]!=null)l[Lh]=H(h[Lh]);if(h[P]!=null)l[P]=H(h[P]);return l},bw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[Ch]!=null)l[Ch]=H(h[Ch]);if(h[N]!=null)l[N]=oh(h[N],w);if(h[V]!=null)l[V]=u(h[V]);if(h[rh]!=null)l[rh]=H(h[rh]);if(h[x]!=null)l[x]=H(h[x]);if(h[P]!=null)l[P]=H(h[P]);return l},t=(h,w)=>{const l={};if(h[O]!=null)l[O]=H(h[O]);if(h[bh]!=null)l[bh]=H(h[bh]);if(h[gh]!=null)l[gh]=H(h[gh]);if(h[vh]!=null)l[vh]=A0(L0(h[vh]));return l},fw=(h,w)=>{const l={};if(h[Ph]!=null)l[Ph]=H(h[Ph]);return l},Cw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},Ow=(h,w)=>{const l={};if(h[Nh]!=null)l[Nh]=H(h[Nh]);if(h[W]!=null)l[W]=H(h[W]);return l},gw=(h,w)=>{const l={};if(h[g]!=null)l[g]=H(h[g]);return l},xw=(h,w)=>{const l={};if(h[ih]!=null)l[ih]=H(h[ih]);if(h[g]!=null)l[g]=H(h[g]);if(h[W]!=null)l[W]=H(h[W]);return l},iw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);if(h[Mh]!=null)l[Mh]=Ow(h[Mh],w);if(h[V]!=null)l[V]=u(h[V]);return l},cw=(h,w)=>{const l={};if(h[U]!=null)l[U]=t(h[U],w);return l},ew=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},pw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},nw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},ow=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},uw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},tw=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},hG=(h,w)=>{const l={};if(h[m]!=null)l[m]=H(h[m]);return l},k=(h)=>({httpStatusCode:h.statusCode,requestId:h.headers["x-amzn-requestid"]??h.headers["x-amzn-request-id"]??h.headers["x-amz-request-id"],extendedRequestId:h.headers["x-amz-id-2"],cfId:h.headers["x-amz-cf-id"]});var lG=R0(Y),j=async(h,w,l,G,d)=>{const{hostname:S,protocol:I="https",port:Q,path:z}=await h.endpoint(),v={protocol:I,hostname:S,port:Q,method:"POST",path:z.endsWith("/")?z.slice(0,-1)+l:z+l,headers:w};if(G!==void 0)v.hostname=G;if(d!==void 0)v.body=d;return new T0(v)},a={"content-type":"application/x-www-form-urlencoded"},s="2011-06-15",r="Action",O="AccessKeyId",wG="AssumeRole",$h="AssumedRoleId",N="AssumedRoleUser",GG="AssumeRoleWithSAML",dG="AssumeRoleWithWebIdentity",g="Account",W="Arn",x="Audience",U="Credentials",Vh="ContextAssertion",IG="DecodeAuthorizationMessage",Ph="DecodedMessage",y="DurationSeconds",vh="Expiration",qh="ExternalId",zh="EncodedMessage",Mh="FederatedUser",Nh="FederatedUserId",SG="GetAccessKeyInfo",HG="GetCallerIdentity",mG="GetFederationToken",JG="GetSessionToken",Wh="Issuer",Th="Key",Ah="Name",Lh="NameQualifier",Z="Policy",$="PolicyArns",Rh="PrincipalArn",jh="ProviderArn",ah="ProvidedContexts",sh="ProviderId",V="PackedPolicySize",rh="Provider",T="RoleArn",i="RoleSessionName",_h="Subject",bh="SecretAccessKey",fh="SAMLAssertion",Ch="SubjectFromWebIdentityToken",P="SourceIdentity",c="SerialNumber",Oh="SubjectType",gh="SessionToken",e="Tags",p="TokenCode",xh="TransitiveTagKeys",ih="UserId",_="Version",ch="Value",eh="WebIdentityToken",ph="arn",m="message",b=(h)=>Object.entries(h).map(([w,l])=>nh(w)+"="+nh(l)).join("&"),DG=(h,w)=>{if(w.Error?.Code!==void 0)return w.Error.Code;if(h.statusCode==404)return"NotFound"};class hh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,P0).ser(j0).de(O0).build(){}class uh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(v0,q0).ser(a0).de(g0).build(){}class lh extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(z0,M0).ser(s0).de(x0).build(){}class th extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(r0).de(i0).build(){}class hl extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(_0).de(c0).build(){}class ll extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(b0).de(e0).build(){}class wl extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,N0).ser(f0).de(p0).build(){}class Gl extends K.classBuilder().ep(D).m(function(h,w,l,G){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,W0).ser(C0).de(n0).build(){}var EG={AssumeRoleCommand:hh,AssumeRoleWithSAMLCommand:uh,AssumeRoleWithWebIdentityCommand:lh,DecodeAuthorizationMessageCommand:th,GetAccessKeyInfoCommand:hl,GetCallerIdentityCommand:ll,GetFederationTokenCommand:wl,GetSessionTokenCommand:Gl};class t0 extends L{}u0(EG,t0);var hw="us-east-1",lw=(h)=>{if(typeof h?.Arn==="string"){const w=h.Arn.split(":");if(w.length>4&&w[4]!=="")return w[4]}return},ww=async(h,w,l)=>{const G=typeof h==="function"?await h():h,d=typeof w==="function"?await w():w;return l?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${G} (provider)`,`${d} (parent client)`,`${hw} (STS default)`),G??d??hw},Gw=(h,w)=>{let l,G;return async(d,S)=>{if(G=d,!l){const{logger:v=h?.parentClientConfig?.logger,region:n,requestHandler:wh=h?.parentClientConfig?.requestHandler,credentialProviderLogger:Qh}=h,Hw=await ww(n,h?.parentClientConfig?.region,Qh),mw=!Iw(wh);l=new w({credentialDefaultProvider:()=>async()=>G,region:Hw,requestHandler:mw?wh:void 0,logger:v})}const{Credentials:I,AssumedRoleUser:Q}=await l.send(new hh(S));if(!I||!I.AccessKeyId||!I.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${S.RoleArn}`);const z=lw(Q);return{accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,sessionToken:I.SessionToken,expiration:I.Expiration,...I.CredentialScope&&{credentialScope:I.CredentialScope},...z&&{accountId:z}}}},dw=(h,w)=>{let l;return async(G)=>{if(!l){const{logger:Q=h?.parentClientConfig?.logger,region:z,requestHandler:v=h?.parentClientConfig?.requestHandler,credentialProviderLogger:n}=h,wh=await ww(z,h?.parentClientConfig?.region,n),Qh=!Iw(v);l=new w({region:wh,requestHandler:Qh?v:void 0,logger:Q})}const{Credentials:d,AssumedRoleUser:S}=await l.send(new lh(G));if(!d||!d.AccessKeyId||!d.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${G.RoleArn}`);const I=lw(S);return{accessKeyId:d.AccessKeyId,secretAccessKey:d.SecretAccessKey,sessionToken:d.SessionToken,expiration:d.Expiration,...d.CredentialScope&&{credentialScope:d.CredentialScope},...I&&{accountId:I}}}};var Iw=(h)=>{return h?.metadata?.handlerProtocol==="h2"};var Sw=(h,w)=>{if(!w)return h;else return class l extends h{constructor(G){super(G);for(let d of w)this.middlewareStack.use(d)}}},kG=(h={},w)=>Gw(h,Sw(L,w)),KG=(h={},w)=>dw(h,Sw(L,w)),jI=(h)=>(w)=>h({roleAssumer:kG(w),roleAssumerWithWebIdentity:KG(w),...w});export{KG as getDefaultRoleAssumerWithWebIdentity,kG as getDefaultRoleAssumer,jI as decorateDefaultCredentialProvider,B0 as __Client,Y as STSServiceException,L as STSClient,t0 as STS,kh as RegionDisabledException,Eh as PackedPolicyTooLargeException,Dh as MalformedPolicyDocumentException,Fh as InvalidIdentityTokenException,Uh as InvalidAuthorizationMessageException,Kh as IDPRejectedClaimException,Bh as IDPCommunicationErrorException,W0 as GetSessionTokenResponseFilterSensitiveLog,Gl as GetSessionTokenCommand,N0 as GetFederationTokenResponseFilterSensitiveLog,wl as GetFederationTokenCommand,ll as GetCallerIdentityCommand,hl as GetAccessKeyInfoCommand,Jh as ExpiredTokenException,th as DecodeAuthorizationMessageCommand,o as CredentialsFilterSensitiveLog,M0 as AssumeRoleWithWebIdentityResponseFilterSensitiveLog,z0 as AssumeRoleWithWebIdentityRequestFilterSensitiveLog,lh as AssumeRoleWithWebIdentityCommand,q0 as AssumeRoleWithSAMLResponseFilterSensitiveLog,v0 as AssumeRoleWithSAMLRequestFilterSensitiveLog,uh as AssumeRoleWithSAMLCommand,P0 as AssumeRoleResponseFilterSensitiveLog,hh as AssumeRoleCommand,K as $Command};
@@ -1,2 +1,2 @@
1
1
  import{C as D} from"./chunk-24a86f8f5ddc0cbd.js";var S=D((y,w)=>{var{defineProperty:G,getOwnPropertyDescriptor:v,getOwnPropertyNames:O}=Object,x=Object.prototype.hasOwnProperty,Q=(b,j)=>G(b,"name",{value:j,configurable:!0}),U=(b,j)=>{for(var z in j)G(b,z,{get:j[z],enumerable:!0})},K=(b,j,z,V)=>{if(j&&typeof j==="object"||typeof j==="function"){for(let B of O(j))if(!x.call(b,B)&&B!==z)G(b,B,{get:()=>j[B],enumerable:!(V=v(j,B))||V.enumerable})}return b},q=(b)=>K(G({},"__esModule",{value:!0}),b),W={};U(W,{AlgorithmId:()=>J,EndpointURLScheme:()=>X,FieldPosition:()=>M,HttpApiKeyAuthLocation:()=>$,HttpAuthLocation:()=>Z,IniSectionType:()=>N,RequestHandlerProtocol:()=>Y,SMITHY_CONTEXT_KEY:()=>R,getDefaultClientConfiguration:()=>T,resolveDefaultRuntimeConfig:()=>k});w.exports=q(W);var Z=((b)=>{return b.HEADER="header",b.QUERY="query",b})(Z||{}),$=((b)=>{return b.HEADER="header",b.QUERY="query",b})($||{}),X=((b)=>{return b.HTTP="http",b.HTTPS="https",b})(X||{}),J=((b)=>{return b.MD5="md5",b.CRC32="crc32",b.CRC32C="crc32c",b.SHA1="sha1",b.SHA256="sha256",b})(J||{}),E=Q((b)=>{const j=[];if(b.sha256!==void 0)j.push({algorithmId:()=>"sha256",checksumConstructor:()=>b.sha256});if(b.md5!=null)j.push({algorithmId:()=>"md5",checksumConstructor:()=>b.md5});return{_checksumAlgorithms:j,addChecksumAlgorithm(z){this._checksumAlgorithms.push(z)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),F=Q((b)=>{const j={};return b.checksumAlgorithms().forEach((z)=>{j[z.algorithmId()]=z.checksumConstructor()}),j},"resolveChecksumRuntimeConfig"),T=Q((b)=>{return{...E(b)}},"getDefaultClientConfiguration"),k=Q((b)=>{return{...F(b)}},"resolveDefaultRuntimeConfig"),M=((b)=>{return b[b.HEADER=0]="HEADER",b[b.TRAILER=1]="TRAILER",b})(M||{}),R="__smithy_context",N=((b)=>{return b.PROFILE="profile",b.SSO_SESSION="sso-session",b.SERVICES="services",b})(N||{}),Y=((b)=>{return b.HTTP_0_9="http/0.9",b.HTTP_1_0="http/1.0",b.TDS_8_0="tds/8.0",b})(Y||{})});
2
- export{S as Bb};
2
+ export{S as ob};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as h} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-6a2141dd4169ce0e.js";import{rb as _} from"./chunk-880cfc21ce7cc2c6.js";import{Ab as P,ub as N,vb as W,wb as I,zb as v} from"./chunk-b13ef9b23e30af91.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-83938f41a5342f87.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-83938f41a5342f87.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-e4a19367b5596f21.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"./chunk-2c5ecf8dc0a97aba.js";import{B as w} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-28694e5e949df0ff.js";import{$ as je,O as se,P as ie,Q as hr,R as nr,S as or,T as dr,W as _,X as yr,Y as Pe,Z as Te,_ as be,aa as tr,ba as Ve,ca as We,da as fe,ea as Ae,fa as ar,ga as mr,ia as S,ja as $,ka as wr,la as Ke,ma as Me,na as kr,oa as Be,pa as vr,qa as U,ra as Xe,sa as Ye,ta as Ze,ua as He,va as sr,wa as ir} from"./chunk-fe8cfc6e6c3ce826.js";import{Da as Qr,Ea as De,Ga as cr,Ha as Xr,Na as E,Oa as t,Pa as Jr,Ra as C,Sa as b,Ta as j,Ua as F,Va as h,ab as Er,bb as a,cb as br,db as Ge,eb as Je,fb as er,gb as rr,ib as d,jb as o,lb as I,mb as Le,nb as Qe,xa as Oe,ya as ue} from"./chunk-156c827bf8d5029c.js";import"./chunk-6a2141dd4169ce0e.js";import{pb as Yr,qb as R} from"./chunk-9d5c096c43928b37.js";import"./chunk-880cfc21ce7cc2c6.js";import{sb as pe} from"./chunk-9dc5c9b7a885d0bc.js";import"./chunk-b13ef9b23e30af91.js";var P=w(_(),1);var le=w(U(),1);var Kr=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}},N=function(e){return{schemeId:"smithy.api#noAuth"}},he=async(e,s,r)=>{return{operation:se(s).operation,region:await ie(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ne=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(N(e));break}case"RegisterClient":{s.push(N(e));break}case"StartDeviceAuthorization":{s.push(N(e));break}default:s.push(Kr(e))}return s},oe=(e)=>{return{...le.resolveAwsSdkSigV4Config(e)}};var de=(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 ce={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-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.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-node":"^3.0.6","@smithy/invalid-dependency":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.654.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(U(),1);var Ue=w(U(),1),qe=w(_(),1);var xe=w(Yr(),1),q=w(Xr(),1),x=w(Qr(),1);var ye={["required"]:!1,type:"String"},te={["required"]:!0,default:!1,type:"Boolean"},ae={["ref"]:"Endpoint"},Se={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},$e={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},me={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Ie={["ref"]:"PartitionResult"},we={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Ie,"supportsDualStack"]}]},ke=[Se],ve=[$e],Ee=[{["ref"]:"Region"}],Br={version:"1.0",parameters:{Region:ye,UseDualStack:te,UseFIPS:te,Endpoint:ye},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ae]}],rules:[{conditions:ke,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:ve,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ae,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:Ee}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Ee,assign:"PartitionResult"}],rules:[{conditions:[Se,$e],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,me]},we],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:ke,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[me,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ie,"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:ve,rules:[{conditions:[we],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"}]},Re=Br;var Lr=new Pe({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Fe=(e,s={})=>{return Lr.get(e,()=>be(Re,{endpointParams:e,logger:s.logger}))};Te.aws=je;var ze=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??q.fromBase64,base64Encoder:e?.base64Encoder??q.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Fe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ne,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ue.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new qe.NoAuthSigner}],logger:e?.logger??new De,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??xe.parseUrl,utf8Decoder:e?.utf8Decoder??x.fromUtf8,utf8Encoder:e?.utf8Encoder??x.toUtf8}};var _e=(e)=>{Je(process.version);const s=He(e),r=()=>s().then(Ge),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:ce.version}),maxAttempts:e?.maxAttempts??R(Me),region:e?.region??R(fe,Ae),requestHandler:Le.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Be,default:async()=>(await r()).retryMode||Ke}),sha256:e?.sha256??Ye.bind(null,"sha256"),streamCollector:e?.streamCollector??Qe,useDualstackEndpoint:e?.useDualstackEndpoint??R(Ve),useFipsEndpoint:e?.useFipsEndpoint??R(We)}};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 z=(e)=>e,lr=(e,s)=>{const r={...z(sr(e)),...z(er(e)),...z(Oe(e)),...z(Ce(e))};return s.forEach((i)=>i.configure(r)),{...e,...ir(r),...rr(r),...ue(r),...ge(r)}};class p extends cr{constructor(...[e]){const s=_e(e||{}),r=de(s),i=yr(r),l=kr(i),n=ar(l),T=hr(n),Wr=wr(T),fr=oe(Wr),re=lr(fr,e?.extensions||[]);super(re);this.config=re,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:he,identityProviderConfigProvider:async(Ar)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Ar.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class c extends Er{constructor(e){super(e);Object.setPrototypeOf(this,c.prototype)}}class G extends c{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends c{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends c{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends c{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class f extends c{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends c{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends c{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends c{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends c{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends c{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description}}class Q extends c{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends c{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Y extends c{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}class Z extends c{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Z.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(U(),1),D=w(_(),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({[ns]:[,"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()},Ur=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/device_authorization");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],startUrl:[]})),r.m("POST").h(i).b(l),r.build()},qr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return H(e,s);const r=d({$metadata:y(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 H(e,s);const r=d({$metadata:y(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 H(e,s);const r=d({$metadata:y(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:C,clientSecret:h,clientSecretExpiresAt:C,tokenEndpoint:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return H(e,s);const r=d({$metadata:y(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},H=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 Hr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Nr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await _r(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await pr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Cr(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Or(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await es(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ss(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await is(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await ls(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await hs(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await rs(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await gr(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await ur(r,s);default:const l=r.body;return Zr({output:e,parsedBody:l,errorCode:i})}},Zr=br(c),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 G({$metadata:y(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 J({$metadata:y(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 V({$metadata:y(e),...r});return a(n,e.body)},pr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new W({$metadata:y(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:y(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:y(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:y(e),...r});return a(n,e.body)},ur=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new Z({$metadata:y(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:y(e),...r});return a(n,e.body)},rs=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 X({$metadata:y(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 M({$metadata:y(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 B({$metadata:y(e),...r});return a(n,e.body)},ls=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:y(e),...r});return a(n,e.body)},hs=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new Q({$metadata:y(e),...r});return a(n,e.body)},y=(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 ns="aws_iam";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","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Sr,$r).ser(jr).de(qr).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","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Ir,Rr).ser(Fr).de(xr).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","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Pr).ser(Dr).de(zr).build(){}class ee 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(Ur).de(Gr).build(){}var os={CreateTokenCommand:g,CreateTokenWithIAMCommand:O,RegisterClientCommand:u,StartDeviceAuthorizationCommand:ee};class Vr extends p{}Jr(os,Vr);export{cr as __Client,Q as UnsupportedGrantTypeException,L as UnauthorizedClientException,Tr as StartDeviceAuthorizationRequestFilterSensitiveLog,ee as StartDeviceAuthorizationCommand,B as SlowDownException,c as SSOOIDCServiceException,p as SSOOIDCClient,Vr as SSOOIDC,Pr as RegisterClientResponseFilterSensitiveLog,u as RegisterClientCommand,M as InvalidScopeException,X as InvalidRequestRegionException,K as InvalidRequestException,Z as InvalidRedirectUriException,A as InvalidGrantException,Y as InvalidClientMetadataException,f as InvalidClientException,W as InternalServerException,V as ExpiredTokenException,Rr as CreateTokenWithIAMResponseFilterSensitiveLog,Ir as CreateTokenWithIAMRequestFilterSensitiveLog,O as CreateTokenWithIAMCommand,$r as CreateTokenResponseFilterSensitiveLog,Sr as CreateTokenRequestFilterSensitiveLog,g as CreateTokenCommand,J as AuthorizationPendingException,G as AccessDeniedException,E as $Command};
@@ -0,0 +1,2 @@
1
+ import{C as D} from"./chunk-24a86f8f5ddc0cbd.js";var C=D((h,A)=>{var{defineProperty:Q,getOwnPropertyDescriptor:M,getOwnPropertyNames:J}=Object,V=Object.prototype.hasOwnProperty,I=(j,b)=>Q(j,"name",{value:b,configurable:!0}),w=(j,b)=>{for(var F in b)Q(j,F,{get:b[F],enumerable:!0})},O=(j,b,F,B)=>{if(b&&typeof b==="object"||typeof b==="function"){for(let G of J(b))if(!V.call(j,G)&&G!==F)Q(j,G,{get:()=>b[G],enumerable:!(B=M(b,G))||B.enumerable})}return j},q=(j)=>O(Q({},"__esModule",{value:!0}),j),Y={};w(Y,{CredentialsProviderError:()=>L,ProviderError:()=>U,TokenProviderError:()=>S,chain:()=>T,fromStatic:()=>N,memoize:()=>R});A.exports=q(Y);var Z=class j extends Error{constructor(b,F=!0){var B;let G,H=!0;if(typeof F==="boolean")G=void 0,H=F;else if(F!=null&&typeof F==="object")G=F.logger,H=F.tryNextLink??!0;super(b);this.name="ProviderError",this.tryNextLink=H,Object.setPrototypeOf(this,j.prototype),(B=G==null?void 0:G.debug)==null||B.call(G,`@smithy/property-provider ${H?"->":"(!)"} ${b}`)}static from(b,F=!0){return Object.assign(new this(b.message,F),b)}};I(Z,"ProviderError");var U=Z,$=class j extends U{constructor(b,F=!0){super(b,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,j.prototype)}};I($,"CredentialsProviderError");var L=$,z=class j extends U{constructor(b,F=!0){super(b,F);this.name="TokenProviderError",Object.setPrototypeOf(this,j.prototype)}};I(z,"TokenProviderError");var S=z,T=I((...j)=>async()=>{if(j.length===0)throw new U("No providers in chain");let b;for(let F of j)try{return await F()}catch(B){if(b=B,B==null?void 0:B.tryNextLink)continue;throw B}throw b},"chain"),N=I((j)=>()=>Promise.resolve(j),"fromStatic"),R=I((j,b,F)=>{let B,G,H,W=!1;const X=I(async()=>{if(!G)G=j();try{B=await G,H=!0,W=!1}finally{G=void 0}return B},"coalesceProvider");if(b===void 0)return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();return B};return async(K)=>{if(!H||(K==null?void 0:K.forceRefresh))B=await X();if(W)return B;if(F&&!F(B))return W=!0,B;if(b(B))return await X(),B;return B}},"memoize")});
2
+ export{C as rb};
@@ -0,0 +1 @@
1
+ import{B as h,C as G} from"./chunk-24a86f8f5ddc0cbd.js";import{rb as I} from"./chunk-880cfc21ce7cc2c6.js";import{ub as H,yb as K} from"./chunk-b13ef9b23e30af91.js";var t=G((r,j)=>{var T=function(c){const i={};if(c=c.replace(/^\?/,""),c)for(let n of c.split("&")){let[F,f=null]=n.split("=");if(F=decodeURIComponent(F),f)f=decodeURIComponent(f);if(!(F in i))i[F]=f;else if(Array.isArray(i[F]))i[F].push(f);else i[F]=[i[F],f]}return i},o=Object.defineProperty,M=Object.getOwnPropertyDescriptor,Q=Object.getOwnPropertyNames,U=Object.prototype.hasOwnProperty,O=(c,i)=>o(c,"name",{value:i,configurable:!0}),d=(c,i)=>{for(var n in i)o(c,n,{get:i[n],enumerable:!0})},v=(c,i,n,F)=>{if(i&&typeof i==="object"||typeof i==="function"){for(let f of Q(i))if(!U.call(c,f)&&f!==n)o(c,f,{get:()=>i[f],enumerable:!(F=M(i,f))||F.enumerable})}return c},J=(c)=>v(o({},"__esModule",{value:!0}),c),S={};d(S,{parseQueryString:()=>T});j.exports=J(S);O(T,"parseQueryString")});var a=G((y,Z)=>{var{defineProperty:w,getOwnPropertyDescriptor:x,getOwnPropertyNames:P}=Object,s=Object.prototype.hasOwnProperty,l=(c,i)=>w(c,"name",{value:i,configurable:!0}),m=(c,i)=>{for(var n in i)w(c,n,{get:i[n],enumerable:!0})},k=(c,i,n,F)=>{if(i&&typeof i==="object"||typeof i==="function"){for(let f of P(i))if(!s.call(c,f)&&f!==n)w(c,f,{get:()=>i[f],enumerable:!(F=x(i,f))||F.enumerable})}return c},q=(c)=>k(w({},"__esModule",{value:!0}),c),z={};m(z,{parseUrl:()=>X});Z.exports=q(z);var p=t(),X=l((c)=>{if(typeof c==="string")return X(new URL(c));const{hostname:i,pathname:n,port:F,protocol:f,search:E}=c;let N;if(E)N=p.parseQueryString(E);return{hostname:i,port:F?parseInt(F):void 0,protocol:f,path:n,query:N}},"parseUrl")});var R=h(I(),1);var b=h(I(),1);function C(c){try{const i=new Set(Array.from(c.match(/([A-Z_]){3,}/g)??[]));return i.delete("CONFIG"),i.delete("CONFIG_PREFIX_SEPARATOR"),i.delete("ENV"),[...i].join(", ")}catch(i){return c}}var B=(c,i)=>async()=>{try{const n=c(process.env);if(n===void 0)throw new Error;return n}catch(n){throw new b.CredentialsProviderError(n.message||`Not found in ENV: ${C(c.toString())}`,{logger:i})}};var L=h(I(),1);var V=(c,{preferredFile:i="config",...n}={})=>async()=>{const F=H(n),{configFile:f,credentialsFile:E}=await K(n),N=E[F]||{},$=f[F]||{},D=i==="config"?{...N,...$}:{...$,...N};try{const A=c(D,i==="config"?f:E);if(A===void 0)throw new Error;return A}catch(g){throw new L.CredentialsProviderError(g.message||`Not found in config files w/ profile [${F}]: ${C(c.toString())}`,{logger:n.logger})}};var W=h(I(),1),u=(c)=>typeof c==="function",Y=(c)=>u(c)?async()=>await c():W.fromStatic(c);var wi=({environmentVariableSelector:c,configFileSelector:i,default:n},F={})=>R.memoize(R.chain(B(c),V(i,F),Y(n)));export{a as pb,wi as qb};
@@ -0,0 +1,9 @@
1
+ import{u as w,v as z,w as B} from"./chunk-2c5ecf8dc0a97aba.js";import{B as Q} from"./chunk-24a86f8f5ddc0cbd.js";import{rb as X} from"./chunk-880cfc21ce7cc2c6.js";import{tb as $} from"./chunk-b13ef9b23e30af91.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-e1a4203ece554bc3.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-a1ef3b11adc01140.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-6b58f7c76c2a738c.js");return H(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-ad396345e8e74292.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-07ad6201a5864cd0.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-542b3c90f0ff4ded.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 sb};
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import{B as m} from"./chunk-24a86f8f5ddc0cbd.js";import{La as A,Za as w,mb as P,za as g} from"./chunk-156c827bf8d5029c.js";import"./chunk-6a2141dd4169ce0e.js";import{rb as d} from"./chunk-880cfc21ce7cc2c6.js";var i=m(d(),1);import O from"fs/promises";var C=m(d(),1);var E="169.254.170.2",R="169.254.170.23",p="[fd00:ec2::23]",S=(e,c)=>{if(e.protocol==="https:")return;if(e.hostname===E||e.hostname===R||e.hostname===p)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const a=e.hostname.split("."),r=(t)=>{const s=parseInt(t,10);return 0<=s&&s<=255};if(a[0]==="127"&&r(a[1])&&r(a[2])&&r(a[3])&&a.length===4)return}throw new C.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
3
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
4
+ - ECS container host 169.254.170.2
5
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:c})};var o=m(d(),1);var I=m(A(),1);function K(e){return new g({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((c,[a,r])=>{return c[a]=r,c},{}),fragment:e.hash})}async function T(e,c){const r=await I.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){const t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new o.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:c});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:w(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new o.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c}),{Code:t.Code,Message:t.Message})}throw new o.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c})}var x=(e,c,a)=>{return async()=>{for(let r=0;r<c;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,a))}return await e()}};var b="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",_="http://169.254.170.2",v="AWS_CONTAINER_CREDENTIALS_FULL_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",D="AWS_CONTAINER_AUTHORIZATION_TOKEN",M=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let c;const a=e.awsContainerCredentialsRelativeUri??process.env[b],r=e.awsContainerCredentialsFullUri??process.env[v],t=e.awsContainerAuthorizationToken??process.env[D],s=e.awsContainerAuthorizationTokenFile??process.env[B],n=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(a&&r)n("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),n("awsContainerCredentialsFullUri will take precedence.");if(t&&s)n("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),n("awsContainerAuthorizationToken will take precedence.");if(r)c=r;else if(a)c=`${_}${a}`;else throw new i.CredentialsProviderError(`No HTTP credential provider host provided.
6
+ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});const y=new URL(c);S(y,e.logger);const u=new P({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return x(async()=>{const f=K(y);if(t)f.headers.Authorization=t;else if(s)f.headers.Authorization=(await O.readFile(s)).toString();try{const h=await u.handle(f);return T(h.response)}catch(h){throw new i.CredentialsProviderError(String(h),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{M as fromHttp};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-6a2141dd4169ce0e.js";import{rb as D} from"./chunk-880cfc21ce7cc2c6.js";import{Ab as E,ub as K} from"./chunk-b13ef9b23e30af91.js";var Z=B(D(),1);var $=B(D(),1);var C=B(D(),1),A=(y,c,_)=>{const b={EcsContainer:async(x)=>{const{fromHttp:w}=await import("./chunk-a1ef3b11adc01140.js"),{fromContainerMetadata:k}=await import("./chunk-e1a4203ece554bc3.js");return _?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),C.chain(w(x??{}),k(x))},Ec2InstanceMetadata:async(x)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:w}=await import("./chunk-e1a4203ece554bc3.js");return w(x)},Environment:async(x)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:w}=await import("./chunk-2c5ecf8dc0a97aba.js");return w(x)}};if(y in b)return b[y];else throw new C.CredentialsProviderError(`Unsupported credential source in profile ${c}. Got ${y}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:_})};var J=(y,{profile:c="default",logger:_}={})=>{return Boolean(y)&&typeof y==="object"&&typeof y.role_arn==="string"&&["undefined","string"].indexOf(typeof y.role_session_name)>-1&&["undefined","string"].indexOf(typeof y.external_id)>-1&&["undefined","string"].indexOf(typeof y.mfa_serial)>-1&&(H(y,{profile:c,logger:_})||R(y,{profile:c,logger:_}))},H=(y,{profile:c,logger:_})=>{const b=typeof y.source_profile==="string"&&typeof y.credential_source==="undefined";if(b)_?.debug?.(` ${c} isAssumeRoleWithSourceProfile source_profile=${y.source_profile}`);return b},R=(y,{profile:c,logger:_})=>{const b=typeof y.credential_source==="string"&&typeof y.source_profile==="undefined";if(b)_?.debug?.(` ${c} isCredentialSourceProfile credential_source=${y.credential_source}`);return b},L=async(y,c,_,b={})=>{_.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const x=c[y];if(!_.roleAssumer){const{getDefaultRoleAssumer:I}=await import("./chunk-63884944ac5ce0f0.js");_.roleAssumer=I({..._.clientConfig,credentialProviderLogger:_.logger,parentClientConfig:_?.parentClientConfig},_.clientPlugins)}const{source_profile:w}=x;if(w&&w in b)throw new $.CredentialsProviderError("Detected a cycle attempting to resolve credentials for profile"+` ${K(_)}. Profiles visited: `+Object.keys(b).join(", "),{logger:_.logger});_.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${w?`source_profile=[${w}]`:`profile=[${y}]`}`);const k=w?j(w,c,_,{...b,[w]:!0},G(c[w]??{})):(await A(x.credential_source,y,_.logger)(_))();if(G(x))return k;else{const I={RoleArn:x.role_arn,RoleSessionName:x.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:x.external_id,DurationSeconds:parseInt(x.duration_seconds||"3600",10)},{mfa_serial:O}=x;if(O){if(!_.mfaCodeProvider)throw new $.CredentialsProviderError(`Profile ${y} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:_.logger,tryNextLink:!1});I.SerialNumber=O,I.TokenCode=await _.mfaCodeProvider(O)}const F=await k;return _.roleAssumer(F,I)}},G=(y)=>{return!y.role_arn&&!!y.credential_source};var Q=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.credential_process==="string",U=async(y,c)=>import("./chunk-07ad6201a5864cd0.js").then(({fromProcess:_})=>_({...y,profile:c})());var V=async(y,c={})=>{const{fromSSO:_}=await import("./chunk-6b58f7c76c2a738c.js");return _({profile:y,logger:c.logger})()},W=(y)=>y&&(typeof y.sso_start_url==="string"||typeof y.sso_account_id==="string"||typeof y.sso_session==="string"||typeof y.sso_region==="string"||typeof y.sso_role_name==="string");var q=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.aws_access_key_id==="string"&&typeof y.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof y.aws_session_token)>-1&&["undefined","string"].indexOf(typeof y.aws_account_id)>-1,z=(y,c)=>{return c?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"),Promise.resolve({accessKeyId:y.aws_access_key_id,secretAccessKey:y.aws_secret_access_key,sessionToken:y.aws_session_token,...y.aws_credential_scope&&{credentialScope:y.aws_credential_scope},...y.aws_account_id&&{accountId:y.aws_account_id}})};var X=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.web_identity_token_file==="string"&&typeof y.role_arn==="string"&&["undefined","string"].indexOf(typeof y.role_session_name)>-1,Y=async(y,c)=>import("./chunk-542b3c90f0ff4ded.js").then(({fromTokenFile:_})=>_({webIdentityTokenFile:y.web_identity_token_file,roleArn:y.role_arn,roleSessionName:y.role_session_name,roleAssumerWithWebIdentity:c.roleAssumerWithWebIdentity,logger:c.logger,parentClientConfig:c.parentClientConfig})());var j=async(y,c,_,b={},x=!1)=>{const w=c[y];if(Object.keys(b).length>0&&q(w))return z(w,_);if(x||J(w,{profile:y,logger:_.logger}))return L(y,c,_,b);if(q(w))return z(w,_);if(X(w))return Y(w,_);if(Q(w))return U(_,y);if(W(w))return await V(y,_);throw new Z.CredentialsProviderError(`Could not resolve credentials using profile: [${y}] in configuration/credentials file(s).`,{logger:_.logger})};var a=(y={})=>async()=>{y.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const c=await E(y);return j(K(y),c,y)};export{a as fromIni};
@@ -1 +1 @@
1
- import{B as x} from"./chunk-24a86f8f5ddc0cbd.js";import{Bb as S} from"./chunk-201d67e6e22cc14b.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 Lb,B as Mb,H as Nb,$e as Ob,c as Pb,R as Qb,Pe as Rb,He as Sb};
1
+ import{B as x} from"./chunk-24a86f8f5ddc0cbd.js";import{ob as S} from"./chunk-6a2141dd4169ce0e.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 tb,B as ub,H as vb,$e as wb,c as xb,R as yb,Pe as zb,He as Ab};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as J} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-6a2141dd4169ce0e.js";import{pb as cc,qb as z} from"./chunk-9d5c096c43928b37.js";import{rb as _} from"./chunk-880cfc21ce7cc2c6.js";import"./chunk-b13ef9b23e30af91.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,2 @@
1
+ // @bun
2
+ import{B as o} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-28694e5e949df0ff.js";import{$ as se,O as $,P,Q as Ie,R as Ce,S as Le,T as Me,W as U,X as Ae,Y as f,Z as g,_ as ee,aa as Ke,ba as le,ca as pe,da as ye,ea as me,fa as Qe,ga as Xe,ia as ts,ja as rs,ka as Ye,la as he,ma as ue,na as Ze,oa as we,pa as je,qa as x,ra as ve,sa as ke,ta as Re,ua as Ee,va as $e,wa as Pe} from"./chunk-fe8cfc6e6c3ce826.js";import{Da as ps,Ea as re,Ga as We,Ha as ys,Na as ss,Oa as E,Ta as B,Ua as Ge,Va as h,ab as Te,bb as u,cb as Ve,db as ce,eb as ie,fb as Ue,gb as _e,ib as i,jb as y,lb as Ne,mb as be,nb as xe,xa as Be,ya as Fe} from"./chunk-156c827bf8d5029c.js";import"./chunk-6a2141dd4169ce0e.js";import{pb as ms,qb as l} from"./chunk-9d5c096c43928b37.js";import"./chunk-880cfc21ce7cc2c6.js";import"./chunk-b13ef9b23e30af91.js";var p=o(U(),1);var J=o(x(),1);var os=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"}},I=async(e,s,t)=>{return{operation:$(s).operation,region:await P(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},C=(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(os(e))}return s},L=(e)=>{return{...J.resolveAwsSdkSigV4Config(e)}};var M=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},W={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var A={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-node":"^3.0.6","@smithy/invalid-dependency":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var qe=o(x(),1);var ae=o(x(),1),ne=o(U(),1);var de=o(ms(),1),v=o(ys(),1),k=o(ps(),1);var K={["required"]:!1,type:"String"},Q={["required"]:!0,default:!1,type:"Boolean"},X={["ref"]:"Endpoint"},O={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},G={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},Y={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},V={["ref"]:"PartitionResult"},Z={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[V,"supportsDualStack"]}]},j=[O],T=[G],H=[{["ref"]:"Region"}],is={version:"1.0",parameters:{Region:K,UseDualStack:Q,UseFIPS:Q,Endpoint:K},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[X]}],rules:[{conditions:j,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:T,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:X,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:H}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:H,assign:"PartitionResult"}],rules:[{conditions:[O,G],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Y]},Z],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:j,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Y,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"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:T,rules:[{conditions:[Z],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"}]},N=is;var ls=new f({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),te=(e,s={})=>{return ls.get(e,()=>ee(N,{endpointParams:e,logger:s.logger}))};g.aws=se;var oe=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??v.fromBase64,base64Encoder:e?.base64Encoder??v.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??te,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??C,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 re,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??de.parseUrl,utf8Decoder:e?.utf8Decoder??k.fromUtf8,utf8Encoder:e?.utf8Encoder??k.toUtf8}};var Se=(e)=>{ie(process.version);const s=Ee(e),t=()=>s().then(ce),r=oe(e);return qe.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Re,defaultUserAgentProvider:e?.defaultUserAgentProvider??ve({serviceId:r.serviceId,clientVersion:A.version}),maxAttempts:e?.maxAttempts??l(ue),region:e?.region??l(ye,me),requestHandler:be.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...we,default:async()=>(await t()).retryMode||he}),sha256:e?.sha256??ke.bind(null,"sha256"),streamCollector:e?.streamCollector??xe,useDualstackEndpoint:e?.useDualstackEndpoint??l(le),useFipsEndpoint:e?.useFipsEndpoint??l(pe)}};var ze=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((F)=>F.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 R=(e)=>e,Je=(e,s)=>{const t={...R($e(e)),...R(Ue(e)),...R(Be(e)),...R(ze(e))};return s.forEach((r)=>r.configure(t)),{...e,...Pe(t),..._e(t),...Fe(t),...De(t)}};class hs extends We{constructor(...[e]){const s=Se(e||{}),t=M(s),r=Ae(t),a=Ze(r),n=Qe(a),F=Ie(n),as=Ye(F),ns=L(as),_=Je(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(Ce(this.config)),this.middlewareStack.use(Le(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:I,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 S extends c{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}class z extends c{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,z.prototype)}}class D extends c{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,D.prototype)}}var He=(e)=>({...e,...e.accessToken&&{accessToken:E}}),us=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:E},...e.sessionToken&&{sessionToken:E}}),Oe=(e)=>({...e,...e.roleCredentials&&{roleCredentials:us(e.roleCredentials)}});var m=o(x(),1),fe=o(U(),1);var ge=async(e,s)=>{const t=fe.requestBuilder(e,s),r=i({},Es,{[Fs]:e[Ss]});t.bp("/federation/credentials");const a=i({[Bs]:[,B(e[Ds],"roleName")],[zs]:[,B(e[qs],"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 ws(e,s);const t=i({$metadata:w(e)}),r=B(Ge(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:Ne});return Object.assign(t,a),t};var ws=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 xs(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await vs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await ks(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await Rs(t,s);default:const a=t.body;return bs({output:e,parsedBody:a,errorCode:r})}},bs=Ve(c),xs=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)},vs=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)},ks=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)},Rs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new D({$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 Es=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),qs="accountId",Ss="accessToken",zs="account_id";var Ds="roleName",Bs="role_name",Fs="x-amz-sso_bearer_token";class Us extends ss.classBuilder().ep(W).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{hs as SSOClient,Us as GetRoleCredentialsCommand};