gemi 0.4.87 → 0.4.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/app/App.d.ts.map +1 -1
  2. package/dist/app/index.js +1 -1
  3. package/dist/bin/index.js +8 -8
  4. package/dist/chunk-0441dc8e5b215b75.js +2 -0
  5. package/dist/chunk-08bf87c7e29141d3.js +9 -0
  6. package/dist/chunk-23b1faa7791ca31d.js +2 -0
  7. package/dist/chunk-36d595d02662f2fa.js +2 -0
  8. package/dist/chunk-3d4e6fdf131bae97.js +2 -0
  9. package/dist/chunk-6e20f463543eec5f.js +2 -0
  10. package/dist/chunk-75aa5e5e2f565737.js +18 -0
  11. package/dist/{chunk-6b18189b2aabf6b7.js → chunk-79f9130d266efc8b.js} +1 -1
  12. package/dist/{chunk-d0b9873261cd82b7.js → chunk-82b3f93a5aac2b2e.js} +1 -1
  13. package/dist/{chunk-5f01223b8fbe1ed8.js → chunk-8f575468b4e4754d.js} +1 -1
  14. package/dist/chunk-92b7f08b6396b0fc.js +2 -0
  15. package/dist/chunk-a4330a47c3806ff1.js +3 -0
  16. package/dist/{chunk-8f2c54f2cd43402a.js → chunk-b35e7bc78a8a613f.js} +1 -1
  17. package/dist/{chunk-b4cbb4706a35f5d5.js → chunk-bd0308763754bf7b.js} +1 -1
  18. package/dist/chunk-d5d491184ec17042.js +2 -0
  19. package/dist/chunk-dc3eae4932658400.js +2 -0
  20. package/dist/chunk-e5db92db378843ab.js +2 -0
  21. package/dist/kernel/index.js +1 -1
  22. package/dist/services/index.js +10 -1
  23. package/package.json +1 -7
  24. package/dist/chunk-519593bc19f7cb9f.js +0 -18
  25. package/dist/chunk-5806220e55ac164c.js +0 -1
  26. package/dist/chunk-6434d2c5758f4125.js +0 -2
  27. package/dist/chunk-69b5648fcd0f0a18.js +0 -3
  28. package/dist/chunk-8e55cff6329b67a9.js +0 -2
  29. package/dist/chunk-9383d727762ecba1.js +0 -2
  30. package/dist/chunk-b38c0c4618d0dd89.js +0 -2
  31. package/dist/chunk-b3eca9338a13f510.js +0 -2
  32. package/dist/chunk-c160211e5cc4c447.js +0 -2
  33. package/dist/chunk-c4b0f134a6b82c51.js +0 -2
  34. package/dist/chunk-cc7158438e52b9ab.js +0 -9
  35. package/dist/chunk-fa61561237819f16.js +0 -1
