@builtbyfriends/bwf 0.0.0-stage → 1.9.2
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 +4 -0
- package/LICENSE +22 -0
- package/README.md +48 -2
- package/dist/account-cmd-Ddt8lGeL.mjs +45 -0
- package/dist/agents-BLiMq9E1.mjs +113 -0
- package/dist/application-analysis-C9Ck2Yeg.mjs +1498 -0
- package/dist/application-routing-DbR-W5lG.mjs +25 -0
- package/dist/atomic-write-DA6eD1Kp.mjs +17 -0
- package/dist/auth-BKsUmWbT.d.mts +77 -0
- package/dist/auth-DkvoW5hB.mjs +33 -0
- package/dist/auth-aKyIWkdS.mjs +1 -0
- package/dist/auth-client-6-Ft9i9T.d.mts +5 -0
- package/dist/auth-client-DwCdwKbw.mjs +5 -0
- package/dist/auth-client-react-CJdeErvM.mjs +5 -0
- package/dist/auth-client-react-DvQLe5Zb.d.mts +5 -0
- package/dist/auth-link-CCl-hJol.mjs +26 -0
- package/dist/auth-migrations-DDeifS3v.mjs +206 -0
- package/dist/auth-router-BG74WFUf.mjs +66 -0
- package/dist/auth-xnkmpZUl.mjs +311 -0
- package/dist/base64-ikl9yBy3.mjs +15 -0
- package/dist/better-auth-shared-Br6TNaYJ.mjs +473 -0
- package/dist/better-auth-shared-CsBNvPOU.d.mts +56 -0
- package/dist/build-cmd-BnZezraT.mjs +153 -0
- package/dist/build-output-dir-Clj_unKN.mjs +402 -0
- package/dist/cancel-deploy-DKAj5U1Z.mjs +57 -0
- package/dist/cf-access-Bhz9wX6p.mjs +131 -0
- package/dist/cf-access-CUP5L08W.mjs +67 -0
- package/dist/cf-build-output-DA6uJomQ.mjs +1 -0
- package/dist/cf-build-output-DNQTwMNU.mjs +438 -0
- package/dist/cf-command-values-2kOtxMo1.mjs +26 -0
- package/dist/cf-config-migrate-COOCi4Ge.mjs +330 -0
- package/dist/cf-worker-settings-CIh4t_yG.mjs +41 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +88 -0
- package/dist/cli/cloudflare-operation-process.d.mts +1 -0
- package/dist/cli/cloudflare-operation-process.mjs +1284 -0
- package/dist/cli/env-schema-probe.d.mts +43 -0
- package/dist/cli/env-schema-probe.mjs +165 -0
- package/dist/cli-main-BfYf6fnB.mjs +1846 -0
- package/dist/client-D3D5RM5h.mjs +940 -0
- package/dist/client-VF2Nzc7Z.mjs +1 -0
- package/dist/cloudflare-auth-DzkU9H6r.mjs +152 -0
- package/dist/cloudflare-cmd-Bm6UhzAQ.mjs +59 -0
- package/dist/cloudflare-config-i8yanry0.mjs +186 -0
- package/dist/cloudflare-connect-B4ItSbJi.mjs +55 -0
- package/dist/cloudflare-operations-BcK849ue.mjs +1 -0
- package/dist/cloudflare-operations-DGF7xH7O.mjs +627 -0
- package/dist/cloudflare-process-tThIjEB2.mjs +309 -0
- package/dist/cloudflare-user-output-CqONaAbP.mjs +19 -0
- package/dist/collect-8i0wU63d.mjs +1 -0
- package/dist/collect-C6Blu9yw.mjs +48 -0
- package/dist/config-CN_RFRkS.mjs +86 -0
- package/dist/config-D5G-Tx6o.mjs +1 -0
- package/dist/config-DOaFIK3w.mjs +88 -0
- package/dist/config-entry.d.mts +202 -0
- package/dist/config-entry.mjs +6 -0
- package/dist/config-tNx0HlFv.mjs +516 -0
- package/dist/connect-CSNWKLzB.mjs +84 -0
- package/dist/create-project-B35ux-LA.mjs +126 -0
- package/dist/create-project-tJ1KwNss.mjs +1 -0
- package/dist/database-provider-DkZo4VwN.mjs +5 -0
- package/dist/database-provider.d.mts +25 -0
- package/dist/database-provider.mjs +1 -0
- package/dist/db-SOv4E9wr.mjs +1735 -0
- package/dist/delete-BSKI7V23.mjs +65 -0
- package/dist/deploy-BCSQoKC0.mjs +2 -0
- package/dist/deploy-CWJ3JJs_.mjs +6512 -0
- package/dist/deploy.d.mts +31 -0
- package/dist/deploy.mjs +118 -0
- package/dist/dev-inbox-I0nqTCdf.mjs +216 -0
- package/dist/discover-DJPmQcL5.mjs +36 -0
- package/dist/discover-EVuydEoM.mjs +1 -0
- package/dist/dist-B6eN80gc.mjs +1612 -0
- package/dist/dist-Cp4b1_T9.mjs +1 -0
- package/dist/dist-DMYe8CZJ.mjs +48 -0
- package/dist/dist-STQXl8ck.mjs +1878 -0
- package/dist/domain-BJaAbxuQ.mjs +149 -0
- package/dist/dotenv-4NdUCXbB.mjs +156 -0
- package/dist/drizzle-DqVFXtlc.mjs +306 -0
- package/dist/drizzle-Ds5P0n-S.mjs +1 -0
- package/dist/edge.d.mts +2 -0
- package/dist/edge.mjs +1 -0
- package/dist/email-C_ATvNIG.mjs +2865 -0
- package/dist/email-cloudflare-oXk2G1G3.mjs +854 -0
- package/dist/email-protocol-CZ0bAkI8.mjs +81 -0
- package/dist/email-rIfZgVAB.mjs +742 -0
- package/dist/env-BGTu3KWZ.mjs +73 -0
- package/dist/env-DUyTzroe.mjs +88 -0
- package/dist/env-Dl4Wggec.mjs +71 -0
- package/dist/env-helpers-BX0APszT.mjs +135 -0
- package/dist/env-helpers-U56xuFgL.d.mts +20 -0
- package/dist/env-mask-BsHxq3R8.mjs +46 -0
- package/dist/env-public-Cw_xPi1D.d.mts +119 -0
- package/dist/env-raw-Bo6TtrHU.mjs +41 -0
- package/dist/env-types-Bg-dTh8u.mjs +56 -0
- package/dist/env-validation-BlXzGgLZ.mjs +1 -0
- package/dist/env-validation-DeqFUSKg.mjs +488 -0
- package/dist/fetch-CBgyyhzm.d.mts +87 -0
- package/dist/fetch-error-DmlRM6e4.mjs +264 -0
- package/dist/fetch-stream-2GUN3YN1.mjs +102 -0
- package/dist/fetch-stream-bUXynOyZ.d.mts +32 -0
- package/dist/fetch-tpPiSK10.mjs +25 -0
- package/dist/gen-dc13IRXh.mjs +509 -0
- package/dist/gen-kQqhFyOP.mjs +1 -0
- package/dist/generate-BgtlYpKg.mjs +1 -0
- package/dist/generate-Da9mWKzU.mjs +80 -0
- package/dist/generated-wrangler-config-CoDaaFsA.mjs +17 -0
- package/dist/git-metadata-Cukp5kV5.mjs +82 -0
- package/dist/github-cmd-DT5Onu6E.mjs +690 -0
- package/dist/handler-B_ocHStk.d.mts +279 -0
- package/dist/handler-CNq7aSs1.mjs +161 -0
- package/dist/help-BK35YcRa.mjs +1946 -0
- package/dist/help-DaRezBj7.mjs +1 -0
- package/dist/inbound-CqubE-9T.d.mts +311 -0
- package/dist/inbound-lHugZPuK.mjs +509 -0
- package/dist/index.d.mts +64 -0
- package/dist/index.mjs +4163 -0
- package/dist/info-CLQoCenb.mjs +109 -0
- package/dist/init-CXanf5ck.mjs +2486 -0
- package/dist/limits-CMmYT2l8.d.mts +16 -0
- package/dist/limits-D27Lp6FP.mjs +46 -0
- package/dist/link-DinwJnon.mjs +52 -0
- package/dist/list-B1WAE9Wt.mjs +130 -0
- package/dist/live-KkEeda1Z.d.mts +105 -0
- package/dist/live-saC8barp.mjs +410 -0
- package/dist/load-user-env-g0ahkZcj.mjs +34 -0
- package/dist/local-d1-bUoAtFUe.mjs +103 -0
- package/dist/log-JDnPc0cF.mjs +23 -0
- package/dist/login-BUzyiyHV.mjs +1 -0
- package/dist/login-Dbv_T3Ru.mjs +87 -0
- package/dist/logs-BjMJooJQ.mjs +129 -0
- package/dist/migrate-DjW9_-sS.mjs +1 -0
- package/dist/migrate-DtcfKqPW.mjs +125 -0
- package/dist/migration-handler-22qiuWPq.mjs +469 -0
- package/dist/migration-handler-Bb2BJh6g.d.mts +38 -0
- package/dist/mime-BMUN_QKG.mjs +1004 -0
- package/dist/mysql-migration-sql-CNuBSqdx.mjs +239 -0
- package/dist/neon-CJzQSycr.mjs +52 -0
- package/dist/node-tfv-3v0V.mjs +64 -0
- package/dist/operator-ai-logging-Ay7M4KWw.mjs +121 -0
- package/dist/operator-args-BiGmSlZx.mjs +722 -0
- package/dist/operator-auth-DdYZYEkO.mjs +47 -0
- package/dist/operator-client-DBujdELO.mjs +82 -0
- package/dist/operator-cmd-BsHKYJYt.mjs +1 -0
- package/dist/operator-cmd-DTIkOAnP.mjs +443 -0
- package/dist/output-Bb34lF0w.mjs +173 -0
- package/dist/output-CVolXKC1.mjs +1 -0
- package/dist/package-BX_giUBX.mjs +1444 -0
- package/dist/package-json-DvS6IFRv.mjs +43 -0
- package/dist/pg-DoyPxa_X.mjs +15 -0
- package/dist/picocolors-D1NxSLw-.mjs +71 -0
- package/dist/plan-BHNt1QhK.mjs +1 -0
- package/dist/plan-DX4_-OM5.mjs +58 -0
- package/dist/platform-args-C-DyuCNX.mjs +1 -0
- package/dist/platform-args-CyeQWaZ7.mjs +538 -0
- package/dist/platform-auth-config-BfXqKSyZ.mjs +371 -0
- package/dist/platform-auth-protection-5FR6qoP_.mjs +231 -0
- package/dist/platform-auth-recovery-B5ZlqA8K.mjs +309 -0
- package/dist/platform-cmd-CcFDxtrl.mjs +1 -0
- package/dist/platform-cmd-ChXeBrRH.mjs +193 -0
- package/dist/platform-discovery-Bxg9aZXU.mjs +40 -0
- package/dist/platform-domain-CwatS3cz.mjs +256 -0
- package/dist/platform-lifecycle-0cXTmMsh.mjs +8928 -0
- package/dist/platform-lifecycle-BcoBAMux.mjs +1 -0
- package/dist/platform-management-6Wbdbob5.mjs +1607 -0
- package/dist/platform-management-hhnczOzr.mjs +1 -0
- package/dist/platform-plans-config-CkbUKFpm.mjs +447 -0
- package/dist/platform-recovery-DgIwlqB-.mjs +96 -0
- package/dist/platform-registry-x1m9HBxf.mjs +450 -0
- package/dist/platform-runtime-logs-kkoiYFpF.mjs +72 -0
- package/dist/platform-setup-DX8y_6Kh.mjs +306 -0
- package/dist/prepare-B9mB47T5.mjs +84 -0
- package/dist/prepare-DNIq07so.mjs +13 -0
- package/dist/prepare-LHkyJqxi.mjs +1 -0
- package/dist/project-CC7eN00D.mjs +141 -0
- package/dist/project-DcSd4BeI.mjs +1 -0
- package/dist/project-cmd-BydRwr-x.mjs +109 -0
- package/dist/project-paths-iXHKRTTQ.mjs +159 -0
- package/dist/project-slug-BUy0lmyR.mjs +1 -0
- package/dist/project-slug-CO6ci9XG.mjs +7 -0
- package/dist/project-team-CvdLhDF2.mjs +129 -0
- package/dist/project-token-CwZdUEGu.mjs +70 -0
- package/dist/project-tsconfig-P9X952KG.mjs +98 -0
- package/dist/project-zero-trust-CKDoPdN1.mjs +64 -0
- package/dist/providers-Cd3c7wi0.mjs +64 -0
- package/dist/providers-Df69hb_X.d.mts +5 -0
- package/dist/provision-BA59NCPO.mjs +1 -0
- package/dist/provision-C90fULHJ.mjs +1814 -0
- package/dist/queues-Bc3FsBQT.d.mts +5 -0
- package/dist/r2-conditions-DSLmkiR5.mjs +60 -0
- package/dist/requests-DNhfyF3l.mjs +52 -0
- package/dist/resolve-project-BCsAMDRA.mjs +47 -0
- package/dist/resolve-project-DhU9_lIo.mjs +1 -0
- package/dist/resource-name-DlJ9QXzg.mjs +10 -0
- package/dist/response-HmNjB30w.mjs +29 -0
- package/dist/rollback-wi6WK5T6.mjs +150 -0
- package/dist/rolldown-runtime-uD8oG6U2.mjs +24 -0
- package/dist/route-types-CRWhr93D.mjs +592 -0
- package/dist/route-url-BIDZT78M.mjs +58 -0
- package/dist/route-url-Bla3Upsy.d.mts +42 -0
- package/dist/routes-stub.d.mts +24 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/routing-assets-CSheDWWM.mjs +54 -0
- package/dist/rpc-DcByS_q0.d.mts +39 -0
- package/dist/rpc-DtxIN9Tv.mjs +19 -0
- package/dist/runner-CPerdjIl.mjs +163 -0
- package/dist/runner-CUNtS5x7.mjs +1 -0
- package/dist/runner-mysql-BjSoQ-mW.mjs +1 -0
- package/dist/runner-mysql-BmTI2EiF.mjs +145 -0
- package/dist/runner-pg-2pjltt0t.mjs +1 -0
- package/dist/runner-pg-mYc75KfH.mjs +61 -0
- package/dist/runtime/ai.d.mts +50 -0
- package/dist/runtime/ai.mjs +455 -0
- package/dist/runtime/auth-client-react.d.mts +2 -0
- package/dist/runtime/auth-client-react.mjs +1 -0
- package/dist/runtime/auth-client.d.mts +2 -0
- package/dist/runtime/auth-client.mjs +1 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +1 -0
- package/dist/runtime/better-auth-mysql.d.mts +5 -0
- package/dist/runtime/better-auth-mysql.mjs +21 -0
- package/dist/runtime/better-auth-pg.d.mts +5 -0
- package/dist/runtime/better-auth-pg.mjs +21 -0
- package/dist/runtime/better-auth.d.mts +6 -0
- package/dist/runtime/better-auth.mjs +22 -0
- package/dist/runtime/client-react.d.mts +5 -0
- package/dist/runtime/client-react.mjs +5 -0
- package/dist/runtime/client.d.mts +5 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-mysql.d.mts +2 -0
- package/dist/runtime/db-mysql.mjs +1 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +36 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/durable.d.mts +64 -0
- package/dist/runtime/durable.mjs +165 -0
- package/dist/runtime/email/testing.d.mts +108 -0
- package/dist/runtime/email/testing.mjs +268 -0
- package/dist/runtime/email-protocol.d.mts +25 -0
- package/dist/runtime/email-protocol.mjs +1 -0
- package/dist/runtime/email.d.mts +26 -0
- package/dist/runtime/email.mjs +524 -0
- package/dist/runtime/env-public-client.d.mts +19 -0
- package/dist/runtime/env-public-client.mjs +55 -0
- package/dist/runtime/env-public.d.mts +4 -0
- package/dist/runtime/env-public.mjs +277 -0
- package/dist/runtime/env.d.mts +12 -0
- package/dist/runtime/env.mjs +1 -0
- package/dist/runtime/fetch-server.d.mts +6 -0
- package/dist/runtime/fetch-server.mjs +29 -0
- package/dist/runtime/fetch-stream.d.mts +3 -0
- package/dist/runtime/fetch-stream.mjs +3 -0
- package/dist/runtime/fetch.d.mts +2 -0
- package/dist/runtime/fetch.mjs +3 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +1 -0
- package/dist/runtime/kv.d.mts +45 -0
- package/dist/runtime/kv.mjs +103 -0
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +1 -0
- package/dist/runtime/live-client.d.mts +40 -0
- package/dist/runtime/live-client.mjs +282 -0
- package/dist/runtime/live-server.d.mts +11 -0
- package/dist/runtime/live-server.mjs +419 -0
- package/dist/runtime/live.d.mts +3 -0
- package/dist/runtime/live.mjs +1 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +57 -0
- package/dist/runtime/migration-handler-mysql.d.mts +2 -0
- package/dist/runtime/migration-handler-mysql.mjs +111 -0
- package/dist/runtime/migration-handler-pg.d.mts +2 -0
- package/dist/runtime/migration-handler-pg.mjs +94 -0
- package/dist/runtime/migration-handler.d.mts +2 -0
- package/dist/runtime/migration-handler.mjs +1 -0
- package/dist/runtime/procedure.d.mts +27 -0
- package/dist/runtime/procedure.mjs +36 -0
- package/dist/runtime/procedures.d.mts +24 -0
- package/dist/runtime/procedures.mjs +56 -0
- package/dist/runtime/queues.d.mts +2 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +11 -0
- package/dist/runtime/remote/binding-handler.mjs +227 -0
- package/dist/runtime/remote/index.d.mts +12 -0
- package/dist/runtime/remote/index.mjs +467 -0
- package/dist/runtime/response.d.mts +11 -0
- package/dist/runtime/response.mjs +1 -0
- package/dist/runtime/route-url.d.mts +2 -0
- package/dist/runtime/route-url.mjs +1 -0
- package/dist/runtime/routing.d.mts +53 -0
- package/dist/runtime/routing.mjs +425 -0
- package/dist/runtime/rpc-react.d.mts +16 -0
- package/dist/runtime/rpc-react.mjs +50 -0
- package/dist/runtime/rpc.d.mts +2 -0
- package/dist/runtime/rpc.mjs +1 -0
- package/dist/runtime/sandbox-container.d.mts +3 -0
- package/dist/runtime/sandbox-container.mjs +1 -0
- package/dist/runtime/sandbox.d.mts +5 -0
- package/dist/runtime/sandbox.mjs +196 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-mysql.d.mts +1 -0
- package/dist/runtime/schema-mysql.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +34 -0
- package/dist/runtime/seed.mjs +5 -0
- package/dist/runtime/sse-client.d.mts +31 -0
- package/dist/runtime/sse-client.mjs +42 -0
- package/dist/runtime/sse.d.mts +32 -0
- package/dist/runtime/sse.mjs +1 -0
- package/dist/runtime/storage.d.mts +4 -0
- package/dist/runtime/storage.mjs +13 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +1 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +297 -0
- package/dist/runtime/ws.d.mts +2 -0
- package/dist/runtime/ws.mjs +108 -0
- package/dist/sandbox-CWDjoEG2.d.mts +50 -0
- package/dist/sandbox-container-BqamdFCx.d.mts +73 -0
- package/dist/sandbox-container-d1AHLpgn.mjs +291 -0
- package/dist/secret-D5XrWshs.mjs +146 -0
- package/dist/skills-Dr3AjuBF.mjs +63 -0
- package/dist/sqlite-validation-CLJXXN93.mjs +24 -0
- package/dist/sse-CxR30yMF.mjs +174 -0
- package/dist/standard-schema-CuDawHOC.d.mts +40 -0
- package/dist/static-asset-marker-mWMX2dLa.mjs +38 -0
- package/dist/subcommand-prompt-B9yUo--u.mjs +370 -0
- package/dist/terminal-log-text-DNsWJREL.mjs +31 -0
- package/dist/types-D7-4tBu7.d.mts +1 -0
- package/dist/untrusted-env-lL7RkYiC.mjs +50 -0
- package/dist/validate-B-zsjhiz.mjs +162 -0
- package/dist/validate-DbqGdPPY.mjs +1 -0
- package/dist/validator-8-NZs2Xr.mjs +168 -0
- package/dist/version-metadata-DPhqnpaa.mjs +23 -0
- package/dist/wrangler-C3uyPadQ.mjs +1 -0
- package/dist/wrangler-TqTvJFWS.mjs +1452 -0
- package/dist/ws-DZRiIpYw.d.mts +137 -0
- package/dist/yarn-pnp-DgWbE7z5.mjs +91 -0
- package/docs/guide/ai.md +273 -0
- package/docs/guide/app-types.md +101 -0
- package/docs/guide/auth.md +255 -0
- package/docs/guide/database/d1.md +86 -0
- package/docs/guide/database/mysql.md +72 -0
- package/docs/guide/database/postgresql.md +94 -0
- package/docs/guide/database.md +454 -0
- package/docs/guide/deployment.md +124 -0
- package/docs/guide/durable-state.md +192 -0
- package/docs/guide/edge/headers.md +47 -0
- package/docs/guide/edge/redirects.md +85 -0
- package/docs/guide/edge/rewrites.md +119 -0
- package/docs/guide/edge/static-assets.md +94 -0
- package/docs/guide/email/domains.md +119 -0
- package/docs/guide/email/receiving.md +142 -0
- package/docs/guide/email/sending.md +262 -0
- package/docs/guide/email.md +23 -0
- package/docs/guide/env-vars.md +115 -0
- package/docs/guide/index.md +37 -0
- package/docs/guide/jobs.md +80 -0
- package/docs/guide/kv.md +100 -0
- package/docs/guide/live.md +181 -0
- package/docs/guide/platform/administration/access.md +165 -0
- package/docs/guide/platform/administration/connected-apps.md +84 -0
- package/docs/guide/platform/administration/email.md +169 -0
- package/docs/guide/platform/administration/operations.md +100 -0
- package/docs/guide/platform/administration/plans.md +156 -0
- package/docs/guide/platform/administration/projects.md +74 -0
- package/docs/guide/platform/administration/zero-trust.md +205 -0
- package/docs/guide/platform/development/local.md +122 -0
- package/docs/guide/platform/development/runtime.md +115 -0
- package/docs/guide/platform/development/schema-ci.md +44 -0
- package/docs/guide/platform/installation/ci.md +62 -0
- package/docs/guide/platform/installation/credentials.md +140 -0
- package/docs/guide/platform/installation/domains.md +120 -0
- package/docs/guide/platform/installation/first-deployment.md +95 -0
- package/docs/guide/platform/installation/maintenance.md +250 -0
- package/docs/guide/platform/installation/prerequisites.md +176 -0
- package/docs/guide/platform/installation/setup.md +300 -0
- package/docs/guide/platform/installation/uninstall.md +110 -0
- package/docs/guide/platform-administration.md +19 -0
- package/docs/guide/platform-development.md +16 -0
- package/docs/guide/procedures.md +48 -0
- package/docs/guide/project-collaboration.md +99 -0
- package/docs/guide/queues.md +149 -0
- package/docs/guide/quickstart.md +129 -0
- package/docs/guide/remote-dev.md +67 -0
- package/docs/guide/sandboxes.md +134 -0
- package/docs/guide/self-hosted-platform.md +45 -0
- package/docs/guide/server-routing.md +283 -0
- package/docs/guide/sse.md +174 -0
- package/docs/guide/storage.md +82 -0
- package/docs/guide/testing.md +64 -0
- package/docs/guide/type-safety.md +270 -0
- package/docs/guide/typed-fetch.md +98 -0
- package/docs/guide/websockets.md +230 -0
- package/docs/index.md +102 -0
- package/docs/integrations/agents.md +38 -0
- package/docs/integrations/cloudflare.md +241 -0
- package/docs/integrations/hono.md +127 -0
- package/docs/reference/api/auth.md +195 -0
- package/docs/reference/api/client.md +90 -0
- package/docs/reference/api/database.md +118 -0
- package/docs/reference/api/deploy.md +63 -0
- package/docs/reference/api/durable.md +47 -0
- package/docs/reference/api/env.md +51 -0
- package/docs/reference/api/handlers.md +189 -0
- package/docs/reference/api/plugin.md +40 -0
- package/docs/reference/api/resources.md +116 -0
- package/docs/reference/api/rewrites.md +111 -0
- package/docs/reference/api/types.md +126 -0
- package/docs/reference/api.md +71 -0
- package/docs/reference/cli/auth.md +87 -0
- package/docs/reference/cli/database.md +159 -0
- package/docs/reference/cli/deploy.md +117 -0
- package/docs/reference/cli/domains.md +42 -0
- package/docs/reference/cli/email.md +145 -0
- package/docs/reference/cli/generate.md +113 -0
- package/docs/reference/cli/github.md +181 -0
- package/docs/reference/cli/platform-config.md +93 -0
- package/docs/reference/cli/platform-email.md +81 -0
- package/docs/reference/cli/platform-installation.md +166 -0
- package/docs/reference/cli/platform-operations.md +90 -0
- package/docs/reference/cli/platform-users.md +159 -0
- package/docs/reference/cli/platform-zero-trust.md +60 -0
- package/docs/reference/cli/platform.md +78 -0
- package/docs/reference/cli/project.md +208 -0
- package/docs/reference/cli/secrets.md +79 -0
- package/docs/reference/cli/setup.md +88 -0
- package/docs/reference/cli.md +115 -0
- package/docs/reference/config.md +478 -0
- package/docs/reference/resource-inference.md +72 -0
- package/docs/reference/structure.md +138 -0
- package/package.json +389 -3
- package/sandbox.Dockerfile +4 -0
- package/schema.json +353 -0
- package/skills/bwf/SKILL.md +100 -0
- package/skills/migrate-vite-cloudflare-to-bwf/SKILL.md +53 -0
- package/templates/assets/bwf.svg +5 -0
- package/templates/assets/icons.svg +49 -0
- package/templates/assets/react.svg +1 -0
- package/templates/assets/stack.svg +35 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { n as redactMessage, t as isUnmaskActive } from "../env-mask-BsHxq3R8.mjs";
|
|
2
|
+
import { i as getRawRuntimeEnv } from "../env-raw-Bo6TtrHU.mjs";
|
|
3
|
+
import { i as isInternalBinding, n as getRuntimeEnv } from "../env-Dl4Wggec.mjs";
|
|
4
|
+
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-BX0APszT.mjs";
|
|
5
|
+
// src/runtime/env-public.ts
|
|
6
|
+
/**
|
|
7
|
+
* Public env API — `@builtbyfriends/bwf/env`.
|
|
8
|
+
*
|
|
9
|
+
* Canonical usage:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* // env.ts at project root
|
|
13
|
+
* import { defineEnv, string, number, oneOf } from "@builtbyfriends/bwf/env";
|
|
14
|
+
*
|
|
15
|
+
* export default defineEnv({
|
|
16
|
+
* STRIPE_KEY: string(),
|
|
17
|
+
* PORT: number().default(3000),
|
|
18
|
+
* NODE_ENV: oneOf(["development", "production"]),
|
|
19
|
+
* VITE_APP_TITLE: string(),
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* // anywhere else
|
|
23
|
+
* import { env } from "@builtbyfriends/bwf/env";
|
|
24
|
+
* env.STRIPE_KEY;
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* The `env` proxy reads from the underlying runtime env (Cloudflare worker
|
|
28
|
+
* bindings, Node `process.env`, etc.) via `getRuntimeEnv()`,
|
|
29
|
+
* and validates each key on first access using the registered schema.
|
|
30
|
+
*
|
|
31
|
+
* Bindings (`DB`, `KV`, `STORAGE`, `AI`, queue handlers) and other env keys
|
|
32
|
+
* not declared in the schema pass through unchanged.
|
|
33
|
+
*/
|
|
34
|
+
const ENV_REGISTRY_SYMBOL = Symbol.for("bwf.env.registry");
|
|
35
|
+
const registryGlobal = globalThis;
|
|
36
|
+
const registry = registryGlobal[ENV_REGISTRY_SYMBOL] ??= {
|
|
37
|
+
schema: null,
|
|
38
|
+
hasDefineEnvBeenCalled: false
|
|
39
|
+
};
|
|
40
|
+
let validatedCache = /* @__PURE__ */ new WeakMap();
|
|
41
|
+
function getValidatedCache(rawEnv) {
|
|
42
|
+
let cache = validatedCache.get(rawEnv);
|
|
43
|
+
if (!cache) {
|
|
44
|
+
cache = /* @__PURE__ */ new Map();
|
|
45
|
+
validatedCache.set(rawEnv, cache);
|
|
46
|
+
}
|
|
47
|
+
return cache;
|
|
48
|
+
}
|
|
49
|
+
/** Vite embeds the same public build inputs into server and browser bundles. */
|
|
50
|
+
function getClientEnvValues() {
|
|
51
|
+
const values = import.meta.env;
|
|
52
|
+
return Object.fromEntries(Object.entries(values ?? {}).filter(([key]) => key.startsWith("VITE_")));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Register an env schema and return the typed `env` proxy.
|
|
56
|
+
*
|
|
57
|
+
* Calling `defineEnv` is the only required step — bwf auto-discovers
|
|
58
|
+
* `env.ts` at project root, imports it, and uses the schema for runtime
|
|
59
|
+
* validation, type generation, and deploy-time secret checks.
|
|
60
|
+
*
|
|
61
|
+
* The return value is identical to the `env` export from `@builtbyfriends/bwf/env`.
|
|
62
|
+
* Re-export it from your `env.ts` if you prefer the explicit
|
|
63
|
+
* `import { env } from "~/env"` pattern.
|
|
64
|
+
*/
|
|
65
|
+
function defineEnv(schema) {
|
|
66
|
+
registry.schema = schema;
|
|
67
|
+
registry.hasDefineEnvBeenCalled = true;
|
|
68
|
+
validatedCache = /* @__PURE__ */ new WeakMap();
|
|
69
|
+
registry.validation = null;
|
|
70
|
+
return env;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Internal: validate the whole schema against the worker env, from the generated
|
|
74
|
+
* worker entry. Catches remote-secret values the deploy CLI cannot see. A
|
|
75
|
+
* completed validation is reused for the same raw values; an env with other
|
|
76
|
+
* values is validated again. Async validators are awaited here, and their values
|
|
77
|
+
* serve later synchronous `env.X` reads of the env this call receives, and of any
|
|
78
|
+
* other env that holds the same raw values.
|
|
79
|
+
*/
|
|
80
|
+
async function _validateEnvOnce(envValues) {
|
|
81
|
+
const schema = registry.schema;
|
|
82
|
+
if (!schema) return;
|
|
83
|
+
const inputs = readSchemaInputs(schema, envValues);
|
|
84
|
+
const last = registry.validation;
|
|
85
|
+
let state;
|
|
86
|
+
if (last && sameInputs(last.inputs, inputs)) state = last.state;
|
|
87
|
+
else {
|
|
88
|
+
state = await validateSchema(schema, inputs);
|
|
89
|
+
if (registry.schema !== schema) return _validateEnvOnce(envValues);
|
|
90
|
+
registry.validation = {
|
|
91
|
+
inputs,
|
|
92
|
+
state
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (!state.ok) throw state.error;
|
|
96
|
+
seedValidated(envValues, state.values);
|
|
97
|
+
}
|
|
98
|
+
/** The raw value of each schema key that `readKey` would validate for this env. */
|
|
99
|
+
function readSchemaInputs(schema, envValues) {
|
|
100
|
+
const values = typeof envValues === "object" && envValues !== null ? envValues : {};
|
|
101
|
+
const clientValues = getClientEnvValues();
|
|
102
|
+
return new Map(Object.keys(schema).map((key) => [key, Object.hasOwn(clientValues, key) ? clientValues[key] : values[key]]));
|
|
103
|
+
}
|
|
104
|
+
function sameInputs(a, b) {
|
|
105
|
+
if (a.size !== b.size) return false;
|
|
106
|
+
for (const [key, value] of a) if (!b.has(key) || !Object.is(b.get(key), value)) return false;
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
async function validateSchema(schema, inputs) {
|
|
110
|
+
const report = await validateAllEnvWithValues(schema, Object.fromEntries(inputs));
|
|
111
|
+
if (report.valid) return {
|
|
112
|
+
ok: true,
|
|
113
|
+
values: report.values
|
|
114
|
+
};
|
|
115
|
+
const lines = ["Env validation failed at worker boot:"];
|
|
116
|
+
for (const key of report.missing) lines.push(` • ${key} is required but missing`);
|
|
117
|
+
for (const { key, messages } of report.invalid) lines.push(` • ${key}: ${messages.join("; ")}`);
|
|
118
|
+
return {
|
|
119
|
+
ok: false,
|
|
120
|
+
error: new EnvValidationError("__init__", [{ message: lines.join("\n") }])
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** Seed the per-key cache of `rawEnv`, where `readKey` looks first, with values validated for it. */
|
|
124
|
+
function seedValidated(rawEnv, values) {
|
|
125
|
+
if (typeof rawEnv !== "object" || rawEnv === null || values.size === 0) return;
|
|
126
|
+
const cache = getValidatedCache(rawEnv);
|
|
127
|
+
for (const [key, value] of values) if (!isInternalBinding(key) && !cache.has(key)) cache.set(key, value);
|
|
128
|
+
}
|
|
129
|
+
/** Internal: framework-only access to the registered schema (for plugin/CLI). */
|
|
130
|
+
function _getRegisteredSchema() {
|
|
131
|
+
return registry.schema;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Internal: returns `true` once `defineEnv()` has been called at least once,
|
|
135
|
+
* regardless of whether the caller passed an empty schema. Gives tooling a
|
|
136
|
+
* reliable signal — `_getRegisteredSchema()` alone can't distinguish
|
|
137
|
+
* `defineEnv({})` (an intentional empty schema) from "never called".
|
|
138
|
+
*/
|
|
139
|
+
function _hasRegisteredSchema() {
|
|
140
|
+
return registry.hasDefineEnvBeenCalled;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Internal: extract `.default(value)` values from the registered schema as
|
|
144
|
+
* stringified env values. Used for explicit build-time client fallbacks.
|
|
145
|
+
*
|
|
146
|
+
* Detection is schema-agnostic: probe each validator with `undefined` and,
|
|
147
|
+
* if it succeeds with a non-undefined value, that value is the default.
|
|
148
|
+
* Works for our built-in `.default(...)` helpers and for any Standard
|
|
149
|
+
* Schema validator with intrinsic default behaviour. Async validators are
|
|
150
|
+
* skipped (we can't get a sync default).
|
|
151
|
+
*
|
|
152
|
+
* Keys with no default — required keys and plain `.optional()` keys — are omitted.
|
|
153
|
+
*/
|
|
154
|
+
function _getSchemaDefaults() {
|
|
155
|
+
const defaults = {};
|
|
156
|
+
if (!registry.schema) return defaults;
|
|
157
|
+
for (const [key, validator] of Object.entries(registry.schema)) {
|
|
158
|
+
let result;
|
|
159
|
+
try {
|
|
160
|
+
result = validator["~standard"].validate(void 0);
|
|
161
|
+
} catch {
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (result instanceof Promise) continue;
|
|
165
|
+
const r = result;
|
|
166
|
+
if (r.issues) continue;
|
|
167
|
+
if (r.value === void 0 || r.value === null) continue;
|
|
168
|
+
defaults[key] = typeof r.value === "string" ? r.value : String(r.value);
|
|
169
|
+
}
|
|
170
|
+
return defaults;
|
|
171
|
+
}
|
|
172
|
+
var EnvValidationError = class extends Error {
|
|
173
|
+
key;
|
|
174
|
+
issues;
|
|
175
|
+
constructor(key, issues) {
|
|
176
|
+
super(`Invalid env "${key}": ${issues.map((i) => i.message).join(", ")}`);
|
|
177
|
+
this.name = "EnvValidationError";
|
|
178
|
+
this.key = key;
|
|
179
|
+
this.issues = issues;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
function readKey(key) {
|
|
183
|
+
const rawEnv = getRawRuntimeEnv();
|
|
184
|
+
if (isInternalBinding(key)) return;
|
|
185
|
+
const filtered = getRuntimeEnv();
|
|
186
|
+
const clientValues = getClientEnvValues();
|
|
187
|
+
const rawValue = Object.hasOwn(clientValues, key) ? clientValues[key] : filtered[key];
|
|
188
|
+
if (!registry.schema) return rawValue;
|
|
189
|
+
const validator = Object.hasOwn(registry.schema, key) ? registry.schema[key] : void 0;
|
|
190
|
+
if (!validator) return rawValue;
|
|
191
|
+
const cache = getValidatedCache(rawEnv);
|
|
192
|
+
if (cache.has(key)) return cache.get(key);
|
|
193
|
+
const latest = registry.validation;
|
|
194
|
+
if (latest?.state.ok && latest.state.values.has(key) && Object.is(latest.inputs.get(key), rawValue)) return latest.state.values.get(key);
|
|
195
|
+
const result = validator["~standard"].validate(rawValue);
|
|
196
|
+
if (result instanceof Promise) throw new Error(`env: Async validator for '${key}' cannot be resolved synchronously. Proxy property access is synchronous, so async Standard Schema validators must be pre-resolved by calling \`_validateEnvOnce(env)\` at worker boot (bwf splices this into the generated entry) or by awaiting \`validateAllEnv(env)\` before the first \`env.${key}\` read. Once pre-validated, the resolved value is cached and served synchronously here.`);
|
|
197
|
+
if (result.issues) {
|
|
198
|
+
const unmask = isUnmaskActive();
|
|
199
|
+
throw new EnvValidationError(key, result.issues.map((i) => ({
|
|
200
|
+
...i,
|
|
201
|
+
message: redactMessage(rawValue, i.message, { unmask })
|
|
202
|
+
})));
|
|
203
|
+
}
|
|
204
|
+
cache.set(key, result.value);
|
|
205
|
+
return result.value;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Typed env proxy. Reads from the runtime env, validating declared keys
|
|
209
|
+
* on first access and passing through bindings / unknown keys unchanged.
|
|
210
|
+
* Async validators must be resolved first by `_validateEnvOnce()`.
|
|
211
|
+
*/
|
|
212
|
+
const env = new Proxy({}, {
|
|
213
|
+
get(_target, key) {
|
|
214
|
+
if (typeof key === "symbol") return;
|
|
215
|
+
return readKey(key);
|
|
216
|
+
},
|
|
217
|
+
has(_target, key) {
|
|
218
|
+
if (typeof key === "symbol") return false;
|
|
219
|
+
return Object.hasOwn(getClientEnvValues(), key) || Reflect.has(getRuntimeEnv(), key);
|
|
220
|
+
},
|
|
221
|
+
ownKeys() {
|
|
222
|
+
return [.../* @__PURE__ */ new Set([...Reflect.ownKeys(getRuntimeEnv()), ...Object.keys(getClientEnvValues())])];
|
|
223
|
+
},
|
|
224
|
+
getOwnPropertyDescriptor(_target, key) {
|
|
225
|
+
if (typeof key === "symbol") return;
|
|
226
|
+
return {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
configurable: true,
|
|
229
|
+
value: readKey(String(key))
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
/**
|
|
234
|
+
* Validate an env record (local dotenv, build inputs, or runtime bindings) against
|
|
235
|
+
* the registered schema. Used by the dev plugin (warnings), the deploy CLI
|
|
236
|
+
* (hard error), and `_validateEnvOnce` at worker boot.
|
|
237
|
+
*
|
|
238
|
+
* Async: awaits any validators that return a `Promise` (zod async refines,
|
|
239
|
+
* arktype narrows, etc.). Callers already run in async contexts.
|
|
240
|
+
*/
|
|
241
|
+
async function validateAllEnv(envValues) {
|
|
242
|
+
if (!registry.schema) return {
|
|
243
|
+
valid: true,
|
|
244
|
+
missing: [],
|
|
245
|
+
invalid: [],
|
|
246
|
+
values: /* @__PURE__ */ new Map()
|
|
247
|
+
};
|
|
248
|
+
return await validateAllEnvWithValues(registry.schema, envValues);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Internal: shared core that validates a schema against values and also
|
|
252
|
+
* returns the resolved values (for sync reads).
|
|
253
|
+
*/
|
|
254
|
+
async function validateAllEnvWithValues(schema, envValues) {
|
|
255
|
+
const report = {
|
|
256
|
+
valid: true,
|
|
257
|
+
missing: [],
|
|
258
|
+
invalid: [],
|
|
259
|
+
values: /* @__PURE__ */ new Map()
|
|
260
|
+
};
|
|
261
|
+
const unmask = isUnmaskActive();
|
|
262
|
+
for (const [key, validator] of Object.entries(schema)) {
|
|
263
|
+
const raw = envValues[key];
|
|
264
|
+
const resultMaybe = validator["~standard"].validate(raw);
|
|
265
|
+
const result = resultMaybe instanceof Promise ? await resultMaybe : resultMaybe;
|
|
266
|
+
if (result.issues) {
|
|
267
|
+
report.valid = false;
|
|
268
|
+
if (raw === void 0 || raw === null || raw === "") report.missing.push(key);
|
|
269
|
+
else report.invalid.push({
|
|
270
|
+
key,
|
|
271
|
+
messages: result.issues.map((i) => redactMessage(raw, i.message, { unmask }))
|
|
272
|
+
});
|
|
273
|
+
} else report.values.set(key, result.value);
|
|
274
|
+
}
|
|
275
|
+
return report;
|
|
276
|
+
}
|
|
277
|
+
export { EnvValidationError, _getRegisteredSchema, _getSchemaDefaults, _hasRegisteredSchema, _validateEnvOnce, boolean, defineEnv, email, env, json, number, oneOf, string, url, validateAllEnv };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
type RuntimeEnv = Record<string, unknown>;
|
|
3
|
+
/** @internal Reuse a resource only within the current runtime request. */
|
|
4
|
+
export declare function getRuntimeRequestResource<T>(key: object, initialize: () => T, outsideScope?: () => T): T;
|
|
5
|
+
export declare function withRuntimeEnv<T>(env: unknown, fn: () => T): T;
|
|
6
|
+
/** Whether `name` is a framework binding hidden from user code. */
|
|
7
|
+
export declare function isInternalBinding(name: string): boolean;
|
|
8
|
+
/** Returns the runtime env with internal platform bindings hidden. */
|
|
9
|
+
export declare function getRuntimeEnv(): RuntimeEnv;
|
|
10
|
+
export declare function getRuntimeBinding<T = unknown>(name: string): T | undefined;
|
|
11
|
+
export declare function requireRuntimeBinding<T = unknown>(name: string): T;
|
|
12
|
+
export type { RuntimeEnv };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as getRuntimeBinding, n as getRuntimeEnv, r as getRuntimeRequestResource, i as isInternalBinding, a as requireRuntimeBinding, o as withRuntimeEnv } from "../env-Dl4Wggec.mjs";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { a as UntypedFetchOptions, c as FetchError } from "../fetch-CBgyyhzm.mjs";
|
|
2
|
+
/** Keep local calls in the app while using the browser client's request and error handling. */
|
|
3
|
+
export declare function createServerFetch<Context extends {
|
|
4
|
+
request?: Request;
|
|
5
|
+
}>(dispatch: (request: Request, context: Context | undefined) => Response | Promise<Response>, getContext: () => Context | undefined, fallbackOrigin: string): (path: string, options?: UntypedFetchOptions) => Promise<unknown>;
|
|
6
|
+
export { FetchError };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { t as createRouteFetch } from "../fetch-tpPiSK10.mjs";
|
|
2
|
+
import { t as FetchError } from "../fetch-error-DmlRM6e4.mjs";
|
|
3
|
+
// src/runtime/fetch-server.ts
|
|
4
|
+
/** Keep local calls in the app while using the browser client's request and error handling. */
|
|
5
|
+
function createServerFetch(dispatch, getContext, fallbackOrigin) {
|
|
6
|
+
return createRouteFetch(async (input, init) => {
|
|
7
|
+
const store = getContext();
|
|
8
|
+
const origin = store?.request ? new URL(store.request.url).origin : fallbackOrigin;
|
|
9
|
+
const request = new Request(new URL(String(input), origin), init);
|
|
10
|
+
if (new URL(request.url).origin !== origin) return globalThis.fetch(request);
|
|
11
|
+
for (const name of ["cookie", "authorization"]) if (!request.headers.has(name)) {
|
|
12
|
+
const value = store?.request?.headers.get(name);
|
|
13
|
+
if (value) request.headers.set(name, value);
|
|
14
|
+
}
|
|
15
|
+
const signal = request.signal;
|
|
16
|
+
signal.throwIfAborted();
|
|
17
|
+
let abort;
|
|
18
|
+
try {
|
|
19
|
+
return await new Promise((resolve, reject) => {
|
|
20
|
+
abort = () => reject(signal.reason);
|
|
21
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
22
|
+
Promise.resolve(dispatch(request, store)).then(resolve, reject);
|
|
23
|
+
});
|
|
24
|
+
} finally {
|
|
25
|
+
signal.removeEventListener("abort", abort);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { FetchError, createServerFetch };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as UntypedFetchOptions, c as FetchError, i as QueryOption, n as MethodsOf, o as createRouteFetch, r as ParamsOption, s as fetch, t as BodyOption } from "../fetch-CBgyyhzm.mjs";
|
|
2
|
+
export { BodyOption, FetchError, MethodsOf, ParamsOption, QueryOption, UntypedFetchOptions, createRouteFetch, fetch };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
+
import { _ as HandlerInput, a as CloudContextVariables, c as QueueMessage, d as TypedQueueHandler, f as basicAuth, g as defineScheduled, h as defineQueue, i as CloudContext, l as QueueRetryOptions, m as defineMiddleware, n as BwfAssetRewriteError, o as CloudEnv, p as defineHandler, r as CloudBindings, s as QueueBatch, t as BasicAuthOptions, u as TypedHandler, v as ValidatorSlots } from "../handler-B_ocHStk.mjs";
|
|
3
|
+
export { BasicAuthOptions, BwfAssetRewriteError, CloudBindings, CloudContext, CloudContextVariables, CloudEnv, type HandlerInput, QueueBatch, QueueMessage, QueueRetryOptions, TypedHandler, TypedQueueHandler, type ValidatorSlots, basicAuth, defineHandler, defineMiddleware, defineQueue, defineScheduled };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as BwfAssetRewriteError, n as basicAuth, r as defineHandler, i as defineMiddleware, a as defineQueue, o as defineScheduled } from "../handler-CNq7aSs1.mjs";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type PutOptions = {
|
|
2
|
+
ttl?: number;
|
|
3
|
+
expiration?: number;
|
|
4
|
+
metadata?: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export type ListOptions = {
|
|
7
|
+
prefix?: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
cursor?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ListKey<M = unknown> = {
|
|
12
|
+
name: string;
|
|
13
|
+
expiration?: number;
|
|
14
|
+
metadata?: M;
|
|
15
|
+
};
|
|
16
|
+
export type ListResult<M = unknown> = {
|
|
17
|
+
keys: Array<ListKey<M>>;
|
|
18
|
+
list_complete: boolean;
|
|
19
|
+
cursor?: string;
|
|
20
|
+
};
|
|
21
|
+
export type KVMap<T> = {
|
|
22
|
+
get(key: string): Promise<T | null>;
|
|
23
|
+
put(key: string, value: T, options?: PutOptions): Promise<void>;
|
|
24
|
+
delete(key: string): Promise<void>;
|
|
25
|
+
list<M = unknown>(options?: Omit<ListOptions, "prefix">): Promise<ListResult<M>>;
|
|
26
|
+
getWithMetadata<M = unknown>(key: string): Promise<{
|
|
27
|
+
value: T | null;
|
|
28
|
+
metadata: M | null;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
export type KVClient = {
|
|
32
|
+
get<T = string>(key: string): Promise<T | null>;
|
|
33
|
+
put(key: string, value: unknown, options?: PutOptions): Promise<void>;
|
|
34
|
+
delete(key: string): Promise<void>;
|
|
35
|
+
list<M = unknown>(options?: ListOptions): Promise<ListResult<M>>;
|
|
36
|
+
getWithMetadata<T = string, M = unknown>(key: string): Promise<{
|
|
37
|
+
value: T | null;
|
|
38
|
+
metadata: M | null;
|
|
39
|
+
}>;
|
|
40
|
+
map<T = unknown>(prefix: string): KVMap<T>;
|
|
41
|
+
};
|
|
42
|
+
/** Create a KV client for a specific KVNamespace instance. */
|
|
43
|
+
export declare function createKV(namespace: KVNamespace): KVClient;
|
|
44
|
+
/** Default KV client — resolves `KV` from the active runtime environment. */
|
|
45
|
+
export declare const kv: KVClient;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { a as requireRuntimeBinding } from "../env-Dl4Wggec.mjs";
|
|
2
|
+
// src/runtime/kv.ts
|
|
3
|
+
function parseValue(raw) {
|
|
4
|
+
if (raw === null) return null;
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(raw);
|
|
7
|
+
} catch {
|
|
8
|
+
return raw;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function serializeValue(value) {
|
|
12
|
+
return JSON.stringify(value);
|
|
13
|
+
}
|
|
14
|
+
function toPutOptions(options) {
|
|
15
|
+
const opts = {};
|
|
16
|
+
if (options?.ttl) opts.expirationTtl = options.ttl;
|
|
17
|
+
if (options?.expiration) opts.expiration = options.expiration;
|
|
18
|
+
if (options?.metadata) opts.metadata = options.metadata;
|
|
19
|
+
return opts;
|
|
20
|
+
}
|
|
21
|
+
function getListCursor(result) {
|
|
22
|
+
return typeof result.cursor === "string" ? result.cursor : void 0;
|
|
23
|
+
}
|
|
24
|
+
function createKVMap(getNS, prefix) {
|
|
25
|
+
const prefixed = (key) => `${prefix}:${key}`;
|
|
26
|
+
return {
|
|
27
|
+
async get(key) {
|
|
28
|
+
return parseValue(await getNS().get(prefixed(key)));
|
|
29
|
+
},
|
|
30
|
+
async put(key, value, options) {
|
|
31
|
+
await getNS().put(prefixed(key), serializeValue(value), toPutOptions(options));
|
|
32
|
+
},
|
|
33
|
+
async delete(key) {
|
|
34
|
+
await getNS().delete(prefixed(key));
|
|
35
|
+
},
|
|
36
|
+
async list(options) {
|
|
37
|
+
const result = await getNS().list({
|
|
38
|
+
prefix: `${prefix}:`,
|
|
39
|
+
limit: options?.limit,
|
|
40
|
+
cursor: options?.cursor
|
|
41
|
+
});
|
|
42
|
+
const stripLen = prefix.length + 1;
|
|
43
|
+
return {
|
|
44
|
+
keys: result.keys.map((k) => ({
|
|
45
|
+
...k,
|
|
46
|
+
name: k.name.slice(stripLen)
|
|
47
|
+
})),
|
|
48
|
+
list_complete: result.list_complete,
|
|
49
|
+
cursor: getListCursor(result)
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
async getWithMetadata(key) {
|
|
53
|
+
const result = await getNS().getWithMetadata(prefixed(key));
|
|
54
|
+
const metadata = result.metadata;
|
|
55
|
+
return {
|
|
56
|
+
value: parseValue(result.value),
|
|
57
|
+
metadata
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function createKVClient(getNS) {
|
|
63
|
+
return {
|
|
64
|
+
async get(key) {
|
|
65
|
+
return parseValue(await getNS().get(key));
|
|
66
|
+
},
|
|
67
|
+
async put(key, value, options) {
|
|
68
|
+
await getNS().put(key, serializeValue(value), toPutOptions(options));
|
|
69
|
+
},
|
|
70
|
+
async delete(key) {
|
|
71
|
+
await getNS().delete(key);
|
|
72
|
+
},
|
|
73
|
+
async list(options) {
|
|
74
|
+
const result = await getNS().list({
|
|
75
|
+
prefix: options?.prefix,
|
|
76
|
+
limit: options?.limit,
|
|
77
|
+
cursor: options?.cursor
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
keys: result.keys,
|
|
81
|
+
list_complete: result.list_complete,
|
|
82
|
+
cursor: getListCursor(result)
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
async getWithMetadata(key) {
|
|
86
|
+
const result = await getNS().getWithMetadata(key);
|
|
87
|
+
return {
|
|
88
|
+
value: parseValue(result.value),
|
|
89
|
+
metadata: result.metadata
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
map(prefix) {
|
|
93
|
+
return createKVMap(getNS, prefix);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** Create a KV client for a specific KVNamespace instance. */
|
|
98
|
+
function createKV(namespace) {
|
|
99
|
+
return createKVClient(() => namespace);
|
|
100
|
+
}
|
|
101
|
+
/** Default KV client — resolves `KV` from the active runtime environment. */
|
|
102
|
+
const kv = createKVClient(() => requireRuntimeBinding("KV"));
|
|
103
|
+
export { createKV, kv };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as UsageLimit, n as asUsageLimit, r as limitFromResponse, i as readUsageLimit } from "../limits-D27Lp6FP.mjs";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as LiveClientEvent } from "../live-KkEeda1Z.mjs";
|
|
2
|
+
import { n as RequestUrl } from "../route-url-Bla3Upsy.mjs";
|
|
3
|
+
export type LiveSubscribeOptions<Data = unknown> = {
|
|
4
|
+
id: string;
|
|
5
|
+
topic: string;
|
|
6
|
+
lastEventId?: string;
|
|
7
|
+
onEvent?: (event: LiveClientEvent<Data>) => void;
|
|
8
|
+
};
|
|
9
|
+
export type ConnectLiveStreamOptions = {
|
|
10
|
+
withCredentials?: boolean;
|
|
11
|
+
fetch?: typeof fetch;
|
|
12
|
+
headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
|
|
13
|
+
eventSource?: EventSourceConstructor;
|
|
14
|
+
keepOpen?: boolean;
|
|
15
|
+
retryDelay?: number;
|
|
16
|
+
onError?: (error: Event | Error) => void;
|
|
17
|
+
};
|
|
18
|
+
export type LiveClient = {
|
|
19
|
+
readonly connectionId: string;
|
|
20
|
+
subscribe<Data = unknown>(options: LiveSubscribeOptions<Data>): Promise<() => Promise<void>>;
|
|
21
|
+
close(): void;
|
|
22
|
+
};
|
|
23
|
+
type EventSourceLike = {
|
|
24
|
+
addEventListener(type: string, listener: (event: Event) => void): void;
|
|
25
|
+
removeEventListener(type: string, listener: (event: Event) => void): void;
|
|
26
|
+
close(): void;
|
|
27
|
+
};
|
|
28
|
+
type EventSourceConstructor = new (url: string, options?: {
|
|
29
|
+
withCredentials?: boolean;
|
|
30
|
+
}) => EventSourceLike;
|
|
31
|
+
/**
|
|
32
|
+
* Open one `EventSource` to a `defineLiveStream()` route and send subscribe and
|
|
33
|
+
* unsubscribe requests to the same URL.
|
|
34
|
+
*
|
|
35
|
+
* With `routing.typedRoutes`, a string `url` must match one of the app's routes
|
|
36
|
+
* or be an absolute `http://`/`https://` URL. Cast a path built at runtime with
|
|
37
|
+
* `as RouteUrl`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function connectLiveStream(url: RequestUrl | URL, options?: ConnectLiveStreamOptions): LiveClient;
|
|
40
|
+
export {};
|