void 0.20.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agents-gni4eqBu.mjs +111 -0
- package/dist/auth-3sGB0zJ1.mjs +22 -0
- package/dist/{auth-DPl6kck4.mjs → auth-B9_D6ygs.mjs} +6 -241
- package/dist/auth-CAw7zHqj.mjs +2 -0
- package/dist/auth-client-BWBT8HLp.mjs +6 -0
- package/dist/auth-client-Bawdj38n.d.mts +7 -0
- package/dist/auth-client-react-7GFffu8R.d.mts +7 -0
- package/dist/auth-client-react-CMLwT2xI.mjs +6 -0
- package/dist/auth-client-solid-DyTFL4cq.d.mts +7 -0
- package/dist/auth-client-solid-UoreJWZG.mjs +6 -0
- package/dist/auth-client-svelte-Cv_WvrRk.mjs +6 -0
- package/dist/auth-client-svelte-zetW0KIH.d.mts +7 -0
- package/dist/auth-client-vue-CFk7Xbv3.mjs +6 -0
- package/dist/auth-client-vue-bChShbQP.d.mts +7 -0
- package/dist/{auth-cmd-gniL2fNt.mjs → auth-cmd-MkBG2u1f.mjs} +5 -5
- package/dist/{auth-link-NZdjCmSc.mjs → auth-link-Devmv96E.mjs} +5 -5
- package/dist/{better-auth-shared-DSCeohOK.d.mts → better-auth-shared-BoVwA5Vm.d.mts} +1 -6
- package/dist/{better-auth-shared-CYw1T3k4.mjs → better-auth-shared-syGYYmnY.mjs} +1 -1
- package/dist/{build-cmd-sI18tX_O.mjs → build-cmd-DsBGwtfs.mjs} +6 -4
- package/dist/{cache-IHn5MwBC.mjs → cache-BMw8eMyF.mjs} +6 -4
- package/dist/{cancel-deploy-C5qTOdLi.mjs → cancel-deploy-B3_s9NIN.mjs} +5 -3
- package/dist/cf-access-rAZxzMkL.mjs +181 -0
- package/dist/cf-build-output-CTdlo6Rt.mjs +520 -0
- package/dist/cli/cf-compat.d.mts +1 -0
- package/dist/cli/cf-compat.mjs +934 -0
- package/dist/cli/cli.mjs +61 -38
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-DAAivdid.mjs +2 -0
- package/dist/{client-dHfSJvAN.mjs → client-PdAJ-F0t.mjs} +148 -89
- package/dist/{cloudflare-auth-6M5llVPC.mjs → cloudflare-auth-BCmTc1X_.mjs} +13 -44
- package/dist/{cloudflare-cmd-4RPGN3KB.mjs → cloudflare-cmd-D6PrKn7o.mjs} +4 -7
- package/dist/{cloudflare-connect-t1UU5svD.mjs → cloudflare-connect-DloREDlc.mjs} +6 -6
- package/dist/cloudflare-operations-BHNJVDbN.mjs +2 -0
- package/dist/{cloudflare-operations-BzWnlC1_.mjs → cloudflare-operations-CPEdHYhM.mjs} +37 -39
- package/dist/cloudflare-user-output-Q-k0QoNQ.mjs +20 -0
- package/dist/collect-DAUItMDS.mjs +2 -0
- package/dist/collect-DXHNWHcT.mjs +48 -0
- package/dist/config--T87TD8T.mjs +2 -0
- package/dist/{config-NOG_U1aK.mjs → config-BSe70f4T.mjs} +4 -6
- package/dist/config-DDIFxQYx.mjs +2 -0
- package/dist/{config-uNGuFsI2.mjs → config-Dxr6cTXn.mjs} +22 -37
- package/dist/config-DywxBLQC.d.mts +185 -0
- package/dist/config-entry.d.mts +6 -0
- package/dist/config-entry.mjs +7 -0
- package/dist/config-uP7ZDtVZ.mjs +21 -0
- package/dist/config-write-y3CBI_ux.mjs +60 -0
- package/dist/{connect-Bfk31O_8.mjs → connect-BvC9kolB.mjs} +8 -6
- package/dist/{create-project-Bk9Z0-Jg.mjs → create-project-C9lQhRzj.mjs} +9 -25
- package/dist/create-project-CI-17RVJ.mjs +2 -0
- package/dist/database-provider-Cx525bwX.mjs +6 -0
- package/dist/database-provider.mjs +1 -5
- package/dist/{db-BkRoptAt.mjs → db-R7IQgOv5.mjs} +48 -44
- package/dist/{delete-DouASY9P.mjs → delete-CghI_NXn.mjs} +6 -4
- package/dist/deploy-CYPymbtG.mjs +2 -0
- package/dist/{deploy-DTaWUS1S.mjs → deploy-H968Lo4T.mjs} +765 -197
- package/dist/discover-BBzDZe_o.mjs +2 -0
- package/dist/{discover-xvfrgJeo.mjs → discover-C4O6YxVS.mjs} +3 -8
- package/dist/{dist-BrsS7cai.mjs → dist-4WkAWhWx.mjs} +1 -15
- package/dist/{dist-m40_XgNh.mjs → dist-Bn8Kodjp.mjs} +1 -1
- package/dist/dist-C5fND3R0.mjs +2 -0
- package/dist/dist-D7-nEOXi.mjs +2 -0
- package/dist/{output-B0cfNSx5.mjs → dist-Dn6nn2IU.mjs} +3 -926
- package/dist/{domain-1RhhOVrC.mjs → domain-CITt8lC-.mjs} +7 -5
- package/dist/{route-types-Da-DpyUp.mjs → drizzle-Beb2Am5S.mjs} +1 -280
- package/dist/{email-Ce6SQq-i.mjs → email-C5kaZXzJ.mjs} +2 -2
- package/dist/{email-C-lGh51B.mjs → email-_8VmyX7V.mjs} +14 -12
- package/dist/{entry-DU3oDoQ3.mjs → entry-DdRFGK0y.mjs} +2 -2
- package/dist/{env-DJHsPE7Z.mjs → env-DV4r3nHz.mjs} +9 -7
- package/dist/{env-DBKmK4vc.mjs → env-DX_v-Q-v.mjs} +1 -1
- package/dist/env-Yz4HcvHs.mjs +78 -0
- package/dist/env-helpers--wFmQ_5Q.mjs +136 -0
- package/dist/{env-types-BNPhro-M.mjs → env-types-CWDtqHgw.mjs} +6 -2
- package/dist/{env-validation-CF6KvTRf.mjs → env-validation-BsFEXps5.mjs} +19 -28
- package/dist/env-validation-DIDGM7h4.mjs +2 -0
- package/dist/fetch-CXDChK7B.mjs +18 -0
- package/dist/fetch-_SeGZao9.d.mts +57 -0
- package/dist/fetch-stream-AOByI7Ki.mjs +81 -0
- package/dist/fetch-stream-Bjf0hoZb.d.mts +49 -0
- package/dist/gen-BBiIZw6g.mjs +2 -0
- package/dist/{gen-B_wPnVTK.mjs → gen-CFOEEc-t.mjs} +13 -11
- package/dist/{generate-RTK8_kK1.mjs → generate-C0VY6RVf.mjs} +2 -2
- package/dist/{github-cmd-PW7ZnWTp.mjs → github-cmd-jYjha2LO.mjs} +18 -22
- package/dist/{handler-D1hLsObx.d.mts → handler-BXJTXd02.d.mts} +6 -1
- package/dist/handler-DghKr6dU.mjs +150 -0
- package/dist/head-D_QRR5Yd.mjs +112 -0
- package/dist/head-client-DzmJGN4C.mjs +90 -0
- package/dist/{headers-BAHwgHdW.mjs → headers-B_HBMgi0.mjs} +2 -2
- package/dist/{help-CwOX-zmI.mjs → help-C46mnlUS.mjs} +17 -12
- package/dist/help-CS_nAsWu.mjs +2 -0
- package/dist/index.d.mts +2 -20
- package/dist/index.mjs +116 -60
- package/dist/{init-BWZ7q5Z4.mjs → init-CSXmvxKu.mjs} +49 -50
- package/dist/{link-Rmvu2Wl_.mjs → link-DxMOALXk.mjs} +7 -5
- package/dist/{list-DEE2S6mY.mjs → list-0wQs0oYg.mjs} +7 -5
- package/dist/live-CB1y5IuC.mjs +411 -0
- package/dist/live-CKiJilLr.d.mts +105 -0
- package/dist/local-d1-DzykTWY8.mjs +104 -0
- package/dist/{login-Uvferzmm.mjs → login-CKk5NX4d.mjs} +6 -11
- package/dist/login-Ch9cgWRF.mjs +2 -0
- package/dist/{logs-27FenuiC.mjs → logs-hxWBSoej.mjs} +6 -4
- package/dist/migrate-CLty4mZR.mjs +2 -0
- package/dist/migrate-DcW8F2W8.mjs +285 -0
- package/dist/migration-handler-DM4clYj5.d.mts +51 -0
- package/dist/{neon-DHwd2zvC.mjs → neon-n74ta1Pr.mjs} +1 -1
- package/dist/{node-Ez5KW5rn.mjs → node-Cupyf7-s.mjs} +6 -6
- package/dist/{operator-auth-B3e08unv.mjs → operator-auth-BkVgJqv-.mjs} +2 -2
- package/dist/{operator-client-LUZnlnYk.mjs → operator-client-A0iex2yi.mjs} +2 -1
- package/dist/{operator-cmd-CjOTmAYE.mjs → operator-cmd-BEUYhaHB.mjs} +6 -6
- package/dist/output-urU86XeT.mjs +146 -0
- package/dist/{package-json-CPoWX79C.mjs → package-json-iCbMg5XF.mjs} +1 -1
- package/dist/pages/client.d.mts +5 -2
- package/dist/pages/client.mjs +5 -3
- package/dist/pages/head-client.mjs +1 -89
- package/dist/pages/head.mjs +1 -111
- package/dist/pages/index.d.mts +2 -3
- package/dist/pages/index.mjs +7 -7
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/prefetch.d.mts +2 -30
- package/dist/pages/prefetch.mjs +1 -89
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +3 -3
- package/dist/pages/serialize.d.mts +2 -9
- package/dist/pages/serialize.mjs +1 -13
- package/dist/plan-BEZ8VJW0.mjs +256 -0
- package/dist/plan-DpuOr14e.mjs +2 -0
- package/dist/{platform-auth-config-DrbQXXiW.mjs → platform-auth-config-Df6yVw-e.mjs} +6 -6
- package/dist/{platform-auth-protection-Bhtvp0B_.mjs → platform-auth-protection-Jb0yftay.mjs} +7 -5
- package/dist/{platform-auth-recovery-CeOKGVeJ.mjs → platform-auth-recovery-DmRyIfW0.mjs} +6 -5
- package/dist/platform-cmd-C9Vt7m-d.mjs +2 -0
- package/dist/{platform-cmd-BFhieCdV.mjs → platform-cmd-DRxCOTwy.mjs} +8 -5
- package/dist/{platform-domain-C74PULqV.mjs → platform-domain-IjiXgrXJ.mjs} +4 -3
- package/dist/{platform-lifecycle-BwAIgz-t.mjs → platform-lifecycle-BquAaU-5.mjs} +263 -56
- package/dist/platform-lifecycle-CuJIZNvA.mjs +2 -0
- package/dist/{platform-management-COogu_Se.mjs → platform-management-CCQKGsq4.mjs} +12 -7
- package/dist/platform-management-Cgyed0WY.mjs +2 -0
- package/dist/{platform-recovery-ewqLefp1.mjs → platform-recovery-DS8ih1SW.mjs} +3 -3
- package/dist/platform-registry-BJbgZLS1.mjs +431 -0
- package/dist/{plugin-inference-BDRfZngg.mjs → plugin-inference-DsvtJLll.mjs} +4 -4
- package/dist/prefetch-Bsc_Pb6c.mjs +90 -0
- package/dist/prefetch-Ce6la4EI.d.mts +31 -0
- package/dist/{prepare-blNRQvQl.mjs → prepare-CaUxODOU.mjs} +3 -2
- package/dist/prepare-D4CkM3_v.mjs +2 -0
- package/dist/{prepare-CtDJjoOj.mjs → prepare-pcWcxSCh.mjs} +13 -11
- package/dist/prerender-render-Cf_WDE9W.mjs +111 -0
- package/dist/prerender-render.mjs +1 -110
- package/dist/{preset-lAy0B0BQ.mjs → preset-Dowh9tTt.mjs} +16 -118
- package/dist/project-BEBFDFLz.mjs +2 -0
- package/dist/project-CWNIPoXc.mjs +209 -0
- package/dist/{project-cmd-DmZK9Hxf.mjs → project-cmd-2lN--YAX.mjs} +18 -16
- package/dist/{project-paths-SK8nMHPp.mjs → project-paths-CKQ-Q5JS.mjs} +47 -14
- package/dist/project-slug-23TpquG4.mjs +8 -0
- package/dist/project-slug-DofjTFd-.mjs +2 -0
- package/dist/{project-team-D8jOJMUJ.mjs → project-team-Dapn9HZn.mjs} +9 -5
- package/dist/{project-token-DA34bf-C.mjs → project-token-C90v9SJK.mjs} +6 -4
- package/dist/{project-tsconfig-Ql2XsSQp.mjs → project-tsconfig-CwfqUnVp.mjs} +2 -2
- package/dist/{protocol-C-pqYJjE.d.mts → protocol-ZH3jP4a7.d.mts} +1 -1
- package/dist/providers-BNKRacMr.d.mts +7 -0
- package/dist/provision-CNgEBkVA.mjs +3 -0
- package/dist/{provision-CSJOjjQk.mjs → provision-Cck2m3jJ.mjs} +11 -25
- package/dist/queues-BWKt1Xo4.d.mts +7 -0
- package/dist/{requests-CUExwGQQ.mjs → requests-CzX46I0i.mjs} +5 -3
- package/dist/resolve-project-BTotl8Nn.mjs +2 -0
- package/dist/{resolve-project--Vxawf7z.mjs → resolve-project-Xvis70DG.mjs} +2 -8
- package/dist/response-Tn7rU0MV.mjs +30 -0
- package/dist/{rollback-CDNGU1gr.mjs → rollback-BEeyc73H.mjs} +6 -4
- package/dist/{rolldown-runtime-rQ84J-ij.mjs → rolldown-runtime-DXIUcv95.mjs} +1 -10
- package/dist/route-types-Id82-veQ.mjs +280 -0
- package/dist/{local-d1-D2I6Ox5F.mjs → runner-BGVsGgkb.mjs} +6 -114
- package/dist/runner-CQs_cDSG.mjs +2 -0
- package/dist/runner-mysql-1o47achK.mjs +2 -0
- package/dist/{runner-mysql-7BPUNGmL.mjs → runner-mysql-BhwMk2Bm.mjs} +2 -9
- package/dist/{runner-pg-BkEza-dX.mjs → runner-pg-CJ_JeGF6.mjs} +2 -9
- package/dist/runner-pg-D7z01mQS.mjs +2 -0
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth-client-react.d.mts +2 -6
- package/dist/runtime/auth-client-react.mjs +1 -5
- package/dist/runtime/auth-client-solid.d.mts +2 -6
- package/dist/runtime/auth-client-solid.mjs +1 -5
- package/dist/runtime/auth-client-svelte.d.mts +2 -6
- package/dist/runtime/auth-client-svelte.mjs +1 -5
- package/dist/runtime/auth-client-vue.d.mts +2 -6
- package/dist/runtime/auth-client-vue.mjs +1 -5
- package/dist/runtime/auth-client.d.mts +2 -6
- package/dist/runtime/auth-client.mjs +1 -5
- package/dist/runtime/auth.mjs +1 -21
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +3 -3
- package/dist/runtime/client-react.mjs +3 -3
- package/dist/runtime/client-solid.d.mts +3 -3
- package/dist/runtime/client-solid.mjs +3 -3
- package/dist/runtime/client-svelte.d.mts +3 -3
- package/dist/runtime/client-svelte.mjs +3 -3
- package/dist/runtime/client-vue.d.mts +3 -3
- package/dist/runtime/client-vue.mjs +3 -3
- package/dist/runtime/client.d.mts +3 -3
- package/dist/runtime/client.mjs +3 -3
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-helpers.mjs +1 -135
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.mjs +2 -2
- package/dist/runtime/env.mjs +1 -77
- package/dist/runtime/fetch-stream.d.mts +2 -49
- package/dist/runtime/fetch-stream.mjs +2 -80
- package/dist/runtime/fetch.d.mts +2 -57
- package/dist/runtime/fetch.mjs +2 -17
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -149
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +2 -2
- package/dist/runtime/live.d.mts +2 -104
- package/dist/runtime/live.mjs +1 -410
- package/dist/runtime/migration-handler-mysql.d.mts +1 -1
- package/dist/runtime/migration-handler-pg.d.mts +1 -1
- package/dist/runtime/migration-handler.d.mts +2 -50
- package/dist/runtime/queues.d.mts +2 -6
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/remote/index.mjs +49 -8
- package/dist/runtime/response.mjs +1 -29
- package/dist/runtime/sandbox.d.mts +4 -56
- package/dist/runtime/sandbox.mjs +82 -221
- package/dist/runtime/sse.mjs +1 -171
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -71
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +2 -2
- package/dist/runtime/ws.d.mts +2 -121
- package/dist/{scan-CpK-57ug.mjs → scan-DJbooZm2.mjs} +3 -3
- package/dist/{scan-BMH4rzlv.mjs → scan-DdDvRCU1.mjs} +8 -26
- package/dist/{secret-Bzzi2e9E.mjs → secret-wnTel5Yw.mjs} +8 -6
- package/dist/serialize-BPvnNQuA.mjs +14 -0
- package/dist/serialize-CfSwWfF2.d.mts +10 -0
- package/dist/{skills-C0RvGjeE.mjs → skills-B-690E7h.mjs} +3 -2
- package/dist/sse-BaC1jXko.mjs +172 -0
- package/dist/{subcommand-prompt-Bmyn5Rlc.mjs → subcommand-prompt-Gj3VzLIh.mjs} +2 -1
- package/dist/sveltekit.d.mts +2 -1
- package/dist/sveltekit.mjs +3 -2
- package/dist/validate-DqJ33oHj.mjs +2 -0
- package/dist/validate-qNhV00PD.mjs +180 -0
- package/dist/validator-BTOu0fB0.mjs +72 -0
- package/dist/{wrangler--imS8n0d.mjs → wrangler-D01qs6VB.mjs} +259 -71
- package/dist/ws-BwcqizuH.d.mts +122 -0
- package/dist/{yarn-pnp-DxSInkzL.mjs → yarn-pnp-CVEc3gE7.mjs} +1 -1
- package/package.json +19 -8
- package/skills/void/SKILL.md +7 -5
- package/skills/void/docs/guide/ai.md +3 -3
- package/skills/void/docs/guide/app-types.md +12 -11
- package/skills/void/docs/guide/auth.md +2 -2
- package/skills/void/docs/guide/database/d1.md +1 -1
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +3 -3
- package/skills/void/docs/guide/deployment.md +16 -16
- package/skills/void/docs/guide/durable-state.md +2 -2
- package/skills/void/docs/guide/edge/headers.md +3 -3
- package/skills/void/docs/guide/edge/prerendering.md +1 -1
- package/skills/void/docs/guide/edge/redirects.md +4 -4
- package/skills/void/docs/guide/edge/revalidation.md +6 -6
- package/skills/void/docs/guide/edge/rewrites.md +28 -27
- package/skills/void/docs/guide/edge/static-assets.md +1 -1
- package/skills/void/docs/guide/email.md +27 -25
- package/skills/void/docs/guide/env-migration.md +1 -1
- package/skills/void/docs/guide/index.md +1 -1
- package/skills/void/docs/guide/pages-routing/head.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +171 -0
- package/skills/void/docs/guide/platform/administration/email.md +121 -0
- package/skills/void/docs/guide/platform/administration/operations.md +97 -0
- package/skills/void/docs/guide/platform/administration/projects.md +56 -0
- package/skills/void/docs/guide/platform/development/local.md +119 -0
- package/skills/void/docs/guide/platform/development/runtime.md +124 -0
- package/skills/void/docs/guide/platform/development/schema-ci.md +95 -0
- package/skills/void/docs/guide/platform/installation/ci.md +58 -0
- package/skills/void/docs/guide/platform/installation/credentials.md +90 -0
- package/skills/void/docs/guide/platform/installation/domains.md +68 -0
- package/skills/void/docs/guide/platform/installation/first-deployment.md +82 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +137 -0
- package/skills/void/docs/guide/platform/installation/prerequisites.md +88 -0
- package/skills/void/docs/guide/platform/installation/setup.md +169 -0
- package/skills/void/docs/guide/platform/installation/uninstall.md +54 -0
- package/skills/void/docs/guide/platform-administration.md +6 -414
- package/skills/void/docs/guide/platform-development.md +5 -316
- package/skills/void/docs/guide/project-collaboration.md +1 -1
- package/skills/void/docs/guide/remote-dev.md +2 -2
- package/skills/void/docs/guide/sandboxes.md +10 -25
- package/skills/void/docs/guide/self-hosted-platform.md +11 -694
- package/skills/void/docs/guide/ssg.md +1 -1
- package/skills/void/docs/guide/websockets.md +1 -1
- package/skills/void/docs/integrations/cloudflare.md +86 -84
- package/skills/void/docs/integrations/frameworks/analog.md +14 -9
- package/skills/void/docs/integrations/frameworks/astro.md +14 -10
- package/skills/void/docs/integrations/frameworks/nuxt.md +14 -9
- package/skills/void/docs/integrations/frameworks/overview.md +35 -29
- package/skills/void/docs/integrations/frameworks/react-router.md +1 -1
- package/skills/void/docs/integrations/frameworks/sveltekit.md +33 -30
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +1 -1
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -5
- package/skills/void/docs/reference/api.md +55 -38
- package/skills/void/docs/reference/cli.md +60 -34
- package/skills/void/docs/reference/config.md +57 -34
- package/skills/void/docs/reference/resource-inference.md +10 -10
- package/skills/void/docs/reference/structure.md +2 -2
- package/dist/validate-tBBN_dXH.mjs +0 -505
|
@@ -1,18 +1,88 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as join } from "./dist-BrsS7cai.mjs";
|
|
3
|
-
import { B as ensureCloudflaredToken, U as isCloudflareAccessChallenge, V as ensurePlatformAccessToken, X as normalizePlatformApiUrl, p as getPackageDir } from "./output-B0cfNSx5.mjs";
|
|
1
|
+
import { a as join } from "./dist-4WkAWhWx.mjs";
|
|
4
2
|
import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
|
|
5
|
-
import {
|
|
3
|
+
import { a as getApiUrl } from "./auth-B9_D6ygs.mjs";
|
|
4
|
+
import { s as normalizePlatformApiUrl } from "./platform-registry-BJbgZLS1.mjs";
|
|
5
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-rAZxzMkL.mjs";
|
|
6
|
+
import { n as getPackageDir } from "./agents-gni4eqBu.mjs";
|
|
6
7
|
import { readFileSync } from "node:fs";
|
|
8
|
+
import { stripVTControlCharacters } from "node:util";
|
|
9
|
+
//#region src/cli/platform-errors.ts
|
|
10
|
+
function parsePlatformErrorBody(body) {
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse(body);
|
|
13
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
14
|
+
const result = {};
|
|
15
|
+
for (const key of [
|
|
16
|
+
"error",
|
|
17
|
+
"message",
|
|
18
|
+
"deployment",
|
|
19
|
+
"minVersion",
|
|
20
|
+
"clientVersion"
|
|
21
|
+
]) {
|
|
22
|
+
const value = parsed[key];
|
|
23
|
+
if (typeof value === "string") result[key] = value;
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function plainExplanation(value) {
|
|
31
|
+
const text = value ? stripVTControlCharacters(value).replace(/[\u0000-\u0008\u000b-\u001f\u007f]/g, " ").trim() : void 0;
|
|
32
|
+
return text && !text.startsWith("{") && !text.startsWith("[") && !/<[^>]+>/.test(text) ? text : void 0;
|
|
33
|
+
}
|
|
34
|
+
function platformErrorMessage(payload) {
|
|
35
|
+
const message = plainExplanation(payload?.message);
|
|
36
|
+
return message && !/^(forbidden|unauthorized|access denied|permission denied)[.!]?$/i.test(message) ? message : void 0;
|
|
37
|
+
}
|
|
38
|
+
function unexplainedRejection(status) {
|
|
39
|
+
if (status === 401) return "Authentication was rejected. Check the credentials for the selected platform and any access gateway in front of it.";
|
|
40
|
+
if (status === 403) return "Access was denied by the platform or its access gateway. Check the selected platform and ask its administrator to confirm your access.";
|
|
41
|
+
return "The platform did not provide an explanation. Retry the operation; if it still fails, contact the platform administrator.";
|
|
42
|
+
}
|
|
43
|
+
function permissionMessage(permission) {
|
|
44
|
+
if (permission === "owner") return "Only the project owner can perform this action. Ask the owner to run it using their platform login.";
|
|
45
|
+
if (permission === "read") return "This action requires project membership (reader or higher). Ask a project admin or owner for access.";
|
|
46
|
+
if (permission === "settings" || permission === "members") return "This action requires admin or owner access. Ask a project admin or owner to confirm your access.";
|
|
47
|
+
if (permission === "configure" || permission === "deploy") return "This action requires collaborator, admin, or owner access. Ask a project admin or owner to confirm your access.";
|
|
48
|
+
return "Ask the platform administrator to check your access to this action.";
|
|
49
|
+
}
|
|
50
|
+
const rejectionMessages = {
|
|
51
|
+
"invalid or expired token": "The platform reported an invalid or expired token. Sign in again with `void connect <platform-url>`, or replace `VOID_TOKEN` if you supplied it.",
|
|
52
|
+
"missing authorization header": "A platform login or token is required. Sign in with `void connect <platform-url>`, or supply a valid `VOID_TOKEN` for that platform.",
|
|
53
|
+
"session revoked; sign in again": "Your platform session was revoked. Sign in again with `void connect <platform-url>`, or replace `VOID_TOKEN` if you supplied it.",
|
|
54
|
+
"user not found": "This account is no longer available. Contact the platform administrator or sign in with an active account on this platform.",
|
|
55
|
+
"deploy credential revoked or expired": "This project deploy credential was revoked or expired. Ask the project owner to issue a replacement and update the credential used by your automation.",
|
|
56
|
+
"deploy token build is no longer active": "This build is no longer active. Start a new build to obtain a valid deployment credential.",
|
|
57
|
+
github_identity_required: "Link your GitHub account with `void github link`, then retry this operation.",
|
|
58
|
+
connect_authorization_required: "This GitHub repository requires authorization. Run `void github connect` in an interactive terminal to authorize access, then retry.",
|
|
59
|
+
"invalid connect grant": "GitHub authorization failed or expired. Run `void github connect` again.",
|
|
60
|
+
"installation access revoked": "Access to this GitHub installation was revoked. Ask its administrator to restore access, then run `void github join`.",
|
|
61
|
+
"account suspended": "This account is suspended. Contact the platform administrator to restore access.",
|
|
62
|
+
"project owner suspended": "The project owner is suspended. Ask the owner to contact the platform administrator.",
|
|
63
|
+
"project is being deleted": "This project is being deleted. Wait for deletion to finish before creating a replacement.",
|
|
64
|
+
"registered user not found": "No registered account matches that email address. Ask the recipient to sign in to this platform first, then invite their registered email.",
|
|
65
|
+
"the project owner cannot be invited or changed as a member": "The project owner cannot be invited or changed through team membership commands. Choose another member.",
|
|
66
|
+
"the project owner cannot leave the project": "The project owner cannot leave. Ask a platform administrator to transfer ownership first.",
|
|
67
|
+
"user is already a project member": "This user is already a project member. Use `void project team list` to find their user ID, then `void project team role` to change their role.",
|
|
68
|
+
"project member not found": "This user is no longer a project member. Run `void project team list` to check current members.",
|
|
69
|
+
"project has too many pending invitations": "This project has reached its pending invitation limit. Run `void project team invitations` and revoke invitations that are no longer needed."
|
|
70
|
+
};
|
|
71
|
+
function formatPlatformApiError(action, status, body, permission) {
|
|
72
|
+
const parsed = parsePlatformErrorBody(body);
|
|
73
|
+
const message = platformErrorMessage(parsed);
|
|
74
|
+
if (status === 426 && parsed?.error === "cli_outdated" && message) return message;
|
|
75
|
+
if (!parsed) {
|
|
76
|
+
if (status === 401 || status === 403) {
|
|
77
|
+
const plain = plainExplanation(body);
|
|
78
|
+
return `${action} (HTTP ${status}): ${plain && !/^(forbidden|unauthorized|access denied|permission denied)[.!]?$/i.test(plain) ? plain.replace(/\s+/g, " ").slice(0, 240) : unexplainedRejection(status)}`;
|
|
79
|
+
}
|
|
80
|
+
return `${action}: ${status} ${body}`;
|
|
81
|
+
}
|
|
82
|
+
return `${action} (HTTP ${status}): ${(message ?? (status === 403 && parsed.error === "forbidden" ? `Access denied. ${permissionMessage(permission)}` : (parsed.error && Object.hasOwn(rejectionMessages, parsed.error) ? rejectionMessages[parsed.error] : void 0) ?? (status === 401 && ["unauthorized", "missing token"].includes(parsed.error ?? "") ? rejectionMessages["invalid or expired token"] : plainExplanation(parsed.error)))) || unexplainedRejection(status)}`;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
7
85
|
//#region src/cli/client.ts
|
|
8
|
-
var client_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
-
PlatformApiError: () => PlatformApiError,
|
|
10
|
-
PlatformClient: () => PlatformClient,
|
|
11
|
-
isCliOutdatedError: () => isCliOutdatedError,
|
|
12
|
-
isExpiredTokenError: () => isExpiredTokenError,
|
|
13
|
-
parsePlatformErrorBody: () => parsePlatformErrorBody,
|
|
14
|
-
readCliVersion: () => readCliVersion
|
|
15
|
-
});
|
|
16
86
|
/**
|
|
17
87
|
* Current CLI version. Sent as `X-Void-CLI-Version` on every platform
|
|
18
88
|
* request so the platform's CLI-version gate can refuse stale CLIs
|
|
@@ -36,15 +106,6 @@ function readCliVersion() {
|
|
|
36
106
|
}
|
|
37
107
|
}
|
|
38
108
|
const VOID_CLI_VERSION = readCliVersion();
|
|
39
|
-
function parsePlatformErrorBody(body) {
|
|
40
|
-
try {
|
|
41
|
-
const parsed = JSON.parse(body);
|
|
42
|
-
if (!parsed || typeof parsed !== "object") return null;
|
|
43
|
-
return parsed;
|
|
44
|
-
} catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
109
|
/**
|
|
49
110
|
* Detects the `cli_outdated` 426 response shape emitted by the platform's
|
|
50
111
|
* `cliVersionGate` middleware. When present, callers should surface the
|
|
@@ -61,23 +122,25 @@ var PlatformApiError = class extends Error {
|
|
|
61
122
|
status;
|
|
62
123
|
body;
|
|
63
124
|
code;
|
|
64
|
-
constructor(action, status, body) {
|
|
125
|
+
constructor(action, status, body, permission) {
|
|
65
126
|
const parsed = parsePlatformErrorBody(body);
|
|
66
|
-
|
|
67
|
-
super(message);
|
|
127
|
+
super(formatPlatformApiError(action, status, body, permission));
|
|
68
128
|
this.name = "PlatformApiError";
|
|
69
129
|
this.status = status;
|
|
70
130
|
this.body = body;
|
|
71
131
|
this.code = parsed?.error ?? parsed?.message;
|
|
72
132
|
}
|
|
73
133
|
};
|
|
74
|
-
async function throwPlatformApiError(action, res) {
|
|
75
|
-
throw new PlatformApiError(action, res.status, await res.text());
|
|
134
|
+
async function throwPlatformApiError(action, res, permission) {
|
|
135
|
+
throw new PlatformApiError(action, res.status, await res.text(), isCloudflareAccessChallenge(res) ? void 0 : permission);
|
|
76
136
|
}
|
|
77
137
|
function isExpiredTokenError(error) {
|
|
78
138
|
if (error instanceof PlatformApiError) return error.status === 401 && error.code === "invalid or expired token";
|
|
79
139
|
return false;
|
|
80
140
|
}
|
|
141
|
+
function isPreflightRejection(error) {
|
|
142
|
+
return error instanceof PlatformApiError && ([401, 403].includes(error.status) && !!parsePlatformErrorBody(error.body)?.error || isCliOutdatedError(error));
|
|
143
|
+
}
|
|
81
144
|
/**
|
|
82
145
|
* Retry contract for the deploy POST's transport phase.
|
|
83
146
|
*
|
|
@@ -176,7 +239,7 @@ var PlatformClient = class {
|
|
|
176
239
|
}
|
|
177
240
|
async listProjectTokens(projectId) {
|
|
178
241
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/tokens`, { headers: { ...this.authHeaders } });
|
|
179
|
-
if (!res.ok) await throwPlatformApiError("Failed to list project tokens", res);
|
|
242
|
+
if (!res.ok) await throwPlatformApiError("Failed to list project tokens", res, "owner");
|
|
180
243
|
return res.json();
|
|
181
244
|
}
|
|
182
245
|
async createProjectToken(projectId, input) {
|
|
@@ -188,17 +251,17 @@ var PlatformClient = class {
|
|
|
188
251
|
},
|
|
189
252
|
body: JSON.stringify(input)
|
|
190
253
|
});
|
|
191
|
-
if (!res.ok) await throwPlatformApiError("Failed to create project token", res);
|
|
254
|
+
if (!res.ok) await throwPlatformApiError("Failed to create project token", res, "owner");
|
|
192
255
|
return res.json();
|
|
193
256
|
}
|
|
194
257
|
async listProjectMembers(projectId) {
|
|
195
258
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/members`, { headers: { ...this.authHeaders } });
|
|
196
|
-
if (!res.ok) await throwPlatformApiError("Failed to list project members", res);
|
|
259
|
+
if (!res.ok) await throwPlatformApiError("Failed to list project members", res, "read");
|
|
197
260
|
return (await res.json()).members;
|
|
198
261
|
}
|
|
199
262
|
async listProjectInvitations(projectId) {
|
|
200
263
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/invitations`, { headers: { ...this.authHeaders } });
|
|
201
|
-
if (!res.ok) await throwPlatformApiError("Failed to list project invitations", res);
|
|
264
|
+
if (!res.ok) await throwPlatformApiError("Failed to list project invitations", res, "members");
|
|
202
265
|
return (await res.json()).invitations;
|
|
203
266
|
}
|
|
204
267
|
async inviteProjectMember(projectId, email, role) {
|
|
@@ -213,7 +276,7 @@ var PlatformClient = class {
|
|
|
213
276
|
role
|
|
214
277
|
})
|
|
215
278
|
});
|
|
216
|
-
if (!res.ok) await throwPlatformApiError("Failed to invite project member", res);
|
|
279
|
+
if (!res.ok) await throwPlatformApiError("Failed to invite project member", res, "members");
|
|
217
280
|
return res.json();
|
|
218
281
|
}
|
|
219
282
|
async renewProjectToken(projectId, credentialId, expiresInDays) {
|
|
@@ -225,7 +288,7 @@ var PlatformClient = class {
|
|
|
225
288
|
},
|
|
226
289
|
body: JSON.stringify(expiresInDays ? { expiresInDays } : {})
|
|
227
290
|
});
|
|
228
|
-
if (!res.ok) await throwPlatformApiError("Failed to renew project token", res);
|
|
291
|
+
if (!res.ok) await throwPlatformApiError("Failed to renew project token", res, "owner");
|
|
229
292
|
return res.json();
|
|
230
293
|
}
|
|
231
294
|
async updateProjectMemberRole(projectId, userId, role) {
|
|
@@ -237,7 +300,7 @@ var PlatformClient = class {
|
|
|
237
300
|
},
|
|
238
301
|
body: JSON.stringify({ role })
|
|
239
302
|
});
|
|
240
|
-
if (!res.ok) await throwPlatformApiError("Failed to change project member role", res);
|
|
303
|
+
if (!res.ok) await throwPlatformApiError("Failed to change project member role", res, "members");
|
|
241
304
|
return res.json();
|
|
242
305
|
}
|
|
243
306
|
async revokeProjectToken(projectId, credentialId) {
|
|
@@ -245,7 +308,7 @@ var PlatformClient = class {
|
|
|
245
308
|
method: "DELETE",
|
|
246
309
|
headers: { ...this.authHeaders }
|
|
247
310
|
});
|
|
248
|
-
if (!res.ok) await throwPlatformApiError("Failed to revoke project token", res);
|
|
311
|
+
if (!res.ok) await throwPlatformApiError("Failed to revoke project token", res, "owner");
|
|
249
312
|
return res.json();
|
|
250
313
|
}
|
|
251
314
|
async removeProjectMember(projectId, userId) {
|
|
@@ -253,14 +316,14 @@ var PlatformClient = class {
|
|
|
253
316
|
method: "DELETE",
|
|
254
317
|
headers: { ...this.authHeaders }
|
|
255
318
|
});
|
|
256
|
-
if (!res.ok) await throwPlatformApiError("Failed to remove project member", res);
|
|
319
|
+
if (!res.ok) await throwPlatformApiError("Failed to remove project member", res, "members");
|
|
257
320
|
}
|
|
258
321
|
async revokeProjectInvitation(projectId, invitationId) {
|
|
259
322
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/invitations/${encodeURIComponent(invitationId)}`, {
|
|
260
323
|
method: "DELETE",
|
|
261
324
|
headers: { ...this.authHeaders }
|
|
262
325
|
});
|
|
263
|
-
if (!res.ok) await throwPlatformApiError("Failed to revoke project invitation", res);
|
|
326
|
+
if (!res.ok) await throwPlatformApiError("Failed to revoke project invitation", res, "members");
|
|
264
327
|
}
|
|
265
328
|
async leaveProject(projectId) {
|
|
266
329
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/leave`, {
|
|
@@ -283,7 +346,7 @@ var PlatformClient = class {
|
|
|
283
346
|
}
|
|
284
347
|
async listDeployments(projectId) {
|
|
285
348
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/deployments`, { headers: { ...this.authHeaders } });
|
|
286
|
-
if (!res.ok) await throwPlatformApiError("Failed to list deployments", res);
|
|
349
|
+
if (!res.ok) await throwPlatformApiError("Failed to list deployments", res, "read");
|
|
287
350
|
return res.json();
|
|
288
351
|
}
|
|
289
352
|
async rollback(projectId, deploymentId, options) {
|
|
@@ -297,7 +360,7 @@ var PlatformClient = class {
|
|
|
297
360
|
},
|
|
298
361
|
body: JSON.stringify(body)
|
|
299
362
|
});
|
|
300
|
-
if (!res.ok) await throwPlatformApiError("Rollback failed", res);
|
|
363
|
+
if (!res.ok) await throwPlatformApiError("Rollback failed", res, "deploy");
|
|
301
364
|
return res.json();
|
|
302
365
|
}
|
|
303
366
|
async cancelDeployment(projectId, deploymentId) {
|
|
@@ -305,7 +368,7 @@ var PlatformClient = class {
|
|
|
305
368
|
method: "POST",
|
|
306
369
|
headers: { ...this.authHeaders }
|
|
307
370
|
});
|
|
308
|
-
if (!res.ok) await throwPlatformApiError("Cancel deployment failed", res);
|
|
371
|
+
if (!res.ok) await throwPlatformApiError("Cancel deployment failed", res, "deploy");
|
|
309
372
|
return res.json();
|
|
310
373
|
}
|
|
311
374
|
async createProject(slug) {
|
|
@@ -335,8 +398,8 @@ var PlatformClient = class {
|
|
|
335
398
|
})
|
|
336
399
|
});
|
|
337
400
|
if (!res.ok) {
|
|
338
|
-
const error = new PlatformApiError("Preflight failed", res.status, await res.text());
|
|
339
|
-
if (
|
|
401
|
+
const error = new PlatformApiError("Preflight failed", res.status, await res.text(), isCloudflareAccessChallenge(res) ? void 0 : "deploy");
|
|
402
|
+
if (isPreflightRejection(error)) throw error;
|
|
340
403
|
return {
|
|
341
404
|
needed: Object.keys(assetManifest),
|
|
342
405
|
total,
|
|
@@ -345,7 +408,7 @@ var PlatformClient = class {
|
|
|
345
408
|
}
|
|
346
409
|
return res.json();
|
|
347
410
|
} catch (error) {
|
|
348
|
-
if (
|
|
411
|
+
if (isPreflightRejection(error)) throw error;
|
|
349
412
|
return {
|
|
350
413
|
needed: Object.keys(assetManifest),
|
|
351
414
|
total,
|
|
@@ -380,7 +443,7 @@ var PlatformClient = class {
|
|
|
380
443
|
cfRay,
|
|
381
444
|
cfCacheStatus
|
|
382
445
|
});
|
|
383
|
-
if (!res.ok) await throwPlatformApiError("Failed to request upload URLs", res);
|
|
446
|
+
if (!res.ok) await throwPlatformApiError("Failed to request upload URLs", res, "deploy");
|
|
384
447
|
return (await res.json()).urls;
|
|
385
448
|
}
|
|
386
449
|
/**
|
|
@@ -440,11 +503,7 @@ var PlatformClient = class {
|
|
|
440
503
|
if (!res.ok) {
|
|
441
504
|
const body = await res.text();
|
|
442
505
|
if (res.status === 409) {
|
|
443
|
-
|
|
444
|
-
try {
|
|
445
|
-
const raw = JSON.parse(body);
|
|
446
|
-
if (raw !== null && typeof raw === "object") parsed = raw;
|
|
447
|
-
} catch {}
|
|
506
|
+
const parsed = parsePlatformErrorBody(body);
|
|
448
507
|
if (parsed?.deployment) {
|
|
449
508
|
cliLog?.warn("deploy_conflict", {
|
|
450
509
|
url,
|
|
@@ -454,12 +513,12 @@ var PlatformClient = class {
|
|
|
454
513
|
yield {
|
|
455
514
|
event: "error",
|
|
456
515
|
step: "finalize",
|
|
457
|
-
message: `${parsed.error ?? "deploy in progress"}: deployment ${parsed.deployment} — it may be an earlier attempt of this deploy or a concurrent one; inspect with \`void project status\` before redeploying`
|
|
516
|
+
message: `${platformErrorMessage(parsed) ?? platformErrorMessage({ message: parsed.error }) ?? "deploy in progress"}: deployment ${parsed.deployment} — it may be an earlier attempt of this deploy or a concurrent one; inspect with \`void project status\` before redeploying`
|
|
458
517
|
};
|
|
459
518
|
return;
|
|
460
519
|
}
|
|
461
520
|
}
|
|
462
|
-
throw new PlatformApiError("Deploy failed", res.status, body);
|
|
521
|
+
throw new PlatformApiError("Deploy failed", res.status, body, isCloudflareAccessChallenge(res) ? void 0 : "deploy");
|
|
463
522
|
}
|
|
464
523
|
const reader = res.body.getReader();
|
|
465
524
|
const decoder = new TextDecoder();
|
|
@@ -514,7 +573,7 @@ var PlatformClient = class {
|
|
|
514
573
|
}
|
|
515
574
|
async listSecrets(projectId) {
|
|
516
575
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/secrets`, { headers: { ...this.authHeaders } });
|
|
517
|
-
if (!res.ok) await throwPlatformApiError("Failed to list secrets", res);
|
|
576
|
+
if (!res.ok) await throwPlatformApiError("Failed to list secrets", res, "configure");
|
|
518
577
|
return res.json();
|
|
519
578
|
}
|
|
520
579
|
async setSecret(projectId, name, value) {
|
|
@@ -526,7 +585,7 @@ var PlatformClient = class {
|
|
|
526
585
|
},
|
|
527
586
|
body: JSON.stringify({ value })
|
|
528
587
|
});
|
|
529
|
-
if (!res.ok) await throwPlatformApiError("Failed to set secret", res);
|
|
588
|
+
if (!res.ok) await throwPlatformApiError("Failed to set secret", res, "configure");
|
|
530
589
|
return res.json();
|
|
531
590
|
}
|
|
532
591
|
async deleteProject(projectId) {
|
|
@@ -534,14 +593,14 @@ var PlatformClient = class {
|
|
|
534
593
|
method: "DELETE",
|
|
535
594
|
headers: { ...this.authHeaders }
|
|
536
595
|
});
|
|
537
|
-
if (!res.ok) await throwPlatformApiError("Failed to delete project", res);
|
|
596
|
+
if (!res.ok) await throwPlatformApiError("Failed to delete project", res, "owner");
|
|
538
597
|
return res.json();
|
|
539
598
|
}
|
|
540
599
|
async getMigrationStatus(projectId, dialect) {
|
|
541
600
|
const url = new URL(`${this.baseUrl}/projects/${projectId}/migrations`);
|
|
542
601
|
if (dialect) url.searchParams.set("dialect", dialect);
|
|
543
602
|
const res = await this.request(url, { headers: { ...this.authHeaders } });
|
|
544
|
-
if (!res.ok) await throwPlatformApiError("Failed to get migration status", res);
|
|
603
|
+
if (!res.ok) await throwPlatformApiError("Failed to get migration status", res, "read");
|
|
545
604
|
return res.json();
|
|
546
605
|
}
|
|
547
606
|
async applyRemoteMigrations(projectId, migrations) {
|
|
@@ -553,7 +612,7 @@ var PlatformClient = class {
|
|
|
553
612
|
},
|
|
554
613
|
body: JSON.stringify({ migrations })
|
|
555
614
|
});
|
|
556
|
-
if (!res.ok) await throwPlatformApiError("Failed to apply remote migrations", res);
|
|
615
|
+
if (!res.ok) await throwPlatformApiError("Failed to apply remote migrations", res, "configure");
|
|
557
616
|
return res.json();
|
|
558
617
|
}
|
|
559
618
|
async renameMigrations(projectId, renames) {
|
|
@@ -565,7 +624,7 @@ var PlatformClient = class {
|
|
|
565
624
|
},
|
|
566
625
|
body: JSON.stringify({ renames })
|
|
567
626
|
});
|
|
568
|
-
if (!res.ok) await throwPlatformApiError("Failed to rename remote migrations", res);
|
|
627
|
+
if (!res.ok) await throwPlatformApiError("Failed to rename remote migrations", res, "configure");
|
|
569
628
|
return res.json();
|
|
570
629
|
}
|
|
571
630
|
async addDomain(projectId, hostname) {
|
|
@@ -577,17 +636,17 @@ var PlatformClient = class {
|
|
|
577
636
|
},
|
|
578
637
|
body: JSON.stringify({ hostname })
|
|
579
638
|
});
|
|
580
|
-
if (!res.ok) await throwPlatformApiError("Failed to add domain", res);
|
|
639
|
+
if (!res.ok) await throwPlatformApiError("Failed to add domain", res, "settings");
|
|
581
640
|
return res.json();
|
|
582
641
|
}
|
|
583
642
|
async listDomains(projectId) {
|
|
584
643
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/domains`, { headers: { ...this.authHeaders } });
|
|
585
|
-
if (!res.ok) await throwPlatformApiError("Failed to list domains", res);
|
|
644
|
+
if (!res.ok) await throwPlatformApiError("Failed to list domains", res, "read");
|
|
586
645
|
return res.json();
|
|
587
646
|
}
|
|
588
647
|
async getDomainStatus(projectId, domainId) {
|
|
589
648
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/domains/${domainId}`, { headers: { ...this.authHeaders } });
|
|
590
|
-
if (!res.ok) await throwPlatformApiError("Failed to get domain status", res);
|
|
649
|
+
if (!res.ok) await throwPlatformApiError("Failed to get domain status", res, "read");
|
|
591
650
|
return res.json();
|
|
592
651
|
}
|
|
593
652
|
async removeDomain(projectId, domainId) {
|
|
@@ -595,7 +654,7 @@ var PlatformClient = class {
|
|
|
595
654
|
method: "DELETE",
|
|
596
655
|
headers: { ...this.authHeaders }
|
|
597
656
|
});
|
|
598
|
-
if (!res.ok) await throwPlatformApiError("Failed to remove domain", res);
|
|
657
|
+
if (!res.ok) await throwPlatformApiError("Failed to remove domain", res, "settings");
|
|
599
658
|
return res.json();
|
|
600
659
|
}
|
|
601
660
|
async deleteSecret(projectId, name) {
|
|
@@ -603,12 +662,12 @@ var PlatformClient = class {
|
|
|
603
662
|
method: "DELETE",
|
|
604
663
|
headers: { ...this.authHeaders }
|
|
605
664
|
});
|
|
606
|
-
if (!res.ok) await throwPlatformApiError("Failed to delete secret", res);
|
|
665
|
+
if (!res.ok) await throwPlatformApiError("Failed to delete secret", res, "configure");
|
|
607
666
|
return res.json();
|
|
608
667
|
}
|
|
609
668
|
async getResources(projectId) {
|
|
610
669
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/resources`, { headers: { ...this.authHeaders } });
|
|
611
|
-
if (!res.ok) await throwPlatformApiError("Failed to get resources", res);
|
|
670
|
+
if (!res.ok) await throwPlatformApiError("Failed to get resources", res, "read");
|
|
612
671
|
return res.json();
|
|
613
672
|
}
|
|
614
673
|
async createPrerenderToken(projectId) {
|
|
@@ -616,7 +675,7 @@ var PlatformClient = class {
|
|
|
616
675
|
method: "POST",
|
|
617
676
|
headers: { ...this.authHeaders }
|
|
618
677
|
});
|
|
619
|
-
if (!res.ok) await throwPlatformApiError("Failed to create prerender token", res);
|
|
678
|
+
if (!res.ok) await throwPlatformApiError("Failed to create prerender token", res, "deploy");
|
|
620
679
|
return (await res.json()).token;
|
|
621
680
|
}
|
|
622
681
|
async provisionDatabase(projectId, connectionString) {
|
|
@@ -628,7 +687,7 @@ var PlatformClient = class {
|
|
|
628
687
|
},
|
|
629
688
|
body: JSON.stringify({ connectionString })
|
|
630
689
|
});
|
|
631
|
-
if (!res.ok) await throwPlatformApiError("Failed to provision database", res);
|
|
690
|
+
if (!res.ok) await throwPlatformApiError("Failed to provision database", res, "configure");
|
|
632
691
|
return res.json();
|
|
633
692
|
}
|
|
634
693
|
async setDatabaseUrl(projectId, connectionString) {
|
|
@@ -640,12 +699,12 @@ var PlatformClient = class {
|
|
|
640
699
|
},
|
|
641
700
|
body: JSON.stringify({ connectionString })
|
|
642
701
|
});
|
|
643
|
-
if (!res.ok) await throwPlatformApiError("Failed to update database URL", res);
|
|
702
|
+
if (!res.ok) await throwPlatformApiError("Failed to update database URL", res, "configure");
|
|
644
703
|
return res.json();
|
|
645
704
|
}
|
|
646
705
|
async getDatabaseUrl(projectId) {
|
|
647
706
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/database-url`, { headers: { ...this.authHeaders } });
|
|
648
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch database URL", res);
|
|
707
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch database URL", res, "owner");
|
|
649
708
|
return res.json();
|
|
650
709
|
}
|
|
651
710
|
async purgeCache(projectId) {
|
|
@@ -657,7 +716,7 @@ var PlatformClient = class {
|
|
|
657
716
|
},
|
|
658
717
|
body: JSON.stringify({ all: true })
|
|
659
718
|
});
|
|
660
|
-
if (!res.ok) await throwPlatformApiError("Cache purge failed", res);
|
|
719
|
+
if (!res.ok) await throwPlatformApiError("Cache purge failed", res, "deploy");
|
|
661
720
|
return res.json();
|
|
662
721
|
}
|
|
663
722
|
async getLogs(projectId, since, limit = 200, deploymentId, level) {
|
|
@@ -668,7 +727,7 @@ var PlatformClient = class {
|
|
|
668
727
|
if (deploymentId) params.set("deploymentId", deploymentId);
|
|
669
728
|
if (level && level !== "all") params.set("level", level);
|
|
670
729
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/logs?${params}`, { headers: { ...this.authHeaders } });
|
|
671
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch logs", res);
|
|
730
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch logs", res, "read");
|
|
672
731
|
return (await res.json()).data;
|
|
673
732
|
}
|
|
674
733
|
async getRequests(projectId, since, limit = 200, status) {
|
|
@@ -678,19 +737,19 @@ var PlatformClient = class {
|
|
|
678
737
|
});
|
|
679
738
|
if (status && status !== "all") params.set("status", status);
|
|
680
739
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/requests?${params}`, { headers: { ...this.authHeaders } });
|
|
681
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch requests", res);
|
|
740
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch requests", res, "read");
|
|
682
741
|
return (await res.json()).data;
|
|
683
742
|
}
|
|
684
743
|
async listBuilds(projectId, limit = 20) {
|
|
685
744
|
const params = new URLSearchParams({ limit: String(limit) });
|
|
686
745
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/builds?${params}`, { headers: { ...this.authHeaders } });
|
|
687
|
-
if (!res.ok) await throwPlatformApiError("Failed to list builds", res);
|
|
746
|
+
if (!res.ok) await throwPlatformApiError("Failed to list builds", res, "read");
|
|
688
747
|
return (await res.json()).builds;
|
|
689
748
|
}
|
|
690
749
|
async getBuildLogs(projectId, buildId, since = 0) {
|
|
691
750
|
const params = new URLSearchParams({ since: String(since) });
|
|
692
751
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/builds/${buildId}/logs?${params}`, { headers: { ...this.authHeaders } });
|
|
693
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch build logs", res);
|
|
752
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch build logs", res, "read");
|
|
694
753
|
return res.json();
|
|
695
754
|
}
|
|
696
755
|
async getGithubInstallUrl() {
|
|
@@ -712,7 +771,7 @@ var PlatformClient = class {
|
|
|
712
771
|
},
|
|
713
772
|
body: JSON.stringify(body)
|
|
714
773
|
});
|
|
715
|
-
if (!res.ok) await throwPlatformApiError("Failed to connect GitHub repository", res);
|
|
774
|
+
if (!res.ok) await throwPlatformApiError("Failed to connect GitHub repository", res, "settings");
|
|
716
775
|
return res.json();
|
|
717
776
|
}
|
|
718
777
|
/**
|
|
@@ -736,7 +795,7 @@ var PlatformClient = class {
|
|
|
736
795
|
}
|
|
737
796
|
async getGithubConnection(projectId) {
|
|
738
797
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/github`, { headers: { ...this.authHeaders } });
|
|
739
|
-
if (!res.ok) await throwPlatformApiError("Failed to get GitHub connection", res);
|
|
798
|
+
if (!res.ok) await throwPlatformApiError("Failed to get GitHub connection", res, "read");
|
|
740
799
|
return res.json();
|
|
741
800
|
}
|
|
742
801
|
async updateGithubConnection(projectId, body) {
|
|
@@ -748,7 +807,7 @@ var PlatformClient = class {
|
|
|
748
807
|
},
|
|
749
808
|
body: JSON.stringify(body)
|
|
750
809
|
});
|
|
751
|
-
if (!res.ok) await throwPlatformApiError("Failed to update GitHub connection", res);
|
|
810
|
+
if (!res.ok) await throwPlatformApiError("Failed to update GitHub connection", res, "settings");
|
|
752
811
|
return res.json();
|
|
753
812
|
}
|
|
754
813
|
async deleteGithubConnection(projectId) {
|
|
@@ -756,7 +815,7 @@ var PlatformClient = class {
|
|
|
756
815
|
method: "DELETE",
|
|
757
816
|
headers: { ...this.authHeaders }
|
|
758
817
|
});
|
|
759
|
-
if (!res.ok) await throwPlatformApiError("Failed to disconnect GitHub repository", res);
|
|
818
|
+
if (!res.ok) await throwPlatformApiError("Failed to disconnect GitHub repository", res, "settings");
|
|
760
819
|
return res.json();
|
|
761
820
|
}
|
|
762
821
|
async getGithubLinkUrl(redirect, codeChallenge) {
|
|
@@ -811,24 +870,24 @@ var PlatformClient = class {
|
|
|
811
870
|
}
|
|
812
871
|
async getEmailUsage(projectId) {
|
|
813
872
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/email/usage`, { headers: { ...this.authHeaders } });
|
|
814
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch email usage", res);
|
|
873
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch email usage", res, "read");
|
|
815
874
|
return res.json();
|
|
816
875
|
}
|
|
817
876
|
async getEmailLogs(projectId, limit) {
|
|
818
877
|
const url = new URL(`${this.baseUrl}/projects/${projectId}/email/logs`);
|
|
819
878
|
if (limit !== void 0) url.searchParams.set("limit", String(limit));
|
|
820
879
|
const res = await this.request(url, { headers: { ...this.authHeaders } });
|
|
821
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch email logs", res);
|
|
880
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch email logs", res, "read");
|
|
822
881
|
return res.json();
|
|
823
882
|
}
|
|
824
883
|
async getEmailOperation(projectId, operationId) {
|
|
825
884
|
const res = await this.request(`${this.baseUrl}/projects/${encodeURIComponent(projectId)}/email/operations/${encodeURIComponent(operationId)}`, { headers: { ...this.authHeaders } });
|
|
826
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch email operation", res);
|
|
885
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch email operation", res, "read");
|
|
827
886
|
return res.json();
|
|
828
887
|
}
|
|
829
888
|
async listEmailDestinations(projectId) {
|
|
830
889
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/email/destinations`, { headers: { ...this.authHeaders } });
|
|
831
|
-
if (!res.ok) await throwPlatformApiError("Failed to list email destinations", res);
|
|
890
|
+
if (!res.ok) await throwPlatformApiError("Failed to list email destinations", res, "read");
|
|
832
891
|
return res.json();
|
|
833
892
|
}
|
|
834
893
|
async addEmailDestination(projectId, address) {
|
|
@@ -840,7 +899,7 @@ var PlatformClient = class {
|
|
|
840
899
|
},
|
|
841
900
|
body: JSON.stringify({ address })
|
|
842
901
|
});
|
|
843
|
-
if (!res.ok) await throwPlatformApiError("Failed to add email destination", res);
|
|
902
|
+
if (!res.ok) await throwPlatformApiError("Failed to add email destination", res, "settings");
|
|
844
903
|
return {
|
|
845
904
|
...await res.json(),
|
|
846
905
|
created: res.status === 201
|
|
@@ -851,18 +910,18 @@ var PlatformClient = class {
|
|
|
851
910
|
method: "DELETE",
|
|
852
911
|
headers: { ...this.authHeaders }
|
|
853
912
|
});
|
|
854
|
-
if (!res.ok) await throwPlatformApiError("Failed to remove email destination", res);
|
|
913
|
+
if (!res.ok) await throwPlatformApiError("Failed to remove email destination", res, "settings");
|
|
855
914
|
return res.json();
|
|
856
915
|
}
|
|
857
916
|
/** Installation email settings the CLI reads before starting a credential flow. */
|
|
858
917
|
async getEmailSettings(projectId) {
|
|
859
918
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/email/settings`, { headers: { ...this.authHeaders } });
|
|
860
|
-
if (!res.ok) await throwPlatformApiError("Failed to read email settings", res);
|
|
919
|
+
if (!res.ok) await throwPlatformApiError("Failed to read email settings", res, "read");
|
|
861
920
|
return res.json();
|
|
862
921
|
}
|
|
863
922
|
async listEmailDomains(projectId) {
|
|
864
923
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/email/domains`, { headers: { ...this.authHeaders } });
|
|
865
|
-
if (!res.ok) await throwPlatformApiError("Failed to list email domains", res);
|
|
924
|
+
if (!res.ok) await throwPlatformApiError("Failed to list email domains", res, "read");
|
|
866
925
|
return res.json();
|
|
867
926
|
}
|
|
868
927
|
/** Submit a scoped token once; later operations address the domain without it. */
|
|
@@ -879,12 +938,12 @@ var PlatformClient = class {
|
|
|
879
938
|
...input.attemptId !== void 0 ? { attemptId: input.attemptId } : {}
|
|
880
939
|
})
|
|
881
940
|
});
|
|
882
|
-
if (!res.ok) await throwPlatformApiError("Failed to add email domain", res);
|
|
941
|
+
if (!res.ok) await throwPlatformApiError("Failed to add email domain", res, "settings");
|
|
883
942
|
return res.json();
|
|
884
943
|
}
|
|
885
944
|
async getEmailDomain(projectId, domain) {
|
|
886
945
|
const res = await this.request(`${this.baseUrl}/projects/${projectId}/email/domains/${encodeURIComponent(domain)}`, { headers: { ...this.authHeaders } });
|
|
887
|
-
if (!res.ok) await throwPlatformApiError("Failed to fetch email domain status", res);
|
|
946
|
+
if (!res.ok) await throwPlatformApiError("Failed to fetch email domain status", res, "read");
|
|
888
947
|
return res.json();
|
|
889
948
|
}
|
|
890
949
|
/** Rotates the shared zone connection secret. */
|
|
@@ -897,7 +956,7 @@ var PlatformClient = class {
|
|
|
897
956
|
},
|
|
898
957
|
body: JSON.stringify({ attemptId })
|
|
899
958
|
});
|
|
900
|
-
if (!res.ok) await throwPlatformApiError("Failed to rotate email connection secret", res);
|
|
959
|
+
if (!res.ok) await throwPlatformApiError("Failed to rotate email connection secret", res, "settings");
|
|
901
960
|
return res.json();
|
|
902
961
|
}
|
|
903
962
|
async syncEmailDomain(projectId, domain) {
|
|
@@ -905,7 +964,7 @@ var PlatformClient = class {
|
|
|
905
964
|
method: "POST",
|
|
906
965
|
headers: { ...this.authHeaders }
|
|
907
966
|
});
|
|
908
|
-
if (!res.ok) await throwPlatformApiError("Failed to sync email domain", res);
|
|
967
|
+
if (!res.ok) await throwPlatformApiError("Failed to sync email domain", res, "settings");
|
|
909
968
|
return res.json();
|
|
910
969
|
}
|
|
911
970
|
async removeEmailDomain(projectId, domain) {
|
|
@@ -913,7 +972,7 @@ var PlatformClient = class {
|
|
|
913
972
|
method: "DELETE",
|
|
914
973
|
headers: { ...this.authHeaders }
|
|
915
974
|
});
|
|
916
|
-
if (!res.ok) await throwPlatformApiError("Failed to remove email domain", res);
|
|
975
|
+
if (!res.ok) await throwPlatformApiError("Failed to remove email domain", res, "settings");
|
|
917
976
|
return res.json();
|
|
918
977
|
}
|
|
919
978
|
};
|
|
@@ -921,4 +980,4 @@ function sleep(ms) {
|
|
|
921
980
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
922
981
|
}
|
|
923
982
|
//#endregion
|
|
924
|
-
export {
|
|
983
|
+
export { readCliVersion as a, isExpiredTokenError as i, PlatformClient as n, parsePlatformErrorBody as o, isCliOutdatedError as r, platformErrorMessage as s, PlatformApiError as t };
|