void 0.22.0 → 0.23.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 +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-C84Ee8cO.mjs} +4 -4
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
- package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-CioEg6uY.mjs} +4 -4
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-BsR981d4.mjs} +4 -4
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-LzvNJORH.mjs} +17 -5
- package/dist/{cache-D0sWhgKI.mjs → cache-C4MvnrMH.mjs} +2 -2
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-abUxpP2n.mjs} +2 -2
- package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +80 -455
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +442 -421
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-Cu7jWiF1.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-RV8NVeB8.mjs} +140 -21
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +5 -5
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-B8uPZ4nx.mjs} +3 -3
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-fxHb-byx.mjs} +116 -172
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-Dg-WkW-C.mjs → connect-Bd4kJd9U.mjs} +5 -5
- package/dist/{create-project-DdoqwFLF.mjs → create-project-Boczwj5r.mjs} +1 -1
- package/dist/{create-project-l9J7pbtm.mjs → create-project-bMf6ffLZ.mjs} +2 -2
- package/dist/{db-gp2sCXyN.mjs → db-8uG64XLl.mjs} +21 -21
- package/dist/{delete-TTedbH6B.mjs → delete-NvbiyeJf.mjs} +2 -2
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-DzAIwqNU.mjs} +908 -582
- package/dist/{deploy-B19L2Bra.mjs → deploy-bjXdFCtn.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-y5Tvydvo.mjs} +3 -3
- package/dist/{email-Bo6G9LOZ.mjs → email-B3umsW75.mjs} +13 -28
- package/dist/{env-BYOrWQnv.mjs → env-BS6qYHDb.mjs} +4 -4
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-sCtlCOdA.mjs → gen-B580--vC.mjs} +2 -2
- package/dist/gen-BVaUUumi.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-v45BdfKX.mjs} +2 -2
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/help-DofyZuY7.mjs +2 -0
- package/dist/{help-GKtwl07I.mjs → help-daGKjXGk.mjs} +229 -747
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +288 -1502
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-Bvy7zrBo.mjs} +46 -15
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-CDqqCjFl.mjs} +3 -3
- package/dist/{list-D44jmIAM.mjs → list-CZj0dzKY.mjs} +3 -3
- package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/login-DYt_An22.mjs +2 -0
- package/dist/{login-CAsAsQ-_.mjs → login-UZKFM_u7.mjs} +3 -3
- package/dist/{logs-BjKvFnVM.mjs → logs-CUZ6t9t3.mjs} +3 -3
- package/dist/migrate-8_2u55MD.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-DHul7PRV.mjs} +2 -1
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-CLgKGlwU.mjs +690 -0
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DBA6dl0m.mjs} +68 -22
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-BJdRtlLq.mjs +506 -0
- package/dist/platform-args-D3RXyR6h.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-B56E9YP1.mjs} +3 -3
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BDWO_aER.mjs} +2 -2
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-1gg4CSRe.mjs} +3 -3
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMcQStSc.mjs} +24 -3
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-BNkcz0OB.mjs} +2 -2
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-9OyBALhH.mjs} +327 -215
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CjwLVQwN.mjs} +6 -3
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-CnyTdcWX.mjs} +1 -1
- package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-B5Mkic5u.mjs} +1 -1
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DOsL0CC9.mjs} +4 -20
- package/dist/prepare-cgvDMtSb.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-CNzrqvBv.mjs} +16 -16
- package/dist/{project-team-BvgM0WoX.mjs → project-team-DQOWPfQT.mjs} +2 -2
- package/dist/{project-token-l5DqK6Az.mjs → project-token-CTDYU0Cc.mjs} +2 -2
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-BNAkW-_0.mjs} +2 -2
- package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-Fr9pRqce.mjs → provision-C4ORE7G7.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CJFgTZY8.mjs} +89 -198
- package/dist/{requests-DN-BbNiM.mjs → requests-MhxYnau8.mjs} +2 -2
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CJ6iSDoU.mjs} +3 -3
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +84 -17
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +1 -1
- package/dist/runtime/sandbox-container.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +3 -3
- package/dist/runtime/sandbox.mjs +75 -45
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
- package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
- package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-BOtOl_cb.mjs → secret-Dli5fP0B.mjs} +4 -4
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
- package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +15 -8
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +50 -135
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +27 -113
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +3 -47
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +5 -18
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +22 -72
- package/skills/void/docs/guide/email/domains.md +112 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +23 -152
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
- package/skills/void/docs/guide/platform/installation/domains.md +30 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +2 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +20 -15
- package/skills/void/docs/guide/platform/installation/setup.md +9 -5
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +4 -9
- package/skills/void/docs/guide/sandboxes.md +29 -21
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +88 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +85 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +127 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +32 -1682
- package/skills/void/docs/reference/config.md +12 -18
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/login-CGcRKEoi.mjs +0 -2
- package/dist/migrate-CYfbKkXh.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-Bm3iq-u4.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
package/dist/cli/cli.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import { a as join } from "../dist-BVqXeR_h.mjs";
|
|
|
3
3
|
import { j as log } from "../dist-CTBk70IR.mjs";
|
|
4
4
|
import { n as getPackageDir } from "../agents-B_pX_HmQ.mjs";
|
|
5
5
|
import { t as formatCloudflareUserMessage } from "../cloudflare-user-output-Q-k0QoNQ.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "../help-daGKjXGk.mjs";
|
|
7
7
|
import { r as OperatorClientError } from "../operator-client-DUwumHpQ.mjs";
|
|
8
|
+
import { n as platformSubcommands, t as parsePlatformArgs } from "../platform-args-BJdRtlLq.mjs";
|
|
8
9
|
import { readFileSync } from "node:fs";
|
|
9
|
-
import { PLATFORM_LOGIN_KINDS, parsePlatformLoginId } from "@void/platform";
|
|
10
10
|
import { parseArgs } from "node:util";
|
|
11
11
|
//#region src/cli/account-args.ts
|
|
12
12
|
const accountSubcommands = [
|
|
@@ -63,7 +63,6 @@ function parseDeployArgs(args) {
|
|
|
63
63
|
"skip-build": { type: "boolean" },
|
|
64
64
|
debug: { type: "boolean" },
|
|
65
65
|
platform: { type: "string" },
|
|
66
|
-
backend: { type: "string" },
|
|
67
66
|
provision: { type: "boolean" },
|
|
68
67
|
"require-email": { type: "boolean" },
|
|
69
68
|
atomic: { type: "boolean" }
|
|
@@ -75,9 +74,7 @@ function parseDeployArgs(args) {
|
|
|
75
74
|
} catch (error) {
|
|
76
75
|
const message = error instanceof Error ? error.message : String(error);
|
|
77
76
|
if (message.includes("argument missing") || message.includes("argument is ambiguous")) {
|
|
78
|
-
|
|
79
|
-
if (optionMatch?.[1] === "--platform") throw new Error("deploy: --platform requires a value ('cloudflare' or 'void').");
|
|
80
|
-
if (optionMatch?.[1] === "--backend") throw new Error("deploy: --backend requires a value ('cloudflare').");
|
|
77
|
+
if (message.match(/Option '(--[a-z-]+)/)?.[1] === "--platform") throw new Error("deploy: --platform requires a value ('cloudflare' or 'void').");
|
|
81
78
|
throw new Error("deploy: --project requires a slug.");
|
|
82
79
|
}
|
|
83
80
|
const unknownOptionMatch = message.match(/Unknown option '([^']+)'/);
|
|
@@ -86,11 +83,7 @@ function parseDeployArgs(args) {
|
|
|
86
83
|
}
|
|
87
84
|
const tokens = parsed.tokens ?? [];
|
|
88
85
|
if (tokens.filter((token) => token.kind === "option" && token.name === "project").length > 1) throw new Error("deploy: --project can only be specified once.");
|
|
89
|
-
|
|
90
|
-
if (backendTokens.length > 1) throw new Error("deploy: --backend can only be specified once.");
|
|
91
|
-
const platformTokens = tokens.filter((token) => token.kind === "option" && token.name === "platform");
|
|
92
|
-
if (platformTokens.length > 1) throw new Error("deploy: --platform can only be specified once.");
|
|
93
|
-
if (platformTokens.length > 0 && backendTokens.length > 0) throw new Error("deploy: --platform and --backend cannot be used together.");
|
|
86
|
+
if (tokens.filter((token) => token.kind === "option" && token.name === "platform").length > 1) throw new Error("deploy: --platform can only be specified once.");
|
|
94
87
|
if (parsed.positionals.length > 0) throw new Error(`deploy: Unexpected argument '${parsed.positionals[0]}'.`);
|
|
95
88
|
const projectValue = parsed.values.project;
|
|
96
89
|
const projectSlug = typeof projectValue === "string" ? projectValue : void 0;
|
|
@@ -102,15 +95,12 @@ function parseDeployArgs(args) {
|
|
|
102
95
|
const platformValue = typeof parsed.values.platform === "string" ? parsed.values.platform : void 0;
|
|
103
96
|
if (platformValue !== void 0 && platformValue !== "cloudflare" && platformValue !== "void") throw new Error("deploy: --platform must be 'cloudflare' or 'void'.");
|
|
104
97
|
const platform = platformValue;
|
|
105
|
-
const backendValue = typeof parsed.values.backend === "string" ? parsed.values.backend : void 0;
|
|
106
|
-
if (backendValue !== void 0 && backendValue !== "cloudflare") throw new Error("deploy: --backend must be 'cloudflare'.");
|
|
107
|
-
const backend = backendValue;
|
|
108
98
|
const provision = parsed.values.provision === true ? true : void 0;
|
|
109
|
-
if (provision &&
|
|
99
|
+
if (provision && platform !== "cloudflare") throw new Error("deploy: --provision requires --platform cloudflare.");
|
|
110
100
|
const requireEmail = parsed.values["require-email"] === true ? true : void 0;
|
|
111
101
|
const atomic = parsed.values.atomic === true ? true : void 0;
|
|
112
|
-
if (requireEmail &&
|
|
113
|
-
if (
|
|
102
|
+
if (requireEmail && platform !== "cloudflare") throw new Error("deploy: --require-email requires --platform cloudflare.");
|
|
103
|
+
if (platform === "cloudflare") {
|
|
114
104
|
if (projectSlug !== void 0) throw new Error("deploy: --project is not supported with --platform cloudflare — this platform deploys to your own Cloudflare account and no Void project is involved.");
|
|
115
105
|
}
|
|
116
106
|
return {
|
|
@@ -120,7 +110,6 @@ function parseDeployArgs(args) {
|
|
|
120
110
|
skipBuild,
|
|
121
111
|
debug,
|
|
122
112
|
platform,
|
|
123
|
-
backend,
|
|
124
113
|
provision,
|
|
125
114
|
requireEmail,
|
|
126
115
|
atomic
|
|
@@ -614,7 +603,6 @@ function parseEmailArgs(args) {
|
|
|
614
603
|
let limit;
|
|
615
604
|
const projectValues = [];
|
|
616
605
|
const platformValues = [];
|
|
617
|
-
const backendValues = [];
|
|
618
606
|
const subdomainValues = [];
|
|
619
607
|
const positional = [];
|
|
620
608
|
const rest = args.slice(1);
|
|
@@ -635,12 +623,8 @@ function parseEmailArgs(args) {
|
|
|
635
623
|
if (value === void 0) throw new Error("email: --platform requires a value ('cloudflare' or 'void').");
|
|
636
624
|
platformValues.push(value);
|
|
637
625
|
i = next;
|
|
638
|
-
} else if (rest[i] === "--backend" || rest[i]?.startsWith("--backend="))
|
|
639
|
-
|
|
640
|
-
if (value === void 0) throw new Error("email: --backend requires a value ('cloudflare').");
|
|
641
|
-
backendValues.push(value);
|
|
642
|
-
i = next;
|
|
643
|
-
} else if (rest[i] === "--subdomain" || rest[i]?.startsWith("--subdomain=")) {
|
|
626
|
+
} else if (rest[i] === "--backend" || rest[i]?.startsWith("--backend=")) throw new Error("email: Unknown option '--backend'.");
|
|
627
|
+
else if (rest[i] === "--subdomain" || rest[i]?.startsWith("--subdomain=")) {
|
|
644
628
|
const { value, next } = readFlagValue(rest, i, "--subdomain");
|
|
645
629
|
if (value === void 0 || value.trim() === "") throw new Error("email: --subdomain requires a value (a subdomain label or host).");
|
|
646
630
|
subdomainValues.push(value);
|
|
@@ -648,20 +632,13 @@ function parseEmailArgs(args) {
|
|
|
648
632
|
} else positional.push(rest[i]);
|
|
649
633
|
if (projectValues.length > 1) throw new Error("email: --project can only be specified once.");
|
|
650
634
|
const projectSlug = projectValues[0];
|
|
651
|
-
if (backendValues.length > 1) throw new Error("email: --backend can only be specified once.");
|
|
652
635
|
if (platformValues.length > 1) throw new Error("email: --platform can only be specified once.");
|
|
653
|
-
if (platformValues.length > 0 && backendValues.length > 0) throw new Error("email: --platform and --backend cannot be used together.");
|
|
654
636
|
let platform;
|
|
655
637
|
const platformValue = platformValues[0];
|
|
656
638
|
if (platformValue !== void 0) {
|
|
657
639
|
if (platformValue !== "cloudflare" && platformValue !== "void") throw new Error("email: --platform must be 'cloudflare' or 'void'.");
|
|
658
640
|
platform = platformValue;
|
|
659
641
|
}
|
|
660
|
-
const backendValue = backendValues[0];
|
|
661
|
-
if (backendValue !== void 0) {
|
|
662
|
-
if (backendValue !== "cloudflare") throw new Error("email: --backend must be 'cloudflare'.");
|
|
663
|
-
platform = "cloudflare";
|
|
664
|
-
}
|
|
665
642
|
if (subdomainValues.length > 1) throw new Error("email: --subdomain can only be specified once.");
|
|
666
643
|
const subdomain = subdomainValues[0];
|
|
667
644
|
if (subcommand === "domain") {
|
|
@@ -1172,390 +1149,16 @@ function parseGithubArgs(args) {
|
|
|
1172
1149
|
throw new Error("github: Usage: void github <install|installations|connect|update|status|disconnect|link|join>.");
|
|
1173
1150
|
}
|
|
1174
1151
|
//#endregion
|
|
1175
|
-
//#region src/cli/
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
"link",
|
|
1186
|
-
"admission",
|
|
1187
|
-
"protection",
|
|
1188
|
-
"recover"
|
|
1189
|
-
];
|
|
1190
|
-
function parsePlatformConfigArgs(args) {
|
|
1191
|
-
if (args.length && args[0] !== "auth") throw new Error("platform: Usage: void platform config auth [command] [options].");
|
|
1192
|
-
const positional = [];
|
|
1193
|
-
const flags = /* @__PURE__ */ new Set();
|
|
1194
|
-
const values = /* @__PURE__ */ new Map();
|
|
1195
|
-
const valueFlags = [
|
|
1196
|
-
"connection",
|
|
1197
|
-
"installation",
|
|
1198
|
-
"id",
|
|
1199
|
-
"file",
|
|
1200
|
-
"client-secret-env",
|
|
1201
|
-
"test-id"
|
|
1202
|
-
];
|
|
1203
|
-
for (let index = 1; index < args.length; index++) {
|
|
1204
|
-
const arg = args[index];
|
|
1205
|
-
if (!arg.startsWith("-")) {
|
|
1206
|
-
positional.push(arg);
|
|
1207
|
-
continue;
|
|
1208
|
-
}
|
|
1209
|
-
const name = arg.slice(2);
|
|
1210
|
-
if (!arg.startsWith("--") || ![
|
|
1211
|
-
"json",
|
|
1212
|
-
"plan",
|
|
1213
|
-
"yes"
|
|
1214
|
-
].includes(name) && !valueFlags.includes(name)) throw new Error(`platform: Unknown config auth flag ${arg}.`);
|
|
1215
|
-
if (flags.has(name) || values.has(name)) throw new Error(`platform: Duplicate flag ${arg}.`);
|
|
1216
|
-
if (!valueFlags.includes(name)) {
|
|
1217
|
-
flags.add(name);
|
|
1218
|
-
continue;
|
|
1219
|
-
}
|
|
1220
|
-
const value = args[++index];
|
|
1221
|
-
if (!value || value.startsWith("-")) throw new Error(`platform: ${arg} requires a value.`);
|
|
1222
|
-
values.set(name, value);
|
|
1223
|
-
}
|
|
1224
|
-
const [action = "", target = "", ...extra] = positional;
|
|
1225
|
-
if (extra.length || action && !PLATFORM_AUTH_ACTIONS.includes(action)) throw new Error(`platform: Usage: void platform config auth <${PLATFORM_AUTH_ACTIONS.join("|")}>.`);
|
|
1226
|
-
const needsTarget = action && action !== "list" && action !== "initialize" && action !== "admission";
|
|
1227
|
-
if (needsTarget && !target || !needsTarget && target) throw new Error(`platform: ${action || "config auth"} ${needsTarget ? "requires a method" : "does not accept a method"}.`);
|
|
1228
|
-
if (action === "add") {
|
|
1229
|
-
if (!PLATFORM_LOGIN_KINDS.includes(target)) throw new Error(`platform: Login kind must be ${PLATFORM_LOGIN_KINDS.join(", ")}.`);
|
|
1230
|
-
} else if (action === "protection") {
|
|
1231
|
-
if (![
|
|
1232
|
-
"enable",
|
|
1233
|
-
"disable",
|
|
1234
|
-
"show"
|
|
1235
|
-
].includes(target)) throw new Error("platform: Usage: void platform config auth protection <enable|disable|show>.");
|
|
1236
|
-
} else if (target) parsePlatformLoginId(target);
|
|
1237
|
-
if (flags.has("plan") && flags.has("yes")) throw new Error("platform: --plan and --yes cannot be combined.");
|
|
1238
|
-
if ((!action || action === "list" || action === "show") && (flags.has("plan") || flags.has("yes"))) throw new Error("platform: Select a configuration change before using --plan or --yes.");
|
|
1239
|
-
if (values.has("id") && action !== "add") throw new Error("platform: --id is only valid when adding a login method.");
|
|
1240
|
-
if (values.has("installation") && action !== "recover" && action !== "protection") throw new Error("platform: --installation is only valid for recovery or platform protection.");
|
|
1241
|
-
if (values.has("file") && ![
|
|
1242
|
-
"add",
|
|
1243
|
-
"configure",
|
|
1244
|
-
"admission",
|
|
1245
|
-
"recover",
|
|
1246
|
-
"protection"
|
|
1247
|
-
].includes(action) || values.has("client-secret-env") && ![
|
|
1248
|
-
"add",
|
|
1249
|
-
"configure",
|
|
1250
|
-
"recover"
|
|
1251
|
-
].includes(action)) throw new Error("platform: --file is valid for add, configure, admission, recover, or protection; --client-secret-env is valid for add, configure, or recover.");
|
|
1252
|
-
if (values.has("test-id") && action !== "enable" && action !== "link") throw new Error("platform: --test-id is only valid for enable or link.");
|
|
1253
|
-
const secretEnv = values.get("client-secret-env") ?? "";
|
|
1254
|
-
if (secretEnv && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(secretEnv)) throw new Error("platform: --client-secret-env requires an environment-variable name.");
|
|
1255
|
-
if (values.has("id")) parsePlatformLoginId(values.get("id"));
|
|
1256
|
-
return {
|
|
1257
|
-
subcommand: "config",
|
|
1258
|
-
action,
|
|
1259
|
-
target,
|
|
1260
|
-
connection: values.get("connection") ?? "",
|
|
1261
|
-
installation: values.get("installation") ?? "",
|
|
1262
|
-
id: values.get("id") ?? "",
|
|
1263
|
-
file: values.get("file") ?? "",
|
|
1264
|
-
clientSecretEnv: secretEnv,
|
|
1265
|
-
testId: values.get("test-id") ?? "",
|
|
1266
|
-
json: flags.has("json"),
|
|
1267
|
-
plan: flags.has("plan"),
|
|
1268
|
-
yes: flags.has("yes")
|
|
1269
|
-
};
|
|
1270
|
-
}
|
|
1271
|
-
//#endregion
|
|
1272
|
-
//#region src/cli/platform-args.ts
|
|
1273
|
-
const platformSubcommands = [
|
|
1274
|
-
{
|
|
1275
|
-
name: "config",
|
|
1276
|
-
hint: "Configure authentication",
|
|
1277
|
-
description: "Configure login methods, company protection, or provider recovery"
|
|
1278
|
-
},
|
|
1279
|
-
...operatorGroups.map((name) => ({
|
|
1280
|
-
name,
|
|
1281
|
-
hint: name === "email" ? "Domains, policy, limits, outcomes, and recovery" : name === "zero-trust" ? "Configure Access protection and project overrides" : "Operator commands",
|
|
1282
|
-
description: `Administer platform ${name}`
|
|
1283
|
-
})),
|
|
1284
|
-
{
|
|
1285
|
-
name: "list",
|
|
1286
|
-
description: "List installed and connected platforms"
|
|
1287
|
-
},
|
|
1288
|
-
{
|
|
1289
|
-
name: "use",
|
|
1290
|
-
arg: "[id]",
|
|
1291
|
-
description: "Select the default Void platform"
|
|
1292
|
-
},
|
|
1293
|
-
{
|
|
1294
|
-
name: "status",
|
|
1295
|
-
arg: "[id]",
|
|
1296
|
-
description: "Inspect a platform and its health"
|
|
1297
|
-
},
|
|
1298
|
-
{
|
|
1299
|
-
name: "discover",
|
|
1300
|
-
description: "Recover installations from a Cloudflare account"
|
|
1301
|
-
},
|
|
1302
|
-
{
|
|
1303
|
-
name: "domain",
|
|
1304
|
-
hint: "Set an application domain",
|
|
1305
|
-
description: "Add a domain to a workers.dev test platform"
|
|
1306
|
-
},
|
|
1307
|
-
{
|
|
1308
|
-
name: "install",
|
|
1309
|
-
description: "Install a Void platform with a domain or workers.dev for testing"
|
|
1310
|
-
},
|
|
1311
|
-
{
|
|
1312
|
-
name: "upgrade",
|
|
1313
|
-
arg: "[id]",
|
|
1314
|
-
description: "Upgrade an installed Void platform"
|
|
1315
|
-
},
|
|
1316
|
-
{
|
|
1317
|
-
name: "rollback",
|
|
1318
|
-
arg: "[id]",
|
|
1319
|
-
description: "Restore a compatible earlier platform runtime"
|
|
1320
|
-
},
|
|
1321
|
-
{
|
|
1322
|
-
name: "repair",
|
|
1323
|
-
arg: "[id]",
|
|
1324
|
-
description: "Reconcile an installed Void platform"
|
|
1325
|
-
},
|
|
1326
|
-
{
|
|
1327
|
-
name: "disable",
|
|
1328
|
-
arg: "[id]",
|
|
1329
|
-
description: "Disable traffic without deleting data"
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
name: "enable",
|
|
1333
|
-
arg: "[id]",
|
|
1334
|
-
description: "Restore traffic for a disabled platform"
|
|
1335
|
-
},
|
|
1336
|
-
{
|
|
1337
|
-
name: "uninstall",
|
|
1338
|
-
arg: "[id]",
|
|
1339
|
-
description: "Safely remove an installed Void platform"
|
|
1340
|
-
}
|
|
1341
|
-
];
|
|
1342
|
-
function readValue(rest, index, flag) {
|
|
1343
|
-
const value = rest[index + 1];
|
|
1344
|
-
if (!value || value.startsWith("-")) throw new Error(`platform: ${flag} requires a value.`);
|
|
1345
|
-
return [value, index + 1];
|
|
1346
|
-
}
|
|
1347
|
-
function parseSelector(rest, subcommand, options = {}) {
|
|
1348
|
-
let selector = "";
|
|
1349
|
-
let plan = false;
|
|
1350
|
-
let yes = false;
|
|
1351
|
-
for (const arg of rest) if (arg === "--plan") plan = true;
|
|
1352
|
-
else if (arg === "--yes" && options.allowYes) yes = true;
|
|
1353
|
-
else if (arg.startsWith("-")) throw new Error(`platform: Unknown flag '${arg}'.`);
|
|
1354
|
-
else if (selector) throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
1355
|
-
else selector = arg;
|
|
1356
|
-
if ((subcommand === "use" || subcommand === "status") && plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
1357
|
-
return {
|
|
1358
|
-
selector,
|
|
1359
|
-
plan,
|
|
1360
|
-
yes
|
|
1361
|
-
};
|
|
1362
|
-
}
|
|
1363
|
-
function parseLifecycleSelector(rest, subcommand) {
|
|
1364
|
-
const positional = [];
|
|
1365
|
-
let runtime = "";
|
|
1366
|
-
let fromRuntime = "";
|
|
1367
|
-
for (let index = 0; index < rest.length; index++) {
|
|
1368
|
-
const arg = rest[index];
|
|
1369
|
-
if (arg === "--runtime") {
|
|
1370
|
-
if (subcommand === "disable") throw new Error("platform: Unknown flag '--runtime'.");
|
|
1371
|
-
const [value, next] = readValue(rest, index, arg);
|
|
1372
|
-
runtime = value;
|
|
1373
|
-
index = next;
|
|
1374
|
-
} else if (arg === "--from-runtime" && subcommand === "rollback") {
|
|
1375
|
-
const [value, next] = readValue(rest, index, arg);
|
|
1376
|
-
fromRuntime = value;
|
|
1377
|
-
index = next;
|
|
1378
|
-
} else positional.push(arg);
|
|
1379
|
-
}
|
|
1380
|
-
const parsed = parseSelector(positional, subcommand, { allowYes: true });
|
|
1381
|
-
if (subcommand === "rollback" && !runtime) throw new Error("platform: rollback requires --runtime <earlier-runtime-directory>.");
|
|
1382
|
-
return {
|
|
1383
|
-
...parsed,
|
|
1384
|
-
runtime,
|
|
1385
|
-
fromRuntime
|
|
1386
|
-
};
|
|
1387
|
-
}
|
|
1388
|
-
function parsePlatformArgs(args) {
|
|
1389
|
-
if (operatorGroups.includes(args[0] ?? "") || [
|
|
1390
|
-
"--connection",
|
|
1391
|
-
"--json",
|
|
1392
|
-
"--plan",
|
|
1393
|
-
"--yes",
|
|
1394
|
-
"--timeout"
|
|
1395
|
-
].includes(args[0] ?? "")) return parseOperatorArgs(args);
|
|
1396
|
-
const [subcommand, ...rest] = args;
|
|
1397
|
-
if (subcommand === "config") return parsePlatformConfigArgs(rest);
|
|
1398
|
-
if (subcommand === "domain") {
|
|
1399
|
-
if (rest.length === 0) return {
|
|
1400
|
-
subcommand,
|
|
1401
|
-
domain: "",
|
|
1402
|
-
selector: "",
|
|
1403
|
-
zone: "",
|
|
1404
|
-
dedicatedZone: false,
|
|
1405
|
-
plan: false,
|
|
1406
|
-
yes: false
|
|
1407
|
-
};
|
|
1408
|
-
if (rest[0] !== "set") throw new Error("platform: Usage: void platform domain set <domain> [--installation <id>] [--zone <domain>] [--dedicated-zone] [--plan] [--yes].");
|
|
1409
|
-
let domain = "";
|
|
1410
|
-
let selector = "";
|
|
1411
|
-
let zone = "";
|
|
1412
|
-
let plan = false;
|
|
1413
|
-
let yes = false;
|
|
1414
|
-
let dedicatedZone = false;
|
|
1415
|
-
for (let index = 1; index < rest.length; index++) {
|
|
1416
|
-
const arg = rest[index];
|
|
1417
|
-
if (arg === "--installation" || arg === "--zone") {
|
|
1418
|
-
const [value, next] = readValue(rest, index, arg);
|
|
1419
|
-
index = next;
|
|
1420
|
-
if (arg === "--zone") zone = value;
|
|
1421
|
-
else selector = value;
|
|
1422
|
-
} else if (arg === "--plan") plan = true;
|
|
1423
|
-
else if (arg === "--yes") yes = true;
|
|
1424
|
-
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
1425
|
-
else if (!arg.startsWith("-") && !domain) domain = arg;
|
|
1426
|
-
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
1427
|
-
}
|
|
1428
|
-
if (!domain) throw new Error("platform: domain set requires an application domain.");
|
|
1429
|
-
if (plan && yes) throw new Error("platform: Use either --plan or --yes.");
|
|
1430
|
-
return {
|
|
1431
|
-
subcommand,
|
|
1432
|
-
domain,
|
|
1433
|
-
selector,
|
|
1434
|
-
zone,
|
|
1435
|
-
dedicatedZone,
|
|
1436
|
-
plan,
|
|
1437
|
-
yes
|
|
1438
|
-
};
|
|
1439
|
-
}
|
|
1440
|
-
if (subcommand === "list") {
|
|
1441
|
-
if (rest.length > 0) throw new Error(`platform: Unexpected argument '${rest[0]}'.`);
|
|
1442
|
-
return { subcommand };
|
|
1443
|
-
}
|
|
1444
|
-
if (subcommand === "use") {
|
|
1445
|
-
const { selector } = parseSelector(rest, subcommand);
|
|
1446
|
-
return {
|
|
1447
|
-
subcommand,
|
|
1448
|
-
selector
|
|
1449
|
-
};
|
|
1450
|
-
}
|
|
1451
|
-
if (subcommand === "status") {
|
|
1452
|
-
const { selector, plan } = parseSelector(rest, subcommand);
|
|
1453
|
-
if (plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
1454
|
-
return {
|
|
1455
|
-
subcommand,
|
|
1456
|
-
selector
|
|
1457
|
-
};
|
|
1458
|
-
}
|
|
1459
|
-
if (subcommand === "discover") {
|
|
1460
|
-
let account = "";
|
|
1461
|
-
let selector = "";
|
|
1462
|
-
for (let index = 0; index < rest.length; index++) {
|
|
1463
|
-
const arg = rest[index];
|
|
1464
|
-
if (arg === "--account" || arg === "--installation") {
|
|
1465
|
-
const [value, next] = readValue(rest, index, arg);
|
|
1466
|
-
if (arg === "--account") account = value;
|
|
1467
|
-
else selector = value;
|
|
1468
|
-
index = next;
|
|
1469
|
-
} else throw new Error("platform: Usage: void platform discover [--account <id>] [--installation <id-or-name>].");
|
|
1470
|
-
}
|
|
1471
|
-
return {
|
|
1472
|
-
subcommand,
|
|
1473
|
-
account,
|
|
1474
|
-
selector
|
|
1475
|
-
};
|
|
1476
|
-
}
|
|
1477
|
-
if (subcommand === "upgrade" || subcommand === "rollback" || subcommand === "repair" || subcommand === "disable" || subcommand === "enable") {
|
|
1478
|
-
const { selector, plan, runtime, fromRuntime, yes } = parseLifecycleSelector(rest, subcommand);
|
|
1479
|
-
return subcommand === "rollback" ? {
|
|
1480
|
-
subcommand,
|
|
1481
|
-
selector,
|
|
1482
|
-
plan,
|
|
1483
|
-
runtime,
|
|
1484
|
-
fromRuntime,
|
|
1485
|
-
yes
|
|
1486
|
-
} : {
|
|
1487
|
-
subcommand,
|
|
1488
|
-
selector,
|
|
1489
|
-
plan,
|
|
1490
|
-
runtime,
|
|
1491
|
-
yes
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
if (subcommand === "uninstall") {
|
|
1495
|
-
const parsed = parseSelector(rest.filter((arg) => ![
|
|
1496
|
-
"--purge-data",
|
|
1497
|
-
"--delete-zone",
|
|
1498
|
-
"--keep-zone"
|
|
1499
|
-
].includes(arg)), subcommand, { allowYes: true });
|
|
1500
|
-
if (rest.includes("--delete-zone") && rest.includes("--keep-zone")) throw new Error("platform: --delete-zone and --keep-zone cannot be used together.");
|
|
1501
|
-
return {
|
|
1502
|
-
subcommand,
|
|
1503
|
-
selector: parsed.selector,
|
|
1504
|
-
plan: parsed.plan,
|
|
1505
|
-
purgeData: rest.includes("--purge-data"),
|
|
1506
|
-
yes: parsed.yes,
|
|
1507
|
-
deleteZone: rest.includes("--delete-zone") ? true : rest.includes("--keep-zone") ? false : null
|
|
1508
|
-
};
|
|
1509
|
-
}
|
|
1510
|
-
if (subcommand === "install") {
|
|
1511
|
-
const values = /* @__PURE__ */ new Map();
|
|
1512
|
-
let plan = false;
|
|
1513
|
-
let resume = false;
|
|
1514
|
-
let dedicatedZone = false;
|
|
1515
|
-
let yes = false;
|
|
1516
|
-
const valueFlags = /* @__PURE__ */ new Set([
|
|
1517
|
-
"--account",
|
|
1518
|
-
"--auth-config",
|
|
1519
|
-
"--application-domain",
|
|
1520
|
-
"--control-plane-domain",
|
|
1521
|
-
"--display-name",
|
|
1522
|
-
"--name",
|
|
1523
|
-
"--runtime",
|
|
1524
|
-
"--zone"
|
|
1525
|
-
]);
|
|
1526
|
-
let workersDev = false;
|
|
1527
|
-
for (let i = 0; i < rest.length; i++) {
|
|
1528
|
-
const arg = rest[i];
|
|
1529
|
-
if (valueFlags.has(arg)) {
|
|
1530
|
-
const [value, next] = readValue(rest, i, arg);
|
|
1531
|
-
values.set(arg, value);
|
|
1532
|
-
i = next;
|
|
1533
|
-
} else if (arg === "--plan") plan = true;
|
|
1534
|
-
else if (arg === "--resume") resume = true;
|
|
1535
|
-
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
1536
|
-
else if (arg === "--yes") yes = true;
|
|
1537
|
-
else if (arg === "--workers-dev") workersDev = true;
|
|
1538
|
-
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
1539
|
-
}
|
|
1540
|
-
if (workersDev && (values.has("--application-domain") || values.has("--zone") || dedicatedZone)) throw new Error("platform: --workers-dev cannot be combined with a domain, zone, or --dedicated-zone.");
|
|
1541
|
-
return {
|
|
1542
|
-
subcommand,
|
|
1543
|
-
...workersDev ? { workersDev: true } : {},
|
|
1544
|
-
...values.has("--auth-config") ? { authConfig: values.get("--auth-config") } : {},
|
|
1545
|
-
account: values.get("--account") ?? "",
|
|
1546
|
-
applicationDomain: values.get("--application-domain") ?? "",
|
|
1547
|
-
controlPlaneDomain: values.get("--control-plane-domain") ?? "",
|
|
1548
|
-
dedicatedZone,
|
|
1549
|
-
displayName: values.get("--display-name") ?? "",
|
|
1550
|
-
name: values.get("--name") ?? "",
|
|
1551
|
-
plan,
|
|
1552
|
-
resume,
|
|
1553
|
-
runtime: values.get("--runtime") ?? "",
|
|
1554
|
-
yes,
|
|
1555
|
-
zone: values.get("--zone") ?? ""
|
|
1556
|
-
};
|
|
1557
|
-
}
|
|
1558
|
-
throw new Error("platform: Usage: void platform <config|auth|user|project|deployment|build|signup|invitation|email|system|worker|list|use|status|discover|install|domain|upgrade|rollback|repair|disable|enable|uninstall>.");
|
|
1152
|
+
//#region src/cli/info-args.ts
|
|
1153
|
+
function parseInfoArgs(args) {
|
|
1154
|
+
const parsed = parseArgs({
|
|
1155
|
+
args,
|
|
1156
|
+
options: { json: { type: "boolean" } },
|
|
1157
|
+
allowPositionals: true,
|
|
1158
|
+
strict: true
|
|
1159
|
+
});
|
|
1160
|
+
if (parsed.positionals.length > 0) throw new Error(`info: Unexpected argument '${parsed.positionals[0]}'.`);
|
|
1161
|
+
return { json: parsed.values.json ?? false };
|
|
1559
1162
|
}
|
|
1560
1163
|
//#endregion
|
|
1561
1164
|
//#region src/cli/prepare-args.ts
|
|
@@ -2049,7 +1652,7 @@ if (helpPath) {
|
|
|
2049
1652
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2050
1653
|
process.exit(1);
|
|
2051
1654
|
}
|
|
2052
|
-
import("../deploy-
|
|
1655
|
+
import("../deploy-bjXdFCtn.mjs").then(({ runDeploy }) => {
|
|
2053
1656
|
runDeploy(root, {
|
|
2054
1657
|
projectSlug: deployArgs.projectSlug,
|
|
2055
1658
|
dir: deployArgs.dir,
|
|
@@ -2057,7 +1660,6 @@ if (helpPath) {
|
|
|
2057
1660
|
skipBuild: deployArgs.skipBuild,
|
|
2058
1661
|
debug: deployArgs.debug,
|
|
2059
1662
|
platform: deployArgs.platform,
|
|
2060
|
-
backend: deployArgs.backend,
|
|
2061
1663
|
provision: deployArgs.provision,
|
|
2062
1664
|
requireEmail: deployArgs.requireEmail,
|
|
2063
1665
|
atomic: deployArgs.atomic
|
|
@@ -2068,25 +1670,38 @@ if (helpPath) {
|
|
|
2068
1670
|
});
|
|
2069
1671
|
} else if (command === "connect") (async () => {
|
|
2070
1672
|
const parsed = parseConnectArgs(args.slice(1));
|
|
2071
|
-
const { runConnectCommand } = await import("../connect-
|
|
1673
|
+
const { runConnectCommand } = await import("../connect-Bd4kJd9U.mjs");
|
|
2072
1674
|
await runConnectCommand(process.cwd(), parsed);
|
|
2073
1675
|
})().catch((err) => {
|
|
2074
1676
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2075
1677
|
process.exit(1);
|
|
2076
1678
|
});
|
|
2077
|
-
else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-
|
|
2078
|
-
else if (command === "account") runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-
|
|
2079
|
-
else if (command === "platform") runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-
|
|
2080
|
-
else if (command === "cloudflare") runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-
|
|
2081
|
-
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-
|
|
2082
|
-
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-
|
|
2083
|
-
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-
|
|
2084
|
-
else if (command === "email") runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-
|
|
2085
|
-
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-
|
|
2086
|
-
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-
|
|
2087
|
-
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-
|
|
2088
|
-
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-
|
|
2089
|
-
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-
|
|
1679
|
+
else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-BsR981d4.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed)));
|
|
1680
|
+
else if (command === "account") runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-C84Ee8cO.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed)));
|
|
1681
|
+
else if (command === "platform") runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-Bt-1w6pY.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed)));
|
|
1682
|
+
else if (command === "cloudflare") runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-BcrVyTmJ.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed)));
|
|
1683
|
+
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-CNzrqvBv.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
|
|
1684
|
+
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-Dli5fP0B.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
|
|
1685
|
+
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-y5Tvydvo.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
|
|
1686
|
+
else if (command === "email") runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-B3umsW75.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed)));
|
|
1687
|
+
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-8uG64XLl.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
|
|
1688
|
+
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-BS6qYHDb.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
|
|
1689
|
+
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-BVaUUumi.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
|
|
1690
|
+
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-v45BdfKX.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
|
|
1691
|
+
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-LzvNJORH.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
|
|
1692
|
+
else if (command === "info") import("../info-B97bTX9N.mjs").then(async ({ runInfoCommand }) => {
|
|
1693
|
+
try {
|
|
1694
|
+
await runInfoCommand(process.cwd(), parseInfoArgs(args.slice(1)));
|
|
1695
|
+
} catch (err) {
|
|
1696
|
+
const message = formatCloudflareUserMessage(err instanceof Error ? err.message : String(err));
|
|
1697
|
+
if (args.includes("--json")) console.error(JSON.stringify({
|
|
1698
|
+
error: "invalid_command",
|
|
1699
|
+
message
|
|
1700
|
+
}));
|
|
1701
|
+
else log.error(message);
|
|
1702
|
+
process.exit(1);
|
|
1703
|
+
}
|
|
1704
|
+
});
|
|
2090
1705
|
else if (command === "prepare") {
|
|
2091
1706
|
const root = process.cwd();
|
|
2092
1707
|
let prepareArgs;
|
|
@@ -2096,7 +1711,7 @@ else if (command === "prepare") {
|
|
|
2096
1711
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2097
1712
|
process.exit(1);
|
|
2098
1713
|
}
|
|
2099
|
-
import("../prepare-
|
|
1714
|
+
import("../prepare-B5Mkic5u.mjs").then(({ runPrepareCommand }) => {
|
|
2100
1715
|
runPrepareCommand(root, prepareArgs).catch((err) => {
|
|
2101
1716
|
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
2102
1717
|
process.exit(1);
|
|
@@ -2104,7 +1719,7 @@ else if (command === "prepare") {
|
|
|
2104
1719
|
});
|
|
2105
1720
|
} else if (command === "init") {
|
|
2106
1721
|
const root = process.cwd();
|
|
2107
|
-
import("../init-
|
|
1722
|
+
import("../init-Bvy7zrBo.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
2108
1723
|
let initArgs;
|
|
2109
1724
|
try {
|
|
2110
1725
|
initArgs = parseInitArgs(args.slice(1));
|
|
@@ -2122,7 +1737,7 @@ else if (command === "prepare") {
|
|
|
2122
1737
|
log.error("migrate: This command takes no arguments.");
|
|
2123
1738
|
process.exit(1);
|
|
2124
1739
|
}
|
|
2125
|
-
import("../migrate-
|
|
1740
|
+
import("../migrate-8_2u55MD.mjs").then(({ runMigrateCommand }) => {
|
|
2126
1741
|
runMigrateCommand(process.cwd()).catch((err) => {
|
|
2127
1742
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
2128
1743
|
process.exit(1);
|
|
@@ -2145,6 +1760,11 @@ else if (command === "prepare") {
|
|
|
2145
1760
|
name: "migrate",
|
|
2146
1761
|
description: "Migrate legacy project configuration"
|
|
2147
1762
|
},
|
|
1763
|
+
{
|
|
1764
|
+
name: "info",
|
|
1765
|
+
hint: "--json",
|
|
1766
|
+
description: "Inspect persistent resource names in this project"
|
|
1767
|
+
},
|
|
2148
1768
|
{
|
|
2149
1769
|
name: "connect",
|
|
2150
1770
|
description: "Connect to Cloudflare or a Void platform"
|
|
@@ -2165,8 +1785,8 @@ else if (command === "prepare") {
|
|
|
2165
1785
|
},
|
|
2166
1786
|
{
|
|
2167
1787
|
name: "platform",
|
|
2168
|
-
hint: "auth | user | project | deployment | signup | email | zero-trust | system | install",
|
|
2169
|
-
description: "Install platforms and administer users, projects, access, and operations"
|
|
1788
|
+
hint: "config | auth | user | project | deployment | signup | email | zero-trust | system | install",
|
|
1789
|
+
description: "Install platforms and administer plans, users, projects, access, and operations"
|
|
2170
1790
|
},
|
|
2171
1791
|
{
|
|
2172
1792
|
name: "cloudflare",
|
|
@@ -2236,40 +1856,45 @@ else if (command === "prepare") {
|
|
|
2236
1856
|
const root = process.cwd();
|
|
2237
1857
|
switch (cmd) {
|
|
2238
1858
|
case "connect": {
|
|
2239
|
-
const { runConnectCommand } = await import("../connect-
|
|
1859
|
+
const { runConnectCommand } = await import("../connect-Bd4kJd9U.mjs");
|
|
2240
1860
|
await runConnectCommand(root, parseConnectArgs([]));
|
|
2241
1861
|
return;
|
|
2242
1862
|
}
|
|
2243
1863
|
case "init": {
|
|
2244
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
1864
|
+
const { runInitCommand, parseInitArgs } = await import("../init-Bvy7zrBo.mjs");
|
|
2245
1865
|
await runInitCommand(root, parseInitArgs([]));
|
|
2246
1866
|
return;
|
|
2247
1867
|
}
|
|
2248
1868
|
case "migrate": {
|
|
2249
|
-
const { runMigrateCommand } = await import("../migrate-
|
|
1869
|
+
const { runMigrateCommand } = await import("../migrate-8_2u55MD.mjs");
|
|
2250
1870
|
await runMigrateCommand(root);
|
|
2251
1871
|
return;
|
|
2252
1872
|
}
|
|
2253
1873
|
case "deploy": {
|
|
2254
|
-
const { runDeploy } = await import("../deploy-
|
|
1874
|
+
const { runDeploy } = await import("../deploy-bjXdFCtn.mjs");
|
|
2255
1875
|
await runDeploy(root);
|
|
2256
1876
|
return;
|
|
2257
1877
|
}
|
|
2258
|
-
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-router-
|
|
2259
|
-
case "account": return runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (r, p) => import("../account-cmd-
|
|
2260
|
-
case "platform": return runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (r, p) => import("../platform-cmd-
|
|
2261
|
-
case "cloudflare": return runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (r, p) => import("../cloudflare-cmd-
|
|
2262
|
-
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-
|
|
2263
|
-
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-
|
|
2264
|
-
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-
|
|
2265
|
-
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-
|
|
2266
|
-
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-
|
|
2267
|
-
case "email": return runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (r, p) => import("../email-
|
|
2268
|
-
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-
|
|
2269
|
-
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-
|
|
2270
|
-
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-
|
|
1878
|
+
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-router-BsR981d4.mjs").then(({ runAuthRouter }) => runAuthRouter(r, p)));
|
|
1879
|
+
case "account": return runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (r, p) => import("../account-cmd-C84Ee8cO.mjs").then(({ runAccountCommand }) => runAccountCommand(r, p)));
|
|
1880
|
+
case "platform": return runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (r, p) => import("../platform-cmd-Bt-1w6pY.mjs").then(({ runPlatformCommand }) => runPlatformCommand(r, p)));
|
|
1881
|
+
case "cloudflare": return runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (r, p) => import("../cloudflare-cmd-BcrVyTmJ.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(r, p)));
|
|
1882
|
+
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-CNzrqvBv.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
|
|
1883
|
+
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-Dli5fP0B.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
|
|
1884
|
+
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-y5Tvydvo.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
|
|
1885
|
+
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-v45BdfKX.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
|
|
1886
|
+
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-LzvNJORH.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
|
|
1887
|
+
case "email": return runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (r, p) => import("../email-B3umsW75.mjs").then(({ runEmailCommand }) => runEmailCommand(r, p)));
|
|
1888
|
+
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-8uG64XLl.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
|
|
1889
|
+
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-BS6qYHDb.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
1890
|
+
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-BVaUUumi.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
1891
|
+
case "info": {
|
|
1892
|
+
const { runInfoCommand } = await import("../info-B97bTX9N.mjs");
|
|
1893
|
+
await runInfoCommand(root, parseInfoArgs([]));
|
|
1894
|
+
return;
|
|
1895
|
+
}
|
|
2271
1896
|
case "prepare": {
|
|
2272
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
1897
|
+
const { runPrepareCommand } = await import("../prepare-B5Mkic5u.mjs");
|
|
2273
1898
|
await runPrepareCommand(root, parsePrepareArgs([]));
|
|
2274
1899
|
return;
|
|
2275
1900
|
}
|