@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,538 @@
|
|
|
1
|
+
import { n as operatorGroups, r as parseOperatorArgs } from "./operator-args-BiGmSlZx.mjs";
|
|
2
|
+
import { R2_LOCATION_HINTS, isR2LocationHint } from "@builtbyfriends/deploy-core";
|
|
3
|
+
import { PLATFORM_LOGIN_KINDS, normalizePlatformDashboardUrl, parsePlatformLoginId } from "@builtbyfriends/platform";
|
|
4
|
+
import { parsePlatformPlanId } from "@builtbyfriends/platform/plans";
|
|
5
|
+
// src/cli/platform-config-args.ts
|
|
6
|
+
const PLATFORM_AUTH_ACTIONS = [
|
|
7
|
+
"list",
|
|
8
|
+
"show",
|
|
9
|
+
"initialize",
|
|
10
|
+
"add",
|
|
11
|
+
"configure",
|
|
12
|
+
"test",
|
|
13
|
+
"enable",
|
|
14
|
+
"disable",
|
|
15
|
+
"link",
|
|
16
|
+
"admission",
|
|
17
|
+
"protection",
|
|
18
|
+
"recover"
|
|
19
|
+
];
|
|
20
|
+
function parsePlatformConfigArgs(args) {
|
|
21
|
+
if (args.length && args[0] !== "auth") throw new Error("platform: Usage: bwf platform config auth [command] [options].");
|
|
22
|
+
const { positional, flags, values } = parseConfigFlags(args, "auth", [
|
|
23
|
+
"connection",
|
|
24
|
+
"installation",
|
|
25
|
+
"id",
|
|
26
|
+
"file",
|
|
27
|
+
"client-secret-env",
|
|
28
|
+
"test-id"
|
|
29
|
+
]);
|
|
30
|
+
const [action = "", target = "", ...extra] = positional;
|
|
31
|
+
if (extra.length || action && !PLATFORM_AUTH_ACTIONS.includes(action)) throw new Error(`platform: Usage: bwf platform config auth <${PLATFORM_AUTH_ACTIONS.join("|")}>.`);
|
|
32
|
+
const needsTarget = action && action !== "list" && action !== "initialize" && action !== "admission";
|
|
33
|
+
if (needsTarget && !target || !needsTarget && target) throw new Error(`platform: ${action || "config auth"} ${needsTarget ? "requires a method" : "does not accept a method"}.`);
|
|
34
|
+
if (action === "add") {
|
|
35
|
+
if (!PLATFORM_LOGIN_KINDS.includes(target)) throw new Error(`platform: Login kind must be ${PLATFORM_LOGIN_KINDS.join(", ")}.`);
|
|
36
|
+
} else if (action === "protection") {
|
|
37
|
+
if (![
|
|
38
|
+
"enable",
|
|
39
|
+
"disable",
|
|
40
|
+
"show"
|
|
41
|
+
].includes(target)) throw new Error("platform: Usage: bwf platform config auth protection <enable|disable|show>.");
|
|
42
|
+
} else if (target) parsePlatformLoginId(target);
|
|
43
|
+
if (flags.has("plan") && flags.has("yes")) throw new Error("platform: --plan and --yes cannot be combined.");
|
|
44
|
+
if ((!action || action === "list" || action === "show") && (flags.has("plan") || flags.has("yes"))) throw new Error("platform: Select a configuration change before using --plan or --yes.");
|
|
45
|
+
if (values.has("id") && action !== "add") throw new Error("platform: --id is only valid when adding a login method.");
|
|
46
|
+
if (values.has("installation") && action !== "recover" && action !== "protection") throw new Error("platform: --installation is only valid for recovery or platform protection.");
|
|
47
|
+
if (values.has("file") && ![
|
|
48
|
+
"add",
|
|
49
|
+
"configure",
|
|
50
|
+
"admission",
|
|
51
|
+
"recover",
|
|
52
|
+
"protection"
|
|
53
|
+
].includes(action) || values.has("client-secret-env") && ![
|
|
54
|
+
"add",
|
|
55
|
+
"configure",
|
|
56
|
+
"recover"
|
|
57
|
+
].includes(action)) throw new Error("platform: --file is valid for add, configure, admission, recover, or protection; --client-secret-env is valid for add, configure, or recover.");
|
|
58
|
+
if (values.has("test-id") && action !== "enable" && action !== "link") throw new Error("platform: --test-id is only valid for enable or link.");
|
|
59
|
+
const secretEnv = values.get("client-secret-env") ?? "";
|
|
60
|
+
if (secretEnv && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(secretEnv)) throw new Error("platform: --client-secret-env requires an environment-variable name.");
|
|
61
|
+
if (values.has("id")) parsePlatformLoginId(values.get("id"));
|
|
62
|
+
return {
|
|
63
|
+
subcommand: "config",
|
|
64
|
+
action,
|
|
65
|
+
target,
|
|
66
|
+
connection: values.get("connection") ?? "",
|
|
67
|
+
installation: values.get("installation") ?? "",
|
|
68
|
+
id: values.get("id") ?? "",
|
|
69
|
+
file: values.get("file") ?? "",
|
|
70
|
+
clientSecretEnv: secretEnv,
|
|
71
|
+
testId: values.get("test-id") ?? "",
|
|
72
|
+
json: flags.has("json"),
|
|
73
|
+
plan: flags.has("plan"),
|
|
74
|
+
yes: flags.has("yes")
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** Parses `config <group>` flags: --json, --plan, --yes, and the given value flags. */
|
|
78
|
+
function parseConfigFlags(args, group, valueFlags) {
|
|
79
|
+
const positional = [];
|
|
80
|
+
const flags = /* @__PURE__ */ new Set();
|
|
81
|
+
const values = /* @__PURE__ */ new Map();
|
|
82
|
+
for (let index = 1; index < args.length; index++) {
|
|
83
|
+
const arg = args[index];
|
|
84
|
+
if (!arg.startsWith("-")) {
|
|
85
|
+
positional.push(arg);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const name = arg.slice(2);
|
|
89
|
+
if (!arg.startsWith("--") || ![
|
|
90
|
+
"json",
|
|
91
|
+
"plan",
|
|
92
|
+
"yes"
|
|
93
|
+
].includes(name) && !valueFlags.includes(name)) throw new Error(`platform: Unknown config ${group} flag ${arg}.`);
|
|
94
|
+
if (flags.has(name) || values.has(name)) throw new Error(`platform: Duplicate flag ${arg}.`);
|
|
95
|
+
if (!valueFlags.includes(name)) {
|
|
96
|
+
flags.add(name);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const value = args[++index];
|
|
100
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${arg} requires a value.`);
|
|
101
|
+
values.set(name, value);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
positional,
|
|
105
|
+
flags,
|
|
106
|
+
values
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// src/cli/platform-plans-args.ts
|
|
110
|
+
const PLATFORM_PLAN_ACTIONS = [
|
|
111
|
+
"show",
|
|
112
|
+
"add",
|
|
113
|
+
"set",
|
|
114
|
+
"reset",
|
|
115
|
+
"archive",
|
|
116
|
+
"restore",
|
|
117
|
+
"remove",
|
|
118
|
+
"default",
|
|
119
|
+
"sync"
|
|
120
|
+
];
|
|
121
|
+
function parsePlatformPlansArgs(args) {
|
|
122
|
+
const { positional, flags, values } = parseConfigFlags(args, "plans", [
|
|
123
|
+
"connection",
|
|
124
|
+
"file",
|
|
125
|
+
"name",
|
|
126
|
+
"copy",
|
|
127
|
+
"replacement"
|
|
128
|
+
]);
|
|
129
|
+
const [action = "", target = "", ...extra] = positional;
|
|
130
|
+
if (extra.length || action && !PLATFORM_PLAN_ACTIONS.includes(action)) throw new Error(`platform: Usage: bwf platform config plans [${PLATFORM_PLAN_ACTIONS.join("|")}] [plan-id] [options].`);
|
|
131
|
+
const needsTarget = action && action !== "show" && action !== "sync";
|
|
132
|
+
if (needsTarget && !target || (!action || action === "sync") && target) throw new Error(`platform: ${action || "config plans"} ${needsTarget ? "requires" : "does not accept"} a plan ID.`);
|
|
133
|
+
for (const id of [
|
|
134
|
+
target,
|
|
135
|
+
values.get("copy"),
|
|
136
|
+
values.get("replacement")
|
|
137
|
+
].filter(Boolean)) parsePlatformPlanId(id);
|
|
138
|
+
if (flags.has("plan") && flags.has("yes")) throw new Error("platform: --plan and --yes cannot be combined.");
|
|
139
|
+
if ((!action || action === "show") && (flags.has("plan") || flags.has("yes"))) throw new Error("platform: Select a configuration change before using --plan or --yes.");
|
|
140
|
+
for (const [name, actions] of [
|
|
141
|
+
["file", ["add", "set"]],
|
|
142
|
+
["name", ["add", "set"]],
|
|
143
|
+
["copy", ["add"]],
|
|
144
|
+
["replacement", ["remove"]]
|
|
145
|
+
]) if (values.has(name) && !actions.includes(action)) throw new Error(`platform: --${name} is only valid for ${actions.join(" or ")}.`);
|
|
146
|
+
return {
|
|
147
|
+
subcommand: "config",
|
|
148
|
+
configGroup: "plans",
|
|
149
|
+
action,
|
|
150
|
+
target,
|
|
151
|
+
connection: values.get("connection") ?? "",
|
|
152
|
+
file: values.get("file") ?? "",
|
|
153
|
+
name: values.get("name") ?? "",
|
|
154
|
+
copy: values.get("copy") ?? "",
|
|
155
|
+
replacement: values.get("replacement") ?? "",
|
|
156
|
+
json: flags.has("json"),
|
|
157
|
+
plan: flags.has("plan"),
|
|
158
|
+
yes: flags.has("yes")
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// src/cli/platform-storage.ts
|
|
162
|
+
function parsePlatformStorageLocation(value) {
|
|
163
|
+
if (value !== "automatic" && !isR2LocationHint(value)) throw new Error(`platform: --storage-location must be automatic or one of: ${R2_LOCATION_HINTS.join(", ")}.`);
|
|
164
|
+
return value;
|
|
165
|
+
}
|
|
166
|
+
function assertPlatformStorageSupported(deployment, runtime) {
|
|
167
|
+
if (deployment.storageLocationHint && runtime.storageLocationHint !== 1) throw new Error("platform: This runtime cannot apply the storage location hint. Use a current platform runtime, or run `bwf platform upgrade --storage-location automatic` first.");
|
|
168
|
+
}
|
|
169
|
+
// src/cli/platform-args.ts
|
|
170
|
+
const platformSubcommands = [
|
|
171
|
+
{
|
|
172
|
+
name: "config",
|
|
173
|
+
hint: "Authentication, plans, and limits",
|
|
174
|
+
description: "Configure login methods, protection, plans, or limits"
|
|
175
|
+
},
|
|
176
|
+
...operatorGroups.map((name) => ({
|
|
177
|
+
name,
|
|
178
|
+
hint: name === "email" ? "Domains, shared recipients, policy, limits, and recovery" : name === "zero-trust" ? "Configure Access protection and project overrides" : name === "project" ? "Inspect, normalize, transfer, or remove projects" : "Operator commands",
|
|
179
|
+
description: `Administer platform ${name}`
|
|
180
|
+
})),
|
|
181
|
+
{
|
|
182
|
+
name: "list",
|
|
183
|
+
description: "List installed and connected platforms"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "use",
|
|
187
|
+
arg: "[id]",
|
|
188
|
+
description: "Select the default bwf platform"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "status",
|
|
192
|
+
arg: "[id]",
|
|
193
|
+
description: "Inspect a platform and its health"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "discover",
|
|
197
|
+
description: "Recover installations from a Cloudflare account"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "domain",
|
|
201
|
+
hint: "Set an application domain",
|
|
202
|
+
description: "Add a domain to a workers.dev test platform"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "install",
|
|
206
|
+
hint: "Preview and save choices with --plan, then select the saved plan to install",
|
|
207
|
+
description: "Install a bwf platform and choose who can access its apps"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "upgrade",
|
|
211
|
+
arg: "[id]",
|
|
212
|
+
description: "Upgrade an installed bwf platform"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "rollback",
|
|
216
|
+
arg: "[id]",
|
|
217
|
+
description: "Restore a compatible earlier platform runtime"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "repair",
|
|
221
|
+
arg: "[id]",
|
|
222
|
+
description: "Reconcile a platform, its dashboard origin, or unfinished login setup"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "disable",
|
|
226
|
+
arg: "[id]",
|
|
227
|
+
description: "Disable traffic without deleting data"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "enable",
|
|
231
|
+
arg: "[id]",
|
|
232
|
+
description: "Restore traffic for a disabled platform"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "uninstall",
|
|
236
|
+
arg: "[id]",
|
|
237
|
+
description: "Safely remove an installed bwf platform"
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
function parseRuntimeLogs(value) {
|
|
241
|
+
if (value !== "full" && value !== "minimal") throw new Error("platform: --runtime-logs must be full or minimal.");
|
|
242
|
+
return value;
|
|
243
|
+
}
|
|
244
|
+
function readValue(rest, index, flag) {
|
|
245
|
+
const value = rest[index + 1];
|
|
246
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${flag} requires a value.`);
|
|
247
|
+
return [value, index + 1];
|
|
248
|
+
}
|
|
249
|
+
function parseSelector(rest, subcommand, options = {}) {
|
|
250
|
+
let selector = "";
|
|
251
|
+
let plan = false;
|
|
252
|
+
let yes = false;
|
|
253
|
+
for (const arg of rest) if (arg === "--plan") plan = true;
|
|
254
|
+
else if (arg === "--yes" && options.allowYes) yes = true;
|
|
255
|
+
else if (arg.startsWith("-")) throw new Error(`platform: Unknown flag '${arg}'.`);
|
|
256
|
+
else if (selector) throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
257
|
+
else selector = arg;
|
|
258
|
+
if ((subcommand === "use" || subcommand === "status") && plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
259
|
+
return {
|
|
260
|
+
selector,
|
|
261
|
+
plan,
|
|
262
|
+
yes
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function parseLifecycleSelector(rest, subcommand) {
|
|
266
|
+
const positional = [];
|
|
267
|
+
let acceptOutsideChanges = false;
|
|
268
|
+
let runtimeLogs;
|
|
269
|
+
let storageLocation;
|
|
270
|
+
let runtime = "";
|
|
271
|
+
let fromRuntime = "";
|
|
272
|
+
let authConfig;
|
|
273
|
+
let dashboardUrl;
|
|
274
|
+
let customDomains = false;
|
|
275
|
+
for (let index = 0; index < rest.length; index++) {
|
|
276
|
+
const arg = rest[index];
|
|
277
|
+
if (arg === "--runtime") {
|
|
278
|
+
if (subcommand === "disable") throw new Error("platform: Unknown flag '--runtime'.");
|
|
279
|
+
const [value, next] = readValue(rest, index, arg);
|
|
280
|
+
runtime = value;
|
|
281
|
+
index = next;
|
|
282
|
+
} else if (arg === "--dashboard-url" && (subcommand === "upgrade" || subcommand === "repair")) {
|
|
283
|
+
const [value, next] = readValue(rest, index, arg);
|
|
284
|
+
dashboardUrl = normalizePlatformDashboardUrl(value);
|
|
285
|
+
index = next;
|
|
286
|
+
} else if (arg === "--custom-domains" && (subcommand === "upgrade" || subcommand === "repair")) customDomains = true;
|
|
287
|
+
else if (arg === "--accept-outside-changes" && (subcommand === "upgrade" || subcommand === "repair")) acceptOutsideChanges = true;
|
|
288
|
+
else if (arg === "--storage-location" && subcommand === "upgrade") {
|
|
289
|
+
const [value, next] = readValue(rest, index, arg);
|
|
290
|
+
storageLocation = parsePlatformStorageLocation(value);
|
|
291
|
+
index = next;
|
|
292
|
+
} else if (arg === "--runtime-logs" && subcommand === "upgrade") {
|
|
293
|
+
const [value, next] = readValue(rest, index, arg);
|
|
294
|
+
runtimeLogs = parseRuntimeLogs(value);
|
|
295
|
+
index = next;
|
|
296
|
+
} else if (arg === "--auth-config" && subcommand === "repair") {
|
|
297
|
+
const [value, next] = readValue(rest, index, arg);
|
|
298
|
+
authConfig = value;
|
|
299
|
+
index = next;
|
|
300
|
+
} else if (arg === "--from-runtime" && subcommand === "rollback") {
|
|
301
|
+
const [value, next] = readValue(rest, index, arg);
|
|
302
|
+
fromRuntime = value;
|
|
303
|
+
index = next;
|
|
304
|
+
} else positional.push(arg);
|
|
305
|
+
}
|
|
306
|
+
const parsed = parseSelector(positional, subcommand, { allowYes: true });
|
|
307
|
+
if (subcommand === "rollback" && !runtime) throw new Error("platform: rollback requires --runtime <earlier-runtime-directory>.");
|
|
308
|
+
return {
|
|
309
|
+
...parsed,
|
|
310
|
+
runtime,
|
|
311
|
+
fromRuntime,
|
|
312
|
+
...authConfig !== void 0 ? { authConfig } : {},
|
|
313
|
+
...dashboardUrl !== void 0 ? { dashboardUrl } : {},
|
|
314
|
+
...customDomains ? { customDomains: true } : {},
|
|
315
|
+
...acceptOutsideChanges ? { acceptOutsideChanges: true } : {},
|
|
316
|
+
...runtimeLogs !== void 0 ? { runtimeLogs } : {},
|
|
317
|
+
...storageLocation !== void 0 ? { storageLocation } : {}
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
function parsePlatformArgs(args) {
|
|
321
|
+
if (operatorGroups.includes(args[0] ?? "") || [
|
|
322
|
+
"--connection",
|
|
323
|
+
"--json",
|
|
324
|
+
"--plan",
|
|
325
|
+
"--yes",
|
|
326
|
+
"--timeout"
|
|
327
|
+
].includes(args[0] ?? "")) return parseOperatorArgs(args);
|
|
328
|
+
const [subcommand, ...rest] = args;
|
|
329
|
+
if (subcommand === "config") {
|
|
330
|
+
if (rest.length === 0) return {
|
|
331
|
+
subcommand: "config",
|
|
332
|
+
configGroup: "",
|
|
333
|
+
plan: false,
|
|
334
|
+
yes: false
|
|
335
|
+
};
|
|
336
|
+
return rest[0] === "plans" ? parsePlatformPlansArgs(rest) : parsePlatformConfigArgs(rest);
|
|
337
|
+
}
|
|
338
|
+
if (subcommand === "domain") {
|
|
339
|
+
if (rest.length === 0) return {
|
|
340
|
+
subcommand,
|
|
341
|
+
domain: "",
|
|
342
|
+
selector: "",
|
|
343
|
+
zone: "",
|
|
344
|
+
dedicatedZone: false,
|
|
345
|
+
plan: false,
|
|
346
|
+
yes: false
|
|
347
|
+
};
|
|
348
|
+
if (rest[0] !== "set") throw new Error("platform: Usage: bwf platform domain set <domain> [--installation <id>] [--zone <domain>] [--dedicated-zone] [--plan] [--yes].");
|
|
349
|
+
let domain = "";
|
|
350
|
+
let selector = "";
|
|
351
|
+
let zone = "";
|
|
352
|
+
let plan = false;
|
|
353
|
+
let yes = false;
|
|
354
|
+
let dedicatedZone = false;
|
|
355
|
+
for (let index = 1; index < rest.length; index++) {
|
|
356
|
+
const arg = rest[index];
|
|
357
|
+
if (arg === "--installation" || arg === "--zone") {
|
|
358
|
+
const [value, next] = readValue(rest, index, arg);
|
|
359
|
+
index = next;
|
|
360
|
+
if (arg === "--zone") zone = value;
|
|
361
|
+
else selector = value;
|
|
362
|
+
} else if (arg === "--plan") plan = true;
|
|
363
|
+
else if (arg === "--yes") yes = true;
|
|
364
|
+
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
365
|
+
else if (!arg.startsWith("-") && !domain) domain = arg;
|
|
366
|
+
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
367
|
+
}
|
|
368
|
+
if (!domain) throw new Error("platform: domain set requires an application domain.");
|
|
369
|
+
if (plan && yes) throw new Error("platform: Use either --plan or --yes.");
|
|
370
|
+
return {
|
|
371
|
+
subcommand,
|
|
372
|
+
domain,
|
|
373
|
+
selector,
|
|
374
|
+
zone,
|
|
375
|
+
dedicatedZone,
|
|
376
|
+
plan,
|
|
377
|
+
yes
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
if (subcommand === "list") {
|
|
381
|
+
if (rest.length > 0) throw new Error(`platform: Unexpected argument '${rest[0]}'.`);
|
|
382
|
+
return { subcommand };
|
|
383
|
+
}
|
|
384
|
+
if (subcommand === "use" || subcommand === "status") {
|
|
385
|
+
const { selector } = parseSelector(rest, subcommand);
|
|
386
|
+
return {
|
|
387
|
+
subcommand,
|
|
388
|
+
selector
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
if (subcommand === "discover") {
|
|
392
|
+
let account = "";
|
|
393
|
+
let selector = "";
|
|
394
|
+
for (let index = 0; index < rest.length; index++) {
|
|
395
|
+
const arg = rest[index];
|
|
396
|
+
if (arg === "--account" || arg === "--installation") {
|
|
397
|
+
const [value, next] = readValue(rest, index, arg);
|
|
398
|
+
if (arg === "--account") account = value;
|
|
399
|
+
else selector = value;
|
|
400
|
+
index = next;
|
|
401
|
+
} else throw new Error("platform: Usage: bwf platform discover [--account <id>] [--installation <id-or-name>].");
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
subcommand,
|
|
405
|
+
account,
|
|
406
|
+
selector
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
if (subcommand === "upgrade" || subcommand === "rollback" || subcommand === "repair" || subcommand === "disable" || subcommand === "enable") {
|
|
410
|
+
const { selector, plan, runtime, fromRuntime, yes, acceptOutsideChanges, authConfig, dashboardUrl, customDomains, runtimeLogs, storageLocation } = parseLifecycleSelector(rest, subcommand);
|
|
411
|
+
return subcommand === "rollback" ? {
|
|
412
|
+
subcommand,
|
|
413
|
+
selector,
|
|
414
|
+
plan,
|
|
415
|
+
runtime,
|
|
416
|
+
fromRuntime,
|
|
417
|
+
yes
|
|
418
|
+
} : {
|
|
419
|
+
subcommand,
|
|
420
|
+
selector,
|
|
421
|
+
plan,
|
|
422
|
+
runtime,
|
|
423
|
+
yes,
|
|
424
|
+
...acceptOutsideChanges ? { acceptOutsideChanges } : {},
|
|
425
|
+
...authConfig !== void 0 ? { authConfig } : {},
|
|
426
|
+
...dashboardUrl !== void 0 ? { dashboardUrl } : {},
|
|
427
|
+
...customDomains ? { customDomains } : {},
|
|
428
|
+
...runtimeLogs !== void 0 ? { runtimeLogs } : {},
|
|
429
|
+
...storageLocation !== void 0 ? { storageLocation } : {}
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
if (subcommand === "uninstall") {
|
|
433
|
+
const parsed = parseSelector(rest.filter((arg) => ![
|
|
434
|
+
"--purge-data",
|
|
435
|
+
"--purge-resources",
|
|
436
|
+
"--keep-zone"
|
|
437
|
+
].includes(arg)), subcommand, { allowYes: true });
|
|
438
|
+
return {
|
|
439
|
+
subcommand,
|
|
440
|
+
selector: parsed.selector,
|
|
441
|
+
plan: parsed.plan,
|
|
442
|
+
purgeData: rest.includes("--purge-data") || rest.includes("--purge-resources"),
|
|
443
|
+
purgeResources: rest.includes("--purge-resources"),
|
|
444
|
+
yes: parsed.yes
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
if (subcommand === "install") {
|
|
448
|
+
const values = /* @__PURE__ */ new Map();
|
|
449
|
+
let plan = false;
|
|
450
|
+
let resume = false;
|
|
451
|
+
let dedicatedZone = false;
|
|
452
|
+
let yes = false;
|
|
453
|
+
let noControlPlaneDomain = false;
|
|
454
|
+
let noDedicatedZone = false;
|
|
455
|
+
let accessProtection;
|
|
456
|
+
const valueFlags = /* @__PURE__ */ new Set([
|
|
457
|
+
"--account",
|
|
458
|
+
"--auth-config",
|
|
459
|
+
"--login-methods",
|
|
460
|
+
"--app-access",
|
|
461
|
+
"--hyperdrive",
|
|
462
|
+
"--application-domain",
|
|
463
|
+
"--control-plane-domain",
|
|
464
|
+
"--dashboard-url",
|
|
465
|
+
"--display-name",
|
|
466
|
+
"--name",
|
|
467
|
+
"--runtime",
|
|
468
|
+
"--runtime-logs",
|
|
469
|
+
"--storage-location",
|
|
470
|
+
"--zone"
|
|
471
|
+
]);
|
|
472
|
+
let workersDev = false;
|
|
473
|
+
let customDomains = false;
|
|
474
|
+
for (let i = 0; i < rest.length; i++) {
|
|
475
|
+
const arg = rest[i];
|
|
476
|
+
if (valueFlags.has(arg)) {
|
|
477
|
+
const [value, next] = readValue(rest, i, arg);
|
|
478
|
+
values.set(arg, value);
|
|
479
|
+
i = next;
|
|
480
|
+
} else if (arg === "--plan") plan = true;
|
|
481
|
+
else if (arg === "--resume") resume = true;
|
|
482
|
+
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
483
|
+
else if (arg === "--no-dedicated-zone") noDedicatedZone = true;
|
|
484
|
+
else if (arg === "--no-control-plane-domain") noControlPlaneDomain = true;
|
|
485
|
+
else if (arg === "--access-protection" || arg === "--no-access-protection") {
|
|
486
|
+
const enabled = arg === "--access-protection";
|
|
487
|
+
if (accessProtection !== void 0 && accessProtection !== enabled) throw new Error("platform: Choose either --access-protection or --no-access-protection.");
|
|
488
|
+
accessProtection = enabled;
|
|
489
|
+
} else if (arg === "--yes") yes = true;
|
|
490
|
+
else if (arg === "--workers-dev") workersDev = true;
|
|
491
|
+
else if (arg === "--custom-domains") customDomains = true;
|
|
492
|
+
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
493
|
+
}
|
|
494
|
+
if (noControlPlaneDomain && values.has("--control-plane-domain")) throw new Error("platform: Choose either --control-plane-domain or --no-control-plane-domain.");
|
|
495
|
+
if (noDedicatedZone && dedicatedZone) throw new Error("platform: Choose either --dedicated-zone or --no-dedicated-zone.");
|
|
496
|
+
if (values.has("--auth-config") && (values.has("--login-methods") || accessProtection !== void 0)) throw new Error("platform: --auth-config cannot be combined with login or Access protection options.");
|
|
497
|
+
const appAccess = values.get("--app-access");
|
|
498
|
+
if (appAccess !== void 0 && ![
|
|
499
|
+
"public",
|
|
500
|
+
"platform",
|
|
501
|
+
"custom"
|
|
502
|
+
].includes(appAccess)) throw new Error("platform: --app-access accepts public, platform, or custom.");
|
|
503
|
+
const runtimeLogs = values.has("--runtime-logs") ? parseRuntimeLogs(values.get("--runtime-logs")) : void 0;
|
|
504
|
+
const storageLocation = values.has("--storage-location") ? parsePlatformStorageLocation(values.get("--storage-location")) : void 0;
|
|
505
|
+
const loginMethods = values.get("--login-methods")?.split(",");
|
|
506
|
+
if (loginMethods && loginMethods.some((method) => !PLATFORM_LOGIN_KINDS.includes(method))) throw new Error("platform: --login-methods accepts github, google, oidc, and cloudflare-access.");
|
|
507
|
+
if (workersDev && (values.has("--application-domain") || values.has("--zone") || dedicatedZone)) throw new Error("platform: --workers-dev cannot be combined with a domain, zone, or --dedicated-zone.");
|
|
508
|
+
if (customDomains && (workersDev || noDedicatedZone)) throw new Error("platform: --custom-domains needs a dedicated application zone; it cannot be combined with --workers-dev or --no-dedicated-zone.");
|
|
509
|
+
return {
|
|
510
|
+
subcommand,
|
|
511
|
+
...noControlPlaneDomain ? { noControlPlaneDomain: true } : {},
|
|
512
|
+
...noDedicatedZone ? { dedicatedZoneSpecified: true } : {},
|
|
513
|
+
...customDomains ? { customDomains: true } : {},
|
|
514
|
+
...values.has("--hyperdrive") ? { hyperdrive: values.get("--hyperdrive") } : {},
|
|
515
|
+
...loginMethods ? { loginMethods: [...new Set(loginMethods)] } : {},
|
|
516
|
+
...accessProtection !== void 0 ? { accessProtection } : {},
|
|
517
|
+
...appAccess !== void 0 ? { appAccess } : {},
|
|
518
|
+
...workersDev ? { workersDev: true } : {},
|
|
519
|
+
...runtimeLogs !== void 0 ? { runtimeLogs } : {},
|
|
520
|
+
...storageLocation !== void 0 ? { storageLocation } : {},
|
|
521
|
+
...values.has("--auth-config") ? { authConfig: values.get("--auth-config") } : {},
|
|
522
|
+
account: values.get("--account") ?? "",
|
|
523
|
+
applicationDomain: values.get("--application-domain") ?? "",
|
|
524
|
+
controlPlaneDomain: values.get("--control-plane-domain") ?? "",
|
|
525
|
+
...values.has("--dashboard-url") ? { dashboardUrl: normalizePlatformDashboardUrl(values.get("--dashboard-url")) } : {},
|
|
526
|
+
dedicatedZone,
|
|
527
|
+
displayName: values.get("--display-name") ?? "",
|
|
528
|
+
name: values.get("--name") ?? "",
|
|
529
|
+
plan,
|
|
530
|
+
resume,
|
|
531
|
+
runtime: values.get("--runtime") ?? "",
|
|
532
|
+
yes,
|
|
533
|
+
zone: values.get("--zone") ?? ""
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
throw new Error("platform: Usage: bwf platform <config|auth|user|project|deployment|build|signup|invitation|email|system|worker|list|use|status|discover|install|domain|upgrade|rollback|repair|disable|enable|uninstall>.");
|
|
537
|
+
}
|
|
538
|
+
export { platformSubcommands as n, assertPlatformStorageSupported as r, parsePlatformArgs as t };
|