gemi 0.115.0 → 0.117.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/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/auth/AuthServiceProvider.d.ts.map +1 -1
- package/dist/auth/config.d.ts +27 -0
- package/dist/auth/config.d.ts.map +1 -1
- package/dist/auth/connections/ConnectionManager.d.ts +133 -0
- package/dist/auth/connections/ConnectionManager.d.ts.map +1 -0
- package/dist/auth/connections/ConnectionStore.d.ts +146 -0
- package/dist/auth/connections/ConnectionStore.d.ts.map +1 -0
- package/dist/auth/connections/ConnectionsController.d.ts +23 -0
- package/dist/auth/connections/ConnectionsController.d.ts.map +1 -0
- package/dist/auth/connections/OAuthConnectionProvider.d.ts +105 -0
- package/dist/auth/connections/OAuthConnectionProvider.d.ts.map +1 -0
- package/dist/auth/connections/errors.d.ts +32 -0
- package/dist/auth/connections/errors.d.ts.map +1 -0
- package/dist/auth/oauth/oauthState.d.ts +15 -2
- package/dist/auth/oauth/oauthState.d.ts.map +1 -1
- package/dist/auth/routes.d.ts +13 -0
- package/dist/auth/routes.d.ts.map +1 -1
- package/dist/bin/orm/emit.d.ts.map +1 -1
- package/dist/bin/orm-generator.js +51 -4
- package/dist/bin/orm-generator.js.map +4 -4
- 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-00n3gwr8.js +71 -0
- package/dist/chunk-00n3gwr8.js.map +13 -0
- package/dist/{chunk-t4yh4nf9.js → chunk-076jezzg.js} +3 -3
- package/dist/{chunk-t4yh4nf9.js.map → chunk-076jezzg.js.map} +1 -1
- package/dist/{chunk-qjhw8nje.js → chunk-077rea02.js} +1 -1
- package/dist/{chunk-0av6xvm6.js → chunk-1ckha5dt.js} +3 -3
- package/dist/{chunk-0av6xvm6.js.map → chunk-1ckha5dt.js.map} +1 -1
- package/dist/{chunk-mschc94q.js → chunk-1zzd39qg.js} +2 -2
- package/dist/{chunk-mschc94q.js.map → chunk-1zzd39qg.js.map} +1 -1
- package/dist/{chunk-5stgtwqw.js → chunk-2bja99cq.js} +2 -2
- package/dist/{chunk-5stgtwqw.js.map → chunk-2bja99cq.js.map} +1 -1
- package/dist/chunk-2czfefn2.js +10 -0
- package/dist/{chunk-t4t3hqe0.js.map → chunk-2czfefn2.js.map} +5 -4
- package/dist/{chunk-aazmrxj9.js → chunk-37pk2cjg.js} +2 -2
- package/dist/{chunk-aazmrxj9.js.map → chunk-37pk2cjg.js.map} +1 -1
- package/dist/{chunk-qsrcdzan.js → chunk-3w4hk6q2.js} +3 -3
- package/dist/{chunk-qsrcdzan.js.map → chunk-3w4hk6q2.js.map} +1 -1
- package/dist/chunk-51w202vr.js +5 -0
- package/dist/{chunk-whtzggn6.js.map → chunk-51w202vr.js.map} +3 -4
- package/dist/{chunk-0z8ejxre.js → chunk-5m8vvtvn.js} +3 -3
- package/dist/{chunk-0z8ejxre.js.map → chunk-5m8vvtvn.js.map} +1 -1
- package/dist/{chunk-jafm3613.js → chunk-5p4z1fgc.js} +2 -2
- package/dist/{chunk-jafm3613.js.map → chunk-5p4z1fgc.js.map} +1 -1
- package/dist/{chunk-kejwjerj.js → chunk-5w6kyxsj.js} +2 -2
- package/dist/{chunk-kejwjerj.js.map → chunk-5w6kyxsj.js.map} +1 -1
- package/dist/{chunk-pyk3gzvc.js → chunk-62jw0vsf.js} +2 -2
- package/dist/{chunk-pyk3gzvc.js.map → chunk-62jw0vsf.js.map} +1 -1
- package/dist/chunk-63ewmmhc.js +5 -0
- package/dist/{chunk-t24p7gc6.js.map → chunk-63ewmmhc.js.map} +1 -1
- package/dist/{chunk-p1aqq0ga.js → chunk-6ggmk2eg.js} +3 -3
- package/dist/{chunk-p1aqq0ga.js.map → chunk-6ggmk2eg.js.map} +1 -1
- package/dist/{chunk-2tzm58j3.js → chunk-6y4nk9f1.js} +2 -2
- package/dist/{chunk-2tzm58j3.js.map → chunk-6y4nk9f1.js.map} +1 -1
- package/dist/{chunk-1hr4xht1.js → chunk-8gtc3s1y.js} +2 -2
- package/dist/{chunk-1hr4xht1.js.map → chunk-8gtc3s1y.js.map} +1 -1
- package/dist/{chunk-frerzsxq.js → chunk-a22h5cby.js} +2 -2
- package/dist/{chunk-frerzsxq.js.map → chunk-a22h5cby.js.map} +1 -1
- package/dist/{chunk-zyt2w03d.js → chunk-a32wfzdq.js} +2 -2
- package/dist/{chunk-zyt2w03d.js.map → chunk-a32wfzdq.js.map} +1 -1
- package/dist/{chunk-t04f3akb.js → chunk-a77586gv.js} +2 -2
- package/dist/{chunk-t04f3akb.js.map → chunk-a77586gv.js.map} +1 -1
- package/dist/chunk-a7r39713.js +5 -0
- package/dist/chunk-a7r39713.js.map +10 -0
- package/dist/{chunk-vxm6yevm.js → chunk-arwmvgrz.js} +2 -2
- package/dist/{chunk-vxm6yevm.js.map → chunk-arwmvgrz.js.map} +1 -1
- package/dist/{chunk-41da9628.js → chunk-bvqae0px.js} +1 -1
- package/dist/{chunk-d9mar37g.js → chunk-c2n6zdyd.js} +2 -2
- package/dist/{chunk-d9mar37g.js.map → chunk-c2n6zdyd.js.map} +1 -1
- package/dist/{chunk-56jky6vf.js → chunk-cytss9mb.js} +2 -2
- package/dist/{chunk-56jky6vf.js.map → chunk-cytss9mb.js.map} +1 -1
- package/dist/{chunk-vw8849ys.js → chunk-dcgvq79a.js} +2 -2
- package/dist/{chunk-m54s6jpr.js.map → chunk-dcgvq79a.js.map} +1 -1
- package/dist/{chunk-6chz1ktz.js → chunk-de4t48j9.js} +3 -3
- package/dist/{chunk-6chz1ktz.js.map → chunk-de4t48j9.js.map} +1 -1
- package/dist/{chunk-cbqazg9k.js → chunk-dz99g58c.js} +2 -2
- package/dist/{chunk-cbqazg9k.js.map → chunk-dz99g58c.js.map} +1 -1
- package/dist/{chunk-e573yxpq.js → chunk-e7ezmag9.js} +3 -3
- package/dist/{chunk-e573yxpq.js.map → chunk-e7ezmag9.js.map} +1 -1
- package/dist/{chunk-yer1r3t3.js → chunk-epvpmakp.js} +2 -2
- package/dist/{chunk-yer1r3t3.js.map → chunk-epvpmakp.js.map} +1 -1
- package/dist/{chunk-yhrye9cm.js → chunk-f8vcwzgd.js} +2 -2
- package/dist/{chunk-yhrye9cm.js.map → chunk-f8vcwzgd.js.map} +1 -1
- package/dist/chunk-fa37qzm3.js +5 -0
- package/dist/chunk-fa37qzm3.js.map +12 -0
- package/dist/{chunk-fxgxf16k.js → chunk-ffgmqwzy.js} +2 -2
- package/dist/{chunk-fxgxf16k.js.map → chunk-ffgmqwzy.js.map} +1 -1
- package/dist/{chunk-er3wf6ng.js → chunk-fk6nxhxn.js} +2 -2
- package/dist/{chunk-er3wf6ng.js.map → chunk-fk6nxhxn.js.map} +1 -1
- package/dist/{chunk-3hrj5rwm.js → chunk-fnwbbmnk.js} +2 -2
- package/dist/{chunk-3hrj5rwm.js.map → chunk-fnwbbmnk.js.map} +1 -1
- package/dist/chunk-g2wncay4.js +9 -0
- package/dist/{chunk-hytt9qyj.js.map → chunk-g2wncay4.js.map} +3 -4
- package/dist/{chunk-gts5p6mw.js → chunk-ge9xjwgq.js} +4 -4
- package/dist/{chunk-gts5p6mw.js.map → chunk-ge9xjwgq.js.map} +1 -1
- package/dist/{chunk-tw5kwbx4.js → chunk-gjy2qjcr.js} +2 -2
- package/dist/{chunk-tw5kwbx4.js.map → chunk-gjy2qjcr.js.map} +1 -1
- package/dist/{chunk-15c2vgaf.js → chunk-gn7kne7r.js} +2 -2
- package/dist/{chunk-15c2vgaf.js.map → chunk-gn7kne7r.js.map} +1 -1
- package/dist/{chunk-9n1hx3mq.js → chunk-hr61ekcr.js} +3 -3
- package/dist/{chunk-9n1hx3mq.js.map → chunk-hr61ekcr.js.map} +1 -1
- package/dist/{chunk-m54s6jpr.js → chunk-hvgmqt6z.js} +2 -2
- package/dist/{chunk-vw8849ys.js.map → chunk-hvgmqt6z.js.map} +1 -1
- package/dist/{chunk-aeh67ynz.js → chunk-hvpn18bb.js} +3 -3
- package/dist/{chunk-aeh67ynz.js.map → chunk-hvpn18bb.js.map} +1 -1
- package/dist/{chunk-jdhdrr2k.js → chunk-j1453bn1.js} +2 -2
- package/dist/{chunk-jdhdrr2k.js.map → chunk-j1453bn1.js.map} +1 -1
- package/dist/{chunk-tn2bryy2.js → chunk-jpetnpzn.js} +2 -2
- package/dist/{chunk-tn2bryy2.js.map → chunk-jpetnpzn.js.map} +1 -1
- package/dist/{chunk-mtbygktb.js → chunk-jqrs16g2.js} +3 -3
- package/dist/{chunk-mtbygktb.js.map → chunk-jqrs16g2.js.map} +1 -1
- package/dist/{chunk-4mfrgd5m.js → chunk-kk77x2v4.js} +2 -2
- package/dist/{chunk-4mfrgd5m.js.map → chunk-kk77x2v4.js.map} +1 -1
- package/dist/chunk-kpn7f58a.js +14 -0
- package/dist/{chunk-dexdkh3z.js.map → chunk-kpn7f58a.js.map} +11 -6
- package/dist/chunk-mhteg4yz.js +57 -0
- package/dist/{chunk-d6591xck.js.map → chunk-mhteg4yz.js.map} +16 -12
- package/dist/{chunk-n672d4g8.js → chunk-n9jyjp4a.js} +2 -2
- package/dist/{chunk-n672d4g8.js.map → chunk-n9jyjp4a.js.map} +1 -1
- package/dist/{chunk-vbdty91k.js → chunk-nb2gggba.js} +3 -3
- package/dist/{chunk-vbdty91k.js.map → chunk-nb2gggba.js.map} +1 -1
- package/dist/chunk-ntxsdchf.js +50 -0
- package/dist/chunk-ntxsdchf.js.map +10 -0
- package/dist/{chunk-2z1981d0.js → chunk-pepzecrm.js} +2 -2
- package/dist/{chunk-2z1981d0.js.map → chunk-pepzecrm.js.map} +1 -1
- package/dist/{chunk-785b41h1.js → chunk-pgy3mfxw.js} +3 -3
- package/dist/{chunk-785b41h1.js.map → chunk-pgy3mfxw.js.map} +1 -1
- package/dist/{chunk-98m15b9x.js → chunk-qhw0hej0.js} +2 -2
- package/dist/{chunk-98m15b9x.js.map → chunk-qhw0hej0.js.map} +1 -1
- package/dist/{chunk-303mprnv.js → chunk-r3v2cnrj.js} +2 -2
- package/dist/{chunk-303mprnv.js.map → chunk-r3v2cnrj.js.map} +1 -1
- package/dist/{chunk-ktr3k768.js → chunk-rhmpphhc.js} +3 -3
- package/dist/{chunk-ktr3k768.js.map → chunk-rhmpphhc.js.map} +1 -1
- package/dist/{chunk-fre6f4nk.js → chunk-s4f56035.js} +2 -2
- package/dist/{chunk-fre6f4nk.js.map → chunk-s4f56035.js.map} +1 -1
- package/dist/{chunk-sr942vb1.js → chunk-sj4f7x4p.js} +2 -2
- package/dist/{chunk-sr942vb1.js.map → chunk-sj4f7x4p.js.map} +1 -1
- package/dist/{chunk-wyw6p3fg.js → chunk-sksmnjkn.js} +3 -3
- package/dist/{chunk-wyw6p3fg.js.map → chunk-sksmnjkn.js.map} +1 -1
- package/dist/{chunk-kqxdsv22.js → chunk-stnd9qht.js} +2 -2
- package/dist/{chunk-kqxdsv22.js.map → chunk-stnd9qht.js.map} +1 -1
- package/dist/{chunk-1myhm0g3.js → chunk-t65074mw.js} +3 -3
- package/dist/{chunk-1myhm0g3.js.map → chunk-t65074mw.js.map} +1 -1
- package/dist/chunk-t87w4h84.js +24 -0
- package/dist/{chunk-wzrt5mac.js.map → chunk-t87w4h84.js.map} +2 -2
- package/dist/{chunk-z10cas5r.js → chunk-thz75w6e.js} +2 -2
- package/dist/{chunk-z10cas5r.js.map → chunk-thz75w6e.js.map} +1 -1
- package/dist/{chunk-xt9tv99x.js → chunk-v8vnxkvp.js} +2 -2
- package/dist/{chunk-xt9tv99x.js.map → chunk-v8vnxkvp.js.map} +1 -1
- package/dist/{chunk-x7cpth2f.js → chunk-veq07rp8.js} +1 -1
- package/dist/{chunk-agyfv3f8.js → chunk-vj5necm0.js} +1 -1
- package/dist/{chunk-mps6ynbh.js → chunk-vtc23xpk.js} +2 -2
- package/dist/{chunk-mps6ynbh.js.map → chunk-vtc23xpk.js.map} +1 -1
- package/dist/{chunk-jmpw6bqz.js → chunk-w4e480he.js} +2 -2
- package/dist/{chunk-jmpw6bqz.js.map → chunk-w4e480he.js.map} +1 -1
- package/dist/{chunk-8rv62v14.js → chunk-wgb79ysr.js} +2 -2
- package/dist/{chunk-8rv62v14.js.map → chunk-wgb79ysr.js.map} +1 -1
- package/dist/{chunk-1vzks22y.js → chunk-wk1tp1f1.js} +2 -2
- package/dist/{chunk-1vzks22y.js.map → chunk-wk1tp1f1.js.map} +1 -1
- package/dist/{chunk-bra1a1fq.js → chunk-wwdbgshx.js} +2 -2
- package/dist/{chunk-bra1a1fq.js.map → chunk-wwdbgshx.js.map} +1 -1
- package/dist/{chunk-eqse2m6n.js → chunk-wzzrz612.js} +2 -2
- package/dist/{chunk-eqse2m6n.js.map → chunk-wzzrz612.js.map} +1 -1
- package/dist/{chunk-hdps9n52.js → chunk-x7qwx07b.js} +3 -3
- package/dist/{chunk-hdps9n52.js.map → chunk-x7qwx07b.js.map} +1 -1
- package/dist/chunk-x84as3vy.js +5 -0
- package/dist/chunk-x84as3vy.js.map +12 -0
- package/dist/chunk-y0en07zh.js +302 -0
- package/dist/chunk-y0en07zh.js.map +17 -0
- package/dist/{chunk-d2gfcf85.js → chunk-yfwrbfnw.js} +2 -2
- package/dist/{chunk-d2gfcf85.js.map → chunk-yfwrbfnw.js.map} +1 -1
- package/dist/{chunk-mazznq15.js → chunk-yhp6bvhj.js} +3 -3
- package/dist/{chunk-mazznq15.js.map → chunk-yhp6bvhj.js.map} +1 -1
- package/dist/{chunk-tzm3c7n6.js → chunk-yvtmygrk.js} +4 -4
- package/dist/{chunk-tzm3c7n6.js.map → chunk-yvtmygrk.js.map} +1 -1
- package/dist/{chunk-mqfzdfnz.js → chunk-zkjs3m5m.js} +2 -2
- package/dist/{chunk-mqfzdfnz.js.map → chunk-zkjs3m5m.js.map} +1 -1
- package/dist/chunk-zw6843j3.js +5 -0
- package/dist/chunk-zw6843j3.js.map +12 -0
- package/dist/chunks/{ThemeProvider-BgLyzzOL.js → ThemeProvider-BLI4zpLu.js} +8 -3
- package/dist/chunks/ThemeProvider-BLI4zpLu.js.map +1 -0
- package/dist/client/ClientRouter.d.ts +3 -5
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/Head.d.ts +1 -1
- package/dist/client/Head.d.ts.map +1 -1
- package/dist/client/ServerDataProvider.d.ts +2 -0
- package/dist/client/ServerDataProvider.d.ts.map +1 -1
- package/dist/client/createRoot.d.ts +2 -4
- package/dist/client/createRoot.d.ts.map +1 -1
- package/dist/client/fonts.d.ts +69 -0
- package/dist/client/fonts.d.ts.map +1 -0
- package/dist/client/htmlAttributes.d.ts +18 -0
- package/dist/client/htmlAttributes.d.ts.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +153 -6
- package/dist/client/index.js.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/builtins.d.ts +13 -0
- package/dist/console/builtins.d.ts.map +1 -0
- package/dist/console/run.js +13 -11
- package/dist/console/run.js.map +6 -5
- package/dist/console/runner.d.ts.map +1 -1
- package/dist/console/usage.d.ts +2 -0
- package/dist/console/usage.d.ts.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/Connections.d.ts +36 -0
- package/dist/facades/Connections.d.ts.map +1 -0
- package/dist/facades/Crypt.d.ts +26 -0
- package/dist/facades/Crypt.d.ts.map +1 -0
- package/dist/facades/Meta.d.ts +17 -1
- package/dist/facades/Meta.d.ts.map +1 -1
- package/dist/facades/Storage.d.ts +29 -0
- package/dist/facades/Storage.d.ts.map +1 -1
- package/dist/facades/index.d.ts +2 -0
- package/dist/facades/index.d.ts.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/HttpRequest.d.ts +4 -0
- package/dist/http/HttpRequest.d.ts.map +1 -1
- package/dist/http/Metadata.d.ts +28 -0
- package/dist/http/Metadata.d.ts.map +1 -1
- package/dist/http/index.d.ts +3 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/http/requestContext.d.ts +4 -0
- package/dist/http/requestContext.d.ts.map +1 -1
- package/dist/http/safeFetch/errors.d.ts +10 -0
- package/dist/http/safeFetch/errors.d.ts.map +1 -1
- package/dist/http/safeFetch/index.d.ts +1 -1
- package/dist/http/safeFetch/index.d.ts.map +1 -1
- package/dist/http/sitemap/Robots.d.ts +95 -0
- package/dist/http/sitemap/Robots.d.ts.map +1 -0
- package/dist/http/sitemap/Sitemap.d.ts +145 -0
- package/dist/http/sitemap/Sitemap.d.ts.map +1 -0
- package/dist/http/sitemap/fetchText.d.ts +16 -0
- package/dist/http/sitemap/fetchText.d.ts.map +1 -0
- package/dist/http/sitemap/index.d.ts +3 -0
- package/dist/http/sitemap/index.d.ts.map +1 -0
- package/dist/http/sitemap/xml.d.ts +21 -0
- package/dist/http/sitemap/xml.d.ts.map +1 -0
- package/dist/i18n/Translator.d.ts.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +2 -2
- package/dist/i18n/resolveLocale.d.ts +18 -0
- package/dist/i18n/resolveLocale.d.ts.map +1 -1
- package/dist/kernel/index.js +3 -3
- package/dist/kernel/index.js.map +3 -3
- package/dist/kernel/providers.d.ts +2 -2
- package/dist/kernel/providers.d.ts.map +1 -1
- package/dist/orm/Model.d.ts.map +1 -1
- package/dist/orm/encryption-rotate.d.ts +44 -0
- package/dist/orm/encryption-rotate.d.ts.map +1 -0
- package/dist/orm/encryption.d.ts +54 -0
- package/dist/orm/encryption.d.ts.map +1 -0
- package/dist/orm/index.d.ts +2 -0
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +3 -3
- package/dist/orm/index.js.map +4 -4
- package/dist/orm/schema.d.ts +25 -1
- package/dist/orm/schema.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/encryption/Encrypter.d.ts +86 -0
- package/dist/services/encryption/Encrypter.d.ts.map +1 -0
- package/dist/services/encryption/EncryptionServiceProvider.d.ts +13 -0
- package/dist/services/encryption/EncryptionServiceProvider.d.ts.map +1 -0
- package/dist/services/encryption/config.d.ts +36 -0
- package/dist/services/encryption/config.d.ts.map +1 -0
- package/dist/services/file-storage/drivers/FileStorageDriver.d.ts +12 -1
- package/dist/services/file-storage/drivers/FileStorageDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/FileSystemDriver.d.ts +8 -1
- package/dist/services/file-storage/drivers/FileSystemDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/types.d.ts +17 -0
- package/dist/services/file-storage/drivers/types.d.ts.map +1 -1
- package/dist/services/file-storage/putFromUrl.d.ts +56 -0
- package/dist/services/file-storage/putFromUrl.d.ts.map +1 -0
- package/dist/services/file-storage/sniffContentType.d.ts +33 -0
- package/dist/services/file-storage/sniffContentType.d.ts.map +1 -0
- package/dist/services/index.d.ts +19 -5
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +10 -10
- package/dist/services/index.js.map +4 -3
- package/dist/services/queue/DatabaseQueueDriver.d.ts +96 -7
- package/dist/services/queue/DatabaseQueueDriver.d.ts.map +1 -1
- package/dist/services/queue/Job.d.ts +72 -0
- package/dist/services/queue/Job.d.ts.map +1 -1
- package/dist/services/queue/MemoryQueueDriver.d.ts +22 -2
- package/dist/services/queue/MemoryQueueDriver.d.ts.map +1 -1
- package/dist/services/queue/QueueDriver.d.ts +74 -1
- package/dist/services/queue/QueueDriver.d.ts.map +1 -1
- package/dist/services/queue/QueueManager.d.ts +47 -0
- package/dist/services/queue/QueueManager.d.ts.map +1 -1
- package/dist/services/queue/batch.d.ts +112 -0
- package/dist/services/queue/batch.d.ts.map +1 -0
- package/dist/services/queue/queueDriverContract.d.ts +5 -0
- package/dist/services/queue/queueDriverContract.d.ts.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +3 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/config.d.ts +19 -0
- package/dist/services/router/config.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/testing/index.js +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-7g9yh5ae.js +0 -5
- package/dist/chunk-7g9yh5ae.js.map +0 -12
- package/dist/chunk-7vb4eey2.js +0 -217
- package/dist/chunk-7vb4eey2.js.map +0 -16
- package/dist/chunk-9b4erdy2.js +0 -5
- package/dist/chunk-9b4erdy2.js.map +0 -11
- package/dist/chunk-d6591xck.js +0 -46
- package/dist/chunk-dexdkh3z.js +0 -14
- package/dist/chunk-hytt9qyj.js +0 -54
- package/dist/chunk-t24p7gc6.js +0 -5
- package/dist/chunk-t4t3hqe0.js +0 -10
- package/dist/chunk-whtzggn6.js +0 -5
- package/dist/chunk-wzrt5mac.js +0 -24
- package/dist/chunks/ThemeProvider-BgLyzzOL.js.map +0 -1
- /package/dist/{chunk-qjhw8nje.js.map → chunk-077rea02.js.map} +0 -0
- /package/dist/{chunk-41da9628.js.map → chunk-bvqae0px.js.map} +0 -0
- /package/dist/{chunk-x7cpth2f.js.map → chunk-veq07rp8.js.map} +0 -0
- /package/dist/{chunk-agyfv3f8.js.map → chunk-vj5necm0.js.map} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bookkeeping of a job batch, shared by every driver so that the rules for
|
|
3
|
+
* when a batch is cancelled and which callbacks run are written once.
|
|
4
|
+
*
|
|
5
|
+
* A driver keeps a `BatchRecord` per batch and calls these functions while it
|
|
6
|
+
* holds that record exclusively: inside the transaction that also ends the job
|
|
7
|
+
* (the database driver, with the batch row locked), or synchronously (the
|
|
8
|
+
* memory driver). Everything here is pure; the driver writes what comes back,
|
|
9
|
+
* and enqueues the callback jobs `settle` returns in the same step, which is
|
|
10
|
+
* what makes each callback run exactly once.
|
|
11
|
+
*
|
|
12
|
+
* The rules:
|
|
13
|
+
*
|
|
14
|
+
* - Every job of the batch ends exactly once as `succeeded`, `failed` (it was
|
|
15
|
+
* dead-lettered) or `cancelled` (it never ran to the end because the batch was
|
|
16
|
+
* cancelled). `pending` counts the ones that have not ended yet.
|
|
17
|
+
* - `catch` is due at the first failure or cancellation, whichever comes first.
|
|
18
|
+
* - Without `allowFailures`, the first failure cancels the batch: the jobs still
|
|
19
|
+
* waiting are ended as `cancelled` at once, and running ones see it through
|
|
20
|
+
* `this.batch.cancelled()`.
|
|
21
|
+
* - Once `pending` reaches 0 the batch is finished: `then` is due when it was
|
|
22
|
+
* not cancelled and nothing failed (or `allowFailures` is set), and `finally`
|
|
23
|
+
* is always due.
|
|
24
|
+
*/
|
|
25
|
+
/** A job and the arguments to dispatch it with: what `Job.with(...)` returns. */
|
|
26
|
+
export type JobCall = {
|
|
27
|
+
/** The job's registered name: its class's `static name`. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** The `run` arguments, before the batch status is appended. */
|
|
30
|
+
args: unknown[];
|
|
31
|
+
};
|
|
32
|
+
export type BatchCallbacks = {
|
|
33
|
+
then?: JobCall;
|
|
34
|
+
catch?: JobCall;
|
|
35
|
+
finally?: JobCall;
|
|
36
|
+
};
|
|
37
|
+
/** What `Job.findBatch` resolves to, and the last argument a batch callback gets. */
|
|
38
|
+
export type BatchStatus = {
|
|
39
|
+
id: string;
|
|
40
|
+
/** The `name` given to `dispatchBatch`, or `null`. */
|
|
41
|
+
name: string | null;
|
|
42
|
+
/** How many jobs the batch was dispatched with. */
|
|
43
|
+
total: number;
|
|
44
|
+
/** Jobs that have not ended yet: waiting, running, or waiting out a retry. */
|
|
45
|
+
pending: number;
|
|
46
|
+
succeeded: number;
|
|
47
|
+
/** Jobs that were dead-lettered. */
|
|
48
|
+
failed: number;
|
|
49
|
+
/** Jobs that ended without running to the end because the batch was cancelled. */
|
|
50
|
+
cancelled: number;
|
|
51
|
+
/** The ids of the dead-lettered jobs, in the order they failed. */
|
|
52
|
+
failedJobIds: string[];
|
|
53
|
+
/**
|
|
54
|
+
* 0 to 1: the ended jobs plus the share each running job reported with
|
|
55
|
+
* `this.progress()`, over `total`. 1 for a batch of no jobs.
|
|
56
|
+
*/
|
|
57
|
+
progress: number;
|
|
58
|
+
/** When the batch was cancelled, in epoch milliseconds, or `null`. */
|
|
59
|
+
cancelledAt: number | null;
|
|
60
|
+
/** When its last job ended, in epoch milliseconds, or `null` while it runs. */
|
|
61
|
+
finishedAt: number | null;
|
|
62
|
+
createdAt: number;
|
|
63
|
+
};
|
|
64
|
+
/** What a driver stores per batch. */
|
|
65
|
+
export type BatchRecord = Omit<BatchStatus, "progress"> & {
|
|
66
|
+
allowFailures: boolean;
|
|
67
|
+
callbacks: BatchCallbacks;
|
|
68
|
+
};
|
|
69
|
+
/** How one job of a batch ended. */
|
|
70
|
+
export type BatchOutcome = "succeeded" | "failed" | "cancelled";
|
|
71
|
+
/** The callback jobs to enqueue, their arguments already serialised. */
|
|
72
|
+
export type BatchCallbackJob = {
|
|
73
|
+
name: string;
|
|
74
|
+
args: string;
|
|
75
|
+
};
|
|
76
|
+
export declare function newBatchRecord(batch: {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string | null;
|
|
79
|
+
total: number;
|
|
80
|
+
allowFailures: boolean;
|
|
81
|
+
callbacks: BatchCallbacks;
|
|
82
|
+
now: number;
|
|
83
|
+
}): BatchRecord;
|
|
84
|
+
/** Counts one job's end. A batch with nothing pending is left as it is. */
|
|
85
|
+
export declare function countOutcome(record: BatchRecord, outcome: BatchOutcome, jobId: string): BatchRecord;
|
|
86
|
+
/**
|
|
87
|
+
* Whether going from `prev` to `next` is the failure that cancels the batch:
|
|
88
|
+
* its first, without `allowFailures`, in a batch not already cancelled.
|
|
89
|
+
*/
|
|
90
|
+
export declare function cancelsBatch(prev: BatchRecord, next: BatchRecord): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Marks the batch cancelled, counting the `waiting` jobs the driver has just
|
|
93
|
+
* ended as `cancelled`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function markCancelled(record: BatchRecord, now: number, waiting: number): BatchRecord;
|
|
96
|
+
/**
|
|
97
|
+
* Finishes the batch when nothing is pending, and says which callbacks became
|
|
98
|
+
* due between `prev` and `next`. Each callback's arguments are its own followed
|
|
99
|
+
* by the batch's status as it stands after this step.
|
|
100
|
+
*/
|
|
101
|
+
export declare function settle(prev: BatchRecord, next: BatchRecord, now: number): {
|
|
102
|
+
record: BatchRecord;
|
|
103
|
+
calls: BatchCallbackJob[];
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The status of a batch. `running` is the sum of the progress the batch's
|
|
107
|
+
* unfinished jobs have reported, each 0 to 1.
|
|
108
|
+
*/
|
|
109
|
+
export declare function statusOf(record: BatchRecord, running?: number): BatchStatus;
|
|
110
|
+
/** A progress value as stored: a finite number clamped to 0..1. */
|
|
111
|
+
export declare function clampProgress(value: number): number;
|
|
112
|
+
//# sourceMappingURL=batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../services/queue/batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iFAAiF;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E,CAAC;AAE9D,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,WAAW,CAgBd;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,MAAM,GACZ,WAAW,CAUb;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAO1E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CAQ5F;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAwBpD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,SAAI,GAAG,WAAW,CAMtE;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKnD"}
|
|
@@ -24,6 +24,9 @@ import type { QueueDriver } from "./QueueDriver";
|
|
|
24
24
|
* checks that the driver says so, because the manager then holds the dispatch
|
|
25
25
|
* until the commit itself; that half is `QueueManager.transaction.test.ts`.
|
|
26
26
|
*
|
|
27
|
+
* `features.batches` runs the batch tests: `enqueueBatch`, the counters
|
|
28
|
+
* `complete` and `fail` keep, `findBatch`, `cancelBatch` and `reportProgress`.
|
|
29
|
+
*
|
|
27
30
|
* Not a `*.test.ts` file, so vitest never runs it on its own, and not exported
|
|
28
31
|
* from `gemi/services`, because it imports vitest.
|
|
29
32
|
*
|
|
@@ -42,5 +45,7 @@ export declare function queueDriverContract(name: string, create: () => QueueDri
|
|
|
42
45
|
run(driver: QueueDriver, fn: () => Promise<void>): Promise<void>;
|
|
43
46
|
joins: boolean;
|
|
44
47
|
};
|
|
48
|
+
/** The driver implements the batch methods, and runs the tests that pin them. */
|
|
49
|
+
batches?: boolean;
|
|
45
50
|
}): void;
|
|
46
51
|
//# sourceMappingURL=queueDriverContract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queueDriverContract.d.ts","sourceRoot":"","sources":["../../../services/queue/queueDriverContract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queueDriverContract.d.ts","sourceRoot":"","sources":["../../../services/queue/queueDriverContract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,EAChD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACvD,QAAQ,GAAE;IACR,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE;QACZ,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACjE,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,QAo4BP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Gc as E,Jc as T}from"../../chunk-y0en07zh.js";import"../../chunk-jpetnpzn.js";import"../../chunk-dz99g58c.js";import"../../chunk-t65074mw.js";import"../../chunk-5w6kyxsj.js";import"../../chunk-076jezzg.js";import"../../chunk-wk1tp1f1.js";import{Ki as I,Li as J,Oi as O}from"../../chunk-a32wfzdq.js";import{Si as N}from"../../chunk-8gtc3s1y.js";import"../../chunk-dcgvq79a.js";import L from"path";class F extends Error{name="QueueWorkerRefused"}class H{kernel;stopping;keepAlive;settings;constructor(y,z={}){this.kernel=y;this.settings={...J(),...z}}async start(){if(await this.kernel.waitForBoot(),this.stopping)return;let y=this.kernel.app;if(!y.bound(E))throw new F("[gemi] `gemi queue:work` has no queue to claim from: this application does not register QueueServiceProvider.");let z=y.make(E);if(!z.durable)throw new F('[gemi] `gemi queue:work` refuses to start: the queue uses the memory driver, which keeps each job in the process that dispatched it, so a worker never sees one. Set `driver: "database"` (or another driver every process can reach) in app/config/queue.ts, or run jobs in the server and drop the worker.');z.start(),this.keepAlive=setInterval(()=>{},1073741824),console.log(`[gemi] Queue worker started: claiming up to ${z.config.concurrency} job(s) at a time.`)}stop(y={}){return this.stopping??=this.drain({...this.settings,...y}),this.stopping}async drain(y){I();let z=this.kernel.app,A=z.resolved(E)?z.make(E):void 0;if(A)console.log(`[gemi] Shutting down: waiting for ${A.running} running job(s) (up to ${y.timeoutMs/1000}s).`),await A.drain(y.timeoutMs);let B=await this.kernel.shutdown({timeoutMs:y.providerTimeoutMs});clearInterval(this.keepAlive);let C=(A?.running??0)===0&&B.failed.length===0&&B.timedOut.length===0;return console.log(`[gemi] Shutdown ${C?"complete":"finished with errors"}.`),C?0:1}}async function U(){let y=N();process.env.ROOT_DIR=y,process.env.APP_DIR=L.join(y,"app"),T();let z=L.join(y,"app/kernel/Kernel.ts"),{default:A}=await import(z);if(typeof A!=="function")return console.error(`[gemi] ${z} has no default export to boot the worker from.`),1;let B=new A;B.boot();let C=new H(B);O(()=>C.stop());try{await C.start()}catch(G){if(!(G instanceof F))throw G;return console.error(G.message),1}return}U().then((y)=>{if(y!==void 0)process.exit(y)},(y)=>{console.error("[gemi] The queue worker failed to start:",y),process.exit(1)});
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=71570968BCFFF1AB64756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import type { Application, ShutdownReport } from \"../../foundation/Application\";\nimport { markShuttingDown, shutdownSettings, type ShutdownSettings } from \"../../server/shutdown\";\nimport { QueueManager } from \"./QueueManager\";\n\n/** The part of a `Kernel` a worker drives. */\nexport type WorkerKernel = {\n readonly app: Application;\n waitForBoot(): Promise<void>;\n shutdown(options?: { timeoutMs?: number }): Promise<ShutdownReport>;\n};\n\n/**\n * A worker that was told to start in an application it cannot claim for. The\n * message is written for the operator reading the deploy's logs.\n */\nexport class QueueWorkerRefused extends Error {\n name = \"QueueWorkerRefused\";\n}\n\n/**\n * The process `gemi queue:work` runs: the application booted as a server boots\n * it, claiming from the queue, and no `Bun.serve`. It exists so job capacity\n * can be scaled apart from request traffic, which needs a driver both kinds of\n * process can reach; see `start` for why the memory driver is refused.\n *\n * The caller marks the process as a worker (`markQueueWorker`) before the\n * kernel registers, so every claim rule that asks `claimsInThisProcess` sees a\n * process that claims, whatever `GEMI_QUEUE_CLAIM` says.\n */\nexport class QueueWorker {\n private stopping: Promise<number> | undefined;\n private keepAlive: ReturnType<typeof setInterval> | undefined;\n private readonly settings: ShutdownSettings;\n\n /**\n * `settings` default to the `GEMI_SHUTDOWN_*` variables, read here rather\n * than at the signal so a bad value is warned about while the deploy is\n * being watched, as `Server.start` does.\n */\n constructor(\n private readonly kernel: WorkerKernel,\n settings: Partial<ShutdownSettings> = {},\n ) {\n this.settings = { ...shutdownSettings(), ...settings };\n }\n\n /**\n * Boots the application and starts claiming. Rejects with\n * `QueueWorkerRefused` when the application has no queue, or its queue uses\n * the memory driver.\n *\n * Refused rather than warned about, because a memory worker can never do\n * anything: its jobs live in a `Map` in the process that dispatched them,\n * so a worker's is always empty. Left running, it looks like a healthy\n * deploy — a process up, no errors — that runs nothing, and scaling it out\n * adds no capacity. An exit the platform reports as a crash loop is a form\n * of the mistake someone will see.\n */\n async start(): Promise<void> {\n await this.kernel.waitForBoot();\n // A signal during the boot has already drained and cleared the handle\n // below. Going on would start the loop again and arm a handle nothing\n // clears, holding open a worker that has finished shutting down.\n if (this.stopping) return;\n\n const application = this.kernel.app;\n // `bound`, not `make` in a try: an application built without the queue\n // provider is a configuration to name, not an unbound-token stack trace.\n if (!application.bound(QueueManager)) {\n throw new QueueWorkerRefused(\n \"[gemi] `gemi queue:work` has no queue to claim from: this application \" +\n \"does not register QueueServiceProvider.\",\n );\n }\n const queue = application.make(QueueManager);\n if (!queue.durable) {\n throw new QueueWorkerRefused(\n \"[gemi] `gemi queue:work` refuses to start: the queue uses the memory \" +\n \"driver, which keeps each job in the process that dispatched it, so \" +\n 'a worker never sees one. Set `driver: \"database\"` (or another driver ' +\n \"every process can reach) in app/config/queue.ts, or run jobs in the \" +\n \"server and drop the worker.\",\n );\n }\n\n // Idempotent: a production boot with a durable driver has already started\n // it (`startClaimingIfServing`). Development has not, and a worker claims\n // in either.\n queue.start();\n // The queue's poll timer is unref'd, so that a script's queue does not\n // hold it open; here the queue is the process, and without a handle of its\n // own an idle worker would exit 0 as soon as it booted.\n this.keepAlive = setInterval(() => {}, 1 << 30);\n console.log(\n `[gemi] Queue worker started: claiming up to ${queue.config.concurrency} job(s) at a time.`,\n );\n }\n\n /**\n * Stops claiming, waits for the running jobs, runs every provider's\n * `shutdown()`, and resolves with the exit code: 0 when no job was left\n * running and every provider finished in time, 1 otherwise. Idempotent.\n *\n * `gemi start`'s drain, with the jobs where the requests were:\n * `isShuttingDown()` turns true, which stops a durable queue claiming;\n * running jobs get `timeoutMs` (`GEMI_SHUTDOWN_TIMEOUT`), which a server\n * spends on requests; then `Application.shutdown` gets `providerTimeoutMs`,\n * and in it the queue provider waits for whatever is still running and\n * names it. The two budgets add up as they do for a server, so a worker\n * fits the same grace period. `delayMs` is not waited: it is for a load\n * balancer, and nothing routes to a worker.\n */\n stop(settings: Partial<ShutdownSettings> = {}): Promise<number> {\n this.stopping ??= this.drain({ ...this.settings, ...settings });\n return this.stopping;\n }\n\n private async drain(settings: ShutdownSettings): Promise<number> {\n markShuttingDown();\n const application = this.kernel.app;\n // Resolving the manager now would build a driver only to stop it, which\n // is what a signal during the boot, before the provider resolved it, finds.\n const queue = application.resolved(QueueManager) ? application.make(QueueManager) : undefined;\n if (queue) {\n console.log(\n `[gemi] Shutting down: waiting for ${queue.running} running job(s) ` +\n `(up to ${settings.timeoutMs / 1000}s).`,\n );\n await queue.drain(settings.timeoutMs);\n }\n\n const report = await this.kernel.shutdown({ timeoutMs: settings.providerTimeoutMs });\n clearInterval(this.keepAlive);\n const clean =\n (queue?.running ?? 0) === 0 && report.failed.length === 0 && report.timedOut.length === 0;\n console.log(`[gemi] Shutdown ${clean ? \"complete\" : \"finished with errors\"}.`);\n return clean ? 0 : 1;\n }\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";iZAYA,kBCGO,IAAM,QAA2B,GAAM,DAC5C,GAAO,kBACT,DAYO,IAAM,CAAY,CAWJ,OAVX,SACA,UACS,SAOjB,WAAW,CACQ,EACjB,EAAsC,CAAC,EACvC,CAFiB,cAGjB,KAAK,SAAW,IAAK,EAAiB,KAAM,CAAS,OAejD,MAAK,EAAkB,CAK3B,GAJA,MAAM,KAAK,OAAO,YAAY,EAI1B,KAAK,SAAU,OAEnB,IAAM,EAAc,KAAK,OAAO,IAGhC,GAAI,CAAC,EAAY,MAAM,CAAY,EACjC,MAAM,IAAI,EACR,+GAEF,EAEF,IAAM,EAAQ,EAAY,KAAK,CAAY,EAC3C,GAAI,CAAC,EAAM,QACT,MAAM,IAAI,EACR,8SAKF,EAMF,EAAM,MAAM,EAIZ,KA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pB,EAGT,OAGF,EAAK,EAAE,KACL,CAAC,IAAS,CACR,GAAI,IAAS,OAAW,QAAQ,KAAK,CAAI,GAE3C,CAAC,IAAU,CACT,QAAQ,MAAM,2CAA4C,CAAK,EAC/D,QAAQ,KAAK,CAAC,EAElB",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "71570968BCFFF1AB64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpRequest } from "../../http";
|
|
2
2
|
import { type CarriedContext } from "../../http/requestContext";
|
|
3
3
|
import { type FlatViewRoutes } from "./createFlatViewRoutes";
|
|
4
|
-
import { type ViewRouteConfig } from "./config";
|
|
4
|
+
import { type LocaleRouting, type ViewRouteConfig } from "./config";
|
|
5
5
|
import type { ComponentTree } from "../../client/types";
|
|
6
6
|
import { type IslandResolver } from "./staticDocument";
|
|
7
7
|
/**
|
|
@@ -61,6 +61,8 @@ export declare class ViewRouteDispatcher {
|
|
|
61
61
|
private readonly hooks;
|
|
62
62
|
/** See `ViewRouteConfig.partialRendering`. */
|
|
63
63
|
readonly partialRendering: boolean;
|
|
64
|
+
/** See `ViewRouteConfig.localeRouting`. */
|
|
65
|
+
readonly localeRouting: LocaleRouting;
|
|
64
66
|
constructor(config: ViewRouteConfig);
|
|
65
67
|
/**
|
|
66
68
|
* Whether every flag gating a route is on for this request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewRouteDispatcher.d.ts","sourceRoot":"","sources":["../../../services/router/ViewRouteDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAmC,MAAM,2BAA2B,CAAC;AAEjG,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"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QACH,WAAW,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QACpD;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QACjD;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,wEAAwE;QACxE,aAAa,CAAC,EAAE,cAAc,CAAC;KAChC;CAo7BJ"}
|
|
@@ -12,6 +12,8 @@ export interface ApiRouteConfig {
|
|
|
12
12
|
onRequestEnd?: (req: HttpRequest) => void | Promise<void>;
|
|
13
13
|
onRequestFail?: (req: HttpRequest, error: any) => void | Promise<void>;
|
|
14
14
|
}
|
|
15
|
+
/** See `ViewRouteConfig.localeRouting`. */
|
|
16
|
+
export type LocaleRouting = "prefix" | "off";
|
|
15
17
|
export interface ViewRouteConfig {
|
|
16
18
|
root: (props: any) => JSX.Element;
|
|
17
19
|
rootRouter: new () => ViewRouter;
|
|
@@ -25,6 +27,23 @@ export interface ViewRouteConfig {
|
|
|
25
27
|
* app cannot audit them all at once.
|
|
26
28
|
*/
|
|
27
29
|
partialRendering?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* How these views take part in locale routing when `translation`
|
|
32
|
+
* configures `supportedLocales`. Set it on a `route.domains` group's `view`
|
|
33
|
+
* to opt that host out (e.g. user-published sites that are not the app's
|
|
34
|
+
* own UI), or with the `"no-locale"` middleware directive on one router or
|
|
35
|
+
* route.
|
|
36
|
+
*
|
|
37
|
+
* - `"prefix"` (default): URLs carry the locale (`/tr-TR/about`), and a
|
|
38
|
+
* visitor whose cookie or `Accept-Language` names another locale is
|
|
39
|
+
* redirected to it.
|
|
40
|
+
* - `"off"`: URLs never carry a locale and nothing redirects. A first
|
|
41
|
+
* segment like `/tr-TR` is an ordinary path. Nothing is detected from the
|
|
42
|
+
* cookie or `Accept-Language`, and no `i18n-locale` cookie is set. The
|
|
43
|
+
* request renders in `translation.defaultLocale` unless middleware picks
|
|
44
|
+
* one with `Lang.setLocale(locale, { cookie: false })`.
|
|
45
|
+
*/
|
|
46
|
+
localeRouting?: LocaleRouting;
|
|
28
47
|
onRequestStart?: (req: HttpRequest) => void | Promise<void>;
|
|
29
48
|
onRequestEnd?: (req: HttpRequest) => void | Promise<void>;
|
|
30
49
|
onRequestFail?: (req: HttpRequest, error: any) => void | Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../services/router/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,WAAW,cAAc;IAI7B,UAAU,EAAE,OAAO,SAAS,CAAC;IAE7B,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;
|
|
1
|
+
{"version":3,"file":"config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,CAC7C,QAAQ,CAAC,eAAe,CAAC,EACzB,MAAM,GAAG,YAAY,CACtB,CASA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-
|
|
2
|
+
import"../chunk-dcgvq79a.js";import M from"path";import{writeFileSync as Q}from"fs";var L=new Set(["FILE","REDIRECT"]);function H(j){return j.run(()=>{let x=[];for(let{group:z,view:D}of j.domains().viewGroups())for(let[G,B]of Object.entries(D.flatViewRoutes)){let C=D.routeManifest[G]??B.segments.map((K)=>K.viewPath);if(C.length===0||L.has(C.at(-1)))continue;x.push({path:G,group:z,views:C,...B.static?{static:B.static.layout?{layout:B.static.layout}:{}}:{}})}return x})}var J=process.argv[2];async function U(){if(!J)throw Error("usage: route-table <out.json>");let j=M.resolve(process.cwd(),"app/kernel/Kernel.ts"),x=await import(j);if(typeof x.default!=="function")throw Error(`${j} has no default export (the Kernel subclass).`);let z=new x.default;z.boot();try{Q(J,JSON.stringify(H(z)))}finally{z.destroy()}}U().then(()=>process.exit(0),(j)=>{console.error(j?.stack??String(j)),process.exit(1)});
|
|
3
3
|
|
|
4
4
|
//# debugId=2C354352EBF6475164756E2164756E21
|
package/dist/support/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Nc as Y}from"../chunk-n9jyjp4a.js";import{Ch as M}from"../chunk-dz99g58c.js";import{Ei as P,Gi as R}from"../chunk-076jezzg.js";import"../chunk-wk1tp1f1.js";import{Pi as Q,Qi as U,Ri as V,Si as W}from"../chunk-8gtc3s1y.js";import"../chunk-dcgvq79a.js";class S{static token;async boot(){}static inject(){if(!this.token)throw Error(`Service [${this.name}] does not declare a \`static token\`, so the container has no key to resolve it by.`);try{return R(this)}catch(x){throw Error(`Could not inject [${this.name}]. Services are constructed when the kernel boots, so `+"inject() only works from code that runs after that \u2014 a constructor default or a method "+`body, never module top level. Check that [${this.name}] is listed in \`services\` on your Kernel.`,{cause:x})}}static with(x){let f=new this;for(let[C,g]of Object.entries(x))if(g!==void 0)f[C]=g;return f}}import{readdir as z}from"fs/promises";import{join as B,parse as j}from"path";var H=[".ts",".tsx",".js",".mjs",".jsx"];function J(x={}){let f={};for(let[C,g]of Object.entries(x))f[C]=q(g);return new P(f)}async function L(x,f=new P){let C=[];try{C=await z(x)}catch(D){return f}let g=C.filter((D)=>{let{ext:v,name:F}=j(D);return H.includes(v)&&!F.startsWith(".")}).sort();for(let D of g){let{name:v}=j(D),F=await import(B(x,D));f.set(v,q(F))}return f}function q(x){if(x&&typeof x==="object"&&"default"in x)return x.default;return x}export{M as withDefaults,Q as sourceFiles,W as projectRoot,L as loadConfigFrom,V as discoverClasses,J as createConfigRepository,Y as ServiceProvider,S as Service,P as Repository,U as DiscoveryError};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=65AB04009D57471764756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { readdir } from \"node:fs/promises\";\nimport { join, parse } from \"node:path\";\n\nimport { Repository } from \"./Repository\";\n\nconst CONFIG_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".mjs\", \".jsx\"];\n\n// Builds a Repository from an already-imported map of config modules. The map\n// key becomes the top-level config key, so `{ mail: mailModule }` is readable\n// as `config.get(\"mail.driver\")`. Each entry may be either the module namespace\n// (its `default` export is unwrapped) or the config object itself.\nexport function createConfigRepository(\n modules: Record<string, any> = {},\n): Repository {\n const items: Record<string, any> = {};\n\n for (const [key, mod] of Object.entries(modules)) {\n items[key] = unwrap(mod);\n }\n\n return new Repository(items);\n}\n\n// Reads every config module in an app's `app/config` directory into a\n// Repository. The file's basename is the top-level key: `app/config/mail.ts`\n// populates `mail.*`. A missing directory yields an empty Repository so apps\n// that declare no config still boot.\nexport async function loadConfigFrom(\n directory: string,\n repository = new Repository(),\n): Promise<Repository> {\n let entries: string[] = [];\n\n try {\n entries = await readdir(directory);\n } catch (err) {\n return repository;\n }\n\n const files = entries\n .filter((entry) => {\n const { ext, name } = parse(entry);\n return CONFIG_EXTENSIONS.includes(ext) && !name.startsWith(\".\");\n })\n .sort();\n\n for (const file of files) {\n const { name } = parse(file);\n const mod = await import(join(directory, file));\n repository.set(name, unwrap(mod));\n }\n\n return repository;\n}\n\nfunction unwrap(mod: any) {\n if (mod && typeof mod === \"object\" && \"default\" in mod) {\n return mod.default;\n }\n return mod;\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";2RAgCO,CAAe,JAAQ,EAOrB,OAMD,AAAI,EAAkB,QAmBrB,OAAS,EAKX,CACH,GAAI,CAAC,KAAK,MACR,MAAU,MACR,YAAY,KAAK,0FACnB,EAGF,GAAI,CACF,OAAO,EAAI,IAAuB,EAClC,MAAO,EAAO,CACd,MAAU,MACR,qBAAqB,KAAK,6DACxB,+FACA,6CAA6C,KAAK,kDAEpD,CAAE,OAAM,CACV,SAoBG,KAAuB,CAAoB,EAA0B,CAC1E,IAAM,EAAW,IAAI,KACrB,QAAY,EAAK,KAAU,OAAO,QAAQ,CAAS,EACjD,GAAI,IAAU,OAAW,EAAS,GAAO,EAE3C,OAAO,EAEX,CChHA,kBAAS,oBACT,eAAS,WAAM,aAIf,IAAM,EAAoB,CAAC,MAAO,OAAQ,MAAO,OAAQ,MAAM,EAMxD,SAAS,CAAsB,CACpC,EAA+B,CAAC,EACpB,CACZ,IAAM,EAA6B,CAAC,EAEpC,QAAY,EAAK,KAAQ,OAAO,QAAQ,CAAO,EAC7C,EAAM,GAAO,EAAO,CAAG,EAGzB,OAAO,IAAI,EAAW,CAAK,EAO7B,eAAsB,CAAc,CAClC,EACA,EAAa,IAAI,EACI,CACrB,IAAI,EAAoB,CAAC,EAEzB,GAAI,CACF,EAAU,MAAM,EAAQ,CAAS,EACjC,MAAO,EAAK,CACZ,OAAO,EAGT,IAAM,EAAQ,EACX,OAAO,CAAC,IAAU,CACjB,IAAQ,MAAK,QAAS,EAAM,CAAK,EACjC,OAAO,EAAkB,SAAS,CAAG,GAAK,CAAC,EAAK,WAAW,GAAG,EAC/D,EACA,KAAK,EAER,QAAW,KAAQ,EAAO,CACxB,IAAQ,QAAS,EAAM,CAAI,EACrB,EAAM,MAAa,SAAK,EAAW,CAAI,GAC7C,EAAW,IAAI,EAAM,EAAO,CAAG,CAAC,EAGlC,OAAO,EAGT,SAAS,CAAM,CAAC,EAAU,CACxB,GAAI,GAAO,OAAO,IAAQ,UAAY,YAAa,EACjD,OAAO,EAAI,QAEb,OAAO",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "65AB04009D57471764756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as QueryManagerProvider, D as I18nProvider, F as createMemoryHistory, I as toVariantKey, J as Subject, L as applyParams, N as ProgressManager, O as ServerDataContext, P as Action, i as RouteTransitionProvider, o as ClientRouterContext, r as m, t as ThemeProvider, z as QueryManagerContext } from "../chunks/ThemeProvider-
|
|
1
|
+
import { B as QueryManagerProvider, D as I18nProvider, F as createMemoryHistory, I as toVariantKey, J as Subject, L as applyParams, N as ProgressManager, O as ServerDataContext, P as Action, i as RouteTransitionProvider, o as ClientRouterContext, r as m, t as ThemeProvider, z as QueryManagerContext } from "../chunks/ThemeProvider-BLI4zpLu.js";
|
|
2
2
|
import { r as RouteStateProvider } from "../chunks/useParams-BN3XXfmG.js";
|
|
3
3
|
import { Suspense, useContext, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
package/dist/vitest/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{fa as B,ga as D}from"../chunk-ge9xjwgq.js";import"../chunk-hr61ekcr.js";import"../chunk-x7qwx07b.js";import{Aa as J}from"../chunk-6ggmk2eg.js";import"../chunk-kk77x2v4.js";import"../chunk-dcgvq79a.js";function N(){return{name:"gemi-custom-request",enforce:"pre",async transform(G,H){let j=H.split("?",1)[0];if(j.includes("/node_modules/")||!B.test(j))return null;return{code:await D(G),map:null}}}}export{N as gemiRequestPlugin,J as gemiIslandPlugin};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=C11E8611E15123D864756E2164756E21
|
package/dist/vitest/index.js.map
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { Plugin } from \"vite\";\nimport {\n CUSTOM_REQUEST_FILTER,\n customRequestParser,\n} from \"../bun/customRequestParser\";\n\n/**\n * The request-param rewrite, as a Vite plugin, for running an app's routes\n * under vitest.\n *\n * gemi calls a route handler and a controller method with no arguments, and a\n * handler written `async (req: HttpRequest<…>) => …` only gets its request\n * because the build rewrites it to `async (req = new HttpRequest()) => …`, which\n * reads the current request from the request context. The app's build and dev\n * server get that rewrite from `gemi/bun/plugin`. Vitest loads modules through\n * Vite instead, even under `bun --bun vitest`, so without this plugin a route\n * dispatched with `App.fetch` in a test sees `req === undefined`.\n *\n * Same transform, same files (`/http/controllers/` and `/http/routes/`) as the\n * Bun plugin. `enforce: \"pre\"` so it sees the TypeScript annotations before\n * Vite strips them.\n *\n * ```ts\n * // vitest.config.ts\n * import { defineConfig } from \"vitest/config\";\n * import { gemiRequestPlugin } from \"gemi/vitest\";\n *\n * export default defineConfig({ plugins: [gemiRequestPlugin()] });\n * ```\n */\nexport function gemiRequestPlugin(): Plugin {\n return {\n name: \"gemi-custom-request\",\n enforce: \"pre\",\n async transform(code, id) {\n const path = id.split(\"?\", 1)[0];\n if (path.includes(\"/node_modules/\") || !CUSTOM_REQUEST_FILTER.test(path)) {\n return null;\n }\n return { code: await customRequestParser(code), map: null };\n },\n };\n}\n\n/**\n * gemi's island transform, for an app's `vitest.config.ts`: with it, a test\n * that renders a static view through `App.fetch` sees each\n * `island(() => import(\"./Counter\"))` with the same module key as the build,\n * and a hydrated view renders the component in place instead of lazily.\n *\n * Without it islands still render (the component is loaded with the\n * `import()`), but their keys are unknown.\n *\n * ```ts\n * // vitest.config.ts\n * import { defineConfig } from \"vitest/config\";\n * import { gemiIslandPlugin, gemiRequestPlugin } from \"gemi/vitest\";\n *\n * export default defineConfig({ plugins: [gemiRequestPlugin(), gemiIslandPlugin()] });\n * ```\n */\nexport { gemiIslandPlugin } from \"../vite/islandPlugin\";\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yOA8BO,IAAS,JAAiB,HAAW,JAC1C,CAAO,CACL,KAAM,sBACN,QAAS,WACH,UAAS,CAAC,EAAM,EAAI,CACxB,IAAM,EAAO,EAAG,MAAM,IAAK,CAAC,EAAE,GAC9B,GAAI,EAAK,SAAS,gBAAgB,GAAK,CAAC,EAAsB,KAAK,CAAI,EACrE,OAAO,KAET,MAAO,CAAE,KAAM,MAAM,EAAoB,CAAI,EAAG,IAAK,IAAK,EAE9D",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "C11E8611E15123D864756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/package.json
CHANGED
package/dist/chunk-7g9yh5ae.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var b="UTC";function W(j){if(typeof j!=="string"||j.length===0)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:j}),!0}catch{return!1}}var S=new Map,H=500;function U(j,B){let N=S.get(j);if(N===void 0){if(S.size>=H)S.delete(S.keys().next().value);N=B(),S.set(j,N)}return N}function Y(j){return j instanceof Date?j:new Date(j)}function M(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 $(j){let{locale:B,timeZone:N}=j,Q=(J={})=>{let K={...J,timeZone:J.timeZone??N};return U(`dt|${B}|${JSON.stringify(K)}`,()=>{return new Intl.DateTimeFormat(B,K)})},P=(J,K)=>{if(J&&M(J))return J;return{...K,...J}};return{locale:B,timeZone:N,date(J,K){return Q(P(K,{dateStyle:"medium"})).format(Y(J))},time(J,K){return Q(P(K,{timeStyle:"short"})).format(Y(J))},dateTime(J,K){return Q(P(K,{dateStyle:"medium",timeStyle:"short"})).format(Y(J))},number(J,K={}){return U(`n|${B}|${JSON.stringify(K)}`,()=>new Intl.NumberFormat(B,K)).format(J)},relative(J,K,R={}){return U(`r|${B}|${JSON.stringify(R)}`,()=>new Intl.RelativeTimeFormat(B,R)).format(J,K)},list(J,K={}){return U(`l|${B}|${JSON.stringify(K)}`,()=>new Intl.ListFormat(B,K)).format(J)},plural(J,K={}){return U(`p|${B}|${JSON.stringify(K)}`,()=>new Intl.PluralRules(B,K)).select(J)},dateTimeFormat:Q}}var x=/^[a-z]{2,3}(?:[-_][a-z0-9]{2,8})*$/i;function I(j){return x.test(j)}function z(j){return j.split(/[-_]/)[0].toLowerCase()}function G(j,B,N){let Q=j?.split(";")[0].trim();if(!Q||!I(Q))return null;let P=Q.replaceAll("_","-").toLowerCase(),J=B.find((X)=>X.toLowerCase()===P);if(J)return J;let K=z(Q),R=B.filter((X)=>z(X)===K);if(R.length===0)return null;if(N&&R.includes(N))return N;return R[0]}class _{config;static token="translator";translations={};isEnabled=!1;constructor(j){this.config=j;if(!W(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,Q]of Object.entries(this.config.prefetch))for(let P of this.config.supportedLocales){if(!B[P])B[P]={};B[P][N]={};for(let J of Q){B[P][N][J.name]={};for(let[K,R]of Object.entries(J.dictionary))this.isEnabled=!0,B[P][N][J.name][K]=R[P]}}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(W(B))return B}return this.config.timeZone}formatter(j,B){return $({locale:j||this.defaultLocale,timeZone:W(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)=>G(K,this.config.supportedLocales,this.config.defaultLocale),Q=N(this.config.detectLocale(j));if(Q)return Q;let P=N(j.cookies.get("i18n-locale"));if(P)return P;let J=j.headers.get("accept-language")??"";for(let K of J.split(",")){let R=N(K);if(R)return R}return B}getPageTranslations(j,B){if(this.translations[j][B])return this.translations[j][B];return{}}}
|
|
3
|
-
export{G as Vh,b as Wh,W as Xh,$ as Yh,_ as Zh};
|
|
4
|
-
|
|
5
|
-
//# debugId=752914F8E621207A64756E2164756E21
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../i18n/formatter.ts", "../i18n/resolveLocale.ts", "../i18n/Translator.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Locale- and time-zone-aware formatting, shared by `useFormatter`, the\n * `format` property of a `useDictionary` result and `Lang.formatter()`.\n *\n * Dependency-free on purpose: components import it, so it must not pull in the\n * server facades.\n *\n * Why the time zone is pinned: a `Date` formatted with no `timeZone` uses the\n * runtime's zone, which is the server's during SSR and the viewer's in the\n * browser. The two disagree for anyone not sitting in the server's zone, so the\n * same instant can print a different hour, or a different day, on each side —\n * a hydration mismatch at best, a wrong date at worst. Every formatter here\n * carries one zone, resolved on the server and shipped with the page, so both\n * sides print the same text.\n */\n\nexport type DateInput = Date | number | string;\n\nexport interface FormatterInit {\n /** BCP 47 locale tag. */\n locale: string;\n /** IANA time zone, such as `UTC` or `Europe/Istanbul`. */\n timeZone: string;\n}\n\nexport interface Formatter {\n readonly locale: string;\n readonly timeZone: string;\n /** A date, `{ dateStyle: \"medium\" }` unless options are given. */\n date(value: DateInput, options?: Intl.DateTimeFormatOptions): string;\n /** A time of day, `{ timeStyle: \"short\" }` unless options are given. */\n time(value: DateInput, options?: Intl.DateTimeFormatOptions): string;\n /** Date and time, `{ dateStyle: \"medium\", timeStyle: \"short\" }` unless options are given. */\n dateTime(value: DateInput, options?: Intl.DateTimeFormatOptions): string;\n number(value: number | bigint, options?: Intl.NumberFormatOptions): string;\n relative(\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n options?: Intl.RelativeTimeFormatOptions,\n ): string;\n list(values: Iterable<string>, options?: Intl.ListFormatOptions): string;\n /** The CLDR plural category for `count`: `one`, `few`, `other`, … */\n plural(count: number, options?: Intl.PluralRulesOptions): Intl.LDMLPluralRule;\n /**\n * The cached `Intl.DateTimeFormat` behind `date`/`time`/`dateTime`, with the\n * formatter's zone applied. For `formatToParts` or `formatRange`.\n */\n dateTimeFormat(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;\n}\n\n/** The zone used when the app configures none. */\nexport const DEFAULT_TIME_ZONE = \"UTC\";\n\n/**\n * Whether `timeZone` is an IANA zone (or offset) this runtime's `Intl` accepts.\n * An unknown zone makes `Intl.DateTimeFormat` throw a `RangeError`, so a zone\n * that comes from a cookie or a user record is checked before it is trusted.\n */\nexport function isValidTimeZone(timeZone: unknown): timeZone is string {\n if (typeof timeZone !== \"string\" || timeZone.length === 0) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone });\n return true;\n } catch {\n return false;\n }\n}\n\n// Constructing an `Intl` formatter is the expensive part — it resolves locale\n// data — so each one is built once per (kind, locale, options). Options are\n// keyed by their JSON; callers pass small literal objects, and a key order\n// difference only costs a duplicate entry, never a wrong result.\nconst cache = new Map<string, unknown>();\nconst CACHE_LIMIT = 500;\n\nfunction cached<T>(key: string, create: () => T): T {\n let value = cache.get(key) as T | undefined;\n if (value === undefined) {\n if (cache.size >= CACHE_LIMIT) {\n // Insertion order: drop the oldest. Unbounded user-driven option objects\n // (a currency per row) must not grow a long-lived server process forever.\n cache.delete(cache.keys().next().value!);\n }\n value = create();\n cache.set(key, value);\n }\n return value;\n}\n\nfunction toDate(value: DateInput): Date {\n return value instanceof Date ? value : new Date(value);\n}\n\nfunction hasDateTimeFields(options: Intl.DateTimeFormatOptions): boolean {\n return (\n options.dateStyle !== undefined ||\n options.timeStyle !== undefined ||\n options.weekday !== undefined ||\n options.era !== undefined ||\n options.year !== undefined ||\n options.month !== undefined ||\n options.day !== undefined ||\n options.dayPeriod !== undefined ||\n options.hour !== undefined ||\n options.minute !== undefined ||\n options.second !== undefined ||\n options.fractionalSecondDigits !== undefined ||\n options.timeZoneName !== undefined\n );\n}\n\nexport function createFormatter(init: FormatterInit): Formatter {\n const { locale, timeZone } = init;\n\n const dateTimeFormat = (options: Intl.DateTimeFormatOptions = {}) => {\n // `??`, not a spread: `{ timeZone: undefined }` would otherwise drop the\n // pinned zone and fall back to the runtime's, which is the bug this exists\n // to prevent.\n const resolved = { ...options, timeZone: options.timeZone ?? timeZone };\n return cached(`dt|${locale}|${JSON.stringify(resolved)}`, () => {\n return new Intl.DateTimeFormat(locale, resolved);\n });\n };\n\n const withDefaults = (\n options: Intl.DateTimeFormatOptions | undefined,\n defaults: Intl.DateTimeFormatOptions,\n ) => {\n if (options && hasDateTimeFields(options)) {\n return options;\n }\n // Options that only tweak (a `timeZone`, `hour12`) still get the default\n // fields; otherwise `{ timeZone }` alone would print a bare numeric date.\n return { ...defaults, ...options };\n };\n\n return {\n locale,\n timeZone,\n date(value, options) {\n return dateTimeFormat(withDefaults(options, { dateStyle: \"medium\" })).format(\n toDate(value),\n );\n },\n time(value, options) {\n return dateTimeFormat(withDefaults(options, { timeStyle: \"short\" })).format(\n toDate(value),\n );\n },\n dateTime(value, options) {\n return dateTimeFormat(\n withDefaults(options, { dateStyle: \"medium\", timeStyle: \"short\" }),\n ).format(toDate(value));\n },\n number(value, options = {}) {\n return cached(\n `n|${locale}|${JSON.stringify(options)}`,\n () => new Intl.NumberFormat(locale, options),\n ).format(value);\n },\n relative(value, unit, options = {}) {\n return cached(\n `r|${locale}|${JSON.stringify(options)}`,\n () => new Intl.RelativeTimeFormat(locale, options),\n ).format(value, unit);\n },\n list(values, options = {}) {\n return cached(\n `l|${locale}|${JSON.stringify(options)}`,\n () => new Intl.ListFormat(locale, options),\n ).format(values);\n },\n plural(count, options = {}) {\n return cached(\n `p|${locale}|${JSON.stringify(options)}`,\n () => new Intl.PluralRules(locale, options),\n ).select(count);\n },\n dateTimeFormat,\n };\n}\n",
|
|
6
|
-
"// A BCP 47-ish tag: a 2–3 letter language, then any number of subtags. Loose on\n// purpose — it only has to tell `en`, `de-AT` and `zh-Hant-TW` apart from path\n// segments like `blog` or `settings`.\nconst LOCALE_TAG = /^[a-z]{2,3}(?:[-_][a-z0-9]{2,8})*$/i;\n\nexport function looksLikeLocale(segment: string): boolean {\n return LOCALE_TAG.test(segment);\n}\n\nfunction languageOf(tag: string): string {\n return tag.split(/[-_]/)[0].toLowerCase();\n}\n\n/**\n * Maps a requested locale onto one the app supports, or `null` when none fits.\n *\n * An exact match wins, ignoring case (`en-us` → `en-US`). Otherwise the tag\n * falls back to a supported locale of the same language, so a short tag\n * resolves to its long form (`en` → `en-US`) and an unsupported region to a\n * supported one (`de-AT` → `de-DE`). When several share the language, the\n * default locale is preferred, then the first in `supportedLocales`.\n */\nexport function resolveLocale(\n requested: string | null | undefined,\n supportedLocales: string[],\n defaultLocale?: string,\n): string | null {\n // An `Accept-Language` entry may carry a weight: `de-AT;q=0.9`.\n const tag = requested?.split(\";\")[0].trim();\n if (!tag || !looksLikeLocale(tag)) {\n return null;\n }\n\n const normalized = tag.replaceAll(\"_\", \"-\").toLowerCase();\n const exact = supportedLocales.find((l) => l.toLowerCase() === normalized);\n if (exact) {\n return exact;\n }\n\n const language = languageOf(tag);\n const sameLanguage = supportedLocales.filter((l) => languageOf(l) === language);\n if (sameLanguage.length === 0) {\n return null;\n }\n if (defaultLocale && sameLanguage.includes(defaultLocale)) {\n return defaultLocale;\n }\n return sameLanguage[0];\n}\n",
|
|
7
|
-
"import type { HttpRequest } from \"../http/HttpRequest\";\nimport type { Dictionary } from \"./Dictionary\";\nimport type { TranslationConfig } from \"./config\";\nimport { resolveLocale } from \"./resolveLocale\";\nimport {\n createFormatter,\n isValidTimeZone,\n type Formatter,\n} from \"./formatter\";\n\nexport class Translator {\n static token = \"translator\";\n\n translations = {};\n isEnabled = false;\n\n constructor(public config: Required<TranslationConfig>) {\n // Fail at boot rather than on the first page that prints a date: `Intl`\n // throws a `RangeError` for a zone it does not know.\n if (!isValidTimeZone(this.config.timeZone)) {\n throw new Error(\n `translation.timeZone: \"${String(this.config.timeZone)}\" is not a time zone this runtime knows. Use an IANA name such as \"UTC\" or \"Europe/Istanbul\".`,\n );\n }\n\n const translations = {};\n\n for (const [route, dicArray] of Object.entries(this.config.prefetch)) {\n for (const locale of this.config.supportedLocales) {\n if (!translations[locale]) {\n translations[locale] = {};\n }\n translations[locale][route] = {};\n for (const dic of dicArray) {\n translations[locale][route][dic.name] = {};\n for (const [key, value] of Object.entries(dic.dictionary)) {\n this.isEnabled = true;\n translations[locale][route][dic.name][key] = value[locale];\n }\n }\n }\n }\n this.translations = translations;\n }\n\n /**\n * Whether the app does locale-aware routing and rendering at all.\n *\n * `isEnabled` only means the legacy `prefetch` config has dictionaries to\n * serve. An app on `defineDictionary` has an empty `prefetch` and declares\n * its locales through `supportedLocales` alone, so gating on `isEnabled`\n * leaves it without locale detection or a locale URL prefix. Both the render\n * path and the redirect read this, because when they disagreed a migrated app\n * rendered a non-default locale at `/` with no redirect and no `Vary` — one\n * cache fill away from serving that document to everyone.\n */\n get isLocaleAware(): boolean {\n return this.isEnabled || this.config.supportedLocales.length > 0;\n }\n\n get supportedLocales(): string[] {\n return this.config.supportedLocales;\n }\n\n get defaultLocale(): string {\n return this.config.defaultLocale;\n }\n\n get components(): Record<string, Dictionary<any>> {\n return this.config.components;\n }\n\n /** The configured zone; `UTC` unless `translation.timeZone` says otherwise. */\n get timeZone(): string {\n return this.config.timeZone;\n }\n\n /**\n * The zone dates are formatted in for this request: `detectTimeZone`'s\n * answer when it gives a zone `Intl` knows, the configured zone otherwise.\n * A bad value from a cookie must not take the page down, so it is ignored\n * rather than thrown.\n */\n detectTimeZone(req: HttpRequest<any, any> | null | undefined): string {\n if (req) {\n const detected = this.config.detectTimeZone(req);\n if (isValidTimeZone(detected)) {\n return detected;\n }\n }\n return this.config.timeZone;\n }\n\n /**\n * A formatter for `locale` (the default locale when omitted) in `timeZone`\n * (the configured zone when omitted). For server code outside a request —\n * jobs, emails. Inside a request, `Lang.formatter()` picks up the request's\n * locale and zone.\n */\n formatter(locale?: string, timeZone?: string): Formatter {\n return createFormatter({\n locale: locale || this.defaultLocale,\n timeZone: isValidTimeZone(timeZone) ? timeZone : this.timeZone,\n });\n }\n\n onLocaleChange(locale: string): Promise<void> | void {\n return this.config.onLocaleChange(locale);\n }\n\n detectLocale(req: HttpRequest<any, any>) {\n const fallbackLocale =\n this.config.defaultLocale ?? this.config.supportedLocales[0] ?? \"en-US\";\n const resolve = (tag: string | null | undefined) =>\n resolveLocale(tag, this.config.supportedLocales, this.config.defaultLocale);\n\n const detectedLocale = resolve(this.config.detectLocale(req));\n if (detectedLocale) {\n return detectedLocale;\n }\n\n const previousLocale = resolve(req.cookies.get(\"i18n-locale\"));\n if (previousLocale) {\n return previousLocale;\n }\n\n // Entries are in the browser's preference order; the first one the app can\n // serve, even by language alone (`de-AT` → `de-DE`), wins.\n const acceptLanguage = req.headers.get(\"accept-language\") ?? \"\";\n for (const entry of acceptLanguage.split(\",\")) {\n const locale = resolve(entry);\n if (locale) {\n return locale;\n }\n }\n\n return fallbackLocale;\n }\n\n getPageTranslations(locale: string, scope: string) {\n if (this.translations[locale][scope]) {\n return this.translations[locale][scope];\n }\n return {};\n }\n}\n"
|
|
8
|
-
],
|
|
9
|
-
"mappings": ";AAmDO,IAAM,EAAoB,MAO1B,SAAS,CAAe,CAAC,EAAuC,C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