void 0.10.13 → 0.20.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/AGENTS_TEMPLATE.md +6 -0
- package/{skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md → LICENSE} +1 -1
- package/README.md +34 -8
- package/dist/{auth-qgMlYp7Z.d.mts → auth-DkcFflXV.d.mts} +10 -11
- package/dist/auth-W9WII-mN.mjs +630 -0
- package/dist/{auth-cmd-BqsdZJp5.mjs → auth-cmd-CAH62yDU.mjs} +4 -3
- package/dist/{auth-migrations-BTZ-ATvQ.mjs → auth-migrations-9vif1uj8.mjs} +53 -12
- package/dist/{better-auth-shared-BQooDxbw.mjs → better-auth-shared-CYw1T3k4.mjs} +7 -10
- package/dist/{better-auth-shared-DealXecJ.d.mts → better-auth-shared-DSCeohOK.d.mts} +10 -5
- package/dist/{build-cmd-Bujrv5q-.mjs → build-cmd-CJvZvPQO.mjs} +6 -4
- package/dist/{cache-C11V8Fxq.mjs → cache-BlNeQjuP.mjs} +9 -5
- package/dist/{cancel-deploy-fwFYF04b.mjs → cancel-deploy-CmlAZ9P6.mjs} +3 -2
- package/dist/cf-access-AJ1ehiFR.mjs +42 -0
- package/dist/cf-access-DsSsZUPr.mjs +67 -0
- package/dist/cli/cli.d.mts +1 -1
- package/dist/cli/cli.mjs +1735 -165
- package/dist/cli/env-schema-probe.d.mts +48 -61
- package/dist/cli/env-schema-probe.mjs +10 -58
- package/dist/{client-Gb71-XkG.mjs → client-Clirrol3.mjs} +120 -463
- package/dist/cloudflare-auth-B1QtTO1b.mjs +217 -0
- package/dist/cloudflare-cmd-B6_OZx2V.mjs +62 -0
- package/dist/cloudflare-connect-j5D4hhrG.mjs +56 -0
- package/dist/cloudflare-operations-CPTpRW6d.mjs +566 -0
- package/dist/{config-qHGgPuWT.mjs → config-BQFq7QvD.mjs} +75 -41
- package/dist/{config-CutEMNGJ.mjs → config-NOG_U1aK.mjs} +10 -15
- package/dist/connect-C04Wdy_h.mjs +79 -0
- package/dist/{create-project-DsYvl3TB.mjs → create-project-ChGZ1DFd.mjs} +26 -16
- package/dist/database-provider.d.mts +21 -0
- package/dist/database-provider.mjs +6 -0
- package/dist/{db-C0i0sYMS.mjs → db-D2d_mUsB.mjs} +612 -117
- package/dist/{delete-mh6p-zkQ.mjs → delete-D8GigDk8.mjs} +9 -6
- package/dist/{deploy-jBJT1fUT.mjs → deploy-iXZ3F0N6.mjs} +3252 -1995
- package/dist/dev-inbox-DkgRWLkW.mjs +307 -0
- package/dist/{discover-CJHyvYfR.mjs → discover-xvfrgJeo.mjs} +3 -3
- package/dist/{magic-string.es-ZQjdJFFn.mjs → dist-BR1quN_w.mjs} +570 -216
- package/dist/{dist-DaKKDf8D.mjs → dist-BrsS7cai.mjs} +17 -2
- package/dist/{dist-BuiRJkTd.mjs → dist-m40_XgNh.mjs} +48 -33
- package/dist/{domain-DiaNQbrl.mjs → domain-B1VmoSr0.mjs} +41 -4
- package/dist/dotenv-VQxupEUv.mjs +181 -0
- package/dist/edge.d.mts +2 -0
- package/dist/edge.mjs +2 -0
- package/dist/email-Ce6SQq-i.mjs +182 -0
- package/dist/email-uKyQYUVY.mjs +1016 -0
- package/dist/{entry-D7yy4xVH.mjs → entry-DU3oDoQ3.mjs} +2 -2
- package/dist/env-BcQzYgoG.mjs +73 -0
- package/dist/env-D4Emu-M_.mjs +95 -0
- package/dist/env-helpers-CyKtOBpj.d.mts +22 -0
- package/dist/env-public-D_6u46fX.d.mts +135 -0
- package/dist/{env-types-QBj-ndax.mjs → env-types-BNPhro-M.mjs} +2 -2
- package/dist/{env-validation-Dea3v3ej.mjs → env-validation-ENpMy6Ez.mjs} +68 -122
- package/dist/{gen-BzXf3Jh2.mjs → gen-DI2YwdBM.mjs} +70 -15
- package/dist/generate-RTK8_kK1.mjs +47 -0
- package/dist/{github-cmd-DKcGUNsj.mjs → github-cmd-xItS5Zwf.mjs} +39 -31
- package/dist/{handler-Cjh8uM3Y.d.mts → handler-D1hLsObx.d.mts} +124 -122
- package/dist/{head-nmvOgFjd.d.mts → head-Do8P4puT.d.mts} +9 -8
- package/dist/{headers-ChAADPQu.mjs → headers-D8QfRX9Y.mjs} +12 -10
- package/dist/inbound-2d0zi2yS.mjs +706 -0
- package/dist/inbound-afAcWeQ9.d.mts +363 -0
- package/dist/index.d.mts +61 -34
- package/dist/index.mjs +1012 -293
- package/dist/{init-7JCAcKNQ.mjs → init-BD-9THgn.mjs} +329 -271
- package/dist/link-RMdgjF1v.mjs +52 -0
- package/dist/{list-CPwFDZ_c.mjs → list-3F52R_yO.mjs} +37 -5
- package/dist/{runner-kapo9aPs.mjs → local-d1-D2I6Ox5F.mjs} +116 -6
- package/dist/{login-BT3H8PN3.mjs → login-pV69H-ZO.mjs} +17 -15
- package/dist/{logs-Bt313ax7.mjs → logs-DFHHD6wE.mjs} +16 -2
- package/dist/mime-BJD7d_qL.mjs +1216 -0
- package/dist/neon-DHwd2zvC.mjs +54 -0
- package/dist/{node-pRg81HqV.mjs → node-Dk3H2jmU.mjs} +29 -8
- package/dist/operator-cmd-DYWRbWUA.mjs +348 -0
- package/dist/{agents-CtgBYqld.mjs → output-tFQLLj26.mjs} +676 -211
- package/dist/{package-json-Cx1osYo6.mjs → package-json-CPoWX79C.mjs} +1 -1
- package/dist/pages/client.d.mts +43 -41
- package/dist/pages/client.mjs +40 -33
- package/dist/pages/head-client.d.mts +10 -12
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +37 -14
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +25 -27
- package/dist/pages/islands-plugin.mjs +6 -4
- package/dist/pages/prefetch.d.mts +6 -7
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -1
- package/dist/pages/serialize.d.mts +7 -8
- package/dist/platform-cmd-DxJ2FRwR.mjs +123 -0
- package/dist/platform-domain-ChvbJkdy.mjs +228 -0
- package/dist/platform-lifecycle-DN4MzJF_.mjs +4450 -0
- package/dist/platform-management-Db2PXw0B.mjs +698 -0
- package/dist/platform-recovery-C_YO-tIs.mjs +99 -0
- package/dist/{plugin-inference-DMeavIJ6.mjs → plugin-inference-BDRfZngg.mjs} +35 -19
- package/dist/prepare-BfJvFUtJ.mjs +14 -0
- package/dist/{prepare-BvvgAz-3.mjs → prepare-CBetXvsN.mjs} +15 -24
- package/dist/{preset-BjyR3lzz.mjs → preset-lAy0B0BQ.mjs} +25 -212
- package/dist/{project-cmd-D_w-4w5B.mjs → project-cmd-Mo0V9yKS.mjs} +25 -12
- package/dist/{project-paths-BQd7OmIo.mjs → project-paths-SK8nMHPp.mjs} +3 -1
- package/dist/{project-tsconfig-B-QtXjLQ.mjs → project-tsconfig-Ql2XsSQp.mjs} +2 -2
- package/dist/{protocol-Bnb0LFp3.d.mts → protocol-C-pqYJjE.d.mts} +3 -4
- package/dist/{provision-CPx2ZxsH.mjs → provision-Blnstcm2.mjs} +78 -45
- package/dist/r2-conditions-D1Wk8i7b.mjs +30 -0
- package/dist/{requests-B8sZxaFM.mjs → requests-BcKOVpRg.mjs} +5 -3
- package/dist/{resolve-project-BBMtLLV9.mjs → resolve-project--Vxawf7z.mjs} +2 -2
- package/dist/rollback-Bx85-0xh.mjs +166 -0
- package/dist/{rolldown-runtime-DJK8HYOj.mjs → rolldown-runtime-rQ84J-ij.mjs} +1 -1
- package/dist/{route-types-z1jtHEi_.mjs → route-types-Da-DpyUp.mjs} +77 -25
- package/dist/routes-stub.d.mts +22 -23
- package/dist/runner-mysql-7BPUNGmL.mjs +61 -0
- package/dist/{runner-pg-CHM76xuC.mjs → runner-pg-BkEza-dX.mjs} +18 -6
- package/dist/runtime/ai.d.mts +21 -14
- package/dist/runtime/ai.mjs +5 -4
- package/dist/runtime/auth-client-react.d.mts +3 -5
- package/dist/runtime/auth-client-solid.d.mts +3 -5
- package/dist/runtime/auth-client-svelte.d.mts +3 -5
- package/dist/runtime/auth-client-vue.d.mts +3 -5
- package/dist/runtime/auth-client.d.mts +3 -5
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +10 -0
- package/dist/runtime/better-auth-mysql.mjs +49 -0
- package/dist/runtime/better-auth-pg.d.mts +8 -9
- package/dist/runtime/better-auth-pg.mjs +2 -2
- package/dist/runtime/better-auth.d.mts +8 -9
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/db-mysql.d.mts +2 -0
- package/dist/runtime/db-mysql.mjs +1 -0
- package/dist/runtime/db.d.mts +10 -11
- package/dist/runtime/durable.d.mts +47 -0
- package/dist/runtime/durable.mjs +146 -0
- package/dist/runtime/email/testing.d.mts +112 -0
- package/dist/runtime/email/testing.mjs +283 -0
- package/dist/runtime/email.d.mts +30 -0
- package/dist/runtime/email.mjs +573 -0
- package/dist/runtime/env-helpers.d.mts +2 -2
- package/dist/runtime/env-helpers.mjs +5 -42
- package/dist/runtime/env-public-client.d.mts +10 -11
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +104 -49
- package/dist/runtime/env.d.mts +19 -18
- package/dist/runtime/env.mjs +15 -2
- package/dist/runtime/fetch-stream.d.mts +20 -21
- package/dist/runtime/fetch.d.mts +15 -16
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/isr.d.mts +21 -22
- package/dist/runtime/isr.mjs +26 -8
- package/dist/runtime/kv.d.mts +9 -10
- package/dist/runtime/live-client.d.mts +5 -7
- package/dist/runtime/live-client.mjs +9 -7
- package/dist/runtime/live-server.d.mts +4 -5
- package/dist/runtime/live.d.mts +22 -24
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.d.mts +16 -17
- package/dist/runtime/migration-handler-mysql.d.mts +4 -0
- package/dist/runtime/migration-handler-mysql.mjs +81 -0
- package/dist/runtime/migration-handler-pg.d.mts +2 -4
- package/dist/runtime/migration-handler.d.mts +5 -6
- package/dist/runtime/migration-handler.mjs +4 -3
- package/dist/runtime/queues.d.mts +3 -4
- package/dist/runtime/queues.mjs +2 -1
- package/dist/runtime/remote/binding-handler.d.mts +10 -12
- package/dist/runtime/remote/binding-handler.mjs +24 -3
- package/dist/runtime/remote/index.d.mts +5 -6
- package/dist/runtime/remote/index.mjs +21 -18
- package/dist/runtime/response.d.mts +10 -11
- package/dist/runtime/sandbox.d.mts +56 -55
- package/dist/runtime/sandbox.mjs +57 -49
- package/dist/runtime/schema-mysql.d.mts +1 -0
- package/dist/runtime/schema-mysql.mjs +2 -0
- package/dist/runtime/seed.d.mts +14 -9
- package/dist/runtime/sse-client.d.mts +6 -7
- package/dist/runtime/sse.d.mts +11 -12
- package/dist/runtime/storage.d.mts +3 -4
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +12 -12
- package/dist/runtime/ws-server.mjs +32 -4
- package/dist/runtime/ws.d.mts +19 -21
- package/dist/{scan-ChWt4pX1.mjs → scan-BMH4rzlv.mjs} +42 -19
- package/dist/{scan-NU4xKGci.mjs → scan-CpK-57ug.mjs} +5 -4
- package/dist/{secret-Dt32J6RI.mjs → secret-ByhJ9AMl.mjs} +62 -5
- package/dist/{skills-CLjN0uUO.mjs → skills-Q46GZMO-.mjs} +6 -4
- package/dist/sqlite-validation-BzKMWnO4.mjs +25 -0
- package/dist/{standard-schema-DJ0HW7QP.d.mts → standard-schema-Fo_vCAZh.d.mts} +6 -6
- package/dist/{subcommand-prompt-BzV8iQZo.mjs → subcommand-prompt-WfySCQ7S.mjs} +67 -48
- package/dist/sveltekit.d.mts +12 -11
- package/dist/sveltekit.mjs +1 -1
- package/dist/types-BAp5AEBU.d.mts +79 -0
- package/dist/types-CKWnYgfy.d.mts +1 -0
- package/dist/{validate-Cw_RLeTj.mjs → validate-tBBN_dXH.mjs} +4 -3
- package/dist/wrangler--imS8n0d.mjs +1796 -0
- package/dist/{yarn-pnp-DJn3SAHF.mjs → yarn-pnp-DxSInkzL.mjs} +1 -1
- package/package.json +79 -65
- package/schema.json +22 -3
- package/skills/void/SKILL.md +59 -2
- package/skills/void/docs/guide/ai.md +32 -14
- package/skills/void/docs/guide/app-types.md +6 -6
- package/skills/void/docs/guide/auth.md +14 -16
- package/skills/void/docs/guide/database/d1.md +6 -0
- package/skills/void/docs/guide/database/mysql.md +60 -0
- package/skills/void/docs/guide/database/postgresql.md +14 -9
- package/skills/void/docs/guide/database.md +39 -26
- package/skills/void/docs/guide/deployment.md +99 -25
- package/skills/void/docs/guide/durable-state.md +140 -0
- package/skills/void/docs/guide/edge/headers.md +5 -5
- package/skills/void/docs/guide/edge/prerendering.md +2 -0
- package/skills/void/docs/guide/edge/revalidation.md +21 -6
- package/skills/void/docs/guide/edge/rewrites.md +18 -14
- package/skills/void/docs/guide/edge/static-assets.md +12 -10
- package/skills/void/docs/guide/email.md +640 -0
- package/skills/void/docs/guide/env-migration.md +109 -0
- package/skills/void/docs/guide/env-vars.md +70 -248
- package/skills/void/docs/guide/index.md +15 -17
- package/skills/void/docs/guide/jobs.md +8 -5
- package/skills/void/docs/guide/live.md +7 -15
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +8 -4
- package/skills/void/docs/guide/pages-routing/islands.md +3 -3
- package/skills/void/docs/guide/pages-routing/loaders.md +6 -4
- package/skills/void/docs/guide/pages-routing/overview.md +7 -7
- package/skills/void/docs/guide/platform-administration.md +212 -0
- package/skills/void/docs/guide/platform-development.md +264 -0
- package/skills/void/docs/guide/queues.md +10 -10
- package/skills/void/docs/guide/quickstart.md +46 -67
- package/skills/void/docs/guide/remote-dev.md +8 -6
- package/skills/void/docs/guide/sandboxes.md +33 -16
- package/skills/void/docs/guide/self-hosted-platform.md +553 -0
- package/skills/void/docs/guide/server-routing.md +5 -5
- package/skills/void/docs/guide/sse.md +4 -4
- package/skills/void/docs/guide/ssg.md +5 -3
- package/skills/void/docs/guide/storage.md +2 -2
- package/skills/void/docs/guide/websockets.md +15 -7
- package/skills/void/docs/index.md +3 -3
- package/skills/void/docs/integrations/agents.md +6 -64
- package/skills/void/docs/integrations/cloudflare.md +165 -146
- package/skills/void/docs/integrations/frameworks/analog.md +4 -4
- package/skills/void/docs/integrations/frameworks/astro.md +5 -5
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -5
- package/skills/void/docs/integrations/frameworks/overview.md +3 -3
- package/skills/void/docs/integrations/frameworks/react-router.md +3 -3
- package/skills/void/docs/integrations/frameworks/sveltekit.md +3 -3
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +2 -2
- package/skills/void/docs/integrations/nodejs-bun-deno.md +11 -4
- package/skills/void/docs/reference/api.md +42 -6
- package/skills/void/docs/reference/cli.md +665 -160
- package/skills/void/docs/reference/config.md +67 -27
- package/skills/void/docs/reference/resource-inference.md +13 -9
- package/skills/void/docs/reference/structure.md +9 -11
- package/AGENT_PROMPT.md +0 -19
- package/dist/cf-access-Bqw81xAf.mjs +0 -22
- package/dist/env-CZy5MorI.mjs +0 -299
- package/dist/env-helpers-z4stu8uc.d.mts +0 -52
- package/dist/env-mask-Dd47NbR6.mjs +0 -90
- package/dist/env-public-BfiLcMBk.d.mts +0 -140
- package/dist/link-CdGHSIy-.mjs +0 -45
- package/dist/mcp-DoM3_nhd.mjs +0 -377
- package/dist/project-paths-GpziKeQQ.d.mts +0 -25
- package/dist/providers-BNKRacMr.d.mts +0 -7
- package/dist/proxy-D-3_D-Gl.mjs +0 -5
- package/dist/rollback-CkvTFXx5.mjs +0 -90
- package/dist/runtime/isr-cache.d.mts +0 -207
- package/dist/runtime/isr-cache.mjs +0 -523
- package/dist/types-lLjNE9Qp.d.mts +0 -51
- package/getting-started-prompt.txt +0 -28
- package/skills/void/command/void.md +0 -7
- package/skills/void/docs/integrations/auth-providers.md +0 -0
- package/skills/void/docs/integrations/payment-processors.md +0 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +0 -408
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +0 -5
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +0 -103
- package/skills/void/docs/node_modules/oxc-minify/README.md +0 -78
- package/skills/void/docs/node_modules/reka-ui/README.md +0 -80
- package/skills/void/docs/node_modules/vitepress/README.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +0 -49
- package/skills/void/docs/node_modules/vitepress/template/index.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +0 -85
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +0 -101
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +0 -19
- package/skills/void/docs/node_modules/void/CLAUDE.md +0 -221
- package/skills/void/docs/node_modules/void/README.md +0 -90
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +0 -685
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +0 -396
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +0 -219
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +0 -37
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +0 -189
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +0 -143
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +0 -1272
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +0 -19
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +0 -22
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +0 -153
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +0 -565
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +0 -127
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +0 -600
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +0 -386
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +0 -95
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-footnote/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +0 -58
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +0 -32
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +0 -99
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +0 -79
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +0 -44
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +0 -65
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +0 -403
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +0 -48
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +0 -85
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +0 -452
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +0 -325
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +0 -398
- package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +0 -96
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +0 -183
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +0 -94
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +0 -63
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +0 -191
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +0 -175
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +0 -76
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +0 -7
- package/skills/void/docs/node_modules/void/test/e2e/README.md +0 -85
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
import { i as normalizeEmail, n as MimeError, r as buildMime } from "../mime-BJD7d_qL.mjs";
|
|
2
|
+
import { a as DEV_INBOX_ENV_VAR, b as serializeCapturedMessage, c as DEV_INBOX_TOKEN_ENV_VAR, d as captureMessage, h as hasActiveSink, i as DEV_INBOX_CAPTURE_URL, p as dispatchToSinks } from "../dev-inbox-DkgRWLkW.mjs";
|
|
3
|
+
import { a as getRawRuntimeEnv } from "../env-raw-Cx8ElDdj.mjs";
|
|
4
|
+
import { a as defineEmail, c as parseEmail, i as createMessageProxy, l as replyEmail, o as enactEmailActions, r as ParseEmailError, s as isForwardableEmailMessage } from "../inbound-2d0zi2yS.mjs";
|
|
5
|
+
//#region src/runtime/email.ts
|
|
6
|
+
const VALID_SLUG = /^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$/;
|
|
7
|
+
function makeError(code, message, cause) {
|
|
8
|
+
return cause === void 0 ? {
|
|
9
|
+
code,
|
|
10
|
+
message
|
|
11
|
+
} : {
|
|
12
|
+
code,
|
|
13
|
+
message,
|
|
14
|
+
cause
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function tryGetRawRuntimeEnv() {
|
|
18
|
+
try {
|
|
19
|
+
return getRawRuntimeEnv();
|
|
20
|
+
} catch {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function readProjectSlug() {
|
|
25
|
+
const raw = tryGetRawRuntimeEnv()?.__VOID_PROJECT_SLUG;
|
|
26
|
+
if (typeof raw !== "string" || raw.length === 0) return;
|
|
27
|
+
return VALID_SLUG.test(raw) ? raw : void 0;
|
|
28
|
+
}
|
|
29
|
+
function readEmailDomain() {
|
|
30
|
+
const raw = tryGetRawRuntimeEnv()?.__VOID_EMAIL_DOMAIN;
|
|
31
|
+
return typeof raw === "string" && raw.length > 0 ? raw : void 0;
|
|
32
|
+
}
|
|
33
|
+
function readEmailFrom() {
|
|
34
|
+
const raw = tryGetRawRuntimeEnv()?.__VOID_EMAIL_FROM;
|
|
35
|
+
return typeof raw === "string" && raw.length > 0 ? raw : void 0;
|
|
36
|
+
}
|
|
37
|
+
const SEND_EMAIL_BINDING_NAME = "SEND_EMAIL";
|
|
38
|
+
function resolveSendEmailBinding(env) {
|
|
39
|
+
const binding = env?.[SEND_EMAIL_BINDING_NAME];
|
|
40
|
+
if (typeof binding !== "object" || binding === null) return;
|
|
41
|
+
return typeof binding.send === "function" ? binding : void 0;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Map an error thrown by the `send_email` binding to a framework code.
|
|
45
|
+
*
|
|
46
|
+
* Email Service throws `Error`s carrying a `code` (the `E_*` table in
|
|
47
|
+
* Cloudflare's Workers API reference); the older Email Routing sender
|
|
48
|
+
* throws message-only errors, so the destination-verification phrasing the
|
|
49
|
+
* platform proxy already keys on is kept as a fallback. Anything else is
|
|
50
|
+
* `UPSTREAM_ERROR` with the original error as `cause` — the framework has
|
|
51
|
+
* no way to act on a delivery failure or a service outage beyond
|
|
52
|
+
* reporting it.
|
|
53
|
+
*
|
|
54
|
+
* The platform proxy's `classifyUpstream` mirrors this table for its own
|
|
55
|
+
* binding, except the two sender codes: there `from` is pinned to the
|
|
56
|
+
* project sender, so a sender failure is the platform's to fix and stays
|
|
57
|
+
* `UPSTREAM_ERROR`. Keep the recipient and limit rows in lockstep.
|
|
58
|
+
*/
|
|
59
|
+
function classifyBindingError(e) {
|
|
60
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
61
|
+
switch (typeof e?.code === "string" ? e.code : "") {
|
|
62
|
+
case "E_RECIPIENT_NOT_ALLOWED": return makeError("UNVERIFIED_DESTINATION", message, e);
|
|
63
|
+
case "E_SENDER_NOT_VERIFIED":
|
|
64
|
+
case "E_SENDER_DOMAIN_NOT_AVAILABLE": return makeError("INVALID_FROM", message, e);
|
|
65
|
+
case "E_RATE_LIMIT_EXCEEDED":
|
|
66
|
+
case "E_DAILY_LIMIT_EXCEEDED": return makeError("QUOTA_EXCEEDED", message, e);
|
|
67
|
+
}
|
|
68
|
+
if (UNVERIFIED_DESTINATION_RE.test(message)) return makeError("UNVERIFIED_DESTINATION", message, e);
|
|
69
|
+
return makeError("UPSTREAM_ERROR", message, e);
|
|
70
|
+
}
|
|
71
|
+
const UNVERIFIED_DESTINATION_RE = /^[^\n]{0,200}destination address[^\n]{0,200}not (?:yet )?verified/i;
|
|
72
|
+
function bytesToReadableStream(bytes) {
|
|
73
|
+
return new ReadableStream({ start(controller) {
|
|
74
|
+
controller.enqueue(bytes);
|
|
75
|
+
controller.close();
|
|
76
|
+
} });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Deliver through the worker's own `SEND_EMAIL` binding. One `EmailMessage`
|
|
80
|
+
* per recipient, every recipient attempted, and the same `deliveries` shape
|
|
81
|
+
* the proxy returns so a caller retries the failed ones the same way in both
|
|
82
|
+
* modes. The stream is rebuilt per send because a `ReadableStream` is
|
|
83
|
+
* one-shot.
|
|
84
|
+
*/
|
|
85
|
+
async function sendViaBinding(binding, from, recipients, raw, fallbackId) {
|
|
86
|
+
let EmailMessage;
|
|
87
|
+
try {
|
|
88
|
+
({EmailMessage} = await import("cloudflare:email"));
|
|
89
|
+
} catch (e) {
|
|
90
|
+
return err("UPSTREAM_ERROR", `email: SEND_EMAIL is bound but cloudflare:email could not be loaded: ${e instanceof Error ? e.message : String(e)}`, e);
|
|
91
|
+
}
|
|
92
|
+
const deliveries = [];
|
|
93
|
+
for (const recipient of recipients) try {
|
|
94
|
+
const result = await binding.send(new EmailMessage(from, recipient, bytesToReadableStream(raw)));
|
|
95
|
+
const mid = typeof result?.messageId === "string" ? result.messageId : "";
|
|
96
|
+
deliveries.push({
|
|
97
|
+
recipient,
|
|
98
|
+
ok: true,
|
|
99
|
+
messageId: mid || fallbackId
|
|
100
|
+
});
|
|
101
|
+
} catch (e) {
|
|
102
|
+
deliveries.push({
|
|
103
|
+
recipient,
|
|
104
|
+
ok: false,
|
|
105
|
+
error: classifyBindingError(e)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (deliveries.some((d) => !d.ok)) return {
|
|
109
|
+
ok: false,
|
|
110
|
+
deliveries
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
ok: true,
|
|
114
|
+
ids: deliveries.map((d) => ({
|
|
115
|
+
recipient: d.recipient,
|
|
116
|
+
messageId: d.messageId
|
|
117
|
+
}))
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Dedup recipients by lowercased email (CF won't collapse duplicate
|
|
122
|
+
* envelopes for us, and double-billing the quota for the same recipient
|
|
123
|
+
* is worse than the rare case where a user actually wanted Cc + Bcc to
|
|
124
|
+
* the same address — which doesn't change delivery semantics anyway).
|
|
125
|
+
*/
|
|
126
|
+
function uniqueRecipients(normalized) {
|
|
127
|
+
const seen = /* @__PURE__ */ new Set();
|
|
128
|
+
const recipients = [];
|
|
129
|
+
for (const r of [
|
|
130
|
+
...normalized.to,
|
|
131
|
+
...normalized.cc,
|
|
132
|
+
...normalized.bcc
|
|
133
|
+
]) {
|
|
134
|
+
const lower = r.email.toLowerCase();
|
|
135
|
+
if (seen.has(lower)) continue;
|
|
136
|
+
seen.add(lower);
|
|
137
|
+
recipients.push(lower);
|
|
138
|
+
}
|
|
139
|
+
return recipients;
|
|
140
|
+
}
|
|
141
|
+
function newRequestId() {
|
|
142
|
+
const bytes = /* @__PURE__ */ new Uint8Array(8);
|
|
143
|
+
crypto.getRandomValues(bytes);
|
|
144
|
+
let hex = "";
|
|
145
|
+
for (const b of bytes) hex += b.toString(16).padStart(2, "0");
|
|
146
|
+
return `req_${Date.now().toString(36)}${hex}`;
|
|
147
|
+
}
|
|
148
|
+
function resolveDefaultFrom(opts) {
|
|
149
|
+
const supplied = opts.from;
|
|
150
|
+
if (!(supplied === void 0 || supplied === null || typeof supplied === "string" && supplied.trim() === "" || typeof supplied === "object" && supplied !== null && !("email" in supplied))) return opts;
|
|
151
|
+
const configured = readEmailFrom();
|
|
152
|
+
if (configured) return {
|
|
153
|
+
...opts,
|
|
154
|
+
from: configured
|
|
155
|
+
};
|
|
156
|
+
const slug = readProjectSlug();
|
|
157
|
+
const domain = readEmailDomain();
|
|
158
|
+
if (!slug || !domain) {
|
|
159
|
+
if (supplied === null) {
|
|
160
|
+
const next = { ...opts };
|
|
161
|
+
delete next.from;
|
|
162
|
+
return next;
|
|
163
|
+
}
|
|
164
|
+
return opts;
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
...opts,
|
|
168
|
+
from: `${slug}+noreply@${domain}`
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function err(code, message, cause) {
|
|
172
|
+
return {
|
|
173
|
+
ok: false,
|
|
174
|
+
error: makeError(code, message, cause)
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function bytesToBase64(bytes) {
|
|
178
|
+
const CHUNK = 8192;
|
|
179
|
+
let binary = "";
|
|
180
|
+
for (let i = 0; i < bytes.byteLength; i += CHUNK) {
|
|
181
|
+
const slice = bytes.subarray(i, Math.min(i + CHUNK, bytes.byteLength));
|
|
182
|
+
binary += String.fromCharCode(...slice);
|
|
183
|
+
}
|
|
184
|
+
return btoa(binary);
|
|
185
|
+
}
|
|
186
|
+
function coerceErrorCode(code) {
|
|
187
|
+
return [
|
|
188
|
+
"BINDING_MISSING",
|
|
189
|
+
"INVALID_FROM",
|
|
190
|
+
"INVALID_TO",
|
|
191
|
+
"UNVERIFIED_DESTINATION",
|
|
192
|
+
"MIME_ERROR",
|
|
193
|
+
"QUOTA_EXCEEDED",
|
|
194
|
+
"UPSTREAM_ERROR"
|
|
195
|
+
].includes(code) ? code : "UPSTREAM_ERROR";
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The text of a refusal the proxy's middleware sent instead of a send
|
|
199
|
+
* response: `{ error: string, message?: string }`. `message` is the
|
|
200
|
+
* sentence written for a person (the capability gate's "This Void platform
|
|
201
|
+
* does not enable email."); `error` is the short code every such refusal
|
|
202
|
+
* carries. `null` when the body is not that shape.
|
|
203
|
+
*/
|
|
204
|
+
function readProxyRefusal(body) {
|
|
205
|
+
if (typeof body !== "object" || body === null || Array.isArray(body)) return null;
|
|
206
|
+
const { error, message } = body;
|
|
207
|
+
if (typeof error !== "string" || error === "") return null;
|
|
208
|
+
return typeof message === "string" && message !== "" ? message : error;
|
|
209
|
+
}
|
|
210
|
+
function isValidProxyResponse(b) {
|
|
211
|
+
if (typeof b !== "object" || b === null) return false;
|
|
212
|
+
const r = b;
|
|
213
|
+
if (r.ok === true && Array.isArray(r.ids)) return true;
|
|
214
|
+
if (r.ok === false && typeof r.error === "object" && r.error !== null) return true;
|
|
215
|
+
if (r.ok === false && Array.isArray(r.deliveries)) return true;
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Validate a per-recipient list from the proxy against the recipients this
|
|
220
|
+
* send asked for. Both list-bearing responses go through here — `ids` on
|
|
221
|
+
* `ok: true` and `deliveries` on a mid-batch `ok: false` — so the two cannot
|
|
222
|
+
* drift: the proxy builds both from the same per-recipient list, one entry
|
|
223
|
+
* per requested address, and a caller following the documented retry
|
|
224
|
+
* pattern (retry only `ok: false` entries) can act on an outcome only if
|
|
225
|
+
* every recipient has one.
|
|
226
|
+
*
|
|
227
|
+
* The rules shared by both shapes: the count equals the recipients sent;
|
|
228
|
+
* every entry is an object naming a requested recipient exactly once. The
|
|
229
|
+
* list is compared as a set against the unique, lowercased recipients the
|
|
230
|
+
* request carried and returned in the order the proxy gave it — order is
|
|
231
|
+
* not part of the contract (the proxy lists allowlist rejections before the
|
|
232
|
+
* sends it attempted). `readEntry` decides the rest of the entry's shape and
|
|
233
|
+
* returns `undefined` when it does not hold; `shape` names that shape in the
|
|
234
|
+
* reason.
|
|
235
|
+
*
|
|
236
|
+
* Anything else is a schema-skewed or corrupt proxy and is refused as a
|
|
237
|
+
* whole rather than trimmed to the entries that parse: a dropped entry is a
|
|
238
|
+
* recipient whose outcome the caller can neither trust nor retry. Entries
|
|
239
|
+
* are named by index only — the body is attached as `cause`, and a recipient
|
|
240
|
+
* string from a corrupt response is not a value to interpolate into an
|
|
241
|
+
* error message.
|
|
242
|
+
*/
|
|
243
|
+
function readRecipientList(raw, recipients, shape, readEntry) {
|
|
244
|
+
if (raw.length !== recipients.length) return {
|
|
245
|
+
ok: false,
|
|
246
|
+
reason: `expected ${recipients.length} deliveries, got ${raw.length}`
|
|
247
|
+
};
|
|
248
|
+
const requested = new Set(recipients);
|
|
249
|
+
const seen = /* @__PURE__ */ new Set();
|
|
250
|
+
const entries = [];
|
|
251
|
+
for (const [i, d] of raw.entries()) {
|
|
252
|
+
const entry = typeof d === "object" && d !== null ? d : null;
|
|
253
|
+
const recipient = entry?.recipient;
|
|
254
|
+
if (entry === null || typeof recipient !== "string") return {
|
|
255
|
+
ok: false,
|
|
256
|
+
reason: `entry ${i} is not ${shape}`
|
|
257
|
+
};
|
|
258
|
+
const value = readEntry(entry, recipient);
|
|
259
|
+
if (value === void 0) return {
|
|
260
|
+
ok: false,
|
|
261
|
+
reason: `entry ${i} is not ${shape}`
|
|
262
|
+
};
|
|
263
|
+
if (!requested.has(recipient)) return {
|
|
264
|
+
ok: false,
|
|
265
|
+
reason: `entry ${i} names a recipient that was not requested`
|
|
266
|
+
};
|
|
267
|
+
if (seen.has(recipient)) return {
|
|
268
|
+
ok: false,
|
|
269
|
+
reason: `entry ${i} repeats a recipient`
|
|
270
|
+
};
|
|
271
|
+
seen.add(recipient);
|
|
272
|
+
entries.push(value);
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
ok: true,
|
|
276
|
+
entries
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* The `ids` list of an `ok: true` response. The proxy answers `ok: true`
|
|
281
|
+
* only once every requested recipient passed its allowlist and
|
|
282
|
+
* `SEND_EMAIL.send()` confirmed each one, so every entry is
|
|
283
|
+
* `{ recipient, messageId }` with `messageId` always a string (`''` when
|
|
284
|
+
* Cloudflare returned none; that is the proxy's explicit convention, and the
|
|
285
|
+
* framework's own Message-ID stands in for it). An `ok: true` with a
|
|
286
|
+
* delivery missing would tell the caller a send was confirmed when it never
|
|
287
|
+
* was, and a success carries no per-recipient failure to retry from.
|
|
288
|
+
*/
|
|
289
|
+
function readDeliveryList(raw, recipients, fallbackId) {
|
|
290
|
+
return readRecipientList(raw, recipients, "{ recipient: string, messageId: string }", (entry, recipient) => typeof entry.messageId === "string" ? {
|
|
291
|
+
recipient,
|
|
292
|
+
messageId: entry.messageId || fallbackId
|
|
293
|
+
} : void 0);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The `deliveries` list of a mid-batch `ok: false` response. Each entry is
|
|
297
|
+
* either a confirmed send (`ok: true`, `messageId` a string with the same
|
|
298
|
+
* `''` convention as above) or a failure (`ok: false`, `error` with a string
|
|
299
|
+
* `message`; the code is coerced, unknown values become `UPSTREAM_ERROR`).
|
|
300
|
+
* Both are the proxy's own outcome for that recipient; `ok` is what the
|
|
301
|
+
* caller retries on, so an entry that does not state it is not an outcome
|
|
302
|
+
* at all — treating it as failed would retry a recipient that may have been
|
|
303
|
+
* delivered, and treating it as delivered would silently lose one.
|
|
304
|
+
*/
|
|
305
|
+
function readFailureDeliveries(raw, recipients, fallbackId) {
|
|
306
|
+
return readRecipientList(raw, recipients, "{ recipient: string, ok: true, messageId: string } | { recipient: string, ok: false, error: { message: string } }", (entry, recipient) => {
|
|
307
|
+
if (entry.ok === true) return typeof entry.messageId === "string" ? {
|
|
308
|
+
recipient,
|
|
309
|
+
ok: true,
|
|
310
|
+
messageId: entry.messageId || fallbackId
|
|
311
|
+
} : void 0;
|
|
312
|
+
if (entry.ok === false) {
|
|
313
|
+
const error = entry.error;
|
|
314
|
+
return typeof error === "object" && error !== null && typeof error.message === "string" ? {
|
|
315
|
+
recipient,
|
|
316
|
+
ok: false,
|
|
317
|
+
error: makeError(coerceErrorCode(error.code), error.message)
|
|
318
|
+
} : void 0;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
async function readResponseAsResult(res, recipients, fallbackId) {
|
|
323
|
+
try {
|
|
324
|
+
let body;
|
|
325
|
+
try {
|
|
326
|
+
body = await res.json();
|
|
327
|
+
} catch {
|
|
328
|
+
return err("UPSTREAM_ERROR", `email: proxy returned ${res.status} with non-JSON body`);
|
|
329
|
+
}
|
|
330
|
+
if (!isValidProxyResponse(body)) {
|
|
331
|
+
const refusal = readProxyRefusal(body);
|
|
332
|
+
if (!res.ok && refusal !== null) return err("UPSTREAM_ERROR", `email: proxy returned ${res.status}: ${refusal}`, body);
|
|
333
|
+
return err("UPSTREAM_ERROR", `email: proxy returned malformed response (status ${res.status})`, body);
|
|
334
|
+
}
|
|
335
|
+
const malformedList = (reason) => err("UPSTREAM_ERROR", `email: proxy returned a malformed delivery list (${reason})`, body);
|
|
336
|
+
if (body.ok === true) {
|
|
337
|
+
const list = readDeliveryList(body.ids, recipients, fallbackId);
|
|
338
|
+
return list.ok ? {
|
|
339
|
+
ok: true,
|
|
340
|
+
ids: list.entries
|
|
341
|
+
} : malformedList(list.reason);
|
|
342
|
+
}
|
|
343
|
+
const failure = body;
|
|
344
|
+
if ("error" in failure && failure.error) {
|
|
345
|
+
const e = failure.error;
|
|
346
|
+
return err(coerceErrorCode(e.code), typeof e.message === "string" ? e.message : "email: upstream send failed");
|
|
347
|
+
}
|
|
348
|
+
const list = readFailureDeliveries(failure.deliveries, recipients, fallbackId);
|
|
349
|
+
return list.ok ? {
|
|
350
|
+
ok: false,
|
|
351
|
+
deliveries: list.entries
|
|
352
|
+
} : malformedList(list.reason);
|
|
353
|
+
} catch (e) {
|
|
354
|
+
return err("UPSTREAM_ERROR", `email: failed to parse proxy response (status ${res.status}): ${e instanceof Error ? e.message : String(e)}`, e);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Resolve the loopback into the `void dev` inbox, or `undefined` outside dev.
|
|
359
|
+
*
|
|
360
|
+
* `DEV_INBOX_ENV_VAR` is injected only when `viteCommand === 'serve'` and it
|
|
361
|
+
* names the worker's assets binding. In dev, `@cloudflare/vite-plugin` binds
|
|
362
|
+
* that name to a miniflare service whose implementation is the Vite dev
|
|
363
|
+
* server's Node middleware stack, so a fetch through it lands on the inbox
|
|
364
|
+
* middleware in the dev-server process — the only place the buffer exists.
|
|
365
|
+
* In a production build neither the var nor that wiring is present.
|
|
366
|
+
*/
|
|
367
|
+
function resolveDevInbox(env) {
|
|
368
|
+
const bindingName = env?.[DEV_INBOX_ENV_VAR];
|
|
369
|
+
if (typeof bindingName !== "string" || bindingName.length === 0) return;
|
|
370
|
+
const binding = env?.[bindingName];
|
|
371
|
+
if (typeof binding !== "object" || binding === null) return;
|
|
372
|
+
if (typeof binding.fetch !== "function") return;
|
|
373
|
+
const token = env?.[DEV_INBOX_TOKEN_ENV_VAR];
|
|
374
|
+
return {
|
|
375
|
+
fetcher: binding,
|
|
376
|
+
token: typeof token === "string" && token.length > 0 ? token : void 0
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
const DEV_INBOX_TIMEOUT_MS = 5e3;
|
|
380
|
+
/** Bound on the error text a failed capture echoes from the dev server. */
|
|
381
|
+
const DEV_INBOX_ERROR_EXCERPT_CHARS = 200;
|
|
382
|
+
const DEV_INBOX_ERROR_EXCERPT_TIMEOUT_MS = 1e3;
|
|
383
|
+
/**
|
|
384
|
+
* First line of a refusal, so a 401 names the header it wanted. Reads ONE
|
|
385
|
+
* chunk under its own deadline: the main 5s race has already settled by the
|
|
386
|
+
* time the status is known, and a body that never arrives must not turn a
|
|
387
|
+
* clean error into a hung `sendEmail`.
|
|
388
|
+
*/
|
|
389
|
+
async function readErrorExcerpt(res) {
|
|
390
|
+
let timer;
|
|
391
|
+
try {
|
|
392
|
+
const reader = res.body?.getReader();
|
|
393
|
+
if (!reader) return "";
|
|
394
|
+
const first = await Promise.race([reader.read().then(({ value }) => value), new Promise((resolve) => {
|
|
395
|
+
timer = setTimeout(() => resolve(void 0), DEV_INBOX_ERROR_EXCERPT_TIMEOUT_MS);
|
|
396
|
+
})]);
|
|
397
|
+
reader.cancel().catch(() => {});
|
|
398
|
+
if (!first) return "";
|
|
399
|
+
return new TextDecoder().decode(first).trim().split("\n")[0].slice(0, DEV_INBOX_ERROR_EXCERPT_CHARS);
|
|
400
|
+
} catch {
|
|
401
|
+
return "";
|
|
402
|
+
} finally {
|
|
403
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
async function postToDevInbox(inbox, captured) {
|
|
407
|
+
let timer;
|
|
408
|
+
try {
|
|
409
|
+
const attempt = Promise.resolve(inbox.fetcher.fetch(`http://localhost${DEV_INBOX_CAPTURE_URL}`, {
|
|
410
|
+
method: "POST",
|
|
411
|
+
headers: {
|
|
412
|
+
"content-type": "application/json",
|
|
413
|
+
...inbox.token !== void 0 && { ["x-void-dev-trigger"]: inbox.token }
|
|
414
|
+
},
|
|
415
|
+
body: serializeCapturedMessage(captured)
|
|
416
|
+
})).then((res) => ({
|
|
417
|
+
kind: "response",
|
|
418
|
+
res
|
|
419
|
+
}), (cause) => ({
|
|
420
|
+
kind: "error",
|
|
421
|
+
cause
|
|
422
|
+
}));
|
|
423
|
+
const settled = await Promise.race([attempt, new Promise((resolve) => {
|
|
424
|
+
timer = setTimeout(() => resolve({ kind: "timeout" }), DEV_INBOX_TIMEOUT_MS);
|
|
425
|
+
})]);
|
|
426
|
+
if (settled.kind === "timeout") return {
|
|
427
|
+
ok: false,
|
|
428
|
+
reason: `no response within ${DEV_INBOX_TIMEOUT_MS}ms`
|
|
429
|
+
};
|
|
430
|
+
if (settled.kind === "error") {
|
|
431
|
+
const cause = settled.cause;
|
|
432
|
+
return {
|
|
433
|
+
ok: false,
|
|
434
|
+
reason: cause instanceof Error ? cause.message : String(cause)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
const { res } = settled;
|
|
438
|
+
if (!res.ok) {
|
|
439
|
+
const excerpt = await readErrorExcerpt(res);
|
|
440
|
+
return {
|
|
441
|
+
ok: false,
|
|
442
|
+
reason: `dev server responded ${res.status}${excerpt ? `: ${excerpt}` : ""}`
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
if (res.headers.get("x-void-email-inbox") !== "captured") return {
|
|
446
|
+
ok: false,
|
|
447
|
+
reason: "response did not come from the dev inbox"
|
|
448
|
+
};
|
|
449
|
+
return { ok: true };
|
|
450
|
+
} catch (e) {
|
|
451
|
+
return {
|
|
452
|
+
ok: false,
|
|
453
|
+
reason: e instanceof Error ? e.message : String(e)
|
|
454
|
+
};
|
|
455
|
+
} finally {
|
|
456
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Shared result shape for both capture paths (in-process sink and dev inbox).
|
|
461
|
+
*
|
|
462
|
+
* `ids` is built from the same deduplicated, lowercased list the two
|
|
463
|
+
* production transports send to, so code written against a captured result
|
|
464
|
+
* sees exactly what a deploy returns: one entry per unique address, keyed the
|
|
465
|
+
* way `sendViaBinding` and the proxy report it. Mapping every `to`/`cc`/`bcc`
|
|
466
|
+
* occurrence instead handed a test or `void dev` handler one success per
|
|
467
|
+
* occurrence in its original case — deliveries that never happen once
|
|
468
|
+
* deployed. The captured message itself keeps the original fields; the
|
|
469
|
+
* inbox displays what was asked for, the result reports what would be sent.
|
|
470
|
+
*/
|
|
471
|
+
function capturedResult(normalized, captureId) {
|
|
472
|
+
const recipients = uniqueRecipients(normalized);
|
|
473
|
+
if (recipients.length === 0) return err("INVALID_TO", "email: 'to' must include at least one recipient.");
|
|
474
|
+
return {
|
|
475
|
+
ok: true,
|
|
476
|
+
ids: recipients.map((recipient) => ({
|
|
477
|
+
recipient,
|
|
478
|
+
messageId: captureId
|
|
479
|
+
}))
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Send an email via the Void platform proxy.
|
|
484
|
+
*
|
|
485
|
+
* During `void dev` the message is captured by the local inbox
|
|
486
|
+
* (`/__void/inbox`) and never reaches the proxy; an in-process sink
|
|
487
|
+
* (`void/email/testing`) takes precedence over it. Pass `sendInDev: true` to
|
|
488
|
+
* override for a single call.
|
|
489
|
+
*/
|
|
490
|
+
async function sendEmail(opts) {
|
|
491
|
+
const resolvedOpts = resolveDefaultFrom(opts);
|
|
492
|
+
if (resolvedOpts.from === void 0) return err("INVALID_FROM", "email: 'from' is required. Set it explicitly or deploy via Void so the platform-injected __VOID_PROJECT_SLUG and __VOID_EMAIL_DOMAIN can default it to <slug>+noreply@<domain>.");
|
|
493
|
+
const optsWithFrom = resolvedOpts;
|
|
494
|
+
let normalized;
|
|
495
|
+
try {
|
|
496
|
+
normalized = await normalizeEmail(optsWithFrom);
|
|
497
|
+
} catch (e) {
|
|
498
|
+
if (e instanceof MimeError) return err(e.code, e.message, e);
|
|
499
|
+
return err("MIME_ERROR", e instanceof Error ? e.message : String(e), e);
|
|
500
|
+
}
|
|
501
|
+
let raw;
|
|
502
|
+
let messageId;
|
|
503
|
+
try {
|
|
504
|
+
const built = buildMime(normalized);
|
|
505
|
+
raw = built.raw;
|
|
506
|
+
messageId = built.messageId;
|
|
507
|
+
} catch (e) {
|
|
508
|
+
if (e instanceof MimeError) return err(e.code, e.message, e);
|
|
509
|
+
return err("MIME_ERROR", e instanceof Error ? e.message : String(e), e);
|
|
510
|
+
}
|
|
511
|
+
const rawEnv = tryGetRawRuntimeEnv();
|
|
512
|
+
if (!opts.sendInDev && hasActiveSink()) {
|
|
513
|
+
const captured = captureMessage(normalized, raw, messageId);
|
|
514
|
+
dispatchToSinks(captured);
|
|
515
|
+
return capturedResult(normalized, captured.id);
|
|
516
|
+
}
|
|
517
|
+
const devInbox = opts.sendInDev ? void 0 : resolveDevInbox(rawEnv);
|
|
518
|
+
if (devInbox) {
|
|
519
|
+
const captured = captureMessage(normalized, raw, messageId);
|
|
520
|
+
const delivered = await postToDevInbox(devInbox, captured);
|
|
521
|
+
if (delivered.ok) return capturedResult(normalized, captured.id);
|
|
522
|
+
const message = `email: the void dev inbox at ${DEV_INBOX_CAPTURE_URL} is unreachable (${delivered.reason}), so nothing was captured and nothing was sent.`;
|
|
523
|
+
console.warn(`[void/email] ${message}`);
|
|
524
|
+
return err("UPSTREAM_ERROR", message);
|
|
525
|
+
}
|
|
526
|
+
const recipients = uniqueRecipients(normalized);
|
|
527
|
+
if (recipients.length === 0) return err("INVALID_TO", "email: 'to' must include at least one recipient.");
|
|
528
|
+
const sendBinding = resolveSendEmailBinding(rawEnv);
|
|
529
|
+
if (sendBinding) return sendViaBinding(sendBinding, normalized.from.email, recipients, raw, messageId);
|
|
530
|
+
const env = rawEnv;
|
|
531
|
+
const proxy = env?.__VOID_PROXY;
|
|
532
|
+
const projectId = env?.__PROJECT_ID;
|
|
533
|
+
const proxyToken = env?.__VOID_PROXY_TOKEN;
|
|
534
|
+
if (!proxy || !projectId || !proxyToken) return err("BINDING_MISSING", "email: neither SEND_EMAIL nor __VOID_PROXY is available, so nothing was sent. Deploy via Void to bind the platform proxy, or set `email.from` in void.json so `void deploy --platform cloudflare` provisions the SEND_EMAIL binding. Under `void dev` messages are captured by the local inbox at /__void/inbox instead — reaching this error there means that path was bypassed (`sendInDev: true`, which does not deliver: `void dev` binds no send transport at all, so there is nothing to fall through to) or unavailable (the worker has no assets binding to reach the dev server through).");
|
|
535
|
+
const requestId = newRequestId();
|
|
536
|
+
const fromDomain = normalized.from.email.split("@")[1] ?? "";
|
|
537
|
+
const body = {
|
|
538
|
+
projectId,
|
|
539
|
+
aiToken: proxyToken,
|
|
540
|
+
proxyToken,
|
|
541
|
+
from: normalized.from.email,
|
|
542
|
+
recipients,
|
|
543
|
+
mimeBase64: bytesToBase64(raw),
|
|
544
|
+
byteSize: raw.byteLength,
|
|
545
|
+
requestId,
|
|
546
|
+
fromDomain
|
|
547
|
+
};
|
|
548
|
+
let res;
|
|
549
|
+
try {
|
|
550
|
+
res = await proxy.fetch("https://email-proxy/email/send", {
|
|
551
|
+
method: "POST",
|
|
552
|
+
headers: { "content-type": "application/json" },
|
|
553
|
+
body: JSON.stringify(body)
|
|
554
|
+
});
|
|
555
|
+
} catch (e) {
|
|
556
|
+
return err("UPSTREAM_ERROR", `email: proxy unreachable: ${e instanceof Error ? e.message : String(e)}`, e);
|
|
557
|
+
}
|
|
558
|
+
return readResponseAsResult(res, recipients, messageId);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Build a normalized email + raw MIME for advanced callers who want to feed
|
|
562
|
+
* the message into a custom transport. Throws on invalid input.
|
|
563
|
+
*/
|
|
564
|
+
async function createEmail(opts) {
|
|
565
|
+
if (opts.from === void 0) throw new MimeError("INVALID_FROM", "createEmail: 'from' is required (this entrypoint does not apply __VOID_PROJECT_SLUG defaulting).");
|
|
566
|
+
const email = await normalizeEmail(opts);
|
|
567
|
+
return {
|
|
568
|
+
email,
|
|
569
|
+
...buildMime(email)
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
//#endregion
|
|
573
|
+
export { MimeError, ParseEmailError, createEmail, createMessageProxy, defineEmail, enactEmailActions, isForwardableEmailMessage, parseEmail, replyEmail, sendEmail };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { EnvSchema,
|
|
1
|
+
import { a as number, c as url, i as json, n as boolean, o as oneOf, r as email, s as string, t as EnvSchema } from "../env-helpers-CyKtOBpj.mjs";
|
|
2
|
+
export { EnvSchema, boolean, email, json, number, oneOf, string, url };
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
//#region src/runtime/env-helpers.ts
|
|
2
|
-
/**
|
|
3
|
-
* Marker property read by the mask helpers. Present only on built-in
|
|
4
|
-
* schema builders; third-party Standard Schema validators fall back to the
|
|
5
|
-
* name/value heuristic (documented in `docs/guide/env-vars.md`).
|
|
6
|
-
*/
|
|
7
|
-
const SECRET_OVERRIDE_SYMBOL = Symbol.for("void.env.secretOverride");
|
|
8
|
-
/**
|
|
9
|
-
* Pull the explicit `.secret()` / `.public()` flag off a Standard Schema
|
|
10
|
-
* validator, if it was authored through our built-in helpers. Returns
|
|
11
|
-
* `undefined` for third-party validators (valibot, zod, arktype, …) —
|
|
12
|
-
* they are redacted purely via the heuristic.
|
|
13
|
-
*/
|
|
14
|
-
function getSecretOverride(validator) {
|
|
15
|
-
if (!validator || typeof validator !== "object") return;
|
|
16
|
-
return validator[SECRET_OVERRIDE_SYMBOL];
|
|
17
|
-
}
|
|
18
2
|
function build(parse, state) {
|
|
19
|
-
|
|
3
|
+
return {
|
|
20
4
|
"~standard": {
|
|
21
5
|
version: 1,
|
|
22
6
|
vendor: "void",
|
|
@@ -34,41 +18,20 @@ function build(parse, state) {
|
|
|
34
18
|
optional() {
|
|
35
19
|
return build(parse, {
|
|
36
20
|
optional: true,
|
|
37
|
-
defaultValue: state.defaultValue
|
|
38
|
-
secretOverride: state.secretOverride
|
|
21
|
+
defaultValue: state.defaultValue
|
|
39
22
|
});
|
|
40
23
|
},
|
|
41
24
|
default(value) {
|
|
42
25
|
return build(parse, {
|
|
43
26
|
optional: false,
|
|
44
|
-
defaultValue: value
|
|
45
|
-
secretOverride: state.secretOverride
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
secret() {
|
|
49
|
-
return build(parse, {
|
|
50
|
-
...state,
|
|
51
|
-
secretOverride: "secret"
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
public() {
|
|
55
|
-
return build(parse, {
|
|
56
|
-
...state,
|
|
57
|
-
secretOverride: "public"
|
|
27
|
+
defaultValue: value
|
|
58
28
|
});
|
|
59
29
|
}
|
|
60
30
|
};
|
|
61
|
-
Object.defineProperty(schema, SECRET_OVERRIDE_SYMBOL, {
|
|
62
|
-
value: state.secretOverride,
|
|
63
|
-
enumerable: false,
|
|
64
|
-
configurable: true
|
|
65
|
-
});
|
|
66
|
-
return schema;
|
|
67
31
|
}
|
|
68
32
|
const empty = () => ({
|
|
69
33
|
optional: false,
|
|
70
|
-
defaultValue: void 0
|
|
71
|
-
secretOverride: void 0
|
|
34
|
+
defaultValue: void 0
|
|
72
35
|
});
|
|
73
36
|
/** Required string env value. */
|
|
74
37
|
function string() {
|
|
@@ -170,4 +133,4 @@ function json() {
|
|
|
170
133
|
}, empty());
|
|
171
134
|
}
|
|
172
135
|
//#endregion
|
|
173
|
-
export {
|
|
136
|
+
export { boolean, email, json, number, oneOf, string, url };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
|
|
1
|
+
import { a as number, c as url, i as json, n as boolean, o as oneOf, r as email, s as string, t as EnvSchema } from "../env-helpers-CyKtOBpj.mjs";
|
|
3
2
|
//#region src/runtime/env-public-client.d.ts
|
|
4
|
-
declare const env: Record<string, unknown>;
|
|
3
|
+
export declare const env: Record<string, unknown>;
|
|
5
4
|
/**
|
|
6
|
-
* In client builds `defineEnv` is a no-op identity function — schema
|
|
7
|
-
* registration only happens server-side. We still return the `env` proxy so
|
|
8
|
-
* t3-style `export const env = defineEnv({...})` keeps working in shared
|
|
9
|
-
* modules.
|
|
10
|
-
*/
|
|
11
|
-
declare function defineEnv<S>(_schema: S): typeof env;
|
|
12
|
-
declare class EnvValidationError extends Error {
|
|
5
|
+
* In client builds `defineEnv` is a no-op identity function — schema
|
|
6
|
+
* registration only happens server-side. We still return the `env` proxy so
|
|
7
|
+
* t3-style `export const env = defineEnv({...})` keeps working in shared
|
|
8
|
+
* modules.
|
|
9
|
+
*/
|
|
10
|
+
export declare function defineEnv<S>(_schema: S): typeof env;
|
|
11
|
+
export declare class EnvValidationError extends Error {
|
|
13
12
|
readonly key: string;
|
|
14
13
|
readonly issues: Array<{
|
|
15
14
|
message: string;
|
|
@@ -19,4 +18,4 @@ declare class EnvValidationError extends Error {
|
|
|
19
18
|
}>);
|
|
20
19
|
}
|
|
21
20
|
//#endregion
|
|
22
|
-
export { type EnvSchema,
|
|
21
|
+
export { type EnvSchema, boolean, email, json, number, oneOf, string, url };
|
|
@@ -6,7 +6,7 @@ function getClientEnv() {
|
|
|
6
6
|
function readClientKey(key) {
|
|
7
7
|
const meta = getClientEnv();
|
|
8
8
|
if (meta && key in meta) return meta[key];
|
|
9
|
-
throw new Error(`env: Key '${key}' is not exposed to the client.
|
|
9
|
+
throw new Error(`env: Key '${key}' is not exposed to the client. Void only exposes VITE_* schema keys to browser code. Either rename the key in env.ts with that prefix, or move this access to a server module.`);
|
|
10
10
|
}
|
|
11
11
|
const env = new Proxy({}, {
|
|
12
12
|
get(_target, key) {
|