@@ -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;IA4CR,gBAAgB;IAIhB,eAAe,CAAC,MAAM,EAAE,YAAY;IAIrC,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAgP9B,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;IA4CR,gBAAgB;IAIhB,eAAe,CAAC,MAAM,EAAE,YAAY;IAIrC,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAoP9B,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 k,h as E,i as F,l as p} from"../http/index.js";import{x as h,y as g} from"../chunk-53b7d6267c9172bc.js";import{A as G} from"../chunk-9475c6ed18013dc8.js";import{B as Jo,C as D} from"../chunk-24a86f8f5ddc0cbd.js";var q=D((to,d)=>{var Yo=function(o){if(typeof o==="function")return o;return(n)=>n.$extends(o)},Zo=function(o){return o},M=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,Vo=Object.getOwnPropertyNames,Ho=Object.prototype.hasOwnProperty,To=(o,n)=>{for(var i in n)M(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)M(o,y,{get:()=>n[y],enumerable:!(c=Oo(n,y))||c.enumerable})}return o},Ao=(o)=>zo(M({},"__esModule",{value:!0}),o),R={};To(R,{Prisma:()=>t,PrismaClient:()=>Xo,default:()=>Qo});d.exports=Ao(R);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 _=D((No,N)=>{N.exports={...q()}});function C(o){let n=[];for(let[i,c]of o)n.push(i,...C(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[f,{exec:V,middleware:O}]of Object.entries($)){const A=i==="/"?f:`${i}${f}`,L=f==="/"&&i!=="/"?i:A;n[L]={exec:[y.run.bind(y),...V],middleware:[...y.middlewares,...O]}}}else n[i]={exec:[y.run.bind(y)],middleware:y.middlewares}}else{const y=new c,b=J(y.routes);for(let[$,{exec:f,middleware:V}]of Object.entries(b)){const O=i==="/"?$:`${i}${$}`,A=$==="/"&&i!=="/"?i:O;n[A]={exec:f,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[f,V]of Object.entries($)){const O=i==="/"?f:`${i}${f}`,A=f==="/"&&i!=="/"?i:O;n[A]=[y,...V]}}else n[i]=[y]}else{const y=new c,b=U(y.routes);for(let[$,f]of Object.entries(b)){const V=i==="/"?$:`${i}${$}`,O=$==="/"&&i!=="/"?i:V;n[O]=f}}return n}import{renderToReadableStream as jo} from"react-dom/server.browser";import{createElement as x,Fragment as fo} from"react";class v{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=g(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.authenticationServiceProvider.basePath;let c={"/":this.viewRouter,[i]:n.authenticationServiceProvider.routers.view},y={"/":this.apiRouter,[i]:n.authenticationServiceProvider.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=C(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 h({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 X=new F(o,z),{data:no,cookies:io,headers:co,user:yo,prefetchedData:wo}=await E.run(X,async()=>{const T=E.getStore();T.setRequest(X),await G.getStore().middlewareServiceContainer.runMiddleware(j,H);const Y=await Promise.all([...w.map((u)=>u(X)),...Array.from(T.prefetchPromiseQueue).map((u)=>u())]),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:no,prefetchedData:wo,currentPathName:H,user:yo,params:z,cookies:io,headers:co}}catch(w){if(w.kind===k)if(i){const{status:j=400,data:H,directive:z,headers:X}=w.payload.api;return new Response(JSON.stringify({data:H,directive:z}),{headers:X,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:f,cookies:V}=c,O=y.reduce((w,j)=>{return{...w,...j}},{}),A=this.i18nServiceContainer.isEnabled;let L={};if(A){const w=this.i18nServiceContainer.detectLocale(new F(o,b)),j=this.i18nServiceContainer.getPageTranslations(w,$);L={[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",f?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),new Response(JSON.stringify({data:{[n.pathname]:O},prefetchedData:c.prefetchedData,i18n:L,is404:!$}),{headers:w})}const{styles:r,manifest:P,serverManifest:m,bootstrapModules:e}=this.renderParams,B={};let K=null;const S=(w,j)=>`"${w}": () => import("${j}")`,I=[];for(let w of["404",...this.flatComponentTree])if(!P){K=`${process.env.APP_DIR}`;const j=await import(`${K}/views/${w}.tsx`);B[w]=j.default,I.push(S(w,`${K}/views/${w}.tsx`))}else{const j=m[`app/views/${w}.tsx`];if(!j?.file)console.log(`Server file not found for ${w}`),console.log(j);const H=await import(`${process.env.DIST_DIR}/server/${j?.file}`);B[w]=H.default;const z=P[`app/views/${w}.tsx`];if(z)I.push(S(w,`/${z?.file}`))}const a=`{${I.join(",")}}`,W=new Headers;W.set("Content-Type","text/html"),W.set("Cache-Control",f?"private, no-cache, no-store, max-age=0, must-revalidate":"public, max-age=864000, must-revalidate"),W.set("ETag",this.appId),c.cookies.forEach((w)=>W.append("Set-Cookie",w.toString()));const s={kind:"view",data:{pageData:{[n.pathname]:O},prefetchedData:c.prefetchedData,i18n:L,auth:{user:f},routeManifest:this.routeManifest,router:{pathname:$,params:b,currentPath:n.pathname,searchParams:n.search,is404:!$?!0:!1},componentTree:[["404",[]],...this.componentTree]},head:{}},oo=await jo(x(fo,{children:[r,x(this.Root,{data:s.data,viewImportMap:B})]}),{bootstrapScriptContent:`window.__GEMI_DATA__ = ${JSON.stringify(s.data)}; window.loaders=${a}`,bootstrapModules:e});return new Response(oo,{status:!$?404:200,headers:W})}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)(()=>{G.getStore().broadcastingServiceContainer.run(o.data.headers,()=>{G.getStore().broadcastingServiceContainer.handleMessage(o,n)})})},open:(o)=>{},close:(o)=>{console.log("closed ws"),o.terminate()}};onPublish(o){this.kernel.services.broadcastingServiceContainer.onPublish(o)}}var l=Jo(_(),1);var Uo=l.Prisma.defineExtension({name:"Gemi Policies",query:{async $allOperations({args:o,operation:n,query:i,model:c}){const b=G.getStore().policiesServiceProvider.policiesList[`${c}Policies`];if(!b)return await i(o);if(!await b.all.call(b,n,o))throw new p;return await i(o)}}});export{Uo as prismaExtension,v 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.authenticationServiceProvider.basePath;let c={"/":this.viewRouter,[i]:n.authenticationServiceProvider.routers.view},y={"/":this.apiRouter,[i]:n.authenticationServiceProvider.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`);B[w]=j.default,I.push(k(w,`${K}/views/${w}.tsx`))}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}`);B[w]=H.default;const z=M[`app/views/${w}.tsx`];if(z)I.push(k(w,`/${z?.file}`))}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};
package/dist/bin/index.js CHANGED
@@ -7149,7 +7149,7 @@ var require_lib = __commonJS((exports, module) => {
7149
7149
  module.exports = Sharp;
7150
7150
  });
7151
7151
 
7152
- // ../../node_modules/commander/lib/error.js
7152
+ // node_modules/commander/lib/error.js
7153
7153
  var require_error = __commonJS((exports) => {
7154
7154
  class CommanderError extends Error {
7155
7155
  constructor(exitCode, code, message) {
@@ -7173,7 +7173,7 @@ var require_error = __commonJS((exports) => {
7173
7173
  exports.InvalidArgumentError = InvalidArgumentError;
7174
7174
  });
7175
7175
 
7176
- // ../../node_modules/commander/lib/argument.js
7176
+ // node_modules/commander/lib/argument.js
7177
7177
  var require_argument = __commonJS((exports) => {
7178
7178
  var humanReadableArgName = function(arg) {
7179
7179
  const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
@@ -7252,7 +7252,7 @@ var require_argument = __commonJS((exports) => {
7252
7252
  exports.humanReadableArgName = humanReadableArgName;
7253
7253
  });
7254
7254
 
7255
- // ../../node_modules/commander/lib/help.js
7255
+ // node_modules/commander/lib/help.js
7256
7256
  var require_help = __commonJS((exports) => {
7257
7257
  var { humanReadableArgName } = require_argument();
7258
7258
 
@@ -7494,7 +7494,7 @@ var require_help = __commonJS((exports) => {
7494
7494
  exports.Help = Help;
7495
7495
  });
7496
7496
 
7497
- // ../../node_modules/commander/lib/option.js
7497
+ // node_modules/commander/lib/option.js
7498
7498
  var require_option = __commonJS((exports) => {
7499
7499
  var camelcase = function(str) {
7500
7500
  return str.split("-").reduce((str2, word) => {
@@ -7645,7 +7645,7 @@ var require_option = __commonJS((exports) => {
7645
7645
  exports.DualOptions = DualOptions;
7646
7646
  });
7647
7647
 
7648
- // ../../node_modules/commander/lib/suggestSimilar.js
7648
+ // node_modules/commander/lib/suggestSimilar.js
7649
7649
  var require_suggestSimilar = __commonJS((exports) => {
7650
7650
  var editDistance = function(a, b2) {
7651
7651
  if (Math.abs(a.length - b2.length) > maxDistance)
@@ -7716,7 +7716,7 @@ var require_suggestSimilar = __commonJS((exports) => {
7716
7716
  exports.suggestSimilar = suggestSimilar;
7717
7717
  });
7718
7718
 
7719
- // ../../node_modules/commander/lib/command.js
7719
+ // node_modules/commander/lib/command.js
7720
7720
  var require_command = __commonJS((exports) => {
7721
7721
  var incrementNodeInspectorPort = function(args) {
7722
7722
  return args.map((arg) => {
@@ -8955,7 +8955,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
8955
8955
  exports.Command = Command;
8956
8956
  });
8957
8957
 
8958
- // ../../node_modules/commander/index.js
8958
+ // node_modules/commander/index.js
8959
8959
  var require_commander = __commonJS((exports) => {
8960
8960
  var { Argument } = require_argument();
8961
8961
  var { Command } = require_command();
@@ -10139,7 +10139,7 @@ async function createRollupInput_default() {
10139
10139
  // bin/gemi.ts
10140
10140
  import {build} from "vite";
10141
10141
 
10142
- // ../../node_modules/commander/esm.mjs
10142
+ // node_modules/commander/esm.mjs
10143
10143
  var import_ = __toESM(require_commander(), 1);
10144
10144
  var {
10145
10145
  program,
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as K} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-79f9130d266efc8b.js";import{Ib as T} from"./chunk-92b7f08b6396b0fc.js";import{Jb as _} from"./chunk-bd0308763754bf7b.js";var r=K(T(),1);var o=K(_(),1);import{exec as y} from"child_process";import{promisify as A} from"util";var x=(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 S=async(c,n,s)=>{const e=n[c];if(n[c]){const t=e.credential_process;if(t!==void 0){const w=A(y);try{const{stdout:u}=await w(t);let i;try{i=JSON.parse(u.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return x(c,i,n)}catch(u){throw new o.CredentialsProviderError(u.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 $=(c={})=>async()=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const n=await r.parseKnownFiles(c);return S(r.getProfileName(c),n,c.logger)};export{$ as fromProcess};
@@ -0,0 +1,9 @@
1
+ import{u as $,v as w,w as z} from"./chunk-8f575468b4e4754d.js";import{B as Q} from"./chunk-24a86f8f5ddc0cbd.js";import{Ib as v} from"./chunk-92b7f08b6396b0fc.js";import{Jb as X} from"./chunk-bd0308763754bf7b.js";var q=Q(X(),1),B=Q(v(),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-d5d491184ec17042.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-82b3f93a5aac2b2e.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[B.ENV_PROFILE]){if(process.env[$]&&process.env[w]){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"),z(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-23b1faa7791ca31d.js");return H(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-3d4e6fdf131bae97.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-0441dc8e5b215b75.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-b35e7bc78a8a613f.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})}),g,O),O=(b)=>b?.expiration!==void 0,g=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{T as Eb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as l} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-79f9130d266efc8b.js";import{Ib as v} from"./chunk-92b7f08b6396b0fc.js";import{Jb as u} from"./chunk-bd0308763754bf7b.js";var x=l(u(),1),O=l(v(),1);var M=(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 k=l(u(),1),m=l(v(),1);var H=300000,_="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var P={},K=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-6e20f463543eec5f.js");if(P[e])return P[e];const s=new r({region:e});return P[e]=s,s};var b=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-6e20f463543eec5f.js");return(await K(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var G=l(u(),1);var R=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new G.TokenProviderError(`Token is expired. ${_}`,!1)};var U=l(u(),1);var S=(e,r,s=!1)=>{if(typeof r==="undefined")throw new U.TokenProviderError(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${_}`,!1)};var q=l(v(),1);import{promises as B} from"fs";var{writeFile:Q}=B,W=(e,r)=>{const s=q.getSSOTokenFilepath(e),t=JSON.stringify(r,null,2);return Q(s,t)};var j=new Date(0),X=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await m.parseKnownFiles(e),s=m.getProfileName(e),t=r[s];if(!t)throw new k.TokenProviderError(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new k.TokenProviderError(`Profile '${s}' is missing required property 'sso_session'.`);const i=t.sso_session,a=(await m.loadSsoSessionData(e))[i];if(!a)throw new k.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 k.TokenProviderError(`Sso session '${i}' is missing required property '${n}'.`,!1);const{sso_start_url:f,sso_region:p}=a;let o;try{o=await m.getSSOTokenFromFile(i)}catch(n){throw new k.TokenProviderError(`The SSO session token associated with profile=${s} was not found or is invalid. ${_}`,!1)}S("accessToken",o.accessToken),S("expiresAt",o.expiresAt);const{accessToken:N,expiresAt:y}=o,c={token:N,expiration:new Date(y)};if(c.expiration.getTime()-Date.now()>H)return c;if(Date.now()-j.getTime()<30000)return R(c),c;S("clientId",o.clientId,!0),S("clientSecret",o.clientSecret,!0),S("refreshToken",o.refreshToken,!0);try{j.setTime(Date.now());const n=await b(o,p);S("accessToken",n.accessToken),S("expiresIn",n.expiresIn);const h=new Date(Date.now()+n.expiresIn*1000);try{await W(i,{...o,accessToken:n.accessToken,expiresAt:h.toISOString(),refreshToken:n.refreshToken})}catch(I){}return{token:n.accessToken,expiration:h}}catch(n){return R(c),c}};var T=l(u(),1),z=l(v(),1),C=!1,D=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:d,clientConfig:a,profile:f,logger:p})=>{let o;const N="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const g=await X({profile:f})();o={accessToken:g.token,expiresAt:new Date(g.expiration).toISOString()}}catch(g){throw new T.CredentialsProviderError(g.message,{tryNextLink:C,logger:p})}else try{o=await z.getSSOTokenFromFile(e)}catch(g){throw new T.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:C,logger:p})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new T.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:C,logger:p});const{accessToken:y}=o,{SSOClient:c,GetRoleCredentialsCommand:n}=await import("./chunk-e5db92db378843ab.js"),h=d||new c(Object.assign({},a??{},{region:a?.region??t}));let I;try{I=await h.send(new n({accountId:s,roleName:i,accessToken:y}))}catch(g){throw new T.CredentialsProviderError(g,{tryNextLink:C,logger:p})}const{roleCredentials:{accessKeyId:w,secretAccessKey:E,sessionToken:A,expiration:$,credentialScope:F,accountId:L}={}}=I;if(!w||!E||!A||!$)throw new T.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:C,logger:p});return{accessKeyId:w,secretAccessKey:E,sessionToken:A,expiration:new Date($),...F&&{credentialScope:F},...L&&{accountId:L}}};var J=l(u(),1),V=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:i,sso_role_name:d}=e;if(!s||!t||!i||!d)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 Te=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoSession:d}=e,{ssoClient:a}=e,f=O.getProfileName(e);if(!r&&!s&&!t&&!i&&!d){const o=(await O.parseKnownFiles(e))[f];if(!o)throw new x.CredentialsProviderError(`Profile ${f} was not found.`,{logger:e.logger});if(!M(o))throw new x.CredentialsProviderError(`Profile ${f} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const w=(await O.loadSsoSessionData(e))[o.sso_session],E=` configurations in profile ${f} and sso-session ${o.sso_session}`;if(t&&t!==w.sso_region)throw new x.CredentialsProviderError("Conflicting SSO region"+E,{tryNextLink:!1,logger:e.logger});if(r&&r!==w.sso_start_url)throw new x.CredentialsProviderError("Conflicting SSO start_url"+E,{tryNextLink:!1,logger:e.logger});o.sso_region=w.sso_region,o.sso_start_url=w.sso_start_url}const{sso_start_url:N,sso_account_id:y,sso_region:c,sso_role_name:n,sso_session:h}=V(o,e.logger);return D({ssoStartUrl:N,ssoSession:h,ssoAccountId:y,ssoRegion:c,ssoRoleName:n,ssoClient:a,clientConfig:e.clientConfig,profile:f})}else if(!r||!s||!t||!i)throw new x.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return D({ssoStartUrl:r,ssoSession:d,ssoAccountId:s,ssoRegion:t,ssoRoleName:i,ssoClient:a,clientConfig:e.clientConfig,profile:f})};export{V as validateSsoProfile,M as isSsoProfile,Te as fromSSO};
@@ -0,0 +1,2 @@
1
+ import{B as c,C as x} from"./chunk-24a86f8f5ddc0cbd.js";import{Ib as U} from"./chunk-92b7f08b6396b0fc.js";import{Jb as m} from"./chunk-bd0308763754bf7b.js";var $=x((y,A)=>{var R=function(o){const t={};if(o=o.replace(/^\?/,""),o)for(let n of o.split("&")){let[i,r=null]=n.split("=");if(i=decodeURIComponent(i),r)r=decodeURIComponent(r);if(!(i in t))t[i]=r;else if(Array.isArray(t[i]))t[i].push(r);else t[i]=[t[i],r]}return t},g=Object.defineProperty,z=Object.getOwnPropertyDescriptor,L=Object.getOwnPropertyNames,X=Object.prototype.hasOwnProperty,Z=(o,t)=>g(o,"name",{value:t,configurable:!0}),b=(o,t)=>{for(var n in t)g(o,n,{get:t[n],enumerable:!0})},B=(o,t,n,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let r of L(t))if(!X.call(o,r)&&r!==n)g(o,r,{get:()=>t[r],enumerable:!(i=z(t,r))||i.enumerable})}return o},H=(o)=>B(g({},"__esModule",{value:!0}),o),I={};b(I,{parseQueryString:()=>R});A.exports=H(I);Z(R,"parseQueryString")});var p=c(m(),1);var w=c(m(),1);function e(o){try{const t=new Set(Array.from(o.match(/([A-Z_]){3,}/g)??[]));return t.delete("CONFIG"),t.delete("CONFIG_PREFIX_SEPARATOR"),t.delete("ENV"),[...t].join(", ")}catch(t){return o}}var E=(o,t)=>async()=>{try{const n=o(process.env);if(n===void 0)throw new Error;return n}catch(n){throw new w.CredentialsProviderError(n.message||`Not found in ENV: ${e(o.toString())}`,{logger:t})}};var N=c(m(),1),h=c(U(),1);var C=(o,{preferredFile:t="config",...n}={})=>async()=>{const i=h.getProfileName(n),{configFile:r,credentialsFile:f}=await h.loadSharedConfigFiles(n),s=f[i]||{},F=r[i]||{},T=t==="config"?{...s,...F}:{...F,...s};try{const d=o(T,t==="config"?r:f);if(d===void 0)throw new Error;return d}catch(a){throw new N.CredentialsProviderError(a.message||`Not found in config files w/ profile [${i}]: ${e(o.toString())}`,{logger:n.logger})}};var l=c(m(),1),j=(o)=>typeof o==="function",S=(o)=>j(o)?async()=>await o():l.fromStatic(o);var J=({environmentVariableSelector:o,configFileSelector:t,default:n},i={})=>p.memoize(p.chain(E(o),C(t,i),S(n)));var G=c($(),1),K=(o)=>{if(typeof o==="string")return K(new URL(o));const{hostname:t,pathname:n,port:i,protocol:r,search:f}=o;let s;if(f)s=G.parseQueryString(f);return{hostname:t,port:i?parseInt(i):void 0,protocol:r,path:n,query:s}};
2
+ export{$ as Fb,J as Gb,K as Hb};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B as k} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-79f9130d266efc8b.js";import{Ib as J} from"./chunk-92b7f08b6396b0fc.js";import{Jb as D} from"./chunk-bd0308763754bf7b.js";var O=k(J(),1);var F=k(D(),1);var $=k(D(),1),L=k(J(),1);var K=k(D(),1),A=(y,c,_)=>{const b={EcsContainer:async(x)=>{const{fromHttp:w}=await import("./chunk-82b3f93a5aac2b2e.js"),{fromContainerMetadata:C}=await import("./chunk-d5d491184ec17042.js");return _?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),K.chain(w(x??{}),C(x))},Ec2InstanceMetadata:async(x)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:w}=await import("./chunk-d5d491184ec17042.js");return w(x)},Environment:async(x)=>{_?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:w}=await import("./chunk-8f575468b4e4754d.js");return w(x)}};if(y in b)return b[y];else throw new K.CredentialsProviderError(`Unsupported credential source in profile ${c}. Got ${y}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:_})};var Q=(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&&(R(y,{profile:c,logger:_})||T(y,{profile:c,logger:_}))},R=(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},T=(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},U=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-dc3eae4932658400.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"+` ${L.getProfileName(_)}. 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 C=w?j(w,c,_,{...b,[w]:!0},G(c[w]??{})):(await A(x.credential_source,y,_.logger)(_))();if(G(x))return C;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:B}=x;if(B){if(!_.mfaCodeProvider)throw new $.CredentialsProviderError(`Profile ${y} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:_.logger,tryNextLink:!1});I.SerialNumber=B,I.TokenCode=await _.mfaCodeProvider(B)}const H=await C;return _.roleAssumer(H,I)}},G=(y)=>{return!y.role_arn&&!!y.credential_source};var V=(y)=>Boolean(y)&&typeof y==="object"&&typeof y.credential_process==="string",W=async(y,c)=>import("./chunk-0441dc8e5b215b75.js").then(({fromProcess:_})=>_({...y,profile:c})());var X=async(y,c={})=>{const{fromSSO:_}=await import("./chunk-23b1faa7791ca31d.js");return _({profile:y,logger:c.logger})()},Y=(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 Z=(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,E=async(y,c)=>import("./chunk-b35e7bc78a8a613f.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||Q(w,{profile:y,logger:_.logger}))return U(y,c,_,b);if(q(w))return z(w,_);if(Z(w))return E(w,_);if(V(w))return W(_,y);if(Y(w))return await X(y,_);throw new F.CredentialsProviderError(`Could not resolve credentials using profile: [${y}] in configuration/credentials file(s).`,{logger:_.logger})};var g=(y={})=>async()=>{y.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const c=await O.parseKnownFiles(y);return j(O.getProfileName(y),c,y)};export{g as fromIni};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-8f575468b4e4754d.js";import{B as $} from"./chunk-24a86f8f5ddc0cbd.js";import"./chunk-28694e5e949df0ff.js";import{$ as Te,O as ee,P as re,Q as or,R as dr,S as cr,T as yr,W as H,X as ar,Y as Ie,Z as Re,_ as Pe,aa as mr,ba as Ke,ca as Me,da as Be,ea as Le,fa as wr,ga as kr,ia as E,ja as S,ka as vr,la as Qe,ma as Xe,na as Er,oa as Ye,pa as Sr,qa as U,ra as Ze,sa as He,ta as Ne,ua as _e,va as lr,wa as hr} from"./chunk-75aa5e5e2f565737.js";import{Ab as o,Cb as I,Ga as je,Ia as Fe,Ja as De,Ka as tr,La as Ue,Ma as qe,Pa as Ve,Qa as We,cb as v,db as t,eb as Wr,gb as _,hb as b,ib as j,jb as F,kb as h,rb as $r,sb as a,tb as Fr,ub as fe,vb as Ae,wb as sr,xa as er,xb as ir,ya as rr,zb as d} from"./chunk-a4330a47c3806ff1.js";import"./chunk-79f9130d266efc8b.js";import{Eb as ge} from"./chunk-08bf87c7e29141d3.js";import{Gb as R,Hb as xe} from"./chunk-36d595d02662f2fa.js";import"./chunk-92b7f08b6396b0fc.js";import"./chunk-bd0308763754bf7b.js";var P=$(H(),1);var se=$(U(),1);var Br=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}},Z=function(e){return{schemeId:"smithy.api#noAuth"}},ie=async(e,s,r)=>{return{operation:ee(s).operation,region:await re(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},le=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(Z(e));break}case"RegisterClient":{s.push(Z(e));break}case"StartDeviceAuthorization":{s.push(Z(e));break}default:s.push(Br(e))}return s},he=(e)=>{return{...se.resolveAwsSdkSigV4Config(e)}};var ne=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},k={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oe={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.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 pe=$(U(),1);var ze=$(U(),1),Ge=$(H(),1);var de={["required"]:!1,type:"String"},ce={["required"]:!0,default:!1,type:"Boolean"},ye={["ref"]:"Endpoint"},ve={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Ee={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},te={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Se={["ref"]:"PartitionResult"},ae={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Se,"supportsDualStack"]}]},me=[ve],we=[Ee],ke=[{["ref"]:"Region"}],Qr={version:"1.0",parameters:{Region:de,UseDualStack:ce,UseFIPS:ce,Endpoint:de},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ye]}],rules:[{conditions:me,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:we,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ye,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:ke}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:ke,assign:"PartitionResult"}],rules:[{conditions:[ve,Ee],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,te]},ae],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:me,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[te,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Se,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:m,headers:m},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:we,rules:[{conditions:[ae],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},$e=Qr;var Xr=new Ie({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),be=(e,s={})=>{return Xr.get(e,()=>Pe($e,{endpointParams:e,logger:s.logger}))};Re.aws=Te;var Je=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Ue,base64Encoder:e?.base64Encoder??qe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??be,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??le,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new ze.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ge.NoAuthSigner}],logger:e?.logger??new De,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??xe,utf8Decoder:e?.utf8Decoder??je,utf8Encoder:e?.utf8Encoder??Fe}};var Ce=(e)=>{Ae(process.version);const s=_e(e),r=()=>s().then(fe),i=Je(e);return pe.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Ne,credentialDefaultProvider:e?.credentialDefaultProvider??ge,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ze({serviceId:i.serviceId,clientVersion:oe.version}),maxAttempts:e?.maxAttempts??R(Xe),region:e?.region??R(Be,Le),requestHandler:Ve.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Ye,default:async()=>(await r()).retryMode||Qe}),sha256:e?.sha256??He.bind(null,"sha256"),streamCollector:e?.streamCollector??We,useDualstackEndpoint:e?.useDualstackEndpoint??R(Ke),useFipsEndpoint:e?.useFipsEndpoint??R(Me)}};var Oe=(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}}},ue=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var q=(e)=>e,nr=(e,s)=>{const r={...q(lr(e)),...q(sr(e)),...q(er(e)),...q(Oe(e))};return s.forEach((i)=>i.configure(r)),{...e,...hr(r),...ir(r),...rr(r),...ue(r)}};class N extends tr{constructor(...[e]){const s=Ce(e||{}),r=ne(s),i=ar(r),l=Er(i),n=wr(l),T=or(n),Ar=vr(T),Kr=he(Ar),u=nr(Kr,e?.extensions||[]);super(u);this.config=u,this.middlewareStack.use(mr(this.config)),this.middlewareStack.use(Sr(this.config)),this.middlewareStack.use(kr(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(cr(this.config)),this.middlewareStack.use(yr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ie,identityProviderConfigProvider:async(Mr)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Mr.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class c extends $r{constructor(e){super(e);Object.setPrototypeOf(this,c.prototype)}}class x extends c{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,x.prototype),this.error=e.error,this.error_description=e.error_description}}class z extends c{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,z.prototype),this.error=e.error,this.error_description=e.error_description}}class G extends c{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends c{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends c{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends c{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class f extends c{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends c{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends c{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends c{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends c{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends c{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Q extends c{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends c{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}var Ir=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),Rr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Pr=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Tr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),br=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),jr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var w=$(U(),1),D=$(H(),1);var Dr=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()},Ur=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");const l=d({[hs]:[,"t"]});let n;return n=JSON.stringify(o(e,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(T)=>I(T),subjectToken:[],subjectTokenType:[]})),r.m("POST").h(i).q(l).b(n),r.build()},qr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/client/register");let l;return l=JSON.stringify(o(e,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(n)=>I(n),issuerUrl:[],redirectUris:(n)=>I(n),scopes:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},xr=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()},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:y(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:y(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,issuedTokenType:h,refreshToken:h,scope:I,tokenType:h});return Object.assign(r,l),r},Jr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:y(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:_,clientSecret:h,clientSecretExpiresAt:_,tokenEndpoint:h});return Object.assign(r,l),r},Vr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:y(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{deviceCode:h,expiresIn:b,interval:b,userCode:h,verificationUri:h,verificationUriComplete:h});return Object.assign(r,l),r},Y=async(e,s)=>{const r={...e,body:await w.parseJsonErrorBody(e.body,s)},i=w.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Zr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Hr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Nr(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await _r(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await pr(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await gr(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await ur(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await rs(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await ss(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await is(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await ls(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await es(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await Cr(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Or(r,s);default:const l=r.body;return Yr({output:e,parsedBody:l,errorCode:i})}},Yr=Fr(c),Zr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new x({$metadata:y(e),...r});return a(n,e.body)},Hr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new z({$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 G({$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 J({$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 V({$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 Q({$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 W({$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 X({$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 f({$metadata:y(e),...r});return a(n,e.body)},es=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{endpoint:h,error:h,error_description:h,region:h});Object.assign(r,l);const n=new L({$metadata:y(e),...r});return a(n,e.body)},rs=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new A({$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 K({$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 M({$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 B({$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 hs="aws_iam";class p extends v.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Ir,Rr).ser(Dr).de(zr).build(){}class C extends v.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Pr,Tr).ser(Ur).de(Gr).build(){}class g extends v.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,br).ser(qr).de(Jr).build(){}class O extends v.classBuilder().ep(k).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(jr,void 0).ser(xr).de(Vr).build(){}var ns={CreateTokenCommand:p,CreateTokenWithIAMCommand:C,RegisterClientCommand:g,StartDeviceAuthorizationCommand:O};class fr extends N{}Wr(ns,fr);export{tr as __Client,B as UnsupportedGrantTypeException,M as UnauthorizedClientException,jr as StartDeviceAuthorizationRequestFilterSensitiveLog,O as StartDeviceAuthorizationCommand,K as SlowDownException,c as SSOOIDCServiceException,N as SSOOIDCClient,fr as SSOOIDC,br as RegisterClientResponseFilterSensitiveLog,g as RegisterClientCommand,A as InvalidScopeException,L as InvalidRequestRegionException,f as InvalidRequestException,X as InvalidRedirectUriException,W as InvalidGrantException,Q as InvalidClientMetadataException,V as InvalidClientException,J as InternalServerException,G as ExpiredTokenException,Tr as CreateTokenWithIAMResponseFilterSensitiveLog,Pr as CreateTokenWithIAMRequestFilterSensitiveLog,C as CreateTokenWithIAMCommand,Rr as CreateTokenResponseFilterSensitiveLog,Ir as CreateTokenRequestFilterSensitiveLog,p as CreateTokenCommand,z as AuthorizationPendingException,x as AccessDeniedException,v as $Command};