gemi 0.160.2 → 0.161.0
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/App.d.ts +5 -0
- package/dist/app/App.d.ts.map +1 -1
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/auth/config.d.ts +3 -2
- package/dist/auth/config.d.ts.map +1 -1
- package/dist/auth/routes.d.ts +20 -42
- package/dist/auth/routes.d.ts.map +1 -1
- package/dist/bin/gemi.js +8 -1
- package/dist/bin/gemi.js.map +3 -3
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +1 -1
- package/dist/{chunk-4vqnv41y.js → chunk-04ffq2ge.js} +2 -2
- package/dist/{chunk-4vqnv41y.js.map → chunk-04ffq2ge.js.map} +1 -1
- package/dist/{chunk-27habdva.js → chunk-04h49y2f.js} +2 -2
- package/dist/{chunk-27habdva.js.map → chunk-04h49y2f.js.map} +1 -1
- package/dist/{chunk-fcjjd162.js → chunk-10zbxbwk.js} +2 -2
- package/dist/{chunk-fcjjd162.js.map → chunk-10zbxbwk.js.map} +1 -1
- package/dist/{chunk-8tyw6faf.js → chunk-1btx3kkv.js} +2 -2
- package/dist/{chunk-8tyw6faf.js.map → chunk-1btx3kkv.js.map} +1 -1
- package/dist/{chunk-bfj2jafb.js → chunk-1cjr8hvc.js} +3 -3
- package/dist/{chunk-bfj2jafb.js.map → chunk-1cjr8hvc.js.map} +2 -2
- package/dist/{chunk-9f2ps5v2.js → chunk-22jm6sn1.js} +2 -2
- package/dist/{chunk-9f2ps5v2.js.map → chunk-22jm6sn1.js.map} +1 -1
- package/dist/{chunk-4ye6p5yk.js → chunk-2hhwsm69.js} +2 -2
- package/dist/{chunk-4ye6p5yk.js.map → chunk-2hhwsm69.js.map} +1 -1
- package/dist/{chunk-cn6dteec.js → chunk-36x1a1mz.js} +4 -4
- package/dist/{chunk-cn6dteec.js.map → chunk-36x1a1mz.js.map} +4 -3
- package/dist/{chunk-wtddr3vs.js → chunk-3tyqnh59.js} +2 -2
- package/dist/{chunk-wtddr3vs.js.map → chunk-3tyqnh59.js.map} +1 -1
- package/dist/chunk-3yvdvv3d.js +24 -0
- package/dist/{chunk-d3195ypx.js.map → chunk-3yvdvv3d.js.map} +3 -3
- package/dist/{chunk-m4pkbndk.js → chunk-51fvpq55.js} +2 -2
- package/dist/{chunk-m4pkbndk.js.map → chunk-51fvpq55.js.map} +1 -1
- package/dist/{chunk-k43m5dvs.js → chunk-576g6eyk.js} +2 -2
- package/dist/{chunk-k43m5dvs.js.map → chunk-576g6eyk.js.map} +1 -1
- package/dist/{chunk-htbvkr11.js → chunk-5z7mqgkp.js} +3 -3
- package/dist/{chunk-htbvkr11.js.map → chunk-5z7mqgkp.js.map} +1 -1
- package/dist/{chunk-3cvza61a.js → chunk-6w2v33bd.js} +2 -2
- package/dist/{chunk-3cvza61a.js.map → chunk-6w2v33bd.js.map} +1 -1
- package/dist/{chunk-p9syxzxh.js → chunk-70kpm72z.js} +3 -3
- package/dist/{chunk-p9syxzxh.js.map → chunk-70kpm72z.js.map} +1 -1
- package/dist/{chunk-cxz7wycm.js → chunk-75ajptxk.js} +4 -4
- package/dist/{chunk-cxz7wycm.js.map → chunk-75ajptxk.js.map} +3 -3
- package/dist/{chunk-qbsk0jr8.js → chunk-7effp39a.js} +2 -2
- package/dist/{chunk-qbsk0jr8.js.map → chunk-7effp39a.js.map} +1 -1
- package/dist/{chunk-57qnqcrp.js → chunk-7ex7aczc.js} +3 -3
- package/dist/{chunk-57qnqcrp.js.map → chunk-7ex7aczc.js.map} +1 -1
- package/dist/{chunk-r3v2cnrj.js → chunk-7txst143.js} +2 -2
- package/dist/{chunk-r3v2cnrj.js.map → chunk-7txst143.js.map} +1 -1
- package/dist/{chunk-v8fx4vgq.js → chunk-89168m0z.js} +2 -2
- package/dist/{chunk-v8fx4vgq.js.map → chunk-89168m0z.js.map} +1 -1
- package/dist/{chunk-fcqx2t0p.js → chunk-8m9kgynj.js} +2 -2
- package/dist/{chunk-fcqx2t0p.js.map → chunk-8m9kgynj.js.map} +1 -1
- package/dist/{chunk-m8a80sgn.js → chunk-8x0q9h0j.js} +3 -3
- package/dist/{chunk-m8a80sgn.js.map → chunk-8x0q9h0j.js.map} +1 -1
- package/dist/{chunk-7rfw4h2x.js → chunk-95gag2pg.js} +2 -2
- package/dist/{chunk-7rfw4h2x.js.map → chunk-95gag2pg.js.map} +1 -1
- package/dist/{chunk-7bc9ypbk.js → chunk-99be7vbh.js} +3 -3
- package/dist/{chunk-7bc9ypbk.js.map → chunk-99be7vbh.js.map} +1 -1
- package/dist/{chunk-kan3yz82.js → chunk-a5htej1f.js} +2 -2
- package/dist/{chunk-kan3yz82.js.map → chunk-a5htej1f.js.map} +1 -1
- package/dist/chunk-a5qn2sq8.js +4 -0
- package/dist/chunk-a5qn2sq8.js.map +10 -0
- package/dist/{chunk-ctrmztan.js → chunk-akgd3c0k.js} +2 -2
- package/dist/{chunk-ctrmztan.js.map → chunk-akgd3c0k.js.map} +1 -1
- package/dist/{chunk-vb73ddwz.js → chunk-asnk2jqn.js} +2 -2
- package/dist/{chunk-vb73ddwz.js.map → chunk-asnk2jqn.js.map} +1 -1
- package/dist/{chunk-a22h5cby.js → chunk-bwg7genv.js} +2 -2
- package/dist/{chunk-a22h5cby.js.map → chunk-bwg7genv.js.map} +1 -1
- package/dist/{chunk-j144nwvh.js → chunk-cd847h0t.js} +3 -3
- package/dist/{chunk-j144nwvh.js.map → chunk-cd847h0t.js.map} +1 -1
- package/dist/{chunk-8m3m5hcf.js → chunk-cjefq3ry.js} +3 -3
- package/dist/{chunk-8m3m5hcf.js.map → chunk-cjefq3ry.js.map} +1 -1
- package/dist/{chunk-664ewdjv.js → chunk-dj6bw2jm.js} +3 -3
- package/dist/{chunk-664ewdjv.js.map → chunk-dj6bw2jm.js.map} +2 -2
- package/dist/{chunk-s0xwqcrf.js → chunk-dkmf4eg1.js} +3 -3
- package/dist/{chunk-s0xwqcrf.js.map → chunk-dkmf4eg1.js.map} +1 -1
- package/dist/{chunk-5qzxyj68.js → chunk-dwxgr189.js} +1 -1
- package/dist/{chunk-79nypedr.js → chunk-e0w1mf72.js} +3 -3
- package/dist/{chunk-79nypedr.js.map → chunk-e0w1mf72.js.map} +1 -1
- package/dist/{chunk-csvffxjh.js → chunk-e9c02bq0.js} +3 -3
- package/dist/{chunk-csvffxjh.js.map → chunk-e9c02bq0.js.map} +1 -1
- package/dist/{chunk-szdbsmq7.js → chunk-egzfxdr1.js} +2 -2
- package/dist/{chunk-szdbsmq7.js.map → chunk-egzfxdr1.js.map} +1 -1
- package/dist/{chunk-yzw2tvqq.js → chunk-fv1r0w0r.js} +2 -2
- package/dist/{chunk-yzw2tvqq.js.map → chunk-fv1r0w0r.js.map} +1 -1
- package/dist/{chunk-d249m2ct.js → chunk-fyyf44aj.js} +2 -2
- package/dist/{chunk-d249m2ct.js.map → chunk-fyyf44aj.js.map} +1 -1
- package/dist/{chunk-gmeeyg19.js → chunk-g3sryyn4.js} +2 -2
- package/dist/{chunk-gmeeyg19.js.map → chunk-g3sryyn4.js.map} +1 -1
- package/dist/{chunk-rq3wrwfa.js → chunk-g3vasg0d.js} +1 -1
- package/dist/{chunk-qsbtqh47.js → chunk-gcxk8j84.js} +3 -3
- package/dist/{chunk-qsbtqh47.js.map → chunk-gcxk8j84.js.map} +1 -1
- package/dist/{chunk-1xxh48bd.js → chunk-gn8ee1dp.js} +2 -2
- package/dist/{chunk-1xxh48bd.js.map → chunk-gn8ee1dp.js.map} +1 -1
- package/dist/{chunk-0vb4j7cx.js → chunk-h4h8m3yr.js} +3 -3
- package/dist/{chunk-0vb4j7cx.js.map → chunk-h4h8m3yr.js.map} +1 -1
- package/dist/chunk-hdr0m0md.js +5 -0
- package/dist/{chunk-0qrbspbe.js.map → chunk-hdr0m0md.js.map} +1 -1
- package/dist/{chunk-ryq2ezgt.js → chunk-hkp00b9x.js} +3 -3
- package/dist/{chunk-ryq2ezgt.js.map → chunk-hkp00b9x.js.map} +1 -1
- package/dist/{chunk-5pc21syf.js → chunk-hx8vkwsb.js} +2 -2
- package/dist/{chunk-5pc21syf.js.map → chunk-hx8vkwsb.js.map} +1 -1
- package/dist/{chunk-0b8m1f07.js → chunk-jr7hdp5z.js} +3 -3
- package/dist/{chunk-0b8m1f07.js.map → chunk-jr7hdp5z.js.map} +1 -1
- package/dist/{chunk-cq16azbw.js → chunk-jry03jqj.js} +4 -4
- package/dist/{chunk-cq16azbw.js.map → chunk-jry03jqj.js.map} +1 -1
- package/dist/{chunk-qz9n2e59.js → chunk-k5xxwr5h.js} +2 -2
- package/dist/{chunk-qz9n2e59.js.map → chunk-k5xxwr5h.js.map} +1 -1
- package/dist/{chunk-p6nkfcn1.js → chunk-kqbnsthz.js} +2 -2
- package/dist/{chunk-p6nkfcn1.js.map → chunk-kqbnsthz.js.map} +1 -1
- package/dist/{chunk-w0rfypzx.js → chunk-kscwjycy.js} +2 -2
- package/dist/{chunk-w0rfypzx.js.map → chunk-kscwjycy.js.map} +1 -1
- package/dist/{chunk-pyyhmeg1.js → chunk-kt83h150.js} +3 -3
- package/dist/{chunk-pyyhmeg1.js.map → chunk-kt83h150.js.map} +1 -1
- package/dist/{chunk-msxhf3m6.js → chunk-m683535s.js} +3 -3
- package/dist/{chunk-msxhf3m6.js.map → chunk-m683535s.js.map} +1 -1
- package/dist/{chunk-98byy5m4.js → chunk-mg5gq632.js} +1 -1
- package/dist/{chunk-bzcfw8qd.js → chunk-mp9hfbs3.js} +2 -2
- package/dist/{chunk-bzcfw8qd.js.map → chunk-mp9hfbs3.js.map} +1 -1
- package/dist/{chunk-2ednvght.js → chunk-mqbx7hc4.js} +2 -2
- package/dist/{chunk-2ednvght.js.map → chunk-mqbx7hc4.js.map} +1 -1
- package/dist/{chunk-epvpmakp.js → chunk-mvd4mc8p.js} +2 -2
- package/dist/{chunk-epvpmakp.js.map → chunk-mvd4mc8p.js.map} +1 -1
- package/dist/{chunk-g71ppv6x.js → chunk-mxhy19a9.js} +2 -2
- package/dist/{chunk-g71ppv6x.js.map → chunk-mxhy19a9.js.map} +1 -1
- package/dist/{chunk-3d8jxky6.js → chunk-n3pc62tc.js} +3 -3
- package/dist/{chunk-3d8jxky6.js.map → chunk-n3pc62tc.js.map} +1 -1
- package/dist/{chunk-8z29qvvm.js → chunk-n6ywagxv.js} +2 -2
- package/dist/{chunk-8z29qvvm.js.map → chunk-n6ywagxv.js.map} +1 -1
- package/dist/{chunk-191gkynh.js → chunk-nc1gstvq.js} +3 -3
- package/dist/{chunk-191gkynh.js.map → chunk-nc1gstvq.js.map} +1 -1
- package/dist/{chunk-0qernzn1.js → chunk-pfjky33c.js} +2 -2
- package/dist/{chunk-0qernzn1.js.map → chunk-pfjky33c.js.map} +1 -1
- package/dist/chunk-pg16c4nx.js +58 -0
- package/dist/{chunk-hxe06cgw.js.map → chunk-pg16c4nx.js.map} +3 -3
- package/dist/{chunk-3vmc6adw.js → chunk-q4q5mxte.js} +2 -2
- package/dist/{chunk-3vmc6adw.js.map → chunk-q4q5mxte.js.map} +1 -1
- package/dist/{chunk-weyv3zrt.js → chunk-r94gpbjv.js} +4 -4
- package/dist/{chunk-weyv3zrt.js.map → chunk-r94gpbjv.js.map} +1 -1
- package/dist/{chunk-tsbxdz4h.js → chunk-rh811v1f.js} +2 -2
- package/dist/{chunk-tsbxdz4h.js.map → chunk-rh811v1f.js.map} +1 -1
- package/dist/{chunk-kk18xqgc.js → chunk-s0z61m9j.js} +2 -2
- package/dist/{chunk-kk18xqgc.js.map → chunk-s0z61m9j.js.map} +1 -1
- package/dist/{chunk-6d6p0q3p.js → chunk-s4nqy979.js} +2 -2
- package/dist/{chunk-6d6p0q3p.js.map → chunk-s4nqy979.js.map} +1 -1
- package/dist/{chunk-6ytezxzj.js → chunk-s7w7pn80.js} +2 -2
- package/dist/{chunk-6ytezxzj.js.map → chunk-s7w7pn80.js.map} +1 -1
- package/dist/chunk-sadtazf5.js +117 -0
- package/dist/{chunk-jx1crzgg.js.map → chunk-sadtazf5.js.map} +6 -6
- package/dist/{chunk-xp7x27n8.js → chunk-vqar6ysw.js} +3 -3
- package/dist/{chunk-xp7x27n8.js.map → chunk-vqar6ysw.js.map} +1 -1
- package/dist/{chunk-5c6dfy75.js → chunk-wamxfhh6.js} +2 -2
- package/dist/{chunk-5c6dfy75.js.map → chunk-wamxfhh6.js.map} +1 -1
- package/dist/{chunk-egwz89ze.js → chunk-wgre66wq.js} +2 -2
- package/dist/{chunk-egwz89ze.js.map → chunk-wgre66wq.js.map} +1 -1
- package/dist/{chunk-bqxt1she.js → chunk-xzbhy9n5.js} +1 -1
- package/dist/{chunk-jarsydtr.js → chunk-xzkr8yck.js} +3 -3
- package/dist/{chunk-jarsydtr.js.map → chunk-xzkr8yck.js.map} +1 -1
- package/dist/{chunk-4670xxae.js → chunk-yc2pnb1w.js} +2 -2
- package/dist/{chunk-4670xxae.js.map → chunk-yc2pnb1w.js.map} +1 -1
- package/dist/{chunk-v0gjdknx.js → chunk-yvpgy1p1.js} +2 -2
- package/dist/{chunk-v0gjdknx.js.map → chunk-yvpgy1p1.js.map} +1 -1
- package/dist/{chunk-zz2n9pa5.js → chunk-z2btwd27.js} +3 -3
- package/dist/{chunk-zz2n9pa5.js.map → chunk-z2btwd27.js.map} +1 -1
- package/dist/{chunk-day21sfa.js → chunk-z94ms1jv.js} +3 -3
- package/dist/{chunk-day21sfa.js.map → chunk-z94ms1jv.js.map} +1 -1
- package/dist/{chunk-m73mjzeh.js → chunk-zh0knwen.js} +2 -2
- package/dist/{chunk-m73mjzeh.js.map → chunk-zh0knwen.js.map} +1 -1
- package/dist/{chunk-9983zmhx.js → chunk-zzgzz4hb.js} +3 -3
- package/dist/{chunk-9983zmhx.js.map → chunk-zzgzz4hb.js.map} +1 -1
- 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/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 +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/probe/index.js +2 -2
- package/dist/probe/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/server/requiredViews.d.ts +7 -0
- package/dist/server/requiredViews.d.ts.map +1 -0
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/DomainRouter.d.ts +3 -0
- package/dist/services/router/DomainRouter.d.ts.map +1 -1
- package/dist/services/router/RouteServiceProvider.d.ts.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +12 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/vitest/index.js +2 -2
- package/dist/vitest/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-0qrbspbe.js +0 -5
- package/dist/chunk-982x8jps.js +0 -4
- package/dist/chunk-982x8jps.js.map +0 -10
- package/dist/chunk-d3195ypx.js +0 -24
- package/dist/chunk-hxe06cgw.js +0 -58
- package/dist/chunk-jx1crzgg.js +0 -117
- /package/dist/{chunk-5qzxyj68.js.map → chunk-dwxgr189.js.map} +0 -0
- /package/dist/{chunk-rq3wrwfa.js.map → chunk-g3vasg0d.js.map} +0 -0
- /package/dist/{chunk-98byy5m4.js.map → chunk-mg5gq632.js.map} +0 -0
- /package/dist/{chunk-bqxt1she.js.map → chunk-xzbhy9n5.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function M(E,C){let A=[],q=new Set;if(C)q.add(C),A.push(C);for(let G of Object.values(E))for(let j of Object.keys(G))if(!q.has(j))q.add(j),A.push(j);return A}function Q(E,C,A=M(E)){let q={};for(let[G,j]of Object.entries(E)){let H=j?.[C];if(typeof H!=="string")for(let I of A){let J=j?.[I];if(typeof J==="string"){H=J;break}}if(typeof H==="string")q[G]=H}return q}function R(E){let C,A;for(let[q,G]of Object.entries(E)){let j=Object.keys(G??{})[0];if(j===void 0)continue;if(A===void 0){A=j,C=q;continue}if(j!==A)return{key:q,first:j,againstKey:C,againstFirst:A}}return null}function P(E){return`{${Object.keys(E).sort().map((q)=>{let G=E[q]??{},H=Object.keys(G).sort().map((I)=>JSON.stringify([I,G[I]])).join(",");return`${JSON.stringify(q)}:[${H}]`}).join(",")}}`}function S(E){let C=P(E),A=2166136261,q=16777619;for(let j=0;j<C.length;j++){let H=C.charCodeAt(j);A=Math.imul(A^H,16777619),q=Math.imul(q^H,2166136261)}let G=(j)=>(j>>>0).toString(16).padStart(8,"0");return`d_${G(A)}${G(q)}`}
|
|
3
|
-
export{M as
|
|
3
|
+
export{M as va,Q as wa,R as xa,S as ya};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=0A30C02A8D41415564756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The one implementation of \"what is a dictionary literal, and what is its id\",\n * shared by the runtime (`defineDictionary`) and the Vite plugin.\n *\n * Both sides must agree exactly. A dictionary's id is a hash of its own\n * contents rather than of its file path, so a module that is bundled on one\n * side and evaluated raw on the other still lands on the same id — which is\n * what lets the SSR payload seed the client registry.\n */\n\nexport type DictionaryTranslations = Record<string, Record<string, string>>;\n\nexport type LocaleStrings = Record<string, string>;\n\n/**\n * Locales the dictionary declares, source language first.\n *\n * The order is meaningful: the first locale is the source language, and a key\n * missing from some other locale falls back along this list.\n *\n * `sourceLocale` pins that choice. Without it the source language is whichever\n * locale is seen first while walking the literal, which makes it an emergent\n * property of key order — adding a key at the top of a dictionary whose other\n * keys happen to lack `en-US` would silently re-point every fallback in it. Any\n * dictionary that is not uniformly translated should say which locale it is\n * authored in.\n */\nexport function dictionaryLocales(\n translations: DictionaryTranslations,\n sourceLocale?: string,\n): string[] {\n const locales: string[] = [];\n const seen = new Set<string>();\n if (sourceLocale) {\n seen.add(sourceLocale);\n locales.push(sourceLocale);\n }\n for (const byLocale of Object.values(translations)) {\n for (const locale of Object.keys(byLocale)) {\n if (!seen.has(locale)) {\n seen.add(locale);\n locales.push(locale);\n }\n }\n }\n return locales;\n}\n\n/**\n * Flatten one locale out of a dictionary.\n *\n * A key with no string for `locale` falls back along the declared locale order\n * rather than vanishing, so a half-translated dictionary degrades one string at\n * a time instead of rendering the whole component as raw keys.\n */\nexport function localeStrings(\n translations: DictionaryTranslations,\n locale: string,\n fallbackOrder: string[] = dictionaryLocales(translations),\n): LocaleStrings {\n const out: LocaleStrings = {};\n for (const [key, byLocale] of Object.entries(translations)) {\n let value = byLocale?.[locale];\n if (typeof value !== \"string\") {\n for (const candidate of fallbackOrder) {\n const fallback = byLocale?.[candidate];\n if (typeof fallback === \"string\") {\n value = fallback;\n break;\n }\n }\n }\n if (typeof value === \"string\") {\n out[key] = value;\n }\n }\n return out;\n}\n\nexport interface SourceDisagreement {\n key: string;\n first: string;\n againstKey: string;\n againstFirst: string;\n}\n\n/**\n * Whether the inferred source language survives reordering the literal.\n *\n * `dictionaryLocales` collects locales entry by entry, so `locales[0]` is the\n * first locale of the first entry. That is invariant under key reordering\n * exactly when every entry lists the same locale first — and order-dependent\n * the moment two entries disagree, because then whichever happens to be written\n * first decides what the *whole* dictionary falls back to. Adding one key at\n * the top can flip every other key's fallback language, from a diff that reads\n * as an addition.\n *\n * Returns the disagreement so the build can name both keys; `null` when the\n * inference is stable. `sourceLocale` settles it and makes the question moot.\n */\nexport function findSourceDisagreement(\n translations: DictionaryTranslations,\n): SourceDisagreement | null {\n let againstKey: string | undefined;\n let againstFirst: string | undefined;\n\n for (const [key, byLocale] of Object.entries(translations)) {\n const first = Object.keys(byLocale ?? {})[0];\n // A key with no locales at all is a different problem, reported elsewhere.\n if (first === undefined) continue;\n\n if (againstFirst === undefined) {\n againstFirst = first;\n againstKey = key;\n continue;\n }\n if (first !== againstFirst) {\n return { key, first, againstKey: againstKey!, againstFirst };\n }\n }\n return null;\n}\n\n/**\n * Canonical serialization — key order in the source file must not change the\n * id, or an innocuous reordering would break the payload/registry match.\n */\nexport function canonicalizeDictionary(\n translations: DictionaryTranslations,\n): string {\n const keys = Object.keys(translations).sort();\n const parts = keys.map((key) => {\n const byLocale = translations[key] ?? {};\n const locales = Object.keys(byLocale).sort();\n const inner = locales.map((l) => JSON.stringify([l, byLocale[l]])).join(\",\");\n return `${JSON.stringify(key)}:[${inner}]`;\n });\n return `{${parts.join(\",\")}}`;\n}\n\n/**\n * FNV-1a, run twice with different offsets for a 64-bit-wide id. No crypto\n * import, and it has to work identically in the browser bundle, under Bun on\n * the server, and inside the Vite plugin.\n */\nexport function dictionaryId(translations: DictionaryTranslations): string {\n const input = canonicalizeDictionary(translations);\n let a = 0x811c9dc5;\n let b = 0x01000193;\n for (let i = 0; i < input.length; i++) {\n const c = input.charCodeAt(i);\n a = Math.imul(a ^ c, 0x01000193);\n b = Math.imul(b ^ c, 0x811c9dc5);\n }\n const hex = (n: number) => (n >>> 0).toString(16).padStart(8, \"0\");\n return `d_${hex(a)}${hex(b)}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UAAU,CAAC,EAAG,EAAS,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,EAC3E,MAAO,GAAG,KAAK,UAAU,CAAG,MAAM,KACnC,EACgB,KAAK,GAAG,KAQpB,SAAS,CAAY,CAAC,EAA8C,CACzE,IAAM,EAAQ,EAAuB,CAAY,EAC7C,EAAI,WACJ,EAAI,SACR,QAAS,EAAI,EAAG,EAAI,EAAM,OAAQ,IAAK,CACrC,IAAM,EAAI,EAAM,WAAW,CAAC,EAC5B,EAAI,KAAK,KAAK,EAAI,EAAG,QAAU,EAC/B,EAAI,KAAK,KAAK,EAAI,EAAG,UAAU,EAEjC,IAAM,EAAM,CAAC,KAAe,IAAM,GAAG,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,EACjE,MAAO,KAAK,EAAI,CAAC,IAAI,EAAI,CAAC",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "0A30C02A8D41415564756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
class A extends Error{constructor(p,q){super(`Target [${p}] is not bound in the container.`+(q.length>0?` Bound tokens: ${q.join(", ")}.`:" No tokens are bound \u2014 was the application booted?"));this.name="BindingResolutionError"}}class C{bindings=new Map;instances=new Map;bind(p,q){this.bindings.set(p.token,{factory:q,shared:!1}),this.instances.delete(p.token)}singleton(p,q){this.bindings.set(p.token,{factory:q,shared:!0}),this.instances.delete(p.token)}instance(p,q){return this.instances.set(p.token,q),q}bound(p){return this.bindings.has(p.token)||this.instances.has(p.token)}resolved(p){return this.instances.has(p.token)}make(p){let q=p.token;if(this.instances.has(q))return this.instances.get(q);let v=this.bindings.get(q);if(!v)throw new A(q,this.keys());let x=v.factory(this);if(v.shared)this.instances.set(q,x);return x}forget(p){this.instances.delete(p.token)}keys(){return[...new Set([...this.bindings.keys(),...this.instances.keys()])]}flush(){this.bindings.clear(),this.instances.clear()}}
|
|
3
|
-
export{A as
|
|
3
|
+
export{A as dl,C as el};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=E51F47215812BAA864756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * Tokens are the service classes themselves, so `make(MailManager)` is typed\n * `MailManager` without a cast. The container keys its bindings off the class's\n * `static token` string rather than the constructor object: the built binary\n * (`dist/bin/gemi.js`) bundles its own copy of gemi while the app resolves\n * `gemi/*` to source, so the same service is two distinct class objects across\n * that boundary. A string survives it. Laravel binds both `'mail'` and\n * `MailManager::class` for the same reason.\n */\nexport type ServiceToken<T> = (abstract new (...args: any[]) => T) & {\n token: string;\n};\n\nexport type Factory<T> = (app: Container) => T;\n\ninterface Binding {\n factory: Factory<any>;\n shared: boolean;\n}\n\nexport class BindingResolutionError extends Error {\n constructor(token: string, known: string[]) {\n super(\n `Target [${token}] is not bound in the container.` +\n (known.length > 0\n ? ` Bound tokens: ${known.join(\", \")}.`\n : \" No tokens are bound — was the application booted?\"),\n );\n this.name = \"BindingResolutionError\";\n }\n}\n\nexport class Container {\n private bindings = new Map<string, Binding>();\n private instances = new Map<string, any>();\n\n bind<T>(token: ServiceToken<T>, factory: Factory<T>) {\n this.bindings.set(token.token, { factory, shared: false });\n this.instances.delete(token.token);\n }\n\n /**\n * Lazy by design — `factory` is not called until the first `make()`.\n */\n singleton<T>(token: ServiceToken<T>, factory: Factory<T>) {\n this.bindings.set(token.token, { factory, shared: true });\n this.instances.delete(token.token);\n }\n\n instance<T>(token: ServiceToken<T>, object: T): T {\n this.instances.set(token.token, object);\n return object;\n }\n\n bound<T>(token: ServiceToken<T>): boolean {\n return (\n this.bindings.has(token.token) || this.instances.has(token.token)\n );\n }\n\n resolved<T>(token: ServiceToken<T>): boolean {\n return this.instances.has(token.token);\n }\n\n make<T>(token: ServiceToken<T>): T {\n const key = token.token;\n\n if (this.instances.has(key)) {\n return this.instances.get(key) as T;\n }\n\n const binding = this.bindings.get(key);\n if (!binding) {\n throw new BindingResolutionError(key, this.keys());\n }\n\n const object = binding.factory(this) as T;\n if (binding.shared) {\n this.instances.set(key, object);\n }\n return object;\n }\n\n forget<T>(token: ServiceToken<T>) {\n this.instances.delete(token.token);\n }\n\n keys(): string[] {\n return [\n ...new Set([...this.bindings.keys(), ...this.instances.keys()]),\n ];\n }\n\n flush() {\n this.bindings.clear();\n this.instances.clear();\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAoBO,MAAM,UAA+B,KAAM,CAChD,WAAW,CAAC,EAAe,EAAiB,CAC1C,MACE,WAAW,qCACR,EAAM,OAAS,EACZ,kBAAkB,EAAM,KAAK,IAAI,KACjC,0DACR,EACA,KAAK,KAAO,yBAEhB,CAEO,MAAM,CAAU,CACb,SAAW,IAAI,IACf,UAAY,IAAI,IAExB,IAAO,CAAC,EAAwB,EAAqB,CACnD,KAAK,SAAS,IAAI,EAAM,MAAO,CAAE,UAAS,OAAQ,EAAM,CAAC,EACzD,KAAK,UAAU,OAAO,EAAM,KAAK,EAMnC,SAAY,CAAC,EAAwB,EAAqB,CACxD,KAAK,SAAS,IAAI,EAAM,MAAO,CAAE,UAAS,OAAQ,EAAK,CAAC,EACxD,KAAK,UAAU,OAAO,EAAM,KAAK,EAGnC,QAAW,CAAC,EAAwB,EAAc,CAEhD,OADA,KAAK,UAAU,IAAI,EAAM,MAAO,CAAM,EAC/B,EAGT,KAAQ,CAAC,EAAiC,CACxC,OACE,KAAK,SAAS,IAAI,EAAM,KAAK,GAAK,KAAK,UAAU,IAAI,EAAM,KAAK,EAIpE,QAAW,CAAC,EAAiC,CAC3C,OAAO,KAAK,UAAU,IAAI,EAAM,KAAK,EAGvC,IAAO,CAAC,EAA2B,CACjC,IAAM,EAAM,EAAM,MAElB,GAAI,KAAK,UAAU,IAAI,CAAG,EACxB,OAAO,KAAK,UAAU,IAAI,CAAG,EAG/B,IAAM,EAAU,KAAK,SAAS,IAAI,CAAG,EACrC,GAAI,CAAC,EACH,MAAM,IAAI,EAAuB,EAAK,KAAK,KAAK,CAAC,EAGnD,IAAM,EAAS,EAAQ,QAAQ,IAAI,EACnC,GAAI,EAAQ,OACV,KAAK,UAAU,IAAI,EAAK,CAAM,EAEhC,OAAO,EAGT,MAAS,CAAC,EAAwB,CAChC,KAAK,UAAU,OAAO,EAAM,KAAK,EAGnC,IAAI,EAAa,CACf,MAAO,CACL,GAAG,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,KAAK,EAAG,GAAG,KAAK,UAAU,KAAK,CAAC,CAAC,CAChE,EAGF,KAAK,EAAG,CACN,KAAK,SAAS,MAAM,EACpB,KAAK,UAAU,MAAM,EAEzB",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "E51F47215812BAA864756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lj as P,zj as X}from"./chunk-8tyw6faf.js";function f(){return{now:new Date,resolved:{}}}var b={now:new Date(0),resolved:{}};function x(z){return(G,H=b)=>{let V=[];for(let Z=0;Z<z.length;Z++)V.push(z[Z](G,H));return V}}var j="\x00";function W(z){return{text:z,binders:[]}}function Q(z,G=""){return{text:j+G,binders:[z]}}function p(z){return z.text.split(j)}function m(z,G){return{text:z.join(j),binders:G}}function $(...z){return I(z,"")}function I(z,G){let H="",V=[];for(let Z=0;Z<z.length;Z++){if(Z>0)H+=G;H+=z[Z].text;for(let Y of z[Z].binders)V.push(Y)}return{text:H,binders:V}}function c(z,G,H){let V=z.text.split(j),Z=V.length-1;if(Z!==z.binders.length)throw Error(`Compiled ${Z} parameter placeholders but collected ${z.binders.length} binders.`);if(Z>G.maxBoundParameters)throw new P(H.model,H.operation,Z,G.maxBoundParameters,G.name,G.bindsListAsOneParameter?"That is one parameter per value in the statement.":`That is one parameter per value, and on ${G.name} each element of an 'in' list counts separately.`);let Y=V[0];for(let B=0;B<Z;B++)Y+=G.placeholder(B)+V[B+1];return{text:Y,binders:z.binders}}class K{name="postgres";supportsInsensitiveMode=!0;bindsListAsOneParameter=!0;supportsReturning=!0;maxBoundParameters=65535;typesParametersFromStatement=!0;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return`$${z+1}`}inList(z,G,H,V){return $(W(`${z} ${G?"<> all":"= any"} (`),Q((Y,B)=>C(V(Y,B))),W(")"))}static COMPOSITE_IN_TYPES={Int:"int",BigInt:"bigint",String:"text",Boolean:"boolean"};canBindCompositeIn(z){return z.length>0&&z.every((G)=>K.COMPOSITE_IN_TYPES[G])}compositeIn(z,G,H){let V=z.map((Z,Y)=>$(Q((B,J)=>C(H(B,J).map((F)=>F[Y]))),W(`::${K.COMPOSITE_IN_TYPES[G[Y]]}[]`)));return $(W(`(${z.join(", ")}) in (select * from unnest(`),...V.flatMap((Z,Y)=>Y===0?[Z]:[W(", "),Z]),W("))"))}listFilters=new Set(["equals","has","hasEvery","hasSome","isEmpty"]);listHas(z,G){return $(G,W(` = any(${z})`))}listHasEvery(z,G){return $(W(`${z} @> `),G)}listHasSome(z,G){return $(W(`${z} && `),G)}listIsEmpty(z,G){return $(W(`${z} ${G?"=":"<>"} `),Q(()=>C([])))}listPush(z,G){return $(W(`array_cat(${z}, `),G,W(")"))}jsonPathSyntax="array";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"]);jsonComparesAsText=!0;jsonExtract(z,G,H){return $(W(`${z} ${H?"#>>":"#>"} `),Q((V,Z)=>C(G(V,Z))))}jsonValueAt(z,G){return $(W("("),this.jsonExtract(z,G,!1),W(")::jsonb"))}jsonHasKeys(z,G,H,V){let Z=()=>G===void 0?W(`(${z})::jsonb`):$(W("("),this.jsonExtract(z,G,!1),W(")::jsonb")),Y=V==="one"?$(Q(H),W("::text")):$(Q((J,F)=>C(H(J,F)??[])),W("::text[]")),B=V==="one"?"?":V==="some"?"?|":"?&";return $(W("(jsonb_typeof("),Z(),W(") = 'object' and "),Z(),W(` ${B} `),Y,W(")"))}distinctFrom(z,G,H){let V=H.type==="Json"&&!H.isList;return $(W(V?`(${z})::jsonb is distinct from `:`${z} is distinct from `),G)}jsonArrayContains(z,G,H){return $(W("("),this.jsonExtract(z,G,!1),W(") @> "),Q((V,Z)=>{let Y=H(V,Z);if(Y===null||Y===void 0)return null;return typeof Y==="string"||typeof Y==="object"?Y:JSON.stringify(Y)}),W("::jsonb"))}like(z,G,H){return $(W(`${z} ${G?"ilike":"like"} `),Q(H))}ignoreConflicts(){return W(" on conflict do nothing")}rowLock(z,G){let H=z.onLocked==="skipLocked"?" skip locked":z.onLocked==="noWait"?" nowait":"";return W(` for ${z.mode==="share"?"share":"update"} of ${this.quoteIdent(G)}${H}`)}paginate(z,G){let H=[];if(z)H.push($(W(" limit "),Q(z)));if(G)H.push($(W(" offset "),Q(G)));return $(...H)}constraintViolation(z){let G=z;if(!G)return null;if(String(G.errno??G.code??"")!=="23505")return null;let V=typeof G.constraint==="string"&&G.constraint!==""?G.constraint:void 0,Z=typeof G.detail==="string"?G.detail:"",Y=/\((.+?)\)=/.exec(Z);return{kind:"unique",columns:Y?(Y[1].match(/"(?:[^"]|"")*"|[^,]+/g)??[]).map((J)=>J.trim()).filter((J)=>J!=="").map((J)=>/^".*"$/s.test(J)?J.slice(1,-1).replace(/""/g,'"'):J):[],constraint:V}}castParameter(z){if(z.isList)return"";return z.type==="Json"?"::text::jsonb":""}encode(z,G){if(z===null||z===void 0)return null;if(G.isList){if(!Array.isArray(z))throw Error(`gemi ORM bug: a non-array reached the parameter binder for the scalar list '${G.column}' (received ${typeof z}). Every path that binds a list is supposed to have checked its operand.`);return C(G.type==="Json"?z.map((H)=>H===null||H===void 0?null:JSON.stringify(H)):z)}return z}encodeUntyped(z){return z}needsDecode(z){return z.isList===!0||z.type==="BigInt"||z.type==="Bytes"}decode(z,G){if(z===null||z===void 0)return null;if(G.isList)return this.decodeList(z,G);return this.decodeScalar(z,G)}decodeList(z,G){let H=Array.isArray(z)?z:typeof z==="string"?E(z,G):ArrayBuffer.isView(z)?Array.from(z):null;if(H===null)throw new X(G,z);return H.map((V)=>V===null||V===void 0?null:this.decodeScalar(V,G))}decodeScalar(z,G){switch(G.type){case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":return z;case"Bytes":return Buffer.isBuffer(z)?new Uint8Array(z.buffer,z.byteOffset,z.byteLength):z;default:return z}}}function C(z){let G="{";for(let H=0;H<z.length;H++){if(H>0)G+=",";G+=D(z[H])}return G+"}"}function D(z){if(z===null||z===void 0)return"NULL";if(z instanceof Date)return`"${z.toISOString()}"`;if(ArrayBuffer.isView(z)){let H="";for(let V of new Uint8Array(z.buffer,z.byteOffset,z.byteLength))H+=V.toString(16).padStart(2,"0");return`"\\\\x${H}"`}return`"${(typeof z==="string"?z:String(z)).replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`}function E(z,G){if(!z.startsWith("{")||!z.endsWith("}"))throw new X(G,z);if(z==="{}")return[];let H=[],V=1,Z=z.length-1;while(V<=Z){let Y="",B=!1;if(z[V]==='"'){B=!0,V++;while(V<Z&&z[V]!=='"')Y+=z[V]==="\\"?z[++V]:z[V],V++;V++}else while(V<Z&&z[V]!==","){if(z[V]==="{")throw new X(G,z);Y+=z[V],V++}if(H.push(!B&&Y.toUpperCase()==="NULL"?null:Y),V<Z&&z[V]!==",")throw new X(G,z);V++}if(G.type!=="Json")return H;return H.map((Y)=>{if(Y===null)return null;try{return JSON.parse(Y)}catch{throw new X(G,Y)}})}var k={"Prisma.DbNull":"db","Prisma.JsonNull":"json","Prisma.AnyNull":"any"};function _(z){return new class{toString(){return z}}}var s=_("Prisma.DbNull"),y=_("Prisma.JsonNull"),u=_("Prisma.AnyNull"),r=y;function A(z){if(typeof z!=="object"||z===null)return null;for(let H in z)return null;if(Object.getOwnPropertyNames(z).length>0)return null;let G;try{G=String(z)}catch{return null}return k[G]??null}var h=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(\.\d+)?$/;function q(z,G){if(z instanceof Date)return z;let H;if(typeof z==="number")H=new Date(z);else if(typeof z==="bigint")H=new Date(Number(z));else if(typeof z==="string")H=new Date(h.test(z)?`${z.replace(" ","T")}Z`:z);else throw new X(G,z);if(Number.isNaN(H.getTime()))throw new X(G,z);return H}class S{name="sqlite";supportsInsensitiveMode=!1;bindsListAsOneParameter=!1;supportsReturning=!0;maxBoundParameters=32766;typesParametersFromStatement=!1;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return"?"}inList(z,G,H,V){let Z=G?"not in":"in",Y=[];for(let B=0;B<H;B++)Y.push(Q((J,F)=>V(J,F)[B]));return $(W(`${z} ${Z} (`),I(Y,", "),W(")"))}canBindCompositeIn(){return!1}compositeIn(){throw Error("SQLite cannot bind a composite `in`; `canBindCompositeIn` is the guard.")}listFilters=new Set;listHas(){throw Error(N("has"))}listHasEvery(){throw Error(N("hasEvery"))}listHasSome(){throw Error(N("hasSome"))}listIsEmpty(){throw Error(N("isEmpty"))}listPush(){throw Error(N("push"))}jsonPathSyntax="jsonpath";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with"]);jsonComparesAsText=!1;jsonExtract(z,G,H){return $(W(`json_extract(${z}, `),Q(G),W(")"))}jsonValueAt(z,G){return $(W(`(${z} -> `),Q(G),W(")"))}jsonHasKeys(z,G,H,V,Z){let Y=(O,U)=>G===void 0?"$":G(O,U),B=(O)=>$(W(`json_type(${z}, `),Q((U,M)=>{let w=H(U,M),L=O===void 0?w:w[O];return`${Y(U,M)}.${JSON.stringify(String(L))}`}),W(") is not null")),J=V==="one"?[B(void 0)]:Array.from({length:Z},(O,U)=>B(U)),F=J.length===0?W(V==="some"?"0":"1"):I(J,V==="every"?" and ":" or ");return $(W(`(json_type(${z}, `),Q(Y),W(") = 'object' and ("),F,W("))"))}distinctFrom(z,G,H){if(H.type==="Json"&&!H.isList)return $(W(`json(${z}) is not json(`),G,W(")"));return $(W(`${z} is not `),G)}jsonArrayContains(){throw Error("SQLite cannot express array_contains; `jsonFilters` is the guard.")}like(z,G,H){return $(W(`${z} like `),Q(H))}ignoreConflicts(){return null}rowLock(z,G){return W("")}paginate(z,G){if(!z&&!G)return W("");if(!G)return $(W(" limit "),Q(z));return $(W(" limit "),Q(z??(()=>-1)),W(" offset "),Q(G))}constraintViolation(z){let G=z?.code;if(G!=="SQLITE_CONSTRAINT_UNIQUE"&&G!=="SQLITE_CONSTRAINT_PRIMARYKEY")return null;let H=String(z.message??""),V=/constraint failed:\s*(.+)$/.exec(H);if(!V)return{kind:"unique",columns:[]};return{kind:"unique",columns:V[1].split(",").map((Y)=>Y.trim()).map((Y)=>{let B=Y.indexOf(".");return B===-1?Y:Y.slice(B+1)}).filter((Y)=>Y!=="")}}castParameter(z){return""}encode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return z instanceof Date?z.getTime():z;case"Boolean":return typeof z==="boolean"?z?1:0:z;case"Json":{let H=A(z);if(H==="db")return null;if(H==="json")return"null";if(H==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the SQLite encoder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.")}return JSON.stringify(z);default:return z}}encodeUntyped(z){if(z instanceof Date)return z.getTime();if(typeof z==="boolean")return z?1:0;return z}needsDecode(z){switch(z.type){case"DateTime":case"Boolean":case"BigInt":case"Json":return!0;default:return!1}}decode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return q(z,G);case"Boolean":if(typeof z==="boolean")return z;return Number(z)!==0;case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":try{return typeof z==="string"?JSON.parse(z):z}catch{throw new X(G,z)}default:return z}}}function N(z){return`SQLite has no array type, so it cannot express '${z}' on a scalar list; \`listFilters\` is the guard.`}class R extends Error{constructor(z){super(`The gemi ORM does not support the '${z}' dialect. Only sqlite `+"and postgres are implemented \u2014 see the supported matrix in "+`docs/orm.md.
|
|
2
|
+
import{Aj as X,Mj as P}from"./chunk-1btx3kkv.js";function f(){return{now:new Date,resolved:{}}}var b={now:new Date(0),resolved:{}};function x(z){return(G,H=b)=>{let V=[];for(let Z=0;Z<z.length;Z++)V.push(z[Z](G,H));return V}}var j="\x00";function W(z){return{text:z,binders:[]}}function Q(z,G=""){return{text:j+G,binders:[z]}}function p(z){return z.text.split(j)}function m(z,G){return{text:z.join(j),binders:G}}function $(...z){return I(z,"")}function I(z,G){let H="",V=[];for(let Z=0;Z<z.length;Z++){if(Z>0)H+=G;H+=z[Z].text;for(let Y of z[Z].binders)V.push(Y)}return{text:H,binders:V}}function c(z,G,H){let V=z.text.split(j),Z=V.length-1;if(Z!==z.binders.length)throw Error(`Compiled ${Z} parameter placeholders but collected ${z.binders.length} binders.`);if(Z>G.maxBoundParameters)throw new P(H.model,H.operation,Z,G.maxBoundParameters,G.name,G.bindsListAsOneParameter?"That is one parameter per value in the statement.":`That is one parameter per value, and on ${G.name} each element of an 'in' list counts separately.`);let Y=V[0];for(let B=0;B<Z;B++)Y+=G.placeholder(B)+V[B+1];return{text:Y,binders:z.binders}}class K{name="postgres";supportsInsensitiveMode=!0;bindsListAsOneParameter=!0;supportsReturning=!0;maxBoundParameters=65535;typesParametersFromStatement=!0;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return`$${z+1}`}inList(z,G,H,V){return $(W(`${z} ${G?"<> all":"= any"} (`),Q((Y,B)=>C(V(Y,B))),W(")"))}static COMPOSITE_IN_TYPES={Int:"int",BigInt:"bigint",String:"text",Boolean:"boolean"};canBindCompositeIn(z){return z.length>0&&z.every((G)=>K.COMPOSITE_IN_TYPES[G])}compositeIn(z,G,H){let V=z.map((Z,Y)=>$(Q((B,J)=>C(H(B,J).map((F)=>F[Y]))),W(`::${K.COMPOSITE_IN_TYPES[G[Y]]}[]`)));return $(W(`(${z.join(", ")}) in (select * from unnest(`),...V.flatMap((Z,Y)=>Y===0?[Z]:[W(", "),Z]),W("))"))}listFilters=new Set(["equals","has","hasEvery","hasSome","isEmpty"]);listHas(z,G){return $(G,W(` = any(${z})`))}listHasEvery(z,G){return $(W(`${z} @> `),G)}listHasSome(z,G){return $(W(`${z} && `),G)}listIsEmpty(z,G){return $(W(`${z} ${G?"=":"<>"} `),Q(()=>C([])))}listPush(z,G){return $(W(`array_cat(${z}, `),G,W(")"))}jsonPathSyntax="array";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"]);jsonComparesAsText=!0;jsonExtract(z,G,H){return $(W(`${z} ${H?"#>>":"#>"} `),Q((V,Z)=>C(G(V,Z))))}jsonValueAt(z,G){return $(W("("),this.jsonExtract(z,G,!1),W(")::jsonb"))}jsonHasKeys(z,G,H,V){let Z=()=>G===void 0?W(`(${z})::jsonb`):$(W("("),this.jsonExtract(z,G,!1),W(")::jsonb")),Y=V==="one"?$(Q(H),W("::text")):$(Q((J,F)=>C(H(J,F)??[])),W("::text[]")),B=V==="one"?"?":V==="some"?"?|":"?&";return $(W("(jsonb_typeof("),Z(),W(") = 'object' and "),Z(),W(` ${B} `),Y,W(")"))}distinctFrom(z,G,H){let V=H.type==="Json"&&!H.isList;return $(W(V?`(${z})::jsonb is distinct from `:`${z} is distinct from `),G)}jsonArrayContains(z,G,H){return $(W("("),this.jsonExtract(z,G,!1),W(") @> "),Q((V,Z)=>{let Y=H(V,Z);if(Y===null||Y===void 0)return null;return typeof Y==="string"||typeof Y==="object"?Y:JSON.stringify(Y)}),W("::jsonb"))}like(z,G,H){return $(W(`${z} ${G?"ilike":"like"} `),Q(H))}ignoreConflicts(){return W(" on conflict do nothing")}rowLock(z,G){let H=z.onLocked==="skipLocked"?" skip locked":z.onLocked==="noWait"?" nowait":"";return W(` for ${z.mode==="share"?"share":"update"} of ${this.quoteIdent(G)}${H}`)}paginate(z,G){let H=[];if(z)H.push($(W(" limit "),Q(z)));if(G)H.push($(W(" offset "),Q(G)));return $(...H)}constraintViolation(z){let G=z;if(!G)return null;if(String(G.errno??G.code??"")!=="23505")return null;let V=typeof G.constraint==="string"&&G.constraint!==""?G.constraint:void 0,Z=typeof G.detail==="string"?G.detail:"",Y=/\((.+?)\)=/.exec(Z);return{kind:"unique",columns:Y?(Y[1].match(/"(?:[^"]|"")*"|[^,]+/g)??[]).map((J)=>J.trim()).filter((J)=>J!=="").map((J)=>/^".*"$/s.test(J)?J.slice(1,-1).replace(/""/g,'"'):J):[],constraint:V}}castParameter(z){if(z.isList)return"";return z.type==="Json"?"::text::jsonb":""}encode(z,G){if(z===null||z===void 0)return null;if(G.isList){if(!Array.isArray(z))throw Error(`gemi ORM bug: a non-array reached the parameter binder for the scalar list '${G.column}' (received ${typeof z}). Every path that binds a list is supposed to have checked its operand.`);return C(G.type==="Json"?z.map((H)=>H===null||H===void 0?null:JSON.stringify(H)):z)}return z}encodeUntyped(z){return z}needsDecode(z){return z.isList===!0||z.type==="BigInt"||z.type==="Bytes"}decode(z,G){if(z===null||z===void 0)return null;if(G.isList)return this.decodeList(z,G);return this.decodeScalar(z,G)}decodeList(z,G){let H=Array.isArray(z)?z:typeof z==="string"?E(z,G):ArrayBuffer.isView(z)?Array.from(z):null;if(H===null)throw new X(G,z);return H.map((V)=>V===null||V===void 0?null:this.decodeScalar(V,G))}decodeScalar(z,G){switch(G.type){case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":return z;case"Bytes":return Buffer.isBuffer(z)?new Uint8Array(z.buffer,z.byteOffset,z.byteLength):z;default:return z}}}function C(z){let G="{";for(let H=0;H<z.length;H++){if(H>0)G+=",";G+=D(z[H])}return G+"}"}function D(z){if(z===null||z===void 0)return"NULL";if(z instanceof Date)return`"${z.toISOString()}"`;if(ArrayBuffer.isView(z)){let H="";for(let V of new Uint8Array(z.buffer,z.byteOffset,z.byteLength))H+=V.toString(16).padStart(2,"0");return`"\\\\x${H}"`}return`"${(typeof z==="string"?z:String(z)).replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`}function E(z,G){if(!z.startsWith("{")||!z.endsWith("}"))throw new X(G,z);if(z==="{}")return[];let H=[],V=1,Z=z.length-1;while(V<=Z){let Y="",B=!1;if(z[V]==='"'){B=!0,V++;while(V<Z&&z[V]!=='"')Y+=z[V]==="\\"?z[++V]:z[V],V++;V++}else while(V<Z&&z[V]!==","){if(z[V]==="{")throw new X(G,z);Y+=z[V],V++}if(H.push(!B&&Y.toUpperCase()==="NULL"?null:Y),V<Z&&z[V]!==",")throw new X(G,z);V++}if(G.type!=="Json")return H;return H.map((Y)=>{if(Y===null)return null;try{return JSON.parse(Y)}catch{throw new X(G,Y)}})}var k={"Prisma.DbNull":"db","Prisma.JsonNull":"json","Prisma.AnyNull":"any"};function _(z){return new class{toString(){return z}}}var s=_("Prisma.DbNull"),y=_("Prisma.JsonNull"),u=_("Prisma.AnyNull"),r=y;function A(z){if(typeof z!=="object"||z===null)return null;for(let H in z)return null;if(Object.getOwnPropertyNames(z).length>0)return null;let G;try{G=String(z)}catch{return null}return k[G]??null}var h=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(\.\d+)?$/;function q(z,G){if(z instanceof Date)return z;let H;if(typeof z==="number")H=new Date(z);else if(typeof z==="bigint")H=new Date(Number(z));else if(typeof z==="string")H=new Date(h.test(z)?`${z.replace(" ","T")}Z`:z);else throw new X(G,z);if(Number.isNaN(H.getTime()))throw new X(G,z);return H}class S{name="sqlite";supportsInsensitiveMode=!1;bindsListAsOneParameter=!1;supportsReturning=!0;maxBoundParameters=32766;typesParametersFromStatement=!1;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return"?"}inList(z,G,H,V){let Z=G?"not in":"in",Y=[];for(let B=0;B<H;B++)Y.push(Q((J,F)=>V(J,F)[B]));return $(W(`${z} ${Z} (`),I(Y,", "),W(")"))}canBindCompositeIn(){return!1}compositeIn(){throw Error("SQLite cannot bind a composite `in`; `canBindCompositeIn` is the guard.")}listFilters=new Set;listHas(){throw Error(N("has"))}listHasEvery(){throw Error(N("hasEvery"))}listHasSome(){throw Error(N("hasSome"))}listIsEmpty(){throw Error(N("isEmpty"))}listPush(){throw Error(N("push"))}jsonPathSyntax="jsonpath";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with"]);jsonComparesAsText=!1;jsonExtract(z,G,H){return $(W(`json_extract(${z}, `),Q(G),W(")"))}jsonValueAt(z,G){return $(W(`(${z} -> `),Q(G),W(")"))}jsonHasKeys(z,G,H,V,Z){let Y=(O,U)=>G===void 0?"$":G(O,U),B=(O)=>$(W(`json_type(${z}, `),Q((U,M)=>{let w=H(U,M),L=O===void 0?w:w[O];return`${Y(U,M)}.${JSON.stringify(String(L))}`}),W(") is not null")),J=V==="one"?[B(void 0)]:Array.from({length:Z},(O,U)=>B(U)),F=J.length===0?W(V==="some"?"0":"1"):I(J,V==="every"?" and ":" or ");return $(W(`(json_type(${z}, `),Q(Y),W(") = 'object' and ("),F,W("))"))}distinctFrom(z,G,H){if(H.type==="Json"&&!H.isList)return $(W(`json(${z}) is not json(`),G,W(")"));return $(W(`${z} is not `),G)}jsonArrayContains(){throw Error("SQLite cannot express array_contains; `jsonFilters` is the guard.")}like(z,G,H){return $(W(`${z} like `),Q(H))}ignoreConflicts(){return null}rowLock(z,G){return W("")}paginate(z,G){if(!z&&!G)return W("");if(!G)return $(W(" limit "),Q(z));return $(W(" limit "),Q(z??(()=>-1)),W(" offset "),Q(G))}constraintViolation(z){let G=z?.code;if(G!=="SQLITE_CONSTRAINT_UNIQUE"&&G!=="SQLITE_CONSTRAINT_PRIMARYKEY")return null;let H=String(z.message??""),V=/constraint failed:\s*(.+)$/.exec(H);if(!V)return{kind:"unique",columns:[]};return{kind:"unique",columns:V[1].split(",").map((Y)=>Y.trim()).map((Y)=>{let B=Y.indexOf(".");return B===-1?Y:Y.slice(B+1)}).filter((Y)=>Y!=="")}}castParameter(z){return""}encode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return z instanceof Date?z.getTime():z;case"Boolean":return typeof z==="boolean"?z?1:0:z;case"Json":{let H=A(z);if(H==="db")return null;if(H==="json")return"null";if(H==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the SQLite encoder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.")}return JSON.stringify(z);default:return z}}encodeUntyped(z){if(z instanceof Date)return z.getTime();if(typeof z==="boolean")return z?1:0;return z}needsDecode(z){switch(z.type){case"DateTime":case"Boolean":case"BigInt":case"Json":return!0;default:return!1}}decode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return q(z,G);case"Boolean":if(typeof z==="boolean")return z;return Number(z)!==0;case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":try{return typeof z==="string"?JSON.parse(z):z}catch{throw new X(G,z)}default:return z}}}function N(z){return`SQLite has no array type, so it cannot express '${z}' on a scalar list; \`listFilters\` is the guard.`}class R extends Error{constructor(z){super(`The gemi ORM does not support the '${z}' dialect. Only sqlite `+"and postgres are implemented \u2014 see the supported matrix in "+`docs/orm.md.
|
|
3
3
|
|
|
4
4
|
The *connection* is fine: Bun's client speaks ${z}, so raw SQL through DB.query / DB.sql and transactions all work. It is the query compiler that has no ${z} dialect, so every model operation raises this.
|
|
5
5
|
|
|
6
6
|
Point DATABASE_URL at Postgres or SQLite to use the ORM, or keep using Prisma's own client for this database.`);this.name="UnsupportedDialectError"}}function Vz(z){return T[z]!==null}function Wz(){return Object.keys(T)}var T={sqlite:new S,postgres:new K,mysql:null,mariadb:null};function Yz(z){let G=T[z];if(G===null)throw new R(z);return G}
|
|
7
|
-
export{f as
|
|
7
|
+
export{f as kh,x as lh,W as mh,Q as nh,p as oh,m as ph,$ as qh,I as rh,c as sh,K as th,s as uh,y as vh,u as wh,r as xh,A as yh,S as zh,R as Ah,Vz as Bh,Wz as Ch,Yz as Dh};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
9
|
+
//# debugId=656D7F3819B4AD9064756E2164756E21
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"import type { Dialect } from \"../../database/dialect\";\nimport type { Binder, Fragment } from \"../compile/fragment\";\nimport type { RowLockClause } from \"../compile/lock\";\nimport type { FieldSchema, ScalarType } from \"../schema\";\nimport { PostgresDialect } from \"./postgres\";\nimport { SqliteDialect } from \"./sqlite\";\n\n/**\n * The per-database strategy.\n *\n * The rule this interface exists to enforce: no `if (dialect === \"postgres\")`\n * ever appears inside the compiler. When something genuinely cannot be\n * expressed through the interface, the interface widens — which is why\n * `inList`, `like` and `paginate` return `Fragment`s rather than strings. Each\n * of the three is a place where SQLite and Postgres disagree about *structure*,\n * not just spelling:\n *\n * - `inList` — SQLite expands one placeholder per element, so `in: [1,2]` and\n * `in: [1,2,3]` are different SQL and different plans. Postgres binds the\n * whole array to one parameter with `= any($1)`, so every length shares a\n * single plan and a single prepared statement.\n * - `like` — Postgres has `ilike` for `mode: \"insensitive\"`; SQLite has no\n * equivalent, and Prisma rejects the argument there outright.\n * - `paginate` — SQLite cannot parse `offset` without a preceding `limit`.\n */\nexport interface SqlDialect {\n readonly name: Dialect;\n\n /**\n * Whether `mode: \"insensitive\"` can be expressed at all. False on SQLite,\n * where Prisma rejects the argument rather than emulating it.\n */\n readonly supportsInsensitiveMode: boolean;\n\n /**\n * Whether an `in` list binds as a single parameter however long it is.\n *\n * True on Postgres (`= any($1)`), false on SQLite (`in (?, ?, ?)`). It is the\n * plan *cache* that needs to know: where the length does not change the SQL\n * text, it must not change the cache key either, or every distinct list\n * length mints another entry holding SQL identical to its neighbours'. That\n * matters most for relations, where the list length is the parent row count\n * and so varies with the data rather than with the code.\n */\n readonly bindsListAsOneParameter: boolean;\n\n /**\n * Whether `insert`/`update`/`delete` can return the rows they touched.\n *\n * True on both implemented dialects — Postgres has had `RETURNING` forever,\n * and SQLite since 3.35 (Bun 1.3.14 bundles 3.51.0, verified by querying\n * `sqlite_version()` rather than by reading a changelog).\n *\n * It is a capability rather than an assumption because MySQL and MariaDB have\n * no `RETURNING` at all. Their fallback — `lastInsertRowid` plus a re-select,\n * and no way to identify the rows an `updateMany` touched — is a different\n * statement shape, not a different spelling. Iteration 4 does not build it,\n * but it must stay expressible, so the write compiler asks rather than\n * assumes and raises a clear error when the answer is no.\n */\n readonly supportsReturning: boolean;\n\n /**\n * How many parameters one statement may bind.\n *\n * A hard protocol/driver limit, not a tuning knob: Postgres sends the\n * parameter count as an int16 in the Bind message, and SQLite compiles\n * `SQLITE_MAX_VARIABLE_NUMBER` in.\n *\n * Three shapes can approach it, all of them scaling with the caller's *data*\n * rather than with the query's shape:\n *\n * - `createMany`, at `rows × columns`.\n * - An `in` list on SQLite, which binds one placeholder per element — and\n * such a list is routinely request-derived (`?ids=…`).\n * - A to-many `include` on SQLite, which batches an `in` over the parent\n * keys, so a large enough `findMany` reaches it with no big list in sight.\n *\n * Postgres escapes the last two: `= any($1)` is one parameter however long\n * the array. The check itself lives in `compile/fragment.ts`'s `render`,\n * because that is the one place that sees a statement's final count.\n *\n * It lives *here* rather than as a constant in the compiler for the usual\n * reason: the number differs per dialect, and the compiler is not allowed to\n * know which dialect it is compiling for.\n */\n readonly maxBoundParameters: number;\n\n /**\n * Whether the **statement** decides a parameter's type, so a cast the caller\n * wrote onto their own placeholder changes how the driver encodes the value.\n *\n * True on Postgres: the server describes the statement, the client is told\n * the parameter is `jsonb`, and Bun then JSON-*encodes* whatever JS value it\n * was handed. That is the whole of #376 — the reason `json-param.ts` retypes\n * such a parameter through `text` and serialises it to match.\n *\n * False on SQLite, and not merely because the correction is unnecessary\n * there: it would be **wrong**, and it would not parse. A parameter's type is\n * the bound value's, and `cast(x as json)` is not a JSON cast at all — SQLite\n * takes any type name and applies affinity rules, and a name containing none\n * of INT/CHAR/CLOB/TEXT/BLOB/REAL/FLOA/DOUB gets NUMERIC affinity, so\n * `cast('{\"a\":1}' as json)` is `0`. Measured through `bun:sqlite` (Bun\n * 1.3.14):\n *\n * select cast(? as jsonb) -> 0 (runs)\n * select json_set('{\"a\":1}','$.b', cast(? as json)) -> {\"a\":1,\"b\":2}\n * select cast(? as text)::json -> ERROR unrecognized token: \":\"\n *\n * So the retyping's rewrite — `cast(? as text)::json` — turns a statement\n * that runs on SQLite today into a syntax error. `::` genuinely cannot fire\n * there (it does not parse), but `cast(… as …)` is not Postgres-only syntax,\n * and \"SQLite has no jsonb type\" is a claim about semantics rather than about\n * what the parser accepts. Asking here rather than matching on `name` is what\n * makes that a fact `tsc` and a test can hold.\n */\n readonly typesParametersFromStatement: boolean;\n\n /** Quote a table or column name. Only ever called with names from the schema. */\n quoteIdent(name: string): string;\n\n /**\n * The parameter marker for the `index`-th (0-based) parameter in a statement.\n * SQLite ignores the index and returns `?`; Postgres returns `$1`, `$2`, ...\n */\n placeholder(index: number): string;\n\n /**\n * Prisma-shaped value -> the value the driver must be handed for this field.\n * The mirror of `decode`, and just as load-bearing: Bun's SQLite driver binds\n * a `Date` to `NULL`, so an unencoded `where: { createdAt: date }` would\n * return no rows rather than failing.\n *\n * Applied at bind time, not compile time — it is a function of the value.\n * Which encoder runs is still decided from the schema, so compile stays pure.\n */\n encode(value: unknown, field: FieldSchema): unknown;\n\n /**\n * SQL appended to this field's placeholder, or `\"\"` for none.\n *\n * The one string a dialect contributes to the statement that is not a\n * parameter, so it must be a constant — never derived from a value, and never\n * from anything an application supplies. `fieldParam` is the only caller, and\n * a non-empty cast also means it serialises the value; the two travel\n * together and neither is correct alone (#209).\n */\n castParameter(field: FieldSchema): string;\n\n /**\n * The same, for a value with **no declared column type** — a parameter\n * interpolated into a composed raw fragment, where there is no schema to ask.\n *\n * It exists because \"raw\" cannot mean \"unportable\". Bun's SQLite driver\n * rejects a `Date` outright (`Binding expected string, TypedArray, boolean,\n * number, bigint or null`) while Postgres takes one, so\n * ``sql`where \"createdAt\" > ${date}` `` would work on one dialect and throw on\n * the other — and the caller has no dialect-independent value to reach for\n * instead, because milliseconds are only correct if that is what the ORM\n * stored. Which it is: this converts to exactly what `encode` writes for a\n * `DateTime`, so a raw statement compares against ORM-written rows correctly.\n *\n * Deliberately narrow. It normalises the JavaScript types whose SQL form the\n * ORM has already decided — a `Date`, a boolean — and touches nothing else. A\n * plain object is *not* JSON-encoded here: the compiler only knows to do that\n * because a field says `Json`, and guessing from the value would turn a\n * mistyped parameter into a successfully-written string.\n *\n * The exception is a parameter the *caller* cast to `json`/`jsonb`, which is\n * a declared type by another route and does not reach this at all — see\n * `json-param.ts`. It is still not a guess from the value: the statement says\n * so.\n */\n encodeUntyped(value: unknown): unknown;\n\n /** Driver value -> the value Prisma would have returned for this field. */\n decode(value: unknown, field: FieldSchema): unknown;\n\n /**\n * False when the driver already returns exactly what Prisma would for this\n * field, letting the shaper skip the call entirely on the hot path.\n */\n needsDecode(field: FieldSchema): boolean;\n\n /**\n * `<lhs> in (...)` / `<lhs> not in (...)`.\n *\n * `length` is the element count, which is shape information and is already\n * part of the plan key. `values` returns the whole array at bind time; how it\n * is spread across parameters is the dialect's business.\n */\n inList(\n lhs: string,\n negated: boolean,\n length: number,\n values: Binder,\n ): Fragment;\n\n /** `<lhs> like <pattern>`, case-insensitively when the dialect can. */\n like(lhs: string, insensitive: boolean, pattern: Binder): Fragment;\n\n /**\n * Whether this dialect can match a **tuple** of columns against a list of\n * tuples in a statement whose text does not grow with the list.\n *\n * The single-column case is `inList`, and on Postgres `= any($1)` already\n * gives one SQL text for every length — which is what lets `collapsedList`\n * keep a batched relation query to one plan entry however many parents it\n * has. A relation joining on *more than one* field cannot use it, so the\n * loader falls back to an `OR` of `AND`s whose text does grow, and the plan\n * cache churns with the parent count (#97).\n *\n * `unnest` closes that on Postgres — one array parameter per *column*, so the\n * text is fixed — but it needs each column's SQL type for the cast, and the\n * types are asked about here rather than assumed: a dialect that cannot spell\n * one of them says so and the caller keeps the portable `OR`.\n */\n canBindCompositeIn(types: readonly ScalarType[]): boolean;\n\n /**\n * `(a, b) in (select * from unnest($1::t[], $2::u[]))`.\n *\n * `values` yields one tuple per parent at bind time; the dialect decides how\n * they are transposed into per-column arrays. Only called when\n * {@link canBindCompositeIn} returned true for these types.\n */\n compositeIn(\n columns: readonly string[],\n types: readonly ScalarType[],\n values: Binder,\n ): Fragment;\n\n /**\n * The filters this dialect can apply to a **scalar list** — `tags String[]`.\n *\n * **Empty is the whole of SQLite's answer**, and it is a capability rather\n * than a gap in this ORM: SQLite has no array type, and Prisma refuses the\n * declaration there at validation time — *\"Field `tags` in model `User` can't\n * be a list. The current connector does not support lists of primitive\n * types.\"* So a SQLite database cannot hold such a column to begin with.\n *\n * The refusal lives here rather than in the generator, which is where it used\n * to live (#300). The generated artifact is dialect-agnostic on purpose —\n * `DATABASE_URL` can name a different database than `prisma generate` saw —\n * so a generator that refused a scalar list refused it for Postgres too, and\n * one `String[]` anywhere meant no artifact for *any* model. Asking the\n * dialect at compile time refuses exactly the combination that cannot work,\n * and names it, which is the shape {@link UnsupportedDialectError} already\n * has for the dialects with no compiler at all.\n */\n readonly listFilters: ReadonlySet<string>;\n\n /**\n * `<value> = any(<column>)` — is this element in the list?\n *\n * The mirror of {@link inList} rather than a variant of it, and the two are\n * easy to confuse: there, one column is matched against a caller's list;\n * here, one caller value is matched against a column that *is* a list.\n *\n * **These four take a `Fragment` where every other member here takes a\n * `Binder`**, which is a deliberate exception. A list operand may need a cast\n * on its placeholder — a single element of a `Json[]` needs #209's\n * `::text::jsonb`, and the serialisation that must travel with it — so the\n * parameter is built by `fieldParam` before it arrives and the dialect\n * chooses only the operator. Handing over a `Binder` instead would oblige\n * each dialect to restate `fieldParam`'s rule, and restating it slightly\n * wrong is silent: `$1::jsonb = any(col)` answers *false* where\n * `$1::text::jsonb = any(col)` answers true, with no error on either.\n */\n listHas(column: string, value: Fragment): Fragment;\n\n /** `hasEvery` — every element of the operand is present in the column. */\n listHasEvery(column: string, values: Fragment): Fragment;\n\n /** `hasSome` — the column and the operand share at least one element. */\n listHasSome(column: string, values: Fragment): Fragment;\n\n /**\n * `isEmpty: true`, or its negation when `empty` is false.\n *\n * The odd one out with no operand at all: the value being compared against is\n * the empty list, which is the compiler's own constant rather than the\n * caller's. It stays a bound parameter regardless — see `jsonNullComparison`,\n * which declines the same exception for the same reason.\n */\n listIsEmpty(column: string, empty: boolean): Fragment;\n\n /**\n * The right-hand side of a `push`: the column's current value with the\n * operand appended. An expression rather than a statement, because it is\n * assigned by the write compiler like any other `set` value.\n */\n listPush(column: string, values: Fragment): Fragment;\n\n /**\n * How this dialect spells a JSON path, and which filters it can apply to one.\n *\n * The **path grammar itself differs**, which is unusual enough to be worth\n * stating rather than hiding: Prisma takes `path: [\"a\", \"b\"]` on Postgres and\n * `path: \"$.a.b\"` on SQLite, and refuses the other form on each. That is not\n * a gemi choice — it is the shape the generated client accepts, measured on\n * both — so reproducing it is what \"Prisma-compatible\" means here.\n *\n * `jsonFilters` is the set of scalar filters the dialect can apply to an\n * extracted value. Prisma refuses `array_contains` and the numeric\n * comparisons on SQLite with *\"Unknown argument\"*, so refusing them here is\n * matching it rather than falling short of it.\n */\n readonly jsonPathSyntax: \"array\" | \"jsonpath\";\n readonly jsonFilters: ReadonlySet<string>;\n\n /**\n * Whether an extracted value compares as **text**.\n *\n * Postgres's `#>>` yields `text`, so `equals: 3` has to bind `\"3\"` — comparing\n * text to an integer parameter is a type error there. SQLite's `json_extract`\n * yields a native value, so the same filter has to bind `3`: bind `\"3\"` and\n * SQLite compares an INTEGER to a TEXT, which is silently *false* rather than\n * an error. One filter, two encodings, and the wrong one is a returned-no-rows\n * bug on one dialect and a raised error on the other.\n */\n readonly jsonComparesAsText: boolean;\n\n /**\n * The extracted value, as a fragment whose path is **bound**.\n *\n * A JSON path is the one place a caller's *value* decides part of an\n * expression's meaning, which makes it the obvious place to interpolate by\n * accident and break invariant 2. Both dialects can take it as a parameter —\n * Postgres's `#>` accepts a `text[]`, SQLite's `json_extract` a string — so\n * nothing has to be bent to keep it out of the SQL text.\n *\n * `asText` picks the extraction that yields SQL text rather than JSON. Every\n * comparison in `jsonComparison` passes `true` — the string filters compare\n * against text, and `equals` / `not` / the numeric operators compare an\n * extracted *scalar*, which is what the text form gives them. The JSON form\n * has exactly one caller, `jsonArrayContains`, because containment is the one\n * operator whose right-hand side is a document.\n *\n * SQLite ignores the flag: `json_extract` already yields a SQL value rather\n * than a JSON document for a scalar at the path. That is why the null\n * sentinels need {@link jsonValueAt} instead of this — see there.\n */\n jsonExtract(column: string, path: Binder, asText: boolean): Fragment;\n\n /** `<extracted> @> <value>` — Postgres only; see `jsonFilters`. */\n jsonArrayContains(column: string, path: Binder, value: Binder): Fragment;\n\n /**\n * The value at `path` **as JSON**, in the form two JSON values compare in.\n *\n * The difference from {@link jsonExtract} is the whole of #407, and it is the\n * distinction the null sentinels are made of. Both dialects have an\n * extraction that collapses \"the key is absent\" into \"the key holds the JSON\n * value `null`\", and both have one that does not:\n *\n * | | collapses | keeps the distinction |\n * | --- | --- | --- |\n * | postgres | `#>>` (text) | `#>` (jsonb) |\n * | sqlite | `json_extract` | `->` (JSON text) |\n *\n * `jsonExtract` is the left column at `asText: true`, which is what every\n * scalar comparison wants — a value to compare, not a document. This is the\n * right column, and it is what lets `equals: DbNull` compile to\n * `<value at path> is null` while `equals: JsonNull` compiles to\n * `<value at path> = <the JSON null>`. Refusing them because `#>>` cannot\n * tell the two apart was true of `#>>` and not of the dialect.\n *\n * **Postgres casts and SQLite does not**, and the cast is not decoration:\n * `#>` on a `json` column (a `@db.Json` field) yields `json`, which has no\n * equality operator at all — *\"operator does not exist: json = jsonb\"*, a\n * raised error rather than a wrong answer, but still one Prisma does not\n * raise. Prisma emits `(…#>…)::jsonb` for exactly this reason and so does\n * this. SQLite's `->` already yields the JSON text form.\n *\n * Bound, never interpolated, for the same reason `jsonExtract` is.\n */\n jsonValueAt(column: string, path: Binder): Fragment;\n\n /**\n * Whether the JSON value at `path` — the column itself when `path` is\n * `undefined` — is an **object** holding the key, any of the keys, or all of\n * them: `has_key`, `has_some_keys`, `has_every_key` (#664).\n *\n * `keys` binds a string for `\"one\"` and a string array for the other two;\n * `count` is that array's length, which SQLite needs because it tests one\n * key per term. Postgres binds the array whole, so its text does not depend\n * on `count` and the plan key collapses the list (`LIST_KEYS` in `plan.ts`).\n *\n * **Objects only, on both dialects.** Postgres's `?` also matches a string\n * *element* of a top-level array; SQLite's path lookup does not. Both forms\n * are guarded with \"the value is an object\" so the two answer the same rows:\n * `has_every_key: []` is \"is an object\", and `has_some_keys: []` is false.\n * A key holding the JSON value `null` exists.\n */\n jsonHasKeys(\n column: string,\n path: Binder | undefined,\n keys: Binder,\n mode: \"one\" | \"some\" | \"every\",\n count: number,\n ): Fragment;\n\n /**\n * `lhs` differs from `rhs`, treating NULL as equal to NULL — the guard\n * `skipIfUnchanged` adds to an update's `where` (#664).\n *\n * `rhs` is the same parameter the `set` binds, so the comparison is against\n * the stored encoding of the value. A `Json` column compares as JSON rather\n * than as text: `jsonb` equality on Postgres (key order and whitespace do not\n * matter), and `json()`-normalised text on SQLite (whitespace does not\n * matter; key order does).\n */\n distinctFrom(lhs: string, rhs: Fragment, field: FieldSchema): Fragment;\n\n /**\n * `limit`/`offset`. Both are values and therefore parameters — this is the\n * single most tempting place in the compiler to inline a number.\n */\n paginate(take: Binder | null, skip: Binder | null): Fragment;\n\n /**\n * The clause that makes an insert skip rows violating a unique constraint —\n * `createMany({ skipDuplicates: true })` — or `null` where it is not offered.\n *\n * **`null` is a parity decision, not a missing feature**, and that is worth\n * knowing before someone \"fixes\" SQLite by returning `insert or ignore`.\n * SQLite has `on conflict do nothing` and has since 3.24; Prisma nonetheless\n * rejects the *argument* on SQLite — `Unknown argument 'skipDuplicates'`,\n * whatever its value, verified against a generated 6.19 client. Offering it\n * here would make gemi a silent superset of Prisma on the one dialect the\n * differential harness could then no longer compare, which is the trade this\n * project has declined every other time it came up.\n *\n * A method rather than a boolean because the SQL differs where it exists, and\n * a `Fragment` because everything the compiler emits is one.\n */\n ignoreConflicts(): Fragment | null;\n\n /**\n * The clause a locking read ends with — `lock: \"update\"` on a `findMany` —\n * naming `table` as the only table whose rows are locked.\n *\n * Scoped to the root table (`for update of \"User\"`) rather than left bare,\n * because a folded `include` puts a lateral subquery in the `from` clause and\n * Postgres refuses to lock through one (`FOR UPDATE is not allowed with\n * aggregate functions`). Scoping it also matches the documented contract on\n * both strategies: the root rows are locked, related rows never are.\n *\n * **Empty on SQLite, and that is a decision.** SQLite has no row locks, and\n * does not need them for what a locking read is for: its transactions are\n * serializable, with one writer at a time on the whole database, so the lost\n * update a row lock prevents cannot happen there. Two transactions that race\n * wait on (or fail with `SQLITE_BUSY` on) the database lock instead of the\n * row's, and `skipLocked` / `noWait` have no row lock to react to. Refusing\n * would stop code that runs on Postgres in production from running against\n * SQLite in development and tests, for no gain. The one misuse that matters\n * on both — a lock outside a transaction — is refused in `Model.$execute`\n * on every dialect.\n */\n rowLock(lock: RowLockClause, table: string): Fragment;\n\n /**\n * Recognise a driver error as a constraint violation, and say which columns\n * it names.\n *\n * Returns `null` for anything else, including the *other* constraint kinds:\n * SQLite reports NOT NULL and FOREIGN KEY failures through the same exception\n * type, and reporting one of those as a duplicate-key error would send a\n * caller looking for a row that does not exist.\n *\n * Columns, not fields — the driver only knows the database's names. The\n * caller maps them back through the schema, where `@map` is in scope.\n */\n constraintViolation(error: unknown): ConstraintViolation | null;\n}\n\n/** A driver error identified as a constraint failure, in dialect-neutral terms. */\nexport interface ConstraintViolation {\n /** Only `unique` is translated today; the rest surface as the raw error. */\n kind: \"unique\";\n /** Database column names, in the order the driver reported them. */\n columns: string[];\n /** The constraint's own name, when the driver gives one. Postgres does. */\n constraint?: string;\n}\n\n/**\n * The ORM was asked to compile against a dialect it does not implement.\n *\n * **The split this message has to convey**, because it is the surprising part:\n * `DatabaseManager` connects to MySQL and MariaDB perfectly well — Bun's client\n * speaks all four — so raw SQL through `DB.query` / `DB.sql` works, and\n * transactions work. What does not exist is a `SqlDialect` for them, so\n * everything that *compiles* a statement stops here.\n *\n * A caller who reads only \"not supported\" reasonably concludes the connection\n * is unusable, which is wrong and is the more expensive misreading: it is the\n * ORM that is unavailable, not the database.\n */\nexport class UnsupportedDialectError extends Error {\n constructor(dialect: Dialect) {\n super(\n `The gemi ORM does not support the '${dialect}' dialect. Only sqlite ` +\n `and postgres are implemented — see the supported matrix in ` +\n `docs/orm.md.\\n\\n` +\n `The *connection* is fine: Bun's client speaks ${dialect}, so raw SQL ` +\n `through DB.query / DB.sql and transactions all work. It is the query ` +\n `compiler that has no ${dialect} dialect, so every model operation ` +\n `raises this.\\n\\n` +\n `Point DATABASE_URL at Postgres or SQLite to use the ORM, or keep ` +\n `using Prisma's own client for this database.`,\n );\n this.name = \"UnsupportedDialectError\";\n }\n}\n\n/**\n * Whether the ORM can compile for this dialect at all.\n *\n * Exported so an application can find out at **boot** rather than on its first\n * query. That is the whole gap this closes: `DatabaseManager` constructs\n * happily against MySQL, so a deploy pointed at one starts, passes a health\n * check, serves traffic, and fails on the first model read — which is the\n * latest and most expensive moment to learn it.\n */\nexport function ormSupports(dialect: Dialect): boolean {\n return COMPILERS[dialect] !== null;\n}\n\n/** Every dialect `Dialect` names, for anything that has to walk them all. */\nexport function everyDialect(): Dialect[] {\n return Object.keys(COMPILERS) as Dialect[];\n}\n\n/**\n * The compiler for each dialect, or `null` where the ORM has none.\n *\n * **One map rather than two lists, and `satisfies` rather than a lookup.** The\n * supported set used to be written three times — `ormSupports`' `||` chain,\n * `dialectFor`'s `if` chain, and a test enumerating a hand-written copy of the\n * `Dialect` union — so adding a fifth member to that union changed nothing\n * anywhere: `tsc` clean, tests green, the new dialect silently reported as\n * unsupported by one function and unknown to the other.\n *\n * That moment is exactly what the guard exists for. Adding a dialect to the\n * union is the *first step of implementing one*, and it is the step where a\n * half-added dialect would disagree with itself.\n *\n * `satisfies Record<Dialect, …>` makes it a compile error in a file the build\n * actually checks. It has to live here rather than in a test: `tsconfig.json`\n * excludes test files and vitest transpiles without type-checking, so an\n * exhaustiveness check written there is a type error nothing ever evaluates.\n *\n * The sixth thing in this codebase made `tsc`'s job rather than a convention's\n * — see the note on `resolveLink`'s `operation`.\n */\nconst COMPILERS = {\n sqlite: new SqliteDialect(),\n postgres: new PostgresDialect(),\n // Bun's client speaks both; the ORM has no compiler for either. See\n // `UnsupportedDialectError`, which is careful to say that the *connection*\n // still works.\n mysql: null,\n mariadb: null,\n} satisfies Record<Dialect, SqlDialect | null>;\n\n/**\n * Resolved per call from `DatabaseManager.dialect`, never baked into a\n * generated artifact — `DATABASE_URL` can point at a different database than\n * the one `prisma generate` saw.\n */\nexport function dialectFor(dialect: Dialect): SqlDialect {\n const compiler = COMPILERS[dialect];\n if (compiler === null) throw new UnsupportedDialectError(dialect);\n return compiler;\n}\n\nexport { PostgresDialect, SqliteDialect };\n"
|
|
10
10
|
],
|
|
11
11
|
"mappings": ";iDAoCO,SAAS,CAAiB,EAAgB,CAC/C,MAAO,CAAE,IAAK,IAAI,KAAQ,SAAU,CAAC,CAAE,EAOzC,IAAM,EAA4B,CAAE,IAAK,IAAI,KAAK,CAAC,EAAG,SAAU,CAAC,CAAE,EAG5D,SAAS,CAAU,CACxB,EACiD,CACjD,MAAO,CAAC,EAAW,EAAuB,IAAiB,CACzD,IAAM,EAAoB,CAAC,EAC3B,QAAS,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,EAAO,KAAK,EAAQ,GAAG,EAAM,CAAO,CAAC,EAEvC,OAAO,GAeX,IAAM,EAAe,OAQd,SAAS,CAAG,CAAC,EAAwB,CAC1C,MAAO,CAAE,OAAM,QAAS,C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,IAAI,EAAY,EAAO,CAAK,UAGpC,OAAO,GAGf,CAEA,SAAS,CAAe,CAAC,EAA0B,CACjD,MACE,mDAAmD,qDC/ChD,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAkB,CAC5B,MACE,sCAAsC,2BACpC,mEACA;AAAA;AAAA,gDACiD,2GAEzB;AAAA;AAAA,8GAI5B,EACA,KAAK,KAAO,0BAEhB,CAWO,SAAS,EAAW,CAAC,EAA2B,CACrD,OAAO,EAAU,KAAa,KAIzB,SAAS,EAAY,EAAc,CACxC,OAAO,OAAO,KAAK,CAAS,EAyB9B,IAAM,EAAY,CAChB,OAAQ,IAAI,EACZ,SAAU,IAAI,EAId,MAAO,KACP,QAAS,IACX,EAOO,SAAS,EAAU,CAAC,EAA8B,CACvD,IAAM,EAAW,EAAU,GAC3B,GAAI,IAAa,KAAM,MAAM,IAAI,EAAwB,CAAO,EAChE,OAAO",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "656D7F3819B4AD9064756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Al as h}from"./chunk-wgre66wq.js";var A=h((f)=>{f.HttpAuthLocation=void 0;(function(t){t.HEADER="header",t.QUERY="query"})(f.HttpAuthLocation||(f.HttpAuthLocation={}));f.HttpApiKeyAuthLocation=void 0;(function(t){t.HEADER="header",t.QUERY="query"})(f.HttpApiKeyAuthLocation||(f.HttpApiKeyAuthLocation={}));f.EndpointURLScheme=void 0;(function(t){t.HTTP="http",t.HTTPS="https"})(f.EndpointURLScheme||(f.EndpointURLScheme={}));f.AlgorithmId=void 0;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(f.AlgorithmId||(f.AlgorithmId={}));var x=(t)=>{let o=[];if(t.sha256!==void 0)o.push({algorithmId:()=>f.AlgorithmId.SHA256,checksumConstructor:()=>t.sha256});if(t.md5!=null)o.push({algorithmId:()=>f.AlgorithmId.MD5,checksumConstructor:()=>t.md5});return{addChecksumAlgorithm(s){o.push(s)},checksumAlgorithms(){return o}}},d=(t)=>{let o={};return t.checksumAlgorithms().forEach((s)=>{o[s.algorithmId()]=s.checksumConstructor()}),o},a=(t)=>{return x(t)},E=(t)=>{return d(t)};f.FieldPosition=void 0;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(f.FieldPosition||(f.FieldPosition={}));var m="__smithy_context";f.IniSectionType=void 0;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(f.IniSectionType||(f.IniSectionType={}));f.RequestHandlerProtocol=void 0;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(f.RequestHandlerProtocol||(f.RequestHandlerProtocol={}));f.SMITHY_CONTEXT_KEY=m;f.getDefaultClientConfiguration=a;f.resolveDefaultRuntimeConfig=E});
|
|
3
3
|
export{A as T};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=F08DEE975AC8560D64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"'use strict';\n\nexports.HttpAuthLocation = void 0;\n(function (HttpAuthLocation) {\n HttpAuthLocation[\"HEADER\"] = \"header\";\n HttpAuthLocation[\"QUERY\"] = \"query\";\n})(exports.HttpAuthLocation || (exports.HttpAuthLocation = {}));\n\nexports.HttpApiKeyAuthLocation = void 0;\n(function (HttpApiKeyAuthLocation) {\n HttpApiKeyAuthLocation[\"HEADER\"] = \"header\";\n HttpApiKeyAuthLocation[\"QUERY\"] = \"query\";\n})(exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {}));\n\nexports.EndpointURLScheme = void 0;\n(function (EndpointURLScheme) {\n EndpointURLScheme[\"HTTP\"] = \"http\";\n EndpointURLScheme[\"HTTPS\"] = \"https\";\n})(exports.EndpointURLScheme || (exports.EndpointURLScheme = {}));\n\nexports.AlgorithmId = void 0;\n(function (AlgorithmId) {\n AlgorithmId[\"MD5\"] = \"md5\";\n AlgorithmId[\"CRC32\"] = \"crc32\";\n AlgorithmId[\"CRC32C\"] = \"crc32c\";\n AlgorithmId[\"SHA1\"] = \"sha1\";\n AlgorithmId[\"SHA256\"] = \"sha256\";\n})(exports.AlgorithmId || (exports.AlgorithmId = {}));\nconst getChecksumConfiguration = (runtimeConfig) => {\n const checksumAlgorithms = [];\n if (runtimeConfig.sha256 !== undefined) {\n checksumAlgorithms.push({\n algorithmId: () => exports.AlgorithmId.SHA256,\n checksumConstructor: () => runtimeConfig.sha256,\n });\n }\n if (runtimeConfig.md5 != undefined) {\n checksumAlgorithms.push({\n algorithmId: () => exports.AlgorithmId.MD5,\n checksumConstructor: () => runtimeConfig.md5,\n });\n }\n return {\n addChecksumAlgorithm(algo) {\n checksumAlgorithms.push(algo);\n },\n checksumAlgorithms() {\n return checksumAlgorithms;\n },\n };\n};\nconst resolveChecksumRuntimeConfig = (clientConfig) => {\n const runtimeConfig = {};\n clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {\n runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();\n });\n return runtimeConfig;\n};\n\nconst getDefaultClientConfiguration = (runtimeConfig) => {\n return getChecksumConfiguration(runtimeConfig);\n};\nconst resolveDefaultRuntimeConfig = (config) => {\n return resolveChecksumRuntimeConfig(config);\n};\n\nexports.FieldPosition = void 0;\n(function (FieldPosition) {\n FieldPosition[FieldPosition[\"HEADER\"] = 0] = \"HEADER\";\n FieldPosition[FieldPosition[\"TRAILER\"] = 1] = \"TRAILER\";\n})(exports.FieldPosition || (exports.FieldPosition = {}));\n\nconst SMITHY_CONTEXT_KEY = \"__smithy_context\";\n\nexports.IniSectionType = void 0;\n(function (IniSectionType) {\n IniSectionType[\"PROFILE\"] = \"profile\";\n IniSectionType[\"SSO_SESSION\"] = \"sso-session\";\n IniSectionType[\"SERVICES\"] = \"services\";\n})(exports.IniSectionType || (exports.IniSectionType = {}));\n\nexports.RequestHandlerProtocol = void 0;\n(function (RequestHandlerProtocol) {\n RequestHandlerProtocol[\"HTTP_0_9\"] = \"http/0.9\";\n RequestHandlerProtocol[\"HTTP_1_0\"] = \"http/1.0\";\n RequestHandlerProtocol[\"TDS_8_0\"] = \"tds/8.0\";\n})(exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {}));\n\nexports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY;\nexports.getDefaultClientConfiguration = getDefaultClientConfiguration;\nexports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig;\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";uDAEQ,mBAAwB,QAC/B,QAAS,CAAC,EAAkB,CACzB,EAAiB,OAAY,SAC7B,EAAiB,MAAW,UACrB,qBAA6B,mBAAmB,CAAC,EAAE,EAEtD,yBAA8B,QACrC,QAAS,CAAC,EAAwB,CAC/B,EAAuB,OAAY,SACnC,EAAuB,MAAW,UAC3B,2BAAmC,yBAAyB,CAAC,EAAE,EAElE,oBAAyB,QAChC,QAAS,CAAC,EAAmB,CAC1B,EAAkB,KAAU,OAC5B,EAAkB,MAAW,UACtB,sBAA8B,oBAAoB,CAAC,EAAE,EAExD,cAAmB,QAC1B,QAAS,CAAC,EAAa,CACpB,EAAY,IAAS,MACrB,EAAY,MAAW,QACvB,EAAY,OAAY,SACxB,EAAY,KAAU,OACtB,EAAY,OAAY,WACjB,gBAAwB,cAAc,CAAC,EAAE,EACpD,IAAM,EAA2B,CAAC,IAAkB,CAChD,IAAM,EAAqB,CAAC,EAC5B,GAAI,EAAc,SAAW,OACzB,EAAmB,KAAK,CACpB,YAAa,IAAc,cAAY,OACvC,oBAAqB,IAAM,EAAc,MAC7C,CAAC,EAEL,GAAI,EAAc,KAAO,KACrB,EAAmB,KAAK,CACpB,YAAa,IAAc,cAAY,IACvC,oBAAqB,IAAM,EAAc,GAC7C,CAAC,EAEL,MAAO,CACH,oBAAoB,CAAC,EAAM,CACvB,EAAmB,KAAK,CAAI,GAEhC,kBAAkB,EAAG,CACjB,OAAO,EAEf,GAEE,EAA+B,CAAC,IAAiB,CACnD,IAAM,EAAgB,CAAC,EAIvB,OAHA,EAAa,mBAAmB,EAAE,QAAQ,CAAC,IAAsB,CAC7D,EAAc,EAAkB,YAAY,GAAK,EAAkB,oBAAoB,EAC1F,EACM,GAGL,EAAgC,CAAC,IAAkB,CACrD,OAAO,EAAyB,CAAa,GAE3C,EAA8B,CAAC,IAAW,CAC5C,OAAO,EAA6B,CAAM,GAGtC,gBAAqB,QAC5B,QAAS,CAAC,EAAe,CACtB,EAAc,EAAc,OAAY,GAAK,SAC7C,EAAc,EAAc,QAAa,GAAK,YACvC,kBAA0B,gBAAgB,CAAC,EAAE,EAExD,IAAM,EAAqB,mBAEnB,iBAAsB,QAC7B,QAAS,CAAC,EAAgB,CACvB,EAAe,QAAa,UAC5B,EAAe,YAAiB,cAChC,EAAe,SAAc,aACtB,mBAA2B,iBAAiB,CAAC,EAAE,EAElD,yBAA8B,QACrC,QAAS,CAAC,EAAwB,CAC/B,EAAuB,SAAc,WACrC,EAAuB,SAAc,WACrC,EAAuB,QAAa,YAC7B,2BAAmC,yBAAyB,CAAC,EAAE,EAElE,qBAAqB,EACrB,gCAAgC,EAChC,8BAA8B",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "F08DEE975AC8560D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Wj as n,Xj as k,Zj as T0}from"./chunk-rh811v1f.js";import{_j as S0}from"./chunk-wamxfhh6.js";import{ak as N0,bk as R0,ck as Q0,ek as D,gk as q,pk as B0}from"./chunk-cd847h0t.js";import{Ek as X0}from"./chunk-zh0knwen.js";import{$k as W0,cl as m}from"./chunk-vqar6ysw.js";import{ll as M0}from"./chunk-yc2pnb1w.js";class y{table;sql;dialect;connection;busyTimeout;configured;constructor(z,V={}){let Y=V.table??"gemi_locks";if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Y))throw Error(`The lock table name "${Y}" is not a plain identifier. Use letters, digits and underscores.`);this.table=Y,this.sql=z.sql,this.dialect=z.dialect,this.connection=z.name,this.busyTimeout=V.busyTimeout??1000}async createTable(){await this.configure();for(let z of v0(this.dialect,this.table))await this.sql.unsafe(z)}async acquire(z,V,Y){await this.configure();let Z=this.sql,$=this.now(Z);if(await this.seed(Z,z),this.mysql){let H=await Z`
|
|
3
3
|
UPDATE ${this.name(Z)}
|
|
4
4
|
SET owner = ${V}, token = token + 1, expires_at = ${$} + ${this.ms(Z,Y)},
|
|
5
5
|
updated_at = ${$}
|
|
@@ -411,6 +411,6 @@ ADD COLUMN IF NOT EXISTS "progress" ${Y}`,`CREATE INDEX IF NOT EXISTS "${V}_batc
|
|
|
411
411
|
}
|
|
412
412
|
};
|
|
413
413
|
`],"worker.ts"),$=URL.createObjectURL(Z);return new Worker($)}async function d0(z,V){let Y=w0();return Y.postMessage({jobName:z,args:V}),await new Promise((Z,$)=>{Y.onmessage=(X)=>{let H=X.data;if("error"in H)$(H.error);else Z(H.result)}})}var c0=new k0("gemi.queue"),l0=60000;class h{static token="queue";jobs={};config;driver;application;inFlight=new Map;state="idle";looping=!1;claiming;woken=!1;claimFailures=0;resume;unsubscribe;heartbeatTimer;releasedNames=new Set;lockManager;workflowRuntime;constructor(z={},V={}){if(this.config=S0(D0(),z),this.application=V.application,this.driver=r0(this.config.driver,this.application),this.useJobs(this.config.jobs),this.config.workflows.length>0)this.useWorkflows(this.config.workflows)}useJobs(z){this.config.jobs=z,this.jobs={};for(let V of z)this.claim(V);this.registerTickJob()}useWorkflows(z){this.config.workflows=z,this.workflows.use(z),this.registerTickJob()}get registeredWorkflows(){return[...this.config.workflows]}get workflows(){return this.workflowRuntime??=new H0(this),this.workflowRuntime}registerTickJob(){if(!this.workflowRuntime||Object.keys(this.workflowRuntime.workflows).length===0)return;let z=this.workflowRuntime.tickJob;if(this.jobs[z.name]&&this.jobs[z.name]!==z){console.error(`A queued job is named "${z.name}", which the workflow runtime uses. Workflows will not run until it is renamed.`);return}this.jobs[z.name]=z}registerJob(z){this.config.jobs=[...this.config.jobs,z],this.claim(z)}claim(z){if(this.jobs[z.name]){console.error(`Two queued jobs are named "${z.name}" \u2014 the first is registered `+"and this one is not, so dispatching either would have run one of them. A class name is the queue's key, so only one job can hold it. Rename one.");return}this.jobs[z.name]=z}get registeredJobs(){return[...this.config.jobs]}dispatchJob(z,V){if(this.jobs[z])return new this.jobs[z]().run(JSON.parse(V))}push(z,V,Y={}){let Z=this.uniqueKey(z,V);if(Z)return this.pushUnique(z,V,Z,Y);let $=this.driver.joinsTransaction?.()===!0;if(!$){let X=Bun.randomUUIDv7();if(D(()=>this.record(z,V,{id:X,reportFailure:!0,committed:!0}).then(()=>{},()=>{})))return Promise.resolve(X)}return this.record(z,V,{reportFailure:Y.reportFailure,joins:$})}pushBatch(z,V,Y={}){let Z=this.buildBatch(z,V,Y),$={id:Z.id,total:V.length},X=this.driver.joinsTransaction?.()===!0;if(!X){if(D(()=>this.recordBatch(Z,{committed:!0}).then(()=>{},()=>{})))return Promise.resolve($)}return this.recordBatch(Z,{joins:X}).then(()=>$)}buildBatch(z,V,Y={}){if(!this.driver.enqueueBatch)throw Error("This queue's driver does not support batches. The memory and database drivers do.");if(new z().worker)throw Error(`${z.name} is a worker job, and a worker job cannot be dispatched in a batch: its thread has no way to report progress or reach the batch.`);if(z.prototype.uniqueId!==S.prototype.uniqueId)throw Error(`${z.name} is unique (it defines uniqueId), and a unique job cannot be dispatched in a batch: a duplicate would resolve to a job outside the batch, and the batch would wait for it forever.`);let $={};for(let X of["then","catch","finally"]){let H=Y[X];if(H===void 0)continue;if(typeof H?.name!=="string"||!Array.isArray(H.args))throw Error(`The batch's ${X} callback is not a job call. Build it with SomeJob.with(...args).`);$[X]={name:H.name,args:H.args}}return{id:Bun.randomUUIDv7(),name:Y.name??null,job:z.name,args:V,allowFailures:Y.allowFailures===!0,callbacks:$}}recordBatch(z,V){let Y=this.driver.enqueueBatch(z);this.startIfIdle();let Z=()=>!this.driver.subscribe&&this.state==="running"&&this.wake(),$=V.joins===!0&&D(Z);return Y.then(()=>$||Z(),(X)=>{if(!V.committed)return;console.error(`[gemi] The queue driver could not record a batch of ${z.job}, which was held until its transaction committed. The transaction stays committed; the batch's jobs did not run and will not be retried.`,X)}),Y}async findBatch(z){if(!this.driver.findBatch)throw Error("This queue's driver does not support batches.");return this.driver.findBatch(z)}async cancelBatch(z){if(!this.driver.cancelBatch)throw Error("This queue's driver does not support batches.");let V=await this.driver.cancelBatch(z);if(V)this.claimSoon();return V}get locks(){return this.lockManager??=new T0(this.resolveLockStore()),this.lockManager}resolveLockStore(){let z=this.config.locks;if(z==="auto"){let V=this.driver.lockStore?.();if(V)return V;if(this.durable)console.warn('[gemi] The queue driver keeps no locks, so unique jobs, withoutOverlapping and onOneServer only hold within this process. Set the queue slice\'s `locks` to "database" or a LockStore.');return new p}if(z==="memory")return new p;if(z==="database"||typeof z==="function"){if(!this.application&&(z==="database"||z.length>0))throw Error("The queue's locks need the application they belong to, and this QueueManager was built without one. Pass { application }.");if(z==="database")return new y(this.application.make(X0));return z(this.application)}if(typeof z==="string")throw Error(`Unknown queue locks "${z}". The queue slice's locks is "auto", "memory", "database", a LockStore, or a function returning one.`);return z}uniqueKey(z,V){if(z.prototype.uniqueId===S.prototype.uniqueId)return;let Y=new z,Z=Y.uniqueId(...JSON.parse(V));if(Z===void 0||Z===null||Z==="")return;return{key:L0(z.name,Z),ttl:Math.max(1,Y.uniqueFor)}}pushUnique(z,V,Y,Z){let $=Bun.randomUUIDv7();if(D(()=>this.recordUnique(z,V,Y,$,{report:!0,committed:!0}).then(()=>{},()=>{})))return Promise.resolve($);return this.recordUnique(z,V,Y,$,{report:Z.reportFailure!==!1,committed:!1})}recordUnique(z,V,Y,Z,$){let X=this.locks.store,H=(async()=>{for(let G=0;G<5;G++){if(await X.acquire(Y.key,Z,Y.ttl)!==null)try{return await this.record(z,V,{id:Z,reportFailure:!1})}catch(B){throw await X.release(Y.key,Z).catch(()=>{}),B}let Q=await X.holder(Y.key);if(Q)return Q.owner}throw Error(`The unique key "${Y.key}" kept changing hands, so ${z.name} was not queued.`)})();return H.catch((G)=>{if(!$.report)return;console.error(`[gemi] The queue could not record the unique job ${z.name}`+($.committed?", which was held until its transaction committed. The transaction stays committed; the job did not run and will not be retried.":", so it did not run and will not be retried."),G)}),H}async releaseUnique(z,V,Y){if(z.uniqueId===S.prototype.uniqueId)return;try{let Z=z.uniqueId(...V);if(Z===void 0||Z===null||Z==="")return;await this.locks.store.release(L0(Y.name,Z),Y.id)}catch(Z){console.error(`[gemi] Could not free the unique key of ${Y.name} (${Y.id}); it frees itself after uniqueFor.`,Z)}}record(z,V,Y){let Z=this.driver.enqueue({name:z.name,args:V,...Y.id===void 0?{}:{id:Y.id}});this.startIfIdle();let $=()=>!this.driver.subscribe&&this.state==="running"&&this.wake(),X=Y.joins===!0&&D($);return Z.then(()=>X||$(),(H)=>{if(Y.reportFailure===!1)return;console.error(`[gemi] The queue driver could not record ${z.name}`+(Y.committed?", which was held until its transaction committed. The transaction stays committed; the job did not run and will not be retried.":", so it did not run and will not be retried."),H)}),Z}async retryDead(z){if(!this.driver.retryDead)throw Error("This queue's driver keeps nothing of a dead-lettered job, so there is nothing to retry. The database driver keeps them.");let V=await this.driver.retryDead(z);if(V)this.claimSoon();return V}startIfIdle(){if(this.state==="idle"&&(!this.durable||this.mayClaimHere()))this.start()}claimSoon(){if(this.startIfIdle(),!this.driver.subscribe&&this.state==="running")this.wake()}start(){if(this.state==="running")return;if(this.state="running",this.durable&&this.application&&this.mayClaimHere()&&!i0())globalThis.__gemiDevQueue=this;if(this.unsubscribe=this.driver.subscribe?.(()=>this.wake()),this.looping)return this.wake();c0.runInAsyncScope(()=>void this.loop())}async drain(z=1/0){if(this.state="stopped",globalThis.__gemiDevQueue===this)globalThis.__gemiDevQueue=void 0;this.unsubscribe?.(),this.unsubscribe=void 0,this.wake();let V,Y=new Promise(($)=>{if(z!==1/0)V=setTimeout($,z)}),Z=(async()=>{await this.claiming?.catch(()=>{}),await Promise.allSettled([...this.inFlight.values()].map(($)=>$.done))})();return await Promise.race([Z,Y]),clearTimeout(V),{unfinished:[...this.inFlight.values()].map(($)=>({...$.job}))}}stop(){return this.drain(0)}get running(){return this.inFlight.size}async loop(){this.looping=!0;try{await this.claimWhileRunning()}finally{this.looping=!1}}async claimWhileRunning(){while(this.state==="running"){let z=this.durable&&M0()?0:this.config.concurrency-this.inFlight.size;if(z>0){this.woken=!1;let V=this.driver.claim(z,{...this.lease(),registered:{names:Object.keys(this.jobs),graceMs:this.config.unknownJobGrace}});this.claiming=V;let Y=[];try{Y=await V,this.claimFailures=0}catch(Z){this.claimFailures++,console.error(`The queue could not claim jobs from its driver; it will try again in ${this.retryDelay()}ms.`,Z)}finally{this.claiming=void 0}for(let Z of Y)this.execute(Z);if(Y.length===z)continue;if(this.woken&&this.inFlight.size<this.config.concurrency)continue}await this.sleep()}}sleep(){return new Promise((z)=>{let V,Y=this.claimFailures>0?this.retryDelay():this.driver.subscribe?void 0:this.config.pollInterval;if(Y!==void 0)V=setTimeout(()=>this.wake(),Y),V.unref?.();this.resume=()=>{clearTimeout(V),z()}})}retryDelay(){let z=Math.min(Math.max(0,this.claimFailures-1),30);return Math.min(this.config.pollInterval*2**z,l0)}wake(){this.woken=!0;let z=this.resume;this.resume=void 0,z?.()}get durable(){return!(this.driver instanceof i)}mayClaimHere(){return!this.application||s0()}lease(){return{visibilityTimeoutMs:this.config.visibilityTimeout}}execute(z){let V=`${z.id}:${z.attempt}`,Y=()=>this.run(z),Z=(this.application?W0.run(this.application,Y):Y()).catch(($)=>{console.error(`The queue could not record the outcome of ${z.name}.`,$)}).finally(()=>{this.inFlight.delete(V),this.wake()});this.inFlight.set(V,{job:z,done:Z}),this.heartbeat()}heartbeat(){let z=this.driver;if(!z.heartbeat||this.heartbeatTimer)return;this.heartbeatTimer=setInterval(()=>{if(this.inFlight.size===0){clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0;return}let V=[...this.inFlight.values()].map((Y)=>Y.job);z.heartbeat(V,this.lease()).catch((Y)=>{console.error("The queue could not extend its job leases.",Y)})},Math.max(1,Math.floor(this.config.visibilityTimeout/3))),this.heartbeatTimer.unref?.()}async run(z){let V=this.jobs[z.name];if(!V){let B=Date.now()-z.createdAt;if(this.durable&&B<this.config.unknownJobGrace){if(!this.releasedNames.has(z.name))this.releasedNames.add(z.name),console.error(`Left a queued "${z.name}" for another replica: nothing is registered here under that name. It is dead-lettered if no replica has run it within unknownJobGrace (${this.config.unknownJobGrace}ms) of its dispatch.`);await this.driver.release(z,{retryInMs:Math.round(this.config.pollInterval*(1+Math.random()))});return}console.error(`Dropped a queued job: nothing is registered under the name "${z.name}". If the class exists, it was not `+"discovered \u2014 check that it is under the queue slice's jobsDir "+"(app/jobs by default), or list it in app/config/queue.ts."),await this.driver.fail(z,{error:`No job is registered under the name "${z.name}".`,retryInMs:null});return}let Y;try{Y=new V}catch(B){console.error(`Dropped a queued ${z.name}: it could not be constructed.`,B),await this.driver.fail(z,{error:`The job could not be constructed: ${String(B)}`,retryInMs:null});return}let Z;try{Z=JSON.parse(z.args)}catch(B){console.error(`Dropped a queued ${z.name}: its arguments are not JSON.`,B),await this.driver.fail(z,{error:`The arguments are not JSON: ${String(B)}`,retryInMs:null});return}if(z.attempt>Math.max(1,Y.maxAttempts)){let B=Error(`${z.name} was claimed for attempt ${z.attempt} of ${Y.maxAttempts}: an earlier attempt never finished, most likely because the process running it exited. Dead-lettered without running it again.`);$0(`${z.name}.onDeadletter`,()=>Y.onDeadletter(B,...Z)),await this.driver.fail(z,{error:B.message,retryInMs:null}),await this.releaseUnique(Y,Z,z);return}if(Y.$claimed={...z},z.batchId!==void 0){if((await this.driver.findBatch?.(z.batchId,{progress:!1}))?.cancelledAt!=null){await this.driver.fail(z,{error:"Its batch was cancelled before it ran.",retryInMs:null,cancelled:!0});return}let K=this.batchHandle(z);Y.batch=K.batch,Y.$progress=K.progress}let $=await this.admit(Y,Z,z);if(!$)return;let X,H;try{H=await(Y.worker?d0(z.name,z.args):Y.run(...Z))}catch(B){X=B}finally{await $.done()}let G=Y.$outcome;if(X===void 0&&G?.kind==="release"){await this.driver.release(z,{retryInMs:Math.max(0,G.delayMs)});return}if(X===void 0&&G?.kind==="fail")X=G.error;let Q=G?.kind==="fail"?G.retry:!0;if(X===void 0)try{Y.onSuccess(H,...Z)}catch(B){X=B}if(X!==void 0){let B=String(X?.stack??X);if($0(`${z.name}.onFail`,()=>Y.onFail(X,...Z)),!Q||z.attempt>=Y.maxAttempts)$0(`${z.name}.onDeadletter`,()=>Y.onDeadletter(X,...Z)),await this.driver.fail(z,{error:B,retryInMs:null}),await this.releaseUnique(Y,Z,z);else await this.driver.fail(z,{error:B,retryInMs:s(Y.backoff,z.attempt)});return}await this.driver.complete(z),await this.releaseUnique(Y,Z,z)}batchHandle(z){let V=z.batchId,Y=this.driver;return{batch:{id:V,cancelled:async()=>(await Y.findBatch?.(V,{progress:!1}))?.cancelledAt!=null},progress:(Z)=>Y.reportProgress?.(z,Z)??Promise.resolve()}}async admit(z,V,Y){let Z=z.concurrency(...V),$=[z.throttle(...V)??[]].flat();if(!Z&&$.length===0)return{done:async()=>{}};let X=this.locks,H;if(Z&&Z.limit>0){let Q=this.config.visibilityTimeout;for(let B=0;B<Z.limit&&!H;B++)H=await X.acquire(`gemi:concurrency:${Z.key}:${B}`,{ttl:Q,renew:!0})??void 0;if(!H){await this.driver.release(Y,{retryInMs:Math.round(this.config.pollInterval*(1+Math.random()))});return}}let G=[];for(let Q of $){let B=`gemi:throttle:${Q.key}`,K=await X.store.hit(B,Q.limit,Q.window);if(!K.allowed){await Promise.all(G.map((A)=>X.store.refund(A))),await H?.release(),await this.driver.release(Y,{retryInMs:Math.max(1,K.resetInMs)});return}G.push(B)}return{done:async()=>{await H?.release().catch((Q)=>{console.error(`[gemi] Could not free a concurrency slot of ${Y.name}.`,Q)})}}}}function L0(z,V){return`gemi:job:${z}:${String(V)}`}function $0(z,V){try{V()}catch(Y){console.error(`${z} threw; the job's claim was ended anyway.`,Y)}}function i0(){return Bun.env.NODE_ENV==="production"}function s0(){if(!p0)return!1;if(a0())return!0;return process.env.ROOT_DIR!==void 0&&!n0()}function n0(z=process.env){return(z.GEMI_QUEUE_CLAIM??"").trim().toLowerCase()==="off"}var x0=Symbol.for("gemi.queue.worker");function cz(z=!0){globalThis[x0]=z}function a0(){return globalThis[x0]===!0}function r0(z,V){if(z==="memory")return new i;if(z==="database"||typeof z==="function"){if(!V&&(z==="database"||z.length>0))throw Error("The queue driver needs the application it belongs to, and this QueueManager was built without one. Pass { application }.");if(z==="database")return new z0(V.make(X0));return z(V)}if(typeof z==="string")throw Error(`Unknown queue driver "${z}". The queue slice's driver is "memory", "database", a QueueDriver, or a function returning one.`);return z}class S{static name="unset";worker=!1;maxAttempts=3;backoff=0;uniqueId(...z){return}uniqueFor=3600000;throttle(...z){return}concurrency(...z){return}release(z=0){this.$outcome={kind:"release",delayMs:z}}fail(z,V={}){this.$outcome={kind:"fail",error:z instanceof Error?z:Error(String(z)),retry:V.retry??!0}}batch=void 0;async progress(z){let V=E(z);await this.$progress?.(V)}$progress;$claimed;$outcome;run(...z){}onFail(z,...V){}onSuccess(z,...V){}onDeadletter(z,...V){}static dispatch(...z){if(this.name==="unset")throw Error("Cannot dispatch a job with no name");return m(h).push(this,JSON.stringify(z))}static dispatchBatch(z,V={}){if(this.name==="unset")throw Error("Cannot dispatch a job with no name");return m(h).pushBatch(this,z.map((Y)=>JSON.stringify(Y)),V)}static with(...z){if(this.name==="unset")throw Error("Cannot use a job with no name as a callback");return JSON.stringify(z),{name:this.name,args:z}}static findBatch(z){return m(h).findBatch(z)}static cancelBatch(z){return m(h).cancelBatch(z)}}var r=["completed","failed","cancelled"],t0=1000;class H0{queue;registry={};storeInstance;tickClass;reportedNames=new Set;constructor(z){this.queue=z}get workflows(){return this.registry}use(z){this.registry={};for(let V of z){if(V.name==="unset"||!V.name){console.error("A workflow class has no `static name`, so it was not registered. Add one.");continue}if(this.registry[V.name]){console.error(`Two workflows are named "${V.name}" \u2014 the first is registered `+"and this one is not. A workflow's name is its key in storage. Rename one.");continue}this.registry[V.name]=V}}get tickJob(){return this.tickClass??=o0(this),this.tickClass}get store(){if(!this.storeInstance){let z=this.queue.driver.workflowStore?.();if(!z||!this.queue.driver.enqueueBatch)throw Error("This queue's driver does not support workflows. The memory and database drivers do.");this.storeInstance=z}return this.storeInstance}start(z,V){if(z.name==="unset"||!z.name)throw Error("Cannot start a workflow with no name");let Y=this.store,Z={id:Bun.randomUUIDv7(),name:z.name,args:u(V,`The arguments of ${z.name}`)??"[]"},$=()=>this.queue.claimSoon(),X=Y.joinsTransaction?.()===!0;if(!X){if(D(()=>Y.create(Z).then($,(B)=>{console.error(`[gemi] The queue could not record the workflow ${z.name}, which was held until its transaction committed. The transaction stays committed; the workflow did not start.`,B)})))return Promise.resolve(Z.id)}let H=Y.create(Z),G=X&&D($);return H.then(()=>{if(!G)$();return Z.id})}async signal(z,V,Y){if(typeof V!=="string"||V.length===0||V.length>191)throw TypeError("A signal key is a string of 1 to 191 characters.");let Z=u(Y,`The payload of signal "${V}"`),$=await this.store.update(z,{key:V},({workflow:X,step:H,now:G})=>{if(r.includes(X.status)||X.status==="cancelling")return{result:!1};if(!H)return{result:!0,step:{workflowId:z,key:V,status:"signalled",attempt:0,output:Z,error:null,batchId:null,wakeAt:null,startedAt:null,finishedAt:G,createdAt:G,updatedAt:G}};if(H.status!=="waiting")return{result:!1};return{result:!0,step:{...H,status:"signalled",output:Z,wakeAt:H.wakeAt,finishedAt:G},tick:{delayMs:0}}});if($)this.queue.claimSoon();return $===!0}async cancel(z){let V=await this.store.update(z,{allSteps:!0},({workflow:Y,steps:Z})=>{if(r.includes(Y.status)||Y.status==="cancelling")return{result:!1};return{result:!0,workflow:{status:"cancelling"},cancelBatches:Z.filter(($)=>$.status==="batching"&&$.batchId!==null).map(($)=>$.batchId),tick:{delayMs:0}}});if(V)this.queue.claimSoon();return V===!0}async find(z){let V=await this.store.find(z);if(!V)return null;let{workflow:Y,steps:Z}=V,$=[];try{$=JSON.parse(Y.args)}catch{}return{id:Y.id,name:Y.name,status:Y.status,args:$,currentStep:Y.currentStep,progress:Y.progress,result:e0(Y.result),error:Y.error,steps:await Promise.all(Z.map(async(X)=>{let H={key:X.key,status:X.status,attempt:X.attempt,error:X.error,batchId:X.batchId,wakeAt:X.wakeAt,startedAt:X.startedAt,finishedAt:X.finishedAt};if(X.batchId===null)return H;let G=await this.queue.driver.findBatch?.(X.batchId);return G?{...H,progress:G.progress}:H})),createdAt:Y.createdAt,updatedAt:Y.updatedAt}}async tick(z,V){let Y=this.store,Z=V.$claimed,$=Z?`${Z.id}:${Z.attempt}`:`${crypto.randomUUID()}:1`,X=Math.max(1,this.queue.config.visibilityTimeout),H=await Y.acquire(z,$,X);if(H.kind!=="acquired")return;let{workflow:G}=H,Q=(J={})=>Y.update(z,{owner:$},()=>({...J,result:void 0,unlock:!0})).then(()=>this.queue.claimSoon()).catch((P)=>{if(!(P instanceof R))throw P});if(r.includes(G.status))return Q();let B=this.registry[G.name];if(!B)return this.unknown(G,V,Q);let K;try{K=JSON.parse(G.args)}catch(J){return Q({workflow:{status:"failed",error:`The arguments are not JSON: ${a(J)}`}})}let A=setInterval(()=>{Y.renew(z,$,X).catch((J)=>{console.error(`[gemi] Could not extend the hold on workflow ${z}.`,J)})},Math.max(1,Math.floor(X/3)));A.unref?.();let U=G.status==="cancelling",F=new Z0({workflowId:z,owner:$,store:Y,steps:H.steps,cancelling:U,findBatch:(J)=>this.queue.driver.findBatch?.(J,{progress:!1})??Promise.resolve(null),buildBatch:(J,P,N)=>this.queue.buildBatch(J,P.map((C)=>JSON.stringify(C)),{name:N.name,allowFailures:N.allowFailures,finally:{name:I,args:[z]}}),scheduled:()=>this.queue.claimSoon(),cancelCheckMs:t0});try{let J;try{let P=new B,N=await(U?P.onCancel(F,...K):P.run(F,...K));J=F.suspension?{kind:"suspended"}:{kind:"completed",result:U?null:u(N,`The result of ${G.name}`)}}catch(P){if(J=F.suspension||P instanceof g?{kind:"suspended"}:{kind:"failed",error:a(P)},P instanceof R)F.lost=!0}if(await F.settled(),F.lost)return;if(J.kind==="completed"&&F.suspension)J={kind:"suspended"};await Y.update(z,{owner:$},({workflow:P,now:N})=>this.finish(P,J,F,U,N)),this.queue.claimSoon()}catch(J){if(J instanceof R)return;throw J}finally{clearInterval(A)}}finish(z,V,Y,Z,$){let X={result:void 0,unlock:!0};if(z.status==="cancelling"&&!Z)return{...X,tick:{delayMs:0}};if(V.kind==="completed")return{...X,workflow:Z?{status:"cancelled",currentStep:null,wakeAt:null}:{status:"completed",result:V.result,progress:1,currentStep:null,wakeAt:null,error:null}};if(V.kind==="failed")return{...X,workflow:{status:Z?"cancelled":"failed",error:V.error,wakeAt:null}};let H=Y.suspension??{status:"waiting",wakes:[]},G={...X,workflow:{status:Z?"cancelling":H.status,currentStep:Y.current??z.currentStep}};if(H.wakes.length>0){let Q=Math.min(...H.wakes);if(!(z.wakeAt!==null&&z.wakeAt>$&&z.wakeAt<=Q))G.tick={delayMs:Math.max(0,Q-$)},G.workflow.wakeAt=Q}return G}async unknown(z,V,Y){let Z=Date.now()-z.createdAt;if(this.queue.durable&&Z<this.queue.config.unknownJobGrace){if(!this.reportedNames.has(z.name))this.reportedNames.add(z.name),console.error(`Left workflow "${z.name}" for another replica: nothing is registered here under that name.`);await Y(),V.release(Math.round(this.queue.config.pollInterval*(1+Math.random())));return}console.error(`Failed workflow ${z.id}: nothing is registered under the name "${z.name}". If the class exists, it was not discovered: check that it is under the queue slice's workflowsDir (app/workflows by default), or list it in app/config/queue.ts.`),await Y({workflow:{status:"failed",error:`No workflow is registered under the name "${z.name}".`}})}tickDeadLettered(z,V){console.error(`[gemi] The tick of workflow ${z} was dead-lettered.`,V),this.store.update(z,{},({workflow:Y})=>r.includes(Y.status)?{result:void 0}:{result:void 0,workflow:{status:"failed",error:`Its tick job was dead-lettered: ${V.message}`},unlock:!0}).catch(()=>{})}}function o0(z){return class extends S{static name=I;maxAttempts=20;backoff=[1000,5000,15000,30000,60000];async run(Y){await z.tick(Y,this)}onDeadletter(Y,Z){z.tickDeadLettered(Z,Y)}}}function e0(z){try{return _(z)}catch{return z}}
|
|
414
|
-
export{y as
|
|
414
|
+
export{y as Kd,p as Ld,o as Md,U0 as Nd,z0 as Od,Az as Pd,D0 as Qd,V0 as Rd,i as Sd,I0 as Td,Y0 as Ud,E0 as Vd,O0 as Wd,Z0 as Xd,H0 as Yd,h as Zd,s0 as _d,n0 as $d,cz as ae,a0 as be,S as ce};
|
|
415
415
|
|
|
416
|
-
//# debugId=
|
|
416
|
+
//# debugId=431FD33988F3985C64756E2164756E21
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"import { deferUntilCommit } from \"../../../orm/context\";\nimport { Job } from \"../Job\";\nimport type { QueueManager } from \"../QueueManager\";\nimport {\n Step,\n WorkflowSuspended,\n decode,\n describe,\n encode,\n} from \"./Step\";\nimport type { WorkflowClass, WorkflowStatus } from \"./Workflow\";\nimport {\n WORKFLOW_TICK_JOB,\n type WorkflowChange,\n WorkflowLeaseLostError,\n type WorkflowRecord,\n type WorkflowRunStatus,\n type WorkflowStore,\n} from \"./WorkflowStore\";\n\nconst ENDED: readonly WorkflowRunStatus[] = [\"completed\", \"failed\", \"cancelled\"];\n\n/** How often a running `step.run` checks whether its workflow was cancelled. */\nconst CANCEL_CHECK_MS = 1000;\n\ntype Outcome =\n | { kind: \"completed\"; result: string | null }\n | { kind: \"failed\"; error: string }\n | { kind: \"suspended\" };\n\n/**\n * The queue's half of workflows: the registry of workflow classes, what\n * `Workflow.start`, `signal`, `find` and `cancel` do, and the tick.\n *\n * ### The tick\n *\n * A workflow advances only inside its tick job, which takes the workflow\n * from the store for a lease (the queue's `visibilityTimeout`, renewed while\n * it runs), runs one pass of `run`, and lets go with the outcome written in\n * the same step. Every write of the pass is fenced by that hold, so a tick\n * that lost it (it was too slow and another took over) changes nothing.\n *\n * A tick that finds the workflow held by another is dropped, after marking\n * the workflow so the holder enqueues a fresh tick when it lets go: a signal\n * that lands mid-pass is never lost, and two passes of one workflow never\n * overlap. A tick that failed or died holds the workflow under its job's id,\n * so its own retry takes it straight back.\n */\nexport class WorkflowRuntime {\n private registry: Record<string, WorkflowClass> = {};\n private storeInstance: WorkflowStore | undefined;\n private tickClass: (new () => Job) | undefined;\n private readonly reportedNames = new Set<string>();\n\n constructor(private readonly queue: QueueManager) {}\n\n /** The workflow classes this process can run, by `static name`. */\n get workflows(): Readonly<Record<string, WorkflowClass>> {\n return this.registry;\n }\n\n /** Replaces the registry. The first class to claim a name wins. */\n use(workflows: readonly WorkflowClass[]) {\n this.registry = {};\n for (const workflow of workflows) {\n if (workflow.name === \"unset\" || !workflow.name) {\n console.error(\n `A workflow class has no \\`static name\\`, so it was not registered. Add one.`,\n );\n continue;\n }\n if (this.registry[workflow.name]) {\n console.error(\n `Two workflows are named \"${workflow.name}\" — the first is registered ` +\n `and this one is not. A workflow's name is its key in storage. Rename one.`,\n );\n continue;\n }\n this.registry[workflow.name] = workflow;\n }\n }\n\n /** The internal job a workflow's passes run in, one class per manager. */\n get tickJob(): new () => Job {\n this.tickClass ??= tickJobFor(this);\n return this.tickClass;\n }\n\n get store(): WorkflowStore {\n if (!this.storeInstance) {\n const store = this.queue.driver.workflowStore?.();\n if (!store || !this.queue.driver.enqueueBatch) {\n throw new Error(\n `This queue's driver does not support workflows. The memory and ` +\n `database drivers do.`,\n );\n }\n this.storeInstance = store;\n }\n return this.storeInstance;\n }\n\n start(workflow: WorkflowClass, args: unknown[]): Promise<string> {\n if (workflow.name === \"unset\" || !workflow.name) {\n throw new Error(\"Cannot start a workflow with no name\");\n }\n const store = this.store;\n const record = {\n id: Bun.randomUUIDv7(),\n name: workflow.name,\n args: encode(args, `The arguments of ${workflow.name}`) ?? \"[]\",\n };\n const wake = () => this.queue.claimSoon();\n\n // As `QueueManager.push`: on the caller's transaction when the store\n // joins it, otherwise held until it commits.\n const joins = store.joinsTransaction?.() === true;\n if (!joins) {\n const held = deferUntilCommit(() =>\n store.create(record).then(wake, (error: unknown) => {\n console.error(\n `[gemi] The queue could not record the workflow ${workflow.name}, which ` +\n `was held until its transaction committed. The transaction stays ` +\n `committed; the workflow did not start.`,\n error,\n );\n }),\n );\n if (held) return Promise.resolve(record.id);\n }\n const written = store.create(record);\n const wakeAtCommit = joins && deferUntilCommit(wake);\n return written.then(() => {\n if (!wakeAtCommit) wake();\n return record.id;\n });\n }\n\n async signal(id: string, key: string, payload?: unknown): Promise<boolean> {\n if (typeof key !== \"string\" || key.length === 0 || key.length > 191) {\n throw new TypeError(`A signal key is a string of 1 to 191 characters.`);\n }\n const output = encode(payload, `The payload of signal \"${key}\"`);\n const taken = await this.store.update(id, { key }, ({ workflow, step, now }) => {\n if (ENDED.includes(workflow.status) || workflow.status === \"cancelling\") {\n return { result: false };\n }\n if (!step) {\n return {\n result: true,\n step: {\n workflowId: id,\n key,\n status: \"signalled\",\n attempt: 0,\n output,\n error: null,\n batchId: null,\n wakeAt: null,\n startedAt: null,\n finishedAt: now,\n createdAt: now,\n updatedAt: now,\n },\n };\n }\n if (step.status !== \"waiting\") return { result: false };\n return {\n result: true,\n step: { ...step, status: \"signalled\", output, wakeAt: step.wakeAt, finishedAt: now },\n tick: { delayMs: 0 },\n };\n });\n if (taken) this.queue.claimSoon();\n return taken === true;\n }\n\n async cancel(id: string): Promise<boolean> {\n const cancelled = await this.store.update(id, { allSteps: true }, ({ workflow, steps }) => {\n if (ENDED.includes(workflow.status) || workflow.status === \"cancelling\") {\n return { result: false };\n }\n return {\n result: true,\n workflow: { status: \"cancelling\" },\n cancelBatches: steps\n .filter((step) => step.status === \"batching\" && step.batchId !== null)\n .map((step) => step.batchId!),\n tick: { delayMs: 0 },\n };\n });\n if (cancelled) this.queue.claimSoon();\n return cancelled === true;\n }\n\n async find(id: string): Promise<WorkflowStatus | null> {\n const state = await this.store.find(id);\n if (!state) return null;\n const { workflow, steps } = state;\n let args: unknown[] = [];\n try {\n args = JSON.parse(workflow.args) as unknown[];\n } catch {}\n return {\n id: workflow.id,\n name: workflow.name,\n status: workflow.status,\n args,\n currentStep: workflow.currentStep,\n progress: workflow.progress,\n result: safeDecode(workflow.result),\n error: workflow.error,\n steps: await Promise.all(\n steps.map(async (step) => {\n const status = {\n key: step.key,\n status: step.status,\n attempt: step.attempt,\n error: step.error,\n batchId: step.batchId,\n wakeAt: step.wakeAt,\n startedAt: step.startedAt,\n finishedAt: step.finishedAt,\n };\n if (step.batchId === null) return status;\n const batch = await this.queue.driver.findBatch?.(step.batchId);\n return batch ? { ...status, progress: batch.progress } : status;\n }),\n ),\n createdAt: workflow.createdAt,\n updatedAt: workflow.updatedAt,\n };\n }\n\n /** One pass of the workflow `id`, run by its tick job. */\n async tick(id: string, job: Job): Promise<void> {\n const store = this.store;\n const claimed = job.$claimed;\n const owner = claimed\n ? `${claimed.id}:${claimed.attempt}`\n : `${crypto.randomUUID()}:1`;\n const lease = Math.max(1, this.queue.config.visibilityTimeout);\n const acquired = await store.acquire(id, owner, lease);\n if (acquired.kind !== \"acquired\") return;\n const { workflow } = acquired;\n\n const letGo = (change: Partial<WorkflowChange<undefined>> = {}) =>\n store\n .update(id, { owner }, () => ({ ...change, result: undefined, unlock: true }))\n .then(() => this.queue.claimSoon())\n .catch((error) => {\n if (!(error instanceof WorkflowLeaseLostError)) throw error;\n });\n\n if (ENDED.includes(workflow.status)) return letGo();\n\n const Class = this.registry[workflow.name];\n if (!Class) return this.unknown(workflow, job, letGo);\n\n let args: unknown[];\n try {\n args = JSON.parse(workflow.args) as unknown[];\n } catch (error) {\n return letGo({\n workflow: { status: \"failed\", error: `The arguments are not JSON: ${describe(error)}` },\n });\n }\n\n const renew = setInterval(\n () => {\n store.renew(id, owner, lease).catch((error) => {\n console.error(`[gemi] Could not extend the hold on workflow ${id}.`, error);\n });\n },\n Math.max(1, Math.floor(lease / 3)),\n );\n renew.unref?.();\n\n const cancelling = workflow.status === \"cancelling\";\n const step = new Step({\n workflowId: id,\n owner,\n store,\n steps: acquired.steps,\n cancelling,\n findBatch: (batchId) =>\n this.queue.driver.findBatch?.(batchId, { progress: false }) ?? Promise.resolve(null),\n buildBatch: (batchJob, tuples, options) =>\n this.queue.buildBatch(\n batchJob,\n tuples.map((tuple) => JSON.stringify(tuple)),\n {\n name: options.name,\n allowFailures: options.allowFailures,\n finally: { name: WORKFLOW_TICK_JOB, args: [id] },\n },\n ),\n scheduled: () => this.queue.claimSoon(),\n cancelCheckMs: CANCEL_CHECK_MS,\n });\n\n try {\n let outcome: Outcome;\n try {\n const instance = new Class();\n const value = await (cancelling\n ? instance.onCancel(step, ...args)\n : instance.run(step, ...args));\n outcome = step.suspension\n ? { kind: \"suspended\" }\n : {\n kind: \"completed\",\n result: cancelling ? null : encode(value, `The result of ${workflow.name}`),\n };\n } catch (error) {\n outcome =\n step.suspension || error instanceof WorkflowSuspended\n ? { kind: \"suspended\" }\n : { kind: \"failed\", error: describe(error) };\n if (error instanceof WorkflowLeaseLostError) step.lost = true;\n }\n // A step the code did not await (or one that ran beside a sleep in a\n // `Promise.all`) is still writing; it finishes inside this pass.\n await step.settled();\n if (step.lost) return;\n // One of those suspended the workflow after `run` had returned: it is\n // not done until that step is.\n if (outcome.kind === \"completed\" && step.suspension) outcome = { kind: \"suspended\" };\n\n await store.update(id, { owner }, ({ workflow: current, now }) =>\n this.finish(current, outcome, step, cancelling, now),\n );\n this.queue.claimSoon();\n } catch (error) {\n if (error instanceof WorkflowLeaseLostError) return;\n throw error;\n } finally {\n clearInterval(renew);\n }\n }\n\n /** The tick's last write: the pass's outcome, and letting go. */\n private finish(\n current: WorkflowRecord,\n outcome: Outcome,\n step: Step,\n cancelling: boolean,\n now: number,\n ): WorkflowChange<undefined> {\n const change: WorkflowChange<undefined> = { result: undefined, unlock: true };\n\n // Cancelled during this pass of `run`: `onCancel` is next, whatever the\n // pass came to.\n if (current.status === \"cancelling\" && !cancelling) {\n return { ...change, tick: { delayMs: 0 } };\n }\n\n if (outcome.kind === \"completed\") {\n return {\n ...change,\n workflow: cancelling\n ? { status: \"cancelled\", currentStep: null, wakeAt: null }\n : {\n status: \"completed\",\n result: outcome.result,\n progress: 1,\n currentStep: null,\n wakeAt: null,\n error: null,\n },\n };\n }\n if (outcome.kind === \"failed\") {\n return {\n ...change,\n workflow: { status: cancelling ? \"cancelled\" : \"failed\", error: outcome.error, wakeAt: null },\n };\n }\n\n const suspension = step.suspension ?? { status: \"waiting\" as const, wakes: [] };\n const next: WorkflowChange<undefined> = {\n ...change,\n workflow: {\n status: cancelling ? \"cancelling\" : suspension.status,\n currentStep: step.current ?? current.currentStep,\n },\n };\n if (suspension.wakes.length > 0) {\n const wakeAt = Math.min(...suspension.wakes);\n // A tick already scheduled no later than this one wakes the workflow\n // in time, and schedules this one itself; a second would only run the\n // pass twice.\n const scheduled =\n current.wakeAt !== null && current.wakeAt > now && current.wakeAt <= wakeAt;\n if (!scheduled) {\n next.tick = { delayMs: Math.max(0, wakeAt - now) };\n next.workflow!.wakeAt = wakeAt;\n }\n }\n return next;\n }\n\n /**\n * A tick for a workflow this process has no class for. During a\n * blue/green ramp that is usually one only the other release has, so on a\n * shared driver it goes back for another replica until `unknownJobGrace`\n * has passed since the workflow started; then it fails.\n */\n private async unknown(\n workflow: WorkflowRecord,\n job: Job,\n letGo: (change?: Partial<WorkflowChange<undefined>>) => Promise<void>,\n ) {\n const age = Date.now() - workflow.createdAt;\n if (this.queue.durable && age < this.queue.config.unknownJobGrace) {\n if (!this.reportedNames.has(workflow.name)) {\n this.reportedNames.add(workflow.name);\n console.error(\n `Left workflow \"${workflow.name}\" for another replica: nothing is ` +\n `registered here under that name.`,\n );\n }\n await letGo();\n job.release(Math.round(this.queue.config.pollInterval * (1 + Math.random())));\n return;\n }\n console.error(\n `Failed workflow ${workflow.id}: nothing is registered under the name ` +\n `\"${workflow.name}\". If the class exists, it was not discovered: check ` +\n `that it is under the queue slice's workflowsDir (app/workflows by ` +\n `default), or list it in app/config/queue.ts.`,\n );\n await letGo({\n workflow: {\n status: \"failed\",\n error: `No workflow is registered under the name \"${workflow.name}\".`,\n },\n });\n }\n\n /**\n * The tick job ran out of attempts, which only a store that stayed\n * unreachable causes. Fails the workflow if it still can, so it does not\n * sit in `running` with nothing left to advance it.\n */\n /** @internal */\n tickDeadLettered(id: string, error: Error) {\n console.error(`[gemi] The tick of workflow ${id} was dead-lettered.`, error);\n void this.store\n .update(id, {}, ({ workflow }) =>\n ENDED.includes(workflow.status)\n ? { result: undefined }\n : {\n result: undefined,\n workflow: {\n status: \"failed\",\n error: `Its tick job was dead-lettered: ${error.message}`,\n },\n unlock: true,\n },\n )\n .catch(() => {});\n }\n}\n\n/** The internal job a workflow's passes run in, bound to one runtime. */\nfunction tickJobFor(runtime: WorkflowRuntime): new () => Job {\n return class WorkflowTickJob extends Job {\n static name = WORKFLOW_TICK_JOB;\n // A tick fails only when the store cannot be reached (a workflow's own\n // errors are recorded, not thrown), so it keeps trying for a while rather\n // than leaving the workflow stuck.\n maxAttempts = 20;\n backoff = [1000, 5000, 15000, 30000, 60000];\n async run(id: string) {\n await runtime.tick(id, this);\n }\n onDeadletter(error: Error, id: string) {\n runtime.tickDeadLettered(id, error);\n }\n };\n}\n\nfunction safeDecode(output: string | null): unknown {\n try {\n return decode(output);\n } catch {\n return output;\n }\n}\n"
|
|
19
19
|
],
|
|
20
20
|
"mappings": ";6VAuCO,AAAM,LAAuC,LACzC,AACQ,FACA,QACA,WACA,YACT,WAER,WAAW,CACT,EAEA,EAAoC,CAAC,EACrC,CACA,IAAM,EAAQ,EAAQ,OAAS,aAC/B,GAAI,CAAC,2BAA2B,KAAK,CAAK,EACxC,MAAU,MACR,wBAAwB,oEAE1B,E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function U(j){return j.split(/[-_]/)[0].toLowerCase()}function H(j,B,N){let R=j?.split(";")[0].trim();if(!R||!I(R))return null;let W=R.replaceAll("_","-").toLowerCase(),J=B.find((X)=>X.toLowerCase()===W);if(J)return J;let K=U(R),S=B.filter((X)=>U(X)===K);if(S.length===0)return null;if(N&&S.includes(N))return N;return S[0]}var C=/^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/;function V(j){let B=[];for(let N of j.split(",")){let[R,...W]=N.split(";"),J=R.trim();if(!J||J!=="*"&&!I(J))continue;let K=1,S=!0;for(let X of W){let[z,O=""]=X.split("=");if(z.trim().toLowerCase()!=="q")continue;let Q=O.trim();if(!C.test(Q)){S=!1;break}K=Number(Q)}if(S)B.push({tag:J,q:K,index:B.length})}return B.sort((N,R)=>R.q-N.q||N.index-R.index)}function E(j,B){let N=j.replaceAll("_","-").toLowerCase(),R=B.replaceAll("_","-").toLowerCase();return R===N||R.startsWith(`${N}-`)}function M(j,B,N){if(!j||B.length===0)return null;let R=V(j),W=R.filter((S)=>S.q===0&&S.tag!=="*").map((S)=>S.tag),J=B.filter((S)=>!W.some((X)=>E(X,S)));if(J.length===0)return null;let K=!1;for(let{tag:S,q:X}of R){if(X===0)continue;if(S==="*"){K=!0;continue}let z=H(S,J,N);if(z)return z}if(!K)return null;return(N&&J.includes(N)?N:J[0])??null}var y="UTC";function G(j){if(typeof j!=="string"||j.length===0)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:j}),!0}catch{return!1}}var Y=new Map,F=500;function $(j,B){let N=Y.get(j);if(N===void 0){if(Y.size>=F)Y.delete(Y.keys().next().value);N=B(),Y.set(j,N)}return N}function P(j){return j instanceof Date?j:new Date(j)}function D(j){return j.dateStyle!==void 0||j.timeStyle!==void 0||j.weekday!==void 0||j.era!==void 0||j.year!==void 0||j.month!==void 0||j.day!==void 0||j.dayPeriod!==void 0||j.hour!==void 0||j.minute!==void 0||j.second!==void 0||j.fractionalSecondDigits!==void 0||j.timeZoneName!==void 0}function x(j){let{locale:B,timeZone:N}=j,R=(J={})=>{let K={...J,timeZone:J.timeZone??N};return $(`dt|${B}|${JSON.stringify(K)}`,()=>{return new Intl.DateTimeFormat(B,K)})},W=(J,K)=>{if(J&&D(J))return J;return{...K,...J}};return{locale:B,timeZone:N,date(J,K){return R(W(K,{dateStyle:"medium"})).format(P(J))},time(J,K){return R(W(K,{timeStyle:"short"})).format(P(J))},dateTime(J,K){return R(W(K,{dateStyle:"medium",timeStyle:"short"})).format(P(J))},number(J,K={}){return $(`n|${B}|${JSON.stringify(K)}`,()=>new Intl.NumberFormat(B,K)).format(J)},relative(J,K,S={}){return $(`r|${B}|${JSON.stringify(S)}`,()=>new Intl.RelativeTimeFormat(B,S)).format(J,K)},list(J,K={}){return $(`l|${B}|${JSON.stringify(K)}`,()=>new Intl.ListFormat(B,K)).format(J)},plural(J,K={}){return $(`p|${B}|${JSON.stringify(K)}`,()=>new Intl.PluralRules(B,K)).select(J)},dateTimeFormat:R}}class b{config;static token="translator";translations={};isEnabled=!1;constructor(j){this.config=j;if(!G(this.config.timeZone))throw Error(`translation.timeZone: "${String(this.config.timeZone)}" is not a time zone this runtime knows. Use an IANA name such as "UTC" or "Europe/Istanbul".`);let B={};for(let[N,R]of Object.entries(this.config.prefetch))for(let W of this.config.supportedLocales){if(!B[W])B[W]={};B[W][N]={};for(let J of R){B[W][N][J.name]={};for(let[K,S]of Object.entries(J.dictionary))this.isEnabled=!0,B[W][N][J.name][K]=S[W]}}this.translations=B}get isLocaleAware(){return this.isEnabled||this.config.supportedLocales.length>0}get supportedLocales(){return this.config.supportedLocales}get defaultLocale(){return this.config.defaultLocale}get components(){return this.config.components}get timeZone(){return this.config.timeZone}detectTimeZone(j){if(j){let B=this.config.detectTimeZone(j);if(G(B))return B}return this.config.timeZone}formatter(j,B){return x({locale:j||this.defaultLocale,timeZone:G(B)?B:this.timeZone})}onLocaleChange(j){return this.config.onLocaleChange(j)}detectLocale(j){let B=this.config.defaultLocale??this.config.supportedLocales[0]??"en-US",N=(K)=>H(K,this.config.supportedLocales,this.config.defaultLocale),R=N(this.config.detectLocale(j));if(R)return R;let W=N(j.cookies.get("i18n-locale"));if(W)return W;let J=M(j.headers.get("accept-language"),this.config.supportedLocales,this.config.defaultLocale);if(J)return J;return B}getPageTranslations(j,B){if(this.translations[j][B])return this.translations[j][B];return{}}}
|
|
3
|
-
export{H as
|
|
3
|
+
export{H as Vk,M as Wk,y as Xk,G as Yk,x as Zk,b as _k};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=DEAB752F4488841664756E2164756E21
|