@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,159 @@
|
|
|
1
|
+
import { a as join, i as isAbsolute, o as normalize } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { createJiti } from "jiti";
|
|
5
|
+
// src/host/alias-hint.ts
|
|
6
|
+
/**
|
|
7
|
+
* Detects tsconfig path aliases in module-resolution errors from files that
|
|
8
|
+
* bwf loads outside Vite (`env.ts` through Node's `import()`, `bwf.config.ts`
|
|
9
|
+
* through jiti), neither of which resolves tsconfig `paths`.
|
|
10
|
+
*
|
|
11
|
+
* Node-only (lives under `host/`). Must not be imported from anything
|
|
12
|
+
* that ships in worker bundles.
|
|
13
|
+
*/
|
|
14
|
+
/** Returns the failed specifier from a Node or jiti module-resolution error, or `null`. */
|
|
15
|
+
function extractFailedSpecifier(err) {
|
|
16
|
+
if (!(err instanceof Error)) return null;
|
|
17
|
+
const code = err.code;
|
|
18
|
+
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND" && code !== "ERR_PACKAGE_PATH_NOT_EXPORTED") return null;
|
|
19
|
+
const match = /Cannot find (?:package|module) '([^']+)'/.exec(err.message);
|
|
20
|
+
return match ? match[1] ?? null : null;
|
|
21
|
+
}
|
|
22
|
+
/** A specifier is alias-shaped if it isn't relative, absolute, a node: URL, or a valid bare package name. */
|
|
23
|
+
function looksLikeAlias(specifier) {
|
|
24
|
+
if (specifier.startsWith("./") || specifier.startsWith("../") || specifier.startsWith("/") || specifier.startsWith("node:") || specifier.startsWith("file:")) return false;
|
|
25
|
+
if (specifier.startsWith("@")) return !/^@[^/]+\/[^/]+/.test(specifier);
|
|
26
|
+
return specifier.startsWith("~") || specifier.startsWith("#");
|
|
27
|
+
}
|
|
28
|
+
/** The alias hint for a failed load of `file`, or `null` when the error isn't an alias import. */
|
|
29
|
+
function aliasHint(err, file) {
|
|
30
|
+
const specifier = extractFailedSpecifier(err);
|
|
31
|
+
if (!specifier || !looksLikeAlias(specifier)) return null;
|
|
32
|
+
return `Hint: '${specifier}' looks like a tsconfig path alias. ${file} does not resolve tsconfig "paths" — use a relative import (e.g. "./shared/...") instead.`;
|
|
33
|
+
}
|
|
34
|
+
// src/config-loader.ts
|
|
35
|
+
const LEGACY_CONFIG_FILE = "bwf.json";
|
|
36
|
+
const TYPED_CONFIG_FILE = "bwf.config.ts";
|
|
37
|
+
/** The file to name in messages about a project's settings. Only legacy projects use JSON. */
|
|
38
|
+
function getConfigFileName(root) {
|
|
39
|
+
return existsSync(join(root, "bwf.json")) ? LEGACY_CONFIG_FILE : TYPED_CONFIG_FILE;
|
|
40
|
+
}
|
|
41
|
+
/** Evaluate a TypeScript config without requiring bwf to be installed in the target project. */
|
|
42
|
+
function loadTypedBwfConfigFile(path) {
|
|
43
|
+
const sourceEntry = fileURLToPath(new URL("./config-entry.ts", import.meta.url));
|
|
44
|
+
const configEntry = existsSync(sourceEntry) ? sourceEntry : fileURLToPath(import.meta.resolve("@builtbyfriends/bwf/config"));
|
|
45
|
+
const module = createJiti(import.meta.url, {
|
|
46
|
+
fsCache: false,
|
|
47
|
+
moduleCache: false,
|
|
48
|
+
interopDefault: false,
|
|
49
|
+
alias: { "@builtbyfriends/bwf/config": configEntry }
|
|
50
|
+
})(path);
|
|
51
|
+
if (!Object.hasOwn(module, "default")) throw new Error("expected a default export");
|
|
52
|
+
return module.default;
|
|
53
|
+
}
|
|
54
|
+
/** Load project-authored configuration before runtime validation. */
|
|
55
|
+
function loadBwfConfig(root) {
|
|
56
|
+
const typedPath = join(root, TYPED_CONFIG_FILE);
|
|
57
|
+
const jsonPath = join(root, LEGACY_CONFIG_FILE);
|
|
58
|
+
const hasTyped = existsSync(typedPath);
|
|
59
|
+
const hasJson = existsSync(jsonPath);
|
|
60
|
+
if (hasTyped && hasJson) throw new Error(`config: Found both ${TYPED_CONFIG_FILE} and ${LEGACY_CONFIG_FILE}. Move the settings from ${LEGACY_CONFIG_FILE} into ${TYPED_CONFIG_FILE}, then delete ${LEGACY_CONFIG_FILE}.`);
|
|
61
|
+
if (!hasTyped && !hasJson) return null;
|
|
62
|
+
if (hasTyped) try {
|
|
63
|
+
return {
|
|
64
|
+
source: TYPED_CONFIG_FILE,
|
|
65
|
+
value: loadTypedBwfConfigFile(typedPath)
|
|
66
|
+
};
|
|
67
|
+
} catch (error) {
|
|
68
|
+
const base = `config: Could not load ${TYPED_CONFIG_FILE}: ${error instanceof Error ? error.message : String(error)}`;
|
|
69
|
+
const hint = aliasHint(error, TYPED_CONFIG_FILE);
|
|
70
|
+
throw new Error(hint ? `${base}\n\n${hint}` : base, { cause: error });
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
return {
|
|
74
|
+
source: LEGACY_CONFIG_FILE,
|
|
75
|
+
value: JSON.parse(readFileSync(jsonPath, "utf-8"))
|
|
76
|
+
};
|
|
77
|
+
} catch (error) {
|
|
78
|
+
throw new Error(`config: Invalid JSON in ${LEGACY_CONFIG_FILE}.`, { cause: error });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// src/project-paths.ts
|
|
82
|
+
const SOURCE_CONVENTION_DIRECTORIES = [
|
|
83
|
+
"routes",
|
|
84
|
+
"middleware",
|
|
85
|
+
"crons",
|
|
86
|
+
"queues",
|
|
87
|
+
"procedures",
|
|
88
|
+
"email",
|
|
89
|
+
"db"
|
|
90
|
+
];
|
|
91
|
+
const AUTH_CONFIG_FILES = [
|
|
92
|
+
"auth.ts",
|
|
93
|
+
"auth.mts",
|
|
94
|
+
"auth.js",
|
|
95
|
+
"auth.mjs",
|
|
96
|
+
"auth.cts",
|
|
97
|
+
"auth.cjs"
|
|
98
|
+
];
|
|
99
|
+
const ENV_CONFIG_FILES = [
|
|
100
|
+
"env.ts",
|
|
101
|
+
"env.mts",
|
|
102
|
+
"env.js",
|
|
103
|
+
"env.mjs"
|
|
104
|
+
];
|
|
105
|
+
const SOURCE_CONVENTIONS = /* @__PURE__ */ new Set([
|
|
106
|
+
...SOURCE_CONVENTION_DIRECTORIES,
|
|
107
|
+
...AUTH_CONFIG_FILES,
|
|
108
|
+
...ENV_CONFIG_FILES
|
|
109
|
+
]);
|
|
110
|
+
function validateSourceDir(value, configFile = TYPED_CONFIG_FILE) {
|
|
111
|
+
if (value.trim() !== value || value.length === 0) throw new Error(`config: "sourceDir" in ${configFile} must be a non-empty relative directory.`);
|
|
112
|
+
if (value === "." || value === ".." || value.startsWith("../") || value.includes("/../") || value.endsWith("/..") || isAbsolute(value)) throw new Error(`config: "sourceDir" path '${value}' in ${configFile} must be a relative directory.`);
|
|
113
|
+
const normalized = normalize(value).replace(/\/+$/, "");
|
|
114
|
+
if (normalized === "" || normalized === ".") throw new Error(`config: "sourceDir" path '${value}' in ${configFile} must be a relative directory.`);
|
|
115
|
+
return normalized;
|
|
116
|
+
}
|
|
117
|
+
function getSourceDir(root, config) {
|
|
118
|
+
return config?.sourceDir ? validateSourceDir(config.sourceDir, getConfigFileName(root)) : "";
|
|
119
|
+
}
|
|
120
|
+
function resolveProjectPaths(root, config) {
|
|
121
|
+
const sourceDir = getSourceDir(root, config);
|
|
122
|
+
const sourceRoot = sourceDir ? join(root, sourceDir) : root;
|
|
123
|
+
const sourceRelative = (path) => sourceDir ? `${sourceDir}/${path}` : path;
|
|
124
|
+
const envFileCandidates = sourceDir ? ENV_CONFIG_FILES.map((file) => join(sourceRoot, file)) : [...ENV_CONFIG_FILES.map((file) => join(root, file)), ...ENV_CONFIG_FILES.map((file) => join(root, "src", file))];
|
|
125
|
+
return {
|
|
126
|
+
root,
|
|
127
|
+
sourceDir,
|
|
128
|
+
sourceRoot,
|
|
129
|
+
routesDir: join(sourceRoot, "routes"),
|
|
130
|
+
middlewareDir: join(sourceRoot, "middleware"),
|
|
131
|
+
cronsDir: join(sourceRoot, "crons"),
|
|
132
|
+
queuesDir: join(sourceRoot, "queues"),
|
|
133
|
+
proceduresDir: join(sourceRoot, "procedures"),
|
|
134
|
+
emailDir: join(sourceRoot, "email"),
|
|
135
|
+
dbDir: join(sourceRoot, "db"),
|
|
136
|
+
migrationsDir: join(sourceRoot, "db", "migrations"),
|
|
137
|
+
schemaFile: join(sourceRoot, "db", "schema.ts"),
|
|
138
|
+
schemaDir: join(sourceRoot, "db", "schema"),
|
|
139
|
+
sourceRelative,
|
|
140
|
+
authConfigCandidates: AUTH_CONFIG_FILES.map((file) => join(sourceRoot, file)),
|
|
141
|
+
envFileCandidates
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function readProjectPaths(root) {
|
|
145
|
+
return resolveProjectPaths(root, readSourceDirConfig(root));
|
|
146
|
+
}
|
|
147
|
+
function readSourceDirConfig(root) {
|
|
148
|
+
const config = loadBwfConfig(root)?.value;
|
|
149
|
+
if (typeof config !== "object" || config === null || Array.isArray(config)) return {};
|
|
150
|
+
const sourceDir = config.sourceDir;
|
|
151
|
+
return typeof sourceDir === "string" ? { sourceDir } : {};
|
|
152
|
+
}
|
|
153
|
+
function assertNoRootSourceConventionConflicts(paths) {
|
|
154
|
+
if (!paths.sourceDir) return;
|
|
155
|
+
const conflicts = Array.from(SOURCE_CONVENTIONS).filter((convention) => existsSync(join(paths.root, convention)) && existsSync(join(paths.sourceRoot, convention)));
|
|
156
|
+
if (conflicts.length === 0) return;
|
|
157
|
+
throw new Error(`sourceDir: ${getConfigFileName(paths.root)} sets "sourceDir": "${paths.sourceDir}", but convention path(s) also exist at the project root: ${conflicts.join(", ")}. Move them under "${paths.sourceDir}" or remove the root copy.`);
|
|
158
|
+
}
|
|
159
|
+
export { TYPED_CONFIG_FILE as a, aliasHint as c, validateSourceDir as i, readProjectPaths as n, loadBwfConfig as o, resolveProjectPaths as r, loadTypedBwfConfigFile as s, assertNoRootSourceConventionConflicts as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as validateProjectSlug } from "./project-slug-CO6ci9XG.mjs";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function validateProjectSlug(value) {
|
|
2
|
+
const slug = (value ?? "").trim();
|
|
3
|
+
if (slug.length === 0) return "Project slug is required.";
|
|
4
|
+
if (!(slug.length === 1 ? /^[a-z0-9]$/.test(slug) : /^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(slug))) return "Slug must be lowercase alphanumeric with dashes.";
|
|
5
|
+
if (slug.length > 56) return `Slug must be at most 56 characters (it forms the email sender <slug>+noreply@).`;
|
|
6
|
+
}
|
|
7
|
+
export { validateProjectSlug as t };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { H as outro, L as log } from "./dist-STQXl8ck.mjs";
|
|
2
|
+
import { c as getToken, i as getAccountCredential } from "./auth-xnkmpZUl.mjs";
|
|
3
|
+
import { c as parsePlatformErrorBody, l as platformErrorMessage, n as PlatformApiError, r as PlatformClient } from "./client-D3D5RM5h.mjs";
|
|
4
|
+
import { h as sanitizeTerminalText, l as formatUrl, m as printSuccess, o as formatCount, p as note } from "./output-Bb34lF0w.mjs";
|
|
5
|
+
import { r as readProjectConfig } from "./project-CC7eN00D.mjs";
|
|
6
|
+
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-BCsAMDRA.mjs";
|
|
7
|
+
// src/cli/project-team.ts
|
|
8
|
+
function clean(value) {
|
|
9
|
+
return (value ?? "—").replace(/[\u0000-\u001f\u007f]/g, " ");
|
|
10
|
+
}
|
|
11
|
+
function memberLines(members) {
|
|
12
|
+
const rows = members.map((member) => ({
|
|
13
|
+
id: member.user.id,
|
|
14
|
+
login: member.user.login ?? "—",
|
|
15
|
+
role: member.role
|
|
16
|
+
}));
|
|
17
|
+
const widths = {
|
|
18
|
+
id: Math.max(2, ...rows.map((row) => clean(row.id).length)),
|
|
19
|
+
login: Math.max(5, ...rows.map((row) => clean(row.login).length))
|
|
20
|
+
};
|
|
21
|
+
return [`${"ID".padEnd(widths.id)} ${"LOGIN".padEnd(widths.login)} ROLE`, ...rows.map((row) => `${clean(row.id).padEnd(widths.id)} ${clean(row.login).padEnd(widths.login)} ${row.role}`)].join("\n");
|
|
22
|
+
}
|
|
23
|
+
function invitationEmail(invitation) {
|
|
24
|
+
return invitation.target?.email ?? invitation.target_email ?? "—";
|
|
25
|
+
}
|
|
26
|
+
function invitationLines(invitations, pending) {
|
|
27
|
+
return invitations.map((invitation) => {
|
|
28
|
+
const project = pending ? ` ${clean(invitation.project?.slug)}` : "";
|
|
29
|
+
const target = pending ? "" : ` ${clean(invitationEmail(invitation))}`;
|
|
30
|
+
const status = pending ? "" : ` ${invitation.status ?? "pending"}`;
|
|
31
|
+
return `${clean(invitation.id)}${project}${target} ${invitation.role}${status} expires ${clean(invitation.expires_at)}`;
|
|
32
|
+
}).join("\n");
|
|
33
|
+
}
|
|
34
|
+
async function resolveProjectId(root, client, projectSlug) {
|
|
35
|
+
const requestedSlug = getRequestedProjectSlug({ projectSlug });
|
|
36
|
+
if (requestedSlug) return (await requireProjectBySlug(client, requestedSlug)).projectId;
|
|
37
|
+
const linked = readProjectConfig(root);
|
|
38
|
+
if (!linked) throw new Error("No linked project. Run `bwf project link` or pass --project <slug>.");
|
|
39
|
+
return linked.projectId;
|
|
40
|
+
}
|
|
41
|
+
function invitationResponseError(error, apiUrl) {
|
|
42
|
+
if (!(error instanceof PlatformApiError)) return error;
|
|
43
|
+
if (platformErrorMessage(parsePlatformErrorBody(error.body))) return error;
|
|
44
|
+
let message;
|
|
45
|
+
if (error.code === "project invitation not found") message = `Invitation not found on ${apiUrl}. Check BWF_API_URL if set, connect to the platform in your invitation with \`bwf connect <url>\`, then run \`bwf project team pending\` to check the invitation ID. If it is missing, ask a project administrator for a new invitation.`;
|
|
46
|
+
else if (error.code === "forbidden") message = `Your account cannot respond to this invitation on ${apiUrl}. Sign in with the account whose registered email received the invitation. To switch accounts, set BWF_API_URL to ${apiUrl}, unset BWF_TOKEN if present, then run \`bwf account logout\` and \`bwf account login\`. Run \`bwf project team pending\` to see that account's invitations.`;
|
|
47
|
+
else if (error.code === "project invitation has expired") message = "This invitation has expired. Ask a project administrator to invite you again, then run `bwf project team pending`.";
|
|
48
|
+
else if (error.code === "project invitation is no longer pending") message = "This invitation has already been answered or revoked. Run `bwf project team pending` to see invitations awaiting your response, or ask a project administrator to check your access.";
|
|
49
|
+
else return error;
|
|
50
|
+
error.message = message;
|
|
51
|
+
return error;
|
|
52
|
+
}
|
|
53
|
+
async function runProjectTeamCommand(root, args) {
|
|
54
|
+
console.log();
|
|
55
|
+
const { apiUrl, token } = args.action === "pending" || args.action === "accept" || args.action === "decline" ? getAccountCredential() : {
|
|
56
|
+
apiUrl: void 0,
|
|
57
|
+
token: getToken(root)
|
|
58
|
+
};
|
|
59
|
+
if (apiUrl) log.info(`Platform: ${formatUrl(apiUrl)}`);
|
|
60
|
+
if (!token) {
|
|
61
|
+
log.error(apiUrl ? `Not logged in to ${apiUrl}. Run \`bwf connect ${apiUrl}\` to sign in.` : "Not logged in. Run `bwf account login` first.");
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
const client = new PlatformClient(token, apiUrl ? { apiUrl } : { root });
|
|
65
|
+
if (args.action === "pending") {
|
|
66
|
+
const invitations = await client.listPendingProjectInvitations();
|
|
67
|
+
if (invitations.length === 0) {
|
|
68
|
+
outro("No pending project invitations.");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
note(invitationLines(invitations, true), "Pending Project Invitations");
|
|
72
|
+
outro(formatCount(invitations.length, "invitation"));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (args.action === "accept" || args.action === "decline") {
|
|
76
|
+
try {
|
|
77
|
+
await client.respondToProjectInvitation(args.invitationId, args.action);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
throw invitationResponseError(error, client.apiUrl);
|
|
80
|
+
}
|
|
81
|
+
if (args.action === "accept") log.info("Open the invited application’s directory and run `bwf project link` if it is not linked yet. If it is linked to another project, use a separate checkout. Accepting an invitation keeps existing project links.");
|
|
82
|
+
printSuccess(`Project invitation ${args.action === "accept" ? "accepted" : "declined"}.`);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const projectId = await resolveProjectId(root, client, "projectSlug" in args ? args.projectSlug : "");
|
|
86
|
+
if (args.action === "list") {
|
|
87
|
+
const { members, warnings } = await client.listProjectMembers(projectId);
|
|
88
|
+
for (const warning of warnings ?? []) log.warn(sanitizeTerminalText(warning));
|
|
89
|
+
note(memberLines(members), "Project Team");
|
|
90
|
+
outro(formatCount(members.length, "member"));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (args.action === "invitations") {
|
|
94
|
+
const invitations = await client.listProjectInvitations(projectId);
|
|
95
|
+
if (invitations.length === 0) {
|
|
96
|
+
outro("No project invitations found.");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
note(invitationLines(invitations, false), "Project Invitations");
|
|
100
|
+
outro(formatCount(invitations.length, "invitation"));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (args.action === "invite") {
|
|
104
|
+
const result = await client.inviteProjectMember(projectId, args.email, args.role);
|
|
105
|
+
const delivery = result.delivery.status === "sent" ? "" : ` (email delivery: ${result.delivery.status.replace("_", " ")})`;
|
|
106
|
+
const action = result.refreshed ? "Updated invitation for" : "Invited";
|
|
107
|
+
if (result.delivery.status !== "sent") note(`Invitation: ${clean(result.invitation.id)}\nShare these steps with the invited user:\n\nbwf connect '${client.apiUrl.replaceAll("'", "'\\''")}'\nbwf project team pending\nbwf project team accept ${clean(result.invitation.id)}`, "Invitation saved; email was not sent");
|
|
108
|
+
printSuccess(`${action} ${clean(invitationEmail(result.invitation))} as ${args.role}${delivery}.`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (args.action === "role") {
|
|
112
|
+
await client.updateProjectMemberRole(projectId, args.userId, args.role);
|
|
113
|
+
printSuccess(`Changed ${args.userId} to ${args.role}.`);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (args.action === "remove") {
|
|
117
|
+
await client.removeProjectMember(projectId, args.userId);
|
|
118
|
+
printSuccess(`Removed ${args.userId} from the project.`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (args.action === "revoke") {
|
|
122
|
+
await client.revokeProjectInvitation(projectId, args.invitationId);
|
|
123
|
+
printSuccess(`Revoked invitation ${args.invitationId}.`);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
await client.leaveProject(projectId);
|
|
127
|
+
printSuccess("Left the project.");
|
|
128
|
+
}
|
|
129
|
+
export { runProjectTeamCommand };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { H as outro, L as log } from "./dist-STQXl8ck.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-xnkmpZUl.mjs";
|
|
3
|
+
import { r as PlatformClient } from "./client-D3D5RM5h.mjs";
|
|
4
|
+
import { _ as tablePrefix, i as dim, m as printSuccess } from "./output-Bb34lF0w.mjs";
|
|
5
|
+
import { r as readProjectConfig } from "./project-CC7eN00D.mjs";
|
|
6
|
+
import { r as requireProjectBySlug } from "./resolve-project-BCsAMDRA.mjs";
|
|
7
|
+
// src/cli/project-token.ts
|
|
8
|
+
async function resolveTarget(root, args) {
|
|
9
|
+
const humanToken = getToken(root);
|
|
10
|
+
if (!humanToken) throw new Error("project: Sign in with a human account before managing CI credentials.");
|
|
11
|
+
const client = new PlatformClient(humanToken, { root });
|
|
12
|
+
if (args.projectSlug) return {
|
|
13
|
+
client,
|
|
14
|
+
projectId: (await requireProjectBySlug(client, args.projectSlug)).projectId,
|
|
15
|
+
slug: args.projectSlug
|
|
16
|
+
};
|
|
17
|
+
const linked = readProjectConfig(root);
|
|
18
|
+
if (!linked) throw new Error("project: No linked project. Pass --project <name>.");
|
|
19
|
+
return {
|
|
20
|
+
client,
|
|
21
|
+
projectId: linked.projectId,
|
|
22
|
+
slug: linked.slug
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function printIssued(args, result, apiUrl) {
|
|
26
|
+
if (args.json) {
|
|
27
|
+
console.log(JSON.stringify({
|
|
28
|
+
...result,
|
|
29
|
+
apiUrl
|
|
30
|
+
}));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
log.info(`Credential ${result.id} is valid until ${result.expiresAt}.`);
|
|
34
|
+
log.warn("Copy this token now. bwf will not display it again.");
|
|
35
|
+
console.log(`\nBWF_TOKEN=${result.token}\nBWF_API_URL=${apiUrl}\n`);
|
|
36
|
+
printSuccess("Project deploy credential created.");
|
|
37
|
+
}
|
|
38
|
+
async function runProjectTokenCommand(root, args) {
|
|
39
|
+
if (!args.json) console.log();
|
|
40
|
+
const { client, projectId, slug } = await resolveTarget(root, args);
|
|
41
|
+
if (args.action === "create") printIssued(args, await client.createProjectToken(projectId, {
|
|
42
|
+
...args.name ? { name: args.name } : {},
|
|
43
|
+
...args.expiresInDays ? { expiresInDays: args.expiresInDays } : {}
|
|
44
|
+
}), client.apiUrl);
|
|
45
|
+
else if (args.action === "renew") printIssued(args, await client.renewProjectToken(projectId, args.credentialId, args.expiresInDays), client.apiUrl);
|
|
46
|
+
else if (args.action === "revoke") {
|
|
47
|
+
await client.revokeProjectToken(projectId, args.credentialId);
|
|
48
|
+
if (args.json) console.log(JSON.stringify({
|
|
49
|
+
ok: true,
|
|
50
|
+
id: args.credentialId
|
|
51
|
+
}));
|
|
52
|
+
else printSuccess(`Revoked ${args.credentialId}.`);
|
|
53
|
+
} else {
|
|
54
|
+
const rows = await client.listProjectTokens(projectId);
|
|
55
|
+
if (args.json) {
|
|
56
|
+
console.log(JSON.stringify(rows));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const prefix = tablePrefix();
|
|
60
|
+
console.log(prefix);
|
|
61
|
+
console.log(`${prefix}${dim("id status expires name")}`);
|
|
62
|
+
for (const row of rows) {
|
|
63
|
+
const status = row.revokedAt ? "revoked" : Date.parse(row.expiresAt) <= Date.now() ? "expired" : "active";
|
|
64
|
+
console.log(`${prefix}${row.id.padEnd(38)}${status.padEnd(9)}${row.expiresAt.slice(0, 10)} ${row.name}`);
|
|
65
|
+
}
|
|
66
|
+
if (rows.length === 0) log.info("No CI deploy credentials.");
|
|
67
|
+
}
|
|
68
|
+
if (!args.json) outro(`${slug} — project-scoped deploy access only`);
|
|
69
|
+
}
|
|
70
|
+
export { runProjectTokenCommand };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { a as join, n as dirname, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
+
import { n as readProjectPaths } from "./project-paths-iXHKRTTQ.mjs";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
|
+
// src/codegen/write-if-changed.ts
|
|
5
|
+
function writeFileIfChanged(path, content) {
|
|
6
|
+
let existing = null;
|
|
7
|
+
try {
|
|
8
|
+
existing = readFileSync(path, "utf8");
|
|
9
|
+
} catch (err) {
|
|
10
|
+
if (err.code !== "ENOENT") throw err;
|
|
11
|
+
}
|
|
12
|
+
if (existing === content) return false;
|
|
13
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
14
|
+
writeFileSync(path, content);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
// src/codegen/project-tsconfig.ts
|
|
18
|
+
/**
|
|
19
|
+
* Build the generated .bwf/tsconfig.json contents. Lists the generated
|
|
20
|
+
* declaration files so TypeScript discovers them via the `files` field
|
|
21
|
+
* (which is inherited by `extends`, unlike `include`).
|
|
22
|
+
*
|
|
23
|
+
* @param hasRouteTypes - When true, include routes.d.ts. When omitted,
|
|
24
|
+
* auto-detect by checking for a routes/ directory.
|
|
25
|
+
* @param hasDb - When true, include db.d.ts and redirect `@builtbyfriends/bwf/db` to it.
|
|
26
|
+
* @param hasSchema - When true, configure `@schema` paths for the user's
|
|
27
|
+
* Drizzle schema.
|
|
28
|
+
*/
|
|
29
|
+
function createProjectTsconfig(root, hasRouteTypes, hasDb, hasSchema, options = {}) {
|
|
30
|
+
const pathsConfig = options.paths ?? readProjectPaths(root);
|
|
31
|
+
const outDir = join(root, ".bwf");
|
|
32
|
+
const includeRoutes = hasRouteTypes ?? existsSync(pathsConfig.routesDir);
|
|
33
|
+
const includeQueues = existsSync(pathsConfig.queuesDir);
|
|
34
|
+
const includeEnv = existsSync(join(outDir, "env.d.ts"));
|
|
35
|
+
const includeAuth = existsSync(join(outDir, "auth.d.ts"));
|
|
36
|
+
const includeBindings = existsSync(join(outDir, "bindings.d.ts"));
|
|
37
|
+
const includeProcedures = existsSync(pathsConfig.proceduresDir);
|
|
38
|
+
const tsconfig = { files: [
|
|
39
|
+
...includeRoutes ? ["routes.d.ts"] : [],
|
|
40
|
+
...hasDb ? ["db.d.ts"] : [],
|
|
41
|
+
...includeQueues ? ["queues.d.ts"] : [],
|
|
42
|
+
...includeEnv ? ["env.d.ts"] : [],
|
|
43
|
+
...includeAuth ? ["auth.d.ts"] : [],
|
|
44
|
+
...includeBindings ? ["bindings.d.ts"] : [],
|
|
45
|
+
...includeProcedures ? ["procedures.d.ts"] : []
|
|
46
|
+
] };
|
|
47
|
+
if (hasDb) {
|
|
48
|
+
const paths = {};
|
|
49
|
+
if (options.redirectDbModule !== false) paths["@builtbyfriends/bwf/db"] = ["./db.d.ts"];
|
|
50
|
+
if (hasSchema) {
|
|
51
|
+
const isDir = existsSync(pathsConfig.schemaDir) && !existsSync(pathsConfig.schemaFile);
|
|
52
|
+
const schemaRel = relative(outDir, pathsConfig.schemaDir);
|
|
53
|
+
const schemaFileRel = relative(outDir, pathsConfig.schemaFile);
|
|
54
|
+
paths["@schema"] = [isDir ? `${schemaRel}/index.ts` : schemaFileRel];
|
|
55
|
+
paths["@schema/*"] = [`${schemaRel}/*`];
|
|
56
|
+
}
|
|
57
|
+
tsconfig.compilerOptions = { paths };
|
|
58
|
+
}
|
|
59
|
+
if (includeRoutes) {
|
|
60
|
+
const compilerOptions = tsconfig.compilerOptions ??= {};
|
|
61
|
+
const paths = compilerOptions.paths ??= {};
|
|
62
|
+
paths["@builtbyfriends/bwf/routes"] = ["./routes.d.ts"];
|
|
63
|
+
}
|
|
64
|
+
if (includeQueues) {
|
|
65
|
+
const compilerOptions = tsconfig.compilerOptions ??= {};
|
|
66
|
+
const paths = compilerOptions.paths ??= {};
|
|
67
|
+
paths["@builtbyfriends/bwf/queues"] = ["./queues.d.ts"];
|
|
68
|
+
}
|
|
69
|
+
return tsconfig;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Ensure .bwf/tsconfig.json exists so the user's root tsconfig can extend it.
|
|
73
|
+
*/
|
|
74
|
+
function ensureProjectTsconfig(root, hasRouteTypes, hasDb, hasSchema, options = {}) {
|
|
75
|
+
const tsconfig = createProjectTsconfig(root, hasRouteTypes, hasDb, hasSchema, options);
|
|
76
|
+
return writeFileIfChanged(join(root, ".bwf", "tsconfig.json"), JSON.stringify(tsconfig, null, 2) + "\n");
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Add or drop `auth.d.ts` in an existing .bwf/tsconfig.json to match whether
|
|
80
|
+
* `.bwf/auth.d.ts` exists, keeping every other entry as written. The dev/build
|
|
81
|
+
* routing plugin uses this after it writes or removes auth.d.ts, so it does not
|
|
82
|
+
* recompute the routes/db choices the Drizzle plugin or `bwf prepare` made.
|
|
83
|
+
* A missing or unreadable tsconfig is left for those writers to create.
|
|
84
|
+
*/
|
|
85
|
+
function syncAuthTypesInProjectTsconfig(root) {
|
|
86
|
+
const outDir = join(root, ".bwf");
|
|
87
|
+
const tsconfigPath = join(outDir, "tsconfig.json");
|
|
88
|
+
let tsconfig;
|
|
89
|
+
try {
|
|
90
|
+
tsconfig = JSON.parse(readFileSync(tsconfigPath, "utf8"));
|
|
91
|
+
} catch {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
const others = (Array.isArray(tsconfig.files) ? tsconfig.files : []).filter((file) => file !== "auth.d.ts");
|
|
95
|
+
tsconfig.files = existsSync(join(outDir, "auth.d.ts")) ? [...others, "auth.d.ts"] : others;
|
|
96
|
+
return writeFileIfChanged(tsconfigPath, JSON.stringify(tsconfig, null, 2) + "\n");
|
|
97
|
+
}
|
|
98
|
+
export { writeFileIfChanged as i, ensureProjectTsconfig as n, syncAuthTypesInProjectTsconfig as r, createProjectTsconfig as t };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { H as outro, L as log } from "./dist-STQXl8ck.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-xnkmpZUl.mjs";
|
|
3
|
+
import { r as PlatformClient } from "./client-D3D5RM5h.mjs";
|
|
4
|
+
import { h as sanitizeTerminalText, m as printSuccess, p as note } from "./output-Bb34lF0w.mjs";
|
|
5
|
+
import { r as readProjectConfig } from "./project-CC7eN00D.mjs";
|
|
6
|
+
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-BCsAMDRA.mjs";
|
|
7
|
+
// src/cli/project-zero-trust.ts
|
|
8
|
+
async function resolveTarget(root, args) {
|
|
9
|
+
const token = getToken(root);
|
|
10
|
+
if (!token) throw new Error("project: Not logged in. Run `bwf account login` first.");
|
|
11
|
+
const client = new PlatformClient(token, { root });
|
|
12
|
+
const requestedSlug = getRequestedProjectSlug({ projectSlug: args.projectSlug });
|
|
13
|
+
if (requestedSlug) {
|
|
14
|
+
const project = await requireProjectBySlug(client, requestedSlug);
|
|
15
|
+
return {
|
|
16
|
+
client,
|
|
17
|
+
projectId: project.projectId,
|
|
18
|
+
slug: project.slug
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const linked = readProjectConfig(root);
|
|
22
|
+
if (!linked) throw new Error("project: No linked project. Pass --project <name> or set BWF_PROJECT.");
|
|
23
|
+
return {
|
|
24
|
+
client,
|
|
25
|
+
projectId: linked.projectId,
|
|
26
|
+
slug: linked.slug
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function statusLines(result) {
|
|
30
|
+
const project = result.project;
|
|
31
|
+
const platformStatus = sanitizeTerminalText(result.platformStatus);
|
|
32
|
+
const unavailableMessage = result.platformStatus === "invalid_configuration" ? "The platform Zero Trust configuration is invalid. Ask a platform administrator to review it." : result.platformStatus === "configuring" ? "The platform is still applying Zero Trust configuration. A platform administrator can resume it with `bwf platform zero-trust reconcile`." : result.platformStatus === "disabling" ? "The platform is disabling project Zero Trust. A platform administrator can resume it with `bwf platform zero-trust reconcile`." : result.platformStatus === "error" ? "The platform Zero Trust configuration needs administrator attention. A platform administrator can inspect its status and reconcile it." : result.platformStatus === "ready" ? "The platform administrator has disabled project Zero Trust." : "The platform administrator has not configured project Zero Trust.";
|
|
33
|
+
return [
|
|
34
|
+
`Available: ${result.available ? "yes" : "no"}`,
|
|
35
|
+
`Platform: ${platformStatus}`,
|
|
36
|
+
...result.platformStatus === "not_configured" || result.platformStatus === "invalid_configuration" ? [] : [`Default for new projects: ${result.protectNewProjects ? "protected" : "public"}`],
|
|
37
|
+
`Desired: ${project ? project.desired_protected ? "protected" : "public" : "not initialized"}`,
|
|
38
|
+
`Effective: ${project ? project.effective_protected ? "protected" : "public" : "not initialized"}`,
|
|
39
|
+
`State: ${project?.state ?? "not initialized"}`,
|
|
40
|
+
...project?.last_error ? [`Last error: ${sanitizeTerminalText(project.last_error)}`] : [],
|
|
41
|
+
...!result.available ? [unavailableMessage] : []
|
|
42
|
+
].join("\n");
|
|
43
|
+
}
|
|
44
|
+
async function runProjectZeroTrustCommand(root, args) {
|
|
45
|
+
console.log();
|
|
46
|
+
const { client, projectId, slug } = await resolveTarget(root, args);
|
|
47
|
+
if (args.action === "status") {
|
|
48
|
+
note(statusLines(await client.getProjectZeroTrust(projectId)), slug);
|
|
49
|
+
outro(`${slug} Zero Trust status`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const result = args.action === "reconcile" ? await client.reconcileProjectZeroTrust(projectId) : await client.setProjectZeroTrust(projectId, args.action === "protect");
|
|
53
|
+
if (result.project.last_error) log.warn(sanitizeTerminalText(result.project.last_error));
|
|
54
|
+
if (result.project.state === "reconciling") {
|
|
55
|
+
outro(`${slug} Zero Trust update is still in progress. Run \`bwf project zero-trust reconcile\` to continue, or wait for scheduled maintenance.`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (result.project.last_error || result.project.state === "error") {
|
|
59
|
+
outro(`${slug} Zero Trust needs attention (${result.project.state}).`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
printSuccess(args.action === "protect" ? `${slug} is protected by Zero Trust.` : args.action === "public" ? `${slug} is public.` : `${slug} Zero Trust reconciled (${result.project.state}).`);
|
|
63
|
+
}
|
|
64
|
+
export { runProjectZeroTrustCommand };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// src/auth/providers.ts
|
|
2
|
+
const BWF_SOCIAL_AUTH_PROVIDERS = [
|
|
3
|
+
"apple",
|
|
4
|
+
"atlassian",
|
|
5
|
+
"cognito",
|
|
6
|
+
"discord",
|
|
7
|
+
"dropbox",
|
|
8
|
+
"facebook",
|
|
9
|
+
"figma",
|
|
10
|
+
"github",
|
|
11
|
+
"gitlab",
|
|
12
|
+
"google",
|
|
13
|
+
"huggingface",
|
|
14
|
+
"kakao",
|
|
15
|
+
"kick",
|
|
16
|
+
"line",
|
|
17
|
+
"linear",
|
|
18
|
+
"linkedin",
|
|
19
|
+
"microsoft",
|
|
20
|
+
"naver",
|
|
21
|
+
"notion",
|
|
22
|
+
"paybin",
|
|
23
|
+
"paypal",
|
|
24
|
+
"polar",
|
|
25
|
+
"railway",
|
|
26
|
+
"reddit",
|
|
27
|
+
"roblox",
|
|
28
|
+
"salesforce",
|
|
29
|
+
"slack",
|
|
30
|
+
"spotify",
|
|
31
|
+
"tiktok",
|
|
32
|
+
"twitch",
|
|
33
|
+
"twitter",
|
|
34
|
+
"vercel",
|
|
35
|
+
"vk",
|
|
36
|
+
"zoom"
|
|
37
|
+
];
|
|
38
|
+
const BWF_EMAIL_AUTH_PROVIDER = "email";
|
|
39
|
+
const NOSAM_AUTH_PROVIDERS = [BWF_EMAIL_AUTH_PROVIDER, ...BWF_SOCIAL_AUTH_PROVIDERS];
|
|
40
|
+
const NOSAM_SOCIAL_AUTH_PROVIDER_SET = new Set(BWF_SOCIAL_AUTH_PROVIDERS);
|
|
41
|
+
const NOSAM_AUTH_PROVIDER_SET = new Set(NOSAM_AUTH_PROVIDERS);
|
|
42
|
+
function isBwfSocialAuthProvider(value) {
|
|
43
|
+
return NOSAM_SOCIAL_AUTH_PROVIDER_SET.has(value);
|
|
44
|
+
}
|
|
45
|
+
function isBwfAuthProvider(value) {
|
|
46
|
+
return NOSAM_AUTH_PROVIDER_SET.has(value);
|
|
47
|
+
}
|
|
48
|
+
/** Provider options other than the client credentials, with the env var that holds each one. */
|
|
49
|
+
const NOSAM_AUTH_PROVIDER_SETTING_ENV_NAMES = { cognito: {
|
|
50
|
+
domain: "AUTH_COGNITO_DOMAIN",
|
|
51
|
+
region: "AUTH_COGNITO_REGION",
|
|
52
|
+
userPoolId: "AUTH_COGNITO_USER_POOL_ID"
|
|
53
|
+
} };
|
|
54
|
+
function getBwfAuthProviderSettingEnvNames(provider) {
|
|
55
|
+
return NOSAM_AUTH_PROVIDER_SETTING_ENV_NAMES[provider] ?? {};
|
|
56
|
+
}
|
|
57
|
+
function getBwfAuthProviderEnvNames(provider) {
|
|
58
|
+
const normalized = provider.toUpperCase().replaceAll("-", "_");
|
|
59
|
+
return {
|
|
60
|
+
clientId: `AUTH_${normalized}_CLIENT_ID`,
|
|
61
|
+
clientSecret: `AUTH_${normalized}_CLIENT_SECRET`
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export { isBwfAuthProvider as a, getBwfAuthProviderSettingEnvNames as i, NOSAM_AUTH_PROVIDERS as n, isBwfSocialAuthProvider as o, getBwfAuthProviderEnvNames as r, BWF_EMAIL_AUTH_PROVIDER as t };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const BWF_SOCIAL_AUTH_PROVIDERS: readonly ["apple", "atlassian", "cognito", "discord", "dropbox", "facebook", "figma", "github", "gitlab", "google", "huggingface", "kakao", "kick", "line", "linear", "linkedin", "microsoft", "naver", "notion", "paybin", "paypal", "polar", "railway", "reddit", "roblox", "salesforce", "slack", "spotify", "tiktok", "twitch", "twitter", "vercel", "vk", "zoom"];
|
|
2
|
+
declare const BWF_EMAIL_AUTH_PROVIDER = "email";
|
|
3
|
+
declare const NOSAM_AUTH_PROVIDERS: readonly [typeof BWF_EMAIL_AUTH_PROVIDER, ...typeof BWF_SOCIAL_AUTH_PROVIDERS];
|
|
4
|
+
type BwfAuthProvider = (typeof NOSAM_AUTH_PROVIDERS)[number];
|
|
5
|
+
export { BwfAuthProvider as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { f as isRealD1Id, p as isRealHyperdriveId } from "./provision-C90fULHJ.mjs";
|