void 0.20.3 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agents-gni4eqBu.mjs +111 -0
- package/dist/auth-3sGB0zJ1.mjs +22 -0
- package/dist/{auth-DPl6kck4.mjs → auth-B9_D6ygs.mjs} +6 -241
- package/dist/auth-CAw7zHqj.mjs +2 -0
- package/dist/auth-client-BWBT8HLp.mjs +6 -0
- package/dist/auth-client-Bawdj38n.d.mts +7 -0
- package/dist/auth-client-react-7GFffu8R.d.mts +7 -0
- package/dist/auth-client-react-CMLwT2xI.mjs +6 -0
- package/dist/auth-client-solid-DyTFL4cq.d.mts +7 -0
- package/dist/auth-client-solid-UoreJWZG.mjs +6 -0
- package/dist/auth-client-svelte-Cv_WvrRk.mjs +6 -0
- package/dist/auth-client-svelte-zetW0KIH.d.mts +7 -0
- package/dist/auth-client-vue-CFk7Xbv3.mjs +6 -0
- package/dist/auth-client-vue-bChShbQP.d.mts +7 -0
- package/dist/{auth-cmd-CzwquNiP.mjs → auth-cmd-g_ymMkUe.mjs} +5 -5
- package/dist/{auth-link-ElDTgF7j.mjs → auth-link-DFvxIyZi.mjs} +5 -5
- package/dist/{better-auth-shared-DSCeohOK.d.mts → better-auth-shared-BoVwA5Vm.d.mts} +1 -6
- package/dist/{better-auth-shared-CYw1T3k4.mjs → better-auth-shared-syGYYmnY.mjs} +1 -1
- package/dist/{build-cmd-BpJe6boP.mjs → build-cmd-wJAv808h.mjs} +6 -4
- package/dist/{cache-D98YTqeE.mjs → cache-Be0Fu5Ka.mjs} +6 -4
- package/dist/{cancel-deploy-CPbEQLMG.mjs → cancel-deploy-BgmyOwhe.mjs} +5 -3
- package/dist/cf-access-rAZxzMkL.mjs +181 -0
- package/dist/cf-build-output-CTdlo6Rt.mjs +520 -0
- package/dist/cli/cf-compat.d.mts +1 -0
- package/dist/cli/cf-compat.mjs +944 -0
- package/dist/cli/cli.mjs +60 -38
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-DAAivdid.mjs +2 -0
- package/dist/{client-BQBrZoCX.mjs → client-PdAJ-F0t.mjs} +6 -12
- package/dist/{cloudflare-auth-6M5llVPC.mjs → cloudflare-auth-BCmTc1X_.mjs} +13 -44
- package/dist/{cloudflare-cmd-4RPGN3KB.mjs → cloudflare-cmd-D6PrKn7o.mjs} +4 -7
- package/dist/{cloudflare-connect-t1UU5svD.mjs → cloudflare-connect-DloREDlc.mjs} +6 -6
- package/dist/cloudflare-operations-BHNJVDbN.mjs +2 -0
- package/dist/{cloudflare-operations-BzWnlC1_.mjs → cloudflare-operations-CPEdHYhM.mjs} +37 -39
- package/dist/cloudflare-user-output-Q-k0QoNQ.mjs +20 -0
- package/dist/collect-DAUItMDS.mjs +2 -0
- package/dist/collect-DXHNWHcT.mjs +48 -0
- package/dist/config--T87TD8T.mjs +2 -0
- package/dist/{config-NOG_U1aK.mjs → config-BSe70f4T.mjs} +4 -6
- package/dist/config-DDIFxQYx.mjs +2 -0
- package/dist/{config-uNGuFsI2.mjs → config-Dxr6cTXn.mjs} +22 -37
- package/dist/config-DywxBLQC.d.mts +185 -0
- package/dist/config-entry.d.mts +6 -0
- package/dist/config-entry.mjs +7 -0
- package/dist/config-uP7ZDtVZ.mjs +21 -0
- package/dist/config-write-y3CBI_ux.mjs +60 -0
- package/dist/{connect-WCQZ_u3m.mjs → connect-LnvW4HKx.mjs} +8 -6
- package/dist/{create-project-D0oXA090.mjs → create-project-BZBl_gQ0.mjs} +8 -23
- package/dist/create-project-JV9-6ICF.mjs +2 -0
- package/dist/database-provider-Cx525bwX.mjs +6 -0
- package/dist/database-provider.mjs +1 -5
- package/dist/{db-DJ-9qs3S.mjs → db-Mzv88E1C.mjs} +48 -44
- package/dist/{delete-BZ4-WaGm.mjs → delete-Ri6JemSU.mjs} +6 -4
- package/dist/deploy-DAH2-m_-.mjs +2 -0
- package/dist/{deploy-BAhhcg5q.mjs → deploy-DEsMVrCY.mjs} +796 -198
- package/dist/discover-BBzDZe_o.mjs +2 -0
- package/dist/{discover-xvfrgJeo.mjs → discover-C4O6YxVS.mjs} +3 -8
- package/dist/{dist-BrsS7cai.mjs → dist-4WkAWhWx.mjs} +1 -15
- package/dist/{dist-m40_XgNh.mjs → dist-Bn8Kodjp.mjs} +1 -1
- package/dist/dist-C5fND3R0.mjs +2 -0
- package/dist/dist-D7-nEOXi.mjs +2 -0
- package/dist/{output-B0cfNSx5.mjs → dist-Dn6nn2IU.mjs} +3 -926
- package/dist/{domain-BxAyhxXN.mjs → domain-BA37Ye7T.mjs} +7 -5
- package/dist/{route-types-Da-DpyUp.mjs → drizzle-Beb2Am5S.mjs} +1 -280
- package/dist/{email-Bj7Cvdwp.mjs → email-C5NsxrQG.mjs} +14 -12
- package/dist/{email-Ce6SQq-i.mjs → email-C5kaZXzJ.mjs} +2 -2
- package/dist/{entry-DU3oDoQ3.mjs → entry-DdRFGK0y.mjs} +2 -2
- package/dist/{env-DBKmK4vc.mjs → env-DX_v-Q-v.mjs} +1 -1
- package/dist/{env-DP_EErve.mjs → env-U_ohASB0.mjs} +9 -7
- package/dist/env-Yz4HcvHs.mjs +78 -0
- package/dist/env-helpers--wFmQ_5Q.mjs +136 -0
- package/dist/{env-types-BNPhro-M.mjs → env-types-CWDtqHgw.mjs} +6 -2
- package/dist/{env-validation-CF6KvTRf.mjs → env-validation-BsFEXps5.mjs} +19 -28
- package/dist/env-validation-DIDGM7h4.mjs +2 -0
- package/dist/fetch-CXDChK7B.mjs +18 -0
- package/dist/fetch-_SeGZao9.d.mts +57 -0
- package/dist/fetch-stream-AOByI7Ki.mjs +81 -0
- package/dist/fetch-stream-Bjf0hoZb.d.mts +49 -0
- package/dist/gen-B87rlalt.mjs +2 -0
- package/dist/{gen-B_wPnVTK.mjs → gen-pg-Ojg8Y.mjs} +13 -11
- package/dist/{generate-RTK8_kK1.mjs → generate-C0VY6RVf.mjs} +2 -2
- package/dist/{github-cmd-C-z_xRrQ.mjs → github-cmd-DsrkweIl.mjs} +6 -4
- package/dist/{handler-D1hLsObx.d.mts → handler-BXJTXd02.d.mts} +6 -1
- package/dist/handler-DghKr6dU.mjs +150 -0
- package/dist/head-D_QRR5Yd.mjs +112 -0
- package/dist/head-client-DzmJGN4C.mjs +90 -0
- package/dist/{headers-BAHwgHdW.mjs → headers-B_HBMgi0.mjs} +2 -2
- package/dist/help-B403BLBB.mjs +2 -0
- package/dist/{help-CwOX-zmI.mjs → help-sBhFH6pi.mjs} +17 -12
- package/dist/index.d.mts +2 -20
- package/dist/index.mjs +116 -60
- package/dist/{init-BGktCXgA.mjs → init-C--Yyj1b.mjs} +49 -50
- package/dist/{link-D2kbqhWb.mjs → link-BC-mNG9-.mjs} +7 -5
- package/dist/{list-CvkK_G7k.mjs → list-DHU1Wj6c.mjs} +7 -5
- package/dist/live-CB1y5IuC.mjs +411 -0
- package/dist/live-CKiJilLr.d.mts +105 -0
- package/dist/local-d1-DzykTWY8.mjs +104 -0
- package/dist/login-BwiopVdg.mjs +2 -0
- package/dist/{login-WIjNc77c.mjs → login-jKe_0QZL.mjs} +6 -11
- package/dist/{logs-dLUFCapG.mjs → logs-BG11f5PR.mjs} +6 -4
- package/dist/migrate-BV8qHiCb.mjs +285 -0
- package/dist/migrate-BXY3B3m7.mjs +2 -0
- package/dist/migration-handler-DM4clYj5.d.mts +51 -0
- package/dist/{neon-DHwd2zvC.mjs → neon-n74ta1Pr.mjs} +1 -1
- package/dist/{node-Ez5KW5rn.mjs → node-Cupyf7-s.mjs} +6 -6
- package/dist/{operator-auth-B3e08unv.mjs → operator-auth-BkVgJqv-.mjs} +2 -2
- package/dist/{operator-client-LUZnlnYk.mjs → operator-client-A0iex2yi.mjs} +2 -1
- package/dist/{operator-cmd-CKJ7xIRs.mjs → operator-cmd-BwAS2XZt.mjs} +6 -6
- package/dist/output-CCH48AMM.mjs +146 -0
- package/dist/{package-json-CPoWX79C.mjs → package-json-iCbMg5XF.mjs} +1 -1
- package/dist/pages/client.d.mts +5 -2
- package/dist/pages/client.mjs +5 -3
- package/dist/pages/head-client.mjs +1 -89
- package/dist/pages/head.mjs +1 -111
- package/dist/pages/index.d.mts +2 -3
- package/dist/pages/index.mjs +7 -7
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/prefetch.d.mts +2 -30
- package/dist/pages/prefetch.mjs +1 -89
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +3 -3
- package/dist/pages/serialize.d.mts +2 -9
- package/dist/pages/serialize.mjs +1 -13
- package/dist/plan-BEZ8VJW0.mjs +256 -0
- package/dist/plan-DpuOr14e.mjs +2 -0
- package/dist/{platform-auth-config-CdVWRRJr.mjs → platform-auth-config-C-hv-_Ok.mjs} +6 -6
- package/dist/{platform-auth-protection-Drl0qhrn.mjs → platform-auth-protection-DjTE5Hj-.mjs} +7 -5
- package/dist/{platform-auth-recovery-CmKEWpDo.mjs → platform-auth-recovery-Cr0r8TEb.mjs} +6 -5
- package/dist/{platform-cmd-5q_k56xS.mjs → platform-cmd-0tEh2ZtA.mjs} +8 -5
- package/dist/platform-cmd-DE6dw45v.mjs +2 -0
- package/dist/{platform-domain-4GiDlcqx.mjs → platform-domain-B_7x6Iqx.mjs} +4 -3
- package/dist/platform-lifecycle-Dhx9Pnub.mjs +2 -0
- package/dist/{platform-lifecycle-R9xAxvtG.mjs → platform-lifecycle-Di0LbhPM.mjs} +208 -37
- package/dist/platform-management-B9LUtMt9.mjs +2 -0
- package/dist/{platform-management-BfWsXHEW.mjs → platform-management-eaiaU3uM.mjs} +8 -5
- package/dist/{platform-recovery-CbK-I1FB.mjs → platform-recovery-BxfA8E5C.mjs} +3 -3
- package/dist/platform-registry-BJbgZLS1.mjs +431 -0
- package/dist/{plugin-inference-BDRfZngg.mjs → plugin-inference-DsvtJLll.mjs} +4 -4
- package/dist/prefetch-Bsc_Pb6c.mjs +90 -0
- package/dist/prefetch-Ce6la4EI.d.mts +31 -0
- package/dist/prepare-D4CkM3_v.mjs +2 -0
- package/dist/{prepare-blNRQvQl.mjs → prepare-_T-Haxrr.mjs} +3 -2
- package/dist/{prepare-CtDJjoOj.mjs → prepare-pcWcxSCh.mjs} +13 -11
- package/dist/prerender-render-Cf_WDE9W.mjs +111 -0
- package/dist/prerender-render.mjs +1 -110
- package/dist/{preset-lAy0B0BQ.mjs → preset-Dowh9tTt.mjs} +16 -118
- package/dist/project-BEBFDFLz.mjs +2 -0
- package/dist/project-CWNIPoXc.mjs +209 -0
- package/dist/{project-cmd-CTdmnzvc.mjs → project-cmd-DrnRJdep.mjs} +18 -16
- package/dist/{project-paths-SK8nMHPp.mjs → project-paths-CKQ-Q5JS.mjs} +47 -14
- package/dist/project-slug-23TpquG4.mjs +8 -0
- package/dist/project-slug-DofjTFd-.mjs +2 -0
- package/dist/{project-team-CGxsQe3_.mjs → project-team-CzRbO_kA.mjs} +6 -4
- package/dist/{project-token-Cirx7uwZ.mjs → project-token-Bwxjf4y6.mjs} +6 -4
- package/dist/{project-tsconfig-Ql2XsSQp.mjs → project-tsconfig-CwfqUnVp.mjs} +2 -2
- package/dist/{protocol-C-pqYJjE.d.mts → protocol-ZH3jP4a7.d.mts} +1 -1
- package/dist/providers-BNKRacMr.d.mts +7 -0
- package/dist/provision-CNgEBkVA.mjs +3 -0
- package/dist/{provision-CSJOjjQk.mjs → provision-Cck2m3jJ.mjs} +11 -25
- package/dist/queues-BWKt1Xo4.d.mts +7 -0
- package/dist/{requests-4Nq59hOr.mjs → requests-DwrqUQZ8.mjs} +5 -3
- package/dist/resolve-project-BTotl8Nn.mjs +2 -0
- package/dist/{resolve-project--Vxawf7z.mjs → resolve-project-Xvis70DG.mjs} +2 -8
- package/dist/response-Tn7rU0MV.mjs +30 -0
- package/dist/{rollback-Dr7u0Ljx.mjs → rollback-B4tFWmkN.mjs} +6 -4
- package/dist/{rolldown-runtime-rQ84J-ij.mjs → rolldown-runtime-DXIUcv95.mjs} +1 -10
- package/dist/route-types-Id82-veQ.mjs +280 -0
- package/dist/{local-d1-D2I6Ox5F.mjs → runner-BGVsGgkb.mjs} +6 -114
- package/dist/runner-CQs_cDSG.mjs +2 -0
- package/dist/runner-mysql-1o47achK.mjs +2 -0
- package/dist/{runner-mysql-7BPUNGmL.mjs → runner-mysql-BhwMk2Bm.mjs} +2 -9
- package/dist/{runner-pg-BkEza-dX.mjs → runner-pg-CJ_JeGF6.mjs} +2 -9
- package/dist/runner-pg-D7z01mQS.mjs +2 -0
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth-client-react.d.mts +2 -6
- package/dist/runtime/auth-client-react.mjs +1 -5
- package/dist/runtime/auth-client-solid.d.mts +2 -6
- package/dist/runtime/auth-client-solid.mjs +1 -5
- package/dist/runtime/auth-client-svelte.d.mts +2 -6
- package/dist/runtime/auth-client-svelte.mjs +1 -5
- package/dist/runtime/auth-client-vue.d.mts +2 -6
- package/dist/runtime/auth-client-vue.mjs +1 -5
- package/dist/runtime/auth-client.d.mts +2 -6
- package/dist/runtime/auth-client.mjs +1 -5
- package/dist/runtime/auth.mjs +1 -21
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +3 -3
- package/dist/runtime/client-react.mjs +3 -3
- package/dist/runtime/client-solid.d.mts +3 -3
- package/dist/runtime/client-solid.mjs +3 -3
- package/dist/runtime/client-svelte.d.mts +3 -3
- package/dist/runtime/client-svelte.mjs +3 -3
- package/dist/runtime/client-vue.d.mts +3 -3
- package/dist/runtime/client-vue.mjs +3 -3
- package/dist/runtime/client.d.mts +3 -3
- package/dist/runtime/client.mjs +3 -3
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-helpers.mjs +1 -135
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.mjs +2 -2
- package/dist/runtime/env.mjs +1 -77
- package/dist/runtime/fetch-stream.d.mts +2 -49
- package/dist/runtime/fetch-stream.mjs +2 -80
- package/dist/runtime/fetch.d.mts +2 -57
- package/dist/runtime/fetch.mjs +2 -17
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -149
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +2 -2
- package/dist/runtime/live.d.mts +2 -104
- package/dist/runtime/live.mjs +1 -410
- package/dist/runtime/migration-handler-mysql.d.mts +1 -1
- package/dist/runtime/migration-handler-pg.d.mts +1 -1
- package/dist/runtime/migration-handler.d.mts +2 -50
- package/dist/runtime/queues.d.mts +2 -6
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/response.mjs +1 -29
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/sse.mjs +1 -171
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -71
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +2 -2
- package/dist/runtime/ws.d.mts +2 -121
- package/dist/{scan-CpK-57ug.mjs → scan-DJbooZm2.mjs} +3 -3
- package/dist/{scan-BMH4rzlv.mjs → scan-DdDvRCU1.mjs} +8 -26
- package/dist/{secret-AcPi-FoA.mjs → secret-UtrRjhEO.mjs} +8 -6
- package/dist/serialize-BPvnNQuA.mjs +14 -0
- package/dist/serialize-CfSwWfF2.d.mts +10 -0
- package/dist/{skills-C0RvGjeE.mjs → skills-B-690E7h.mjs} +3 -2
- package/dist/sse-BaC1jXko.mjs +172 -0
- package/dist/{subcommand-prompt-Bmyn5Rlc.mjs → subcommand-prompt-BuGYkAkC.mjs} +2 -1
- package/dist/sveltekit.d.mts +2 -1
- package/dist/sveltekit.mjs +3 -2
- package/dist/validate-DqJ33oHj.mjs +2 -0
- package/dist/validate-qNhV00PD.mjs +180 -0
- package/dist/validator-BTOu0fB0.mjs +72 -0
- package/dist/{wrangler--imS8n0d.mjs → wrangler-D01qs6VB.mjs} +259 -71
- package/dist/ws-BwcqizuH.d.mts +122 -0
- package/dist/{yarn-pnp-DxSInkzL.mjs → yarn-pnp-CVEc3gE7.mjs} +1 -1
- package/package.json +19 -8
- package/skills/void/SKILL.md +6 -4
- package/skills/void/docs/guide/ai.md +3 -3
- package/skills/void/docs/guide/app-types.md +12 -11
- package/skills/void/docs/guide/auth.md +2 -2
- package/skills/void/docs/guide/database/d1.md +1 -1
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +3 -3
- package/skills/void/docs/guide/deployment.md +8 -15
- package/skills/void/docs/guide/durable-state.md +2 -2
- package/skills/void/docs/guide/edge/headers.md +3 -3
- package/skills/void/docs/guide/edge/prerendering.md +1 -1
- package/skills/void/docs/guide/edge/redirects.md +4 -4
- package/skills/void/docs/guide/edge/revalidation.md +6 -6
- package/skills/void/docs/guide/edge/rewrites.md +28 -27
- package/skills/void/docs/guide/edge/static-assets.md +1 -1
- package/skills/void/docs/guide/email.md +60 -66
- package/skills/void/docs/guide/env-migration.md +1 -1
- package/skills/void/docs/guide/index.md +15 -41
- package/skills/void/docs/guide/pages-routing/head.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +13 -5
- package/skills/void/docs/guide/platform/administration/projects.md +3 -1
- package/skills/void/docs/guide/platform/installation/ci.md +3 -0
- package/skills/void/docs/guide/platform/installation/credentials.md +15 -5
- package/skills/void/docs/guide/platform/installation/prerequisites.md +2 -0
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/quickstart.md +11 -78
- package/skills/void/docs/guide/remote-dev.md +2 -2
- package/skills/void/docs/guide/sandboxes.md +1 -1
- package/skills/void/docs/guide/ssg.md +1 -1
- package/skills/void/docs/guide/websockets.md +1 -1
- package/skills/void/docs/index.md +17 -17
- package/skills/void/docs/integrations/cloudflare.md +91 -96
- package/skills/void/docs/integrations/frameworks/analog.md +14 -9
- package/skills/void/docs/integrations/frameworks/astro.md +14 -10
- package/skills/void/docs/integrations/frameworks/nuxt.md +14 -9
- package/skills/void/docs/integrations/frameworks/overview.md +35 -29
- package/skills/void/docs/integrations/frameworks/react-router.md +1 -1
- package/skills/void/docs/integrations/frameworks/sveltekit.md +33 -30
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +1 -1
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -5
- package/skills/void/docs/reference/api.md +21 -4
- package/skills/void/docs/reference/cli.md +40 -25
- package/skills/void/docs/reference/config.md +58 -35
- package/skills/void/docs/reference/structure.md +2 -2
- package/dist/validate-tBBN_dXH.mjs +0 -505
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as applySqliteAuthMigrations } from "../auth-migrations-9vif1uj8.mjs";
|
|
2
|
-
import { t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { t as createVoidAuthRuntime } from "../better-auth-shared-syGYYmnY.mjs";
|
|
3
3
|
//#region src/runtime/better-auth.ts
|
|
4
4
|
async function resolveDatabase(env) {
|
|
5
5
|
if (!env.DB) throw new Error("auth: Better Auth requires the \"DB\" D1 binding for sqlite apps.");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-DkcFflXV.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createAuthClient, t as auth } from "../auth-client-react-7GFffu8R.mjs";
|
|
3
3
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
4
|
-
import { fetch } from "
|
|
5
|
-
import { fetchStream } from "
|
|
4
|
+
import { t as fetch } from "../fetch-_SeGZao9.mjs";
|
|
5
|
+
import { t as fetchStream } from "../fetch-stream-Bjf0hoZb.mjs";
|
|
6
6
|
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
-
import { fetch } from "
|
|
3
|
-
import { fetchStream } from "
|
|
4
|
-
import {
|
|
2
|
+
import { t as fetch } from "../fetch-CXDChK7B.mjs";
|
|
3
|
+
import { t as fetchStream } from "../fetch-stream-AOByI7Ki.mjs";
|
|
4
|
+
import { n as createAuthClient, t as auth } from "../auth-client-react-CMLwT2xI.mjs";
|
|
5
5
|
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-DkcFflXV.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createAuthClient, t as auth } from "../auth-client-solid-DyTFL4cq.mjs";
|
|
3
3
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
4
|
-
import { fetch } from "
|
|
5
|
-
import { fetchStream } from "
|
|
4
|
+
import { t as fetch } from "../fetch-_SeGZao9.mjs";
|
|
5
|
+
import { t as fetchStream } from "../fetch-stream-Bjf0hoZb.mjs";
|
|
6
6
|
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
-
import { fetch } from "
|
|
3
|
-
import { fetchStream } from "
|
|
4
|
-
import {
|
|
2
|
+
import { t as fetch } from "../fetch-CXDChK7B.mjs";
|
|
3
|
+
import { t as fetchStream } from "../fetch-stream-AOByI7Ki.mjs";
|
|
4
|
+
import { n as createAuthClient, t as auth } from "../auth-client-solid-UoreJWZG.mjs";
|
|
5
5
|
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-DkcFflXV.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createAuthClient, t as auth } from "../auth-client-svelte-zetW0KIH.mjs";
|
|
3
3
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
4
|
-
import { fetch } from "
|
|
5
|
-
import { fetchStream } from "
|
|
4
|
+
import { t as fetch } from "../fetch-_SeGZao9.mjs";
|
|
5
|
+
import { t as fetchStream } from "../fetch-stream-Bjf0hoZb.mjs";
|
|
6
6
|
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
-
import { fetch } from "
|
|
3
|
-
import { fetchStream } from "
|
|
4
|
-
import {
|
|
2
|
+
import { t as fetch } from "../fetch-CXDChK7B.mjs";
|
|
3
|
+
import { t as fetchStream } from "../fetch-stream-AOByI7Ki.mjs";
|
|
4
|
+
import { n as createAuthClient, t as auth } from "../auth-client-svelte-Cv_WvrRk.mjs";
|
|
5
5
|
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-DkcFflXV.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createAuthClient, t as auth } from "../auth-client-vue-bChShbQP.mjs";
|
|
3
3
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
4
|
-
import { fetch } from "
|
|
5
|
-
import { fetchStream } from "
|
|
4
|
+
import { t as fetch } from "../fetch-_SeGZao9.mjs";
|
|
5
|
+
import { t as fetchStream } from "../fetch-stream-Bjf0hoZb.mjs";
|
|
6
6
|
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
-
import { fetch } from "
|
|
3
|
-
import { fetchStream } from "
|
|
4
|
-
import {
|
|
2
|
+
import { t as fetch } from "../fetch-CXDChK7B.mjs";
|
|
3
|
+
import { t as fetchStream } from "../fetch-stream-AOByI7Ki.mjs";
|
|
4
|
+
import { n as createAuthClient, t as auth } from "../auth-client-vue-CFk7Xbv3.mjs";
|
|
5
5
|
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-DkcFflXV.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createAuthClient, t as auth } from "../auth-client-Bawdj38n.mjs";
|
|
3
3
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
4
|
-
import { fetch } from "
|
|
5
|
-
import { fetchStream } from "
|
|
4
|
+
import { t as fetch } from "../fetch-_SeGZao9.mjs";
|
|
5
|
+
import { t as fetchStream } from "../fetch-stream-Bjf0hoZb.mjs";
|
|
6
6
|
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
package/dist/runtime/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
-
import { fetch } from "
|
|
3
|
-
import { fetchStream } from "
|
|
4
|
-
import {
|
|
2
|
+
import { t as fetch } from "../fetch-CXDChK7B.mjs";
|
|
3
|
+
import { t as fetchStream } from "../fetch-stream-AOByI7Ki.mjs";
|
|
4
|
+
import { n as createAuthClient, t as auth } from "../auth-client-BWBT8HLp.mjs";
|
|
5
5
|
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
package/dist/runtime/db.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requireRuntimeBinding } from "
|
|
1
|
+
import { a as requireRuntimeBinding } from "../env-Yz4HcvHs.mjs";
|
|
2
2
|
import { drizzle } from "drizzle-orm/d1";
|
|
3
3
|
import { and, asc, avg, between, count, desc, eq, exists, gt, gte, ilike, inArray, isNotNull, isNull, like, lt, lte, max, min, ne, not, notBetween, notExists, notInArray, notLike, or, sql, sum } from "drizzle-orm";
|
|
4
4
|
//#region src/runtime/db.ts
|
package/dist/runtime/durable.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requireRuntimeBinding, withRuntimeEnv } from "
|
|
1
|
+
import { a as requireRuntimeBinding, o as withRuntimeEnv } from "../env-Yz4HcvHs.mjs";
|
|
2
2
|
import { DurableObject } from "cloudflare:workers";
|
|
3
3
|
//#region src/runtime/durable.ts
|
|
4
4
|
const DEFAULT_STORAGE_KEY = "__void_durable_state";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as normalizeEmail, r as buildMime } from "../../mime-D5Nmdzf7.mjs";
|
|
2
2
|
import { y as registerEmailSink } from "../../dev-inbox-P0u4tM8Y.mjs";
|
|
3
|
-
import { n as compileEmailPattern, t as compareEmailRoutes } from "../../email-
|
|
3
|
+
import { n as compileEmailPattern, t as compareEmailRoutes } from "../../email-C5kaZXzJ.mjs";
|
|
4
4
|
import { i as createMessageProxy, n as MAX_INBOUND_HEADERS, t as MAX_INBOUND_BYTES } from "../../inbound-aVHEUhKo.mjs";
|
|
5
5
|
//#region src/runtime/email/testing.ts
|
|
6
6
|
/**
|
|
@@ -1,136 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function build(parse, state) {
|
|
3
|
-
return {
|
|
4
|
-
"~standard": {
|
|
5
|
-
version: 1,
|
|
6
|
-
vendor: "void",
|
|
7
|
-
validate(value) {
|
|
8
|
-
if (value === void 0 || value === null || value === "") {
|
|
9
|
-
if (state.defaultValue !== void 0) return { value: state.defaultValue };
|
|
10
|
-
if (state.optional) return { value: void 0 };
|
|
11
|
-
return { issues: [{ message: "Required" }] };
|
|
12
|
-
}
|
|
13
|
-
const result = parse(typeof value === "string" ? value : String(value));
|
|
14
|
-
if (result.ok) return { value: result.value };
|
|
15
|
-
return { issues: [{ message: result.message }] };
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
optional() {
|
|
19
|
-
return build(parse, {
|
|
20
|
-
optional: true,
|
|
21
|
-
defaultValue: state.defaultValue
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
default(value) {
|
|
25
|
-
return build(parse, {
|
|
26
|
-
optional: false,
|
|
27
|
-
defaultValue: value
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const empty = () => ({
|
|
33
|
-
optional: false,
|
|
34
|
-
defaultValue: void 0
|
|
35
|
-
});
|
|
36
|
-
/** Required string env value. */
|
|
37
|
-
function string() {
|
|
38
|
-
return build((raw) => ({
|
|
39
|
-
ok: true,
|
|
40
|
-
value: raw
|
|
41
|
-
}), empty());
|
|
42
|
-
}
|
|
43
|
-
/** Numeric env value. Parses with `Number(raw)`; rejects NaN. */
|
|
44
|
-
function number() {
|
|
45
|
-
return build((raw) => {
|
|
46
|
-
const n = Number(raw);
|
|
47
|
-
if (Number.isNaN(n)) return {
|
|
48
|
-
ok: false,
|
|
49
|
-
message: `Expected a number, got "${raw}"`
|
|
50
|
-
};
|
|
51
|
-
return {
|
|
52
|
-
ok: true,
|
|
53
|
-
value: n
|
|
54
|
-
};
|
|
55
|
-
}, empty());
|
|
56
|
-
}
|
|
57
|
-
/** Boolean env value. Accepts "true"/"false"/"1"/"0" (case-insensitive). */
|
|
58
|
-
function boolean() {
|
|
59
|
-
return build((raw) => {
|
|
60
|
-
const lowercased = raw.toLowerCase();
|
|
61
|
-
if (lowercased === "true" || lowercased === "1") return {
|
|
62
|
-
ok: true,
|
|
63
|
-
value: true
|
|
64
|
-
};
|
|
65
|
-
if (lowercased === "false" || lowercased === "0") return {
|
|
66
|
-
ok: true,
|
|
67
|
-
value: false
|
|
68
|
-
};
|
|
69
|
-
return {
|
|
70
|
-
ok: false,
|
|
71
|
-
message: `Expected boolean (true/false/1/0), got "${raw}"`
|
|
72
|
-
};
|
|
73
|
-
}, empty());
|
|
74
|
-
}
|
|
75
|
-
/** URL string — validated via `new URL(raw)`. */
|
|
76
|
-
function url() {
|
|
77
|
-
return build((raw) => {
|
|
78
|
-
try {
|
|
79
|
-
new URL(raw);
|
|
80
|
-
return {
|
|
81
|
-
ok: true,
|
|
82
|
-
value: raw
|
|
83
|
-
};
|
|
84
|
-
} catch {
|
|
85
|
-
return {
|
|
86
|
-
ok: false,
|
|
87
|
-
message: `Expected a valid URL, got "${raw}"`
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}, empty());
|
|
91
|
-
}
|
|
92
|
-
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
93
|
-
/** Email string — basic shape validation. */
|
|
94
|
-
function email() {
|
|
95
|
-
return build((raw) => {
|
|
96
|
-
if (!EMAIL_RE.test(raw)) return {
|
|
97
|
-
ok: false,
|
|
98
|
-
message: `Expected a valid email, got "${raw}"`
|
|
99
|
-
};
|
|
100
|
-
return {
|
|
101
|
-
ok: true,
|
|
102
|
-
value: raw
|
|
103
|
-
};
|
|
104
|
-
}, empty());
|
|
105
|
-
}
|
|
106
|
-
/** One of a fixed set of literal string values. */
|
|
107
|
-
function oneOf(values) {
|
|
108
|
-
return build((raw) => {
|
|
109
|
-
if (values.includes(raw)) return {
|
|
110
|
-
ok: true,
|
|
111
|
-
value: raw
|
|
112
|
-
};
|
|
113
|
-
return {
|
|
114
|
-
ok: false,
|
|
115
|
-
message: `Expected one of ${values.join(", ")}, got "${raw}"`
|
|
116
|
-
};
|
|
117
|
-
}, empty());
|
|
118
|
-
}
|
|
119
|
-
/** JSON-parsed env value. Specify `T` to type the parsed result. */
|
|
120
|
-
function json() {
|
|
121
|
-
return build((raw) => {
|
|
122
|
-
try {
|
|
123
|
-
return {
|
|
124
|
-
ok: true,
|
|
125
|
-
value: JSON.parse(raw)
|
|
126
|
-
};
|
|
127
|
-
} catch (e) {
|
|
128
|
-
return {
|
|
129
|
-
ok: false,
|
|
130
|
-
message: `Invalid JSON: ${e.message}`
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}, empty());
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
1
|
+
import { a as oneOf, i as number, n as email, o as string, r as json, s as url, t as boolean } from "../env-helpers--wFmQ_5Q.mjs";
|
|
136
2
|
export { boolean, email, json, number, oneOf, string, url };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as oneOf, i as number, n as email, o as string, r as json, s as url, t as boolean } from "../env-helpers--wFmQ_5Q.mjs";
|
|
2
2
|
//#region src/runtime/env-public-client.ts
|
|
3
3
|
function getClientEnv() {
|
|
4
4
|
return import.meta.env;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as getRawRuntimeEnv } from "../env-raw-Cx8ElDdj.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { i as isInternalBinding, n as getRuntimeEnv } from "../env-Yz4HcvHs.mjs";
|
|
3
|
+
import { a as oneOf, i as number, n as email, o as string, r as json, s as url, t as boolean } from "../env-helpers--wFmQ_5Q.mjs";
|
|
4
4
|
//#region src/shared/env-mask.ts
|
|
5
5
|
/**
|
|
6
6
|
* Secret redaction helpers for env-validation output.
|
package/dist/runtime/env.mjs
CHANGED
|
@@ -1,78 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
//#region src/runtime/env.ts
|
|
4
|
-
/**
|
|
5
|
-
* Public runtime env API — exposed via "void/_env".
|
|
6
|
-
*
|
|
7
|
-
* All exports from this module are accessible to user code.
|
|
8
|
-
* Internal platform bindings (__VOID_*, __PROJECT_*) are filtered
|
|
9
|
-
* from getRuntimeEnv() and blocked in getRuntimeBinding().
|
|
10
|
-
*/
|
|
11
|
-
const runtimeRequestContext = new AsyncLocalStorage();
|
|
12
|
-
/** @internal Reuse a resource only within the current runtime request. */
|
|
13
|
-
function getRuntimeRequestResource(key, initialize) {
|
|
14
|
-
const scope = runtimeRequestContext.getStore();
|
|
15
|
-
if (!scope) throw new Error("env: Request-scoped resource is unavailable outside a runtime handler.");
|
|
16
|
-
if (scope.resources.has(key)) return scope.resources.get(key);
|
|
17
|
-
const resource = initialize();
|
|
18
|
-
scope.resources.set(key, resource);
|
|
19
|
-
return resource;
|
|
20
|
-
}
|
|
21
|
-
function withRuntimeEnv(env, fn) {
|
|
22
|
-
const resolved = asEnv(env);
|
|
23
|
-
if (!resolved) return fn();
|
|
24
|
-
if (runtimeRequestContext.getStore()) return envContext.run(resolved, fn);
|
|
25
|
-
const scope = { resources: /* @__PURE__ */ new Map() };
|
|
26
|
-
return envContext.run(resolved, () => runtimeRequestContext.run(scope, fn));
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Shared internal-binding predicate. A binding is framework-internal — and must
|
|
30
|
-
* never be exposed to user code — when it carries an internal prefix
|
|
31
|
-
* (`__VOID_`, `__PROJECT_`; always hidden) or is an exact-name internal (e.g.
|
|
32
|
-
* `ISR_CACHE`; hidden ONLY while ISR is active for the isolate). `rawEnv` is the
|
|
33
|
-
* unfiltered runtime env, consulted via {@link isIsrActive} to gate the
|
|
34
|
-
* exact-name check so a non-ISR app's own `ISR_CACHE` binding stays visible —
|
|
35
|
-
* matching the build-time `isr` gate on the generated `c.env` filter.
|
|
36
|
-
*
|
|
37
|
-
* Single source of truth for the runtime `env` filter here and the public
|
|
38
|
-
* `void/env` proxy (`env-public.ts`).
|
|
39
|
-
*/
|
|
40
|
-
function isInternalBinding(name, rawEnv) {
|
|
41
|
-
if (INTERNAL_BINDING_PREFIXES.some((p) => name.startsWith(p))) return true;
|
|
42
|
-
return isIsrActive(rawEnv) && INTERNAL_BINDING_EXACT_NAMES.includes(name);
|
|
43
|
-
}
|
|
44
|
-
function filterEnvProxy(env) {
|
|
45
|
-
return new Proxy(env, {
|
|
46
|
-
get(target, prop, receiver) {
|
|
47
|
-
if (typeof prop === "string" && isInternalBinding(prop, target)) return;
|
|
48
|
-
return Reflect.get(target, prop, receiver);
|
|
49
|
-
},
|
|
50
|
-
has(target, prop) {
|
|
51
|
-
if (typeof prop === "string" && isInternalBinding(prop, target)) return false;
|
|
52
|
-
return Reflect.has(target, prop);
|
|
53
|
-
},
|
|
54
|
-
ownKeys(target) {
|
|
55
|
-
return Reflect.ownKeys(target).filter((key) => typeof key !== "string" || !isInternalBinding(key, target));
|
|
56
|
-
},
|
|
57
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
58
|
-
if (typeof prop === "string" && isInternalBinding(prop, target)) return;
|
|
59
|
-
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/** Returns the runtime env with internal platform bindings hidden. */
|
|
64
|
-
function getRuntimeEnv() {
|
|
65
|
-
return filterEnvProxy(getRawRuntimeEnv());
|
|
66
|
-
}
|
|
67
|
-
function getRuntimeBinding(name) {
|
|
68
|
-
const raw = getRawRuntimeEnv();
|
|
69
|
-
if (isInternalBinding(name, raw)) return;
|
|
70
|
-
return raw[name];
|
|
71
|
-
}
|
|
72
|
-
function requireRuntimeBinding(name) {
|
|
73
|
-
const value = getRuntimeBinding(name);
|
|
74
|
-
if (value !== void 0 && value !== null) return value;
|
|
75
|
-
throw new Error(`env: Missing Cloudflare binding '${name}'.`);
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
1
|
+
import { a as requireRuntimeBinding, i as isInternalBinding, n as getRuntimeEnv, o as withRuntimeEnv, r as getRuntimeRequestResource, t as getRuntimeBinding } from "../env-Yz4HcvHs.mjs";
|
|
78
2
|
export { getRuntimeBinding, getRuntimeEnv, getRuntimeRequestResource, isInternalBinding, requireRuntimeBinding, withRuntimeEnv };
|
|
@@ -1,50 +1,3 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type MethodsOf<P extends keyof RouteMap> = keyof RouteMap[P] & string;
|
|
5
|
-
type InputOf<P extends keyof RouteMap, M extends MethodsOf<P>> = RouteMap[P][M] extends {
|
|
6
|
-
input: infer I;
|
|
7
|
-
} ? I : {};
|
|
8
|
-
type BodyOption<I> = "body" extends keyof I ? {
|
|
9
|
-
body: I["body" & keyof I];
|
|
10
|
-
} : {
|
|
11
|
-
body?: Record<string, unknown> | BodyInit | null;
|
|
12
|
-
};
|
|
13
|
-
type QueryOption<I> = "query" extends keyof I ? {
|
|
14
|
-
query: I["query" & keyof I];
|
|
15
|
-
} : {
|
|
16
|
-
query?: Record<string, string>;
|
|
17
|
-
};
|
|
18
|
-
type ParamsOption<I> = "params" extends keyof I ? {
|
|
19
|
-
params: I["params" & keyof I];
|
|
20
|
-
} : {
|
|
21
|
-
params?: Record<string, string>;
|
|
22
|
-
};
|
|
23
|
-
type StreamOptions<P extends keyof RouteMap, M extends MethodsOf<P>> = BodyOption<InputOf<P, M>> & QueryOption<InputOf<P, M>> & ParamsOption<InputOf<P, M>> & {
|
|
24
|
-
method?: M;
|
|
25
|
-
headers?: HeadersInit;
|
|
26
|
-
signal?: AbortSignal;
|
|
27
|
-
baseURL?: string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Consume an SSE endpoint as an async generator of text chunks.
|
|
31
|
-
*
|
|
32
|
-
* Parses Workers AI SSE format (`data: {"response":"chunk"}` + `data: [DONE]`)
|
|
33
|
-
* and plain text SSE (`data: some text`).
|
|
34
|
-
*
|
|
35
|
-
* ```ts
|
|
36
|
-
* import { fetchStream } from "void/client";
|
|
37
|
-
*
|
|
38
|
-
* for await (const chunk of fetchStream("/api/ai/chat", {
|
|
39
|
-
* method: "POST",
|
|
40
|
-
* body: { messages: [{ role: "user", content: "Hello" }] },
|
|
41
|
-
* })) {
|
|
42
|
-
* output += chunk;
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @yields {string} Text chunks from SSE data frames.
|
|
47
|
-
*/
|
|
48
|
-
export declare function fetchStream<P extends keyof RouteMap & string, M extends MethodsOf<P> = "POST" extends MethodsOf<P> ? "POST" : MethodsOf<P>>(path: P, options?: StreamOptions<P, M>): AsyncGenerator<string, void, undefined>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { FetchError as StreamError };
|
|
2
|
+
import { t as fetchStream } from "../fetch-stream-Bjf0hoZb.mjs";
|
|
3
|
+
export { FetchError as StreamError, fetchStream };
|
|
@@ -1,81 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Consume an SSE endpoint as an async generator of text chunks.
|
|
5
|
-
*
|
|
6
|
-
* Parses Workers AI SSE format (`data: {"response":"chunk"}` + `data: [DONE]`)
|
|
7
|
-
* and plain text SSE (`data: some text`).
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* import { fetchStream } from "void/client";
|
|
11
|
-
*
|
|
12
|
-
* for await (const chunk of fetchStream("/api/ai/chat", {
|
|
13
|
-
* method: "POST",
|
|
14
|
-
* body: { messages: [{ role: "user", content: "Hello" }] },
|
|
15
|
-
* })) {
|
|
16
|
-
* output += chunk;
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @yields {string} Text chunks from SSE data frames.
|
|
21
|
-
*/
|
|
22
|
-
async function* fetchStream(path, options) {
|
|
23
|
-
let url = path;
|
|
24
|
-
if (options?.params) for (const [key, value] of Object.entries(options.params)) url = url.replace(`:${key}`, encodeURIComponent(value));
|
|
25
|
-
const body = (await ofetch.raw(url, {
|
|
26
|
-
method: options?.method ?? "POST",
|
|
27
|
-
body: options?.body,
|
|
28
|
-
query: options?.query,
|
|
29
|
-
headers: options?.headers,
|
|
30
|
-
signal: options?.signal,
|
|
31
|
-
baseURL: options?.baseURL,
|
|
32
|
-
responseType: "stream"
|
|
33
|
-
}))._data;
|
|
34
|
-
if (!body) return;
|
|
35
|
-
const reader = body.getReader();
|
|
36
|
-
const decoder = new TextDecoder();
|
|
37
|
-
let buffer = "";
|
|
38
|
-
try {
|
|
39
|
-
while (true) {
|
|
40
|
-
const { done, value } = await reader.read();
|
|
41
|
-
if (done) break;
|
|
42
|
-
buffer += decoder.decode(value, { stream: true });
|
|
43
|
-
const lines = buffer.split("\n");
|
|
44
|
-
buffer = lines.pop();
|
|
45
|
-
for (const line of lines) {
|
|
46
|
-
const trimmed = line.trim();
|
|
47
|
-
if (!trimmed || trimmed.startsWith(":")) continue;
|
|
48
|
-
if (trimmed.startsWith("data: ")) {
|
|
49
|
-
const data = trimmed.slice(6);
|
|
50
|
-
if (data === "[DONE]") return;
|
|
51
|
-
try {
|
|
52
|
-
const parsed = JSON.parse(data);
|
|
53
|
-
if (typeof parsed.response === "string") {
|
|
54
|
-
yield parsed.response;
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if ("response" in parsed) continue;
|
|
58
|
-
} catch {}
|
|
59
|
-
yield data;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (buffer.trim()) {
|
|
64
|
-
const trimmed = buffer.trim();
|
|
65
|
-
if (trimmed.startsWith("data: ")) {
|
|
66
|
-
const data = trimmed.slice(6);
|
|
67
|
-
if (data !== "[DONE]") try {
|
|
68
|
-
const parsed = JSON.parse(data);
|
|
69
|
-
if (typeof parsed.response === "string") yield parsed.response;
|
|
70
|
-
else if (!("response" in parsed)) yield data;
|
|
71
|
-
} catch {
|
|
72
|
-
yield data;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
} finally {
|
|
77
|
-
reader.releaseLock();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
1
|
+
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
+
import { t as fetchStream } from "../fetch-stream-AOByI7Ki.mjs";
|
|
81
3
|
export { FetchError as StreamError, fetchStream };
|
package/dist/runtime/fetch.d.mts
CHANGED
|
@@ -1,58 +1,3 @@
|
|
|
1
1
|
import { t as FetchError } from "../fetch-error-Sp1R4mZv.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type MethodsOf<P extends keyof RouteMap> = keyof RouteMap[P] & string;
|
|
5
|
-
type DefaultMethod<P extends keyof RouteMap> = "GET" extends MethodsOf<P> ? "GET" : never;
|
|
6
|
-
type RouteEntry<P extends keyof RouteMap, M extends MethodsOf<P>> = RouteMap[P][M] extends {
|
|
7
|
-
input: infer I;
|
|
8
|
-
output: infer O;
|
|
9
|
-
} ? {
|
|
10
|
-
input: I;
|
|
11
|
-
output: O;
|
|
12
|
-
} : {
|
|
13
|
-
input: {};
|
|
14
|
-
output: unknown;
|
|
15
|
-
};
|
|
16
|
-
type OutputOf<P extends keyof RouteMap, M extends MethodsOf<P>> = RouteEntry<P, M>["output"];
|
|
17
|
-
type InputOf<P extends keyof RouteMap, M extends MethodsOf<P>> = RouteEntry<P, M>["input"];
|
|
18
|
-
type BodyOption<I> = "body" extends keyof I ? {
|
|
19
|
-
body: I["body" & keyof I];
|
|
20
|
-
} : {
|
|
21
|
-
body?: Record<string, unknown> | BodyInit | null;
|
|
22
|
-
};
|
|
23
|
-
type QueryOption<I> = "query" extends keyof I ? {
|
|
24
|
-
query: I["query" & keyof I];
|
|
25
|
-
} : {
|
|
26
|
-
query?: Record<string, string>;
|
|
27
|
-
};
|
|
28
|
-
type ParamsOption<I> = "params" extends keyof I ? {
|
|
29
|
-
params: I["params" & keyof I];
|
|
30
|
-
} : {
|
|
31
|
-
params?: Record<string, string>;
|
|
32
|
-
};
|
|
33
|
-
type HasRequiredInput<P extends keyof RouteMap, M extends MethodsOf<P>> = "body" extends keyof InputOf<P, M> ? true : "query" extends keyof InputOf<P, M> ? true : "params" extends keyof InputOf<P, M> ? true : false;
|
|
34
|
-
type FetchOptions<P extends keyof RouteMap, M extends MethodsOf<P>> = BodyOption<InputOf<P, M>> & QueryOption<InputOf<P, M>> & ParamsOption<InputOf<P, M>> & {
|
|
35
|
-
method?: M;
|
|
36
|
-
headers?: HeadersInit;
|
|
37
|
-
signal?: AbortSignal;
|
|
38
|
-
baseURL?: string;
|
|
39
|
-
retry?: number;
|
|
40
|
-
timeout?: number;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Typed fetch client for Void API routes.
|
|
44
|
-
*
|
|
45
|
-
* Built on top of ofetch. Supports baseURL, retry, timeout, and all
|
|
46
|
-
* ofetch features while providing full route type safety.
|
|
47
|
-
*
|
|
48
|
-
* ```ts
|
|
49
|
-
* import { fetch } from "void/client";
|
|
50
|
-
*
|
|
51
|
-
* const users = await fetch("/api/users"); // typed!
|
|
52
|
-
* const user = await fetch("/api/users/:id", { params: { id: "1" } });
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare function fetch<P extends keyof RouteMap & string>(path: HasRequiredInput<P, DefaultMethod<P>> extends false ? P : never): Promise<OutputOf<P, DefaultMethod<P>>>;
|
|
56
|
-
export declare function fetch<P extends keyof RouteMap & string, M extends MethodsOf<P> = DefaultMethod<P>>(path: P, options: FetchOptions<P, M>): Promise<OutputOf<P, M>>;
|
|
57
|
-
//#endregion
|
|
58
|
-
export { FetchError };
|
|
2
|
+
import { t as fetch } from "../fetch-_SeGZao9.mjs";
|
|
3
|
+
export { FetchError, fetch };
|
package/dist/runtime/fetch.mjs
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
async function fetch(path, options) {
|
|
4
|
-
let url = path;
|
|
5
|
-
if (options?.params) for (const [key, value] of Object.entries(options.params)) url = url.replace(`:${key}`, encodeURIComponent(value));
|
|
6
|
-
return ofetch(url, {
|
|
7
|
-
method: options?.method ?? "GET",
|
|
8
|
-
body: options?.body,
|
|
9
|
-
query: options?.query,
|
|
10
|
-
headers: options?.headers,
|
|
11
|
-
signal: options?.signal,
|
|
12
|
-
baseURL: options?.baseURL,
|
|
13
|
-
retry: options?.retry,
|
|
14
|
-
timeout: options?.timeout
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
1
|
+
import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
|
|
2
|
+
import { t as fetch } from "../fetch-CXDChK7B.mjs";
|
|
18
3
|
export { FetchError, fetch };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, n as CloudBindings, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, w as ValidationError, y as defineScheduled } from "../handler-
|
|
2
|
+
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, n as CloudBindings, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, w as ValidationError, y as defineScheduled } from "../handler-BXJTXd02.mjs";
|
|
3
3
|
export { BasicAuthOptions, CloudBindings, CloudContext, CloudContextVariables, CloudEnv, type Deferred, type HandlerInput, type InferProps, QueueBatch, QueueMessage, QueueRetryOptions, RenderAssetTags, TypedHandler, TypedQueueHandler, ValidationError, type ValidatorSlots, VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled };
|