cf 1.0.0-beta.13 → 1.0.0-beta.15
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 +10 -0
- package/dist/_meta/commands.json +5039 -2465
- package/dist/_meta/hand-written-commands.json +375 -22
- package/dist/_meta/schemas.json +2607 -1038
- package/dist/abuse-reports-CnQBtN1G.mjs +24 -0
- package/dist/access-BzmXSwzj.mjs +2 -0
- package/dist/account-tags-2qPWbW17.mjs +15 -0
- package/dist/accounts-B0Byg-AV.mjs +132 -0
- package/dist/acm-DgAu0cnk.mjs +15 -0
- package/dist/addressing-J1oa0ML2.mjs +105 -0
- package/dist/agent-memory-4KGou-tm.mjs +34 -0
- package/dist/ai-WY7wVQfA.mjs +31 -0
- package/dist/ai-audit-D38HaEoZ.mjs +6 -0
- package/dist/ai-gateway-C0gIipT8.mjs +80 -0
- package/dist/ai-search-ClwnPU-9.mjs +79 -0
- package/dist/ai-security-BIsvFPYV.mjs +10 -0
- package/dist/alerting-MHhv28oO.mjs +56 -0
- package/dist/analytics-BfBz7bqB.mjs +17 -0
- package/dist/analytics_engine-CXVdBF1n.mjs +4 -0
- package/dist/api-eMuS5GI1.mjs +3 -0
- package/dist/api-security-DUCfcdC1.mjs +154 -0
- package/dist/argo-CUlzI4v3.mjs +14 -0
- package/dist/artifacts-BLfWGzBg.mjs +43 -0
- package/dist/audit-logs-CsfIm2QS.mjs +4 -0
- package/dist/auth-8Sm4uLGM.mjs +2 -0
- package/dist/auth-C6u9qIGO.mjs +2 -0
- package/dist/auth-CGRemu5W.mjs +2 -0
- package/dist/{auth-token-pNQrX_9O.mjs → auth-token-DkkYg4DP.mjs} +1 -1
- package/dist/{autoconfig-sD7Frryg.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
- package/dist/basin-catalog-CrKRYJ0b.mjs +46 -0
- package/dist/billing-NxehgXrR.mjs +23 -0
- package/dist/blocks-Bat9A8V_.mjs +5 -0
- package/dist/bot-management-C993iQKL.mjs +9 -0
- package/dist/botnet-feed-CZ4vYk5y.mjs +11 -0
- package/dist/brand-protection-ADVgIi0l.mjs +27 -0
- package/dist/browser-run-CEptKZYl.mjs +42 -0
- package/dist/build-Bm6kGyzo.mjs +2 -0
- package/dist/{build-HmSXqjGn.mjs → build-sBpqm9ga.mjs} +1 -1
- package/dist/builds-DqtiTH7p.mjs +71 -0
- package/dist/cache-hX5QxmI0.mjs +45 -0
- package/dist/certificate-authorities-BOcybjc1.mjs +6 -0
- package/dist/cf-Bq4pA4n6.mjs +18 -0
- package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
- package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
- package/dist/{chunk-DSGVRFIS-C1_SEtRK.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
- package/dist/{cli-DeJc9U8z.mjs → cli-R8h3OKZI.mjs} +1 -1
- package/dist/client-certificates-Bez_ArKE.mjs +13 -0
- package/dist/client-side-security-CSmA50Bv.mjs +63 -0
- package/dist/cloud-connector-0Wivqi7S.mjs +6 -0
- package/dist/{cloudflared--1Ws1RJy.mjs → cloudflared-By8BzYXc.mjs} +1 -1
- package/dist/cloudforce-one-J-rU6k1U.mjs +405 -0
- package/dist/{command-Dh7RmjFu.mjs → command-0BOb1pgV.mjs} +1 -1
- package/dist/{command-DUhX8Dcr.mjs → command-BCJN-ZM2.mjs} +1 -1
- package/dist/{command-BvfKhMl7.mjs → command-BG-kLOnS.mjs} +1 -1
- package/dist/{command-Cu7dcaHT.mjs → command-BIsI-mMX.mjs} +1 -1
- package/dist/{command-83uVfXh9.mjs → command-BKDbbA-L.mjs} +1 -1
- package/dist/command-BWQIKu6I.mjs +2 -0
- package/dist/{command-D3fyhdy-.mjs → command-Bdy69UFU.mjs} +1 -1
- package/dist/{command-BDe67N_n.mjs → command-Bgb-3yPg.mjs} +1 -1
- package/dist/{command-_rqD0hXF.mjs → command-C6w1OdoC.mjs} +1 -1
- package/dist/{command-oNVwyjGB.mjs → command-CKW6UhTh.mjs} +1 -1
- package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
- package/dist/{command-CcuLC6CJ.mjs → command-DIs-Nqtl.mjs} +1 -1
- package/dist/command-DPn5ANHs.mjs +2 -0
- package/dist/{command-CG6RvZs0.mjs → command-DZfKHiru.mjs} +1 -1
- package/dist/{command-BlIb6RR2.mjs → command-DppVezAB.mjs} +1 -1
- package/dist/{completions-D06AO7A8.mjs → completions-CpNGTlUX.mjs} +1 -1
- package/dist/config.mjs +0 -0
- package/dist/connector-interrupts-CH-DaLuo.mjs +6 -0
- package/dist/connector-telemetry-events-X3Fod9nl.mjs +6 -0
- package/dist/connector-telemetry-snapshots-D-WR4npQ.mjs +6 -0
- package/dist/connectors-CORKD31m.mjs +15 -0
- package/dist/containers-BboUbx3k.mjs +78 -0
- package/dist/containers-Di3_Vopq.mjs +376 -0
- package/dist/content-scan-DXGREAXa.mjs +14 -0
- package/dist/{context-q7UaYK69.mjs → context-A6T-NKPI.mjs} +2 -2
- package/dist/cps-1BoOLtTq.mjs +6 -0
- package/dist/create-OXylMu6m.mjs +2 -0
- package/dist/csamScanner-CHfbfeup.mjs +10 -0
- package/dist/ct-alerting-DlH4ILQo.mjs +5 -0
- package/dist/custom-certificates-zJqJZ2Th.mjs +17 -0
- package/dist/custom-csrs-DoLIGqYL.mjs +11 -0
- package/dist/custom-hostnames-YfV-aoAK.mjs +27 -0
- package/dist/custom-nameservers-BV43gmgt.mjs +9 -0
- package/dist/custom-pages-CoOU1Cdx.mjs +21 -0
- package/dist/d1-DujBmzLa.mjs +94 -0
- package/dist/dcv-delegation-CPLsVYOl.mjs +4 -0
- package/dist/delegate.mjs +0 -0
- package/dist/deploy-context-tEhwEXnA.mjs +56 -0
- package/dist/{deploy-input-Cc0_2QlW.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
- package/dist/{deploy-CWNm1-5v.mjs → deploy-wNujfGUJ.mjs} +1 -1
- package/dist/{dev-ZA8itQE7.mjs → dev-EtnMYA7K.mjs} +1 -1
- package/dist/diagnostics-B3TYPVRi.mjs +15 -0
- package/dist/dist-DZRTPMMA.mjs +449 -0
- package/dist/dls-CWm1HRF0.mjs +17 -0
- package/dist/dns-CjAFU7Z9.mjs +144 -0
- package/dist/dns-firewall-BooBP9ap.mjs +71 -0
- package/dist/docs-C5XB7HdG.mjs +3 -0
- package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
- package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
- package/dist/durable-objects-CSrMQDCE.mjs +6 -0
- package/dist/email-auth-Bp1Mui-n.mjs +6 -0
- package/dist/email-routing-CVF6SwQt.mjs +45 -0
- package/dist/email-security-mYZtazae.mjs +158 -0
- package/dist/email-sending-BqaKU_Xu.mjs +47 -0
- package/dist/error-sanitization-CIQOep3I.mjs +2 -0
- package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
- package/dist/fieldExtractors-CAGZVmYg.mjs +9 -0
- package/dist/firewall-DgTDsYOt.mjs +36 -0
- package/dist/flagship-Db3PxxyZ.mjs +28 -0
- package/dist/fraud-BEOQczy8.mjs +22 -0
- package/dist/get-By1q8YlI.mjs +2 -0
- package/dist/get-CRKvqCu6.mjs +2 -0
- package/dist/get-iPUHxD1r.mjs +2 -0
- package/dist/google-tag-gateway-DjLQ9wo0.mjs +6 -0
- package/dist/hand-written-dry-run-B82fRl2N.mjs +2 -0
- package/dist/healthchecks-C3ScnKss.mjs +22 -0
- package/dist/{hostnames-sF999-6H.mjs → hostnames-DU0k-xO9.mjs} +6 -6
- package/dist/hyperdrive-IpCCLCRd.mjs +37 -0
- package/dist/iam-96CYM8Vw.mjs +52 -0
- package/dist/images-AB9EgZgT.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-1w_mcgk3.mjs → init-D2nPoW4f.mjs} +2 -2
- package/dist/intel-BKb4RLvS.mjs +76 -0
- package/dist/ips-z9APCV_b.mjs +4 -0
- package/dist/k2-Bv-HiJ29.mjs +11 -0
- package/dist/keyless-certificates-ChgSGHq4.mjs +13 -0
- package/dist/keys-BhngDsDa.mjs +4 -0
- package/dist/kv-CB5MQVGP.mjs +15 -0
- package/dist/{lazy-command-BDiIwpss.mjs → lazy-command-CaZ1kdlW.mjs} +1 -1
- package/dist/leaked-credential-checks-Bsi2WpSU.mjs +18 -0
- package/dist/load-balancers-0gXZNCeI.mjs +76 -0
- package/dist/{local-DlT72Xpn.mjs → local-Dil4fTWX.mjs} +1 -1
- package/dist/local-DxWDQDnG.mjs +2 -0
- package/dist/{local-runtime-CokO6qaX.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
- package/dist/login-CiQGR8ha.mjs +5 -0
- package/dist/login-Ik98G4K6.mjs +2 -0
- package/dist/logo-matches-DmoF5Otu.mjs +6 -0
- package/dist/logos-BL6ohIMH.mjs +7 -0
- package/dist/logpush-UVopW68t.mjs +46 -0
- package/dist/logs-BVfxiEiM.mjs +36 -0
- package/dist/magic-cloud-networking-B5S3aM6f.mjs +71 -0
- package/dist/magic-network-monitoring-CDSJPP47.mjs +36 -0
- package/dist/magic-transit-TcDTKM43.mjs +386 -0
- package/dist/managed-defense-C88HL0pg.mjs +18 -0
- package/dist/managed-transforms-Ja41Tahl.mjs +9 -0
- package/dist/matches-BL_Y-9Yq.mjs +6 -0
- package/dist/mcp-BWp5Q09R.mjs +32 -0
- package/dist/mesh-lFPLRWhV.mjs +26 -0
- package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
- package/dist/monetization-BIc4Bwo2.mjs +20 -0
- package/dist/mtls-certificates-CVBw-Jli.mjs +13 -0
- package/dist/network-Wig0qbaC.mjs +50 -0
- package/dist/network-interconnects-C16z1HuQ.mjs +72 -0
- package/dist/o11y-Bhy4qDRm.mjs +93 -0
- package/dist/oauth-CfEedDZi.mjs +4 -0
- package/dist/oauth-clients-eXjmK5yf.mjs +16 -0
- package/dist/{oauth-mspHHU5U.mjs → oauth-oWaW7ICv.mjs} +1 -1
- package/dist/oauth-scopes-DZWn50EA.mjs +4 -0
- package/dist/organization-QdAQTrKa.mjs +71 -0
- package/dist/organizations-CgAQYdK5.mjs +4 -0
- package/dist/origin-ca-certificates-BklXqp8X.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Dg16ueT4.mjs +6 -0
- package/dist/origin-tls-client-auth-d8bDU5zU.mjs +30 -0
- package/dist/output-Co4xdFf6.mjs +2 -0
- package/dist/page-rules-CgMkC6YR.mjs +39 -0
- package/dist/pages-CkBtOOf8.mjs +54 -0
- package/dist/path-DRw6Y-nd.mjs +2 -0
- package/dist/pay-per-crawl-CnGXOWyz.mjs +38 -0
- package/dist/pay-per-use-HbfxpATr.mjs +33 -0
- package/dist/pipelines-CnO9CCs0.mjs +44 -0
- package/dist/precursor-Bc55XJdQ.mjs +4 -0
- package/dist/previews-C7vZrajd.mjs +7 -0
- package/dist/progress-D5po7ScB.mjs +2 -0
- package/dist/prompt-BAJpE3jV.mjs +4 -0
- package/dist/queries-BJAH4B74.mjs +9 -0
- package/dist/queues-D4G8vvwi.mjs +57 -0
- package/dist/r2-CJ8rD6Jb.mjs +128 -0
- package/dist/{radar-DrQLcbkq.mjs → radar-DgaxOdcd.mjs} +150 -150
- package/dist/raw-fetch-yY-wX5Xx.mjs +2 -0
- package/dist/realtime-DU09m7L7.mjs +172 -0
- package/dist/registrar-Cj7OfvGs.mjs +43 -0
- package/dist/registrar-sandbox-CA0Mua-j.mjs +56 -0
- package/dist/{registry-CHowrQsZ.mjs → registry-CRnk93ur.mjs} +1 -1
- package/dist/reporting-3kDVF5c8.mjs +14 -0
- package/dist/{request-headers-DiJeDAn1.mjs → request-headers-D_eQn93b.mjs} +1 -1
- package/dist/request-tracers-VBD4R3s3.mjs +4 -0
- package/dist/resolve-BpgXeklt.mjs +2 -0
- package/dist/resolve-C3FmNlSO.mjs +2 -0
- package/dist/resource-sharing-BtUF3psS.mjs +40 -0
- package/dist/resource-tagging--90INP8_.mjs +4 -0
- package/dist/rules-CcwPngVo.mjs +18 -0
- package/dist/rulesets-CfdruY82.mjs +37 -0
- package/dist/rum-RLkdfSL7.mjs +30 -0
- package/dist/run-CUNhH5CQ.mjs +2 -0
- package/dist/{run-BvHwWWUX.mjs → run-DASYqJsY.mjs} +1 -1
- package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
- package/dist/{schema-flags-BzoBGPWk.mjs → schema-flags-CShtn7ya.mjs} +1 -1
- package/dist/scim-BZYsTPIL.mjs +18 -0
- package/dist/secrets-store-C_-FkSH_.mjs +24 -0
- package/dist/security-insights-BVBEaZmD.mjs +40 -0
- package/dist/security-txt--IoHrHee.mjs +9 -0
- package/dist/session-Cq3YNLoI.mjs +2 -0
- package/dist/shared-zNQNv1im.mjs +2 -0
- package/dist/smart-shield-CByC4_60.mjs +24 -0
- package/dist/snippets-DB-jiZAV.mjs +20 -0
- package/dist/{spawn-IysxuTNW.mjs → spawn-DQttFH05.mjs} +1 -1
- package/dist/spectrum-Bs2g1BmK.mjs +83 -0
- package/dist/speed-Bq4evEnJ.mjs +24 -0
- package/dist/sql-XGci7hZC.mjs +4 -0
- package/dist/src-GiuwAT55.mjs +125 -0
- package/dist/ssl-KJTLW1NR.mjs +45 -0
- package/dist/{startup-profile-CdJWgNjd.mjs → startup-profile-BOaseXnO.mjs} +1 -1
- package/dist/startup-profile-BwEZFVGS.mjs +2 -0
- package/dist/{state-BDSvdSdP.mjs → state-Boubf1X6.mjs} +1 -1
- package/dist/state-CODDG9Nx.mjs +2 -0
- package/dist/stream-BotgYspF.mjs +102 -0
- package/dist/submit-C5VytaHP.mjs +4 -0
- package/dist/{tags-CA1xMM96.mjs → tags-3Hq-B9qp.mjs} +2 -2
- package/dist/{telemetry-Cm39QJ-M.mjs → telemetry-3FJOXl_C.mjs} +1 -1
- package/dist/telemetry-BhKfwxyh.mjs +2 -0
- package/dist/tenant-BgX5onPc.mjs +10 -0
- package/dist/tenant-custom-nameservers-BVG8v1Xo.mjs +9 -0
- package/dist/theme-BGHWSKCw.mjs +6 -0
- package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
- package/dist/tunnels-CThOI3qH.mjs +29 -0
- package/dist/turnstile-BgZaUx-g.mjs +33 -0
- package/dist/ui-BtIBQeaG.mjs +2 -0
- package/dist/update-check-Yy7Ivq2V.mjs +2 -0
- package/dist/{update-check-CMXSdres.mjs → update-check-jb89ih_g.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/url-info-DQERN0Xq.mjs +4 -0
- package/dist/url-normalization-Cb1hofqv.mjs +9 -0
- package/dist/url-scanner-gHgx1bW7.mjs +16 -0
- package/dist/user-CdKzIuSi.mjs +112 -0
- package/dist/values-EwA8Sx0w.mjs +4 -0
- package/dist/vectorize-DejgIJIv.mjs +32 -0
- package/dist/version-B6MnUIqV.mjs +2 -0
- package/dist/waiting-rooms-BNR1HvAP.mjs +53 -0
- package/dist/web-assets-iglnzkTV.mjs +64 -0
- package/dist/web3-JBUU6IVt.mjs +28 -0
- package/dist/workers-CDp4kLTJ.mjs +40 -0
- package/dist/workers-builds-CSb9Dglt.mjs +14 -0
- package/dist/workers-for-platforms-D4srNZvt.mjs +40 -0
- package/dist/workers-vpc-LPC8TadH.mjs +13 -0
- package/dist/workflows-DN_VqWJC.mjs +52 -0
- package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
- package/dist/zaraz-DDErl5yc.mjs +22 -0
- package/dist/zero-trust-M88XX3uD.mjs +957 -0
- package/dist/zone-BsGvedmN.mjs +4 -0
- package/dist/zones-l_sRKrVl.mjs +124 -0
- package/package.json +17 -20
- package/dist/Page-BShsqCXr.mjs +0 -2
- package/dist/abuse-reports-BjU1s8cf.mjs +0 -24
- package/dist/access-C_G2MZnA.mjs +0 -2
- package/dist/account-tags-CaXDDeZ4.mjs +0 -15
- package/dist/accounts-BALwxDQY.mjs +0 -131
- package/dist/acm-CP9EaXQN.mjs +0 -15
- package/dist/addressing-DRlaxqrI.mjs +0 -93
- package/dist/agent-memory-vGhlfZBx.mjs +0 -34
- package/dist/ai-CJtbWfB9.mjs +0 -31
- package/dist/ai-audit-C0BJNqZZ.mjs +0 -6
- package/dist/ai-gateway-BQtv3U3x.mjs +0 -80
- package/dist/ai-search-DGU1Y5By.mjs +0 -79
- package/dist/ai-security-CFTaYk_X.mjs +0 -10
- package/dist/alerting-1hun27JC.mjs +0 -56
- package/dist/analytics-DXUSjvzT.mjs +0 -17
- package/dist/analytics_engine-CQsnL09C.mjs +0 -4
- package/dist/api-security-BXhrfR6-.mjs +0 -154
- package/dist/argo-LPUCTnee.mjs +0 -14
- package/dist/args-CfbYkeXd.mjs +0 -2
- package/dist/artifacts-Dt6easua.mjs +0 -43
- package/dist/audit-logs-CVznAM2Z.mjs +0 -4
- package/dist/auth-CGLsxbc6.mjs +0 -2
- package/dist/auth-CrmVwfpJ.mjs +0 -2
- package/dist/auth-eQr-kQCH.mjs +0 -2
- package/dist/banner-D03JEqRs.mjs +0 -2
- package/dist/basin-catalog-ZQICw-zF.mjs +0 -46
- package/dist/billing-Dy1-dV_B.mjs +0 -23
- package/dist/bot-management-DTgPwL7O.mjs +0 -9
- package/dist/botnet-feed-xb98Cj3Y.mjs +0 -11
- package/dist/brand-protection-Ck3okE2k.mjs +0 -27
- package/dist/browser-run-DJGJSzFX.mjs +0 -42
- package/dist/build-B1L6xrgC.mjs +0 -2
- package/dist/builds-CYxcZtkG.mjs +0 -71
- package/dist/cache-D9tSfovH.mjs +0 -45
- package/dist/certificate-authorities-CpiveTFC.mjs +0 -6
- package/dist/cf-BxsXrVeh.mjs +0 -18
- package/dist/chunk-NDZDTP46-Bjx_wtJe.mjs +0 -361
- package/dist/cli-types-9oYmRTHJ.mjs +0 -2
- package/dist/client-certificates-CF6YZyvP.mjs +0 -13
- package/dist/client-side-security-BLoe9kS5.mjs +0 -63
- package/dist/cloud-connector-DXRUHsjt.mjs +0 -6
- package/dist/cloudforce-one-CBLxXi6v.mjs +0 -447
- package/dist/command-DwXiDOeH.mjs +0 -2
- package/dist/command-UiHLJ8Ji.mjs +0 -2
- package/dist/connector-interrupts-DelTmNyw.mjs +0 -6
- package/dist/connector-telemetry-events-BwxR3G8d.mjs +0 -6
- package/dist/connector-telemetry-snapshots-Bqq-hrpJ.mjs +0 -6
- package/dist/connectors-D-m3rEpk.mjs +0 -15
- package/dist/containers-CVNfEjJs.mjs +0 -78
- package/dist/containers-DeoZyeQe.mjs +0 -375
- package/dist/content-scan-W0BNzbQp.mjs +0 -14
- package/dist/cps-BZ6hqRb5.mjs +0 -6
- package/dist/csamScanner-Bo1t3CLh.mjs +0 -10
- package/dist/ct-alerting-E03faC7p.mjs +0 -5
- package/dist/custom-certificates-CUySSPzi.mjs +0 -17
- package/dist/custom-csrs-gNpWkJPQ.mjs +0 -11
- package/dist/custom-hostnames-abGBAbx7.mjs +0 -27
- package/dist/custom-nameservers-BgNXol1P.mjs +0 -9
- package/dist/custom-pages-DMKX3aoD.mjs +0 -21
- package/dist/d1-CE08YqYk.mjs +0 -93
- package/dist/dcv-delegation-B5YUEWu0.mjs +0 -4
- package/dist/deploy-context-Dr6bxNcB.mjs +0 -56
- package/dist/diagnostics-UMbG6m4n.mjs +0 -15
- package/dist/dist-BHEmAAHr.mjs +0 -487
- package/dist/dls-DIl16mLp.mjs +0 -17
- package/dist/dns-QUpgljRG.mjs +0 -144
- package/dist/dns-firewall-BZwJXHLj.mjs +0 -71
- package/dist/durable-objects-BCj4ykpU.mjs +0 -6
- package/dist/email-auth-DlHIYhCk.mjs +0 -6
- package/dist/email-routing-UKVS4DYy.mjs +0 -45
- package/dist/email-security-CZjfRIg0.mjs +0 -158
- package/dist/email-sending-Dquc880C.mjs +0 -47
- package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
- package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
- package/dist/errors-_sob7Ihu.mjs +0 -3
- package/dist/fieldExtractors-BbwDRquU.mjs +0 -9
- package/dist/firewall--mTfDnCJ.mjs +0 -36
- package/dist/flagship-cfoSwwM9.mjs +0 -28
- package/dist/fraud-Dcsq3EYK.mjs +0 -22
- package/dist/google-tag-gateway-DPKSkZQi.mjs +0 -6
- package/dist/healthchecks-D78hIIBC.mjs +0 -22
- package/dist/hyperdrive-qWACKfA4.mjs +0 -37
- package/dist/iam-Bvg_PayW.mjs +0 -52
- package/dist/images-DI_lEZ4L.mjs +0 -71
- package/dist/intel-BxElBUMP.mjs +0 -76
- package/dist/ips-DWoaKxi7.mjs +0 -4
- package/dist/k2-tFjaftl-.mjs +0 -11
- package/dist/keyless-certificates-BrvxHU4J.mjs +0 -13
- package/dist/keys-DcwTYKRf.mjs +0 -4
- package/dist/kv-htXS-7uP.mjs +0 -15
- package/dist/leaked-credential-checks-bvGrLOmQ.mjs +0 -18
- package/dist/load-balancers-BNTUt4yG.mjs +0 -76
- package/dist/local-DlDumOSC.mjs +0 -2
- package/dist/login-BGF_I_LT.mjs +0 -5
- package/dist/login-Ccw-mYwT.mjs +0 -2
- package/dist/logo-matches-tE8LTKgg.mjs +0 -6
- package/dist/logos-Bj845Mcw.mjs +0 -7
- package/dist/logpush-Cs8JdvKi.mjs +0 -46
- package/dist/logs-C92XZvNu.mjs +0 -36
- package/dist/magic-cloud-networking-hNp5MMw-.mjs +0 -71
- package/dist/magic-network-monitoring-68GuWAnv.mjs +0 -36
- package/dist/magic-transit-DNd7gu4j.mjs +0 -383
- package/dist/managed-defense-B_wCAuFD.mjs +0 -18
- package/dist/managed-transforms-DZdxHPOh.mjs +0 -9
- package/dist/matches-B65CkflD.mjs +0 -6
- package/dist/mcp-DrJW5ayK.mjs +0 -32
- package/dist/mesh-DfVzYTn1.mjs +0 -26
- package/dist/monetization-BGaI8CMO.mjs +0 -20
- package/dist/mtls-certificates-BsU2emDD.mjs +0 -13
- package/dist/network-BEMD8P0U.mjs +0 -50
- package/dist/network-interconnects-DMu_fcbo.mjs +0 -68
- package/dist/o11y-C1a4gDGF.mjs +0 -93
- package/dist/oauth-Bj5Ne1o8.mjs +0 -9
- package/dist/oauth-clients-p4Etdqy_.mjs +0 -16
- package/dist/oauth-scopes-B2IabFza.mjs +0 -4
- package/dist/organization-CdXt7AVZ.mjs +0 -75
- package/dist/organizations-5S6xEp7T.mjs +0 -4
- package/dist/origin-ca-certificates-_VJAoK1D.mjs +0 -11
- package/dist/origin-post-quantum-encryption-GcldDsT2.mjs +0 -6
- package/dist/origin-tls-client-auth-DZHld9fA.mjs +0 -30
- package/dist/output-BOe-3AQG.mjs +0 -2
- package/dist/page-rules-o1tAMMsD.mjs +0 -39
- package/dist/pages-CmiOhjSl.mjs +0 -54
- package/dist/pay-per-crawl-BsnOxGYU.mjs +0 -38
- package/dist/pay-per-use-BXWMCSyE.mjs +0 -33
- package/dist/pipelines-DWLQC0F6.mjs +0 -44
- package/dist/precursor-B6DjBib6.mjs +0 -4
- package/dist/previews-dUKEBGSM.mjs +0 -4
- package/dist/progress-BtkTVcHI.mjs +0 -2
- package/dist/prompt-RlgRrmbm.mjs +0 -3
- package/dist/queries-yLwoJRHV.mjs +0 -9
- package/dist/queues-CnJRaE1o.mjs +0 -57
- package/dist/r2-CuC6-zQX.mjs +0 -128
- package/dist/raw-fetch-B4NvWuZD.mjs +0 -2
- package/dist/realtime-CjsnzHxD.mjs +0 -172
- package/dist/registrar-BgOsxTnX.mjs +0 -43
- package/dist/registrar-sandbox-3ikBD9fB.mjs +0 -56
- package/dist/reporting-hE127s5r.mjs +0 -14
- package/dist/request-tracers-BCwLxmPN.mjs +0 -4
- package/dist/resolve-CaTBV-c6.mjs +0 -2
- package/dist/resolve-DCGSzUDQ.mjs +0 -2
- package/dist/resource-sharing-2qvWUuMa.mjs +0 -40
- package/dist/resource-tagging-Dwx7iL3v.mjs +0 -4
- package/dist/rules-DxVQ6jIg.mjs +0 -18
- package/dist/rulesets-Cdh8YjI9.mjs +0 -37
- package/dist/rum-a4CMq4Qu.mjs +0 -30
- package/dist/run-CkbrPJPx.mjs +0 -2
- package/dist/scim-B8XlXl8v.mjs +0 -18
- package/dist/secrets-store-Cqhedh_i.mjs +0 -24
- package/dist/security-insights-le2-DteL.mjs +0 -40
- package/dist/security-txt-cCArWXur.mjs +0 -9
- package/dist/session-C1BhT1ZJ.mjs +0 -2
- package/dist/shared-BPjcpXuA.mjs +0 -2
- package/dist/smart-shield-Csyh8hwB.mjs +0 -24
- package/dist/snippets-DUWx25q6.mjs +0 -20
- package/dist/spectrum-Da3UYSOR.mjs +0 -83
- package/dist/speed-NxlMnB2e.mjs +0 -24
- package/dist/sql-CNdHAlQ8.mjs +0 -4
- package/dist/src-JfLDUxFr.mjs +0 -125
- package/dist/ssl-BtaX2WEJ.mjs +0 -45
- package/dist/startup-profile-B2l0ChVu.mjs +0 -2
- package/dist/state-JB4_BU1o.mjs +0 -2
- package/dist/stream-C1Ijjzn4.mjs +0 -102
- package/dist/submit-MdkuU_Pt.mjs +0 -4
- package/dist/telemetry-BsYO3nxG.mjs +0 -2
- package/dist/tenant-BB6Oszcl.mjs +0 -10
- package/dist/tenant-custom-nameservers-BsbgYAEo.mjs +0 -9
- package/dist/theme-CQ_TYifs.mjs +0 -6
- package/dist/tunnels-CRFtyHWz.mjs +0 -29
- package/dist/turnstile-DBXWo_Xe.mjs +0 -33
- package/dist/ui-YmjF66Ct.mjs +0 -5
- package/dist/update-check-C2oVEbXx.mjs +0 -2
- package/dist/url-info-t-XAs0Mk.mjs +0 -4
- package/dist/url-normalization-Cs4F8e0a.mjs +0 -9
- package/dist/url-scanner-CBIoDbTx.mjs +0 -16
- package/dist/user-CevdOMoa.mjs +0 -112
- package/dist/values-CjNlkbIh.mjs +0 -4
- package/dist/vectorize-9d9tPmg5.mjs +0 -32
- package/dist/version-BdVUXLnK.mjs +0 -2
- package/dist/waiting-rooms--5WmrWb3.mjs +0 -53
- package/dist/web-assets-BHot_MU8.mjs +0 -64
- package/dist/web3-CYfWAF6b.mjs +0 -28
- package/dist/workers-S17M0n3h.mjs +0 -40
- package/dist/workers-builds-Dw7ho3So.mjs +0 -14
- package/dist/workers-for-platforms-A3yjyLh3.mjs +0 -40
- package/dist/workers-vpc-BZ2xXtC3.mjs +0 -13
- package/dist/workflows-BgGrVpSR.mjs +0 -43
- package/dist/zaraz-BsD2dMI3.mjs +0 -22
- package/dist/zero-trust-CA3iGQbG.mjs +0 -837
- package/dist/zone-D2M4EZD0.mjs +0 -4
- package/dist/zones-BoOC_JzC.mjs +0 -124
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-C6u9qIGO.mjs";import{a as i,t as a}from"./context-A6T-NKPI.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-D5po7ScB.mjs";import{t as l}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g,n as _}from"./prompt-BAJpE3jV.mjs";import{n as v,t as ee}from"./raw-fetch-yY-wX5Xx.mjs";var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules`};function ne(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules bulk-delete
|
|
3
|
+
|
|
4
|
+
Delete all DNS Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`bulk-delete`,describe:`Delete all DNS Protection rules.`,builder:ne,handler:async e=>l({command:`magic-transit advanced-dns-protection configs dns protection rules bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-dns-protection configs dns protection rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(te,{account_id:l}));o(u,{successLabel:`Deleted`})})};var y={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules`,body:`json`};function ie(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules create
|
|
6
|
+
|
|
7
|
+
Create a DNS Protection rule for an account.`).option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const ae={command:`create`,describe:`Create DNS Protection rule.`,builder:ie,handler:async e=>l({command:`magic-transit advanced-dns-protection configs dns protection rules create`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({block_any_queries:e[`block-any-queries`],burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:m(e.name,`name`,`text`),profile_sensitivity:m(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:m(e.scope,`scope`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(y,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`burst-sensitivity`]===void 0&&(e[`burst-sensitivity`]=await h(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),e[`profile-sensitivity`]===void 0&&(e[`profile-sensitivity`]=await h(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),e[`rate-sensitivity`]===void 0&&(e[`rate-sensitivity`]=await h(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.scope===void 0&&(e.scope=await h(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let u=p({block_any_queries:e[`block-any-queries`],burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:m(e.name,`name`,`text`),profile_sensitivity:m(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:m(e.scope,`scope`,`text`)}),f=await c(`Creating`,async()=>n.send(y,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var oe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules/${t.rule_id}`};function se(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules delete <rule-id>
|
|
8
|
+
|
|
9
|
+
Delete a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ce={command:`delete <rule-id>`,describe:`Delete DNS Protection rule.`,builder:se,handler:async e=>l({command:`magic-transit advanced-dns-protection configs dns protection rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(oe,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Deleted`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules/${t.rule_id}`};function ue(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules get <rule-id>
|
|
11
|
+
|
|
12
|
+
Get a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <rule-id>`,describe:`Get DNS Protection rule.`,builder:ue,handler:async e=>l({command:`magic-transit advanced-dns-protection configs dns protection rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-dns-protection configs dns protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(le,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Loaded`})})};var fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules`,query:[`page`,`per_page`,`order`,`direction`],joined:[`page`,`per_page`,`order`,`direction`]};function pe(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules list
|
|
13
|
+
|
|
14
|
+
List all DNS Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`List all DNS Protection rules.`,builder:pe,handler:async e=>l({command:`magic-transit advanced-dns-protection configs dns protection rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-dns-protection configs dns protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(fe,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var he={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules/${t.rule_id}`,body:`json`};function ge(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules update <rule-id>
|
|
15
|
+
|
|
16
|
+
Update a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to update.`,demandOption:!0}).option(`block-any-queries`,{type:`boolean`,description:`The new value for whether to block DNS ANY queries. Optional.`}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`profile-sensitivity`,{type:`string`,description:`The new profile sensitivity. Optional. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the DNS Protection rule.`})}const _e={command:`update <rule-id>`,describe:`Update DNS Protection rule.`,builder:ge,handler:async e=>l({command:`magic-transit advanced-dns-protection configs dns protection rules update`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-dns-protection configs dns protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({block_any_queries:e[`block-any-queries`],burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:m(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(he,{body:t,account_id:l,rule_id:e[`rule-id`]}));o(r,{successLabel:`Updated`});return}let u=p({block_any_queries:e[`block-any-queries`],burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:m(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}),f=await c(`Updating`,async()=>n.send(he,{body:u,account_id:l,rule_id:e[`rule-id`]}));o(f,{successLabel:`Updated`})})},ve={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(re).command(ae).command(ce).command(de).command(me).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ye={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},be={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xe={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`advanced-dns-protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ce={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist`};function we(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist bulk-delete
|
|
17
|
+
|
|
18
|
+
Delete all allowlist prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Te={command:`bulk-delete`,describe:`Delete all allowlist prefixes.`,builder:we,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs allowlist bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs allowlist bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
19
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Ce,{account_id:l}));o(u,{successLabel:`Deleted`})})};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist`,body:`json`};function Ee(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist create
|
|
20
|
+
|
|
21
|
+
Create an allowlist prefix for an account.`).option(`comment`,{type:`string`,description:`An comment describing the allowlist prefix.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect.`}).option(`prefix`,{type:`string`,description:`The allowlist prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new allowlist prefix to create.`})}const De={command:`create`,describe:`Create allowlist prefix.`,builder:Ee,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs allowlist create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs allowlist create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({comment:m(e.comment,`comment`,`text`),enabled:e.enabled,prefix:m(e.prefix,`prefix`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(b,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.comment===void 0&&(e.comment=await h(`comment`,`An comment describing the allowlist prefix.`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.prefix===void 0&&(e.prefix=await h(`prefix`,`The allowlist prefix to add in CIDR format.`));let u=p({comment:m(e.comment,`comment`,`text`),enabled:e.enabled,prefix:m(e.prefix,`prefix`,`text`)}),f=await c(`Creating`,async()=>n.send(b,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Oe={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist`,query:[`page`,`per_page`,`order`,`direction`],joined:[`page`,`per_page`,`order`,`direction`]};function ke(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist list
|
|
22
|
+
|
|
23
|
+
List all allowlist prefixes for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`list`,describe:`List all allowlist prefixes.`,builder:ke,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs allowlist list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs allowlist list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Oe,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var je={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist/${t.prefix_id}`};function Me(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix delete <prefix-id>
|
|
24
|
+
|
|
25
|
+
Delete the allowlist prefix for an account given a UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <prefix-id>`,describe:`Delete allowlist prefix.`,builder:Me,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs allowlist prefix delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs allowlist prefix delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
26
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(je,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Deleted`})})};var Pe={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist/${t.prefix_id}`};function Fe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix get <prefix-id>
|
|
27
|
+
|
|
28
|
+
Get an allowlist prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`get <prefix-id>`,describe:`Get allowlist prefix.`,builder:Fe,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs allowlist prefix get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs allowlist prefix get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Pe,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Loaded`})})};var x={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist/${t.prefix_id}`,body:`json`};function Le(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix update <prefix-id>
|
|
29
|
+
|
|
30
|
+
Update an allowlist prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A comment describing the allowlist prefix. Optional.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the allowlist prefix.`})}const Re={command:`update <prefix-id>`,describe:`Update allowlist prefix.`,builder:Le,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs allowlist prefix update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs allowlist prefix update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({comment:m(e.comment,`comment`,`text`),enabled:e.enabled}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(x,{body:t,account_id:l,prefix_id:e[`prefix-id`]}));o(r,{successLabel:`Updated`});return}let u=p({comment:m(e.comment,`comment`,`text`),enabled:e.enabled}),f=await c(`Updating`,async()=>n.send(x,{body:u,account_id:l,prefix_id:e[`prefix-id`]}));o(f,{successLabel:`Updated`})})},ze={command:`prefix`,describe:`Operations for advanced-tcp-protection.configs.allowlist.prefix`,builder:e=>e.command(Ne).command(Ie).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Be={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist`,builder:e=>e.command(Te).command(De).command(Ae).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ve={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes`};function He(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk-delete
|
|
31
|
+
|
|
32
|
+
Delete all prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ue={command:`bulk-delete`,describe:`Delete all prefixes.`,builder:He,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
33
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Ve,{account_id:l}));o(u,{successLabel:`Deleted`})})};var We={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/bulk`,body:`json`};function Ge(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk create
|
|
34
|
+
|
|
35
|
+
Create multiple prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The list of new prefixes to create.`})}const Ke={command:`create`,describe:`Create multiple prefixes.`,builder:Ge,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes bulk create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(We,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},qe={command:`bulk`,describe:`Operations for advanced-tcp-protection.configs.prefixes.bulk`,builder:e=>e.command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var S={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes`,body:`json`};function Je(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes create
|
|
36
|
+
|
|
37
|
+
Create a prefix for an account.`).option(`comment`,{type:`string`,description:`A comment describing the prefix.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection.`}).option(`prefix`,{type:`string`,description:`The prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new prefix to create.`})}const Ye={command:`create`,describe:`Create prefix.`,builder:Je,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes create`,classification:{safeFlags:[`excluded`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({comment:m(e.comment,`comment`,`text`),excluded:e.excluded,prefix:m(e.prefix,`prefix`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(S,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.comment===void 0&&(e.comment=await h(`comment`,`A comment describing the prefix.`)),e.excluded===void 0)throw Error(`--excluded is required (or pass --body with this field set).`);e.prefix===void 0&&(e.prefix=await h(`prefix`,`The prefix to add in CIDR format.`));let u=p({comment:m(e.comment,`comment`,`text`),excluded:e.excluded,prefix:m(e.prefix,`prefix`,`text`)}),f=await c(`Creating`,async()=>n.send(S,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Xe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/${t.prefix_id}`};function Ze(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes delete <prefix-id>
|
|
38
|
+
|
|
39
|
+
Delete the prefix for an account given a UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qe={command:`delete <prefix-id>`,describe:`Delete prefix.`,builder:Ze,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
40
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Xe,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Deleted`})})};var $e={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/${t.prefix_id}`};function et(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes get <prefix-id>
|
|
41
|
+
|
|
42
|
+
Get a prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`get <prefix-id>`,describe:`Get prefix.`,builder:et,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send($e,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Loaded`})})};var nt={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes`,query:[`page`,`per_page`,`order`,`direction`],joined:[`page`,`per_page`,`order`,`direction`]};function rt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes list
|
|
43
|
+
|
|
44
|
+
List all prefixes for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`list`,describe:`List all prefixes.`,builder:rt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(nt,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var C={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/${t.prefix_id}`,body:`json`};function at(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes update <prefix-id>
|
|
45
|
+
|
|
46
|
+
Update a prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A new comment for the prefix. Optional.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the prefix.`})}const ot={command:`update <prefix-id>`,describe:`Update prefix.`,builder:at,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs prefixes update`,classification:{safeFlags:[`excluded`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs prefixes update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({comment:m(e.comment,`comment`,`text`),excluded:e.excluded}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(C,{body:t,account_id:l,prefix_id:e[`prefix-id`]}));o(r,{successLabel:`Updated`});return}let u=p({comment:m(e.comment,`comment`,`text`),excluded:e.excluded}),f=await c(`Updating`,async()=>n.send(C,{body:u,account_id:l,prefix_id:e[`prefix-id`]}));o(f,{successLabel:`Updated`})})},st={command:`prefixes`,describe:`Operations for advanced-tcp-protection.configs.prefixes`,builder:e=>e.command(Ue).command(Ye).command(Qe).command(tt).command(it).command(ot).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ct={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`};function lt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters bulk-delete
|
|
47
|
+
|
|
48
|
+
Delete all SYN Protection filters for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ut={command:`bulk-delete`,describe:`Delete all SYN Protection filters.`,builder:lt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection filters bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
49
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(ct,{account_id:l}));o(u,{successLabel:`Deleted`})})};var w={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`,body:`json`};function dt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters create
|
|
50
|
+
|
|
51
|
+
Create a SYN Protection filter for an account.`).option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const ft={command:`create`,describe:`Create a SYN Protection filter.`,builder:dt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection filters create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({expression:m(e.expression,`expression`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(w,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.expression===void 0&&(e.expression=await h(`expression`,`The filter expression.`));let u=p({expression:m(e.expression,`expression`,`text`)}),f=await c(`Creating`,async()=>n.send(w,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var pt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t.filter_id}`};function mt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters delete <filter-id>
|
|
52
|
+
|
|
53
|
+
Delete a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ht={command:`delete <filter-id>`,describe:`Delete SYN Protection filter.`,builder:mt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection filters delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection filters delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
54
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(pt,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Deleted`})})};var gt={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t.filter_id}`};function _t(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters get <filter-id>
|
|
55
|
+
|
|
56
|
+
Get a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`get <filter-id>`,describe:`Get SYN Protection filter.`,builder:_t,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection filters get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(gt,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Loaded`})})};var yt={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`,query:[`mode`,`page`,`per_page`,`order`,`direction`],joined:[`mode`,`page`,`per_page`,`order`,`direction`]};function bt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters list
|
|
57
|
+
|
|
58
|
+
List all SYN Protection filters for an account.`).option(`filter-mode`,{type:`string`,description:`The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'.`}).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xt={command:`list`,describe:`List all SYN Protection filters.`,builder:bt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection filters list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={mode:e[`filter-mode`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(yt,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var T={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t.filter_id}`,body:`json`};function St(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters update <filter-id>
|
|
59
|
+
|
|
60
|
+
Update a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const Ct={command:`update <filter-id>`,describe:`Update SYN Protection filter.`,builder:St,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection filters update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection filters update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({expression:m(e.expression,`expression`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(T,{body:t,account_id:l,filter_id:e[`filter-id`]}));o(r,{successLabel:`Updated`});return}let u=p({expression:m(e.expression,`expression`,`text`)}),f=await c(`Updating`,async()=>n.send(T,{body:u,account_id:l,filter_id:e[`filter-id`]}));o(f,{successLabel:`Updated`})})},wt={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters`,builder:e=>e.command(ut).command(ft).command(ht).command(vt).command(xt).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Tt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules`};function Et(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules bulk-delete
|
|
61
|
+
|
|
62
|
+
Delete all SYN Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Dt={command:`bulk-delete`,describe:`Delete all SYN Protection rules.`,builder:Et,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection rules bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
63
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Tt,{account_id:l}));o(u,{successLabel:`Deleted`})})};var E={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules`,body:`json`};function Ot(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules create
|
|
64
|
+
|
|
65
|
+
Create a SYN Protection rule for an account.`).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The type of mitigation. Must be one of 'challenge' or 'retransmit'. Optional. Defaults to 'challenge'.`}).option(`name`,{type:`string`,description:`The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new SYN Protection rule to add.`})}const kt={command:`create`,describe:`Create SYN Protection rule.`,builder:Ot,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection rules create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:m(e[`mitigation-type`],`mitigation-type`,`text`),name:m(e.name,`name`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:m(e.scope,`scope`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(E,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`burst-sensitivity`]===void 0&&(e[`burst-sensitivity`]=await h(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),e[`rate-sensitivity`]===void 0&&(e[`rate-sensitivity`]=await h(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.scope===void 0&&(e.scope=await h(`scope`,`The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let u=p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:m(e[`mitigation-type`],`mitigation-type`,`text`),name:m(e.name,`name`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:m(e.scope,`scope`,`text`)}),f=await c(`Creating`,async()=>n.send(E,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var At={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t.rule_id}`};function jt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules delete <rule-id>
|
|
66
|
+
|
|
67
|
+
Delete a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Mt={command:`delete <rule-id>`,describe:`Delete SYN Protection rule.`,builder:jt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
68
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(At,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Deleted`})})};var Nt={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t.rule_id}`};function Pt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules get <rule-id>
|
|
69
|
+
|
|
70
|
+
Get a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ft={command:`get <rule-id>`,describe:`Get SYN Protection rule.`,builder:Pt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Nt,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Loaded`})})};var It={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules`,query:[`page`,`per_page`,`order`,`direction`],joined:[`page`,`per_page`,`order`,`direction`]};function Lt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules list
|
|
71
|
+
|
|
72
|
+
List all SYN Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`list`,describe:`List all SYN Protection rules.`,builder:Lt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(It,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var D={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t.rule_id}`,body:`json`};function zt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules update <rule-id>
|
|
73
|
+
|
|
74
|
+
Update a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The new mitigation type. Optional. Must be one of 'challenge' or 'retransmit'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The fields to update on the SYN Protection rule.`})}const Bt={command:`update <rule-id>`,describe:`Update SYN Protection rule.`,builder:zt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs syn protection rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs syn protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:m(e[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(D,{body:t,account_id:l,rule_id:e[`rule-id`]}));o(r,{successLabel:`Updated`});return}let u=p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:m(e[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}),f=await c(`Updating`,async()=>n.send(D,{body:u,account_id:l,rule_id:e[`rule-id`]}));o(f,{successLabel:`Updated`})})},Vt={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules`,builder:e=>e.command(Dt).command(kt).command(Mt).command(Ft).command(Rt).command(Bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ht={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.syn.protection`,builder:e=>e.command(wt).command(Vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ut={command:`syn`,describe:`Operations for advanced-tcp-protection.configs.syn`,builder:e=>e.command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Wt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`};function Gt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters bulk-delete
|
|
75
|
+
|
|
76
|
+
Delete all TCP Flow Protection filters for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Kt={command:`bulk-delete`,describe:`Delete all TCP Flow Protection filters.`,builder:Gt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
77
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Wt,{account_id:l}));o(u,{successLabel:`Deleted`})})};var O={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,body:`json`};function qt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters create
|
|
78
|
+
|
|
79
|
+
Create a TCP Flow Protection filter for an account.`).option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const Jt={command:`create`,describe:`Create a TCP Flow Protection filter.`,builder:qt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({expression:m(e.expression,`expression`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(O,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.expression===void 0&&(e.expression=await h(`expression`,`The filter expression.`));let u=p({expression:m(e.expression,`expression`,`text`)}),f=await c(`Creating`,async()=>n.send(O,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Yt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t.filter_id}`};function Xt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters delete <filter-id>
|
|
80
|
+
|
|
81
|
+
Delete a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Zt={command:`delete <filter-id>`,describe:`Delete TCP Flow Protection filter.`,builder:Xt,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
82
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Yt,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Deleted`})})};var Qt={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t.filter_id}`};function $t(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters get <filter-id>
|
|
83
|
+
|
|
84
|
+
Get a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const en={command:`get <filter-id>`,describe:`Get TCP Flow Protection filter.`,builder:$t,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Qt,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Loaded`})})};var tn={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,query:[`mode`,`page`,`per_page`,`order`,`direction`],joined:[`mode`,`page`,`per_page`,`order`,`direction`]};function nn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters list
|
|
85
|
+
|
|
86
|
+
List all TCP Flow Protection filters for an account.`).option(`filter-mode`,{type:`string`,description:`The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'.`}).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rn={command:`list`,describe:`List all TCP Flow Protection filters.`,builder:nn,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={mode:e[`filter-mode`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(tn,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var k={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t.filter_id}`,body:`json`};function an(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters update <filter-id>
|
|
87
|
+
|
|
88
|
+
Update a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const on={command:`update <filter-id>`,describe:`Update TCP Flow Protection filter.`,builder:an,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({expression:m(e.expression,`expression`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(k,{body:t,account_id:l,filter_id:e[`filter-id`]}));o(r,{successLabel:`Updated`});return}let u=p({expression:m(e.expression,`expression`,`text`)}),f=await c(`Updating`,async()=>n.send(k,{body:u,account_id:l,filter_id:e[`filter-id`]}));o(f,{successLabel:`Updated`})})},sn={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters`,builder:e=>e.command(Kt).command(Jt).command(Zt).command(en).command(rn).command(on).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var cn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`};function ln(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules bulk-delete
|
|
89
|
+
|
|
90
|
+
Delete all TCP Flow Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const un={command:`bulk-delete`,describe:`Delete all TCP Flow Protection rules.`,builder:ln,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
91
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(cn,{account_id:l}));o(u,{successLabel:`Deleted`})})};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,body:`json`};function dn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules create
|
|
92
|
+
|
|
93
|
+
Create a TCP Flow Protection rule for an account.`).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the TCP Flow Protection rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new TCP Flow Protection rule.`})}const fn={command:`create`,describe:`Create TCP Flow Protection rule.`,builder:dn,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:m(e.name,`name`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:m(e.scope,`scope`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(A,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`burst-sensitivity`]===void 0&&(e[`burst-sensitivity`]=await h(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),e[`rate-sensitivity`]===void 0&&(e[`rate-sensitivity`]=await h(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.scope===void 0&&(e.scope=await h(`scope`,`The scope for the TCP Flow Protection rule.`));let u=p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:m(e.name,`name`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:m(e.scope,`scope`,`text`)}),f=await c(`Creating`,async()=>n.send(A,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var pn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t.rule_id}`};function mn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules delete <rule-id>
|
|
94
|
+
|
|
95
|
+
Delete a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const hn={command:`delete <rule-id>`,describe:`Delete TCP Flow Protection rule.`,builder:mn,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
96
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(pn,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Deleted`})})};var gn={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t.rule_id}`};function _n(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules get <rule-id>
|
|
97
|
+
|
|
98
|
+
Get a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vn={command:`get <rule-id>`,describe:`Get TCP Flow Protection rule.`,builder:_n,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(gn,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Loaded`})})};var yn={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,query:[`page`,`per_page`,`order`,`direction`],joined:[`page`,`per_page`,`order`,`direction`]};function bn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules list
|
|
99
|
+
|
|
100
|
+
List all TCP Flow Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xn={command:`list`,describe:`List all TCP Flow Protection rules.`,builder:bn,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(yn,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var j={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t.rule_id}`,body:`json`};function Sn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules update <rule-id>
|
|
101
|
+
|
|
102
|
+
Update a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the TCP Flow Protection rule.`})}const Cn={command:`update <rule-id>`,describe:`Update TCP Flow Protection rule.`,builder:Sn,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(j,{body:t,account_id:l,rule_id:e[`rule-id`]}));o(r,{successLabel:`Updated`});return}let u=p({burst_sensitivity:m(e[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:m(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}),f=await c(`Updating`,async()=>n.send(j,{body:u,account_id:l,rule_id:e[`rule-id`]}));o(f,{successLabel:`Updated`})})},wn={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules`,builder:e=>e.command(un).command(fn).command(hn).command(vn).command(xn).command(Cn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Tn={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection`,builder:e=>e.command(sn).command(wn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},En={command:`flow`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow`,builder:e=>e.command(Tn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Dn={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`};function On(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status get
|
|
103
|
+
|
|
104
|
+
Get the protection status of the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kn={command:`get`,describe:`Get protection status.`,builder:On,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp protection status get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp protection status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_protection_status`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Dn,{account_id:l}));o(u,{successLabel:`Loaded`})})};var M={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`,body:`json`};function An(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status update
|
|
105
|
+
|
|
106
|
+
Update the protection status of the account.`).option(`enabled`,{type:`boolean`,description:`Enables or disables protection.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The update to apply to the protection status.`})}const jn={command:`update`,describe:`Update protection status.`,builder:An,handler:async e=>l({command:`magic-transit advanced-tcp-protection configs tcp protection status update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit advanced-tcp-protection configs tcp protection status update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_protection_status`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(M,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:e.enabled}),f=await c(`Updating`,async()=>n.send(M,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})},Mn={command:`status`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection.status`,builder:e=>e.command(kn).command(jn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Nn={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection`,builder:e=>e.command(Mn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Pn={command:`tcp`,describe:`Operations for advanced-tcp-protection.configs.tcp`,builder:e=>e.command(En).command(Nn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fn={command:`configs`,describe:`Operations for advanced-tcp-protection.configs`,builder:e=>e.command(Be).command(st).command(Ut).command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},In={command:`advanced-tcp-protection`,describe:`Advanced Tcp Protection operations`,builder:e=>e.command(Fn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var N={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/apps`,body:`json`};function Ln(e){return e.usage(`$0 magic-transit apps create
|
|
107
|
+
|
|
108
|
+
Creates a new App for an account`).option(`hostnames`,{type:`string`,array:!0,description:`FQDNs to associate with traffic decisions.`}).option(`name`,{type:`string`,description:`Display name for the app.`}).option(`type`,{type:`string`,description:`Category of the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Rn={command:`create`,describe:`Create a new App`,builder:Ln,handler:async e=>l({command:`magic-transit apps create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({hostnames:e.hostnames,name:m(e.name,`name`,`text`),type:m(e.type,`type`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(N,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`Display name for the app.`)),e.type===void 0&&(e.type=await h(`type`,`Category of the app.`));let u=p({hostnames:e.hostnames,name:m(e.name,`name`,`text`),type:m(e.type,`type`,`text`)}),f=await c(`Creating`,async()=>n.send(N,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var zn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/apps/${t.account_app_id}`};function Bn(e){return e.usage(`$0 magic-transit apps delete <account-app-id>
|
|
109
|
+
|
|
110
|
+
Deletes specific Account App.`).positional(`account-app-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Vn={command:`delete <account-app-id>`,describe:`Delete Account App`,builder:Bn,handler:async e=>l({command:`magic-transit apps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/apps/${e[`account-app-id`]==null?`<account-app-id>`:encodeURIComponent(String(e[`account-app-id`]))}`,pathParams:{"account-app-id":String(e[`account-app-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
111
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(zn,{account_id:l,account_app_id:e[`account-app-id`]}));o(u,{successLabel:`Deleted`})})};var Hn={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/apps`};function Un(e){return e.usage(`$0 magic-transit apps list
|
|
112
|
+
|
|
113
|
+
Lists Apps associated with an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wn={command:`list`,describe:`List Apps`,builder:Un,handler:async e=>l({command:`magic-transit apps list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Hn,{account_id:l}));o(u,{successLabel:`Loaded`})})};var P={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/apps/${t.account_app_id}`,body:`json`};function Gn(e){return e.usage(`$0 magic-transit apps update <account-app-id>
|
|
114
|
+
|
|
115
|
+
Updates an Account App`).positional(`account-app-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`FQDNs to associate with traffic decisions.`}).option(`name`,{type:`string`,description:`Display name for the app.`}).option(`type`,{type:`string`,description:`Category of the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Kn={command:`update <account-app-id>`,describe:`Update an App`,builder:Gn,handler:async e=>l({command:`magic-transit apps update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/apps/${e[`account-app-id`]==null?`<account-app-id>`:encodeURIComponent(String(e[`account-app-id`]))}`,pathParams:{"account-app-id":String(e[`account-app-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({hostnames:e.hostnames,name:m(e.name,`name`,`text`),type:m(e.type,`type`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(P,{body:t,account_id:l,account_app_id:e[`account-app-id`]}));o(r,{successLabel:`Updated`});return}let u=p({hostnames:e.hostnames,name:m(e.name,`name`,`text`),type:m(e.type,`type`,`text`)}),f=await c(`Updating`,async()=>n.send(P,{body:u,account_id:l,account_app_id:e[`account-app-id`]}));o(f,{successLabel:`Updated`})})},qn={command:`apps`,describe:`Application-aware traffic policies for Magic WAN that steer traffic by app type`,builder:e=>e.command(Rn).command(Vn).command(Wn).command(Kn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles`,body:`json`};function Jn(e){return e.usage(`$0 magic-transit bgp-filter-profiles create
|
|
116
|
+
|
|
117
|
+
Creates a new BGP filter profile for an account.`).option(`description`,{type:`string`,description:`Description of the filter profile`,default:``}).option(`match-action`,{type:`string`,description:`Action to take when a route matches one of the targets in this profile`,choices:[`allow`,`deny`]}).coerce(`match-action`,e=>m(e,`match-action`,`text`)).option(`name`,{type:`string`,description:`Friendly name for the filter profile`}).option(`targets`,{type:`string`,array:!0,description:`List of CIDR prefixes. Each entry may carry an optional suffix that specifies which prefix lengths to match relative to the prefix length N: '{X,Y}' matches prefix lengths in the inclusive range [X, Y] where N <= X <= Y <= max (max is 32 for IPv4, 128 for IPv6), '{X}' matches exactly length X (equivalent to {X,X}), '+' is shorthand for {N, max} (the prefix and all more-specific subnets, including at length N itself; valid even when N is the maximum length). Omit the suffix to match the prefix exactly at length N.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Yn={command:`create`,describe:`Create BGP Filter Profile`,builder:Jn,handler:async e=>l({command:`magic-transit bgp-filter-profiles create`,classification:{safeFlags:[`match-action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit bgp-filter-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),match_action:e[`match-action`],name:m(e.name,`name`,`text`),targets:e.targets}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(F,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e[`match-action`]===void 0&&(e[`match-action`]=await g(`match-action`,`Action to take when a route matches one of the targets in this profile`,[`allow`,`deny`])),e.name===void 0&&(e.name=await h(`name`,`Friendly name for the filter profile`)),e.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let u=p({description:m(e.description,`description`,`text`),match_action:e[`match-action`],name:m(e.name,`name`,`text`),targets:e.targets}),f=await c(`Creating`,async()=>n.send(F,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Xn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles/${t.profile_id}`};function Zn(e){return e.usage(`$0 magic-transit bgp-filter-profiles delete <profile-id>
|
|
118
|
+
|
|
119
|
+
Deletes a BGP filter profile.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qn={command:`delete <profile-id>`,describe:`Delete BGP Filter Profile`,builder:Zn,handler:async e=>l({command:`magic-transit bgp-filter-profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit bgp-filter-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/bgp/filter_profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
120
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Xn,{account_id:l,profile_id:e[`profile-id`]}));o(u,{successLabel:`Deleted`})})};var $n={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles/${t.profile_id}`};function er(e){return e.usage(`$0 magic-transit bgp-filter-profiles get <profile-id>
|
|
121
|
+
|
|
122
|
+
Gets a specific BGP filter profile for an account.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tr={command:`get <profile-id>`,describe:`Get BGP Filter Profile`,builder:er,handler:async e=>l({command:`magic-transit bgp-filter-profiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit bgp-filter-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/bgp/filter_profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send($n,{account_id:l,profile_id:e[`profile-id`]}));o(u,{successLabel:`Loaded`})})};var nr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles`};function rr(e){return e.usage(`$0 magic-transit bgp-filter-profiles list
|
|
123
|
+
|
|
124
|
+
Lists all BGP filter profiles for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ir={command:`list`,describe:`List BGP Filter Profiles`,builder:rr,handler:async e=>l({command:`magic-transit bgp-filter-profiles list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit bgp-filter-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(nr,{account_id:l}));o(u,{successLabel:`Loaded`})})};var I={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles/${t.profile_id}`,body:`json`};function ar(e){return e.usage(`$0 magic-transit bgp-filter-profiles update <profile-id>
|
|
125
|
+
|
|
126
|
+
Updates a BGP filter profile. Omitted properties are left unchanged. To clear an existing description send \`description: ""\`.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the filter profile`}).option(`match-action`,{type:`string`,description:`Action to take when a route matches one of the targets in this profile`,choices:[`allow`,`deny`]}).coerce(`match-action`,e=>m(e,`match-action`,`text`)).option(`name`,{type:`string`,description:`Friendly name for the filter profile`}).option(`targets`,{type:`string`,array:!0,description:`List of CIDR prefixes. Each entry may carry an optional suffix that specifies which prefix lengths to match relative to the prefix length N: '{X,Y}' matches prefix lengths in the inclusive range [X, Y] where N <= X <= Y <= max (max is 32 for IPv4, 128 for IPv6), '{X}' matches exactly length X (equivalent to {X,X}), '+' is shorthand for {N, max} (the prefix and all more-specific subnets, including at length N itself; valid even when N is the maximum length). Omit the suffix to match the prefix exactly at length N.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:'Partial update for a BGP filter profile. At least one property must be provided; omitted properties are left unchanged. To clear an existing description send `description: ""`.'})}const or={command:`update <profile-id>`,describe:`Update BGP Filter Profile`,builder:ar,handler:async e=>l({command:`magic-transit bgp-filter-profiles update`,classification:{safeFlags:[`match-action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit bgp-filter-profiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/bgp/filter_profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),match_action:e[`match-action`],name:m(e.name,`name`,`text`),targets:e.targets}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(I,{body:t,account_id:l,profile_id:e[`profile-id`]}));o(r,{successLabel:`Updated`});return}let u=p({description:m(e.description,`description`,`text`),match_action:e[`match-action`],name:m(e.name,`name`,`text`),targets:e.targets}),f=await c(`Updating`,async()=>n.send(I,{body:u,account_id:l,profile_id:e[`profile-id`]}));o(f,{successLabel:`Updated`})})},sr={command:`bgp-filter-profiles`,describe:`BGP filter profiles for controlling which routes are allowed or denied on Magic Transit tunnels`,builder:e=>e.command(Yn).command(Qn).command(tr).command(ir).command(or).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var cr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/bgp/settings`};function lr(e){return e.usage(`$0 magic-transit bgp-settings get
|
|
127
|
+
|
|
128
|
+
Gets the BGP settings for an account, including the default ASN and redistribution configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ur={command:`get`,describe:`Get BGP Settings`,builder:lr,handler:async e=>l({command:`magic-transit bgp-settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit bgp-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(cr,{account_id:l}));o(u,{successLabel:`Loaded`})})};var L={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/bgp/settings`,body:`json`};function dr(e){return e.usage(`$0 magic-transit bgp-settings update
|
|
129
|
+
|
|
130
|
+
Modifies the BGP settings for an account, including the default ASN and redistribution configuration.`).option(`cloudflare-asn`,{type:`number`,description:`Route advertisements from Cloudflare to ramps in this account will use this ASN.`}).option(`redistribute-static:wan`,{type:`boolean`,description:`Redistribute static WAN routes into BGP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fr={command:`update`,describe:`Update BGP Settings`,builder:dr,handler:async e=>l({command:`magic-transit bgp-settings update`,classification:{safeFlags:[`redistribute-static:wan`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit bgp-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({cloudflare_asn:e[`cloudflare-asn`],redistribute:{"static:wan":e[`redistribute-static:wan`]}}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(L,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}let u=p({cloudflare_asn:e[`cloudflare-asn`],redistribute:{"static:wan":e[`redistribute-static:wan`]}}),f=await c(`Updating`,async()=>n.send(L,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})},pr={command:`bgp-settings`,describe:`BGP settings for controlling default ASN and route redistribution on Magic Transit tunnels`,builder:e=>e.command(ur).command(fr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mr(e){return e.usage(`$0 magic-transit cf-interconnects bulk-update
|
|
131
|
+
|
|
132
|
+
Updates multiple interconnects associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const hr={command:`bulk-update`,describe:`Update multiple interconnects`,builder:mr,handler:async e=>l({command:`magic-transit cf-interconnects bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit cf-interconnects bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let u=await r(e),f=e.local?t:await a();if(e.accountId=f,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${f}/magic/cf_interconnects`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let p=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${f}/magic/cf_interconnects`,{headers:Object.keys(l).length>0?l:void 0}));o(p,{successLabel:`Updated`})})};function gr(e){return e.usage(`$0 magic-transit cf-interconnects get <cf-interconnect-id>
|
|
133
|
+
|
|
134
|
+
Lists details for a specific interconnect.`).positional(`cf-interconnect-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _r={command:`get <cf-interconnect-id>`,describe:`List interconnect Details`,builder:gr,handler:async e=>l({command:`magic-transit cf-interconnects get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit cf-interconnects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf_interconnects/${e[`cf-interconnect-id`]==null?`<cf-interconnect-id>`:encodeURIComponent(String(e[`cf-interconnect-id`]))}`,pathParams:{"cf-interconnect-id":String(e[`cf-interconnect-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/cf_interconnects/${encodeURIComponent(String(e[`cf-interconnect-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function vr(e){return e.usage(`$0 magic-transit cf-interconnects list
|
|
135
|
+
|
|
136
|
+
Lists interconnects associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yr={command:`list`,describe:`List interconnects`,builder:vr,handler:async e=>l({command:`magic-transit cf-interconnects list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let e=await i();s({command:`cf magic-transit cf-interconnects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/cf_interconnects`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function br(e){return e.usage(`$0 magic-transit cf-interconnects update <cf-interconnect-id>
|
|
137
|
+
|
|
138
|
+
Updates a specific interconnect associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`cf-interconnect-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`bgp-as-no`,{type:`number`,description:`Deprecated. Use customer_asn.`}).option(`bgp-cloudflare-endpoint`,{type:`string`,description:`Read-only for v1.5; derived from interface_address.`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session.`}).option(`bgp-customer-endpoint`,{type:`string`,description:`Read-only for v1.5; derived from interface_address.`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
139
|
+
|
|
140
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
141
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
142
|
+
misconfiguration, not for defending against malicious attacks.
|
|
143
|
+
|
|
144
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
145
|
+
character:
|
|
146
|
+
|
|
147
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
148
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
149
|
+
|
|
150
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
151
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
152
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
153
|
+
these disallowed characters will be rejected.`}).option(`description`,{type:`string`,description:`An optional description of the interconnect.`}).option(`gre-cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>m(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the interconnect and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the interconnect.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>m(e,`health-check-direction`,`text`)).option(`health-check-source`,{type:`string`,description:"The source IPv4 address used for bidirectional health checks. Supported only for version 1.5 interconnects. It is required when `direction` is `bidirectional` and must be omitted (and is cleared) when `direction` is `unidirectional`. The address must be within RFC1918 space, the approved link-local range 169.254.240.0/20, or the Cloudflare reserved range 198.41.199.224/27."}).option(`interface-address`,{type:`string`,description:`The IPv4 interface address for the interconnect. For MPLS Interconnects,
|
|
154
|
+
use a /30 or /31 prefix. For GRE Interconnects, a /30 or /31 prefix
|
|
155
|
+
may be used. Version 1.5 interconnects require a /31 prefix and may
|
|
156
|
+
also use a prefix from the account's authorized prefixes; otherwise,
|
|
157
|
+
select the subnet from RFC 1918 or the approved link-local ranges.
|
|
158
|
+
`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576.`}).option(`name`,{type:`string`,description:`The name of the interconnect. The name cannot share a name with other tunnels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xr={command:`update <cf-interconnect-id>`,describe:`Update interconnect`,builder:br,handler:async e=>l({command:`magic-transit cf-interconnects update`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit cf-interconnects update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf_interconnects/${e[`cf-interconnect-id`]==null?`<cf-interconnect-id>`:encodeURIComponent(String(e[`cf-interconnect-id`]))}`,pathParams:{"cf-interconnect-id":String(e[`cf-interconnect-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({automatic_return_routing:e[`automatic-return-routing`],bgp:{as_no:e[`bgp-as-no`],cloudflare_endpoint:m(e[`bgp-cloudflare-endpoint`],`bgp-cloudflare-endpoint`,`text`),customer_asn:e[`bgp-customer-asn`],customer_endpoint:m(e[`bgp-customer-endpoint`],`bgp-customer-endpoint`,`text`),export_filter_id:m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},description:m(e.description,`description`,`text`),gre:{cloudflare_endpoint:m(e[`gre-cloudflare-endpoint`],`gre-cloudflare-endpoint`,`text`)},health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`],source:m(e[`health-check-source`],`health-check-source`,`text`)},interface_address:m(e[`interface-address`],`interface-address`,`text`),interface_address6:m(e[`interface-address6`],`interface-address6`,`text`),mtu:e.mtu,name:m(e.name,`name`,`text`)}):d(e.body)});return}let f=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${h}/magic/cf_interconnects/${encodeURIComponent(String(e[`cf-interconnect-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let g={};e[`automatic-return-routing`]!==void 0&&u(g,[`automatic_return_routing`],e[`automatic-return-routing`]),e[`bgp-as-no`]!==void 0&&u(g,[`bgp`,`as_no`],e[`bgp-as-no`]),e[`bgp-cloudflare-endpoint`]!==void 0&&u(g,[`bgp`,`cloudflare_endpoint`],m(e[`bgp-cloudflare-endpoint`],`bgp-cloudflare-endpoint`,`text`)),e[`bgp-customer-asn`]!==void 0&&u(g,[`bgp`,`customer_asn`],e[`bgp-customer-asn`]),e[`bgp-customer-endpoint`]!==void 0&&u(g,[`bgp`,`customer_endpoint`],m(e[`bgp-customer-endpoint`],`bgp-customer-endpoint`,`text`)),e[`bgp-export-filter-id`]!==void 0&&u(g,[`bgp`,`export_filter_id`],m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),e[`bgp-extra-prefixes`]!==void 0&&u(g,[`bgp`,`extra_prefixes`],e[`bgp-extra-prefixes`]),e[`bgp-import-filter-id`]!==void 0&&u(g,[`bgp`,`import_filter_id`],m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(g,[`bgp`,`md5_key`],m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e.description!==void 0&&u(g,[`description`],m(e.description,`description`,`text`)),e[`gre-cloudflare-endpoint`]!==void 0&&u(g,[`gre`,`cloudflare_endpoint`],m(e[`gre-cloudflare-endpoint`],`gre-cloudflare-endpoint`,`text`)),e[`health-check-enabled`]!==void 0&&u(g,[`health_check`,`enabled`],e[`health-check-enabled`]),e[`health-check-rate`]!==void 0&&u(g,[`health_check`,`rate`],e[`health-check-rate`]),e[`health-check-target-saved`]!==void 0&&u(g,[`health_check`,`target`,`saved`],m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)),e[`health-check-type`]!==void 0&&u(g,[`health_check`,`type`],e[`health-check-type`]),e[`health-check-direction`]!==void 0&&u(g,[`health_check`,`direction`],e[`health-check-direction`]),e[`health-check-source`]!==void 0&&u(g,[`health_check`,`source`],m(e[`health-check-source`],`health-check-source`,`text`)),e[`interface-address`]!==void 0&&u(g,[`interface_address`],m(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(g,[`interface_address6`],m(e[`interface-address6`],`interface-address6`,`text`)),e.mtu!==void 0&&u(g,[`mtu`],e.mtu),e.name!==void 0&&u(g,[`name`],m(e.name,`name`,`text`));let _=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${h}/magic/cf_interconnects/${encodeURIComponent(String(e[`cf-interconnect-id`]))}`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Updated`})})},Sr={command:`cf-interconnects`,describe:`Cloudflare Network Interconnect (CNI) links for direct physical or virtual peering`,builder:e=>e.command(hr).command(_r).command(yr).command(xr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Cr={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites`,body:`json`};function wr(e){return e.usage(`$0 magic-transit cf1-sites create
|
|
159
|
+
|
|
160
|
+
Creates new CF1 Sites for an account. Each site must have a unique name within the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tr={command:`create`,describe:`Create CF1 Sites`,builder:wr,handler:async e=>l({command:`magic-transit cf1-sites create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Cr,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var Er={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}`};function Dr(e){return e.usage(`$0 magic-transit cf1-sites delete <cf1-site-id>
|
|
161
|
+
|
|
162
|
+
Deletes a specific CF1 Site for an account.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Or={command:`delete <cf1-site-id>`,describe:`Delete CF1 Site`,builder:Dr,handler:async e=>l({command:`magic-transit cf1-sites delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
163
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Er,{account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(u,{successLabel:`Deleted`})})};var kr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}`};function Ar(e){return e.usage(`$0 magic-transit cf1-sites get <cf1-site-id>
|
|
164
|
+
|
|
165
|
+
Gets a specific CF1 Site for an account.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jr={command:`get <cf1-site-id>`,describe:`Get CF1 Site`,builder:Ar,handler:async e=>l({command:`magic-transit cf1-sites get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(kr,{account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(u,{successLabel:`Loaded`})})};var Mr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites`};function Nr(e){return e.usage(`$0 magic-transit cf1-sites list
|
|
166
|
+
|
|
167
|
+
Lists CF1 Sites associated with an account. A CF1 Site represents a physical customer network location with optional geographic coordinates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pr={command:`list`,describe:`List CF1 Sites`,builder:Nr,handler:async e=>l({command:`magic-transit cf1-sites list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit cf1-sites list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Mr,{account_id:l}));o(u,{successLabel:`Loaded`})})};var Fr={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps`,body:`json`};function Ir(e){return e.usage(`$0 magic-transit cf1-sites ramps create <cf1-site-id>
|
|
168
|
+
|
|
169
|
+
Creates ramps (network connections) for a CF1 Site.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Lr={command:`create <cf1-site-id>`,describe:`Create CF1 Site Ramps`,builder:Ir,handler:async e=>l({command:`magic-transit cf1-sites ramps create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}/ramps`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Fr,{body:t,account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var Rr={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps/${t.ramp_id}`};function zr(e){return e.usage(`$0 magic-transit cf1-sites ramps delete <ramp-id>
|
|
170
|
+
|
|
171
|
+
Deletes a specific ramp from a CF1 Site.`).positional(`ramp-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Br={command:`delete <ramp-id>`,describe:`Delete CF1 Site Ramp`,builder:zr,handler:async e=>l({command:`magic-transit cf1-sites ramps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}/ramps/${e[`ramp-id`]==null?`<ramp-id>`:encodeURIComponent(String(e[`ramp-id`]))}`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``),"ramp-id":String(e[`ramp-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
172
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Rr,{account_id:l,cf1_site_id:e[`cf1-site-id`],ramp_id:e[`ramp-id`]}));o(u,{successLabel:`Deleted`})})};var Vr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps/${t.ramp_id}`};function Hr(e){return e.usage(`$0 magic-transit cf1-sites ramps get <ramp-id>
|
|
173
|
+
|
|
174
|
+
Gets a specific ramp for a CF1 Site.`).positional(`ramp-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ur={command:`get <ramp-id>`,describe:`Get CF1 Site Ramp`,builder:Hr,handler:async e=>l({command:`magic-transit cf1-sites ramps get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}/ramps/${e[`ramp-id`]==null?`<ramp-id>`:encodeURIComponent(String(e[`ramp-id`]))}`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``),"ramp-id":String(e[`ramp-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Vr,{account_id:l,cf1_site_id:e[`cf1-site-id`],ramp_id:e[`ramp-id`]}));o(u,{successLabel:`Loaded`})})};var Wr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps`};function Gr(e){return e.usage(`$0 magic-transit cf1-sites ramps list
|
|
175
|
+
|
|
176
|
+
Lists ramps (network connections) associated with a CF1 Site. Ramps represent GRE tunnels, IPsec tunnels, interconnects, or MCONN links.`).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kr={command:`list`,describe:`List CF1 Site Ramps`,builder:Gr,handler:async e=>l({command:`magic-transit cf1-sites ramps list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}/ramps`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Wr,{account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(u,{successLabel:`Loaded`})})},qr={command:`ramps`,describe:`Operations for cf1-sites.ramps`,builder:e=>e.command(Lr).command(Br).command(Ur).command(Kr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var R={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}`,body:`json`};function Jr(e){return e.usage(`$0 magic-transit cf1-sites update <cf1-site-id>
|
|
177
|
+
|
|
178
|
+
Partially updates a specific CF1 Site for an account. Only the fields included in the request body are modified; omitted fields retain their existing values.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`A human-provided description of the CF1 Site.`}).option(`location-lat`,{type:`number`,description:`Latitude of the CF1 Site.`}).option(`location-long`,{type:`number`,description:`Longitude of the CF1 Site.`}).option(`location-name`,{type:`string`,description:`Name of nearest town, city, or village.`}).option(`name`,{type:`string`,description:`A human-provided name describing the CF1 Site that should be unique within the account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update payload for a CF1 Site. All properties are optional; only fields supplied in the request body are modified.`})}const Yr={command:`update <cf1-site-id>`,describe:`Update CF1 Site`,builder:Jr,handler:async e=>l({command:`magic-transit cf1-sites update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit cf1-sites update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/cf1_sites/${e[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(e[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(e[`cf1-site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),location:{lat:e[`location-lat`],long:e[`location-long`],name:m(e[`location-name`],`location-name`,`text`)},name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(R,{body:t,account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(r,{successLabel:`Updated`});return}let u=p({description:m(e.description,`description`,`text`),location:{lat:e[`location-lat`],long:e[`location-long`],name:m(e[`location-name`],`location-name`,`text`)},name:m(e.name,`name`,`text`)}),f=await c(`Updating`,async()=>n.send(R,{body:u,account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(f,{successLabel:`Updated`})})},Xr={command:`cf1-sites`,describe:`Operations for cf1-sites`,builder:e=>e.command(Tr).command(Or).command(jr).command(Pr).command(Yr).command(qr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zr(e){return e.usage(`$0 magic-transit gre-tunnels bulk-update
|
|
179
|
+
|
|
180
|
+
Updates multiple GRE tunnels. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Qr={command:`bulk-update`,describe:`Update multiple GRE tunnels`,builder:Zr,handler:async e=>l({command:`magic-transit gre-tunnels bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit gre-tunnels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let u=await r(e),f=e.local?t:await a();if(e.accountId=f,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${f}/magic/gre_tunnels`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let p=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${f}/magic/gre_tunnels`,{headers:Object.keys(l).length>0?l:void 0}));o(p,{successLabel:`Updated`})})};function $r(e){return e.usage(`$0 magic-transit gre-tunnels create
|
|
181
|
+
|
|
182
|
+
Creates a new GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.",default:!1}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
183
|
+
|
|
184
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
185
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
186
|
+
misconfiguration, not for defending against malicious attacks.
|
|
187
|
+
|
|
188
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
189
|
+
character:
|
|
190
|
+
|
|
191
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
192
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
193
|
+
|
|
194
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
195
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
196
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
197
|
+
these disallowed characters will be rejected.`}).option(`cloudflare-gre-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel.`}).option(`customer-gre-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the GRE tunnel.`}).option(`description`,{type:`string`,description:`An optional description of the GRE tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>m(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>m(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.`,default:1476}).option(`name`,{type:`string`,description:`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`}).option(`ttl`,{type:`number`,description:`Time To Live (TTL) in number of hops of the GRE tunnel.`,default:64}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const ei={command:`create`,describe:`Create a GRE tunnel`,builder:$r,handler:async e=>l({command:`magic-transit gre-tunnels create`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit gre-tunnels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({automatic_return_routing:e[`automatic-return-routing`],bgp:{customer_asn:e[`bgp-customer-asn`],export_filter_id:m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_gre_endpoint:m(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`),customer_gre_endpoint:m(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`),description:m(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:m(e[`interface-address`],`interface-address`,`text`),interface_address6:m(e[`interface-address6`],`interface-address6`,`text`),mtu:e.mtu,name:m(e.name,`name`,`text`),ttl:e.ttl}):d(e.body)});return}let f=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${g}/magic/gre_tunnels`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}e[`cloudflare-gre-endpoint`]===void 0&&(e[`cloudflare-gre-endpoint`]=await h(`cloudflare-gre-endpoint`,`The IP address assigned to the Cloudflare side of the GRE tunnel.`)),e[`customer-gre-endpoint`]===void 0&&(e[`customer-gre-endpoint`]=await h(`customer-gre-endpoint`,`The IP address assigned to the customer side of the GRE tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await h(`interface-address`,`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`));let _={};e[`automatic-return-routing`]!==void 0&&u(_,[`automatic_return_routing`],e[`automatic-return-routing`]),e[`bgp-customer-asn`]!==void 0&&u(_,[`bgp`,`customer_asn`],e[`bgp-customer-asn`]),e[`bgp-export-filter-id`]!==void 0&&u(_,[`bgp`,`export_filter_id`],m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),e[`bgp-extra-prefixes`]!==void 0&&u(_,[`bgp`,`extra_prefixes`],e[`bgp-extra-prefixes`]),e[`bgp-import-filter-id`]!==void 0&&u(_,[`bgp`,`import_filter_id`],m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(_,[`bgp`,`md5_key`],m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e[`cloudflare-gre-endpoint`]!==void 0&&u(_,[`cloudflare_gre_endpoint`],m(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`)),e[`customer-gre-endpoint`]!==void 0&&u(_,[`customer_gre_endpoint`],m(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],m(e.description,`description`,`text`)),e[`health-check-enabled`]!==void 0&&u(_,[`health_check`,`enabled`],e[`health-check-enabled`]),e[`health-check-rate`]!==void 0&&u(_,[`health_check`,`rate`],e[`health-check-rate`]),e[`health-check-target-saved`]!==void 0&&u(_,[`health_check`,`target`,`saved`],m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)),e[`health-check-type`]!==void 0&&u(_,[`health_check`,`type`],e[`health-check-type`]),e[`health-check-direction`]!==void 0&&u(_,[`health_check`,`direction`],e[`health-check-direction`]),e[`interface-address`]!==void 0&&u(_,[`interface_address`],m(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],m(e[`interface-address6`],`interface-address6`,`text`)),e.mtu!==void 0&&u(_,[`mtu`],e.mtu),e.name!==void 0&&u(_,[`name`],m(e.name,`name`,`text`)),e.ttl!==void 0&&u(_,[`ttl`],e.ttl);let v=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${g}/magic/gre_tunnels`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function ti(e){return e.usage(`$0 magic-transit gre-tunnels delete <gre-tunnel-id>
|
|
198
|
+
|
|
199
|
+
Disables and removes a specific static GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ni={command:`delete <gre-tunnel-id>`,describe:`Delete GRE Tunnel`,builder:ti,handler:async e=>l({command:`magic-transit gre-tunnels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit gre-tunnels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/gre_tunnels/${e[`gre-tunnel-id`]==null?`<gre-tunnel-id>`:encodeURIComponent(String(e[`gre-tunnel-id`]))}`,pathParams:{"gre-tunnel-id":String(e[`gre-tunnel-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
200
|
+
`);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(e[`gre-tunnel-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function ri(e){return e.usage(`$0 magic-transit gre-tunnels get <gre-tunnel-id>
|
|
201
|
+
|
|
202
|
+
Lists informtion for a specific GRE tunnel.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ii={command:`get <gre-tunnel-id>`,describe:`List GRE Tunnel Details`,builder:ri,handler:async e=>l({command:`magic-transit gre-tunnels get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit gre-tunnels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/gre_tunnels/${e[`gre-tunnel-id`]==null?`<gre-tunnel-id>`:encodeURIComponent(String(e[`gre-tunnel-id`]))}`,pathParams:{"gre-tunnel-id":String(e[`gre-tunnel-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(e[`gre-tunnel-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function ai(e){return e.usage(`$0 magic-transit gre-tunnels list
|
|
203
|
+
|
|
204
|
+
Lists GRE tunnels associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oi={command:`list`,describe:`List GRE tunnels`,builder:ai,handler:async e=>l({command:`magic-transit gre-tunnels list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let e=await i();s({command:`cf magic-transit gre-tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/gre_tunnels`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function si(e){return e.usage(`$0 magic-transit gre-tunnels update <gre-tunnel-id>
|
|
205
|
+
|
|
206
|
+
Updates a specific GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`cloudflare-gre-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel.`}).option(`customer-gre-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the GRE tunnel.`}).option(`description`,{type:`string`,description:`An optional description of the GRE tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>m(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>m(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.`}).option(`name`,{type:`string`,description:`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`}).option(`ttl`,{type:`number`,description:`Time To Live (TTL) in number of hops of the GRE tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ci={command:`update <gre-tunnel-id>`,describe:`Update GRE Tunnel`,builder:si,handler:async e=>l({command:`magic-transit gre-tunnels update`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit gre-tunnels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/gre_tunnels/${e[`gre-tunnel-id`]==null?`<gre-tunnel-id>`:encodeURIComponent(String(e[`gre-tunnel-id`]))}`,pathParams:{"gre-tunnel-id":String(e[`gre-tunnel-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({automatic_return_routing:e[`automatic-return-routing`],cloudflare_gre_endpoint:m(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`),customer_gre_endpoint:m(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`),description:m(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:m(e[`interface-address`],`interface-address`,`text`),interface_address6:m(e[`interface-address6`],`interface-address6`,`text`),mtu:e.mtu,name:m(e.name,`name`,`text`),ttl:e.ttl}):d(e.body)});return}let f=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${g}/magic/gre_tunnels/${encodeURIComponent(String(e[`gre-tunnel-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}e[`cloudflare-gre-endpoint`]===void 0&&(e[`cloudflare-gre-endpoint`]=await h(`cloudflare-gre-endpoint`,`The IP address assigned to the Cloudflare side of the GRE tunnel.`)),e[`customer-gre-endpoint`]===void 0&&(e[`customer-gre-endpoint`]=await h(`customer-gre-endpoint`,`The IP address assigned to the customer side of the GRE tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await h(`interface-address`,`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`));let _={};e[`automatic-return-routing`]!==void 0&&u(_,[`automatic_return_routing`],e[`automatic-return-routing`]),e[`cloudflare-gre-endpoint`]!==void 0&&u(_,[`cloudflare_gre_endpoint`],m(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`)),e[`customer-gre-endpoint`]!==void 0&&u(_,[`customer_gre_endpoint`],m(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],m(e.description,`description`,`text`)),e[`health-check-enabled`]!==void 0&&u(_,[`health_check`,`enabled`],e[`health-check-enabled`]),e[`health-check-rate`]!==void 0&&u(_,[`health_check`,`rate`],e[`health-check-rate`]),e[`health-check-target-saved`]!==void 0&&u(_,[`health_check`,`target`,`saved`],m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)),e[`health-check-type`]!==void 0&&u(_,[`health_check`,`type`],e[`health-check-type`]),e[`health-check-direction`]!==void 0&&u(_,[`health_check`,`direction`],e[`health-check-direction`]),e[`interface-address`]!==void 0&&u(_,[`interface_address`],m(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],m(e[`interface-address6`],`interface-address6`,`text`)),e.mtu!==void 0&&u(_,[`mtu`],e.mtu),e.name!==void 0&&u(_,[`name`],m(e.name,`name`,`text`)),e.ttl!==void 0&&u(_,[`ttl`],e.ttl);let v=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${g}/magic/gre_tunnels/${encodeURIComponent(String(e[`gre-tunnel-id`]))}`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Updated`})})},li={command:`gre-tunnels`,describe:`GRE tunnel endpoints that connect your network to Cloudflare for Magic Transit`,builder:e=>e.command(Qr).command(ei).command(ni).command(ii).command(oi).command(ci).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ui(e){return e.usage(`$0 magic-transit ipsec-tunnels bulk-update
|
|
207
|
+
|
|
208
|
+
Update multiple IPsec tunnels associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const di={command:`bulk-update`,describe:`Update multiple IPsec tunnels`,builder:ui,handler:async e=>l({command:`magic-transit ipsec-tunnels bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let u=await r(e),f=e.local?t:await a();if(e.accountId=f,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${f}/magic/ipsec_tunnels`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let p=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${f}/magic/ipsec_tunnels`,{headers:Object.keys(l).length>0?l:void 0}));o(p,{successLabel:`Updated`})})};function fi(e){return e.usage(`$0 magic-transit ipsec-tunnels create
|
|
209
|
+
|
|
210
|
+
Creates a new IPsec tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.",default:!1}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
211
|
+
|
|
212
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
213
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
214
|
+
misconfiguration, not for defending against malicious attacks.
|
|
215
|
+
|
|
216
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
217
|
+
character:
|
|
218
|
+
|
|
219
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
220
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
221
|
+
|
|
222
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
223
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
224
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
225
|
+
these disallowed characters will be rejected.`}).option(`cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the IPsec tunnel.`}).option(`custom-remote-identities-fqdn-id`,{type:`string`,description:`A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The
|
|
226
|
+
generated IKE IDs can still be used even if this custom value is specified.
|
|
227
|
+
|
|
228
|
+
Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
229
|
+
|
|
230
|
+
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
231
|
+
fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
|
|
232
|
+
cannot have the same cloudflare_endpoint.`}).option(`customer-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.`}).option(`description`,{type:`string`,description:`An optional description forthe IPsec tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>m(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>m(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`name`,{type:`string`,description:`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`}).option(`psk`,{type:`string`,description:`A randomly generated or provided string for use in the IPsec tunnel.`}).option(`replay-protection`,{type:`boolean`,description:"If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.",default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const pi={command:`create`,describe:`Create an IPsec tunnel`,builder:fi,handler:async e=>l({command:`magic-transit ipsec-tunnels create`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`replay-protection`,`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({automatic_return_routing:e[`automatic-return-routing`],bgp:{customer_asn:e[`bgp-customer-asn`],export_filter_id:m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_endpoint:m(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`),custom_remote_identities:{fqdn_id:m(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)},customer_endpoint:m(e[`customer-endpoint`],`customer-endpoint`,`text`),description:m(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:m(e[`interface-address`],`interface-address`,`text`),interface_address6:m(e[`interface-address6`],`interface-address6`,`text`),name:m(e.name,`name`,`text`),psk:m(e.psk,`psk`,`text`),replay_protection:e[`replay-protection`]}):d(e.body),sensitiveBodyPaths:[[`psk`]]});return}let f=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${g}/magic/ipsec_tunnels`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}e[`cloudflare-endpoint`]===void 0&&(e[`cloudflare-endpoint`]=await h(`cloudflare-endpoint`,`The IP address assigned to the Cloudflare side of the IPsec tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await h(`interface-address`,`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`));let _={};e[`automatic-return-routing`]!==void 0&&u(_,[`automatic_return_routing`],e[`automatic-return-routing`]),e[`bgp-customer-asn`]!==void 0&&u(_,[`bgp`,`customer_asn`],e[`bgp-customer-asn`]),e[`bgp-export-filter-id`]!==void 0&&u(_,[`bgp`,`export_filter_id`],m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),e[`bgp-extra-prefixes`]!==void 0&&u(_,[`bgp`,`extra_prefixes`],e[`bgp-extra-prefixes`]),e[`bgp-import-filter-id`]!==void 0&&u(_,[`bgp`,`import_filter_id`],m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(_,[`bgp`,`md5_key`],m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e[`cloudflare-endpoint`]!==void 0&&u(_,[`cloudflare_endpoint`],m(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`)),e[`custom-remote-identities-fqdn-id`]!==void 0&&u(_,[`custom_remote_identities`,`fqdn_id`],m(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)),e[`customer-endpoint`]!==void 0&&u(_,[`customer_endpoint`],m(e[`customer-endpoint`],`customer-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],m(e.description,`description`,`text`)),e[`health-check-enabled`]!==void 0&&u(_,[`health_check`,`enabled`],e[`health-check-enabled`]),e[`health-check-rate`]!==void 0&&u(_,[`health_check`,`rate`],e[`health-check-rate`]),e[`health-check-target-saved`]!==void 0&&u(_,[`health_check`,`target`,`saved`],m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)),e[`health-check-type`]!==void 0&&u(_,[`health_check`,`type`],e[`health-check-type`]),e[`health-check-direction`]!==void 0&&u(_,[`health_check`,`direction`],e[`health-check-direction`]),e[`interface-address`]!==void 0&&u(_,[`interface_address`],m(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],m(e[`interface-address6`],`interface-address6`,`text`)),e.name!==void 0&&u(_,[`name`],m(e.name,`name`,`text`)),e.psk!==void 0&&u(_,[`psk`],m(e.psk,`psk`,`text`)),e[`replay-protection`]!==void 0&&u(_,[`replay_protection`],e[`replay-protection`]);let v=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${g}/magic/ipsec_tunnels`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function mi(e){return e.usage(`$0 magic-transit ipsec-tunnels delete <ipsec-tunnel-id>
|
|
233
|
+
|
|
234
|
+
Disables and removes a specific static IPsec Tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const hi={command:`delete <ipsec-tunnel-id>`,describe:`Delete IPsec Tunnel`,builder:mi,handler:async e=>l({command:`magic-transit ipsec-tunnels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels/${e[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,pathParams:{"ipsec-tunnel-id":String(e[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
235
|
+
`);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function gi(e){return e.usage(`$0 magic-transit ipsec-tunnels get <ipsec-tunnel-id>
|
|
236
|
+
|
|
237
|
+
Lists details for a specific IPsec tunnel.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _i={command:`get <ipsec-tunnel-id>`,describe:`List IPsec tunnel details`,builder:gi,handler:async e=>l({command:`magic-transit ipsec-tunnels get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels/${e[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,pathParams:{"ipsec-tunnel-id":String(e[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function vi(e){return e.usage(`$0 magic-transit ipsec-tunnels list
|
|
238
|
+
|
|
239
|
+
Lists IPsec tunnels associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yi={command:`list`,describe:`List IPsec tunnels`,builder:vi,handler:async e=>l({command:`magic-transit ipsec-tunnels list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let e=await i();s({command:`cf magic-transit ipsec-tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/ipsec_tunnels`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};var bi={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/ipsec_tunnels/${t.ipsec_tunnel_id}/psk_generate`};function xi(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-generate <ipsec-tunnel-id>
|
|
240
|
+
|
|
241
|
+
Generates a Pre-Shared Key for a specific IPsec tunnel used in the IKE session. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes. After a PSK is generated, the PSK is immediately persisted to Cloudflare's edge and cannot be retrieved later. Store the PSK in a safe place.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Si={command:`psk-generate <ipsec-tunnel-id>`,describe:`Generate Pre-Shared Key (PSK) for IPsec tunnels`,builder:xi,handler:async e=>l({command:`magic-transit ipsec-tunnels psk-generate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels psk-generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels/${e[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(e[`ipsec-tunnel-id`]))}/psk_generate`,pathParams:{"ipsec-tunnel-id":String(e[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Creating`,async()=>n.send(bi,{account_id:l,ipsec_tunnel_id:e[`ipsec-tunnel-id`]}));o(u,{successLabel:`Created`})})};var Ci={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/ipsec_tunnels/psk`,query:[`validate_only`],body:`json`};function wi(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-set
|
|
242
|
+
|
|
243
|
+
Sets Pre-Shared Keys for multiple IPsec tunnels associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes. After PSKs are applied, they are immediately persisted to Cloudflare's edge and cannot be retrieved later. Store the PSKs in a safe place.`).option(`validate-only`,{type:`boolean`,description:"If `true`, only run validation without persisting changes."}).option(`psks`,{type:`string`,description:`List of tunnel ID and PSK pairs. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for setting PSKs for multiple IPsec tunnels.`})}const Ti={command:`psk-set`,describe:`Set Pre-Shared Keys (PSK) for IPsec tunnels`,builder:wi,handler:async e=>l({command:`magic-transit ipsec-tunnels psk-set`,classification:{safeFlags:[`validate-only`,`dry-run`]}},e,async()=>{let n={validate_only:e[`validate-only`]};if(e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels psk-set`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels/psk`,pathParams:{},query:n,bodyKind:`json`,body:e.body===void 0?p({psks:f(e.psks,`psks`)}):d(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=d(e.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await c(`Creating`,async()=>l.send(Ci,{body:t,account_id:u,...n}));o(r,{successLabel:`Created`});return}if(e.psks===void 0)throw Error(`--psks is required (or pass --body with this field set).`);let m=p({psks:f(e.psks,`psks`)});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let h=await c(`Creating`,async()=>l.send(Ci,{body:m,account_id:u,...n}));o(h,{successLabel:`Created`})})};function Ei(e){return e.usage(`$0 magic-transit ipsec-tunnels update <ipsec-tunnel-id>
|
|
244
|
+
|
|
245
|
+
Updates a specific IPsec tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
246
|
+
|
|
247
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
248
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
249
|
+
misconfiguration, not for defending against malicious attacks.
|
|
250
|
+
|
|
251
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
252
|
+
character:
|
|
253
|
+
|
|
254
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
255
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
256
|
+
|
|
257
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
258
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
259
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
260
|
+
these disallowed characters will be rejected.`}).option(`cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the IPsec tunnel.`}).option(`custom-remote-identities-fqdn-id`,{type:`string`,description:`A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The
|
|
261
|
+
generated IKE IDs can still be used even if this custom value is specified.
|
|
262
|
+
|
|
263
|
+
Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
264
|
+
|
|
265
|
+
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
266
|
+
fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
|
|
267
|
+
cannot have the same cloudflare_endpoint.`}).option(`customer-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.`}).option(`description`,{type:`string`,description:`An optional description forthe IPsec tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>m(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>m(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`name`,{type:`string`,description:`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`}).option(`psk`,{type:`string`,description:`A randomly generated or provided string for use in the IPsec tunnel.`}).option(`replay-protection`,{type:`boolean`,description:"If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const Di={command:`update <ipsec-tunnel-id>`,describe:`Update IPsec Tunnel`,builder:Ei,handler:async e=>l({command:`magic-transit ipsec-tunnels update`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`replay-protection`,`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit ipsec-tunnels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/ipsec_tunnels/${e[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,pathParams:{"ipsec-tunnel-id":String(e[`ipsec-tunnel-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({automatic_return_routing:e[`automatic-return-routing`],bgp:{customer_asn:e[`bgp-customer-asn`],export_filter_id:m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_endpoint:m(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`),custom_remote_identities:{fqdn_id:m(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)},customer_endpoint:m(e[`customer-endpoint`],`customer-endpoint`,`text`),description:m(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:m(e[`interface-address`],`interface-address`,`text`),interface_address6:m(e[`interface-address6`],`interface-address6`,`text`),name:m(e.name,`name`,`text`),psk:m(e.psk,`psk`,`text`),replay_protection:e[`replay-protection`]}):d(e.body),sensitiveBodyPaths:[[`psk`]]});return}let f=await r(e),g=e.local?t:await a();if(e.accountId=g,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${g}/magic/ipsec_tunnels/${encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}e[`cloudflare-endpoint`]===void 0&&(e[`cloudflare-endpoint`]=await h(`cloudflare-endpoint`,`The IP address assigned to the Cloudflare side of the IPsec tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await h(`interface-address`,`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`));let _={};e[`automatic-return-routing`]!==void 0&&u(_,[`automatic_return_routing`],e[`automatic-return-routing`]),e[`bgp-customer-asn`]!==void 0&&u(_,[`bgp`,`customer_asn`],e[`bgp-customer-asn`]),e[`bgp-export-filter-id`]!==void 0&&u(_,[`bgp`,`export_filter_id`],m(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),e[`bgp-extra-prefixes`]!==void 0&&u(_,[`bgp`,`extra_prefixes`],e[`bgp-extra-prefixes`]),e[`bgp-import-filter-id`]!==void 0&&u(_,[`bgp`,`import_filter_id`],m(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(_,[`bgp`,`md5_key`],m(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e[`cloudflare-endpoint`]!==void 0&&u(_,[`cloudflare_endpoint`],m(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`)),e[`custom-remote-identities-fqdn-id`]!==void 0&&u(_,[`custom_remote_identities`,`fqdn_id`],m(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)),e[`customer-endpoint`]!==void 0&&u(_,[`customer_endpoint`],m(e[`customer-endpoint`],`customer-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],m(e.description,`description`,`text`)),e[`health-check-enabled`]!==void 0&&u(_,[`health_check`,`enabled`],e[`health-check-enabled`]),e[`health-check-rate`]!==void 0&&u(_,[`health_check`,`rate`],e[`health-check-rate`]),e[`health-check-target-saved`]!==void 0&&u(_,[`health_check`,`target`,`saved`],m(e[`health-check-target-saved`],`health-check-target-saved`,`text`)),e[`health-check-type`]!==void 0&&u(_,[`health_check`,`type`],e[`health-check-type`]),e[`health-check-direction`]!==void 0&&u(_,[`health_check`,`direction`],e[`health-check-direction`]),e[`interface-address`]!==void 0&&u(_,[`interface_address`],m(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],m(e[`interface-address6`],`interface-address6`,`text`)),e.name!==void 0&&u(_,[`name`],m(e.name,`name`,`text`)),e.psk!==void 0&&u(_,[`psk`],m(e.psk,`psk`,`text`)),e[`replay-protection`]!==void 0&&u(_,[`replay_protection`],e[`replay-protection`]);let v=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${g}/magic/ipsec_tunnels/${encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Updated`})})},Oi={command:`ipsec-tunnels`,describe:`IPsec tunnel endpoints with pre-shared key management for encrypted transit`,builder:e=>e.command(di).command(pi).command(hi).command(_i).command(yi).command(Si).command(Ti).command(Di).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ki={method:`POST`,path:t=>e`/accounts/${t.account_id}/pcaps`,body:`json`};function Ai(e){return e.usage(`$0 magic-transit pcaps create
|
|
268
|
+
|
|
269
|
+
Create new PCAP request for account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ji={command:`create`,describe:`Create PCAP request`,builder:Ai,handler:async e=>l({command:`magic-transit pcaps create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(ki,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Mi(e){return e.usage(`$0 magic-transit pcaps download get <pcap-id>
|
|
270
|
+
|
|
271
|
+
Download PCAP information into a file. Response is a binary PCAP file.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const Ni={command:`get <pcap-id>`,describe:`Download Simple PCAP`,builder:Mi,handler:async e=>l({command:`magic-transit pcaps download get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps/${e[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(e[`pcap-id`]))}/download`,pathParams:{"pcap-id":String(e[`pcap-id`]??``)},bodyKind:`none`});return}await r(e);let n=e.local?t:await a();e.accountId=n;let o=await c(`Loading`,async()=>ee(`/accounts/${n}/pcaps/${encodeURIComponent(String(e[`pcap-id`]))}/download`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));v(e.text===!0?o.toString(`utf-8`):o)})},Pi={command:`download`,describe:`Operations for pcaps.download`,builder:e=>e.command(Ni).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Fi={method:`GET`,path:t=>e`/accounts/${t.account_id}/pcaps/${t.pcap_id}`};function Ii(e){return e.usage(`$0 magic-transit pcaps get <pcap-id>
|
|
272
|
+
|
|
273
|
+
Get information for a PCAP request by id.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Li={command:`get <pcap-id>`,describe:`Get PCAP request`,builder:Ii,handler:async e=>l({command:`magic-transit pcaps get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps/${e[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(e[`pcap-id`]))}`,pathParams:{"pcap-id":String(e[`pcap-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Fi,{account_id:l,pcap_id:e[`pcap-id`]}));o(u,{successLabel:`Loaded`})})};var Ri={method:`GET`,path:t=>e`/accounts/${t.account_id}/pcaps`};function zi(e){return e.usage(`$0 magic-transit pcaps list
|
|
274
|
+
|
|
275
|
+
Lists all packet capture requests for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bi={command:`list`,describe:`List packet capture requests`,builder:zi,handler:async e=>l({command:`magic-transit pcaps list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit pcaps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ri,{account_id:l}));o(u,{successLabel:`Loaded`})})};var z={method:`POST`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership`,body:`json`};function Vi(e){return e.usage(`$0 magic-transit pcaps ownership create
|
|
276
|
+
|
|
277
|
+
Adds an AWS or GCP bucket to use with full packet captures.`).option(`destination-conf`,{type:`string`,description:"The full URI for the bucket. This field only applies to `full` packet captures."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Hi={command:`create`,describe:`Add buckets for full packet captures`,builder:Vi,handler:async e=>l({command:`magic-transit pcaps ownership create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({destination_conf:m(e[`destination-conf`],`destination-conf`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(z,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await h(`destination-conf`,"The full URI for the bucket. This field only applies to `full` packet captures."));let u=p({destination_conf:m(e[`destination-conf`],`destination-conf`,`text`)}),f=await c(`Creating`,async()=>n.send(z,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Ui={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership/${t.ownership_id}`,response:!1};function Wi(e){return e.usage(`$0 magic-transit pcaps ownership delete <ownership-id>
|
|
278
|
+
|
|
279
|
+
Deletes buckets added to the packet captures API.`).positional(`ownership-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Gi={command:`delete <ownership-id>`,describe:`Delete buckets for full packet captures`,builder:Wi,handler:async e=>l({command:`magic-transit pcaps ownership delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps ownership delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps/ownership/${e[`ownership-id`]==null?`<ownership-id>`:encodeURIComponent(String(e[`ownership-id`]))}`,pathParams:{"ownership-id":String(e[`ownership-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
280
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Ui,{account_id:l,ownership_id:e[`ownership-id`]}));o(u,{successLabel:`Deleted`})})};var Ki={method:`GET`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership`};function qi(e){return e.usage(`$0 magic-transit pcaps ownership get
|
|
281
|
+
|
|
282
|
+
List all buckets configured for use with PCAPs API.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ji={command:`get`,describe:`List PCAPs Bucket Ownership`,builder:qi,handler:async e=>l({command:`magic-transit pcaps ownership get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit pcaps ownership get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ki,{account_id:l}));o(u,{successLabel:`Loaded`})})};var B={method:`POST`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership/validate`,body:`json`};function Yi(e){return e.usage(`$0 magic-transit pcaps ownership validate
|
|
283
|
+
|
|
284
|
+
Validates buckets added to the packet captures API.`).option(`destination-conf`,{type:`string`,description:"The full URI for the bucket. This field only applies to `full` packet captures."}).option(`ownership-challenge`,{type:`string`,description:`The ownership challenge filename stored in the bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xi={command:`validate`,describe:`Validate buckets for full packet captures`,builder:Yi,handler:async e=>l({command:`magic-transit pcaps ownership validate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps/ownership/validate`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({destination_conf:m(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:m(e[`ownership-challenge`],`ownership-challenge`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(B,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await h(`destination-conf`,"The full URI for the bucket. This field only applies to `full` packet captures.")),e[`ownership-challenge`]===void 0&&(e[`ownership-challenge`]=await h(`ownership-challenge`,`The ownership challenge filename stored in the bucket.`));let u=p({destination_conf:m(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:m(e[`ownership-challenge`],`ownership-challenge`,`text`)}),f=await c(`Creating`,async()=>n.send(B,{body:u,account_id:l}));o(f,{successLabel:`Created`})})},Zi={command:`ownership`,describe:`Operations for pcaps.ownership`,builder:e=>e.command(Hi).command(Gi).command(Ji).command(Xi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Qi={method:`PUT`,path:t=>e`/accounts/${t.account_id}/pcaps/${t.pcap_id}/stop`,response:!1};function $i(e){return e.usage(`$0 magic-transit pcaps stop <pcap-id>
|
|
285
|
+
|
|
286
|
+
Stop full PCAP.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ea={command:`stop <pcap-id>`,describe:`Stop full PCAP`,builder:$i,handler:async e=>l({command:`magic-transit pcaps stop`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit pcaps stop`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pcaps/${e[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(e[`pcap-id`]))}/stop`,pathParams:{"pcap-id":String(e[`pcap-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force,message:`This operation halts an in-progress full packet capture. Any unsaved capture data will be lost.`})){process.stderr.write(`Aborted.
|
|
287
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Qi,{account_id:l,pcap_id:e[`pcap-id`]}));o(u,{successLabel:`Deleted`})})},ta={command:`pcaps`,describe:`Packet capture requests for debugging traffic flowing through Magic Transit tunnels`,builder:e=>e.command(ji).command(Li).command(Bi).command(ea).command(Pi).command(Zi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups`,body:`json`};function na(e){return e.usage(`$0 magic-transit redundancy-groups create
|
|
288
|
+
|
|
289
|
+
Creates a new redundancy group, optionally with tunnel members.`).option(`description`,{type:`string`,description:`Optional description`,default:``}).option(`members`,{type:`string`,description:`Tunnels to add to the group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Human-readable name for the redundancy group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ra={command:`create`,describe:`Create a Redundancy Group`,builder:na,handler:async e=>l({command:`magic-transit redundancy-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit redundancy-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),members:f(e.members,`members`),name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(V,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`Human-readable name for the redundancy group`));let u=p({description:m(e.description,`description`,`text`),members:f(e.members,`members`),name:m(e.name,`name`,`text`)}),g=await c(`Creating`,async()=>n.send(V,{body:u,account_id:l}));o(g,{successLabel:`Created`})})};var ia={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups/${t.redundancy_group_id}`};function aa(e){return e.usage(`$0 magic-transit redundancy-groups delete <redundancy-group-id>
|
|
290
|
+
|
|
291
|
+
Deletes a redundancy group. Member tunnels are not deleted — their redundancy_group_id is cleared.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const oa={command:`delete <redundancy-group-id>`,describe:`Delete a Redundancy Group`,builder:aa,handler:async e=>l({command:`magic-transit redundancy-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit redundancy-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/redundancy_groups/${e[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(e[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(e[`redundancy-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
292
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(ia,{account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(u,{successLabel:`Deleted`})})};var sa={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups/${t.redundancy_group_id}`};function ca(e){return e.usage(`$0 magic-transit redundancy-groups get <redundancy-group-id>
|
|
293
|
+
|
|
294
|
+
Gets details for a specific redundancy group, including full member tunnel data.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const la={command:`get <redundancy-group-id>`,describe:`Get Redundancy Group Details`,builder:ca,handler:async e=>l({command:`magic-transit redundancy-groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit redundancy-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/redundancy_groups/${e[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(e[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(e[`redundancy-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(sa,{account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(u,{successLabel:`Loaded`})})};var ua={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups`};function da(e){return e.usage(`$0 magic-transit redundancy-groups list
|
|
295
|
+
|
|
296
|
+
Lists redundancy groups associated with an account, including full member tunnel data.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fa={command:`list`,describe:`List Redundancy Groups`,builder:da,handler:async e=>l({command:`magic-transit redundancy-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit redundancy-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ua,{account_id:l}));o(u,{successLabel:`Loaded`})})};var H={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups/${t.redundancy_group_id}`,body:`json`};function pa(e){return e.usage(`$0 magic-transit redundancy-groups update <redundancy-group-id>
|
|
297
|
+
|
|
298
|
+
Replaces the name, description, and full set of members for an existing redundancy group.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description`}).option(`members`,{type:`string`,description:`Tunnels to add to the group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Human-readable name for the redundancy group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ma={command:`update <redundancy-group-id>`,describe:`Update a Redundancy Group`,builder:pa,handler:async e=>l({command:`magic-transit redundancy-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit redundancy-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/redundancy_groups/${e[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(e[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(e[`redundancy-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),members:f(e.members,`members`),name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(H,{body:t,account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await h(`name`,`Human-readable name for the redundancy group`));let u=p({description:m(e.description,`description`,`text`),members:f(e.members,`members`),name:m(e.name,`name`,`text`)}),g=await c(`Updating`,async()=>n.send(H,{body:u,account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(g,{successLabel:`Updated`})})},ha={command:`redundancy-groups`,describe:`Operations for redundancy-groups`,builder:e=>e.command(ra).command(oa).command(la).command(fa).command(ma).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/routes`,body:`json`};function ga(e){return e.usage(`$0 magic-transit routes bulk-update
|
|
299
|
+
|
|
300
|
+
Update multiple Magic static routes. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes. Only fields for a route that need to be changed need be provided.`).option(`routes`,{type:`string`,description:`The routes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _a={command:`bulk-update`,describe:`Update Many Routes`,builder:ga,handler:async e=>l({command:`magic-transit routes bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit routes bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({routes:f(e.routes,`routes`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(U,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}if(e.routes===void 0)throw Error(`--routes is required (or pass --body with this field set).`);let u=p({routes:f(e.routes,`routes`)}),m=await c(`Updating`,async()=>n.send(U,{body:u,account_id:l}));o(m,{successLabel:`Updated`})})};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/routes`,body:`json`};function va(e){return e.usage(`$0 magic-transit routes create
|
|
301
|
+
|
|
302
|
+
Creates a new Magic static route. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes.`).option(`description`,{type:`string`,description:`An optional human provided description of the static route.`}).option(`nexthop`,{type:`string`,description:`The next-hop IP Address for the static route.`}).option(`prefix`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`priority`,{type:`number`,description:`Priority of the static route.`}).option(`scope-colo-names`,{type:`string`,array:!0,description:`List of colo names for the ECMP scope.`}).option(`scope-colo-regions`,{type:`string`,array:!0,description:`List of colo regions for the ECMP scope.`}).option(`weight`,{type:`number`,description:`Optional weight of the ECMP scope - if provided.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ya={command:`create`,describe:`Create a Route`,builder:va,handler:async e=>l({command:`magic-transit routes create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit routes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),nexthop:m(e.nexthop,`nexthop`,`text`),prefix:m(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(W,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.nexthop===void 0&&(e.nexthop=await h(`nexthop`,`The next-hop IP Address for the static route.`)),e.prefix===void 0&&(e.prefix=await h(`prefix`,`IP Prefix in Classless Inter-Domain Routing format.`)),e.priority===void 0)throw Error(`--priority is required (or pass --body with this field set).`);let u=p({description:m(e.description,`description`,`text`),nexthop:m(e.nexthop,`nexthop`,`text`),prefix:m(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}),f=await c(`Creating`,async()=>n.send(W,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var ba={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/routes/${t.route_id}`};function xa(e){return e.usage(`$0 magic-transit routes delete <route-id>
|
|
303
|
+
|
|
304
|
+
Disable and remove a specific Magic static route.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Sa={command:`delete <route-id>`,describe:`Delete Route`,builder:xa,handler:async e=>l({command:`magic-transit routes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit routes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/routes/${e[`route-id`]==null?`<route-id>`:encodeURIComponent(String(e[`route-id`]))}`,pathParams:{"route-id":String(e[`route-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
305
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(ba,{account_id:l,route_id:e[`route-id`]}));o(u,{successLabel:`Deleted`})})};var G={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/routes`,body:`json`};function Ca(e){return e.usage(`$0 magic-transit routes empty
|
|
306
|
+
|
|
307
|
+
Delete multiple Magic static routes.`).option(`routes`,{type:`string`,description:`The routes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const wa={command:`empty`,describe:`Delete Many Routes`,builder:Ca,handler:async e=>l({command:`magic-transit routes empty`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit routes empty`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({routes:f(e.routes,`routes`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
308
|
+
`);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n.send(G,{body:t,account_id:l}));o(r,{successLabel:`Deleted`});return}if(e.routes===void 0)throw Error(`--routes is required (or pass --body with this field set).`);let u=p({routes:f(e.routes,`routes`)}),m=await c(`Deleting`,async()=>n.send(G,{body:u,account_id:l}));o(m,{successLabel:`Deleted`})})};var Ta={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/routes/${t.route_id}`};function Ea(e){return e.usage(`$0 magic-transit routes get <route-id>
|
|
309
|
+
|
|
310
|
+
Get a specific Magic static route.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Da={command:`get <route-id>`,describe:`Route Details`,builder:Ea,handler:async e=>l({command:`magic-transit routes get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit routes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/routes/${e[`route-id`]==null?`<route-id>`:encodeURIComponent(String(e[`route-id`]))}`,pathParams:{"route-id":String(e[`route-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ta,{account_id:l,route_id:e[`route-id`]}));o(u,{successLabel:`Loaded`})})};var Oa={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/routes`};function ka(e){return e.usage(`$0 magic-transit routes list
|
|
311
|
+
|
|
312
|
+
List all Magic static routes.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Aa={command:`list`,describe:`List Routes`,builder:ka,handler:async e=>l({command:`magic-transit routes list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf magic-transit routes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Oa,{account_id:l}));o(u,{successLabel:`Loaded`})})};var K={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/routes/${t.route_id}`,body:`json`};function ja(e){return e.usage(`$0 magic-transit routes update <route-id>
|
|
313
|
+
|
|
314
|
+
Update a specific Magic static route. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`An optional human provided description of the static route.`}).option(`nexthop`,{type:`string`,description:`The next-hop IP Address for the static route.`}).option(`prefix`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`priority`,{type:`number`,description:`Priority of the static route.`}).option(`scope-colo-names`,{type:`string`,array:!0,description:`List of colo names for the ECMP scope.`}).option(`scope-colo-regions`,{type:`string`,array:!0,description:`List of colo regions for the ECMP scope.`}).option(`weight`,{type:`number`,description:`Optional weight of the ECMP scope - if provided.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ma={command:`update <route-id>`,describe:`Update Route`,builder:ja,handler:async e=>l({command:`magic-transit routes update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit routes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/routes/${e[`route-id`]==null?`<route-id>`:encodeURIComponent(String(e[`route-id`]))}`,pathParams:{"route-id":String(e[`route-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),nexthop:m(e.nexthop,`nexthop`,`text`),prefix:m(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(K,{body:t,account_id:l,route_id:e[`route-id`]}));o(r,{successLabel:`Updated`});return}if(e.nexthop===void 0&&(e.nexthop=await h(`nexthop`,`The next-hop IP Address for the static route.`)),e.prefix===void 0&&(e.prefix=await h(`prefix`,`IP Prefix in Classless Inter-Domain Routing format.`)),e.priority===void 0)throw Error(`--priority is required (or pass --body with this field set).`);let u=p({description:m(e.description,`description`,`text`),nexthop:m(e.nexthop,`nexthop`,`text`),prefix:m(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}),f=await c(`Updating`,async()=>n.send(K,{body:u,account_id:l,route_id:e[`route-id`]}));o(f,{successLabel:`Updated`})})},Na={command:`routes`,describe:`Static routes that direct IP prefix traffic through specific GRE/IPsec tunnels`,builder:e=>e.command(_a).command(ya).command(Sa).command(wa).command(Da).command(Aa).command(Ma).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls`,body:`json`};function Pa(e){return e.usage(`$0 magic-transit sites acls create <site-id>
|
|
315
|
+
|
|
316
|
+
Creates a new Site ACL.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Bidirectional ACL policy for local network traffic within a site.`})}const Fa={command:`create <site-id>`,describe:`Create a new Site ACL`,builder:Pa,handler:async e=>l({command:`magic-transit sites acls create`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/acls`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:m(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:m(e[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:e[`lan-1-port-ranges`],ports:e[`lan-1-ports`]},lan_2:{lan_id:m(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:m(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:m(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(q,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Created`});return}e[`lan-1-lan-id`]===void 0&&(e[`lan-1-lan-id`]=await h(`lan-1-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),e[`lan-2-lan-id`]===void 0&&(e[`lan-2-lan-id`]=await h(`lan-2-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),e.name===void 0&&(e.name=await h(`name`,`The name of the ACL.`));let u=p({description:m(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:m(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:m(e[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:e[`lan-1-port-ranges`],ports:e[`lan-1-ports`]},lan_2:{lan_id:m(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:m(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:m(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}),f=await c(`Creating`,async()=>n.send(q,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Created`})})};var Ia={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls/${t.acl_id}`};function La(e){return e.usage(`$0 magic-transit sites acls delete <acl-id>
|
|
317
|
+
|
|
318
|
+
Remove a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ra={command:`delete <acl-id>`,describe:`Delete Site ACL`,builder:La,handler:async e=>l({command:`magic-transit sites acls delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"acl-id":String(e[`acl-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
319
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Ia,{account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(u,{successLabel:`Deleted`})})};var J={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls/${t.acl_id}`,body:`json`};function za(e){return e.usage(`$0 magic-transit sites acls edit <acl-id>
|
|
320
|
+
|
|
321
|
+
Patch a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`lan-1-lan-id`,`lan-1-lan-name`,`lan-1-port-ranges`,`lan-1-ports`].some(t=>e[t]!==void 0)){let t=[`lan-1-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_1-* flag is set`)}return!0}).check(e=>{if([`lan-2-lan-id`,`lan-2-lan-name`,`lan-2-port-ranges`,`lan-2-ports`].some(t=>e[t]!==void 0)){let t=[`lan-2-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_2-* flag is set`)}return!0})}const Ba={command:`edit <acl-id>`,describe:`Patch Site ACL`,builder:za,handler:async e=>l({command:`magic-transit sites acls edit`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites acls edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"acl-id":String(e[`acl-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:m(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:m(e[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:e[`lan-1-port-ranges`],ports:e[`lan-1-ports`]},lan_2:{lan_id:m(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:m(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:m(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(J,{body:t,account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(r,{successLabel:`Updated`});return}let u=p({description:m(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:m(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:m(e[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:e[`lan-1-port-ranges`],ports:e[`lan-1-ports`]},lan_2:{lan_id:m(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:m(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:m(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}),f=await c(`Updating`,async()=>n.send(J,{body:u,account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(f,{successLabel:`Updated`})})};var Va={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls/${t.acl_id}`};function Ha(e){return e.usage(`$0 magic-transit sites acls get <acl-id>
|
|
322
|
+
|
|
323
|
+
Get a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ua={command:`get <acl-id>`,describe:`Site ACL Details`,builder:Ha,handler:async e=>l({command:`magic-transit sites acls get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"acl-id":String(e[`acl-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Va,{account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(u,{successLabel:`Loaded`})})};var Wa={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls`};function Ga(e){return e.usage(`$0 magic-transit sites acls list
|
|
324
|
+
|
|
325
|
+
Lists Site ACLs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ka={command:`list`,describe:`List Site ACLs`,builder:Ga,handler:async e=>l({command:`magic-transit sites acls list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/acls`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Wa,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var Y={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls/${t.acl_id}`,body:`json`};function qa(e){return e.usage(`$0 magic-transit sites acls update <acl-id>
|
|
326
|
+
|
|
327
|
+
Update a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`lan-1-lan-id`,`lan-1-lan-name`,`lan-1-port-ranges`,`lan-1-ports`].some(t=>e[t]!==void 0)){let t=[`lan-1-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_1-* flag is set`)}return!0}).check(e=>{if([`lan-2-lan-id`,`lan-2-lan-name`,`lan-2-port-ranges`,`lan-2-ports`].some(t=>e[t]!==void 0)){let t=[`lan-2-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_2-* flag is set`)}return!0})}const Ja={command:`update <acl-id>`,describe:`Update Site ACL`,builder:qa,handler:async e=>l({command:`magic-transit sites acls update`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"acl-id":String(e[`acl-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:m(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:m(e[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:e[`lan-1-port-ranges`],ports:e[`lan-1-ports`]},lan_2:{lan_id:m(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:m(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:m(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Y,{body:t,account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(r,{successLabel:`Updated`});return}let u=p({description:m(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:m(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:m(e[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:e[`lan-1-port-ranges`],ports:e[`lan-1-ports`]},lan_2:{lan_id:m(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:m(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:m(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}),f=await c(`Updating`,async()=>n.send(Y,{body:u,account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(f,{successLabel:`Updated`})})},Ya={command:`acls`,describe:`Operations for sites.acls`,builder:e=>e.command(Fa).command(Ra).command(Ba).command(Ua).command(Ka).command(Ja).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/app_configs`,body:`json`};function Xa(e){return e.usage(`$0 magic-transit sites app-configuration create <site-id>
|
|
328
|
+
|
|
329
|
+
Creates a new App Config for a site`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`breakout`,{type:`boolean`,description:`Whether to breakout traffic to the app's endpoints directly. Null preserves default behavior.`}).option(`preferred-wans`,{type:`string`,array:!0,description:`WAN interfaces to prefer over default WANs, highest-priority first. Can only be specified for breakout rules (breakout must be true).`}).option(`priority`,{type:`number`,description:`Priority of traffic. 0 is default, anything greater is prioritized. (Currently only 0 and 1 are supported)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Za={command:`create <site-id>`,describe:`Create a new App Config`,builder:Xa,handler:async e=>l({command:`magic-transit sites app-configuration create`,classification:{safeFlags:[`breakout`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites app-configuration create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/app_configs`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({breakout:e.breakout,preferred_wans:e[`preferred-wans`],priority:e.priority}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(X,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Created`});return}let u=p({breakout:e.breakout,preferred_wans:e[`preferred-wans`],priority:e.priority}),f=await c(`Creating`,async()=>n.send(X,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Created`})})};var Qa={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/app_configs/${t.app_config_id}`};function $a(e){return e.usage(`$0 magic-transit sites app-configuration delete <app-config-id>
|
|
330
|
+
|
|
331
|
+
Deletes specific App Config associated with a site.`).positional(`app-config-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const eo={command:`delete <app-config-id>`,describe:`Delete App Config`,builder:$a,handler:async e=>l({command:`magic-transit sites app-configuration delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites app-configuration delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/app_configs/${e[`app-config-id`]==null?`<app-config-id>`:encodeURIComponent(String(e[`app-config-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"app-config-id":String(e[`app-config-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
332
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Qa,{account_id:l,site_id:e[`site-id`],app_config_id:e[`app-config-id`]}));o(u,{successLabel:`Deleted`})})};var to={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/app_configs`};function no(e){return e.usage(`$0 magic-transit sites app-configuration list
|
|
333
|
+
|
|
334
|
+
Lists App Configs associated with a site.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ro={command:`list`,describe:`List App Configs`,builder:no,handler:async e=>l({command:`magic-transit sites app-configuration list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites app-configuration list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/app_configs`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(to,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/app_configs/${t.app_config_id}`,body:`json`};function io(e){return e.usage(`$0 magic-transit sites app-configuration update <app-config-id>
|
|
335
|
+
|
|
336
|
+
Updates an App Config for a site`).positional(`app-config-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`account-app-id`,{type:`string`,description:`Magic account app ID.`}).option(`breakout`,{type:`boolean`,description:`Whether to breakout traffic to the app's endpoints directly. Null preserves default behavior.`}).option(`managed-app-id`,{type:`string`,description:`Managed app ID.`}).option(`preferred-wans`,{type:`string`,array:!0,description:`WAN interfaces to prefer over default WANs, highest-priority first. Can only be specified for breakout rules (breakout must be true).`}).option(`priority`,{type:`number`,description:`Priority of traffic. 0 is default, anything greater is prioritized. (Currently only 0 and 1 are supported)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ao={command:`update <app-config-id>`,describe:`Update an App Config`,builder:io,handler:async e=>l({command:`magic-transit sites app-configuration update`,classification:{safeFlags:[`breakout`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites app-configuration update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/app_configs/${e[`app-config-id`]==null?`<app-config-id>`:encodeURIComponent(String(e[`app-config-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"app-config-id":String(e[`app-config-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({account_app_id:m(e[`account-app-id`],`account-app-id`,`text`),breakout:e.breakout,managed_app_id:m(e[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:e[`preferred-wans`],priority:e.priority}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Z,{body:t,account_id:l,site_id:e[`site-id`],app_config_id:e[`app-config-id`]}));o(r,{successLabel:`Updated`});return}let u=p({account_app_id:m(e[`account-app-id`],`account-app-id`,`text`),breakout:e.breakout,managed_app_id:m(e[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:e[`preferred-wans`],priority:e.priority}),f=await c(`Updating`,async()=>n.send(Z,{body:u,account_id:l,site_id:e[`site-id`],app_config_id:e[`app-config-id`]}));o(f,{successLabel:`Updated`})})},oo={command:`app-configuration`,describe:`Operations for sites.app-configuration`,builder:e=>e.command(Za).command(eo).command(ro).command(ao).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Q={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites`,body:`json`};function so(e){return e.usage(`$0 magic-transit sites create
|
|
337
|
+
|
|
338
|
+
Creates a new Site`).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const co={command:`create`,describe:`Create a new Site`,builder:so,handler:async e=>l({command:`magic-transit sites create`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({connector_id:m(e[`connector-id`],`connector-id`,`text`),description:m(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:m(e[`location-lat`],`location-lat`,`text`),lon:m(e[`location-lon`],`location-lon`,`text`)},name:m(e.name,`name`,`text`),secondary_connector_id:m(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Q,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`The name of the site.`));let u=p({connector_id:m(e[`connector-id`],`connector-id`,`text`),description:m(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:m(e[`location-lat`],`location-lat`,`text`),lon:m(e[`location-lon`],`location-lon`,`text`)},name:m(e.name,`name`,`text`),secondary_connector_id:m(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}),f=await c(`Creating`,async()=>n.send(Q,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var lo={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}`};function uo(e){return e.usage(`$0 magic-transit sites delete <site-id>
|
|
339
|
+
|
|
340
|
+
Remove a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const fo={command:`delete <site-id>`,describe:`Delete Site`,builder:uo,handler:async e=>l({command:`magic-transit sites delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
341
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(lo,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Deleted`})})};var po={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}`,body:`json`};function mo(e){return e.usage(`$0 magic-transit sites edit <site-id>
|
|
342
|
+
|
|
343
|
+
Patch a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ho={command:`edit <site-id>`,describe:`Patch Site`,builder:mo,handler:async e=>l({command:`magic-transit sites edit`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({connector_id:m(e[`connector-id`],`connector-id`,`text`),description:m(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:m(e[`location-lat`],`location-lat`,`text`),lon:m(e[`location-lon`],`location-lon`,`text`)},name:m(e.name,`name`,`text`),secondary_connector_id:m(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(po,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=p({connector_id:m(e[`connector-id`],`connector-id`,`text`),description:m(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:m(e[`location-lat`],`location-lat`,`text`),lon:m(e[`location-lon`],`location-lon`,`text`)},name:m(e.name,`name`,`text`),secondary_connector_id:m(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}),f=await c(`Updating`,async()=>n.send(po,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Updated`})})};function go(e){return e.usage(`$0 magic-transit sites get <site-id>
|
|
344
|
+
|
|
345
|
+
Get a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _o={command:`get <site-id>`,describe:`Site Details`,builder:go,handler:async e=>l({command:`magic-transit sites get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`x-magic-new-hc-target`]!==void 0&&(l[`x-magic-new-hc-target`]=String(e[`x-magic-new-hc-target`])),e.dryRun){let t=await i();s({command:`cf magic-transit sites get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/magic/sites/${encodeURIComponent(String(e[`site-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};var vo={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans`,body:`json`};function yo(e){return e.usage(`$0 magic-transit sites lans create <site-id>
|
|
346
|
+
|
|
347
|
+
Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const bo={command:`create <site-id>`,describe:`Create a new Site LAN`,builder:yo,handler:async e=>l({command:`magic-transit sites lans create`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites lans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/lans`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:m(e.name,`name`,`text`),nat:{static_prefix:m(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:f(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:m(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:m(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:m(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`]},secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:m(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(vo,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Created`});return}let u=p({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:m(e.name,`name`,`text`),nat:{static_prefix:m(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:f(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:m(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:m(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:m(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`]},secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:m(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]}),h=await c(`Creating`,async()=>n.send(vo,{body:u,account_id:l,site_id:e[`site-id`]}));o(h,{successLabel:`Created`})})};var xo={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`};function So(e){return e.usage(`$0 magic-transit sites lans delete <lan-id>
|
|
348
|
+
|
|
349
|
+
Remove a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Co={command:`delete <lan-id>`,describe:`Delete Site LAN`,builder:So,handler:async e=>l({command:`magic-transit sites lans delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites lans delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/lans/${e[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(e[`lan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"lan-id":String(e[`lan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
350
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(xo,{account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(u,{successLabel:`Deleted`})})};var wo={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`,body:`json`};function To(e){return e.usage(`$0 magic-transit sites lans edit <lan-id>
|
|
351
|
+
|
|
352
|
+
Patch a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Eo={command:`edit <lan-id>`,describe:`Patch Site LAN`,builder:To,handler:async e=>l({command:`magic-transit sites lans edit`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites lans edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/lans/${e[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(e[`lan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"lan-id":String(e[`lan-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:m(e.name,`name`,`text`),nat:{static_prefix:m(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:f(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:m(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:m(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:m(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`]},secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:m(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(wo,{body:t,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(r,{successLabel:`Updated`});return}let u=p({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:m(e.name,`name`,`text`),nat:{static_prefix:m(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:f(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:m(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:m(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:m(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`]},secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:m(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]}),h=await c(`Updating`,async()=>n.send(wo,{body:u,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(h,{successLabel:`Updated`})})};var Do={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`};function Oo(e){return e.usage(`$0 magic-transit sites lans get <lan-id>
|
|
353
|
+
|
|
354
|
+
Get a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ko={command:`get <lan-id>`,describe:`Site LAN Details`,builder:Oo,handler:async e=>l({command:`magic-transit sites lans get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites lans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/lans/${e[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(e[`lan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"lan-id":String(e[`lan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Do,{account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(u,{successLabel:`Loaded`})})};var Ao={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans`};function jo(e){return e.usage(`$0 magic-transit sites lans list
|
|
355
|
+
|
|
356
|
+
Lists Site LANs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mo={command:`list`,describe:`List Site LANs`,builder:jo,handler:async e=>l({command:`magic-transit sites lans list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites lans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/lans`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ao,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var No={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`,body:`json`};function Po(e){return e.usage(`$0 magic-transit sites lans update <lan-id>
|
|
357
|
+
|
|
358
|
+
Update a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Fo={command:`update <lan-id>`,describe:`Update Site LAN`,builder:Po,handler:async e=>l({command:`magic-transit sites lans update`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites lans update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/lans/${e[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(e[`lan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"lan-id":String(e[`lan-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:m(e.name,`name`,`text`),nat:{static_prefix:m(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:f(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:m(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:m(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:m(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`]},secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:m(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(No,{body:t,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(r,{successLabel:`Updated`});return}let u=p({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:m(e.name,`name`,`text`),nat:{static_prefix:m(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:f(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:m(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:m(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:m(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`]},secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:m(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]}),h=await c(`Updating`,async()=>n.send(No,{body:u,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(h,{successLabel:`Updated`})})},Io={command:`lans`,describe:`Operations for sites.lans`,builder:e=>e.command(bo).command(Co).command(Eo).command(ko).command(Mo).command(Fo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Lo={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites`,query:[`connectorid`]};function Ro(e){return e.usage(`$0 magic-transit sites list
|
|
359
|
+
|
|
360
|
+
Lists Sites associated with an account. Use connectorid query param to return sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID.`).option(`connectorid`,{type:`string`,description:`Identifier`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zo={command:`list`,describe:`List Sites`,builder:Ro,handler:async e=>l({command:`magic-transit sites list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={connectorid:e.connectorid};if(e.dryRun){let e=await i();s({command:`cf magic-transit sites list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Lo,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var Bo={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`,body:`json`};function Vo(e){return e.usage(`$0 magic-transit sites netflow-config create <site-id>
|
|
361
|
+
|
|
362
|
+
Creates a NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ho={command:`create <site-id>`,describe:`Create NetFlow Configuration`,builder:Vo,handler:async e=>l({command:`magic-transit sites netflow-config create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites netflow-config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({active_timeout:e[`active-timeout`],collector_ip:m(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Bo,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Created`});return}let u=p({active_timeout:e[`active-timeout`],collector_ip:m(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}),f=await c(`Creating`,async()=>n.send(Bo,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Created`})})};var Uo={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`};function Wo(e){return e.usage(`$0 magic-transit sites netflow-config delete <site-id>
|
|
363
|
+
|
|
364
|
+
Remove NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Go={command:`delete <site-id>`,describe:`Delete NetFlow Configuration`,builder:Wo,handler:async e=>l({command:`magic-transit sites netflow-config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites netflow-config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
365
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Uo,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Deleted`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`,body:`json`};function Ko(e){return e.usage(`$0 magic-transit sites netflow-config edit <site-id>
|
|
366
|
+
|
|
367
|
+
Updates NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qo={command:`edit <site-id>`,describe:`Update NetFlow Configuration`,builder:Ko,handler:async e=>l({command:`magic-transit sites netflow-config edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites netflow-config edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({active_timeout:e[`active-timeout`],collector_ip:m(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send($,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=p({active_timeout:e[`active-timeout`],collector_ip:m(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}),f=await c(`Updating`,async()=>n.send($,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Updated`})})};var Jo={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`};function Yo(e){return e.usage(`$0 magic-transit sites netflow-config get <site-id>
|
|
368
|
+
|
|
369
|
+
Get NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xo={command:`get <site-id>`,describe:`NetFlow Configuration Details`,builder:Yo,handler:async e=>l({command:`magic-transit sites netflow-config get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites netflow-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Jo,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var Zo={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`,body:`json`};function Qo(e){return e.usage(`$0 magic-transit sites netflow-config update <site-id>
|
|
370
|
+
|
|
371
|
+
Updates NetFlow configuration for a site (partial update).`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $o={command:`update <site-id>`,describe:`Update NetFlow Configuration`,builder:Qo,handler:async e=>l({command:`magic-transit sites netflow-config update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites netflow-config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({active_timeout:e[`active-timeout`],collector_ip:m(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Zo,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=p({active_timeout:e[`active-timeout`],collector_ip:m(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}),f=await c(`Updating`,async()=>n.send(Zo,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Updated`})})},es={command:`netflow-config`,describe:`Operations for sites.netflow-config`,builder:e=>e.command(Ho).command(Go).command(qo).command(Xo).command($o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ts={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}`,body:`json`};function ns(e){return e.usage(`$0 magic-transit sites update <site-id>
|
|
372
|
+
|
|
373
|
+
Update a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const rs={command:`update <site-id>`,describe:`Update Site`,builder:ns,handler:async e=>l({command:`magic-transit sites update`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({connector_id:m(e[`connector-id`],`connector-id`,`text`),description:m(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:m(e[`location-lat`],`location-lat`,`text`),lon:m(e[`location-lon`],`location-lon`,`text`)},name:m(e.name,`name`,`text`),secondary_connector_id:m(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(ts,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=p({connector_id:m(e[`connector-id`],`connector-id`,`text`),description:m(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:m(e[`location-lat`],`location-lat`,`text`),lon:m(e[`location-lon`],`location-lon`,`text`)},name:m(e.name,`name`,`text`),secondary_connector_id:m(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}),f=await c(`Updating`,async()=>n.send(ts,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Updated`})})};var is={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans`,body:`json`};function as(e){return e.usage(`$0 magic-transit sites wans create <site-id>
|
|
374
|
+
|
|
375
|
+
Creates a new Site WAN.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:"Magic WAN health check rate for tunnels created on this link. The default value is `mid`.",choices:[`low`,`mid`,`high`],default:`mid`}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`,default:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const os={command:`create <site-id>`,describe:`Create a new Site WAN`,builder:as,handler:async e=>l({command:`magic-transit sites wans create`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites wans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/wans`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:m(e.name,`name`,`text`),physport:e.physport,priority:e.priority,static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:m(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:e[`vlan-tag`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(is,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Created`});return}if(e.physport===void 0)throw Error(`--physport is required (or pass --body with this field set).`);let u=p({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:m(e.name,`name`,`text`),physport:e.physport,priority:e.priority,static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:m(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:e[`vlan-tag`]}),f=await c(`Creating`,async()=>n.send(is,{body:u,account_id:l,site_id:e[`site-id`]}));o(f,{successLabel:`Created`})})};var ss={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`};function cs(e){return e.usage(`$0 magic-transit sites wans delete <wan-id>
|
|
376
|
+
|
|
377
|
+
Remove a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ls={command:`delete <wan-id>`,describe:`Delete Site WAN`,builder:cs,handler:async e=>l({command:`magic-transit sites wans delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites wans delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/wans/${e[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(e[`wan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"wan-id":String(e[`wan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
378
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(ss,{account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(u,{successLabel:`Deleted`})})};var us={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`,body:`json`};function ds(e){return e.usage(`$0 magic-transit sites wans edit <wan-id>
|
|
379
|
+
|
|
380
|
+
Patch a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:`Magic WAN health check rate for tunnels created on this link.`,choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const fs={command:`edit <wan-id>`,describe:`Patch Site WAN`,builder:ds,handler:async e=>l({command:`magic-transit sites wans edit`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites wans edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/wans/${e[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(e[`wan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"wan-id":String(e[`wan-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:m(e.name,`name`,`text`),physport:e.physport,priority:e.priority,static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:m(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:e[`vlan-tag`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(us,{body:t,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(r,{successLabel:`Updated`});return}let u=p({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:m(e.name,`name`,`text`),physport:e.physport,priority:e.priority,static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:m(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:e[`vlan-tag`]}),f=await c(`Updating`,async()=>n.send(us,{body:u,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(f,{successLabel:`Updated`})})};var ps={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`};function ms(e){return e.usage(`$0 magic-transit sites wans get <wan-id>
|
|
381
|
+
|
|
382
|
+
Get a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hs={command:`get <wan-id>`,describe:`Site WAN Details`,builder:ms,handler:async e=>l({command:`magic-transit sites wans get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites wans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/wans/${e[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(e[`wan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"wan-id":String(e[`wan-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ps,{account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(u,{successLabel:`Loaded`})})};var gs={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans`};function _s(e){return e.usage(`$0 magic-transit sites wans list
|
|
383
|
+
|
|
384
|
+
Lists Site WANs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vs={command:`list`,describe:`List Site WANs`,builder:_s,handler:async e=>l({command:`magic-transit sites wans list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites wans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/wans`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(gs,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var ys={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`,body:`json`};function bs(e){return e.usage(`$0 magic-transit sites wans update <wan-id>
|
|
385
|
+
|
|
386
|
+
Update a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:`Magic WAN health check rate for tunnels created on this link.`,choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>m(e,`health-check-rate`,`text`)).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const xs={command:`update <wan-id>`,describe:`Update Site WAN`,builder:bs,handler:async e=>l({command:`magic-transit sites wans update`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf magic-transit sites wans update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/magic/sites/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}/wans/${e[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(e[`wan-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``),"wan-id":String(e[`wan-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:m(e.name,`name`,`text`),physport:e.physport,priority:e.priority,static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:m(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:e[`vlan-tag`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(ys,{body:t,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(r,{successLabel:`Updated`});return}let u=p({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:m(e.name,`name`,`text`),physport:e.physport,priority:e.priority,static_addressing:{address:m(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:m(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:m(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:e[`vlan-tag`]}),f=await c(`Updating`,async()=>n.send(ys,{body:u,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(f,{successLabel:`Updated`})})},Ss={command:`wans`,describe:`Operations for sites.wans`,builder:e=>e.command(os).command(ls).command(fs).command(hs).command(vs).command(xs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Cs={command:`sites`,describe:`Magic WAN branch sites — base CRUD, LAN/WAN interface configuration, ACLs, connectors, app configuration, and NetFlow config`,builder:e=>e.command(co).command(fo).command(ho).command(_o).command(zo).command(rs).command(Ya).command(oo).command(Io).command(es).command(Ss).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ws={command:`magic-transit`,describe:`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,builder:e=>e.command(Se).command(In).command(qn).command(sr).command(pr).command(Sr).command(Xr).command(li).command(Oi).command(ta).command(ha).command(Na).command(Cs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ws as default};
|