gemi 0.119.2 → 0.120.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gemi.js +32 -5
- package/dist/bin/gemi.js.map +6 -5
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-x5m12vkw.js → chunk-0ejjgzwc.js} +2 -2
- package/dist/{chunk-x5m12vkw.js.map → chunk-0ejjgzwc.js.map} +1 -1
- package/dist/{chunk-7rffbkmg.js → chunk-0k02tza1.js} +1 -1
- package/dist/{chunk-14xk8kq0.js → chunk-0yj0s1pn.js} +2 -2
- package/dist/{chunk-14xk8kq0.js.map → chunk-0yj0s1pn.js.map} +1 -1
- package/dist/{chunk-6pqbsc5y.js → chunk-19dpzp4y.js} +3 -3
- package/dist/{chunk-6pqbsc5y.js.map → chunk-19dpzp4y.js.map} +1 -1
- package/dist/{chunk-3vt172y7.js → chunk-1wnnkde0.js} +3 -3
- package/dist/{chunk-3vt172y7.js.map → chunk-1wnnkde0.js.map} +1 -1
- package/dist/{chunk-ct1vwaw7.js → chunk-1xdrs2hx.js} +3 -3
- package/dist/{chunk-ct1vwaw7.js.map → chunk-1xdrs2hx.js.map} +1 -1
- package/dist/{chunk-79rtpahn.js → chunk-2c0s0561.js} +2 -2
- package/dist/{chunk-79rtpahn.js.map → chunk-2c0s0561.js.map} +1 -1
- package/dist/{chunk-nfq127pg.js → chunk-2n3pgfnb.js} +2 -2
- package/dist/{chunk-nfq127pg.js.map → chunk-2n3pgfnb.js.map} +1 -1
- package/dist/{chunk-s2h85rbf.js → chunk-32n8t8x6.js} +2 -2
- package/dist/{chunk-s2h85rbf.js.map → chunk-32n8t8x6.js.map} +1 -1
- package/dist/{chunk-6gfsjgra.js → chunk-3gsv1vv1.js} +2 -2
- package/dist/{chunk-6gfsjgra.js.map → chunk-3gsv1vv1.js.map} +1 -1
- package/dist/{chunk-862jeyz0.js → chunk-3wnghdsx.js} +2 -2
- package/dist/{chunk-862jeyz0.js.map → chunk-3wnghdsx.js.map} +1 -1
- package/dist/{chunk-yn4x9wxc.js → chunk-471htqmz.js} +2 -2
- package/dist/{chunk-yn4x9wxc.js.map → chunk-471htqmz.js.map} +1 -1
- package/dist/{chunk-w1zqg54r.js → chunk-48gmyaxc.js} +2 -2
- package/dist/{chunk-w1zqg54r.js.map → chunk-48gmyaxc.js.map} +1 -1
- package/dist/{chunk-299zx9dv.js → chunk-4acpw92g.js} +3 -3
- package/dist/{chunk-299zx9dv.js.map → chunk-4acpw92g.js.map} +1 -1
- package/dist/{chunk-9c5s06gc.js → chunk-4fx8p02c.js} +2 -2
- package/dist/{chunk-9c5s06gc.js.map → chunk-4fx8p02c.js.map} +1 -1
- package/dist/{chunk-xpz1bp50.js → chunk-51w5ktv2.js} +3 -3
- package/dist/{chunk-xpz1bp50.js.map → chunk-51w5ktv2.js.map} +1 -1
- package/dist/{chunk-9qkjkse0.js → chunk-5nj94s66.js} +4 -4
- package/dist/{chunk-9qkjkse0.js.map → chunk-5nj94s66.js.map} +1 -1
- package/dist/{chunk-j632p533.js → chunk-5tdxbwzg.js} +3 -3
- package/dist/{chunk-j632p533.js.map → chunk-5tdxbwzg.js.map} +1 -1
- package/dist/{chunk-zq1bhsdg.js → chunk-65beps2q.js} +3 -3
- package/dist/{chunk-zq1bhsdg.js.map → chunk-65beps2q.js.map} +1 -1
- package/dist/{chunk-xeh1mw1d.js → chunk-6yhpprzs.js} +3 -3
- package/dist/{chunk-xeh1mw1d.js.map → chunk-6yhpprzs.js.map} +1 -1
- package/dist/{chunk-620yeafr.js → chunk-7ftj43vp.js} +2 -2
- package/dist/{chunk-620yeafr.js.map → chunk-7ftj43vp.js.map} +1 -1
- package/dist/{chunk-4kj4e22e.js → chunk-7g649j8h.js} +2 -2
- package/dist/{chunk-4kj4e22e.js.map → chunk-7g649j8h.js.map} +1 -1
- package/dist/{chunk-675kzd7z.js → chunk-7mmw0jr2.js} +2 -2
- package/dist/{chunk-675kzd7z.js.map → chunk-7mmw0jr2.js.map} +1 -1
- package/dist/{chunk-k1ncgq7p.js → chunk-9d2d08qm.js} +2 -2
- package/dist/{chunk-k1ncgq7p.js.map → chunk-9d2d08qm.js.map} +1 -1
- package/dist/{chunk-wdg83tgd.js → chunk-9rr5h818.js} +3 -3
- package/dist/{chunk-wdg83tgd.js.map → chunk-9rr5h818.js.map} +1 -1
- package/dist/{chunk-30xxc6r7.js → chunk-9xyxbxgk.js} +2 -2
- package/dist/{chunk-30xxc6r7.js.map → chunk-9xyxbxgk.js.map} +1 -1
- package/dist/{chunk-khd9ft0s.js → chunk-ar4d3vmr.js} +3 -3
- package/dist/{chunk-khd9ft0s.js.map → chunk-ar4d3vmr.js.map} +1 -1
- package/dist/chunk-b5a5vvkk.js +57 -0
- package/dist/{chunk-bz5gda3b.js.map → chunk-b5a5vvkk.js.map} +7 -6
- package/dist/{chunk-6ggmk2eg.js → chunk-c0v61fp5.js} +2 -2
- package/dist/{chunk-6ggmk2eg.js.map → chunk-c0v61fp5.js.map} +1 -1
- package/dist/{chunk-bw2pfaz3.js → chunk-c7qs1xp3.js} +2 -2
- package/dist/{chunk-bw2pfaz3.js.map → chunk-c7qs1xp3.js.map} +1 -1
- package/dist/{chunk-2kegxt0s.js → chunk-cca0grq3.js} +2 -2
- package/dist/{chunk-2kegxt0s.js.map → chunk-cca0grq3.js.map} +1 -1
- package/dist/{chunk-b336h3hj.js → chunk-cskqet01.js} +2 -2
- package/dist/{chunk-b336h3hj.js.map → chunk-cskqet01.js.map} +1 -1
- package/dist/{chunk-pzk2a5sr.js → chunk-cvr5624r.js} +1 -1
- package/dist/chunk-cytq2msw.js +24 -0
- package/dist/{chunk-w8d37mcq.js.map → chunk-cytq2msw.js.map} +3 -3
- package/dist/{chunk-8507ez1g.js → chunk-d2c3947c.js} +2 -2
- package/dist/{chunk-8507ez1g.js.map → chunk-d2c3947c.js.map} +1 -1
- package/dist/{chunk-q0djcyj2.js → chunk-d5f1m3d2.js} +2 -2
- package/dist/{chunk-q0djcyj2.js.map → chunk-d5f1m3d2.js.map} +1 -1
- package/dist/{chunk-f9tfpn3w.js → chunk-dedqr5wb.js} +2 -2
- package/dist/{chunk-f9tfpn3w.js.map → chunk-dedqr5wb.js.map} +1 -1
- package/dist/{chunk-h02kyxgg.js → chunk-dhbgrv58.js} +1 -1
- package/dist/{chunk-d4dd7jde.js → chunk-dwedx1jb.js} +3 -3
- package/dist/{chunk-d4dd7jde.js.map → chunk-dwedx1jb.js.map} +1 -1
- package/dist/{chunk-5crtgt1y.js → chunk-ep0baa9g.js} +2 -2
- package/dist/{chunk-5crtgt1y.js.map → chunk-ep0baa9g.js.map} +1 -1
- package/dist/{chunk-kk77x2v4.js → chunk-er8acmch.js} +7 -7
- package/dist/{chunk-kk77x2v4.js.map → chunk-er8acmch.js.map} +3 -3
- package/dist/{chunk-thz75w6e.js → chunk-fcqx2t0p.js} +2 -2
- package/dist/{chunk-thz75w6e.js.map → chunk-fcqx2t0p.js.map} +1 -1
- package/dist/{chunk-1p87gdd2.js → chunk-fenc5tpv.js} +2 -2
- package/dist/{chunk-1p87gdd2.js.map → chunk-fenc5tpv.js.map} +1 -1
- package/dist/{chunk-fmea4sak.js → chunk-gc2dz11k.js} +2 -2
- package/dist/{chunk-fmea4sak.js.map → chunk-gc2dz11k.js.map} +1 -1
- package/dist/{chunk-qxxbp3nn.js → chunk-gemzbw7f.js} +2 -2
- package/dist/{chunk-qxxbp3nn.js.map → chunk-gemzbw7f.js.map} +1 -1
- package/dist/{chunk-qpy25jj9.js → chunk-gy81nd9a.js} +2 -2
- package/dist/{chunk-qpy25jj9.js.map → chunk-gy81nd9a.js.map} +1 -1
- package/dist/{chunk-c8vttyem.js → chunk-h43jp8ws.js} +2 -2
- package/dist/{chunk-c8vttyem.js.map → chunk-h43jp8ws.js.map} +1 -1
- package/dist/chunk-htgmy3x7.js +5 -0
- package/dist/{chunk-15v719sq.js.map → chunk-htgmy3x7.js.map} +1 -1
- package/dist/{chunk-xqd3zde5.js → chunk-jaa6xkeh.js} +2 -2
- package/dist/{chunk-xqd3zde5.js.map → chunk-jaa6xkeh.js.map} +1 -1
- package/dist/{chunk-2bja99cq.js → chunk-kk18xqgc.js} +2 -2
- package/dist/{chunk-2bja99cq.js.map → chunk-kk18xqgc.js.map} +1 -1
- package/dist/{chunk-mcjbck8e.js → chunk-krk7mcgm.js} +3 -3
- package/dist/{chunk-mcjbck8e.js.map → chunk-krk7mcgm.js.map} +1 -1
- package/dist/{chunk-hd5ztshp.js → chunk-krtybgz1.js} +2 -2
- package/dist/{chunk-hd5ztshp.js.map → chunk-krtybgz1.js.map} +1 -1
- package/dist/{chunk-fjhnn3de.js → chunk-m53fgf20.js} +3 -3
- package/dist/{chunk-fjhnn3de.js.map → chunk-m53fgf20.js.map} +1 -1
- package/dist/{chunk-4c1npv8k.js → chunk-m83zm86m.js} +2 -2
- package/dist/{chunk-4c1npv8k.js.map → chunk-m83zm86m.js.map} +1 -1
- package/dist/{chunk-q6a30w8w.js → chunk-meg8rtr6.js} +2 -2
- package/dist/{chunk-q6a30w8w.js.map → chunk-meg8rtr6.js.map} +1 -1
- package/dist/{chunk-vy0tnx2s.js → chunk-mr94nfp1.js} +3 -3
- package/dist/{chunk-vy0tnx2s.js.map → chunk-mr94nfp1.js.map} +1 -1
- package/dist/{chunk-zb8zzf5x.js → chunk-nz8z8jr1.js} +3 -3
- package/dist/{chunk-zb8zzf5x.js.map → chunk-nz8z8jr1.js.map} +1 -1
- package/dist/{chunk-d38x71xy.js → chunk-pemhmjzp.js} +3 -3
- package/dist/{chunk-d38x71xy.js.map → chunk-pemhmjzp.js.map} +1 -1
- package/dist/{chunk-d2v78b77.js → chunk-pn2x59ge.js} +3 -3
- package/dist/{chunk-d2v78b77.js.map → chunk-pn2x59ge.js.map} +1 -1
- package/dist/{chunk-qm6j85fq.js → chunk-qphjhpad.js} +2 -2
- package/dist/{chunk-qm6j85fq.js.map → chunk-qphjhpad.js.map} +1 -1
- package/dist/{chunk-p5xy9cn8.js → chunk-qsz9241c.js} +2 -2
- package/dist/{chunk-p5xy9cn8.js.map → chunk-qsz9241c.js.map} +1 -1
- package/dist/{chunk-d6nhcqvt.js → chunk-qy8c0gzr.js} +2 -2
- package/dist/{chunk-d6nhcqvt.js.map → chunk-qy8c0gzr.js.map} +1 -1
- package/dist/{chunk-7ns5506p.js → chunk-r01aqf0q.js} +2 -2
- package/dist/{chunk-7ns5506p.js.map → chunk-r01aqf0q.js.map} +1 -1
- package/dist/{chunk-0p6mdba6.js → chunk-rhvc1axc.js} +2 -2
- package/dist/{chunk-0p6mdba6.js.map → chunk-rhvc1axc.js.map} +1 -1
- package/dist/{chunk-pjz79c2c.js → chunk-s07v65x6.js} +3 -3
- package/dist/{chunk-pjz79c2c.js.map → chunk-s07v65x6.js.map} +1 -1
- package/dist/{chunk-q00f25na.js → chunk-s5k3yq6t.js} +2 -2
- package/dist/{chunk-q00f25na.js.map → chunk-s5k3yq6t.js.map} +1 -1
- package/dist/{chunk-ty8gxbgj.js → chunk-s6vvqsd0.js} +3 -3
- package/dist/{chunk-ty8gxbgj.js.map → chunk-s6vvqsd0.js.map} +3 -3
- package/dist/{chunk-2854taf5.js → chunk-sx340k85.js} +2 -2
- package/dist/{chunk-2854taf5.js.map → chunk-sx340k85.js.map} +1 -1
- package/dist/{chunk-j5q5ysng.js → chunk-tewhms9w.js} +2 -2
- package/dist/{chunk-j5q5ysng.js.map → chunk-tewhms9w.js.map} +1 -1
- package/dist/{chunk-7pxdvvrz.js → chunk-tk135gmj.js} +3 -3
- package/dist/{chunk-7pxdvvrz.js.map → chunk-tk135gmj.js.map} +1 -1
- package/dist/{chunk-yvd4pgd9.js → chunk-vx7hvyvq.js} +2 -2
- package/dist/{chunk-yvd4pgd9.js.map → chunk-vx7hvyvq.js.map} +1 -1
- package/dist/{chunk-xecnc8zv.js → chunk-wjkh2gem.js} +1 -1
- package/dist/{chunk-511zqetr.js → chunk-wqe47c0j.js} +2 -2
- package/dist/{chunk-511zqetr.js.map → chunk-wqe47c0j.js.map} +1 -1
- package/dist/{chunk-2y0r4b7g.js → chunk-y6wt5b6t.js} +1 -1
- package/dist/{chunk-kkx8a35r.js → chunk-yds7zwc3.js} +2 -2
- package/dist/{chunk-kkx8a35r.js.map → chunk-yds7zwc3.js.map} +1 -1
- package/dist/{chunk-w7am9q0q.js → chunk-zefs2b6h.js} +2 -2
- package/dist/{chunk-w7am9q0q.js.map → chunk-zefs2b6h.js.map} +1 -1
- package/dist/{chunk-de4t48j9.js → chunk-zg6hmc48.js} +1 -1
- package/dist/{chunk-svn6zvzd.js → chunk-zrcd9hxr.js} +2 -2
- package/dist/{chunk-svn6zvzd.js.map → chunk-zrcd9hxr.js.map} +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +26 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/staticNavigation.d.ts +26 -0
- package/dist/client/staticNavigation.d.ts.map +1 -0
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/ViewRouter.d.ts +36 -2
- package/dist/http/ViewRouter.d.ts.map +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +2 -2
- package/dist/internal/islandRuntime.d.ts +16 -0
- package/dist/internal/islandRuntime.d.ts.map +1 -1
- package/dist/internal/staticNavigationRuntime.d.ts +8 -0
- package/dist/internal/staticNavigationRuntime.d.ts.map +1 -0
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/devFetch.d.ts.map +1 -1
- package/dist/server/httpProd.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -3
- package/dist/services/index.js.map +2 -2
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +5 -0
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/staticDocument.d.ts +30 -21
- package/dist/services/router/staticDocument.d.ts.map +1 -1
- package/dist/stats/bundleStats.d.ts +6 -2
- package/dist/stats/bundleStats.d.ts.map +1 -1
- package/dist/stats/route-table.js +2 -2
- package/dist/stats/route-table.js.map +3 -3
- package/dist/stats/routeTable.d.ts +5 -1
- package/dist/stats/routeTable.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +185 -2
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/staticDocument.d.ts +80 -0
- package/dist/testing/staticDocument.d.ts.map +1 -0
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-15v719sq.js +0 -5
- package/dist/chunk-bz5gda3b.js +0 -57
- package/dist/chunk-w8d37mcq.js +0 -24
- /package/dist/{chunk-7rffbkmg.js.map → chunk-0k02tza1.js.map} +0 -0
- /package/dist/{chunk-pzk2a5sr.js.map → chunk-cvr5624r.js.map} +0 -0
- /package/dist/{chunk-h02kyxgg.js.map → chunk-dhbgrv58.js.map} +0 -0
- /package/dist/{chunk-xecnc8zv.js.map → chunk-wjkh2gem.js.map} +0 -0
- /package/dist/{chunk-2y0r4b7g.js.map → chunk-y6wt5b6t.js.map} +0 -0
- /package/dist/{chunk-de4t48j9.js.map → chunk-zg6hmc48.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R as C,T as h,U as m}from"./chunk-
|
|
2
|
+
import{R as C,T as h,U as m}from"./chunk-qphjhpad.js";import{ma as w,na as q}from"./chunk-zg6hmc48.js";import"./chunk-a22h5cby.js";import"./chunk-epvpmakp.js";import"./chunk-r3v2cnrj.js";import"./chunk-c0v61fp5.js";import"./chunk-kk18xqgc.js";import"./chunk-krtybgz1.js";import{Jg as _}from"./chunk-cca0grq3.js";import{Ui as y}from"./chunk-er8acmch.js";import{gj as N}from"./chunk-rhvc1axc.js";import"./chunk-tewhms9w.js";import{join as $J}from"path";import{createServer as zJ}from"vite";import{join as l}from"path";import{IncomingMessage as d,ServerResponse as p}from"http";import{Socket as i}from"net";function v(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((W)=>W.trim()).filter((W)=>W.length>0).join(`
|
|
5
5
|
`).trim()}function D(J){return`
|
|
@@ -53,6 +53,6 @@ RefreshRuntime.injectIntoGlobalHook(window);
|
|
|
53
53
|
window.$RefreshReg$ = () => {};
|
|
54
54
|
window.$RefreshSig$ = () => (type) => type;
|
|
55
55
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
56
|
-
`;function t(J){let{pathname:W}=new URL(J.url),Z=($)=>new Response($,{headers:{"Content-Type":"application/javascript"}});if(W===S)return Z(s);if(W.startsWith("/render-error.js"))return Z("window.render_error = true");if(W.startsWith("/refresh.js"))return Z(a);return null}function k(J,W,Z){let $=l(process.cwd(),"app");return async(Q)=>{let{pathname:X}=new URL(Q.url),Y=(z)=>{if(console.error(z),Z.ssrFixStacktrace?.(z),O(z),
|
|
56
|
+
`;function t(J){let{pathname:W}=new URL(J.url),Z=($)=>new Response($,{headers:{"Content-Type":"application/javascript"}});if(W===S)return Z(s);if(W.startsWith("/render-error.js"))return Z("window.render_error = true");if(W.startsWith("/refresh.js"))return Z(a);return null}function k(J,W,Z){let $=l(process.cwd(),"app");return async(Q)=>{let{pathname:X}=new URL(Q.url),Y=(z)=>{if(console.error(z),Z.ssrFixStacktrace?.(z),O(z),N(X))return new Response(JSON.stringify({error:_("server_error",z?.message??String(z),500)}),{status:500,headers:{"Content-Type":"application/json"}});return globalThis.__gemiErrorPageServed=!0,new Response(D(H(z)),{status:500,headers:{"Content-Type":"text/html"}})},G=async(z)=>{let U=t(z);if(U)return U;try{let B=J.fetch.bind(J),K=await n(Z,z)??await B(z);if(K instanceof Response)return K;let j={},b={},M={},c=(L,A)=>`"${L}": () => import("${A}")`,F=[];for(let L of["404",...J.getFlatComponentTree.call(J)]){if(Bun.env.NODE_ENV==="test")break;let A=`${process.env.APP_DIR}`,x=await I(Z).import(`${A}/views/${L}.tsx`);j[L]=x.default,b[L]=x?.OpenGraph,M[L]=x,F.push(c(L,`/app/views/${L}.tsx`))}let u=`{${F.join(",")}}`;return await K({getStyles:async(L,A)=>await C($,Z,L,A?.layout),resolveIsland:(L)=>({src:`/${L}${y}`,preload:[]}),buildId:"dev",bootstrapModules:[S],viewImportMap:j,viewModules:M,ogMap:b,loaders:u,cssManifest:{}})}catch(B){return Y(B)}};return await W(Q,(z)=>J.withGlobalMiddleware(z,G,Y))}}function r(J){try{return Bun.listen({hostname:"0.0.0.0",port:J,socket:{data(){}}}).stop(!0),!0}catch(W){return W?.code!=="EADDRINUSE"}}function T(J,W=r){let Z=24678+(J-5173);if(Z>65471)Z=24678;for(let $=Z;$<Z+64;$++)if(W($))return $;throw Error(`Could not find a free port for Vite's HMR websocket: tried ${Z}-${Z+64-1}. Set one explicitly in gemi.config.ts as \`vite: { server: { ws: { port } } }\`.`)}import{createServer as e}from"http";var JJ=new Set(["vite-hmr","vite-ping"]);async function P(J){let W=e((Z,$)=>{$.writeHead(426,{"Content-Type":"text/plain"}),$.end("Upgrade Required")});return await new Promise((Z,$)=>{W.once("error",$),W.listen(J,"127.0.0.1",()=>{W.off("error",$),Z()})}),W}function f(J){if(!J||typeof J!=="object")return null;let Z=J.server?.address?.();if(Z&&typeof Z==="object"&&"port"in Z)return Number(Z.port)||null;return null}function R(J){if(J.headers.get("upgrade")?.toLowerCase()!=="websocket")return!1;return JJ.has(J.headers.get("sec-websocket-protocol")??"")}var WJ=(J)=>typeof J==="string"?J:new Uint8Array(J);async function g(J,W,Z){let $=new URL(J.url),Q=J.headers.get("sec-websocket-protocol")??"vite-hmr",X={host:J.headers.get("host")??$.host},Y=J.headers.get("origin");if(Y)X.origin=Y;let G=new WebSocket(`ws://127.0.0.1:${Z}${$.pathname}${$.search}`,{protocols:[Q],headers:X});G.binaryType="arraybuffer";let z={upstream:G,early:[]};if(G.onmessage=(K)=>{let j=WJ(K.data);if(z.browser)z.browser.send(j);else z.early.push(j)},G.onclose=(K)=>{z.browser?.close(ZJ(K.code),K.reason)},G.onerror=()=>{},!await new Promise((K)=>{G.addEventListener("open",()=>K(!0),{once:!0}),G.addEventListener("close",()=>K(!1),{once:!0})}))return new Response("Vite refused the HMR websocket",{status:403});if(!W.upgrade(J,{headers:{"Sec-WebSocket-Protocol":Q},data:z}))return G.close(),new Response("WebSocket upgrade failed",{status:400});return}function ZJ(J){if(J===1000||J>=1001&&J<=1003||J>=1007&&J<=1014)return J;if(J>=3000&&J<=4999)return J;return 1000}var E={open(J){let W=J.data;for(let Z of W.early)J.send(Z);if(W.early=[],W.browser=J,W.upstream.readyState!==WebSocket.OPEN)J.close(1000)},message(J,W){if(J.data.upstream.readyState===WebSocket.OPEN)J.data.upstream.send(W)},close(J){let{upstream:W}=J.data;if(W.readyState<=WebSocket.OPEN)W.close()}};var V=process.cwd(),GJ=$J(V,"app");if(!globalThis.__gemiErrorHooked)globalThis.__gemiErrorHooked=!0,process.on("unhandledRejection",(J)=>{console.error(J),O(J)}),process.on("uncaughtException",(J)=>{console.error(J),O(J)});async function SJ(J,W){let Z=Number(process.env.PORT)||5173,$=m(),Q=Boolean(globalThis.__gemiVite),X=globalThis.__gemiVite??=await zJ({configFile:!1,plugins:[q()],server:{middlewareMode:!0,port:Z,ws:{server:await P(T(Z))},allowedHosts:J.devAllowedHosts.call(J),watch:{ignored:(U)=>{let B=U.split(/[/\\]/).pop()??"";return B===".env"||B.startsWith(".env.")}}},appType:"custom",resolve:{dedupe:["react","react-dom"]},optimizeDeps:{include:["react","react-dom","react-dom/client"]},ssr:{external:[...w]}});process.env.ROOT_DIR=V,process.env.APP_DIR=GJ;let Y=k(J,W,X),G=f(X.config?.server?.ws),z=Bun.serve({port:Z,idleTimeout:$,fetch:(U,B)=>{if(G!==null&&R(U))return g(U,B,G);return Y(U)},websocket:E});if(Q)I(X).clearCache();if(Q)if(globalThis.__gemiErrorActive&&globalThis.__gemiErrorPageServed)globalThis.__gemiErrorActive=!1,globalThis.__gemiErrorPageServed=!1,X.ws.send({type:"full-reload"});else globalThis.__gemiErrorActive=!1,X.ws.send({type:"custom",event:"http-reload"});else h({port:z.port,rootDir:V});return z}export{H as viteErrorPayload,SJ as httpDev};
|
|
57
57
|
|
|
58
|
-
//# debugId=
|
|
58
|
+
//# debugId=DD235AA05CAC380F64756E2164756E21
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sources": ["../server/httpDev.ts", "../server/devFetch.ts", "../server/renderErrorPage.ts", "../server/hmrPort.ts", "../server/hmrRelay.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { join } from \"node:path\";\n\nimport { createServer } from \"vite\";\n\nimport { App } from \"../app\";\nimport gemiVite from \"../vite\";\nimport { Instrumentation } from \"./types\";\nimport { printStartupBanner } from \"./banner\";\nimport { GEMI_EXTERNAL_SPECIFIERS } from \"../internal/gemiExternals\";\nimport { createDevFetch, sendErrorToClient, ssrRunner } from \"./devFetch\";\nimport { resolveHmrPort } from \"./hmrPort\";\nimport { serverIdleTimeout } from \"./idleTimeout\";\nimport {\n type HmrRelayData,\n hmrRelayHandler,\n hmrRelayPort,\n isHmrUpgrade,\n listenHmrServer,\n upgradeHmr,\n} from \"./hmrRelay\";\n\nexport { viteErrorPayload } from \"./devFetch\";\n\nconst rootDir = process.cwd();\nconst appDir = join(rootDir, \"app\");\n\n// `bun --hot` re-evaluates the module graph on every server-code change. A\n// syntax error or top-level throw in app code therefore fails during *module\n// load* — outside any request, and before `httpDev` re-runs — so Bun only\n// prints it to the console. Bun surfaces these as `unhandledRejection` (the\n// reload re-imports the entry and the failing dynamic import rejects), so hook\n// that here and forward it to the client. Registered once; process listeners\n// persist across reloads.\nif (!globalThis.__gemiErrorHooked) {\n globalThis.__gemiErrorHooked = true;\n process.on(\"unhandledRejection\", (reason) => {\n console.error(reason);\n sendErrorToClient(reason);\n });\n process.on(\"uncaughtException\", (err) => {\n console.error(err);\n sendErrorToClient(err);\n });\n}\n\nexport async function httpDev(app: App, instrumentation: Instrumentation) {\n // Same override the prod server honors (`httpProd.ts`). Read here rather than\n // inline at `Bun.serve` because the HMR port is derived from it.\n const httpPort = Number(process.env.PORT) || 5173;\n // The same `SERVER_IDLE_TIMEOUT` `gemi start` honours (#787), so a long-poll\n // that works in production is not cut at Bun's 10s here. Read before Vite\n // starts so a bad value fails the boot first. Upgraded sockets, the HMR relay\n // among them, are not subject to it.\n const idleTimeout = serverIdleTimeout();\n\n // `bun --hot` re-runs this module on every server-code change, so keep a\n // single Vite server on `globalThis` instead of spawning a new one (and a new\n // HMR socket) on each reload.\n const isReload = Boolean(globalThis.__gemiVite);\n const vite = (globalThis.__gemiVite ??= await createServer({\n // gemi owns the Vite setup — the app has no `vite.config.mjs` to discover.\n // Register the gemi plugin explicitly instead; it loads `gemi.config.ts` and\n // appends the app's Vite plugins (e.g. `@vitejs/plugin-react`, which serves\n // `/@react-refresh` and the HMR preamble referenced below).\n configFile: false,\n plugins: [gemiVite()],\n server: {\n middlewareMode: true,\n // The page's own port, so the HMR client's fallback (\"direct\") socket\n // also targets this server rather than Vite's default 5173.\n port: httpPort,\n // In middleware mode Vite would stand up a second HTTP server for the HMR\n // websocket on a fixed port — so two `gemi dev` processes fought over one\n // socket, and a proxy or tunnel, which carries only the page's port,\n // could not reach it at all. Hand Vite a loopback server instead, on a\n // port of this process's own (see `hmrPort.ts` for how it is chosen):\n // given a server, Vite tells the browser to connect to the page's origin,\n // and `Bun.serve` below relays that socket to it (see `hmrRelay.ts`).\n // `ws` and not the older `hmr`: `server.hmr.{port,host,…}` is\n // deprecated in Vite 8 and warns. An app overriding either one in\n // `gemi.config.ts` still wins — plugin config (where `gemi.config.ts`'s\n // `vite` block is applied) is merged over this inline config, and Vite's\n // own `hmr`→`ws` compat shim forwards the deprecated spelling here.\n ws: { server: await listenHmrServer(resolveHmrPort(httpPort)) },\n // Vite answers any host other than `localhost` and `*.localhost` with a\n // 403, which would block a `route.domains` root such as `lvh.me` and\n // every custom domain pointed here from `/etc/hosts`.\n allowedHosts: app.devAllowedHosts.call(app),\n // gemi reloads `.env` into process.env itself (see `watchEnv`). Stop Vite\n // from *also* watching env files: Vite's env-change handler restarts the\n // dev server, which closes the SSR module runner — but gemi keeps a single\n // Vite instance across `bun --hot` reloads, so an in-flight view import\n // hits the closed runner (\"Vite module runner has been closed\"). Ignoring\n // env files here only disables the restart; env *loading* at startup (and\n // `import.meta.env`) is unaffected.\n watch: {\n ignored: (file: string) => {\n const base = file.split(/[/\\\\]/).pop() ?? \"\";\n return base === \".env\" || base.startsWith(\".env.\");\n },\n },\n },\n appType: \"custom\",\n // Views are loaded through this SSR graph while the renderer\n // (react-dom/server in ViewRouteDispatcher) is imported by Bun.\n // Dedupe so Vite can never resolve a second React copy — a mismatch makes\n // the SSR dispatcher null (\"Invalid hook call\") after an HMR reload.\n resolve: { dedupe: [\"react\", \"react-dom\"] },\n // Pre-bundle the whole React surface the client uses in one pass. The client\n // imports `react-dom/client` (`init.tsx`) and `react-dom` (`createPortal` in\n // `HttpReload.tsx`); if only the first is discovered at startup, the first\n // request to a module using the second triggers a *second* optimize pass,\n // and the already-served page ends up importing a now-stale dep — surfacing\n // as \"does not provide an export named 't'\". Listing them up front bundles\n // them together so no re-optimization (and no version skew) happens.\n optimizeDeps: { include: [\"react\", \"react-dom\", \"react-dom/client\"] },\n // `gemi` is a linked package, so Vite would otherwise compile its own copy\n // into this graph — giving views a *different* `RouteStateContext` (and\n // other module-level singletons) than the Bun-loaded renderer's `Root`\n // provider, so `useRouteData()` reads the empty default (`i18n` undefined).\n // Externalizing makes view imports of `gemi/*` resolve to the one Bun\n // instance. Vite's `ssr.external` matches exact specifiers (subpaths are NOT\n // covered by the bare name, and regexes are ignored here), so every subpath\n // a view might import must be listed — see `internal/gemiExternals`, the\n // shared source of truth this and the SSR build (`vite/index.ts`) both use.\n ssr: {\n external: [...GEMI_EXTERNAL_SPECIFIERS],\n },\n }));\n\n process.env.ROOT_DIR = rootDir;\n process.env.APP_DIR = appDir;\n\n const devFetch = createDevFetch(app, instrumentation, vite);\n // `null` when an app's own `server.ws` in `gemi.config.ts` sent Vite's\n // websocket elsewhere; the browser then connects there directly.\n const relayPort = hmrRelayPort(vite.config?.server?.ws);\n const server = Bun.serve<HmrRelayData>({\n port: httpPort,\n idleTimeout,\n fetch: (req, server) => {\n if (relayPort !== null && isHmrUpgrade(req)) {\n return upgradeHmr(req, server, relayPort);\n }\n return devFetch(req);\n },\n websocket: hmrRelayHandler,\n });\n\n // `bun --hot` re-evaluates its *whole* module graph on a server-code change —\n // node_modules included — so after a reload `react`, `react-dom/server` and the\n // Bun-loaded `gemi` are all fresh instances. This Vite server is not reloaded\n // with them (it is deliberately kept on `globalThis` above), and its SSR runner\n // still holds every view module it has evaluated — each bound, through the\n // externalized `gemi/*` imports, to the *previous* `gemi` and therefore the\n // previous `react`. The next render then sets the dispatcher on the new React\n // while a cached view calls hooks on the old one: \"Invalid hook call\", a null\n // `dispatcher.useContext` thrown from `useRouteData` inside a view nobody\n // touched. Editing a *view* never showed it — Vite's own watcher invalidates\n // that module, so it re-evaluates against the new instances. Editing a\n // server-only file (`app/config/*`, a feature declaration, a controller) is\n // the case with nothing to invalidate the views, so drop the evaluated\n // modules here, once per reload.\n //\n // Here and not before `Bun.serve`, with nothing awaited in between, because\n // both sides of the swap have to see a consistent pair. Until that call\n // returns the *previous* fetch handler is still serving — old dispatcher, old\n // `react-dom/server` — and a request landing there after an early clear would\n // re-evaluate its views against the *new* `gemi`: the same mismatch, reversed.\n // After it, the new handler is live and must not be given the stale ones. The\n // two statements are synchronous neighbours, so no request can be dispatched\n // between them.\n //\n // Only the *evaluated* modules go: the server-side transform cache is\n // untouched, so this costs a re-evaluation and not a re-transform. Clearing\n // the module graph as well would not have been enough anyway — externalized\n // deps (`gemi`, and React through it) are cached in the runner by URL and\n // carry no invalidation flag, which is exactly where the stale React hides.\n if (isReload) {\n ssrRunner(vite).clearCache();\n }\n\n // On a reload `app` has already been rebuilt with the new code and Bun.serve\n // above has swapped in the new fetch handler, so the updated controllers are\n // live *now*. Tell the client to re-run its queries only at this point —\n // firing it from Vite's file watcher instead races Bun's reload and leaves\n // the UI one change behind.\n if (isReload) {\n // We got here, so the reload succeeded. Recover from any error that was\n // showing: a standalone error page must be fully reloaded to get the app\n // back, whereas an overlay pushed onto a live page is cleared by the\n // client's `http-reload` handler (no jarring full-page reload). A normal\n // reload just re-runs client queries against the now-live controllers.\n if (globalThis.__gemiErrorActive && globalThis.__gemiErrorPageServed) {\n globalThis.__gemiErrorActive = false;\n globalThis.__gemiErrorPageServed = false;\n vite.ws.send({ type: \"full-reload\" });\n } else {\n globalThis.__gemiErrorActive = false;\n vite.ws.send({ type: \"custom\", event: \"http-reload\" });\n }\n } else {\n // First start (not a `bun --hot` reload) — print the startup banner once.\n printStartupBanner({ port: server.port, rootDir });\n }\n\n return server;\n}\n",
|
|
6
|
-
"import { stringEraRefusal } from \"../http/Error\";\nimport { join } from \"node:path\";\nimport { IncomingMessage, ServerResponse } from \"node:http\";\nimport { Socket } from \"node:net\";\n\nimport type { RunnableDevEnvironment, ViteDevServer } from \"vite\";\n\nimport type { App } from \"../app\";\nimport { isApiPath } from \"../services/router/apiPath\";\nimport { renderErrorPage } from \"./renderErrorPage\";\nimport { createDevStyles } from \"./styles\";\nimport type { Instrumentation } from \"./types\";\nimport { ISLAND_ENTRY_QUERY } from \"../internal/islandRuntime\";\n\n// Run a Web `Request` through Vite's Connect middleware.\n// Resolves to a `Response` when Vite handles the request (module transforms,\n// assets, the HMR client, ...), or `null` when it calls `next()` — which, with\n// `appType: \"custom\"`, it does for everything it doesn't own.\nfunction viteMiddleware(vite: ViteDevServer, request: Request): Promise<Response | null> {\n const url = new URL(request.url);\n\n const req = new IncomingMessage(new Socket());\n req.url = url.pathname + url.search;\n req.method = request.method;\n req.headers = Object.fromEntries(request.headers);\n\n const res = new ServerResponse(req);\n const chunks: Buffer[] = [];\n\n return new Promise((resolve) => {\n res.write = ((chunk: any) => {\n if (chunk) chunks.push(Buffer.from(chunk));\n return true;\n }) as typeof res.write;\n\n res.end = ((chunk?: any) => {\n if (chunk && typeof chunk !== \"function\") chunks.push(Buffer.from(chunk));\n\n const headers = new Headers();\n for (const [key, value] of Object.entries(res.getHeaders())) {\n if (value == null) continue;\n for (const v of Array.isArray(value) ? value : [value]) {\n headers.append(key, String(v));\n }\n }\n\n resolve(\n new Response(chunks.length ? Buffer.concat(chunks) : null, {\n status: res.statusCode,\n headers,\n }),\n );\n return res;\n }) as typeof res.end;\n\n vite.middlewares(req, res, () => resolve(null));\n });\n}\n\ndeclare global {\n // Created once and reused across `bun --hot` reloads (see below).\n var __gemiVite: ViteDevServer | undefined;\n // Guards one-time registration of the process error hooks across reloads.\n var __gemiErrorHooked: boolean | undefined;\n // An error overlay is currently showing on the client (clear it on recovery).\n var __gemiErrorActive: boolean | undefined;\n // We served a standalone error *page* (not just a pushed overlay), so the\n // visible document has no live app — recovery needs a full page reload.\n var __gemiErrorPageServed: boolean | undefined;\n}\n\n// Build the `> 1 | ...\\n | ^` codeframe Vite's overlay renders — must\n// match its `codeframeRE` (a `<line> | <text>` line followed by a `| ^` line,\n// each ending in a newline).\nfunction codeFrame(lineText: string, line: number, column: number) {\n const gutter = String(line);\n const pad = \" \".repeat(gutter.length);\n const caret = \" \".repeat(Math.max(0, column - 1)) + \"^\";\n return `${gutter} | ${lineText}\\n${pad} | ${caret}\\n`;\n}\n\n// Normalize whatever Bun/JS throws into the { message, stack, frame, loc }\n// shape Vite's error overlay consumes. Two cases matter:\n// - a real `Error` (runtime top-level throw) carries a proper `.stack`;\n// - a Bun `BuildMessage` (syntax error) has NO `.stack`, only a `.position`\n// ({ file, line, column, lineText }) — so synthesize a codeframe + loc from\n// it, otherwise the overlay shows a bare message with no location.\n// (An `Error` instance also JSON-stringifies to `{}`, so fields are copied by\n// hand either way.)\nexport function viteErrorPayload(err: any) {\n if (err && typeof err === \"object\") {\n const pos = err.position;\n if (pos && typeof pos === \"object\" && typeof pos.file === \"string\") {\n return {\n message: typeof err.message === \"string\" ? err.message : String(err),\n stack: \"\",\n frame:\n typeof pos.lineText === \"string\"\n ? codeFrame(pos.lineText, pos.line, pos.column)\n : undefined,\n loc: { file: pos.file, line: pos.line, column: pos.column },\n };\n }\n return {\n message: typeof err.message === \"string\" ? err.message : String(err),\n stack: typeof err.stack === \"string\" ? err.stack : \"\",\n };\n }\n return { message: String(err), stack: \"\" };\n}\n\n// Push an error into the browser via Vite's HMR socket. `__gemiVite` persists\n// across `bun --hot` reloads, so this works even when the reload that produced\n// the error never got far enough to (re)run `httpDev`.\nexport function sendErrorToClient(err: any) {\n const vite = globalThis.__gemiVite;\n if (!vite) return;\n vite.ws.send({ type: \"error\", err: viteErrorPayload(err) as any });\n globalThis.__gemiErrorActive = true;\n}\n\n/**\n * The SSR environment's module runner — what `vite.ssrLoadModule` is a thin\n * (and, in Vite 8, deprecated) wrapper over. Going through it directly is what\n * gives `httpDev` a handle on the evaluated-module cache it has to drop after a\n * `bun --hot` reload; `ssrLoadModule` keeps its own runner private.\n *\n * Duck-typed rather than `isRunnableDevEnvironment(environment)`: this server\n * outlives the module instance that created it, and after a reload the freshly\n * evaluated `vite` brings a *new* `RunnableDevEnvironment` class object, so the\n * `instanceof` that predicate performs is false for a perfectly runnable\n * environment. (The same one-copy-per-reload rule this whole dance is about.)\n */\nexport function ssrRunner(vite: ViteDevServer) {\n const environment = vite.environments.ssr as RunnableDevEnvironment;\n if (typeof environment?.runner?.import !== \"function\") {\n throw new Error(\"gemi dev requires a runnable Vite SSR environment.\");\n }\n return environment.runner;\n}\n\n/**\n * The dev document's single bootstrap module. It loads, in this order:\n *\n * 1. `/refresh.js` — the React Refresh preamble;\n * 2. `/@vite/client` — the HMR client;\n * 3. `/app/client.tsx` — the app.\n *\n * One module, because React emits every `bootstrapModules` entry as\n * `<script type=\"module\" async>`, and async module scripts run in whatever\n * order they finish loading. The preamble has to have installed\n * `window.$RefreshReg$` before any component module evaluates, or\n * `@vitejs/plugin-react`'s transform throws \"can't detect preamble\" and the\n * app never hydrates. Awaiting each `import()` is what makes the order a\n * guarantee rather than a race.\n *\n * The preamble and the HMR client are each caught: an app without\n * `@vitejs/plugin-react` has no `/@react-refresh` and needs no preamble, and a\n * broken HMR client must not stop the app from booting. The app's own import\n * is not caught, so its errors surface as they would from a script tag.\n */\nexport const DEV_ENTRY_PATH = \"/@gemi/dev-entry.js\";\n\nexport const DEV_ENTRY_SOURCE = `const report = (error) => console.error(error);\nawait import(\"/refresh.js\").catch(report);\nawait import(\"/@vite/client\").catch(report);\nawait import(\"/app/client.tsx\");\n`;\n\n/**\n * Installs the React Refresh preamble, as `@vitejs/plugin-react`'s own\n * `index.html` transform would.\n *\n * The runtime is imported by an origin-relative URL. An absolute one, built\n * from the request URL the server sees, breaks behind a TLS-terminating proxy\n * or tunnel: the browser is on `https://<tunnel>` while the server sees\n * `http://localhost:5173`, so the import is blocked as mixed content or points\n * at a host the browser cannot reach.\n */\nexport const REFRESH_PREAMBLE_SOURCE = `import RefreshRuntime from \"/@react-refresh\";\nRefreshRuntime.injectIntoGlobalHook(window);\nwindow.$RefreshReg$ = () => {};\nwindow.$RefreshSig$ = () => (type) => type;\nwindow.__vite_plugin_react_preamble_installed__ = true;\n`;\n\n/**\n * The scripts the dev document loads that nothing on disk backs: the\n * bootstrap entry above, `/refresh.js` with the React Refresh preamble, and\n * `/render-error.js`, which the dev error page loads. `null` for any other\n * path.\n *\n * Answered inside the global middleware, not in front of it as they were. They\n * have no production counterpart, but a gate that must hold in dev as well,\n * one that refuses traffic without a header, is only complete if nothing the\n * dev server answers goes around it.\n */\nfunction devScript(req: Request): Response | null {\n const { pathname } = new URL(req.url);\n const script = (source: string) =>\n new Response(source, {\n headers: {\n \"Content-Type\": \"application/javascript\",\n },\n });\n if (pathname === DEV_ENTRY_PATH) {\n return script(DEV_ENTRY_SOURCE);\n }\n if (pathname.startsWith(\"/render-error.js\")) {\n return script(\"window.render_error = true\");\n }\n if (pathname.startsWith(\"/refresh.js\")) {\n return script(REFRESH_PREAMBLE_SOURCE);\n }\n return null;\n}\n\n/**\n * The dev server's `fetch` handler, apart from `Bun.serve` and from creating\n * Vite, so a test can hand it a stub Vite server and drive it with plain\n * `Request`s. `httpDev` is the only other caller. This module has no import\n * side effects, unlike `httpDev.ts`, which installs process-wide error hooks.\n */\nexport function createDevFetch(\n app: App,\n instrumentation: Instrumentation,\n vite: ViteDevServer,\n): (req: Request) => Promise<Response> {\n const appDir = join(process.cwd(), \"app\");\n\n return async (req) => {\n const { pathname } = new URL(req.url);\n const errorResponse = (err: any): Response => {\n // Errors thrown *while handling a request* (a controller throwing, a\n // failing view import, ...) never hit `httpDev`'s module-load hooks,\n // so surface them here: forward to the overlay for any already-open\n // page, and render an error page for this response so a fresh load\n // (which has no live HMR socket yet) still shows the failure.\n console.error(err);\n vite.ssrFixStacktrace?.(err);\n sendErrorToClient(err);\n\n if (isApiPath(pathname)) {\n return new Response(\n JSON.stringify({\n error: stringEraRefusal(\"server_error\", err?.message ?? String(err), 500),\n }),\n {\n status: 500,\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n }\n\n // This document has no live app (so no HttpReload listener to clear the\n // overlay) — remember that, so recovery forces a full page reload.\n globalThis.__gemiErrorPageServed = true;\n return new Response(renderErrorPage(viteErrorPayload(err)), {\n status: 500,\n headers: { \"Content-Type\": \"text/html\" },\n });\n };\n const requestHandler = async (req: Request): Promise<Response> => {\n const script = devScript(req);\n if (script) {\n return script;\n }\n try {\n const handler = app.fetch.bind(app);\n const result = (await viteMiddleware(vite, req)) ?? (await handler(req));\n if (result instanceof Response) {\n return result;\n }\n\n const viewImportMap = {};\n const ogMap = {};\n const viewModules = {};\n const template = (viewName: string, path: string) =>\n `\"${viewName}\": () => import(\"${path}\")`;\n const templates = [];\n\n for (const fileName of [\"404\", ...app.getFlatComponentTree.call(app)]) {\n if (process.env.NODE_ENV === \"test\") {\n break;\n }\n const appDir = `${process.env.APP_DIR}`;\n const mod = await ssrRunner(vite).import(`${appDir}/views/${fileName}.tsx`);\n\n viewImportMap[fileName] = mod.default;\n ogMap[fileName] = mod?.OpenGraph;\n // The whole module, so a streaming render can put the view's\n // `Loading`/`Error` exports into the shell it sends.\n viewModules[fileName] = mod;\n // Emit a root-relative URL (`/app/views/Foo.tsx`), NOT the absolute\n // filesystem path the runner import above uses. The browser's\n // `window.loaders` preload and `client.tsx`'s `import.meta.glob` map\n // must import the exact same URL — otherwise Vite serves the module\n // under two URLs (`/app/views/Foo.tsx` vs `/Users/.../app/views/Foo.tsx`)\n // and loads/instantiates the view twice.\n templates.push(template(fileName, `/app/views/${fileName}.tsx`));\n }\n\n const loaders = `{${templates.join(\",\")}}`;\n\n return await result({\n getStyles: async (currentViews: string[], options?: { static?: boolean; layout?: string }) =>\n await createDevStyles(appDir, vite, currentViews, options?.layout),\n // Vite serves app files by their root-relative path; the island\n // entry is that path plus the plugin's query.\n resolveIsland: (moduleKey: string) => ({\n src: `/${moduleKey}${ISLAND_ENTRY_QUERY}`,\n preload: [],\n }),\n bootstrapModules: [DEV_ENTRY_PATH],\n viewImportMap,\n viewModules,\n ogMap,\n loaders,\n cssManifest: {},\n });\n } catch (err: any) {\n return errorResponse(err);\n }\n };\n\n // In front of Vite's middleware, the dev scripts and the app, as\n // `httpProd` puts the global middleware in front of its static files, so a\n // check that passes here passes there. A throw from it is answered like\n // one from a route. Vite's HMR websocket is the one thing it cannot cover:\n // its upgrade is relayed to Vite by `Bun.serve` (see `hmrRelay.ts`) before\n // this handler runs, and Vite checks the token and host itself.\n return await instrumentation(req, (req) =>\n app.withGlobalMiddleware(req, requestHandler, errorResponse),\n );\n };\n}\n",
|
|
6
|
+
"import { stringEraRefusal } from \"../http/Error\";\nimport { join } from \"node:path\";\nimport { IncomingMessage, ServerResponse } from \"node:http\";\nimport { Socket } from \"node:net\";\n\nimport type { RunnableDevEnvironment, ViteDevServer } from \"vite\";\n\nimport type { App } from \"../app\";\nimport { isApiPath } from \"../services/router/apiPath\";\nimport { renderErrorPage } from \"./renderErrorPage\";\nimport { createDevStyles } from \"./styles\";\nimport type { Instrumentation } from \"./types\";\nimport { ISLAND_ENTRY_QUERY } from \"../internal/islandRuntime\";\n\n// Run a Web `Request` through Vite's Connect middleware.\n// Resolves to a `Response` when Vite handles the request (module transforms,\n// assets, the HMR client, ...), or `null` when it calls `next()` — which, with\n// `appType: \"custom\"`, it does for everything it doesn't own.\nfunction viteMiddleware(vite: ViteDevServer, request: Request): Promise<Response | null> {\n const url = new URL(request.url);\n\n const req = new IncomingMessage(new Socket());\n req.url = url.pathname + url.search;\n req.method = request.method;\n req.headers = Object.fromEntries(request.headers);\n\n const res = new ServerResponse(req);\n const chunks: Buffer[] = [];\n\n return new Promise((resolve) => {\n res.write = ((chunk: any) => {\n if (chunk) chunks.push(Buffer.from(chunk));\n return true;\n }) as typeof res.write;\n\n res.end = ((chunk?: any) => {\n if (chunk && typeof chunk !== \"function\") chunks.push(Buffer.from(chunk));\n\n const headers = new Headers();\n for (const [key, value] of Object.entries(res.getHeaders())) {\n if (value == null) continue;\n for (const v of Array.isArray(value) ? value : [value]) {\n headers.append(key, String(v));\n }\n }\n\n resolve(\n new Response(chunks.length ? Buffer.concat(chunks) : null, {\n status: res.statusCode,\n headers,\n }),\n );\n return res;\n }) as typeof res.end;\n\n vite.middlewares(req, res, () => resolve(null));\n });\n}\n\ndeclare global {\n // Created once and reused across `bun --hot` reloads (see below).\n var __gemiVite: ViteDevServer | undefined;\n // Guards one-time registration of the process error hooks across reloads.\n var __gemiErrorHooked: boolean | undefined;\n // An error overlay is currently showing on the client (clear it on recovery).\n var __gemiErrorActive: boolean | undefined;\n // We served a standalone error *page* (not just a pushed overlay), so the\n // visible document has no live app — recovery needs a full page reload.\n var __gemiErrorPageServed: boolean | undefined;\n}\n\n// Build the `> 1 | ...\\n | ^` codeframe Vite's overlay renders — must\n// match its `codeframeRE` (a `<line> | <text>` line followed by a `| ^` line,\n// each ending in a newline).\nfunction codeFrame(lineText: string, line: number, column: number) {\n const gutter = String(line);\n const pad = \" \".repeat(gutter.length);\n const caret = \" \".repeat(Math.max(0, column - 1)) + \"^\";\n return `${gutter} | ${lineText}\\n${pad} | ${caret}\\n`;\n}\n\n// Normalize whatever Bun/JS throws into the { message, stack, frame, loc }\n// shape Vite's error overlay consumes. Two cases matter:\n// - a real `Error` (runtime top-level throw) carries a proper `.stack`;\n// - a Bun `BuildMessage` (syntax error) has NO `.stack`, only a `.position`\n// ({ file, line, column, lineText }) — so synthesize a codeframe + loc from\n// it, otherwise the overlay shows a bare message with no location.\n// (An `Error` instance also JSON-stringifies to `{}`, so fields are copied by\n// hand either way.)\nexport function viteErrorPayload(err: any) {\n if (err && typeof err === \"object\") {\n const pos = err.position;\n if (pos && typeof pos === \"object\" && typeof pos.file === \"string\") {\n return {\n message: typeof err.message === \"string\" ? err.message : String(err),\n stack: \"\",\n frame:\n typeof pos.lineText === \"string\"\n ? codeFrame(pos.lineText, pos.line, pos.column)\n : undefined,\n loc: { file: pos.file, line: pos.line, column: pos.column },\n };\n }\n return {\n message: typeof err.message === \"string\" ? err.message : String(err),\n stack: typeof err.stack === \"string\" ? err.stack : \"\",\n };\n }\n return { message: String(err), stack: \"\" };\n}\n\n// Push an error into the browser via Vite's HMR socket. `__gemiVite` persists\n// across `bun --hot` reloads, so this works even when the reload that produced\n// the error never got far enough to (re)run `httpDev`.\nexport function sendErrorToClient(err: any) {\n const vite = globalThis.__gemiVite;\n if (!vite) return;\n vite.ws.send({ type: \"error\", err: viteErrorPayload(err) as any });\n globalThis.__gemiErrorActive = true;\n}\n\n/**\n * The SSR environment's module runner — what `vite.ssrLoadModule` is a thin\n * (and, in Vite 8, deprecated) wrapper over. Going through it directly is what\n * gives `httpDev` a handle on the evaluated-module cache it has to drop after a\n * `bun --hot` reload; `ssrLoadModule` keeps its own runner private.\n *\n * Duck-typed rather than `isRunnableDevEnvironment(environment)`: this server\n * outlives the module instance that created it, and after a reload the freshly\n * evaluated `vite` brings a *new* `RunnableDevEnvironment` class object, so the\n * `instanceof` that predicate performs is false for a perfectly runnable\n * environment. (The same one-copy-per-reload rule this whole dance is about.)\n */\nexport function ssrRunner(vite: ViteDevServer) {\n const environment = vite.environments.ssr as RunnableDevEnvironment;\n if (typeof environment?.runner?.import !== \"function\") {\n throw new Error(\"gemi dev requires a runnable Vite SSR environment.\");\n }\n return environment.runner;\n}\n\n/**\n * The dev document's single bootstrap module. It loads, in this order:\n *\n * 1. `/refresh.js` — the React Refresh preamble;\n * 2. `/@vite/client` — the HMR client;\n * 3. `/app/client.tsx` — the app.\n *\n * One module, because React emits every `bootstrapModules` entry as\n * `<script type=\"module\" async>`, and async module scripts run in whatever\n * order they finish loading. The preamble has to have installed\n * `window.$RefreshReg$` before any component module evaluates, or\n * `@vitejs/plugin-react`'s transform throws \"can't detect preamble\" and the\n * app never hydrates. Awaiting each `import()` is what makes the order a\n * guarantee rather than a race.\n *\n * The preamble and the HMR client are each caught: an app without\n * `@vitejs/plugin-react` has no `/@react-refresh` and needs no preamble, and a\n * broken HMR client must not stop the app from booting. The app's own import\n * is not caught, so its errors surface as they would from a script tag.\n */\nexport const DEV_ENTRY_PATH = \"/@gemi/dev-entry.js\";\n\nexport const DEV_ENTRY_SOURCE = `const report = (error) => console.error(error);\nawait import(\"/refresh.js\").catch(report);\nawait import(\"/@vite/client\").catch(report);\nawait import(\"/app/client.tsx\");\n`;\n\n/**\n * Installs the React Refresh preamble, as `@vitejs/plugin-react`'s own\n * `index.html` transform would.\n *\n * The runtime is imported by an origin-relative URL. An absolute one, built\n * from the request URL the server sees, breaks behind a TLS-terminating proxy\n * or tunnel: the browser is on `https://<tunnel>` while the server sees\n * `http://localhost:5173`, so the import is blocked as mixed content or points\n * at a host the browser cannot reach.\n */\nexport const REFRESH_PREAMBLE_SOURCE = `import RefreshRuntime from \"/@react-refresh\";\nRefreshRuntime.injectIntoGlobalHook(window);\nwindow.$RefreshReg$ = () => {};\nwindow.$RefreshSig$ = () => (type) => type;\nwindow.__vite_plugin_react_preamble_installed__ = true;\n`;\n\n/**\n * The scripts the dev document loads that nothing on disk backs: the\n * bootstrap entry above, `/refresh.js` with the React Refresh preamble, and\n * `/render-error.js`, which the dev error page loads. `null` for any other\n * path.\n *\n * Answered inside the global middleware, not in front of it as they were. They\n * have no production counterpart, but a gate that must hold in dev as well,\n * one that refuses traffic without a header, is only complete if nothing the\n * dev server answers goes around it.\n */\nfunction devScript(req: Request): Response | null {\n const { pathname } = new URL(req.url);\n const script = (source: string) =>\n new Response(source, {\n headers: {\n \"Content-Type\": \"application/javascript\",\n },\n });\n if (pathname === DEV_ENTRY_PATH) {\n return script(DEV_ENTRY_SOURCE);\n }\n if (pathname.startsWith(\"/render-error.js\")) {\n return script(\"window.render_error = true\");\n }\n if (pathname.startsWith(\"/refresh.js\")) {\n return script(REFRESH_PREAMBLE_SOURCE);\n }\n return null;\n}\n\n/**\n * The dev server's `fetch` handler, apart from `Bun.serve` and from creating\n * Vite, so a test can hand it a stub Vite server and drive it with plain\n * `Request`s. `httpDev` is the only other caller. This module has no import\n * side effects, unlike `httpDev.ts`, which installs process-wide error hooks.\n */\nexport function createDevFetch(\n app: App,\n instrumentation: Instrumentation,\n vite: ViteDevServer,\n): (req: Request) => Promise<Response> {\n const appDir = join(process.cwd(), \"app\");\n\n return async (req) => {\n const { pathname } = new URL(req.url);\n const errorResponse = (err: any): Response => {\n // Errors thrown *while handling a request* (a controller throwing, a\n // failing view import, ...) never hit `httpDev`'s module-load hooks,\n // so surface them here: forward to the overlay for any already-open\n // page, and render an error page for this response so a fresh load\n // (which has no live HMR socket yet) still shows the failure.\n console.error(err);\n vite.ssrFixStacktrace?.(err);\n sendErrorToClient(err);\n\n if (isApiPath(pathname)) {\n return new Response(\n JSON.stringify({\n error: stringEraRefusal(\"server_error\", err?.message ?? String(err), 500),\n }),\n {\n status: 500,\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n }\n\n // This document has no live app (so no HttpReload listener to clear the\n // overlay) — remember that, so recovery forces a full page reload.\n globalThis.__gemiErrorPageServed = true;\n return new Response(renderErrorPage(viteErrorPayload(err)), {\n status: 500,\n headers: { \"Content-Type\": \"text/html\" },\n });\n };\n const requestHandler = async (req: Request): Promise<Response> => {\n const script = devScript(req);\n if (script) {\n return script;\n }\n try {\n const handler = app.fetch.bind(app);\n const result = (await viteMiddleware(vite, req)) ?? (await handler(req));\n if (result instanceof Response) {\n return result;\n }\n\n const viewImportMap = {};\n const ogMap = {};\n const viewModules = {};\n const template = (viewName: string, path: string) =>\n `\"${viewName}\": () => import(\"${path}\")`;\n const templates = [];\n\n for (const fileName of [\"404\", ...app.getFlatComponentTree.call(app)]) {\n if (process.env.NODE_ENV === \"test\") {\n break;\n }\n const appDir = `${process.env.APP_DIR}`;\n const mod = await ssrRunner(vite).import(`${appDir}/views/${fileName}.tsx`);\n\n viewImportMap[fileName] = mod.default;\n ogMap[fileName] = mod?.OpenGraph;\n // The whole module, so a streaming render can put the view's\n // `Loading`/`Error` exports into the shell it sends.\n viewModules[fileName] = mod;\n // Emit a root-relative URL (`/app/views/Foo.tsx`), NOT the absolute\n // filesystem path the runner import above uses. The browser's\n // `window.loaders` preload and `client.tsx`'s `import.meta.glob` map\n // must import the exact same URL — otherwise Vite serves the module\n // under two URLs (`/app/views/Foo.tsx` vs `/Users/.../app/views/Foo.tsx`)\n // and loads/instantiates the view twice.\n templates.push(template(fileName, `/app/views/${fileName}.tsx`));\n }\n\n const loaders = `{${templates.join(\",\")}}`;\n\n return await result({\n getStyles: async (currentViews: string[], options?: { static?: boolean; layout?: string }) =>\n await createDevStyles(appDir, vite, currentViews, options?.layout),\n // Vite serves app files by their root-relative path; the island\n // entry is that path plus the plugin's query.\n resolveIsland: (moduleKey: string) => ({\n src: `/${moduleKey}${ISLAND_ENTRY_QUERY}`,\n preload: [],\n }),\n // Vite serves modules fresh, so dev has one build.\n buildId: \"dev\",\n bootstrapModules: [DEV_ENTRY_PATH],\n viewImportMap,\n viewModules,\n ogMap,\n loaders,\n cssManifest: {},\n });\n } catch (err: any) {\n return errorResponse(err);\n }\n };\n\n // In front of Vite's middleware, the dev scripts and the app, as\n // `httpProd` puts the global middleware in front of its static files, so a\n // check that passes here passes there. A throw from it is answered like\n // one from a route. Vite's HMR websocket is the one thing it cannot cover:\n // its upgrade is relayed to Vite by `Bun.serve` (see `hmrRelay.ts`) before\n // this handler runs, and Vite checks the token and host itself.\n return await instrumentation(req, (req) =>\n app.withGlobalMiddleware(req, requestHandler, errorResponse),\n );\n };\n}\n",
|
|
7
7
|
"function cleanupTerminalText(text) {\n return (\n text\n // Remove ANSI escape sequences (colors, formatting)\n .replace(/\\x1b\\[[0-9;]*m/g, \"\")\n // Remove ANSI escape sequences with different format\n .replace(/\\[[0-9;]*m/g, \"\")\n // Remove excessive whitespace and normalize line breaks\n .replace(/\\n\\s*\\n/g, \"\\n\")\n // Trim each line\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .join(\"\\n\")\n .trim()\n );\n}\n\nexport function renderErrorPage(err: any) {\n return `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1.0\"\n />\n\n <title>Error</title>\n <style>\n body {\n font-family: Arial, sans-serif;\n padding: 20px;\n }\n h1 {\n color: red;\n }\n </style>\n </head>\n <body>\n <div id=\"overlay\"></div>\n <script type=\"module\" src=\"/refresh.js\"></script>\n <script type=\"module\" src=\"/@vite/client\"></script>\n <script>\n ${cleanupTerminalText.toString()}\n const err = ${JSON.stringify(err, Object.getOwnPropertyNames(err), 2)}\n\n window.addEventListener('load', () => {\n const container = document.getElementById('overlay')\n const ErrorOverlay = customElements.get('vite-error-overlay')\n if (ErrorOverlay) {\n const overlay = new ErrorOverlay({ ...err, message: cleanupTerminalText(err.message) });\n container.appendChild(overlay)\n }\n })\n </script>\n </body>\n</html>\n`;\n}\n",
|
|
8
8
|
"// Vite's HMR websocket needs a port of its own, and in middleware mode Vite\n// always picks the same one.\n//\n// `httpDev` runs Vite with `middlewareMode: true`, so Vite has no HTTP server of\n// its own to hang the websocket off — it stands up a second HTTP server just for\n// the upgrade. When nothing names a port, that server binds Vite's default 24678\n// in *every* `gemi dev` process. `PORT` moves the Bun server and nothing else, so\n// a second dev server logs\n//\n// WebSocket server error: Port undefined is already in use\n//\n// and carries on with a dead socket. (Vite logs that failure rather than throwing\n// — which is why the symptom is not a crash but pages that hot-reload on the\n// *other* checkout's edits: their `/@vite/client` was told 24678, and 24678 is\n// the first server's.) So gemi names the port instead of letting Vite default it.\n//\n// Why derive from the HTTP port rather than just scan for a free one: two dev\n// servers must already differ in `PORT` to run at all, so deriving makes their\n// HMR ports differ *before* either one binds anything. A scan alone would hand\n// both the same port when they start at the same moment, each having probed\n// before the other bound. The scan is still here, for the port being taken by\n// something that is not a gemi dev server.\n\nconst VITE_DEFAULT_HTTP_PORT = 5173;\nconst VITE_DEFAULT_HMR_PORT = 24678;\n\n// A port is 16 bits.\nconst MAX_PORT = 65535;\n\n// How far to walk up from the derived port before giving up. Large enough that\n// only a pathological machine exhausts it, small enough to fail in well under a\n// second rather than appearing to hang.\nconst SEARCH_WINDOW = 64;\n\n/**\n * Bind-test a port the same way Vite will.\n *\n * Vite calls `wsHttpServer.listen(port, host)` with no host unless one is\n * configured, so its websocket server takes the wildcard address — which is what\n * this binds too. The match matters: a wildcard bind collides with a wildcard\n * *or* a loopback holder, while a loopback bind only collides with loopback. A\n * process holding `127.0.0.1:P` alone therefore reads as free here, correctly —\n * Vite would fail to bind `*:P` against it, but nothing in gemi makes Vite bind\n * loopback-only, so that case cannot arise from a second `gemi dev`.\n *\n * Only `EADDRINUSE` counts as taken. Any other failure — a permission error, an\n * unroutable address — is not something a different port would fix, so it is\n * reported free and left for Vite to surface.\n */\nfunction isPortFree(port: number): boolean {\n try {\n const listener = Bun.listen({\n hostname: \"0.0.0.0\",\n port,\n socket: { data() {} },\n });\n // `true` closes active connections too. There are none — nothing has been\n // told this port exists yet — but it also makes the close synchronous, so\n // the port is released before the next probe or before Vite binds it.\n listener.stop(true);\n return true;\n } catch (error) {\n return (error as { code?: string })?.code !== \"EADDRINUSE\";\n }\n}\n\n/**\n * Pick the port for Vite's HMR websocket, given the port the dev server's HTTP\n * side is on.\n *\n * `5173` returns `24678` — Vite's two defaults stay paired, so a single dev\n * server behaves exactly as it did before, and anything pointed at 24678 (a\n * firewall rule, a container port mapping, a note in a README) keeps working.\n * Every other HTTP port is offset by the same distance, so distinct `PORT`s\n * always yield distinct HMR ports.\n *\n * @param isFree Injected for tests. Production callers use the bind test above.\n */\nexport function resolveHmrPort(\n httpPort: number,\n isFree: (port: number) => boolean = isPortFree,\n): number {\n let start = VITE_DEFAULT_HMR_PORT + (httpPort - VITE_DEFAULT_HTTP_PORT);\n\n // A high `PORT` can push the derived port past the top of the range — or so\n // close to it that the walk would run off the end. Fall back to the default\n // and let the scan sort it out; being *adjacent* to another server's port is\n // fine, landing *on* it is what has to be avoided, and the scan does that.\n //\n // There is deliberately no matching floor. The offset is only -5173, so the\n // lowest a real HTTP port can derive is 19505 (from `PORT=0`) — a guard for\n // the bottom of the range would be a branch no input can take.\n if (start > MAX_PORT - SEARCH_WINDOW) {\n start = VITE_DEFAULT_HMR_PORT;\n }\n\n for (let port = start; port < start + SEARCH_WINDOW; port++) {\n if (isFree(port)) return port;\n }\n\n throw new Error(\n `Could not find a free port for Vite's HMR websocket: tried ${start}-${\n start + SEARCH_WINDOW - 1\n }. Set one explicitly in gemi.config.ts as \\`vite: { server: { ws: { port } } }\\`.`,\n );\n}\n",
|
|
9
9
|
"import { createServer, type Server as NodeServer } from \"node:http\";\n\nimport type { Server, ServerWebSocket, WebSocketHandler } from \"bun\";\n\n// Vite's HMR websocket, carried on the dev server's own port.\n//\n// In middleware mode Vite has no HTTP server of its own, so by default it\n// stands up a second one for the websocket, on a second port (see\n// `hmrPort.ts`), and tells the browser to connect to `<page host>:<that port>`.\n// A reverse proxy or tunnel (ngrok, a container port mapping, a phone on the\n// LAN through https) only carries the port the page came from, so HMR could\n// not connect there, and the client logged connection failures forever.\n//\n// Vite can attach its websocket to a server it is handed (`server.ws.server`)\n// instead, and then tells the browser to connect to the page's own origin. That\n// server has to be a Node `http.Server`; the dev server is `Bun.serve`. So:\n//\n// - the Node server Vite is handed listens on loopback only, on the port\n// `resolveHmrPort` picked, and answers nothing but websocket upgrades;\n// - `Bun.serve` accepts the browser's upgrade on the page's origin and relays\n// frames both ways to that loopback server.\n//\n// The relay forwards the browser's `Host` and `Origin` and the request's query\n// (the `token`), so Vite still runs its own host and token checks against what\n// the browser actually sent.\n\n/** The subprotocols Vite's client opens its sockets with. */\nconst VITE_PROTOCOLS = new Set([\"vite-hmr\", \"vite-ping\"]);\n\n/**\n * Start the loopback Node server Vite attaches its HMR websocket to.\n * Everything but an upgrade gets `426 Upgrade Required`, as Vite's own\n * websocket server answers.\n */\nexport async function listenHmrServer(port: number): Promise<NodeServer> {\n const server = createServer((_req, res) => {\n res.writeHead(426, { \"Content-Type\": \"text/plain\" });\n res.end(\"Upgrade Required\");\n });\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(port, \"127.0.0.1\", () => {\n server.off(\"error\", reject);\n resolve();\n });\n });\n return server;\n}\n\n/**\n * The loopback port to relay to, read from the config Vite actually resolved,\n * so an app that set its own `server.ws` in `gemi.config.ts` is relayed to\n * where Vite really is, or not relayed at all. `null` when Vite was not given\n * a server (its websocket is then on a port of its own, and the client goes\n * there directly) or when HMR is off.\n */\nexport function hmrRelayPort(wsConfig: unknown): number | null {\n if (!wsConfig || typeof wsConfig !== \"object\") return null;\n const server = (wsConfig as { server?: { address?: () => unknown } }).server;\n const address = server?.address?.();\n if (address && typeof address === \"object\" && \"port\" in address) {\n return Number((address as { port: number }).port) || null;\n }\n return null;\n}\n\n/** Whether a request is the Vite client opening its HMR (or ping) socket. */\nexport function isHmrUpgrade(req: Request): boolean {\n if (req.headers.get(\"upgrade\")?.toLowerCase() !== \"websocket\") return false;\n return VITE_PROTOCOLS.has(req.headers.get(\"sec-websocket-protocol\") ?? \"\");\n}\n\nexport type HmrRelayData = {\n /** The socket to Vite, already open when the browser's is accepted. */\n upstream: WebSocket;\n /** Frames Vite sent before the browser's socket opened (its `connected`). */\n early: (string | Uint8Array)[];\n browser?: ServerWebSocket<HmrRelayData>;\n};\n\ntype Frame = string | Uint8Array;\n\nconst frameOf = (data: unknown): Frame =>\n typeof data === \"string\" ? data : new Uint8Array(data as ArrayBuffer);\n\n/**\n * Open the socket to Vite first, and accept the browser's upgrade only once\n * Vite has accepted it. Returns `undefined` once Bun has taken the request\n * over, or a refusal.\n *\n * The order matters. Vite refuses a socket whose host is not in\n * `allowedHosts`, or a cross-origin one without its token. Had the browser's\n * socket been accepted first and closed when Vite refused, the client would\n * read that as \"server connection lost\", ping (which Vite always answers),\n * and reload the page, forever. Refused before it opens, the client logs one\n * \"failed to connect to websocket\" and the page keeps working.\n */\nexport async function upgradeHmr(\n req: Request,\n server: Server<HmrRelayData>,\n port: number,\n): Promise<Response | undefined> {\n const url = new URL(req.url);\n const protocol = req.headers.get(\"sec-websocket-protocol\") ?? \"vite-hmr\";\n // `Host` is what Vite's `allowedHosts` check reads; the URL's host is the\n // same value `Bun.serve` derived it from.\n const headers: Record<string, string> = {\n host: req.headers.get(\"host\") ?? url.host,\n };\n const origin = req.headers.get(\"origin\");\n if (origin) headers.origin = origin;\n\n const upstream = new WebSocket(\n `ws://127.0.0.1:${port}${url.pathname}${url.search}`,\n {\n protocols: [protocol],\n headers,\n } as any,\n );\n upstream.binaryType = \"arraybuffer\";\n const data: HmrRelayData = { upstream, early: [] };\n\n upstream.onmessage = (event) => {\n const frame = frameOf(event.data);\n if (data.browser) data.browser.send(frame);\n else data.early.push(frame);\n };\n upstream.onclose = (event) => {\n data.browser?.close(sendableCloseCode(event.code), event.reason);\n };\n upstream.onerror = () => {\n // A `close` follows; it ends the browser's socket if there is one.\n };\n\n const opened = await new Promise<boolean>((resolve) => {\n upstream.addEventListener(\"open\", () => resolve(true), { once: true });\n upstream.addEventListener(\"close\", () => resolve(false), { once: true });\n });\n if (!opened) {\n return new Response(\"Vite refused the HMR websocket\", { status: 403 });\n }\n\n const upgraded = server.upgrade(req, {\n // The browser fails a connection whose response does not echo the\n // subprotocol it asked for.\n headers: { \"Sec-WebSocket-Protocol\": protocol },\n data,\n });\n if (!upgraded) {\n upstream.close();\n return new Response(\"WebSocket upgrade failed\", { status: 400 });\n }\n return undefined;\n}\n\n// A close code that may be sent in a close frame. 1005, 1006 and 1015 are\n// reported locally and never sent.\nfunction sendableCloseCode(code: number): number {\n if (\n code === 1000 ||\n (code >= 1001 && code <= 1003) ||\n (code >= 1007 && code <= 1014)\n ) {\n return code;\n }\n if (code >= 3000 && code <= 4999) return code;\n return 1000;\n}\n\n/** `Bun.serve`'s `websocket` option: relays frames to and from Vite. */\nexport const hmrRelayHandler: WebSocketHandler<HmrRelayData> = {\n open(ws: ServerWebSocket<HmrRelayData>) {\n const data = ws.data;\n for (const frame of data.early) ws.send(frame);\n data.early = [];\n data.browser = ws;\n // Vite may have hung up while the upgrade was in flight.\n if (data.upstream.readyState !== WebSocket.OPEN) ws.close(1000);\n },\n message(ws: ServerWebSocket<HmrRelayData>, message) {\n if (ws.data.upstream.readyState === WebSocket.OPEN) {\n ws.data.upstream.send(message);\n }\n },\n close(ws: ServerWebSocket<HmrRelayData>) {\n const { upstream } = ws.data;\n if (upstream.readyState <= WebSocket.OPEN) upstream.close();\n },\n};\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";weAAA,SAAS,QAET,iBAAS,QCDT,SAAS,OACT,oBAAS,cAAiB,OAC1B,WAAS,MCHT,SAAS,CAAmB,CAAC,EAAM,CACjC,OACE,EAEG,QAAQ,kBAAmB,EAAE,EAE7B,QAAQ,cAAe,EAAE,EAEzB,QAAQ,WAAY;AAAA,CAAI,EAExB,MAAM;AAAA,CAAI,EACV,IAAI,CAAC,IAAS,EAAK,KAAK,CAAC,EACzB,OAAO,CAAC,IAAS,EAAK,OAAS,CAAC,EAChC,KAAK;AAAA,CAAI,EACT,KAAK,EAIL,SAAS,CAAe,CAAC,EAAU,CACxC,MAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QA0BD,EAAoB,SAAS;AAAA,oBACjB,KAAK,UAAU,EAAK,OAAO,oBAAoB,CAAG,EAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ED5B1E,SAAS,CAAc,CAAC,EAAqB,EAA4C,CACvF,IAAM,EAAM,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nD,OAAO",
|
|
12
|
+
"debugId": "DD235AA05CAC380F64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Q as I}from"./chunk-
|
|
2
|
+
import{Q as I}from"./chunk-0ejjgzwc.js";import{_ as A}from"./chunk-zrcd9hxr.js";import"./chunk-s5k3yq6t.js";import{aa as f}from"./chunk-32n8t8x6.js";import{ij as t,mj as T}from"./chunk-tewhms9w.js";var N=t(I(),1),a=t(f(),1),d=t(A(),1);import{readFileSync as g}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:m,policy:S,durationSeconds:l}=e,{roleAssumerWithWebIdentity:E}=e;if(!E){let{getDefaultRoleAssumerWithWebIdentity:p}=await import("./chunk-jaa6xkeh.js").then((m)=>t(m.default,1));E=p({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return E({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:m,Policy:S,DurationSeconds:l})};var _="AWS_WEB_IDENTITY_TOKEN_FILE",O="AWS_ROLE_ARN",k="AWS_ROLE_SESSION_NAME",L=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[_],r=e?.roleArn??process.env[O],i=e?.roleSessionName??process.env[k];if(!o||!r)throw new a.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:d.externalDataInterceptor?.getTokenRecord?.()[o]??g(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[_])N.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{c as fromWebToken,L as fromTokenFile};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=FE3397C062FD3E1564756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"export const fromWebToken = (init) => async (awsIdentityProperties) => {\n init.logger?.debug(\"@aws-sdk/credential-provider-web-identity - fromWebToken\");\n const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;\n let { roleAssumerWithWebIdentity } = init;\n if (!roleAssumerWithWebIdentity) {\n const { getDefaultRoleAssumerWithWebIdentity } = await import(\"@aws-sdk/nested-clients/sts\");\n roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({\n ...init.clientConfig,\n credentialProviderLogger: init.logger,\n parentClientConfig: {\n ...awsIdentityProperties?.callerClientConfig,\n ...init.parentClientConfig,\n },\n }, init.clientPlugins);\n }\n return roleAssumerWithWebIdentity({\n RoleArn: roleArn,\n RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,\n WebIdentityToken: webIdentityToken,\n ProviderId: providerId,\n PolicyArns: policyArns,\n Policy: policy,\n DurationSeconds: durationSeconds,\n });\n};\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";8NAAA,SACA,KACA,KACA,iBAAS,WCHF,IAAM,EAAe,CAAC,IAAS,MAAO,IAA0B,CACnE,EAAK,QAAQ,MAAM,0DAA0D,EAC7E,IAAQ,UAAS,kBAAiB,mBAAkB,aAAY,aAAY,SAAQ,mBAAoB,GAClG,8BAA+B,EACrC,GAAI,CAAC,EAA4B,CAC7B,IAAQ,wCAAyC,KAAa,yDAC9D,EAA6B,EAAqC,IAC3D,EAAK,aACR,yBAA0B,EAAK,OAC/B,mBAAoB,IACb,GAAuB,sBACvB,EAAK,kBACZ,CACJ,EAAG,EAAK,aAAa,EAEzB,OAAO,EAA2B,CAC9B,QAAS,EACT,gBAAiB,GAAmB,sBAAsB,KAAK,IAAI,IACnE,iBAAkB,EAClB,WAAY,EACZ,WAAY,EACZ,OAAQ,EACR,gBAAiB,CACrB,CAAC,GDlBL,IAAM,EAAiB,8BACjB,EAAe,eACf,EAAwB,wBACjB,EAAgB,CAAC,EAAO,CAAC,IAAM,MAAO,IAA0B,CACzE,EAAK,QAAQ,MAAM,2DAA2D,EAC9E,IAAM,EAAuB,GAAM,sBAAwB,QAAQ,IAAI,GACjE,EAAU,GAAM,SAAW,QAAQ,IAAI,GACvC,EAAkB,GAAM,iBAAmB,QAAQ,IAAI,GAC7D,GAAI,CAAC,GAAwB,CAAC,EAC1B,MAAM,IAAI,2BAAyB,2CAA4C,CAC3E,OAAQ,EAAK,MACjB,CAAC,EAEL,IAAM,EAAc,MAAM,EAAa,IAChC,EACH,iBAAkB,2BAAyB,iBAAiB,EAAE,IAC1D,EAAa,EAAsB,CAAE,SAAU,OAAQ,CAAC,EAC5D,UACA,iBACJ,CAAC,EAAE,CAAqB,EACxB,GAAI,IAAyB,QAAQ,IAAI,GACrC,uBAAqB,EAAa,wCAAyC,GAAG,EAElF,OAAO",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "FE3397C062FD3E1564756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=(a,b)=>()=>(a&&(b=a(a=0)),b);var w=import.meta.require;
|
|
3
|
-
export{s as
|
|
3
|
+
export{s as ij,t as jj,u as kj,v as lj,w as mj};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=5B847145E06461A064756E2164756E21
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{B as
|
|
2
|
+
import{Ii as x}from"./chunk-fenc5tpv.js";function B(j){return j}function C(){return{supportedLocales:[],defaultLocale:"en-US",prefetch:{},components:{},detectLocale:()=>null,onLocaleChange:(j)=>{console.log(`Locale changed to ${j}`)},timeZone:x,detectTimeZone:()=>null}}
|
|
3
|
+
export{B as Rc,C as Sc};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=946959EAF8C13A5A64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { DEFAULT_TIME_ZONE } from \"./formatter\";\nimport type { Dictionary } from \"./Dictionary\";\nimport type { HttpRequest } from \"../http/HttpRequest\";\n\n// Config key: `translation`. Derived from `I18nServiceProvider`.\nexport interface TranslationConfig {\n supportedLocales?: string[];\n defaultLocale?: string;\n /**\n * @deprecated Only for `Dictionary.create` dictionaries. A `defineDictionary`\n * dictionary needs no entry here — the component that reads it pulls it in,\n * and the bundler ships only the active locale.\n */\n prefetch?: Record<string, Array<Dictionary<any>>>;\n /** @deprecated Only for `Dictionary.create` dictionaries. See `prefetch`. */\n components?: Record<string, Dictionary<any>>;\n\n // Returning `null` falls back to gemi's own locale detection.\n detectLocale?: (req: HttpRequest) => string | null;\n onLocaleChange?: (locale: string) => Promise<void> | void;\n\n /**\n * The IANA time zone dates are formatted in by `useFormatter`,\n * `useDictionary(...).format` and `Lang.formatter()`. Defaults to `UTC`.\n *\n * One zone for server and browser alike, so a server-rendered date and its\n * hydrated copy print the same text. Override per call with\n * `format.date(value, { timeZone })`.\n */\n timeZone?: string;\n /**\n * Resolve the zone for one request, e.g. from a cookie or the signed-in\n * user's profile. Returning `null` (or a zone `Intl` does not know) falls back\n * to `timeZone`. Runs on the server; the result ships with the page.\n */\n detectTimeZone?: (req: HttpRequest) => string | null;\n}\n\nexport function defineTranslationConfig(\n config: TranslationConfig,\n): TranslationConfig {\n return config;\n}\n\nexport function translationConfigDefaults(): Required<TranslationConfig> {\n return {\n supportedLocales: [],\n defaultLocale: \"en-US\",\n prefetch: {},\n components: {},\n detectLocale: () => null,\n onLocaleChange: (locale) => {\n console.log(`Locale changed to ${locale}`);\n },\n timeZone: DEFAULT_TIME_ZONE,\n detectTimeZone: () => null,\n };\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yCAsCO,SAAS,CAAuB,CACrC,EACmB,CACnB,OAAO,EAGF,SAAS,CAAyB,EAAgC,CACvE,MAAO,CACL,iBAAkB,CAAC,EACnB,cAAe,QACf,SAAU,CAAC,EACX,WAAY,CAAC,EACb,aAAc,IAAM,KACpB,eAAgB,CAAC,IAAW,CAC1B,QAAQ,IAAI,qBAAqB,GAAQ,GAE3C,SAAU,EACV,eAAgB,IAAM,IACxB",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "946959EAF8C13A5A64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as Nt}from"./chunk-6gfsjgra.js";import{A as xt,B as pt,C as Xt,i as er,k as L,l as At,m as Wt,n as Yt,p as Hr,q as Lr,r as Rt,s as jt,t as ar,u as Bt,v as Jt,w as lr,x as Mt,y as Ut,z as wt}from"./chunk-d2v78b77.js";import{D as Nr,E as at,G as Dt,K as He,O as M}from"./chunk-j632p533.js";import{P as zt}from"./chunk-4kj4e22e.js";import"./chunk-x5m12vkw.js";import{X as ut}from"./chunk-862jeyz0.js";import{Y as Ft}from"./chunk-bw2pfaz3.js";import{Z as lt}from"./chunk-qpy25jj9.js";import"./chunk-svn6zvzd.js";import"./chunk-q00f25na.js";import"./chunk-s2h85rbf.js";import{la as bt}from"./chunk-5crtgt1y.js";import{hj as p}from"./chunk-j5q5ysng.js";var V=p((se)=>{Object.defineProperty(se,"__esModule",{value:!0});se.resolveHttpAuthSchemeConfig=se.defaultSigninHttpAuthSchemeProvider=se.defaultSigninHttpAuthSchemeParametersProvider=void 0;var Mr=L(),H=Nr(),Ur=async(e,r,t)=>{return{operation:(0,H.getSmithyContext)(r).operation,region:await(0,H.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};se.defaultSigninHttpAuthSchemeParametersProvider=Ur;function wr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(r,t)=>({signingProperties:{config:r,context:t}})}}function xr(e){return{schemeId:"smithy.api#noAuth"}}var gr=(e)=>{let r=[];switch(e.operation){case"CreateOAuth2Token":{r.push(xr(e));break}default:r.push(wr(e))}return r};se.defaultSigninHttpAuthSchemeProvider=gr;var fr=(e)=>{let r=(0,Mr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,H.normalizeProvider)(e.authSchemePreference??[])})};se.resolveHttpAuthSchemeConfig=fr});var Se=p((Ee)=>{Object.defineProperty(Ee,"__esModule",{value:!0});Ee.ruleSet=void 0;var ve="required",o="fn",n="argv",c="ref",ne=!0,ie="isSet",S="booleanEquals",I="error",E="endpoint",l="tree",N="PartitionResult",z="stringEquals",de={[ve]:!0,default:!1,type:"boolean"},ue={[ve]:!1,type:"string"},ae={[c]:"Endpoint"},A={[o]:S,[n]:[{[c]:"UseFIPS"},!0]},W={[o]:S,[n]:[{[c]:"UseDualStack"},!0]},s={},Y={[o]:"getAttr",[n]:[{[c]:N},"name"]},R={[o]:S,[n]:[{[c]:"UseFIPS"},!1]},F={[o]:S,[n]:[{[c]:"UseDualStack"},!1]},le={[o]:"getAttr",[n]:[{[c]:N},"supportsFIPS"]},pe={[o]:S,[n]:[!0,{[o]:"getAttr",[n]:[{[c]:N},"supportsDualStack"]}]},ce=[{[c]:"Region"}],hr={version:"1.0",parameters:{UseDualStack:de,UseFIPS:de,Endpoint:ue,Region:ue},rules:[{conditions:[{[o]:ie,[n]:[ae]}],rules:[{conditions:[A],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:I},{rules:[{conditions:[W],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:I},{endpoint:{url:ae,properties:s,headers:s},type:E}],type:l}],type:l},{rules:[{conditions:[{[o]:ie,[n]:ce}],rules:[{conditions:[{[o]:"aws.partition",[n]:ce,assign:N}],rules:[{conditions:[{[o]:z,[n]:[Y,"aws"]},R,F],endpoint:{url:"https://{Region}.signin.aws.amazon.com",properties:s,headers:s},type:E},{conditions:[{[o]:z,[n]:[Y,"aws-cn"]},R,F],endpoint:{url:"https://{Region}.signin.amazonaws.cn",properties:s,headers:s},type:E},{conditions:[{[o]:z,[n]:[Y,"aws-us-gov"]},R,F],endpoint:{url:"https://{Region}.signin.amazonaws-us-gov.com",properties:s,headers:s},type:E},{conditions:[A,W],rules:[{conditions:[{[o]:S,[n]:[ne,le]},pe],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:s,headers:s},type:E}],type:l},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:I}],type:l},{conditions:[A,F],rules:[{conditions:[{[o]:S,[n]:[le,ne]}],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",properties:s,headers:s},type:E}],type:l},{error:"FIPS is enabled but this partition does not support FIPS",type:I}],type:l},{conditions:[R,W],rules:[{conditions:[pe],rules:[{endpoint:{url:"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:s,headers:s},type:E}],type:l},{error:"DualStack is enabled but this partition does not support DualStack",type:I}],type:l},{endpoint:{url:"https://signin.{Region}.{PartitionResult#dnsSuffix}",properties:s,headers:s},type:E}],type:l}],type:l},{error:"Invalid Configuration: Missing Region",type:I}],type:l}]};Ee.ruleSet=hr});var Ie=p((Pe)=>{Object.defineProperty(Pe,"__esModule",{value:!0});Pe.defaultEndpointResolver=void 0;var Vr=Lr(),j=Hr(),zr=Se(),Ar=new j.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Wr=(e,r={})=>{return Ar.get(e,()=>(0,j.resolveEndpoint)(zr.ruleSet,{endpointParams:e,logger:r.logger}))};Pe.defaultEndpointResolver=Wr;j.customEndpointFunctions.aws=Vr.awsEndpointFunctions});var U=p((J)=>{Object.defineProperty(J,"__esModule",{value:!0});J.SigninServiceException=J.__ServiceException=void 0;var qe=M();Object.defineProperty(J,"__ServiceException",{enumerable:!0,get:function(){return qe.ServiceException}});class B extends qe.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,B.prototype)}}J.SigninServiceException=B});var k=p((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.ValidationException=be.TooManyRequestsError=be.InternalServerException=be.AccessDeniedException=void 0;var w=U();class X extends w.SigninServiceException{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error}}be.AccessDeniedException=X;class Q extends w.SigninServiceException{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error}}be.InternalServerException=Q;class Z extends w.SigninServiceException{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error}}be.TooManyRequestsError=Z;class K extends w.SigninServiceException{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error}}be.ValidationException=K});var C=p((We)=>{Object.defineProperty(We,"__esModule",{value:!0});We.CreateOAuth2Token$=We.CreateOAuth2TokenResponseBody$=We.CreateOAuth2TokenResponse$=We.CreateOAuth2TokenRequestBody$=We.CreateOAuth2TokenRequest$=We.AccessToken$=We.errorTypeRegistries=We.ValidationException$=We.TooManyRequestsError$=We.InternalServerException$=We.AccessDeniedException$=We.SigninServiceException$=void 0;var Jr="AccessDeniedException",Xr="AccessToken",Qr="CreateOAuth2Token",Zr="CreateOAuth2TokenRequest",Kr="CreateOAuth2TokenRequestBody",kr="CreateOAuth2TokenResponseBody",Tr="CreateOAuth2TokenResponse",mr="InternalServerException",Cr="RefreshToken",_r="TooManyRequestsError",et="ValidationException",Fe="accessKeyId",Ne="accessToken",T="client",Me="clientId",Ue="codeVerifier",rt="code",y="error",we="expiresIn",xe="grantType",tt="http",m="httpError",ge="idToken",d="jsonName",g="message",x="refreshToken",fe="redirectUri",Le="smithy.ts.sdk.synthetic.com.amazonaws.signin",Ge="secretAccessKey",$e="sessionToken",st="server",ot="tokenInput",nt="tokenOutput",he="tokenType",u="com.amazonaws.signin",Ve=He(),f=k(),it=U(),ze=Ve.TypeRegistry.for(Le);We.SigninServiceException$=[-3,Le,"SigninServiceException",0,[],[]];ze.registerError(We.SigninServiceException$,it.SigninServiceException);var q=Ve.TypeRegistry.for(u);We.AccessDeniedException$=[-3,u,Jr,{[y]:T},[y,g],[0,0],2];q.registerError(We.AccessDeniedException$,f.AccessDeniedException);We.InternalServerException$=[-3,u,mr,{[y]:st,[m]:500},[y,g],[0,0],2];q.registerError(We.InternalServerException$,f.InternalServerException);We.TooManyRequestsError$=[-3,u,_r,{[y]:T,[m]:429},[y,g],[0,0],2];q.registerError(We.TooManyRequestsError$,f.TooManyRequestsError);We.ValidationException$=[-3,u,et,{[y]:T,[m]:400},[y,g],[0,0],2];q.registerError(We.ValidationException$,f.ValidationException);We.errorTypeRegistries=[ze,q];var Ae=[0,u,Cr,8,0];We.AccessToken$=[3,u,Xr,8,[Fe,Ge,$e],[[0,{[d]:Fe}],[0,{[d]:Ge}],[0,{[d]:$e}]],3];We.CreateOAuth2TokenRequest$=[3,u,Zr,0,[ot],[[()=>We.CreateOAuth2TokenRequestBody$,16]],1];We.CreateOAuth2TokenRequestBody$=[3,u,Kr,0,[Me,xe,rt,fe,Ue,x],[[0,{[d]:Me}],[0,{[d]:xe}],0,[0,{[d]:fe}],[0,{[d]:Ue}],[()=>Ae,{[d]:x}]],2];We.CreateOAuth2TokenResponse$=[3,u,Tr,0,[nt],[[()=>We.CreateOAuth2TokenResponseBody$,16]],1];We.CreateOAuth2TokenResponseBody$=[3,u,kr,0,[Ne,he,we,x,ge],[[()=>We.AccessToken$,{[d]:Ne}],[0,{[d]:he}],[1,{[d]:we}],[()=>Ae,{[d]:x}],[0,{[d]:ge}]],4];We.CreateOAuth2Token$=[9,u,Qr,{[tt]:["POST","/v1/token",200]},()=>We.CreateOAuth2TokenRequest$,()=>We.CreateOAuth2TokenResponse$]});var sr=p((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var ct=L(),vt=pt(),Et=er(),yt=M(),St=lt(),Ce=at(),_e=ut(),Pt=V(),Ot=Ie(),It=C(),qt=(e)=>{return{apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??Ce.fromBase64,base64Encoder:e?.base64Encoder??Ce.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ot.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Pt.defaultSigninHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new ct.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Et.NoAuthSigner}],logger:e?.logger??new yt.NoOpLogger,protocol:e?.protocol??vt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:It.errorTypeRegistries,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",urlParser:e?.urlParser??St.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=qt});var vr=p((pr)=>{Object.defineProperty(pr,"__esModule",{value:!0});pr.getRuntimeConfig=void 0;var gt=bt(),ft=gt.__importDefault(Nt()),or=L(),nr=Mt(),G=ar(),Gt=Ut(),ir=lr(),P=Ft(),dr=Dt(),ur=M(),$t=wt(),ht=xt(),Ht=Rt(),Lt=sr(),Vt=(e)=>{(0,ur.emitWarningIfUnsupportedVersion)(process.version);let r=(0,ht.resolveDefaultsModeConfig)(e),t=()=>r().then(ur.loadConfigsForDefaultMode),a=(0,Lt.getRuntimeConfig)(e);(0,or.emitWarningIfUnsupportedVersion)(process.version);let i={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,P.loadConfig)(or.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,i),bodyLengthChecker:e?.bodyLengthChecker??$t.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,nr.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:ft.default.version}),maxAttempts:e?.maxAttempts??(0,P.loadConfig)(ir.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,P.loadConfig)(G.NODE_REGION_CONFIG_OPTIONS,{...G.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:dr.NodeHttpHandler.create(e?.requestHandler??t),retryMode:e?.retryMode??(0,P.loadConfig)({...ir.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await t()).retryMode||Ht.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??Gt.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??dr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,P.loadConfig)(G.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,P.loadConfig)(G.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,P.loadConfig)(nr.NODE_APP_ID_CONFIG_OPTIONS,i)}};pr.getRuntimeConfig=Vt});var vs=p((v)=>{var Er=At(),Qt=Wt(),Zt=Yt(),yr=jt(),Kt=ar(),_=er(),kt=He(),Tt=Bt(),qr=Jt(),Sr=lr(),O=M(),Pr=V(),mt=vr(),Or=Xt(),Ir=zt(),D=C(),$=k(),Ct=U(),_t=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"})},es={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},rs=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:t,credentials:a}=e;return{setHttpAuthScheme(i){let b=r.findIndex((h)=>h.schemeId===i.schemeId);if(b===-1)r.push(i);else r.splice(b,1,i)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(i){t=i},httpAuthSchemeProvider(){return t},setCredentials(i){a=i},credentials(){return a}}},ts=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},ss=(e,r)=>{let t=Object.assign(Or.getAwsRegionExtensionConfiguration(e),O.getDefaultExtensionConfiguration(e),Ir.getHttpHandlerExtensionConfiguration(e),rs(e));return r.forEach((a)=>a.configure(t)),Object.assign(e,Or.resolveAwsRegionExtensionConfiguration(t),O.resolveDefaultRuntimeConfig(t),Ir.resolveHttpHandlerRuntimeConfig(t),ts(t))};class ee extends O.Client{config;constructor(...[e]){let r=mt.getRuntimeConfig(e||{});super(r);this.initConfig=r;let t=_t(r),a=yr.resolveUserAgentConfig(t),i=Sr.resolveRetryConfig(a),b=Kt.resolveRegionConfig(i),h=Er.resolveHostHeaderConfig(b),Dr=qr.resolveEndpointConfig(h),br=Pr.resolveHttpAuthSchemeConfig(Dr),Rr=ss(br,e?.extensions||[]);this.config=Rr,this.middlewareStack.use(kt.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(yr.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(Tt.getContentLengthPlugin(this.config)),this.middlewareStack.use(Er.getHostHeaderPlugin(this.config)),this.middlewareStack.use(Qt.getLoggerPlugin(this.config)),this.middlewareStack.use(Zt.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Pr.defaultSigninHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(Fr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":Fr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends O.Command.classBuilder().ep(es).m(function(e,r,t,a){return[qr.getEndpointPlugin(t,e.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(D.CreateOAuth2Token$).build(){}var os={CreateOAuth2TokenCommand:re};class te extends ee{}O.createAggregatedClient(os,te);var ns={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",SERVER_ERROR:"server_error",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};v.$Command=O.Command;v.__Client=O.Client;v.SigninServiceException=Ct.SigninServiceException;v.CreateOAuth2TokenCommand=re;v.OAuth2ErrorCode=ns;v.Signin=te;v.SigninClient=ee;Object.prototype.hasOwnProperty.call(D,"__proto__")&&!Object.prototype.hasOwnProperty.call(v,"__proto__")&&Object.defineProperty(v,"__proto__",{enumerable:!0,value:D.__proto__});Object.keys(D).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(v,e))v[e]=D[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(v,"__proto__")&&Object.defineProperty(v,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(v,e))v[e]=$[e]})});export default vs();
|
|
2
|
+
import{h as Nt}from"./chunk-3gsv1vv1.js";import{A as xt,B as pt,C as Xt,i as er,k as L,l as At,m as Wt,n as Yt,p as Hr,q as Lr,r as Rt,s as jt,t as ar,u as Bt,v as Jt,w as lr,x as Mt,y as Ut,z as wt}from"./chunk-pn2x59ge.js";import{D as Nr,E as at,G as Dt,K as He,O as M}from"./chunk-5tdxbwzg.js";import{P as zt}from"./chunk-7g649j8h.js";import"./chunk-0ejjgzwc.js";import{X as ut}from"./chunk-3wnghdsx.js";import{Y as Ft}from"./chunk-c7qs1xp3.js";import{Z as lt}from"./chunk-gy81nd9a.js";import"./chunk-zrcd9hxr.js";import"./chunk-s5k3yq6t.js";import"./chunk-32n8t8x6.js";import{la as bt}from"./chunk-ep0baa9g.js";import{jj as p}from"./chunk-tewhms9w.js";var V=p((se)=>{Object.defineProperty(se,"__esModule",{value:!0});se.resolveHttpAuthSchemeConfig=se.defaultSigninHttpAuthSchemeProvider=se.defaultSigninHttpAuthSchemeParametersProvider=void 0;var Mr=L(),H=Nr(),Ur=async(e,r,t)=>{return{operation:(0,H.getSmithyContext)(r).operation,region:await(0,H.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};se.defaultSigninHttpAuthSchemeParametersProvider=Ur;function wr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(r,t)=>({signingProperties:{config:r,context:t}})}}function xr(e){return{schemeId:"smithy.api#noAuth"}}var gr=(e)=>{let r=[];switch(e.operation){case"CreateOAuth2Token":{r.push(xr(e));break}default:r.push(wr(e))}return r};se.defaultSigninHttpAuthSchemeProvider=gr;var fr=(e)=>{let r=(0,Mr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,H.normalizeProvider)(e.authSchemePreference??[])})};se.resolveHttpAuthSchemeConfig=fr});var Se=p((Ee)=>{Object.defineProperty(Ee,"__esModule",{value:!0});Ee.ruleSet=void 0;var ve="required",o="fn",n="argv",c="ref",ne=!0,ie="isSet",S="booleanEquals",I="error",E="endpoint",l="tree",N="PartitionResult",z="stringEquals",de={[ve]:!0,default:!1,type:"boolean"},ue={[ve]:!1,type:"string"},ae={[c]:"Endpoint"},A={[o]:S,[n]:[{[c]:"UseFIPS"},!0]},W={[o]:S,[n]:[{[c]:"UseDualStack"},!0]},s={},Y={[o]:"getAttr",[n]:[{[c]:N},"name"]},R={[o]:S,[n]:[{[c]:"UseFIPS"},!1]},F={[o]:S,[n]:[{[c]:"UseDualStack"},!1]},le={[o]:"getAttr",[n]:[{[c]:N},"supportsFIPS"]},pe={[o]:S,[n]:[!0,{[o]:"getAttr",[n]:[{[c]:N},"supportsDualStack"]}]},ce=[{[c]:"Region"}],hr={version:"1.0",parameters:{UseDualStack:de,UseFIPS:de,Endpoint:ue,Region:ue},rules:[{conditions:[{[o]:ie,[n]:[ae]}],rules:[{conditions:[A],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:I},{rules:[{conditions:[W],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:I},{endpoint:{url:ae,properties:s,headers:s},type:E}],type:l}],type:l},{rules:[{conditions:[{[o]:ie,[n]:ce}],rules:[{conditions:[{[o]:"aws.partition",[n]:ce,assign:N}],rules:[{conditions:[{[o]:z,[n]:[Y,"aws"]},R,F],endpoint:{url:"https://{Region}.signin.aws.amazon.com",properties:s,headers:s},type:E},{conditions:[{[o]:z,[n]:[Y,"aws-cn"]},R,F],endpoint:{url:"https://{Region}.signin.amazonaws.cn",properties:s,headers:s},type:E},{conditions:[{[o]:z,[n]:[Y,"aws-us-gov"]},R,F],endpoint:{url:"https://{Region}.signin.amazonaws-us-gov.com",properties:s,headers:s},type:E},{conditions:[A,W],rules:[{conditions:[{[o]:S,[n]:[ne,le]},pe],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:s,headers:s},type:E}],type:l},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:I}],type:l},{conditions:[A,F],rules:[{conditions:[{[o]:S,[n]:[le,ne]}],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",properties:s,headers:s},type:E}],type:l},{error:"FIPS is enabled but this partition does not support FIPS",type:I}],type:l},{conditions:[R,W],rules:[{conditions:[pe],rules:[{endpoint:{url:"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:s,headers:s},type:E}],type:l},{error:"DualStack is enabled but this partition does not support DualStack",type:I}],type:l},{endpoint:{url:"https://signin.{Region}.{PartitionResult#dnsSuffix}",properties:s,headers:s},type:E}],type:l}],type:l},{error:"Invalid Configuration: Missing Region",type:I}],type:l}]};Ee.ruleSet=hr});var Ie=p((Pe)=>{Object.defineProperty(Pe,"__esModule",{value:!0});Pe.defaultEndpointResolver=void 0;var Vr=Lr(),j=Hr(),zr=Se(),Ar=new j.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Wr=(e,r={})=>{return Ar.get(e,()=>(0,j.resolveEndpoint)(zr.ruleSet,{endpointParams:e,logger:r.logger}))};Pe.defaultEndpointResolver=Wr;j.customEndpointFunctions.aws=Vr.awsEndpointFunctions});var U=p((J)=>{Object.defineProperty(J,"__esModule",{value:!0});J.SigninServiceException=J.__ServiceException=void 0;var qe=M();Object.defineProperty(J,"__ServiceException",{enumerable:!0,get:function(){return qe.ServiceException}});class B extends qe.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,B.prototype)}}J.SigninServiceException=B});var k=p((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.ValidationException=be.TooManyRequestsError=be.InternalServerException=be.AccessDeniedException=void 0;var w=U();class X extends w.SigninServiceException{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error}}be.AccessDeniedException=X;class Q extends w.SigninServiceException{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error}}be.InternalServerException=Q;class Z extends w.SigninServiceException{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error}}be.TooManyRequestsError=Z;class K extends w.SigninServiceException{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error}}be.ValidationException=K});var C=p((We)=>{Object.defineProperty(We,"__esModule",{value:!0});We.CreateOAuth2Token$=We.CreateOAuth2TokenResponseBody$=We.CreateOAuth2TokenResponse$=We.CreateOAuth2TokenRequestBody$=We.CreateOAuth2TokenRequest$=We.AccessToken$=We.errorTypeRegistries=We.ValidationException$=We.TooManyRequestsError$=We.InternalServerException$=We.AccessDeniedException$=We.SigninServiceException$=void 0;var Jr="AccessDeniedException",Xr="AccessToken",Qr="CreateOAuth2Token",Zr="CreateOAuth2TokenRequest",Kr="CreateOAuth2TokenRequestBody",kr="CreateOAuth2TokenResponseBody",Tr="CreateOAuth2TokenResponse",mr="InternalServerException",Cr="RefreshToken",_r="TooManyRequestsError",et="ValidationException",Fe="accessKeyId",Ne="accessToken",T="client",Me="clientId",Ue="codeVerifier",rt="code",y="error",we="expiresIn",xe="grantType",tt="http",m="httpError",ge="idToken",d="jsonName",g="message",x="refreshToken",fe="redirectUri",Le="smithy.ts.sdk.synthetic.com.amazonaws.signin",Ge="secretAccessKey",$e="sessionToken",st="server",ot="tokenInput",nt="tokenOutput",he="tokenType",u="com.amazonaws.signin",Ve=He(),f=k(),it=U(),ze=Ve.TypeRegistry.for(Le);We.SigninServiceException$=[-3,Le,"SigninServiceException",0,[],[]];ze.registerError(We.SigninServiceException$,it.SigninServiceException);var q=Ve.TypeRegistry.for(u);We.AccessDeniedException$=[-3,u,Jr,{[y]:T},[y,g],[0,0],2];q.registerError(We.AccessDeniedException$,f.AccessDeniedException);We.InternalServerException$=[-3,u,mr,{[y]:st,[m]:500},[y,g],[0,0],2];q.registerError(We.InternalServerException$,f.InternalServerException);We.TooManyRequestsError$=[-3,u,_r,{[y]:T,[m]:429},[y,g],[0,0],2];q.registerError(We.TooManyRequestsError$,f.TooManyRequestsError);We.ValidationException$=[-3,u,et,{[y]:T,[m]:400},[y,g],[0,0],2];q.registerError(We.ValidationException$,f.ValidationException);We.errorTypeRegistries=[ze,q];var Ae=[0,u,Cr,8,0];We.AccessToken$=[3,u,Xr,8,[Fe,Ge,$e],[[0,{[d]:Fe}],[0,{[d]:Ge}],[0,{[d]:$e}]],3];We.CreateOAuth2TokenRequest$=[3,u,Zr,0,[ot],[[()=>We.CreateOAuth2TokenRequestBody$,16]],1];We.CreateOAuth2TokenRequestBody$=[3,u,Kr,0,[Me,xe,rt,fe,Ue,x],[[0,{[d]:Me}],[0,{[d]:xe}],0,[0,{[d]:fe}],[0,{[d]:Ue}],[()=>Ae,{[d]:x}]],2];We.CreateOAuth2TokenResponse$=[3,u,Tr,0,[nt],[[()=>We.CreateOAuth2TokenResponseBody$,16]],1];We.CreateOAuth2TokenResponseBody$=[3,u,kr,0,[Ne,he,we,x,ge],[[()=>We.AccessToken$,{[d]:Ne}],[0,{[d]:he}],[1,{[d]:we}],[()=>Ae,{[d]:x}],[0,{[d]:ge}]],4];We.CreateOAuth2Token$=[9,u,Qr,{[tt]:["POST","/v1/token",200]},()=>We.CreateOAuth2TokenRequest$,()=>We.CreateOAuth2TokenResponse$]});var sr=p((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var ct=L(),vt=pt(),Et=er(),yt=M(),St=lt(),Ce=at(),_e=ut(),Pt=V(),Ot=Ie(),It=C(),qt=(e)=>{return{apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??Ce.fromBase64,base64Encoder:e?.base64Encoder??Ce.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ot.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Pt.defaultSigninHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new ct.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Et.NoAuthSigner}],logger:e?.logger??new yt.NoOpLogger,protocol:e?.protocol??vt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:It.errorTypeRegistries,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",urlParser:e?.urlParser??St.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=qt});var vr=p((pr)=>{Object.defineProperty(pr,"__esModule",{value:!0});pr.getRuntimeConfig=void 0;var gt=bt(),ft=gt.__importDefault(Nt()),or=L(),nr=Mt(),G=ar(),Gt=Ut(),ir=lr(),P=Ft(),dr=Dt(),ur=M(),$t=wt(),ht=xt(),Ht=Rt(),Lt=sr(),Vt=(e)=>{(0,ur.emitWarningIfUnsupportedVersion)(process.version);let r=(0,ht.resolveDefaultsModeConfig)(e),t=()=>r().then(ur.loadConfigsForDefaultMode),a=(0,Lt.getRuntimeConfig)(e);(0,or.emitWarningIfUnsupportedVersion)(process.version);let i={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,P.loadConfig)(or.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,i),bodyLengthChecker:e?.bodyLengthChecker??$t.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,nr.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:ft.default.version}),maxAttempts:e?.maxAttempts??(0,P.loadConfig)(ir.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,P.loadConfig)(G.NODE_REGION_CONFIG_OPTIONS,{...G.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:dr.NodeHttpHandler.create(e?.requestHandler??t),retryMode:e?.retryMode??(0,P.loadConfig)({...ir.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await t()).retryMode||Ht.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??Gt.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??dr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,P.loadConfig)(G.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,P.loadConfig)(G.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,P.loadConfig)(nr.NODE_APP_ID_CONFIG_OPTIONS,i)}};pr.getRuntimeConfig=Vt});var vs=p((v)=>{var Er=At(),Qt=Wt(),Zt=Yt(),yr=jt(),Kt=ar(),_=er(),kt=He(),Tt=Bt(),qr=Jt(),Sr=lr(),O=M(),Pr=V(),mt=vr(),Or=Xt(),Ir=zt(),D=C(),$=k(),Ct=U(),_t=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"})},es={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},rs=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:t,credentials:a}=e;return{setHttpAuthScheme(i){let b=r.findIndex((h)=>h.schemeId===i.schemeId);if(b===-1)r.push(i);else r.splice(b,1,i)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(i){t=i},httpAuthSchemeProvider(){return t},setCredentials(i){a=i},credentials(){return a}}},ts=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},ss=(e,r)=>{let t=Object.assign(Or.getAwsRegionExtensionConfiguration(e),O.getDefaultExtensionConfiguration(e),Ir.getHttpHandlerExtensionConfiguration(e),rs(e));return r.forEach((a)=>a.configure(t)),Object.assign(e,Or.resolveAwsRegionExtensionConfiguration(t),O.resolveDefaultRuntimeConfig(t),Ir.resolveHttpHandlerRuntimeConfig(t),ts(t))};class ee extends O.Client{config;constructor(...[e]){let r=mt.getRuntimeConfig(e||{});super(r);this.initConfig=r;let t=_t(r),a=yr.resolveUserAgentConfig(t),i=Sr.resolveRetryConfig(a),b=Kt.resolveRegionConfig(i),h=Er.resolveHostHeaderConfig(b),Dr=qr.resolveEndpointConfig(h),br=Pr.resolveHttpAuthSchemeConfig(Dr),Rr=ss(br,e?.extensions||[]);this.config=Rr,this.middlewareStack.use(kt.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(yr.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(Tt.getContentLengthPlugin(this.config)),this.middlewareStack.use(Er.getHostHeaderPlugin(this.config)),this.middlewareStack.use(Qt.getLoggerPlugin(this.config)),this.middlewareStack.use(Zt.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Pr.defaultSigninHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(Fr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":Fr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends O.Command.classBuilder().ep(es).m(function(e,r,t,a){return[qr.getEndpointPlugin(t,e.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(D.CreateOAuth2Token$).build(){}var os={CreateOAuth2TokenCommand:re};class te extends ee{}O.createAggregatedClient(os,te);var ns={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",SERVER_ERROR:"server_error",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};v.$Command=O.Command;v.__Client=O.Client;v.SigninServiceException=Ct.SigninServiceException;v.CreateOAuth2TokenCommand=re;v.OAuth2ErrorCode=ns;v.Signin=te;v.SigninClient=ee;Object.prototype.hasOwnProperty.call(D,"__proto__")&&!Object.prototype.hasOwnProperty.call(v,"__proto__")&&Object.defineProperty(v,"__proto__",{enumerable:!0,value:D.__proto__});Object.keys(D).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(v,e))v[e]=D[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(v,"__proto__")&&Object.defineProperty(v,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(v,e))v[e]=$[e]})});export default vs();
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=FFB83AA2D6EB19D964756E2164756E21
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\nvar schemas_0 = require('./schemas/schemas_0');\nvar errors = require('./models/errors');\nvar SigninServiceException = require('./models/SigninServiceException');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"signin\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SigninClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSigninHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nclass CreateOAuth2TokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"Signin\", \"CreateOAuth2Token\", {})\n .n(\"SigninClient\", \"CreateOAuth2TokenCommand\")\n .sc(schemas_0.CreateOAuth2Token$)\n .build() {\n}\n\nconst commands = {\n CreateOAuth2TokenCommand,\n};\nclass Signin extends SigninClient {\n}\nsmithyClient.createAggregatedClient(commands, Signin);\n\nconst OAuth2ErrorCode = {\n AUTHCODE_EXPIRED: \"AUTHCODE_EXPIRED\",\n INSUFFICIENT_PERMISSIONS: \"INSUFFICIENT_PERMISSIONS\",\n INVALID_REQUEST: \"INVALID_REQUEST\",\n SERVER_ERROR: \"server_error\",\n TOKEN_EXPIRED: \"TOKEN_EXPIRED\",\n USER_CREDENTIALS_CHANGED: \"USER_CREDENTIALS_CHANGED\",\n};\n\nexports.$Command = smithyClient.Command;\nexports.__Client = smithyClient.Client;\nexports.SigninServiceException = SigninServiceException.SigninServiceException;\nexports.CreateOAuth2TokenCommand = CreateOAuth2TokenCommand;\nexports.OAuth2ErrorCode = OAuth2ErrorCode;\nexports.Signin = Signin;\nexports.SigninClient = SigninClient;\nObject.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: schemas_0['__proto__']\n });\n\nObject.keys(schemas_0).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];\n});\nObject.prototype.hasOwnProperty.call(errors, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: errors['__proto__']\n });\n\nObject.keys(errors).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];\n});\n"
|
|
14
14
|
],
|
|
15
15
|
"mappings": ";uuBACA,CAAO,SAAe,HAAS,OAAc,LAAE,AAAO,JAAK,LAAC,JACpD,yBAAsC,iCAA8C,2CAAqD,OACjJ,IAAM,OACA,OACA,GAAgD,MAAO,EAAQ,EAAS,IAAU,CACpF,MAAO,CACH,WAAY,EAAG,EAAkB,kBAAkB,CAAO,EAAE,UAC5D,OAAS,MAAO,EAAG,EAAkB,mBAAmB,EAAO,MAAM,EAAE,IAClE,IAAM,CACH,MAAU,MAAM,yDAAyD,IAC1E,CACX,GAEI,iDAAgD,GACxD,SAAS,EAAgC,CAAC,EAAgB,CACtD,MAAO,CACH,SAAU,iBACV,kBAAmB,CACf,KAAM,SACN,OAAQ,EAAe,MAC3B,EACA,oBAAqB,CAAC,EAAQ,KAAa,CACvC,kBAAmB,CACf,SACA,SACJ,CACJ,EACJ,EAEJ,SAAS,EAAmC,CAAC,EAAgB,CACzD,MAAO,CACH,SAAU,mBACd,EAEJ,IAAM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,KAAK,EAAS,WAAW,GAC1D,OAAO,eAAe,EAAS,YAAa,CACxC,WAAY,GACZ,MAAO,EAAU,SACrB,CAAC,EAEL,OAAO,KAAK,CAAS,EAAE,QAAQ,QAAS,CAAC,EAAG,CACxC,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAU,GACpG,EACD,OAAO,UAAU,eAAe,KAAK,EAAQ,WAAW,GACpD,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,WAAW,GAC1D,OAAO,eAAe,EAAS,YAAa,CACxC,WAAY,GACZ,MAAO,EAAO,SAClB,CAAC,EAEL,OAAO,KAAK,CAAM,EAAE,QAAQ,QAAS,CAAC,EAAG,CACrC,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAO,GACjG",
|
|
16
|
-
"debugId": "
|
|
16
|
+
"debugId": "FFB83AA2D6EB19D964756E2164756E21",
|
|
17
17
|
"names": []
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-48gmyaxc.js";import"./chunk-0ejjgzwc.js";import"./chunk-32n8t8x6.js";import"./chunk-tewhms9w.js";export{g as fromEnv,c as ENV_SESSION,b as ENV_SECRET,a as ENV_KEY,d as ENV_EXPIRATION,e as ENV_CREDENTIAL_SCOPE,f as ENV_ACCOUNT_ID};
|
|
3
3
|
|
|
4
4
|
//# debugId=30E142423ED216F064756E2164756E21
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Q as ne}from"./chunk-
|
|
2
|
+
import{Q as ne}from"./chunk-0ejjgzwc.js";import{_ as C}from"./chunk-zrcd9hxr.js";import"./chunk-s5k3yq6t.js";import{aa as _}from"./chunk-32n8t8x6.js";import{ij as c,mj as F}from"./chunk-tewhms9w.js";var x=c(_(),1),T=c(C(),1);var q=(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 D=c(ne(),1);var u=c(_(),1),m=c(C(),1);var W=300000,h="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-gemzbw7f.js").then((m)=>c(m.default,1)),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var X=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-gemzbw7f.js").then((m)=>c(m.default,1));return(await j(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var z=c(_(),1);var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new z.TokenProviderError(`Token is expired. ${h}`,!1)};var J=c(_(),1);var g=(e,o,r=!1)=>{if(typeof o>"u")throw new J.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${h}`,!1)};var V=c(C(),1);import{promises as re}from"fs";var{writeFile:te}=re,Y=(e,o)=>{let r=V.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return te(r,t)};var B=new Date(0),Q=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await m.parseKnownFiles(e),t=m.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new u.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new u.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,p=(await m.loadSsoSessionData(e))[a];if(!p)throw new u.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!p[i])throw new u.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:S,sso_region:I}=p,s;try{s=await m.getSSOTokenFromFile(a)}catch(i){throw new u.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${h}`,!1)}g("accessToken",s.accessToken),g("expiresAt",s.expiresAt);let{accessToken:y,expiresAt:E}=s,l={token:y,expiration:new Date(E)};if(l.expiration.getTime()-Date.now()>W)return l;if(Date.now()-B.getTime()<30000)return P(l),l;g("clientId",s.clientId,!0),g("clientSecret",s.clientSecret,!0),g("refreshToken",s.refreshToken,!0);try{B.setTime(Date.now());let i=await X(s,I,e,o);g("accessToken",i.accessToken),g("expiresIn",i.expiresIn);let O=new Date(Date.now()+i.expiresIn*1000);try{await Y(a,{...s,accessToken:i.accessToken,expiresAt:O.toISOString(),refreshToken:i.refreshToken})}catch(R){}return{token:i.accessToken,expiration:O}}catch(i){return P(l),l}};var k=c(_(),1),Z=c(C(),1),A=!1,$=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:p,callerClientConfig:S,profile:I,filepath:s,configFilepath:y,ignoreCache:E,logger:l})=>{let i,O="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let w=await Q({profile:I,filepath:s,configFilepath:y,ignoreCache:E})();i={accessToken:w.token,expiresAt:new Date(w.expiration).toISOString()}}catch(w){throw new k.CredentialsProviderError(w.message,{tryNextLink:A,logger:l})}else try{i=await Z.getSSOTokenFromFile(e)}catch(w){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:A,logger:l})}if(new Date(i.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:A,logger:l});let{accessToken:R}=i,{SSOClient:d,GetRoleCredentialsCommand:N}=await import("./chunk-zefs2b6h.js"),se=a||new d(Object.assign({},f??{},{logger:f?.logger??S?.logger??p?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??S?.userAgentAppId??p?.userAgentAppId})),L;try{L=await se.send(new N({accountId:r,roleName:n,accessToken:R}))}catch(w){throw new k.CredentialsProviderError(w,{tryNextLink:A,logger:l})}let{roleCredentials:{accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:b,credentialScope:H,accountId:U}={}}=L;if(!M||!G||!K||!b)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:A,logger:l});let v={accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:new Date(b),...H&&{credentialScope:H},...U&&{accountId:U}};if(o)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var ee=c(_(),1),oe=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new ee.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(", ")}
|
|
3
3
|
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var Ce=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:f}=e,{ssoClient:p}=e,S=T.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!f){let s=(await T.parseKnownFiles(e))[S];if(!s)throw new x.CredentialsProviderError(`Profile ${S} was not found.`,{logger:e.logger});if(!q(s))throw new x.CredentialsProviderError(`Profile ${S} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let d=(await T.loadSsoSessionData(e))[s.sso_session],N=` configurations in profile ${S} and sso-session ${s.sso_session}`;if(n&&n!==d.sso_region)throw new x.CredentialsProviderError("Conflicting SSO region"+N,{tryNextLink:!1,logger:e.logger});if(r&&r!==d.sso_start_url)throw new x.CredentialsProviderError("Conflicting SSO start_url"+N,{tryNextLink:!1,logger:e.logger});s.sso_region=d.sso_region,s.sso_start_url=d.sso_start_url}let{sso_start_url:y,sso_account_id:E,sso_region:l,sso_role_name:i,sso_session:O}=oe(s,e.logger);return $({ssoStartUrl:y,ssoSession:O,ssoAccountId:E,ssoRegion:l,ssoRoleName:i,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new x.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return $({ssoStartUrl:r,ssoSession:f,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{oe as validateSsoProfile,q as isSsoProfile,Ce as fromSSO};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=DCE2C5C0984E7E1F64756E2164756E21
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"import { CredentialsProviderError } from \"@smithy/property-provider\";\nexport const validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")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ClB,OAAQ,EAAK,MACjB,CAAC,EAEA,QAAI,CAAC,GAAe,CAAC,GAAgB,CAAC,GAAa,CAAC,EACrD,MAAM,IAAI,2BAAyB,+HAC8B,CAAE,YAAa,GAAO,OAAQ,EAAK,MAAO,CAAC,EAG5G,YAAO,EAAsB,CACzB,cACA,aACA,eACA,YACA,cACA,YACA,aAAc,EAAK,aACnB,mBAAoB,EAAK,mBACzB,mBAAoB,EAAK,mBACzB,QAAS,EACT,SAAU,EAAK,SACf,eAAgB,EAAK,eACrB,YAAa,EAAK,YAClB,OAAQ,EAAK,MACjB,CAAC",
|
|
18
|
-
"debugId": "
|
|
18
|
+
"debugId": "DCE2C5C0984E7E1F64756E2164756E21",
|
|
19
19
|
"names": []
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-tewhms9w.js";function R(f,D){let P=new Map;for(let p of[...D.tables].sort())P.set(p,{name:p,columns:[],primaryKey:[],relations:[]});for(let{table:p,...s}of D.columns)P.get(p)?.columns.push(s);for(let{table:p,column:s}of D.primaryKeys)P.get(p)?.primaryKey.push(s);let d=new Map;for(let p of D.foreignKeys){let s=P.get(p.table);if(!s)continue;let M=`${p.table}\x00${p.key}`,q=d.get(M);if(!q)q={name:p.name,columns:[],referencedTable:p.referencedTable,referencedColumns:[],onDelete:p.onDelete,onUpdate:p.onUpdate},d.set(M,q),s.relations.push(q);q.columns.push(p.column),q.referencedColumns.push(p.referencedColumn)}return{dialect:f,tables:[...P.values()]}}async function h(f,D){let P=await f.unsafe(`
|
|
3
3
|
select TABLE_NAME as name
|
|
4
4
|
from information_schema.TABLES
|
|
5
5
|
where TABLE_SCHEMA = database() and TABLE_TYPE = 'BASE TABLE'
|
|
@@ -45,6 +45,6 @@ Say which, and registerModels will leave it alone:
|
|
|
45
45
|
register("${j}", ${z[0]})
|
|
46
46
|
|
|
47
47
|
A class that is only a typed view over the same rows belongs in a module you do not hand to registerModels.`);this.model=j;this.candidates=z;this.name="AmbiguousModelRegistrationError"}}class C extends Error{model;operation;required;limit;dialect;constructor(j,z,B,G,H,I){super(`${j}.${z} would bind ${B} parameters, and the '${H}' driver accepts at most ${G} in one statement. ${I}`+(z==="createMany"?" A createMany over the ceiling is normally split across statements inside one transaction, so reaching this means splitting cannot help: a single row binds more than the driver accepts.":" Splitting is not something this operation can do for you \u2014 one "+"statement has to carry one answer. Narrow the query."));this.model=j;this.operation=z;this.required=B;this.limit=G;this.dialect=H;this.name="ParameterLimitError"}}class D extends Error{model;operation;field;constructor(j,z,B){super(`${j}.${z} is missing a value for '${B}', which is required and has no default.`);this.model=j;this.operation=z;this.field=B;this.name="MissingRequiredValueError"}}class F extends Error{relation;model;constructor(j,z,B){super(`'${j}' is not a relation on model ${z}. `+(B.length>0?`Known relations: ${B.join(", ")}.`:`${z} declares no relations.`));this.relation=j;this.model=z;this.name="UnknownRelationError"}}class b extends Error{model;limit;constructor(j,z){super(`The include tree nests more than ${z} relations deep (at model ${j}). Deeply nested includes are legal, so this is a guard against a generated or malformed argument tree rather than a limit on `+"modelling \u2014 every level costs at least one query.");this.model=j;this.limit=z;this.name="RelationDepthExceededError"}}class P extends Error{model;relation;target;constructor(j,z,B,G){super(`${j}.${z} points at model '${B}', which nothing has registered. The generated artifact and the registry disagree: re-run \`prisma generate\`, and check that app/models/generated/index.ts is imported. `+(G.length>0?`Registered models: ${G.join(", ")}.`:"Nothing is registered at all."));this.model=j;this.relation=z;this.target=B;this.name="UnregisteredRelationTargetError"}}class R extends Error{model;relation;constructor(j,z,B){super(`Cannot resolve how ${j}.${z} joins: ${B} This means `+"app/models/generated is stale or hand-edited \u2014 re-run "+"`prisma generate`.");this.model=j;this.relation=z;this.name="MalformedRelationError"}}class v extends Error{constructor(j,z){super(`No model is registered under the name '${j}'. `+(z.length>0?`Registered models: ${z.join(", ")}.`:"Nothing is registered \u2014 is app/models/generated/index.ts imported?"));this.name="ModelNotRegisteredError"}}class N extends Error{constructor(j){super(`${j} has no $schema. Model subclasses must extend a generated base class from app/models/generated/models.ts.`);this.name="MissingModelSchemaError"}}class Q extends Error{model;operation;constructor(j,z){super(`${j}.${z} was given 'lock' outside a transaction. A row lock lasts until the transaction that took it ends, so outside one it is released as soon as the row is read and protects nothing. Run the read and the writes it guards inside Model.transaction(async () => { ... }).`);this.model=j;this.operation=z;this.name="LockOutsideTransactionError"}}
|
|
48
|
-
export{K as
|
|
48
|
+
export{K as jh,Z as kh,_ as lh,$ as mh,L as nh,M as oh,U as ph,V as qh,y as rh,O as sh,W as th,E as uh,S as vh,T as wh,x as xh,A as yh,C as zh,D as Ah,F as Bh,b as Ch,P as Dh,R as Eh,v as Fh,N as Gh,Q as Hh};
|
|
49
49
|
|
|
50
|
-
//# debugId=
|
|
50
|
+
//# debugId=6DDFD781D606AED864756E2164756E21
|