void 0.22.0 → 0.24.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/AGENTS_TEMPLATE.md +1 -1
- package/README.md +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-vJhh5lrb.mjs} +5 -5
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-DLNN0D3Z.mjs → auth-CQkSDS50.mjs} +26 -96
- package/dist/auth-DX3JURcX.mjs +2 -0
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-D75t9wO2.mjs} +5 -5
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-ClfhL1J7.mjs} +7 -7
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-zMi1iFnS.mjs} +21 -9
- package/dist/{cache-D0sWhgKI.mjs → cache-ZtQmyxVV.mjs} +5 -5
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-Box0kkEV.mjs} +5 -5
- package/dist/{cf-access-P0iZnu0q.mjs → cf-access-BGe5sWXF.mjs} +4 -48
- package/dist/{cf-access-DRsQRe6k.mjs → cf-access-TWNzXltp.mjs} +3 -11
- 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 +89 -461
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +454 -424
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +4 -4
- package/dist/client-B9UBI03V.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-DKAsFA4X.mjs} +161 -24
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-CmY8dGkd.mjs} +6 -6
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-IiR3ZieC.mjs} +4 -4
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-BCdXSsmo.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-DzH-A966.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-B-usTnlF.mjs} +9 -9
- package/dist/{create-project-l9J7pbtm.mjs → create-project-CYOOAYcn.mjs} +12 -12
- package/dist/{create-project-DdoqwFLF.mjs → create-project-FWbf5Olo.mjs} +1 -1
- package/dist/{db-gp2sCXyN.mjs → db-Ck2eZ2iB.mjs} +26 -26
- package/dist/{delete-TTedbH6B.mjs → delete-sK56qtzZ.mjs} +5 -5
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-gCVaiJbS.mjs} +984 -616
- package/dist/{deploy-B19L2Bra.mjs → deploy-irP5q0-x.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-DFfQE8jg.mjs} +6 -6
- package/dist/{email-Bo6G9LOZ.mjs → email-CdnhUHvJ.mjs} +15 -30
- package/dist/{env-BYOrWQnv.mjs → env-DmGdHi5i.mjs} +8 -8
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-types-C2_bIk_b.mjs → env-types-D5kds_OZ.mjs} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-C_8tPdhs.mjs} +20 -73
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-zZOCcQVZ.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-CshAkukR.mjs} +4 -4
- package/dist/gen-DvQTWzDU.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-DftuEvIt.mjs} +13 -13
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/{headers-DWi2IXWx.mjs → headers-2rKda9Y6.mjs} +1 -1
- package/dist/{help-GKtwl07I.mjs → help-Dotbf6iz.mjs} +236 -750
- package/dist/help-mabuIV98.mjs +2 -0
- package/dist/{inbound-aVHEUhKo.mjs → inbound-fRkqcXaC.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +299 -1517
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-BTQEZZGJ.mjs} +61 -27
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-B46sYH0K.mjs} +6 -6
- package/dist/{list-D44jmIAM.mjs → list-BnPrIsU_.mjs} +6 -6
- 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/log-vqY3pqwI.mjs +29 -0
- package/dist/{login-CAsAsQ-_.mjs → login-BuiMyUrx.mjs} +8 -8
- package/dist/login-DIy9Sb-U.mjs +2 -0
- package/dist/{logs-BjKvFnVM.mjs → logs-CZG9d-ic.mjs} +10 -11
- package/dist/migrate-BCiJ8w0f.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-q4_njtaW.mjs} +4 -3
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-B3BTmSoi.mjs +697 -0
- package/dist/{operator-auth-8KnOVXVd.mjs → operator-auth-7erYc6Lt.mjs} +2 -2
- package/dist/{operator-client-DUwumHpQ.mjs → operator-client-CpHjTd0t.mjs} +3 -3
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DGqPJUD3.mjs} +70 -24
- package/dist/{output-Dm_A4Tbv.mjs → output-CbM85T4k.mjs} +18 -10
- 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 +2 -2
- 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-3k8X9-H_.mjs +514 -0
- package/dist/platform-args-DdnM6WIf.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-DDrxUy4m.mjs} +6 -6
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BLadnnct.mjs} +8 -8
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-CmCzX2Fl.mjs} +6 -6
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMDEc9uS.mjs} +29 -8
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-pMTRhvYs.mjs} +1 -1
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-Di6EYrQl.mjs} +5 -5
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-BBoNzojY.mjs} +1541 -572
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BFdSi9Qt.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CWOQOWXm.mjs} +10 -7
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-DG47jys8.mjs} +1 -1
- package/dist/platform-plans-config-Vl9BP3H4.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-BJnQJEtQ.mjs} +4 -4
- package/dist/{platform-registry-QBa4DK32.mjs → platform-registry-DkPPXfp_.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-CBLT3CHH.mjs} +3 -3
- package/dist/prepare-CnjcTV2s.mjs +2 -0
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DnaKBi--.mjs} +5 -21
- package/dist/{project-C0Fqu05O.mjs → project-DKG5Ra8p.mjs} +15 -82
- package/dist/project-DsblYifa.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-DxnXstAq.mjs} +19 -19
- package/dist/{project-team-BvgM0WoX.mjs → project-team-BmHcaALJ.mjs} +5 -5
- package/dist/{project-token-l5DqK6Az.mjs → project-token-GionZlBI.mjs} +5 -5
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-JLCjVQA7.mjs} +5 -5
- package/dist/prompts-2TGE6oXx.mjs +2 -0
- package/dist/prompts-BNUoTiaf.mjs +2044 -0
- 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-CVku1JFU.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CaoxO_U7.mjs} +90 -199
- package/dist/{requests-DN-BbNiM.mjs → requests-BOjIVAeF.mjs} +5 -5
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CwR3pLj3.mjs} +6 -6
- 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 +87 -22
- 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 +2 -2
- package/dist/runtime/email.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/remote/index.mjs +2 -2
- 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-ByWJWBUG.mjs} +7 -7
- package/dist/{skills-D1II1Juz.mjs → skills-C1PlclPt.mjs} +1 -1
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/{subcommand-prompt-CY1C4fvl.mjs → subcommand-prompt-klFCfcor.mjs} +40 -32
- 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 +16 -10
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +55 -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 +48 -112
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +4 -48
- 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 +116 -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 +49 -160
- 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/ci.md +1 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +15 -6
- package/skills/void/docs/guide/platform/installation/domains.md +35 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +4 -2
- package/skills/void/docs/guide/platform/installation/maintenance.md +15 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +24 -18
- package/skills/void/docs/guide/platform/installation/setup.md +88 -14
- 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 +5 -10
- 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 +89 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +105 -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 +142 -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 +59 -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/auth-CZuiVsFh.mjs +0 -2
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/dist-BuDuKZJv.mjs +0 -2
- package/dist/dist-CTBk70IR.mjs +0 -1310
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/log-ChfPKsVd.mjs +0 -26
- 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/project-BuUwfj6f.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import { n as operatorGroups, r as parseOperatorArgs } from "./operator-args-B3BTmSoi.mjs";
|
|
2
|
+
import { PLATFORM_LOGIN_KINDS, normalizePlatformDashboardUrl, parsePlatformLoginId } from "@void/platform";
|
|
3
|
+
import { parsePlatformPlanId } from "@void/platform/plans";
|
|
4
|
+
//#region src/cli/platform-config-args.ts
|
|
5
|
+
const PLATFORM_AUTH_ACTIONS = [
|
|
6
|
+
"list",
|
|
7
|
+
"show",
|
|
8
|
+
"initialize",
|
|
9
|
+
"add",
|
|
10
|
+
"configure",
|
|
11
|
+
"test",
|
|
12
|
+
"enable",
|
|
13
|
+
"disable",
|
|
14
|
+
"link",
|
|
15
|
+
"admission",
|
|
16
|
+
"protection",
|
|
17
|
+
"recover"
|
|
18
|
+
];
|
|
19
|
+
function parsePlatformConfigArgs(args) {
|
|
20
|
+
if (args.length && args[0] !== "auth") throw new Error("platform: Usage: void platform config auth [command] [options].");
|
|
21
|
+
const positional = [];
|
|
22
|
+
const flags = /* @__PURE__ */ new Set();
|
|
23
|
+
const values = /* @__PURE__ */ new Map();
|
|
24
|
+
const valueFlags = [
|
|
25
|
+
"connection",
|
|
26
|
+
"installation",
|
|
27
|
+
"id",
|
|
28
|
+
"file",
|
|
29
|
+
"client-secret-env",
|
|
30
|
+
"test-id"
|
|
31
|
+
];
|
|
32
|
+
for (let index = 1; index < args.length; index++) {
|
|
33
|
+
const arg = args[index];
|
|
34
|
+
if (!arg.startsWith("-")) {
|
|
35
|
+
positional.push(arg);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const name = arg.slice(2);
|
|
39
|
+
if (!arg.startsWith("--") || ![
|
|
40
|
+
"json",
|
|
41
|
+
"plan",
|
|
42
|
+
"yes"
|
|
43
|
+
].includes(name) && !valueFlags.includes(name)) throw new Error(`platform: Unknown config auth flag ${arg}.`);
|
|
44
|
+
if (flags.has(name) || values.has(name)) throw new Error(`platform: Duplicate flag ${arg}.`);
|
|
45
|
+
if (!valueFlags.includes(name)) {
|
|
46
|
+
flags.add(name);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const value = args[++index];
|
|
50
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${arg} requires a value.`);
|
|
51
|
+
values.set(name, value);
|
|
52
|
+
}
|
|
53
|
+
const [action = "", target = "", ...extra] = positional;
|
|
54
|
+
if (extra.length || action && !PLATFORM_AUTH_ACTIONS.includes(action)) throw new Error(`platform: Usage: void platform config auth <${PLATFORM_AUTH_ACTIONS.join("|")}>.`);
|
|
55
|
+
const needsTarget = action && action !== "list" && action !== "initialize" && action !== "admission";
|
|
56
|
+
if (needsTarget && !target || !needsTarget && target) throw new Error(`platform: ${action || "config auth"} ${needsTarget ? "requires a method" : "does not accept a method"}.`);
|
|
57
|
+
if (action === "add") {
|
|
58
|
+
if (!PLATFORM_LOGIN_KINDS.includes(target)) throw new Error(`platform: Login kind must be ${PLATFORM_LOGIN_KINDS.join(", ")}.`);
|
|
59
|
+
} else if (action === "protection") {
|
|
60
|
+
if (![
|
|
61
|
+
"enable",
|
|
62
|
+
"disable",
|
|
63
|
+
"show"
|
|
64
|
+
].includes(target)) throw new Error("platform: Usage: void platform config auth protection <enable|disable|show>.");
|
|
65
|
+
} else if (target) parsePlatformLoginId(target);
|
|
66
|
+
if (flags.has("plan") && flags.has("yes")) throw new Error("platform: --plan and --yes cannot be combined.");
|
|
67
|
+
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.");
|
|
68
|
+
if (values.has("id") && action !== "add") throw new Error("platform: --id is only valid when adding a login method.");
|
|
69
|
+
if (values.has("installation") && action !== "recover" && action !== "protection") throw new Error("platform: --installation is only valid for recovery or platform protection.");
|
|
70
|
+
if (values.has("file") && ![
|
|
71
|
+
"add",
|
|
72
|
+
"configure",
|
|
73
|
+
"admission",
|
|
74
|
+
"recover",
|
|
75
|
+
"protection"
|
|
76
|
+
].includes(action) || values.has("client-secret-env") && ![
|
|
77
|
+
"add",
|
|
78
|
+
"configure",
|
|
79
|
+
"recover"
|
|
80
|
+
].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.");
|
|
81
|
+
if (values.has("test-id") && action !== "enable" && action !== "link") throw new Error("platform: --test-id is only valid for enable or link.");
|
|
82
|
+
const secretEnv = values.get("client-secret-env") ?? "";
|
|
83
|
+
if (secretEnv && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(secretEnv)) throw new Error("platform: --client-secret-env requires an environment-variable name.");
|
|
84
|
+
if (values.has("id")) parsePlatformLoginId(values.get("id"));
|
|
85
|
+
return {
|
|
86
|
+
subcommand: "config",
|
|
87
|
+
action,
|
|
88
|
+
target,
|
|
89
|
+
connection: values.get("connection") ?? "",
|
|
90
|
+
installation: values.get("installation") ?? "",
|
|
91
|
+
id: values.get("id") ?? "",
|
|
92
|
+
file: values.get("file") ?? "",
|
|
93
|
+
clientSecretEnv: secretEnv,
|
|
94
|
+
testId: values.get("test-id") ?? "",
|
|
95
|
+
json: flags.has("json"),
|
|
96
|
+
plan: flags.has("plan"),
|
|
97
|
+
yes: flags.has("yes")
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/cli/platform-plans-args.ts
|
|
102
|
+
const PLATFORM_PLAN_ACTIONS = [
|
|
103
|
+
"show",
|
|
104
|
+
"add",
|
|
105
|
+
"set",
|
|
106
|
+
"reset",
|
|
107
|
+
"archive",
|
|
108
|
+
"restore",
|
|
109
|
+
"remove",
|
|
110
|
+
"default",
|
|
111
|
+
"sync"
|
|
112
|
+
];
|
|
113
|
+
function parsePlatformPlansArgs(args) {
|
|
114
|
+
const positional = [];
|
|
115
|
+
const flags = /* @__PURE__ */ new Set();
|
|
116
|
+
const values = /* @__PURE__ */ new Map();
|
|
117
|
+
const valueFlags = [
|
|
118
|
+
"connection",
|
|
119
|
+
"file",
|
|
120
|
+
"name",
|
|
121
|
+
"copy",
|
|
122
|
+
"replacement"
|
|
123
|
+
];
|
|
124
|
+
for (let index = 1; index < args.length; index++) {
|
|
125
|
+
const arg = args[index];
|
|
126
|
+
if (!arg.startsWith("-")) {
|
|
127
|
+
positional.push(arg);
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const name = arg.slice(2);
|
|
131
|
+
if (!arg.startsWith("--") || ![
|
|
132
|
+
"json",
|
|
133
|
+
"plan",
|
|
134
|
+
"yes"
|
|
135
|
+
].includes(name) && !valueFlags.includes(name)) throw new Error(`platform: Unknown config plans flag ${arg}.`);
|
|
136
|
+
if (flags.has(name) || values.has(name)) throw new Error(`platform: Duplicate flag ${arg}.`);
|
|
137
|
+
if (!valueFlags.includes(name)) {
|
|
138
|
+
flags.add(name);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const value = args[++index];
|
|
142
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${arg} requires a value.`);
|
|
143
|
+
values.set(name, value);
|
|
144
|
+
}
|
|
145
|
+
const [action = "", target = "", ...extra] = positional;
|
|
146
|
+
if (extra.length || action && !PLATFORM_PLAN_ACTIONS.includes(action)) throw new Error(`platform: Usage: void platform config plans [${PLATFORM_PLAN_ACTIONS.join("|")}] [plan-id] [options].`);
|
|
147
|
+
const needsTarget = action && action !== "show" && action !== "sync";
|
|
148
|
+
if (needsTarget && !target || (!action || action === "sync") && target) throw new Error(`platform: ${action || "config plans"} ${needsTarget ? "requires" : "does not accept"} a plan ID.`);
|
|
149
|
+
for (const id of [
|
|
150
|
+
target,
|
|
151
|
+
values.get("copy"),
|
|
152
|
+
values.get("replacement")
|
|
153
|
+
].filter(Boolean)) parsePlatformPlanId(id);
|
|
154
|
+
if (flags.has("plan") && flags.has("yes")) throw new Error("platform: --plan and --yes cannot be combined.");
|
|
155
|
+
if ((!action || action === "show") && (flags.has("plan") || flags.has("yes"))) throw new Error("platform: Select a configuration change before using --plan or --yes.");
|
|
156
|
+
for (const [name, actions] of [
|
|
157
|
+
["file", ["add", "set"]],
|
|
158
|
+
["name", ["add", "set"]],
|
|
159
|
+
["copy", ["add"]],
|
|
160
|
+
["replacement", ["remove"]]
|
|
161
|
+
]) if (values.has(name) && !actions.includes(action)) throw new Error(`platform: --${name} is only valid for ${actions.join(" or ")}.`);
|
|
162
|
+
return {
|
|
163
|
+
subcommand: "config",
|
|
164
|
+
configGroup: "plans",
|
|
165
|
+
action,
|
|
166
|
+
target,
|
|
167
|
+
connection: values.get("connection") ?? "",
|
|
168
|
+
file: values.get("file") ?? "",
|
|
169
|
+
name: values.get("name") ?? "",
|
|
170
|
+
copy: values.get("copy") ?? "",
|
|
171
|
+
replacement: values.get("replacement") ?? "",
|
|
172
|
+
json: flags.has("json"),
|
|
173
|
+
plan: flags.has("plan"),
|
|
174
|
+
yes: flags.has("yes")
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/cli/platform-args.ts
|
|
179
|
+
const platformSubcommands = [
|
|
180
|
+
{
|
|
181
|
+
name: "config",
|
|
182
|
+
hint: "Authentication, plans, and limits",
|
|
183
|
+
description: "Configure login methods, protection, plans, or limits"
|
|
184
|
+
},
|
|
185
|
+
...operatorGroups.map((name) => ({
|
|
186
|
+
name,
|
|
187
|
+
hint: name === "email" ? "Domains, shared recipients, policy, limits, and recovery" : name === "zero-trust" ? "Configure Access protection and project overrides" : name === "project" ? "Inspect, normalize, transfer, or remove projects" : "Operator commands",
|
|
188
|
+
description: `Administer platform ${name}`
|
|
189
|
+
})),
|
|
190
|
+
{
|
|
191
|
+
name: "list",
|
|
192
|
+
description: "List installed and connected platforms"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "use",
|
|
196
|
+
arg: "[id]",
|
|
197
|
+
description: "Select the default Void platform"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "status",
|
|
201
|
+
arg: "[id]",
|
|
202
|
+
description: "Inspect a platform and its health"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "discover",
|
|
206
|
+
description: "Recover installations from a Cloudflare account"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "domain",
|
|
210
|
+
hint: "Set an application domain",
|
|
211
|
+
description: "Add a domain to a workers.dev test platform"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: "install",
|
|
215
|
+
hint: "Preview and save choices with --plan, then select the saved plan to install",
|
|
216
|
+
description: "Install a Void platform and choose who can access its apps"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "upgrade",
|
|
220
|
+
arg: "[id]",
|
|
221
|
+
description: "Upgrade an installed Void platform"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "rollback",
|
|
225
|
+
arg: "[id]",
|
|
226
|
+
description: "Restore a compatible earlier platform runtime"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "repair",
|
|
230
|
+
arg: "[id]",
|
|
231
|
+
description: "Reconcile a platform or configure its dashboard origin"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "disable",
|
|
235
|
+
arg: "[id]",
|
|
236
|
+
description: "Disable traffic without deleting data"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "enable",
|
|
240
|
+
arg: "[id]",
|
|
241
|
+
description: "Restore traffic for a disabled platform"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "uninstall",
|
|
245
|
+
arg: "[id]",
|
|
246
|
+
description: "Safely remove an installed Void platform"
|
|
247
|
+
}
|
|
248
|
+
];
|
|
249
|
+
function readValue(rest, index, flag) {
|
|
250
|
+
const value = rest[index + 1];
|
|
251
|
+
if (!value || value.startsWith("-")) throw new Error(`platform: ${flag} requires a value.`);
|
|
252
|
+
return [value, index + 1];
|
|
253
|
+
}
|
|
254
|
+
function parseSelector(rest, subcommand, options = {}) {
|
|
255
|
+
let selector = "";
|
|
256
|
+
let plan = false;
|
|
257
|
+
let yes = false;
|
|
258
|
+
for (const arg of rest) if (arg === "--plan") plan = true;
|
|
259
|
+
else if (arg === "--yes" && options.allowYes) yes = true;
|
|
260
|
+
else if (arg.startsWith("-")) throw new Error(`platform: Unknown flag '${arg}'.`);
|
|
261
|
+
else if (selector) throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
262
|
+
else selector = arg;
|
|
263
|
+
if ((subcommand === "use" || subcommand === "status") && plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
264
|
+
return {
|
|
265
|
+
selector,
|
|
266
|
+
plan,
|
|
267
|
+
yes
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function parseLifecycleSelector(rest, subcommand) {
|
|
271
|
+
const positional = [];
|
|
272
|
+
let runtime = "";
|
|
273
|
+
let fromRuntime = "";
|
|
274
|
+
let dashboardUrl;
|
|
275
|
+
for (let index = 0; index < rest.length; index++) {
|
|
276
|
+
const arg = rest[index];
|
|
277
|
+
if (arg === "--runtime") {
|
|
278
|
+
if (subcommand === "disable") throw new Error("platform: Unknown flag '--runtime'.");
|
|
279
|
+
const [value, next] = readValue(rest, index, arg);
|
|
280
|
+
runtime = value;
|
|
281
|
+
index = next;
|
|
282
|
+
} else if (arg === "--dashboard-url" && (subcommand === "upgrade" || subcommand === "repair")) {
|
|
283
|
+
const [value, next] = readValue(rest, index, arg);
|
|
284
|
+
dashboardUrl = normalizePlatformDashboardUrl(value);
|
|
285
|
+
index = next;
|
|
286
|
+
} else if (arg === "--from-runtime" && subcommand === "rollback") {
|
|
287
|
+
const [value, next] = readValue(rest, index, arg);
|
|
288
|
+
fromRuntime = value;
|
|
289
|
+
index = next;
|
|
290
|
+
} else positional.push(arg);
|
|
291
|
+
}
|
|
292
|
+
const parsed = parseSelector(positional, subcommand, { allowYes: true });
|
|
293
|
+
if (subcommand === "rollback" && !runtime) throw new Error("platform: rollback requires --runtime <earlier-runtime-directory>.");
|
|
294
|
+
return {
|
|
295
|
+
...parsed,
|
|
296
|
+
runtime,
|
|
297
|
+
fromRuntime,
|
|
298
|
+
...dashboardUrl !== void 0 ? { dashboardUrl } : {}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function parsePlatformArgs(args) {
|
|
302
|
+
if (operatorGroups.includes(args[0] ?? "") || [
|
|
303
|
+
"--connection",
|
|
304
|
+
"--json",
|
|
305
|
+
"--plan",
|
|
306
|
+
"--yes",
|
|
307
|
+
"--timeout"
|
|
308
|
+
].includes(args[0] ?? "")) return parseOperatorArgs(args);
|
|
309
|
+
const [subcommand, ...rest] = args;
|
|
310
|
+
if (subcommand === "config") {
|
|
311
|
+
if (rest.length === 0) return {
|
|
312
|
+
subcommand: "config",
|
|
313
|
+
configGroup: "",
|
|
314
|
+
plan: false,
|
|
315
|
+
yes: false
|
|
316
|
+
};
|
|
317
|
+
return rest[0] === "plans" ? parsePlatformPlansArgs(rest) : parsePlatformConfigArgs(rest);
|
|
318
|
+
}
|
|
319
|
+
if (subcommand === "domain") {
|
|
320
|
+
if (rest.length === 0) return {
|
|
321
|
+
subcommand,
|
|
322
|
+
domain: "",
|
|
323
|
+
selector: "",
|
|
324
|
+
zone: "",
|
|
325
|
+
dedicatedZone: false,
|
|
326
|
+
plan: false,
|
|
327
|
+
yes: false
|
|
328
|
+
};
|
|
329
|
+
if (rest[0] !== "set") throw new Error("platform: Usage: void platform domain set <domain> [--installation <id>] [--zone <domain>] [--dedicated-zone] [--plan] [--yes].");
|
|
330
|
+
let domain = "";
|
|
331
|
+
let selector = "";
|
|
332
|
+
let zone = "";
|
|
333
|
+
let plan = false;
|
|
334
|
+
let yes = false;
|
|
335
|
+
let dedicatedZone = false;
|
|
336
|
+
for (let index = 1; index < rest.length; index++) {
|
|
337
|
+
const arg = rest[index];
|
|
338
|
+
if (arg === "--installation" || arg === "--zone") {
|
|
339
|
+
const [value, next] = readValue(rest, index, arg);
|
|
340
|
+
index = next;
|
|
341
|
+
if (arg === "--zone") zone = value;
|
|
342
|
+
else selector = value;
|
|
343
|
+
} else if (arg === "--plan") plan = true;
|
|
344
|
+
else if (arg === "--yes") yes = true;
|
|
345
|
+
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
346
|
+
else if (!arg.startsWith("-") && !domain) domain = arg;
|
|
347
|
+
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
348
|
+
}
|
|
349
|
+
if (!domain) throw new Error("platform: domain set requires an application domain.");
|
|
350
|
+
if (plan && yes) throw new Error("platform: Use either --plan or --yes.");
|
|
351
|
+
return {
|
|
352
|
+
subcommand,
|
|
353
|
+
domain,
|
|
354
|
+
selector,
|
|
355
|
+
zone,
|
|
356
|
+
dedicatedZone,
|
|
357
|
+
plan,
|
|
358
|
+
yes
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
if (subcommand === "list") {
|
|
362
|
+
if (rest.length > 0) throw new Error(`platform: Unexpected argument '${rest[0]}'.`);
|
|
363
|
+
return { subcommand };
|
|
364
|
+
}
|
|
365
|
+
if (subcommand === "use") {
|
|
366
|
+
const { selector } = parseSelector(rest, subcommand);
|
|
367
|
+
return {
|
|
368
|
+
subcommand,
|
|
369
|
+
selector
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
if (subcommand === "status") {
|
|
373
|
+
const { selector, plan } = parseSelector(rest, subcommand);
|
|
374
|
+
if (plan) throw new Error("platform: Unknown flag '--plan'.");
|
|
375
|
+
return {
|
|
376
|
+
subcommand,
|
|
377
|
+
selector
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
if (subcommand === "discover") {
|
|
381
|
+
let account = "";
|
|
382
|
+
let selector = "";
|
|
383
|
+
for (let index = 0; index < rest.length; index++) {
|
|
384
|
+
const arg = rest[index];
|
|
385
|
+
if (arg === "--account" || arg === "--installation") {
|
|
386
|
+
const [value, next] = readValue(rest, index, arg);
|
|
387
|
+
if (arg === "--account") account = value;
|
|
388
|
+
else selector = value;
|
|
389
|
+
index = next;
|
|
390
|
+
} else throw new Error("platform: Usage: void platform discover [--account <id>] [--installation <id-or-name>].");
|
|
391
|
+
}
|
|
392
|
+
return {
|
|
393
|
+
subcommand,
|
|
394
|
+
account,
|
|
395
|
+
selector
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
if (subcommand === "upgrade" || subcommand === "rollback" || subcommand === "repair" || subcommand === "disable" || subcommand === "enable") {
|
|
399
|
+
const { selector, plan, runtime, fromRuntime, yes, dashboardUrl } = parseLifecycleSelector(rest, subcommand);
|
|
400
|
+
return subcommand === "rollback" ? {
|
|
401
|
+
subcommand,
|
|
402
|
+
selector,
|
|
403
|
+
plan,
|
|
404
|
+
runtime,
|
|
405
|
+
fromRuntime,
|
|
406
|
+
yes
|
|
407
|
+
} : {
|
|
408
|
+
subcommand,
|
|
409
|
+
selector,
|
|
410
|
+
plan,
|
|
411
|
+
runtime,
|
|
412
|
+
yes,
|
|
413
|
+
...dashboardUrl !== void 0 ? { dashboardUrl } : {}
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
if (subcommand === "uninstall") {
|
|
417
|
+
const parsed = parseSelector(rest.filter((arg) => ![
|
|
418
|
+
"--purge-data",
|
|
419
|
+
"--delete-zone",
|
|
420
|
+
"--keep-zone"
|
|
421
|
+
].includes(arg)), subcommand, { allowYes: true });
|
|
422
|
+
if (rest.includes("--delete-zone") && rest.includes("--keep-zone")) throw new Error("platform: --delete-zone and --keep-zone cannot be used together.");
|
|
423
|
+
return {
|
|
424
|
+
subcommand,
|
|
425
|
+
selector: parsed.selector,
|
|
426
|
+
plan: parsed.plan,
|
|
427
|
+
purgeData: rest.includes("--purge-data"),
|
|
428
|
+
yes: parsed.yes,
|
|
429
|
+
deleteZone: rest.includes("--delete-zone") ? true : rest.includes("--keep-zone") ? false : null
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
if (subcommand === "install") {
|
|
433
|
+
const values = /* @__PURE__ */ new Map();
|
|
434
|
+
let plan = false;
|
|
435
|
+
let resume = false;
|
|
436
|
+
let dedicatedZone = false;
|
|
437
|
+
let yes = false;
|
|
438
|
+
let noControlPlaneDomain = false;
|
|
439
|
+
let noDedicatedZone = false;
|
|
440
|
+
let accessProtection;
|
|
441
|
+
const valueFlags = /* @__PURE__ */ new Set([
|
|
442
|
+
"--account",
|
|
443
|
+
"--auth-config",
|
|
444
|
+
"--login-methods",
|
|
445
|
+
"--app-access",
|
|
446
|
+
"--hyperdrive",
|
|
447
|
+
"--application-domain",
|
|
448
|
+
"--control-plane-domain",
|
|
449
|
+
"--dashboard-url",
|
|
450
|
+
"--display-name",
|
|
451
|
+
"--name",
|
|
452
|
+
"--runtime",
|
|
453
|
+
"--zone"
|
|
454
|
+
]);
|
|
455
|
+
let workersDev = false;
|
|
456
|
+
for (let i = 0; i < rest.length; i++) {
|
|
457
|
+
const arg = rest[i];
|
|
458
|
+
if (valueFlags.has(arg)) {
|
|
459
|
+
const [value, next] = readValue(rest, i, arg);
|
|
460
|
+
values.set(arg, value);
|
|
461
|
+
i = next;
|
|
462
|
+
} else if (arg === "--plan") plan = true;
|
|
463
|
+
else if (arg === "--resume") resume = true;
|
|
464
|
+
else if (arg === "--dedicated-zone") dedicatedZone = true;
|
|
465
|
+
else if (arg === "--no-dedicated-zone") noDedicatedZone = true;
|
|
466
|
+
else if (arg === "--no-control-plane-domain") noControlPlaneDomain = true;
|
|
467
|
+
else if (arg === "--access-protection" || arg === "--no-access-protection") {
|
|
468
|
+
const enabled = arg === "--access-protection";
|
|
469
|
+
if (accessProtection !== void 0 && accessProtection !== enabled) throw new Error("platform: Choose either --access-protection or --no-access-protection.");
|
|
470
|
+
accessProtection = enabled;
|
|
471
|
+
} else if (arg === "--yes") yes = true;
|
|
472
|
+
else if (arg === "--workers-dev") workersDev = true;
|
|
473
|
+
else throw new Error(`platform: Unexpected argument '${arg}'.`);
|
|
474
|
+
}
|
|
475
|
+
if (noControlPlaneDomain && values.has("--control-plane-domain")) throw new Error("platform: Choose either --control-plane-domain or --no-control-plane-domain.");
|
|
476
|
+
if (noDedicatedZone && dedicatedZone) throw new Error("platform: Choose either --dedicated-zone or --no-dedicated-zone.");
|
|
477
|
+
if (values.has("--auth-config") && (values.has("--login-methods") || accessProtection !== void 0)) throw new Error("platform: --auth-config cannot be combined with login or Access protection options.");
|
|
478
|
+
const appAccess = values.get("--app-access");
|
|
479
|
+
if (appAccess !== void 0 && ![
|
|
480
|
+
"public",
|
|
481
|
+
"platform",
|
|
482
|
+
"custom"
|
|
483
|
+
].includes(appAccess)) throw new Error("platform: --app-access accepts public, platform, or custom.");
|
|
484
|
+
const loginMethods = values.get("--login-methods")?.split(",");
|
|
485
|
+
if (loginMethods && loginMethods.some((method) => !PLATFORM_LOGIN_KINDS.includes(method))) throw new Error("platform: --login-methods accepts github, google, oidc, and cloudflare-access.");
|
|
486
|
+
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.");
|
|
487
|
+
return {
|
|
488
|
+
subcommand,
|
|
489
|
+
...noControlPlaneDomain ? { noControlPlaneDomain: true } : {},
|
|
490
|
+
...noDedicatedZone ? { dedicatedZoneSpecified: true } : {},
|
|
491
|
+
...values.has("--hyperdrive") ? { hyperdrive: values.get("--hyperdrive") } : {},
|
|
492
|
+
...loginMethods ? { loginMethods: [...new Set(loginMethods)] } : {},
|
|
493
|
+
...accessProtection !== void 0 ? { accessProtection } : {},
|
|
494
|
+
...appAccess !== void 0 ? { appAccess } : {},
|
|
495
|
+
...workersDev ? { workersDev: true } : {},
|
|
496
|
+
...values.has("--auth-config") ? { authConfig: values.get("--auth-config") } : {},
|
|
497
|
+
account: values.get("--account") ?? "",
|
|
498
|
+
applicationDomain: values.get("--application-domain") ?? "",
|
|
499
|
+
controlPlaneDomain: values.get("--control-plane-domain") ?? "",
|
|
500
|
+
...values.has("--dashboard-url") ? { dashboardUrl: normalizePlatformDashboardUrl(values.get("--dashboard-url")) } : {},
|
|
501
|
+
dedicatedZone,
|
|
502
|
+
displayName: values.get("--display-name") ?? "",
|
|
503
|
+
name: values.get("--name") ?? "",
|
|
504
|
+
plan,
|
|
505
|
+
resume,
|
|
506
|
+
runtime: values.get("--runtime") ?? "",
|
|
507
|
+
yes,
|
|
508
|
+
zone: values.get("--zone") ?? ""
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
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>.");
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
514
|
+
export { platformSubcommands as n, parsePlatformArgs as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as OperatorClient } from "./operator-client-
|
|
4
|
-
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-
|
|
1
|
+
import { u as openBrowser } from "./auth-CQkSDS50.mjs";
|
|
2
|
+
import { A as confirm, K as select, U as password, X as text, tt as isCancel, z as multiselect } from "./prompts-BNUoTiaf.mjs";
|
|
3
|
+
import { n as OperatorClient } from "./operator-client-CpHjTd0t.mjs";
|
|
4
|
+
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-7erYc6Lt.mjs";
|
|
5
5
|
import { execFile } from "node:child_process";
|
|
6
6
|
import { parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration } from "@void/platform";
|
|
7
7
|
import { stripVTControlCharacters } from "node:util";
|
|
@@ -140,11 +140,11 @@ async function configurationInput(args, existing) {
|
|
|
140
140
|
}
|
|
141
141
|
async function runPlatformAuthConfig(args) {
|
|
142
142
|
if (args.action === "recover") {
|
|
143
|
-
const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-
|
|
143
|
+
const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-CmCzX2Fl.mjs");
|
|
144
144
|
return runPlatformAuthRecovery(args);
|
|
145
145
|
}
|
|
146
146
|
if (args.action === "protection") {
|
|
147
|
-
const { runPlatformProtectionConfig } = await import("./platform-auth-protection-
|
|
147
|
+
const { runPlatformProtectionConfig } = await import("./platform-auth-protection-BLadnnct.mjs");
|
|
148
148
|
return runPlatformProtectionConfig(args);
|
|
149
149
|
}
|
|
150
150
|
const origin = resolveOperatorOrigin(args.connection);
|
package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BLadnnct.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ensurePlatformAccessToken } from "./cf-access-
|
|
4
|
-
import {
|
|
5
|
-
import { n as OperatorClient } from "./operator-client-
|
|
6
|
-
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-
|
|
7
|
-
import { A as PlatformCloudflareClient, D as checkpointPlatformAccessResources, E as resolvePlatformCloudflareCredential, O as parsePlatformAccessSetupSpec, k as preparePlatformAccessSetup, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock } from "./platform-lifecycle-
|
|
8
|
-
import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-
|
|
1
|
+
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
2
|
+
import { b as writePendingInstallationSecrets, d as promoteInstallationSecrets, f as readInstallationRecoverySecrets, g as resolveInstallationManifest, s as normalizePlatformApiUrl, t as acquirePlatformLifecycleLock, y as writeInstallationManifest } from "./platform-registry-DkPPXfp_.mjs";
|
|
3
|
+
import { n as ensurePlatformAccessToken } from "./cf-access-BGe5sWXF.mjs";
|
|
4
|
+
import { A as confirm, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
|
|
5
|
+
import { n as OperatorClient } from "./operator-client-CpHjTd0t.mjs";
|
|
6
|
+
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-7erYc6Lt.mjs";
|
|
7
|
+
import { A as PlatformCloudflareClient, D as checkpointPlatformAccessResources, E as resolvePlatformCloudflareCredential, O as parsePlatformAccessSetupSpec, k as preparePlatformAccessSetup, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock } from "./platform-lifecycle-BBoNzojY.mjs";
|
|
8
|
+
import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-CWOQOWXm.mjs";
|
|
9
9
|
import { createHmac } from "node:crypto";
|
|
10
10
|
import { parsePlatformAccessProtection, platformProtectionProofMessage } from "@void/platform";
|
|
11
11
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as resolveOperatorOrigin } from "./operator-auth-
|
|
5
|
-
import { A as PlatformCloudflareClient, E as resolvePlatformCloudflareCredential, f as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLockConnection } from "./platform-lifecycle-
|
|
6
|
-
import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-
|
|
1
|
+
import { f as readInstallationRecoverySecrets, g as resolveInstallationManifest, t as acquirePlatformLifecycleLock } from "./platform-registry-DkPPXfp_.mjs";
|
|
2
|
+
import { u as openBrowser } from "./auth-CQkSDS50.mjs";
|
|
3
|
+
import { A as confirm, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
|
|
4
|
+
import { a as resolveOperatorOrigin } from "./operator-auth-7erYc6Lt.mjs";
|
|
5
|
+
import { A as PlatformCloudflareClient, E as resolvePlatformCloudflareCredential, f as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLockConnection } from "./platform-lifecycle-BBoNzojY.mjs";
|
|
6
|
+
import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-CWOQOWXm.mjs";
|
|
7
7
|
import { createCipheriv, createDecipheriv, createHash, createHmac, hkdfSync, randomBytes, randomUUID } from "node:crypto";
|
|
8
8
|
import { execFile } from "node:child_process";
|
|
9
9
|
import { parsePlatformAccessProtection, parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration, platformAuthenticationRecoveryMessage, validatePlatformAdmissionPolicy } from "@void/platform";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
2
|
-
import { _ as
|
|
3
|
-
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-
|
|
4
|
-
import {
|
|
5
|
-
import { c as import_picocolors } from "./output-
|
|
1
|
+
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
2
|
+
import { _ as savePlatformConnection, o as listPlatformConnections, r as getActivePlatformConnection, s as normalizePlatformApiUrl, v as selectPlatformConnection } from "./platform-registry-DkPPXfp_.mjs";
|
|
3
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-BGe5sWXF.mjs";
|
|
4
|
+
import { K as select, L as log, X as text, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
|
|
5
|
+
import { c as import_picocolors } from "./output-CbM85T4k.mjs";
|
|
6
6
|
import { parsePlatformDiscoveryDocument } from "@void/platform";
|
|
7
7
|
//#region src/cli/platform-cmd.ts
|
|
8
8
|
async function discoverPlatform(input, fetcher = fetch) {
|
|
@@ -92,12 +92,33 @@ function saveDiscoveredPlatform(discovery) {
|
|
|
92
92
|
}
|
|
93
93
|
async function runPlatformCommand(_root, args) {
|
|
94
94
|
if (args.subcommand === "config") {
|
|
95
|
-
|
|
95
|
+
if ("configGroup" in args) {
|
|
96
|
+
if (args.configGroup === "") {
|
|
97
|
+
if (!process.stdin.isTTY) throw new Error("platform: Choose void platform config auth or void platform config plans.");
|
|
98
|
+
const group = await select({
|
|
99
|
+
message: "Platform configuration:",
|
|
100
|
+
options: [{
|
|
101
|
+
value: "auth",
|
|
102
|
+
label: "Authentication and protection"
|
|
103
|
+
}, {
|
|
104
|
+
value: "plans",
|
|
105
|
+
label: "Plans and limits"
|
|
106
|
+
}]
|
|
107
|
+
});
|
|
108
|
+
if (isCancel(group)) return;
|
|
109
|
+
const { parsePlatformArgs } = await import("./platform-args-DdnM6WIf.mjs");
|
|
110
|
+
return runPlatformCommand(_root, parsePlatformArgs(["config", group]));
|
|
111
|
+
}
|
|
112
|
+
const { runPlatformPlansConfig } = await import("./platform-plans-config-Vl9BP3H4.mjs");
|
|
113
|
+
await runPlatformPlansConfig(args);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const { runPlatformAuthConfig } = await import("./platform-auth-config-DDrxUy4m.mjs");
|
|
96
117
|
await runPlatformAuthConfig(args);
|
|
97
118
|
return;
|
|
98
119
|
}
|
|
99
120
|
if (args.subcommand === "operator") {
|
|
100
|
-
const { runOperatorCommand } = await import("./operator-cmd-
|
|
121
|
+
const { runOperatorCommand } = await import("./operator-cmd-DGqPJUD3.mjs");
|
|
101
122
|
await runOperatorCommand(args);
|
|
102
123
|
return;
|
|
103
124
|
}
|
|
@@ -129,7 +150,7 @@ async function runPlatformCommand(_root, args) {
|
|
|
129
150
|
console.log(`Capabilities: ${Object.entries(discovery.capabilities).filter(([, enabled]) => enabled).map(([name]) => name).join(", ")}`);
|
|
130
151
|
return;
|
|
131
152
|
}
|
|
132
|
-
const { runPlatformLifecycleCommand } = await import("./platform-lifecycle-
|
|
153
|
+
const { runPlatformLifecycleCommand } = await import("./platform-lifecycle-BFdSi9Qt.mjs");
|
|
133
154
|
await runPlatformLifecycleCommand(args);
|
|
134
155
|
}
|
|
135
156
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as runPlatformCommand, t as discoverPlatform } from "./platform-cmd-
|
|
1
|
+
import { r as runPlatformCommand, t as discoverPlatform } from "./platform-cmd-DMDEc9uS.mjs";
|
|
2
2
|
export { discoverPlatform, runPlatformCommand };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { A as PlatformCloudflareClient, E as resolvePlatformCloudflareCredential, T as assertPlatformOperatorCredentialCanApplyPlan, _ as recordPlatformWorkerTraffic, c as createPlatformHealthProbeToken, m as recordResource, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, t as assertNoninteractivePlatformMutationAcknowledged, y as createPlatformInstallPlan } from "./platform-lifecycle-
|
|
5
|
-
import { a as resolveInstalledPlatformManifest, c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-
|
|
1
|
+
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
2
|
+
import { _ as savePlatformConnection, f as readInstallationRecoverySecrets, t as acquirePlatformLifecycleLock, y as writeInstallationManifest } from "./platform-registry-DkPPXfp_.mjs";
|
|
3
|
+
import { A as confirm, B as note, L as log, X as text, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
|
|
4
|
+
import { A as PlatformCloudflareClient, E as resolvePlatformCloudflareCredential, T as assertPlatformOperatorCredentialCanApplyPlan, _ as recordPlatformWorkerTraffic, c as createPlatformHealthProbeToken, m as recordResource, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, t as assertNoninteractivePlatformMutationAcknowledged, y as createPlatformInstallPlan } from "./platform-lifecycle-BBoNzojY.mjs";
|
|
5
|
+
import { a as resolveInstalledPlatformManifest, c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-CWOQOWXm.mjs";
|
|
6
6
|
import { PLATFORM_HEALTH_HOSTNAME_LABEL, PLATFORM_REMOTE_INSTALLATION_MANIFEST_KEY, createApplicationRoutes, createPlatformDeploymentManifest, normalizeApplicationDomain } from "@void/platform";
|
|
7
7
|
//#region src/cli/platform-domain.ts
|
|
8
8
|
function platformDomainTarget(manifest, domain, zone, dedicatedZone) {
|