cf 1.0.0-beta.16 → 1.0.0-beta.18
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/dist/_meta/commands.json +6117 -4540
- package/dist/_meta/schemas.json +5016 -3257
- package/dist/{abuse-reports-17K-TRhO.mjs → abuse-reports-Ce-g5uZP.mjs} +6 -6
- package/dist/{access-BwB7sg1D.mjs → access-BtsMwesh.mjs} +1 -1
- package/dist/{accounts-BnIGu_ac.mjs → accounts-X5QVzEUW.mjs} +27 -21
- package/dist/{acm-CQRcu_zw.mjs → acm-C_NepMi6.mjs} +1 -1
- package/dist/{addressing-Qcm9jd3C.mjs → addressing-BkQY1hoA.mjs} +18 -18
- package/dist/{agent-memory-B3xN9I6-.mjs → agent-memory-1OPgC3lK.mjs} +6 -6
- package/dist/{ai-BRKOCckA.mjs → ai-Bb0_Zknm.mjs} +1 -1
- package/dist/{ai-audit-Cd9Rc2Fc.mjs → ai-audit-DuEjVdML.mjs} +1 -1
- package/dist/{ai-gateway-BWU5064V.mjs → ai-gateway-Cm2vWMSI.mjs} +42 -42
- package/dist/ai-search-DDRpxyOM.mjs +79 -0
- package/dist/{ai-security-Dn0Ee6QS.mjs → ai-security-A2STvE1b.mjs} +5 -5
- package/dist/{alerting-BXTiMfXo.mjs → alerting-CIwSk-Ks.mjs} +1 -1
- package/dist/{analytics-Jyd04TRW.mjs → analytics-H--uM3DA.mjs} +7 -7
- package/dist/{analytics-engine-CzrNfUeh.mjs → analytics-engine-Alu7cllT.mjs} +1 -1
- package/dist/{api-security-DRBHZaf_.mjs → api-security-D-pcnhUL.mjs} +26 -26
- package/dist/{argo-DiQt0pSb.mjs → argo-Lvmcx3am.mjs} +1 -1
- package/dist/{artifacts-eBZ4YN53.mjs → artifacts-xT5S-mVa.mjs} +1 -1
- package/dist/{audit-logs-Bb4HTZay.mjs → audit-logs-DEoRBLkU.mjs} +1 -1
- package/dist/{auth-C6My1gI6.mjs → auth-B73lQS2h.mjs} +1 -1
- package/dist/auth-DMzEmOhG.mjs +2 -0
- package/dist/{auth-eVI_UEt8.mjs → auth-Db1KT0vm.mjs} +1 -1
- package/dist/{auth-token-Cfj2yehs.mjs → auth-token-D9XIPlwf.mjs} +1 -1
- package/dist/{autoconfig-B0ESZ8DJ.mjs → autoconfig-9po_tqsS.mjs} +1 -1
- package/dist/{basin-catalog-Cwk1RSMX.mjs → basin-catalog-DFHt3cWi.mjs} +1 -1
- package/dist/{billing-CfV8oi6A.mjs → billing-Bm2JNSGa.mjs} +6 -6
- package/dist/body-parser-DnBfDdx3.mjs +2 -0
- package/dist/{bot-management-CH4_Kewx.mjs → bot-management-CSr38g-O.mjs} +4 -4
- package/dist/{botnet-feed-Cg_Wp8ei.mjs → botnet-feed-ebeWWSJj.mjs} +1 -1
- package/dist/{brand-protection-Cp2ckWou.mjs → brand-protection-BCn9Mv-d.mjs} +5 -5
- package/dist/browser-run-BcWxzhAn.mjs +42 -0
- package/dist/build-BRJnyeu8.mjs +2 -0
- package/dist/{build-sBpqm9ga.mjs → build-i8l2qGVZ.mjs} +1 -1
- package/dist/{builds-B2RBgVL9.mjs → builds-BMwDzi7G.mjs} +39 -39
- package/dist/{cache-yvrYPvRI.mjs → cache-_VaTLC5T.mjs} +1 -1
- package/dist/chunk-JP6R7L72-C0kFUelb.mjs +2 -0
- package/dist/cli-P3q5DG3W.mjs +6 -0
- package/dist/{client-side-security-D50iZjd_.mjs → client-side-security-CjSXrpa9.mjs} +1 -1
- package/dist/{cloud-connector-wvSGdxWT.mjs → cloud-connector-BPJBeP06.mjs} +1 -1
- package/dist/{cloudforce-one-j6vlmaMB.mjs → cloudforce-one-DXX31GMi.mjs} +189 -189
- package/dist/{command-CM_f48gs.mjs → command-BXiA79DP.mjs} +1 -1
- package/dist/{command-CmUtmu5j.mjs → command-BbsPxJBT.mjs} +1 -1
- package/dist/{command-BDpm-U8z.mjs → command-Bkc04OyY.mjs} +1 -1
- package/dist/{command-BSbhJRmu.mjs → command-BtTc28ql.mjs} +1 -1
- package/dist/{command-DFRsim8q.mjs → command-CBZhxmKD.mjs} +1 -1
- package/dist/{command-BbO3sBQ2.mjs → command-CL7LLXM7.mjs} +1 -1
- package/dist/{command-DQojhTEQ.mjs → command-CYyfigfC.mjs} +1 -1
- package/dist/{command-DiqRELHF.mjs → command-CxWLFv5Y.mjs} +1 -1
- package/dist/{command-74P4_CTx.mjs → command-DDcBC4px.mjs} +1 -1
- package/dist/{command-Dr4PEvB2.mjs → command-NoxvOARP.mjs} +1 -1
- package/dist/{completions-oD1EcuHk.mjs → completions-CrDmwKnK.mjs} +1 -1
- package/dist/{connector-interrupts-DP4rbOe8.mjs → connector-interrupts-V4HGULCM.mjs} +1 -1
- package/dist/{connector-telemetry-events-BQGBQwzR.mjs → connector-telemetry-events-D9mTcfbJ.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DBO0Mdcj.mjs → connector-telemetry-snapshots-COrPVKol.mjs} +1 -1
- package/dist/{connectors-BSVr3Kz1.mjs → connectors-DvVlxGDx.mjs} +1 -1
- package/dist/{containers-BTqAeVV2.mjs → containers-Bt2zFsFd.mjs} +8 -8
- package/dist/{containers-BOpKpipz.mjs → containers-BtcOgwm5.mjs} +2 -2
- package/dist/{content-scan-B9Keyxe-.mjs → content-scan-DldLmTjy.mjs} +1 -1
- package/dist/{context-B-vEsyrK.mjs → context-C_a8oSY9.mjs} +1 -1
- package/dist/cps-REo1OWP1.mjs +6 -0
- package/dist/csam-scanner-CIbbdoJK.mjs +10 -0
- package/dist/{custom-csrs-DM5X-K6H.mjs → custom-csrs-iGNc3rSZ.mjs} +1 -1
- package/dist/{custom-hostnames-BBjqaiFF.mjs → custom-hostnames-BNxYbTyu.mjs} +15 -15
- package/dist/{custom-nameservers-C0NDMLPJ.mjs → custom-nameservers-BMJoTSlQ.mjs} +1 -1
- package/dist/custom-pages-Qdemt1Fm.mjs +21 -0
- package/dist/{d1-hin5PmxW.mjs → d1-DvCiQibO.mjs} +8 -8
- package/dist/{deploy-Bo7FtE44.mjs → deploy-K664XPOb.mjs} +1 -1
- package/dist/{deploy-context-ClvBD87y.mjs → deploy-context-ClNVJYlR.mjs} +13 -13
- package/dist/{deploy-input-BqJ7GVZ-.mjs → deploy-input-KK6yyBN_.mjs} +1 -1
- package/dist/{dev-EtnMYA7K.mjs → dev-CnoMHxf4.mjs} +1 -1
- package/dist/{diagnostics-LZuMrGjK.mjs → diagnostics-Cw0mtcep.mjs} +2 -2
- package/dist/{dls-Bq8k3iy-.mjs → dls-DoqfqutH.mjs} +1 -1
- package/dist/{dns-ry5E2Bsa.mjs → dns-DC6WcO3m.mjs} +21 -21
- package/dist/{dns-firewall-zavP5Qxj.mjs → dns-firewall-DpQH9BCE.mjs} +9 -9
- package/dist/{docs-B08YtL0U.mjs → docs-CqNRBHab.mjs} +1 -1
- package/dist/{durable-objects-B9fo41B1.mjs → durable-objects-CJDDy3CC.mjs} +1 -1
- package/dist/{email-auth-D9LGjFlh.mjs → email-auth--NHg1TjG.mjs} +1 -1
- package/dist/{email-routing-6iDnNPhY.mjs → email-routing-COjENK55.mjs} +13 -13
- package/dist/{email-security-ty4ufRnJ.mjs → email-security-rdjH95T2.mjs} +38 -38
- package/dist/{email-sending-d7LO_Cz_.mjs → email-sending-26VJhR6Q.mjs} +18 -18
- package/dist/{field-extractors-DkgQ7PSw.mjs → field-extractors-DBOvGOwz.mjs} +2 -2
- package/dist/{firewall-Q88YyEwD.mjs → firewall-D8K93ffF.mjs} +20 -20
- package/dist/{flagship-CzI8zhd6.mjs → flagship-CHdmCmvQ.mjs} +11 -11
- package/dist/{fraud-CvFXTR0w.mjs → fraud-CY4TV5Vc.mjs} +1 -1
- package/dist/{google-tag-gateway-Y2zbyey8.mjs → google-tag-gateway-DzSt4wlz.mjs} +1 -1
- package/dist/healthchecks-B52Mf3uL.mjs +22 -0
- package/dist/{hostnames-B3k7fIUL.mjs → hostnames-BMITIM8P.mjs} +1 -1
- package/dist/{hyperdrive-BWGYz95H.mjs → hyperdrive-CHsW0r6Z.mjs} +1 -1
- package/dist/{iam-AXco_qmt.mjs → iam-o1n9eUXf.mjs} +9 -9
- package/dist/{images-BzYh8y0u.mjs → images-CJHAGxX6.mjs} +37 -37
- package/dist/index.mjs +1 -1
- package/dist/{init-DlenHBtS.mjs → init-CqQDL6i3.mjs} +1 -1
- package/dist/{intel-BBi3i_GU.mjs → intel-B3S1gxUg.mjs} +1 -1
- package/dist/{ips-CWG2b7AM.mjs → ips-q_UJMiy8.mjs} +1 -1
- package/dist/{k2-DXdMe3Cb.mjs → k2-BNqVZnDN.mjs} +2 -2
- package/dist/{kv-FUd7UdDu.mjs → kv-B0nXSOcW.mjs} +1 -1
- package/dist/{lazy-command-BC8rIlHu.mjs → lazy-command-4ccdBqrc.mjs} +1 -1
- package/dist/{leaked-credential-checks-BufVA9vL.mjs → leaked-credential-checks-BXwIjlTs.mjs} +1 -1
- package/dist/load-balancers-DJtMztJ0.mjs +76 -0
- package/dist/{login-DVbXZ_Tv.mjs → login-D-1FiBNv.mjs} +1 -1
- package/dist/{login-BJr2PBaJ.mjs → login-chQP8825.mjs} +1 -1
- package/dist/{logo-matches-BluaPvMa.mjs → logo-matches-qVYq8tWL.mjs} +1 -1
- package/dist/{logos-CXtmYWEJ.mjs → logos-tnIahhcu.mjs} +1 -1
- package/dist/{logpush-DCYgrqz0.mjs → logpush-D4s3pJRw.mjs} +24 -24
- package/dist/{logs-as60IP29.mjs → logs-cw7UL5V2.mjs} +3 -3
- package/dist/{magic-cloud-networking-0RsHugUF.mjs → magic-cloud-networking-CLEHztNY.mjs} +1 -1
- package/dist/{magic-network-monitoring-CPqvZdcb.mjs → magic-network-monitoring-DRwygeVq.mjs} +9 -9
- package/dist/{magic-transit-ClPyGzOE.mjs → magic-transit-BFopRdPs.mjs} +170 -170
- package/dist/{managed-defense-P4_QWSbK.mjs → managed-defense-D5kpmq0T.mjs} +9 -9
- package/dist/{managed-transforms-CUwQXMij.mjs → managed-transforms-CT4jjnzJ.mjs} +2 -2
- package/dist/{matches-BjckDBW1.mjs → matches-ClJ_24EY.mjs} +1 -1
- package/dist/{mcp-C2EG2c7L.mjs → mcp-50os3IRG.mjs} +10 -10
- package/dist/{mesh-CpMZA7Xt.mjs → mesh-jxtQP8sS.mjs} +2 -2
- package/dist/{migrate-6e5mJ79R.mjs → migrate-DerOyuv2.mjs} +1 -1
- package/dist/{monetization-DypuCZmU.mjs → monetization-D6cCDi-h.mjs} +4 -4
- package/dist/{network-DQ5Ridgy.mjs → network-dnWHB2uY.mjs} +27 -25
- package/dist/{network-interconnects-ifU4JhGE.mjs → network-interconnects-Cf8qSVdt.mjs} +1 -1
- package/dist/{o11y-CzssfRHt.mjs → o11y-oMSg1pG4.mjs} +49 -49
- package/dist/{oauth-BNTiErBG.mjs → oauth-BfBdHhPS.mjs} +1 -1
- package/dist/{oauth-BDdhqasa.mjs → oauth-DDOiiH7h.mjs} +1 -1
- package/dist/{oauth-clients-gknNcBdV.mjs → oauth-clients-XDmoe-b4.mjs} +1 -1
- package/dist/{oauth-scopes-BJeSanuF.mjs → oauth-scopes-D9VYGuTs.mjs} +1 -1
- package/dist/open-PCXX3ZDZ-5J5IU2MX-CKla-jDt.mjs +4 -0
- package/dist/organization-94lHeeOs.mjs +75 -0
- package/dist/{organizations-kfFFW4uO.mjs → organizations-BJf3UTFi.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-DfrnptJ1.mjs → origin-post-quantum-encryption-DMytVSUZ.mjs} +1 -1
- package/dist/{page-rules-ByrDMDBZ.mjs → page-rules-BUI-50oz.mjs} +4 -4
- package/dist/pages-CcdpCzHs.mjs +54 -0
- package/dist/pay-per-crawl-B1uHZn9j.mjs +38 -0
- package/dist/{pay-per-use-49EXt75f.mjs → pay-per-use-t066I5wm.mjs} +7 -7
- package/dist/{pipelines-Bvgh1BQZ.mjs → pipelines-Co6S044l.mjs} +8 -8
- package/dist/precursor-BftyvS86.mjs +4 -0
- package/dist/previews-BLhnhElx.mjs +7 -0
- package/dist/{progress-R-1tIuep.mjs → progress-Q5w9PNTT.mjs} +1 -1
- package/dist/{prompt-dgLm0iFJ.mjs → prompt-C0hKSr-R.mjs} +1 -1
- package/dist/{queries-EbIadtC5.mjs → queries-4MubO6Sz.mjs} +3 -3
- package/dist/{queues-C4GZ-O3f.mjs → queues-CteS5M92.mjs} +17 -17
- package/dist/{r2-DEuFfWBR.mjs → r2-2QpT_Gso.mjs} +24 -24
- package/dist/{radar-CDOERVcR.mjs → radar-ODKaK4FJ.mjs} +1 -1
- package/dist/{raw-fetch-BapeoreV.mjs → raw-fetch-CEOuoKl9.mjs} +1 -1
- package/dist/{realtime-D_A9Qgly.mjs → realtime-DkfU8uEX.mjs} +84 -84
- package/dist/registrar-DM6JTVPS.mjs +43 -0
- package/dist/{registrar-sandbox-BF3cYO3n.mjs → registrar-sandbox-BPNGf65G.mjs} +11 -9
- package/dist/{reporting-BWm9jIF8.mjs → reporting-5yFNXbJg.mjs} +1 -1
- package/dist/{request-headers-BRxv6NkA.mjs → request-headers-DXvswze2.mjs} +1 -1
- package/dist/request-tracers-BarLZY95.mjs +4 -0
- package/dist/{resource-sharing-C186jZv0.mjs → resource-sharing-BVEwBPs8.mjs} +19 -19
- package/dist/{rules-DYnGIU_0.mjs → rules-_C31X4Jz.mjs} +6 -6
- package/dist/{rulesets-BcNrbVcq.mjs → rulesets-8RwxoFhG.mjs} +6 -6
- package/dist/{rum-BDyRecfp.mjs → rum-CAUcpXpM.mjs} +6 -6
- package/dist/{run-BvDCuZ8q.mjs → run-DtFLvOHB.mjs} +1 -1
- package/dist/run-LcOb9rhI.mjs +2 -0
- package/dist/{schema-flags-DcKjAxI1.mjs → schema-flags-DibfxEF6.mjs} +1 -1
- package/dist/{scim-zn-CNCsc.mjs → scim-DX5XrQ4w.mjs} +1 -1
- package/dist/{secrets-store-CFhyQUV6.mjs → secrets-store-DSqqrr25.mjs} +1 -1
- package/dist/{security-insights-D8XgtCed.mjs → security-insights-FSktO04S.mjs} +1 -1
- package/dist/{security-txt-CCM-Vro0.mjs → security-txt-D2g3lQdg.mjs} +1 -1
- package/dist/{shared-ouAF7o4S.mjs → shared-eefMO8R4.mjs} +1 -1
- package/dist/smart-shield-IVb2sR0C.mjs +24 -0
- package/dist/{snippets-B2jBY0m_.mjs → snippets-cWwWficN.mjs} +2 -2
- package/dist/{spawn-DQttFH05.mjs → spawn-BW2bJmKO.mjs} +1 -1
- package/dist/{spectrum-Cf_4cGE8.mjs → spectrum-DYiIBYRB.mjs} +1 -1
- package/dist/{speed-DoXdyIYK.mjs → speed-C7uiW2Wf.mjs} +1 -1
- package/dist/{sql-Bze4h80q.mjs → sql-TGV8qQMj.mjs} +1 -1
- package/dist/{src-BguQDHjS.mjs → src-BUH-P_zd.mjs} +5 -5
- package/dist/ssl-xQP_HbWN.mjs +139 -0
- package/dist/{stream-BcReYIHJ.mjs → stream-CfWgj8Cr.mjs} +55 -55
- package/dist/{submit-ldFVNfNC.mjs → submit-DxGr1T40.mjs} +1 -1
- package/dist/tags-LEJ2VYhQ.mjs +23 -0
- package/dist/{telemetry-Cojgz4Sv.mjs → telemetry-BHne10Yy.mjs} +1 -1
- package/dist/telemetry-BavSU4ku.mjs +2 -0
- package/dist/{tenant-AZ0EAsmT.mjs → tenant-7d5vwc6K.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-aozjaasc.mjs → tenant-custom-nameservers-BkxlPr5O.mjs} +1 -1
- package/dist/{tunnels-CXez5LPB.mjs → tunnels-DlGODvwT.mjs} +4 -4
- package/dist/{turnstile-B2NQ8Nsk.mjs → turnstile-DhLkdhij.mjs} +5 -5
- package/dist/update-check-nLfkSfdz.mjs +2 -0
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{update-check-BlyKN8m0.mjs → update-check-wvjOsnGK.mjs} +1 -1
- package/dist/{url-info-D_UqGiWD.mjs → url-info-CeoV5dBc.mjs} +1 -1
- package/dist/{url-normalization-CF1YHpIN.mjs → url-normalization-9NoaoRNh.mjs} +1 -1
- package/dist/{url-scanner-ChF3GO2U.mjs → url-scanner-w_-Sumz-.mjs} +8 -8
- package/dist/{user-BfWRsdJh.mjs → user-D33B3alX.mjs} +59 -59
- package/dist/{vectorize-CRYbWKg5.mjs → vectorize-Wp9De13y.mjs} +17 -17
- package/dist/version-B2RUUqGT.mjs +2 -0
- package/dist/{waiting-rooms-Crp7MVd9.mjs → waiting-rooms-BE8FloRd.mjs} +13 -13
- package/dist/{web-assets-CgyrPnT-.mjs → web-assets-ew0iaP7c.mjs} +35 -35
- package/dist/{web3-Cd0Yd0eQ.mjs → web3-BUyXBaqq.mjs} +6 -6
- package/dist/{workers-builds-f2nVw7EZ.mjs → workers-builds-DzU9NGno.mjs} +7 -7
- package/dist/{workers-for-platforms-DjeKp2uy.mjs → workers-for-platforms-B4xzFNxJ.mjs} +25 -22
- package/dist/{workers-CTwJpTfJ.mjs → workers-pP5tsDbD.mjs} +25 -22
- package/dist/{workers-vpc-B_L3TEg2.mjs → workers-vpc-Bre_t9Al.mjs} +1 -1
- package/dist/{workflows-CBPGf65x.mjs → workflows-DXYGKtqq.mjs} +1 -1
- package/dist/wrangler-migration-R9TQ_4Qd.mjs +946 -0
- package/dist/zaraz-DoH4QD0u.mjs +22 -0
- package/dist/{zero-trust-B9xY8zcn.mjs → zero-trust-DKt20rzE.mjs} +461 -458
- package/dist/{zone-CmwVqTI2.mjs → zone-BXM3p0JR.mjs} +1 -1
- package/dist/{zones-Bf0VVpMf.mjs → zones-CJdtqEBx.mjs} +21 -21
- package/package.json +11 -11
- package/dist/account-tags-povXTDAu.mjs +0 -15
- package/dist/ai-search-CJ3b8eot.mjs +0 -79
- package/dist/auth-OFqV2M4q.mjs +0 -2
- package/dist/body-parser-DkHKPkJ7.mjs +0 -2
- package/dist/browser-run-CfQ30dB6.mjs +0 -42
- package/dist/build-Bm6kGyzo.mjs +0 -2
- package/dist/certificate-authorities-BdMRaOnD.mjs +0 -6
- package/dist/cli-CsnoQloF.mjs +0 -6
- package/dist/client-certificates-CuWGvZSr.mjs +0 -13
- package/dist/cps-VRP794c5.mjs +0 -6
- package/dist/csam-scanner-C1jOgXVu.mjs +0 -10
- package/dist/ct-alerting-Y9vfa6Fo.mjs +0 -5
- package/dist/custom-certificates-CojTEC0E.mjs +0 -17
- package/dist/custom-pages-M4RUxcn6.mjs +0 -21
- package/dist/dcv-delegation-KOO8syyQ.mjs +0 -4
- package/dist/healthchecks-4Hz-6xYi.mjs +0 -22
- package/dist/keyless-certificates-B4ta_OGS.mjs +0 -13
- package/dist/keys-B9zvFzrf.mjs +0 -4
- package/dist/load-balancers-CWd9mSWM.mjs +0 -76
- package/dist/mtls-certificates-B5AWTU6u.mjs +0 -13
- package/dist/organization-CXAM41sd.mjs +0 -71
- package/dist/origin-ca-certificates-DwhYV3m_.mjs +0 -11
- package/dist/origin-tls-client-auth-COSxTc2q.mjs +0 -30
- package/dist/pages-DuGcBC6k.mjs +0 -54
- package/dist/pay-per-crawl-B3_Gn9Cj.mjs +0 -38
- package/dist/precursor-VobQf--m.mjs +0 -4
- package/dist/previews-DkwFHNRx.mjs +0 -7
- package/dist/registrar-X1YLlnmg.mjs +0 -43
- package/dist/request-tracers-CHWpiejG.mjs +0 -4
- package/dist/resource-tagging-BTagOZli.mjs +0 -4
- package/dist/run-roYb_Odh.mjs +0 -2
- package/dist/smart-shield-DwW7N92r.mjs +0 -24
- package/dist/ssl-u_0gUhPA.mjs +0 -45
- package/dist/tags-D_Hc_A-r.mjs +0 -4
- package/dist/telemetry-Ct_2AaO4.mjs +0 -2
- package/dist/update-check-BnGDxswi.mjs +0 -2
- package/dist/values-CLfxkAUJ.mjs +0 -4
- package/dist/version-CVlh2Zaq.mjs +0 -2
- package/dist/wrangler-migration-DxTB5yPT.mjs +0 -2
- package/dist/zaraz-3VDxl0gF.mjs +0 -22
|
@@ -1,139 +1,139 @@
|
|
|
1
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-
|
|
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-Db1KT0vm.mjs";import{a as i,t as a}from"./context-C_a8oSY9.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-Q5w9PNTT.mjs";import{t as l}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{a as u,i as d,n as f,r as p,t as m}from"./body-parser-DnBfDdx3.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-C0hKSr-R.mjs";import{n as ee,t as te}from"./raw-fetch-CEOuoKl9.mjs";var ne={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules`};function re(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules bulk-delete
|
|
3
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
|
|
5
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 ie={command:`bulk-delete`,describe:`Delete all DNS Protection rules.`,builder:re,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(ne,{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 ae(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules create
|
|
6
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
|
|
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 oe={command:`create`,describe:`Create DNS Protection rule.`,builder:ae,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?m({block_any_queries:e[`block-any-queries`],burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:h(e.name,`name`,`text`),profile_sensitivity:h(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:h(e.scope,`scope`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.name===void 0&&(e.name=await g(`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 g(`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 g(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.scope===void 0&&(e.scope=await g(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let u=m({block_any_queries:e[`block-any-queries`],burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:h(e.name,`name`,`text`),profile_sensitivity:h(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:h(e.scope,`scope`,`text`)}),d=await c(`Creating`,async()=>n.send(y,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var se={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules/${t.rule_id}`};function ce(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules delete <rule-id>
|
|
8
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
|
|
10
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 le={command:`delete <rule-id>`,describe:`Delete DNS Protection rule.`,builder:ce,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(se,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Deleted`})})};var ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules/${t.rule_id}`};function de(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules get <rule-id>
|
|
11
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
|
|
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 fe={command:`get <rule-id>`,describe:`Get DNS Protection rule.`,builder:de,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(ue,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Loaded`})})};var pe={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 me(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules list
|
|
13
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
|
|
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 he={command:`list`,describe:`List all DNS Protection rules.`,builder:me,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(pe,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var ge={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/advanced_dns_protection/configs/dns_protection/rules/${t.rule_id}`,body:`json`};function _e(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules update <rule-id>
|
|
15
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
|
|
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 ve={command:`update <rule-id>`,describe:`Update DNS Protection rule.`,builder:_e,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?m({block_any_queries:e[`block-any-queries`],burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:h(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(ge,{body:t,account_id:l,rule_id:e[`rule-id`]}));o(r,{successLabel:`Updated`});return}let u=m({block_any_queries:e[`block-any-queries`],burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:h(e[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}),d=await c(`Updating`,async()=>n.send(ge,{body:u,account_id:l,rule_id:e[`rule-id`]}));o(d,{successLabel:`Updated`})})},ye={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(ie).command(oe).command(le).command(fe).command(he).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},be={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xe={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ce={command:`advanced-dns-protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var we={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist`};function Te(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist bulk-delete
|
|
17
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
|
|
19
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Ee={command:`bulk-delete`,describe:`Delete all allowlist prefixes.`,builder:Te,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
19
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(we,{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 De(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist create
|
|
20
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
|
|
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 Oe={command:`create`,describe:`Create allowlist prefix.`,builder:De,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?m({comment:h(e.comment,`comment`,`text`),enabled:e.enabled,prefix:h(e.prefix,`prefix`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`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 g(`prefix`,`The allowlist prefix to add in CIDR format.`));let u=m({comment:h(e.comment,`comment`,`text`),enabled:e.enabled,prefix:h(e.prefix,`prefix`,`text`)}),d=await c(`Creating`,async()=>n.send(b,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var ke={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 Ae(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist list
|
|
22
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
|
|
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 je={command:`list`,describe:`List all allowlist prefixes.`,builder:Ae,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(ke,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var Me={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist/${t.prefix_id}`};function Ne(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix delete <prefix-id>
|
|
24
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
|
|
26
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Pe={command:`delete <prefix-id>`,describe:`Delete allowlist prefix.`,builder:Ne,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
26
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Me,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Deleted`})})};var Fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/allowlist/${t.prefix_id}`};function Ie(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix get <prefix-id>
|
|
27
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
|
|
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 Le={command:`get <prefix-id>`,describe:`Get allowlist prefix.`,builder:Ie,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(Fe,{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 Re(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix update <prefix-id>
|
|
29
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
|
|
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 ze={command:`update <prefix-id>`,describe:`Update allowlist prefix.`,builder:Re,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?m({comment:h(e.comment,`comment`,`text`),enabled:e.enabled}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({comment:h(e.comment,`comment`,`text`),enabled:e.enabled}),d=await c(`Updating`,async()=>n.send(x,{body:u,account_id:l,prefix_id:e[`prefix-id`]}));o(d,{successLabel:`Updated`})})},Be={command:`prefix`,describe:`Operations for advanced-tcp-protection.configs.allowlist.prefix`,builder:e=>e.command(Pe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ve={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist`,builder:e=>e.command(Ee).command(Oe).command(je).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var He={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes`};function Ue(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk-delete
|
|
31
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
|
|
33
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 We={command:`bulk-delete`,describe:`Delete all prefixes.`,builder:Ue,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
33
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(He,{account_id:l}));o(u,{successLabel:`Deleted`})})};var Ge={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/bulk`,body:`json`};function Ke(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk create
|
|
34
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
|
|
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 qe={command:`create`,describe:`Create multiple prefixes.`,builder:Ke,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:f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(Ge,{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.`)})},Je={command:`bulk`,describe:`Operations for advanced-tcp-protection.configs.prefixes.bulk`,builder:e=>e.command(qe).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 Ye(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes create
|
|
36
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
|
|
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 Xe={command:`create`,describe:`Create prefix.`,builder:Ye,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?m({comment:h(e.comment,`comment`,`text`),excluded:e.excluded,prefix:h(e.prefix,`prefix`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`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 g(`prefix`,`The prefix to add in CIDR format.`));let u=m({comment:h(e.comment,`comment`,`text`),excluded:e.excluded,prefix:h(e.prefix,`prefix`,`text`)}),d=await c(`Creating`,async()=>n.send(S,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var Ze={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/${t.prefix_id}`};function Qe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes delete <prefix-id>
|
|
38
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
|
|
40
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 $e={command:`delete <prefix-id>`,describe:`Delete prefix.`,builder:Qe,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
40
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Ze,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Deleted`})})};var et={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/prefixes/${t.prefix_id}`};function tt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes get <prefix-id>
|
|
41
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
|
|
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 nt={command:`get <prefix-id>`,describe:`Get prefix.`,builder:tt,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(et,{account_id:l,prefix_id:e[`prefix-id`]}));o(u,{successLabel:`Loaded`})})};var rt={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 it(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes list
|
|
43
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
|
|
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 at={command:`list`,describe:`List all prefixes.`,builder:it,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(rt,{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 ot(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes update <prefix-id>
|
|
45
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
|
|
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 st={command:`update <prefix-id>`,describe:`Update prefix.`,builder:ot,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?m({comment:h(e.comment,`comment`,`text`),excluded:e.excluded}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({comment:h(e.comment,`comment`,`text`),excluded:e.excluded}),d=await c(`Updating`,async()=>n.send(C,{body:u,account_id:l,prefix_id:e[`prefix-id`]}));o(d,{successLabel:`Updated`})})},ct={command:`prefixes`,describe:`Operations for advanced-tcp-protection.configs.prefixes`,builder:e=>e.command(We).command(Xe).command($e).command(nt).command(at).command(st).command(Je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var lt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters`};function ut(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters bulk-delete
|
|
47
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
|
|
49
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 dt={command:`bulk-delete`,describe:`Delete all SYN Protection filters.`,builder:ut,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
49
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(lt,{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 ft(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters create
|
|
50
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
|
|
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 pt={command:`create`,describe:`Create a SYN Protection filter.`,builder:ft,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?m({expression:h(e.expression,`expression`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`expression`,`The filter expression.`));let u=m({expression:h(e.expression,`expression`,`text`)}),d=await c(`Creating`,async()=>n.send(w,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var mt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t.filter_id}`};function ht(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters delete <filter-id>
|
|
52
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
|
|
54
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 gt={command:`delete <filter-id>`,describe:`Delete SYN Protection filter.`,builder:ht,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
54
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(mt,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Deleted`})})};var _t={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t.filter_id}`};function vt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters get <filter-id>
|
|
55
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
|
|
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 yt={command:`get <filter-id>`,describe:`Get SYN Protection filter.`,builder:vt,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(_t,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Loaded`})})};var bt={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 xt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters list
|
|
57
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
|
|
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 St={command:`list`,describe:`List all SYN Protection filters.`,builder:xt,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(bt,{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 Ct(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters update <filter-id>
|
|
59
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
|
|
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 wt={command:`update <filter-id>`,describe:`Update SYN Protection filter.`,builder:Ct,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?m({expression:h(e.expression,`expression`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({expression:h(e.expression,`expression`,`text`)}),d=await c(`Updating`,async()=>n.send(T,{body:u,account_id:l,filter_id:e[`filter-id`]}));o(d,{successLabel:`Updated`})})},Tt={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters`,builder:e=>e.command(dt).command(pt).command(gt).command(yt).command(St).command(wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Et={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules`};function Dt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules bulk-delete
|
|
61
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
|
|
63
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Ot={command:`bulk-delete`,describe:`Delete all SYN Protection rules.`,builder:Dt,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
63
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Et,{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 kt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules create
|
|
64
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
|
|
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 At={command:`create`,describe:`Create SYN Protection rule.`,builder:kt,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?m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:h(e[`mitigation-type`],`mitigation-type`,`text`),name:h(e.name,`name`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:h(e.scope,`scope`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.name===void 0&&(e.name=await g(`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 g(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.scope===void 0&&(e.scope=await g(`scope`,`The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let u=m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:h(e[`mitigation-type`],`mitigation-type`,`text`),name:h(e.name,`name`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:h(e.scope,`scope`,`text`)}),d=await c(`Creating`,async()=>n.send(E,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var jt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t.rule_id}`};function Mt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules delete <rule-id>
|
|
66
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
|
|
68
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Nt={command:`delete <rule-id>`,describe:`Delete SYN Protection rule.`,builder:Mt,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
68
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(jt,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Deleted`})})};var Pt={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t.rule_id}`};function Ft(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules get <rule-id>
|
|
69
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
|
|
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 It={command:`get <rule-id>`,describe:`Get SYN Protection rule.`,builder:Ft,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(Pt,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Loaded`})})};var Lt={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 Rt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules list
|
|
71
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
|
|
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 zt={command:`list`,describe:`List all SYN Protection rules.`,builder:Rt,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(Lt,{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 Bt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules update <rule-id>
|
|
73
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
|
|
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 Vt={command:`update <rule-id>`,describe:`Update SYN Protection rule.`,builder:Bt,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?m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:h(e[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:h(e[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}),d=await c(`Updating`,async()=>n.send(D,{body:u,account_id:l,rule_id:e[`rule-id`]}));o(d,{successLabel:`Updated`})})},Ht={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules`,builder:e=>e.command(Ot).command(At).command(Nt).command(It).command(zt).command(Vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ut={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.syn.protection`,builder:e=>e.command(Tt).command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Wt={command:`syn`,describe:`Operations for advanced-tcp-protection.configs.syn`,builder:e=>e.command(Ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Gt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`};function Kt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters bulk-delete
|
|
75
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
|
|
77
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 qt={command:`bulk-delete`,describe:`Delete all TCP Flow Protection filters.`,builder:Kt,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
77
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Gt,{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 Jt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters create
|
|
78
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
|
|
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 Yt={command:`create`,describe:`Create a TCP Flow Protection filter.`,builder:Jt,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?m({expression:h(e.expression,`expression`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`expression`,`The filter expression.`));let u=m({expression:h(e.expression,`expression`,`text`)}),d=await c(`Creating`,async()=>n.send(O,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var Xt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t.filter_id}`};function Zt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters delete <filter-id>
|
|
80
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
|
|
82
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Qt={command:`delete <filter-id>`,describe:`Delete TCP Flow Protection filter.`,builder:Zt,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
82
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Xt,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Deleted`})})};var $t={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t.filter_id}`};function en(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters get <filter-id>
|
|
83
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
|
|
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 tn={command:`get <filter-id>`,describe:`Get TCP Flow Protection filter.`,builder:en,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($t,{account_id:l,filter_id:e[`filter-id`]}));o(u,{successLabel:`Loaded`})})};var nn={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 rn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters list
|
|
85
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
|
|
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 an={command:`list`,describe:`List all TCP Flow Protection filters.`,builder:rn,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(nn,{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 on(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters update <filter-id>
|
|
87
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
|
|
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 sn={command:`update <filter-id>`,describe:`Update TCP Flow Protection filter.`,builder:on,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?m({expression:h(e.expression,`expression`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({expression:h(e.expression,`expression`,`text`)}),d=await c(`Updating`,async()=>n.send(k,{body:u,account_id:l,filter_id:e[`filter-id`]}));o(d,{successLabel:`Updated`})})},cn={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters`,builder:e=>e.command(qt).command(Yt).command(Qt).command(tn).command(an).command(sn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ln={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`};function un(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules bulk-delete
|
|
89
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
|
|
91
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 dn={command:`bulk-delete`,describe:`Delete all TCP Flow Protection rules.`,builder:un,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
91
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(ln,{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 fn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules create
|
|
92
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
|
|
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 pn={command:`create`,describe:`Create TCP Flow Protection rule.`,builder:fn,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?m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:h(e.name,`name`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:h(e.scope,`scope`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.name===void 0&&(e.name=await g(`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 g(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),e.scope===void 0&&(e.scope=await g(`scope`,`The scope for the TCP Flow Protection rule.`));let u=m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),name:h(e.name,`name`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:h(e.scope,`scope`,`text`)}),d=await c(`Creating`,async()=>n.send(A,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var mn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t.rule_id}`};function hn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules delete <rule-id>
|
|
94
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
|
|
96
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 gn={command:`delete <rule-id>`,describe:`Delete TCP Flow Protection rule.`,builder:hn,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
96
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(mn,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Deleted`})})};var _n={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t.rule_id}`};function vn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules get <rule-id>
|
|
97
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
|
|
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 yn={command:`get <rule-id>`,describe:`Get TCP Flow Protection rule.`,builder:vn,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(_n,{account_id:l,rule_id:e[`rule-id`]}));o(u,{successLabel:`Loaded`})})};var bn={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 xn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules list
|
|
99
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
|
|
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 Sn={command:`list`,describe:`List all TCP Flow Protection rules.`,builder:xn,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(bn,{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 Cn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules update <rule-id>
|
|
101
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
|
|
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 wn={command:`update <rule-id>`,describe:`Update TCP Flow Protection rule.`,builder:Cn,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?m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({burst_sensitivity:h(e[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:h(e[`rate-sensitivity`],`rate-sensitivity`,`text`)}),d=await c(`Updating`,async()=>n.send(j,{body:u,account_id:l,rule_id:e[`rule-id`]}));o(d,{successLabel:`Updated`})})},Tn={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules`,builder:e=>e.command(dn).command(pn).command(gn).command(yn).command(Sn).command(wn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},En={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection`,builder:e=>e.command(cn).command(Tn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Dn={command:`flow`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow`,builder:e=>e.command(En).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var On={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/advanced_tcp_protection/configs/tcp_protection_status`};function kn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status get
|
|
103
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
|
|
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 An={command:`get`,describe:`Get protection status.`,builder:kn,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(On,{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 jn(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status update
|
|
105
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
|
|
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 Mn={command:`update`,describe:`Update protection status.`,builder:jn,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?m({enabled:e.enabled}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({enabled:e.enabled}),d=await c(`Updating`,async()=>n.send(M,{body:u,account_id:l}));o(d,{successLabel:`Updated`})})},Nn={command:`status`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection.status`,builder:e=>e.command(An).command(Mn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Pn={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection`,builder:e=>e.command(Nn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fn={command:`tcp`,describe:`Operations for advanced-tcp-protection.configs.tcp`,builder:e=>e.command(Dn).command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},In={command:`configs`,describe:`Operations for advanced-tcp-protection.configs`,builder:e=>e.command(Ve).command(ct).command(Wt).command(Fn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ln={command:`advanced-tcp-protection`,describe:`Advanced Tcp Protection operations`,builder:e=>e.command(In).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var N={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/apps`,body:`json`};function Rn(e){return e.usage(`$0 magic-transit apps create
|
|
107
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
|
|
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 zn={command:`create`,describe:`Create a new App`,builder:Rn,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?m({hostnames:e.hostnames,name:h(e.name,`name`,`text`),type:h(e.type,`type`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`name`,`Display name for the app.`)),e.type===void 0&&(e.type=await g(`type`,`Category of the app.`));let u=m({hostnames:e.hostnames,name:h(e.name,`name`,`text`),type:h(e.type,`type`,`text`)}),d=await c(`Creating`,async()=>n.send(N,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var Bn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/apps/${t.account_app_id}`};function Vn(e){return e.usage(`$0 magic-transit apps delete <account-app-id>
|
|
109
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
|
|
111
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Hn={command:`delete <account-app-id>`,describe:`Delete Account App`,builder:Vn,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
111
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Bn,{account_id:l,account_app_id:e[`account-app-id`]}));o(u,{successLabel:`Deleted`})})};var Un={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/apps`};function Wn(e){return e.usage(`$0 magic-transit apps list
|
|
112
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
|
|
113
|
+
Lists Apps associated with an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gn={command:`list`,describe:`List Apps`,builder:Wn,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(Un,{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 Kn(e){return e.usage(`$0 magic-transit apps update <account-app-id>
|
|
114
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
|
|
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 qn={command:`update <account-app-id>`,describe:`Update an App`,builder:Kn,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?m({hostnames:e.hostnames,name:h(e.name,`name`,`text`),type:h(e.type,`type`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({hostnames:e.hostnames,name:h(e.name,`name`,`text`),type:h(e.type,`type`,`text`)}),d=await c(`Updating`,async()=>n.send(P,{body:u,account_id:l,account_app_id:e[`account-app-id`]}));o(d,{successLabel:`Updated`})})},Jn={command:`apps`,describe:`Application-aware traffic policies for Magic WAN that steer traffic by app type`,builder:e=>e.command(zn).command(Hn).command(Gn).command(qn).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 Yn(e){return e.usage(`$0 magic-transit bgp-filter-profiles create
|
|
116
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=>
|
|
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=>h(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 Xn={command:`create`,describe:`Create BGP Filter Profile`,builder:Yn,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?m({description:h(e.description,`description`,`text`),match_action:e[`match-action`],name:h(e.name,`name`,`text`),targets:e.targets}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 _(`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 g(`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=m({description:h(e.description,`description`,`text`),match_action:e[`match-action`],name:h(e.name,`name`,`text`),targets:e.targets}),d=await c(`Creating`,async()=>n.send(F,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var Zn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles/${t.profile_id}`};function Qn(e){return e.usage(`$0 magic-transit bgp-filter-profiles delete <profile-id>
|
|
118
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
|
|
120
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 $n={command:`delete <profile-id>`,describe:`Delete BGP Filter Profile`,builder:Qn,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
120
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Zn,{account_id:l,profile_id:e[`profile-id`]}));o(u,{successLabel:`Deleted`})})};var er={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles/${t.profile_id}`};function tr(e){return e.usage(`$0 magic-transit bgp-filter-profiles get <profile-id>
|
|
121
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
|
|
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 nr={command:`get <profile-id>`,describe:`Get BGP Filter Profile`,builder:tr,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(er,{account_id:l,profile_id:e[`profile-id`]}));o(u,{successLabel:`Loaded`})})};var rr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/bgp/filter_profiles`};function ir(e){return e.usage(`$0 magic-transit bgp-filter-profiles list
|
|
123
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
|
|
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 ar={command:`list`,describe:`List BGP Filter Profiles`,builder:ir,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(rr,{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 or(e){return e.usage(`$0 magic-transit bgp-filter-profiles update <profile-id>
|
|
125
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=>
|
|
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=>h(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 sr={command:`update <profile-id>`,describe:`Update BGP Filter Profile`,builder:or,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?m({description:h(e.description,`description`,`text`),match_action:e[`match-action`],name:h(e.name,`name`,`text`),targets:e.targets}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({description:h(e.description,`description`,`text`),match_action:e[`match-action`],name:h(e.name,`name`,`text`),targets:e.targets}),d=await c(`Updating`,async()=>n.send(I,{body:u,account_id:l,profile_id:e[`profile-id`]}));o(d,{successLabel:`Updated`})})},cr={command:`bgp-filter-profiles`,describe:`BGP filter profiles for controlling which routes are allowed or denied on Magic Transit tunnels`,builder:e=>e.command(Xn).command($n).command(nr).command(ar).command(sr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var lr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/bgp/settings`};function ur(e){return e.usage(`$0 magic-transit bgp-settings get
|
|
127
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
|
|
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 dr={command:`get`,describe:`Get BGP Settings`,builder:ur,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(lr,{account_id:l}));o(u,{successLabel:`Loaded`})})};var L={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/bgp/settings`,body:`json`};function fr(e){return e.usage(`$0 magic-transit bgp-settings update
|
|
129
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
|
|
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 pr={command:`update`,describe:`Update BGP Settings`,builder:fr,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?m({cloudflare_asn:e[`cloudflare-asn`],redistribute:{"static:wan":e[`redistribute-static:wan`]}}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(L,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}let u=m({cloudflare_asn:e[`cloudflare-asn`],redistribute:{"static:wan":e[`redistribute-static:wan`]}}),d=await c(`Updating`,async()=>n.send(L,{body:u,account_id:l}));o(d,{successLabel:`Updated`})})},mr={command:`bgp-settings`,describe:`BGP settings for controlling default ASN and route redistribution on Magic Transit tunnels`,builder:e=>e.command(dr).command(pr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hr(e){return e.usage(`$0 magic-transit cf-interconnects bulk-update
|
|
131
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
|
|
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 gr={command:`bulk-update`,describe:`Update multiple interconnects`,builder:hr,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:f(e.body)});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/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/${d}/magic/cf_interconnects`,{headers:Object.keys(l).length>0?l:void 0}));o(p,{successLabel:`Updated`})})};function _r(e){return e.usage(`$0 magic-transit cf-interconnects get <cf-interconnect-id>
|
|
133
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
|
|
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 vr={command:`get <cf-interconnect-id>`,describe:`List interconnect Details`,builder:_r,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 yr(e){return e.usage(`$0 magic-transit cf-interconnects list
|
|
135
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
|
|
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 br={command:`list`,describe:`List interconnects`,builder:yr,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 xr(e){return e.usage(`$0 magic-transit cf-interconnects update <cf-interconnect-id>
|
|
137
137
|
|
|
138
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
139
|
|
|
@@ -150,34 +150,34 @@ character:
|
|
|
150
150
|
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
151
151
|
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
152
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=>
|
|
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=>h(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=>h(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=>h(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
154
|
use a /30 or /31 prefix. For GRE Interconnects, a /30 or /31 prefix
|
|
155
155
|
may be used. Version 1.5 interconnects require a /31 prefix and may
|
|
156
156
|
also use a prefix from the account's authorized prefixes; otherwise,
|
|
157
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
|
|
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 Sr={command:`update <cf-interconnect-id>`,describe:`Update interconnect`,builder:xr,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?m({automatic_return_routing:e[`automatic-return-routing`],bgp:{as_no:e[`bgp-as-no`],cloudflare_endpoint:h(e[`bgp-cloudflare-endpoint`],`bgp-cloudflare-endpoint`,`text`),customer_asn:e[`bgp-customer-asn`],customer_endpoint:h(e[`bgp-customer-endpoint`],`bgp-customer-endpoint`,`text`),export_filter_id:h(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},description:h(e.description,`description`,`text`),gre:{cloudflare_endpoint:h(e[`gre-cloudflare-endpoint`],`gre-cloudflare-endpoint`,`text`)},health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:h(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`],source:h(e[`health-check-source`],`health-check-source`,`text`)},interface_address:h(e[`interface-address`],`interface-address`,`text`),interface_address6:h(e[`interface-address6`],`interface-address6`,`text`),mtu:e.mtu,name:h(e.name,`name`,`text`)}):f(e.body)});return}let d=await r(e),p=e.local?t:await a();if(e.accountId=p,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(d,`PUT`,`/accounts/${p}/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`],h(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`],h(e[`bgp-customer-endpoint`],`bgp-customer-endpoint`,`text`)),e[`bgp-export-filter-id`]!==void 0&&u(g,[`bgp`,`export_filter_id`],h(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`],h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(g,[`bgp`,`md5_key`],h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e.description!==void 0&&u(g,[`description`],h(e.description,`description`,`text`)),e[`gre-cloudflare-endpoint`]!==void 0&&u(g,[`gre`,`cloudflare_endpoint`],h(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`],h(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`],h(e[`health-check-source`],`health-check-source`,`text`)),e[`interface-address`]!==void 0&&u(g,[`interface_address`],h(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(g,[`interface_address6`],h(e[`interface-address6`],`interface-address6`,`text`)),e.mtu!==void 0&&u(g,[`mtu`],e.mtu),e.name!==void 0&&u(g,[`name`],h(e.name,`name`,`text`));let _=await c(`Updating`,async()=>n(d,`PUT`,`/accounts/${p}/magic/cf_interconnects/${encodeURIComponent(String(e[`cf-interconnect-id`]))}`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Updated`})})},Cr={command:`cf-interconnects`,describe:`Cloudflare Network Interconnect (CNI) links for direct physical or virtual peering`,builder:e=>e.command(gr).command(vr).command(br).command(Sr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var wr={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites`,body:`json`};function Tr(e){return e.usage(`$0 magic-transit cf1-sites create
|
|
159
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
|
|
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 Er={command:`create`,describe:`Create CF1 Sites`,builder:Tr,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:f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(wr,{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 Dr={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}`};function Or(e){return e.usage(`$0 magic-transit cf1-sites delete <cf1-site-id>
|
|
161
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
|
|
163
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 kr={command:`delete <cf1-site-id>`,describe:`Delete CF1 Site`,builder:Or,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
163
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Dr,{account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(u,{successLabel:`Deleted`})})};var Ar={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}`};function jr(e){return e.usage(`$0 magic-transit cf1-sites get <cf1-site-id>
|
|
164
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
|
|
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 Mr={command:`get <cf1-site-id>`,describe:`Get CF1 Site`,builder:jr,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(Ar,{account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(u,{successLabel:`Loaded`})})};var Nr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites`};function Pr(e){return e.usage(`$0 magic-transit cf1-sites list
|
|
166
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
|
|
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 Fr={command:`list`,describe:`List CF1 Sites`,builder:Pr,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(Nr,{account_id:l}));o(u,{successLabel:`Loaded`})})};var Ir={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps`,body:`json`};function Lr(e){return e.usage(`$0 magic-transit cf1-sites ramps create <cf1-site-id>
|
|
168
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
|
|
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 Rr={command:`create <cf1-site-id>`,describe:`Create CF1 Site Ramps`,builder:Lr,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:f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(Ir,{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 zr={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps/${t.ramp_id}`};function Br(e){return e.usage(`$0 magic-transit cf1-sites ramps delete <ramp-id>
|
|
170
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
|
|
172
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Vr={command:`delete <ramp-id>`,describe:`Delete CF1 Site Ramp`,builder:Br,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
172
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(zr,{account_id:l,cf1_site_id:e[`cf1-site-id`],ramp_id:e[`ramp-id`]}));o(u,{successLabel:`Deleted`})})};var Hr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps/${t.ramp_id}`};function Ur(e){return e.usage(`$0 magic-transit cf1-sites ramps get <ramp-id>
|
|
173
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
|
|
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 Wr={command:`get <ramp-id>`,describe:`Get CF1 Site Ramp`,builder:Ur,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(Hr,{account_id:l,cf1_site_id:e[`cf1-site-id`],ramp_id:e[`ramp-id`]}));o(u,{successLabel:`Loaded`})})};var Gr={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/cf1_sites/${t.cf1_site_id}/ramps`};function Kr(e){return e.usage(`$0 magic-transit cf1-sites ramps list
|
|
175
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
|
|
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 qr={command:`list`,describe:`List CF1 Site Ramps`,builder:Kr,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(Gr,{account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(u,{successLabel:`Loaded`})})},Jr={command:`ramps`,describe:`Operations for cf1-sites.ramps`,builder:e=>e.command(Rr).command(Vr).command(Wr).command(qr).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 Yr(e){return e.usage(`$0 magic-transit cf1-sites update <cf1-site-id>
|
|
177
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
|
|
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 Xr={command:`update <cf1-site-id>`,describe:`Update CF1 Site`,builder:Yr,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?m({description:h(e.description,`description`,`text`),location:{lat:e[`location-lat`],long:e[`location-long`],name:h(e[`location-name`],`location-name`,`text`)},name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({description:h(e.description,`description`,`text`),location:{lat:e[`location-lat`],long:e[`location-long`],name:h(e[`location-name`],`location-name`,`text`)},name:h(e.name,`name`,`text`)}),d=await c(`Updating`,async()=>n.send(R,{body:u,account_id:l,cf1_site_id:e[`cf1-site-id`]}));o(d,{successLabel:`Updated`})})},Zr={command:`cf1-sites`,describe:`Operations for cf1-sites`,builder:e=>e.command(Er).command(kr).command(Mr).command(Fr).command(Xr).command(Jr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qr(e){return e.usage(`$0 magic-transit gre-tunnels bulk-update
|
|
179
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
|
|
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 $r={command:`bulk-update`,describe:`Update multiple GRE tunnels`,builder:Qr,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:f(e.body)});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/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/${d}/magic/gre_tunnels`,{headers:Object.keys(l).length>0?l:void 0}));o(p,{successLabel:`Updated`})})};function ei(e){return e.usage(`$0 magic-transit gre-tunnels create
|
|
181
181
|
|
|
182
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
183
|
|
|
@@ -194,18 +194,18 @@ character:
|
|
|
194
194
|
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
195
195
|
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
196
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=>
|
|
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=>h(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=>h(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=>h(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 ti={command:`create`,describe:`Create a GRE tunnel`,builder:ei,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?m({automatic_return_routing:e[`automatic-return-routing`],bgp:{customer_asn:e[`bgp-customer-asn`],export_filter_id:h(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_gre_endpoint:h(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`),customer_gre_endpoint:h(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`),description:h(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:h(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:h(e[`interface-address`],`interface-address`,`text`),interface_address6:h(e[`interface-address6`],`interface-address6`,`text`),mtu:e.mtu,name:h(e.name,`name`,`text`),ttl:e.ttl}):f(e.body)});return}let d=await r(e),p=e.local?t:await a();if(e.accountId=p,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n(d,`POST`,`/accounts/${p}/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 g(`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 g(`customer-gre-endpoint`,`The IP address assigned to the customer side of the GRE tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await g(`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 g(`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`],h(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`],h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(_,[`bgp`,`md5_key`],h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e[`cloudflare-gre-endpoint`]!==void 0&&u(_,[`cloudflare_gre_endpoint`],h(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`)),e[`customer-gre-endpoint`]!==void 0&&u(_,[`customer_gre_endpoint`],h(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],h(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`],h(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`],h(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],h(e[`interface-address6`],`interface-address6`,`text`)),e.mtu!==void 0&&u(_,[`mtu`],e.mtu),e.name!==void 0&&u(_,[`name`],h(e.name,`name`,`text`)),e.ttl!==void 0&&u(_,[`ttl`],e.ttl);let v=await c(`Creating`,async()=>n(d,`POST`,`/accounts/${p}/magic/gre_tunnels`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function ni(e){return e.usage(`$0 magic-transit gre-tunnels delete <gre-tunnel-id>
|
|
198
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
|
|
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
|
|
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 ri={command:`delete <gre-tunnel-id>`,describe:`Delete GRE Tunnel`,builder:ni,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 v({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 ii(e){return e.usage(`$0 magic-transit gre-tunnels get <gre-tunnel-id>
|
|
201
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
|
|
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 ai={command:`get <gre-tunnel-id>`,describe:`List GRE Tunnel Details`,builder:ii,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 oi(e){return e.usage(`$0 magic-transit gre-tunnels list
|
|
203
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
|
|
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 si={command:`list`,describe:`List GRE tunnels`,builder:oi,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 ci(e){return e.usage(`$0 magic-transit gre-tunnels update <gre-tunnel-id>
|
|
205
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=>
|
|
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=>h(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=>h(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=>h(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 li={command:`update <gre-tunnel-id>`,describe:`Update GRE Tunnel`,builder:ci,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?m({automatic_return_routing:e[`automatic-return-routing`],cloudflare_gre_endpoint:h(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`),customer_gre_endpoint:h(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`),description:h(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:h(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:h(e[`interface-address`],`interface-address`,`text`),interface_address6:h(e[`interface-address6`],`interface-address6`,`text`),mtu:e.mtu,name:h(e.name,`name`,`text`),ttl:e.ttl}):f(e.body)});return}let d=await r(e),p=e.local?t:await a();if(e.accountId=p,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(d,`PUT`,`/accounts/${p}/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 g(`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 g(`customer-gre-endpoint`,`The IP address assigned to the customer side of the GRE tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await g(`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 g(`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`],h(e[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`)),e[`customer-gre-endpoint`]!==void 0&&u(_,[`customer_gre_endpoint`],h(e[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],h(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`],h(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`],h(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],h(e[`interface-address6`],`interface-address6`,`text`)),e.mtu!==void 0&&u(_,[`mtu`],e.mtu),e.name!==void 0&&u(_,[`name`],h(e.name,`name`,`text`)),e.ttl!==void 0&&u(_,[`ttl`],e.ttl);let v=await c(`Updating`,async()=>n(d,`PUT`,`/accounts/${p}/magic/gre_tunnels/${encodeURIComponent(String(e[`gre-tunnel-id`]))}`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Updated`})})},ui={command:`gre-tunnels`,describe:`GRE tunnel endpoints that connect your network to Cloudflare for Magic Transit`,builder:e=>e.command($r).command(ti).command(ri).command(ai).command(si).command(li).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function di(e){return e.usage(`$0 magic-transit ipsec-tunnels bulk-update
|
|
207
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
|
|
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 fi={command:`bulk-update`,describe:`Update multiple IPsec tunnels`,builder:di,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:f(e.body)});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/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/${d}/magic/ipsec_tunnels`,{headers:Object.keys(l).length>0?l:void 0}));o(p,{successLabel:`Updated`})})};function pi(e){return e.usage(`$0 magic-transit ipsec-tunnels create
|
|
209
209
|
|
|
210
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
211
|
|
|
@@ -229,18 +229,18 @@ Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
|
229
229
|
|
|
230
230
|
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
231
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=>
|
|
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=>h(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=>h(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=>h(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 mi={command:`create`,describe:`Create an IPsec tunnel`,builder:pi,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?m({automatic_return_routing:e[`automatic-return-routing`],bgp:{customer_asn:e[`bgp-customer-asn`],export_filter_id:h(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_endpoint:h(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`),custom_remote_identities:{fqdn_id:h(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)},customer_endpoint:h(e[`customer-endpoint`],`customer-endpoint`,`text`),description:h(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:h(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:h(e[`interface-address`],`interface-address`,`text`),interface_address6:h(e[`interface-address6`],`interface-address6`,`text`),name:h(e.name,`name`,`text`),psk:h(e.psk,`psk`,`text`),replay_protection:e[`replay-protection`]}):f(e.body),sensitiveBodyPaths:[[`psk`]]});return}let d=await r(e),p=e.local?t:await a();if(e.accountId=p,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n(d,`POST`,`/accounts/${p}/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 g(`cloudflare-endpoint`,`The IP address assigned to the Cloudflare side of the IPsec tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await g(`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 g(`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`],h(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`],h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(_,[`bgp`,`md5_key`],h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e[`cloudflare-endpoint`]!==void 0&&u(_,[`cloudflare_endpoint`],h(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`)),e[`custom-remote-identities-fqdn-id`]!==void 0&&u(_,[`custom_remote_identities`,`fqdn_id`],h(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)),e[`customer-endpoint`]!==void 0&&u(_,[`customer_endpoint`],h(e[`customer-endpoint`],`customer-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],h(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`],h(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`],h(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],h(e[`interface-address6`],`interface-address6`,`text`)),e.name!==void 0&&u(_,[`name`],h(e.name,`name`,`text`)),e.psk!==void 0&&u(_,[`psk`],h(e.psk,`psk`,`text`)),e[`replay-protection`]!==void 0&&u(_,[`replay_protection`],e[`replay-protection`]);let v=await c(`Creating`,async()=>n(d,`POST`,`/accounts/${p}/magic/ipsec_tunnels`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function hi(e){return e.usage(`$0 magic-transit ipsec-tunnels delete <ipsec-tunnel-id>
|
|
233
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
|
|
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
|
|
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 gi={command:`delete <ipsec-tunnel-id>`,describe:`Delete IPsec Tunnel`,builder:hi,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 v({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 _i(e){return e.usage(`$0 magic-transit ipsec-tunnels get <ipsec-tunnel-id>
|
|
236
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
|
|
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 vi={command:`get <ipsec-tunnel-id>`,describe:`List IPsec tunnel details`,builder:_i,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 yi(e){return e.usage(`$0 magic-transit ipsec-tunnels list
|
|
238
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
|
|
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 bi={command:`list`,describe:`List IPsec tunnels`,builder:yi,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 xi={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/ipsec_tunnels/${t.ipsec_tunnel_id}/psk_generate`};function Si(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-generate <ipsec-tunnel-id>
|
|
240
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
|
|
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 Ci={command:`psk-generate <ipsec-tunnel-id>`,describe:`Generate Pre-Shared Key (PSK) for IPsec tunnels`,builder:Si,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(xi,{account_id:l,ipsec_tunnel_id:e[`ipsec-tunnel-id`]}));o(u,{successLabel:`Created`})})};var wi={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/ipsec_tunnels/psk`,query:[`validate_only`],body:`json`};function Ti(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-set
|
|
242
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
|
|
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 Ei={command:`psk-set`,describe:`Set Pre-Shared Keys (PSK) for IPsec tunnels`,builder:Ti,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?m({psks:d(e.psks,`psks`)}):f(e.body)});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.body){let t=f(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(wi,{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 p=m({psks:d(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(wi,{body:p,account_id:u,...n}));o(h,{successLabel:`Created`})})};function Di(e){return e.usage(`$0 magic-transit ipsec-tunnels update <ipsec-tunnel-id>
|
|
244
244
|
|
|
245
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
246
|
|
|
@@ -264,123 +264,123 @@ Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
|
264
264
|
|
|
265
265
|
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
266
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=>
|
|
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=>h(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=>h(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=>h(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 Oi={command:`update <ipsec-tunnel-id>`,describe:`Update IPsec Tunnel`,builder:Di,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?m({automatic_return_routing:e[`automatic-return-routing`],bgp:{customer_asn:e[`bgp-customer-asn`],export_filter_id:h(e[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:e[`bgp-extra-prefixes`],import_filter_id:h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_endpoint:h(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`),custom_remote_identities:{fqdn_id:h(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)},customer_endpoint:h(e[`customer-endpoint`],`customer-endpoint`,`text`),description:h(e.description,`description`,`text`),health_check:{enabled:e[`health-check-enabled`],rate:e[`health-check-rate`],target:{saved:h(e[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:e[`health-check-type`],direction:e[`health-check-direction`]},interface_address:h(e[`interface-address`],`interface-address`,`text`),interface_address6:h(e[`interface-address6`],`interface-address6`,`text`),name:h(e.name,`name`,`text`),psk:h(e.psk,`psk`,`text`),replay_protection:e[`replay-protection`]}):f(e.body),sensitiveBodyPaths:[[`psk`]]});return}let d=await r(e),p=e.local?t:await a();if(e.accountId=p,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(d,`PUT`,`/accounts/${p}/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 g(`cloudflare-endpoint`,`The IP address assigned to the Cloudflare side of the IPsec tunnel.`)),e[`interface-address`]===void 0&&(e[`interface-address`]=await g(`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 g(`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`],h(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`],h(e[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),e[`bgp-md5-key`]!==void 0&&u(_,[`bgp`,`md5_key`],h(e[`bgp-md5-key`],`bgp-md5-key`,`text`)),e[`cloudflare-endpoint`]!==void 0&&u(_,[`cloudflare_endpoint`],h(e[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`)),e[`custom-remote-identities-fqdn-id`]!==void 0&&u(_,[`custom_remote_identities`,`fqdn_id`],h(e[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)),e[`customer-endpoint`]!==void 0&&u(_,[`customer_endpoint`],h(e[`customer-endpoint`],`customer-endpoint`,`text`)),e.description!==void 0&&u(_,[`description`],h(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`],h(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`],h(e[`interface-address`],`interface-address`,`text`)),e[`interface-address6`]!==void 0&&u(_,[`interface_address6`],h(e[`interface-address6`],`interface-address6`,`text`)),e.name!==void 0&&u(_,[`name`],h(e.name,`name`,`text`)),e.psk!==void 0&&u(_,[`psk`],h(e.psk,`psk`,`text`)),e[`replay-protection`]!==void 0&&u(_,[`replay_protection`],e[`replay-protection`]);let v=await c(`Updating`,async()=>n(d,`PUT`,`/accounts/${p}/magic/ipsec_tunnels/${encodeURIComponent(String(e[`ipsec-tunnel-id`]))}`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Updated`})})},ki={command:`ipsec-tunnels`,describe:`IPsec tunnel endpoints with pre-shared key management for encrypted transit`,builder:e=>e.command(fi).command(mi).command(gi).command(vi).command(bi).command(Ci).command(Ei).command(Oi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ai={method:`POST`,path:t=>e`/accounts/${t.account_id}/pcaps`,body:`json`};function ji(e){return e.usage(`$0 magic-transit pcaps create
|
|
268
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
|
|
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 Mi={command:`create`,describe:`Create PCAP request`,builder:ji,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:f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(Ai,{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 Ni(e){return e.usage(`$0 magic-transit pcaps download get <pcap-id>
|
|
270
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
|
|
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 Pi={command:`get <pcap-id>`,describe:`Download Simple PCAP`,builder:Ni,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()=>te(`/accounts/${n}/pcaps/${encodeURIComponent(String(e[`pcap-id`]))}/download`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));ee(e.text===!0?o.toString(`utf-8`):o)})},Fi={command:`download`,describe:`Operations for pcaps.download`,builder:e=>e.command(Pi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ii={method:`GET`,path:t=>e`/accounts/${t.account_id}/pcaps/${t.pcap_id}`};function Li(e){return e.usage(`$0 magic-transit pcaps get <pcap-id>
|
|
272
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
|
|
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 Ri={command:`get <pcap-id>`,describe:`Get PCAP request`,builder:Li,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(Ii,{account_id:l,pcap_id:e[`pcap-id`]}));o(u,{successLabel:`Loaded`})})};var zi={method:`GET`,path:t=>e`/accounts/${t.account_id}/pcaps`};function Bi(e){return e.usage(`$0 magic-transit pcaps list
|
|
274
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
|
|
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 Vi={command:`list`,describe:`List packet capture requests`,builder:Bi,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(zi,{account_id:l}));o(u,{successLabel:`Loaded`})})};var z={method:`POST`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership`,body:`json`};function Hi(e){return e.usage(`$0 magic-transit pcaps ownership create
|
|
276
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
|
|
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 Ui={command:`create`,describe:`Add buckets for full packet captures`,builder:Hi,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?m({destination_conf:h(e[`destination-conf`],`destination-conf`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`destination-conf`,"The full URI for the bucket. This field only applies to `full` packet captures."));let u=m({destination_conf:h(e[`destination-conf`],`destination-conf`,`text`)}),d=await c(`Creating`,async()=>n.send(z,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var Wi={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership/${t.ownership_id}`,response:!1};function Gi(e){return e.usage(`$0 magic-transit pcaps ownership delete <ownership-id>
|
|
278
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
|
|
280
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Ki={command:`delete <ownership-id>`,describe:`Delete buckets for full packet captures`,builder:Gi,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
280
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Wi,{account_id:l,ownership_id:e[`ownership-id`]}));o(u,{successLabel:`Deleted`})})};var qi={method:`GET`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership`};function Ji(e){return e.usage(`$0 magic-transit pcaps ownership get
|
|
281
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
|
|
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 Yi={command:`get`,describe:`List PCAPs Bucket Ownership`,builder:Ji,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(qi,{account_id:l}));o(u,{successLabel:`Loaded`})})};var B={method:`POST`,path:t=>e`/accounts/${t.account_id}/pcaps/ownership/validate`,body:`json`};function Xi(e){return e.usage(`$0 magic-transit pcaps ownership validate
|
|
283
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
|
|
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 Zi={command:`validate`,describe:`Validate buckets for full packet captures`,builder:Xi,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?m({destination_conf:h(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:h(e[`ownership-challenge`],`ownership-challenge`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`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 g(`ownership-challenge`,`The ownership challenge filename stored in the bucket.`));let u=m({destination_conf:h(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:h(e[`ownership-challenge`],`ownership-challenge`,`text`)}),d=await c(`Creating`,async()=>n.send(B,{body:u,account_id:l}));o(d,{successLabel:`Created`})})},Qi={command:`ownership`,describe:`Operations for pcaps.ownership`,builder:e=>e.command(Ui).command(Ki).command(Yi).command(Zi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $i={method:`PUT`,path:t=>e`/accounts/${t.account_id}/pcaps/${t.pcap_id}/stop`,response:!1};function ea(e){return e.usage(`$0 magic-transit pcaps stop <pcap-id>
|
|
285
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
|
|
287
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 ta={command:`stop <pcap-id>`,describe:`Stop full PCAP`,builder:ea,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 v({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($i,{account_id:l,pcap_id:e[`pcap-id`]}));o(u,{successLabel:`Deleted`})})},na={command:`pcaps`,describe:`Packet capture requests for debugging traffic flowing through Magic Transit tunnels`,builder:e=>e.command(Mi).command(Ri).command(Vi).command(ta).command(Fi).command(Qi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups`,body:`json`};function ra(e){return e.usage(`$0 magic-transit redundancy-groups create
|
|
288
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
|
|
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 ia={command:`create`,describe:`Create a Redundancy Group`,builder:ra,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?m({description:h(e.description,`description`,`text`),members:d(e.members,`members`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`name`,`Human-readable name for the redundancy group`));let u=m({description:h(e.description,`description`,`text`),members:d(e.members,`members`),name:h(e.name,`name`,`text`)}),p=await c(`Creating`,async()=>n.send(V,{body:u,account_id:l}));o(p,{successLabel:`Created`})})};var aa={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups/${t.redundancy_group_id}`};function oa(e){return e.usage(`$0 magic-transit redundancy-groups delete <redundancy-group-id>
|
|
290
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
|
|
292
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 sa={command:`delete <redundancy-group-id>`,describe:`Delete a Redundancy Group`,builder:oa,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
292
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(aa,{account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(u,{successLabel:`Deleted`})})};var ca={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups/${t.redundancy_group_id}`};function la(e){return e.usage(`$0 magic-transit redundancy-groups get <redundancy-group-id>
|
|
293
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
|
|
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 ua={command:`get <redundancy-group-id>`,describe:`Get Redundancy Group Details`,builder:la,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(ca,{account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(u,{successLabel:`Loaded`})})};var da={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/redundancy_groups`};function fa(e){return e.usage(`$0 magic-transit redundancy-groups list
|
|
295
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
|
|
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 pa={command:`list`,describe:`List Redundancy Groups`,builder:fa,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(da,{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 ma(e){return e.usage(`$0 magic-transit redundancy-groups update <redundancy-group-id>
|
|
297
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
|
|
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 ha={command:`update <redundancy-group-id>`,describe:`Update a Redundancy Group`,builder:ma,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?m({description:h(e.description,`description`,`text`),members:d(e.members,`members`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`name`,`Human-readable name for the redundancy group`));let u=m({description:h(e.description,`description`,`text`),members:d(e.members,`members`),name:h(e.name,`name`,`text`)}),p=await c(`Updating`,async()=>n.send(H,{body:u,account_id:l,redundancy_group_id:e[`redundancy-group-id`]}));o(p,{successLabel:`Updated`})})},ga={command:`redundancy-groups`,describe:`Operations for redundancy-groups`,builder:e=>e.command(ia).command(sa).command(ua).command(pa).command(ha).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/routes`,body:`json`};function _a(e){return e.usage(`$0 magic-transit routes bulk-update
|
|
299
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
|
|
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 va={command:`bulk-update`,describe:`Update Many Routes`,builder:_a,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?m({routes:d(e.routes,`routes`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({routes:d(e.routes,`routes`)}),p=await c(`Updating`,async()=>n.send(U,{body:u,account_id:l}));o(p,{successLabel:`Updated`})})};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/routes`,body:`json`};function ya(e){return e.usage(`$0 magic-transit routes create
|
|
301
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
|
|
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 ba={command:`create`,describe:`Create a Route`,builder:ya,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?m({description:h(e.description,`description`,`text`),nexthop:h(e.nexthop,`nexthop`,`text`),prefix:h(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`nexthop`,`The next-hop IP Address for the static route.`)),e.prefix===void 0&&(e.prefix=await g(`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=m({description:h(e.description,`description`,`text`),nexthop:h(e.nexthop,`nexthop`,`text`),prefix:h(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}),d=await c(`Creating`,async()=>n.send(W,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var xa={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/routes/${t.route_id}`};function Sa(e){return e.usage(`$0 magic-transit routes delete <route-id>
|
|
303
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
|
|
305
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Ca={command:`delete <route-id>`,describe:`Delete Route`,builder:Sa,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
305
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(xa,{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 wa(e){return e.usage(`$0 magic-transit routes empty
|
|
306
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
|
|
308
|
-
`);return}if(e.body){let t=
|
|
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 Ta={command:`empty`,describe:`Delete Many Routes`,builder:wa,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?m({routes:d(e.routes,`routes`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
308
|
+
`);return}if(e.body){let t=f(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=m({routes:d(e.routes,`routes`)}),p=await c(`Deleting`,async()=>n.send(G,{body:u,account_id:l}));o(p,{successLabel:`Deleted`})})};var Ea={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/routes/${t.route_id}`};function Da(e){return e.usage(`$0 magic-transit routes get <route-id>
|
|
309
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
|
|
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 Oa={command:`get <route-id>`,describe:`Route Details`,builder:Da,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(Ea,{account_id:l,route_id:e[`route-id`]}));o(u,{successLabel:`Loaded`})})};var ka={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/routes`};function Aa(e){return e.usage(`$0 magic-transit routes list
|
|
311
311
|
|
|
312
|
-
List all Magic static routes.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
312
|
+
List all Magic static routes.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ja={command:`list`,describe:`List Routes`,builder:Aa,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(ka,{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 Ma(e){return e.usage(`$0 magic-transit routes update <route-id>
|
|
313
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
|
|
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 Na={command:`update <route-id>`,describe:`Update Route`,builder:Ma,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?m({description:h(e.description,`description`,`text`),nexthop:h(e.nexthop,`nexthop`,`text`),prefix:h(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`nexthop`,`The next-hop IP Address for the static route.`)),e.prefix===void 0&&(e.prefix=await g(`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=m({description:h(e.description,`description`,`text`),nexthop:h(e.nexthop,`nexthop`,`text`),prefix:h(e.prefix,`prefix`,`text`),priority:e.priority,scope:{colo_names:e[`scope-colo-names`],colo_regions:e[`scope-colo-regions`]},weight:e.weight}),d=await c(`Updating`,async()=>n.send(K,{body:u,account_id:l,route_id:e[`route-id`]}));o(d,{successLabel:`Updated`})})},Pa={command:`routes`,describe:`Static routes that direct IP prefix traffic through specific GRE/IPsec tunnels`,builder:e=>e.command(va).command(ba).command(Ca).command(Ta).command(Oa).command(ja).command(Na).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 Fa(e){return e.usage(`$0 magic-transit sites acls create <site-id>
|
|
315
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
|
|
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 Ia={command:`create <site-id>`,describe:`Create a new Site ACL`,builder:Fa,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?m({description:h(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:h(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:h(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:h(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:h(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:h(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`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 g(`lan-2-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),e.name===void 0&&(e.name=await g(`name`,`The name of the ACL.`));let u=m({description:h(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:h(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:h(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:h(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:h(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:h(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}),d=await c(`Creating`,async()=>n.send(q,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Created`})})};var La={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls/${t.acl_id}`};function Ra(e){return e.usage(`$0 magic-transit sites acls delete <acl-id>
|
|
317
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
|
|
319
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 za={command:`delete <acl-id>`,describe:`Delete Site ACL`,builder:Ra,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
319
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(La,{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 Ba(e){return e.usage(`$0 magic-transit sites acls edit <acl-id>
|
|
320
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
|
|
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 Va={command:`edit <acl-id>`,describe:`Patch Site ACL`,builder:Ba,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?m({description:h(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:h(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:h(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:h(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:h(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:h(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({description:h(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:h(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:h(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:h(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:h(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:h(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}),d=await c(`Updating`,async()=>n.send(J,{body:u,account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(d,{successLabel:`Updated`})})};var Ha={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls/${t.acl_id}`};function Ua(e){return e.usage(`$0 magic-transit sites acls get <acl-id>
|
|
322
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
|
|
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 Wa={command:`get <acl-id>`,describe:`Site ACL Details`,builder:Ua,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(Ha,{account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(u,{successLabel:`Loaded`})})};var Ga={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/acls`};function Ka(e){return e.usage(`$0 magic-transit sites acls list
|
|
324
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
|
|
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 qa={command:`list`,describe:`List Site ACLs`,builder:Ka,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(Ga,{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 Ja(e){return e.usage(`$0 magic-transit sites acls update <acl-id>
|
|
326
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
|
|
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 Ya={command:`update <acl-id>`,describe:`Update Site ACL`,builder:Ja,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?m({description:h(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:h(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:h(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:h(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:h(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:h(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({description:h(e.description,`description`,`text`),forward_locally:e[`forward-locally`],lan_1:{lan_id:h(e[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:h(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:h(e[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:h(e[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:e[`lan-2-port-ranges`],ports:e[`lan-2-ports`]},name:h(e.name,`name`,`text`),protocols:e.protocols,unidirectional:e.unidirectional}),d=await c(`Updating`,async()=>n.send(Y,{body:u,account_id:l,site_id:e[`site-id`],acl_id:e[`acl-id`]}));o(d,{successLabel:`Updated`})})},Xa={command:`acls`,describe:`Operations for sites.acls`,builder:e=>e.command(Ia).command(za).command(Va).command(Wa).command(qa).command(Ya).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 Za(e){return e.usage(`$0 magic-transit sites app-configuration create <site-id>
|
|
328
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
|
|
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 Qa={command:`create <site-id>`,describe:`Create a new App Config`,builder:Za,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?m({breakout:e.breakout,preferred_wans:e[`preferred-wans`],priority:e.priority}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({breakout:e.breakout,preferred_wans:e[`preferred-wans`],priority:e.priority}),d=await c(`Creating`,async()=>n.send(X,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Created`})})};var $a={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/app_configs/${t.app_config_id}`};function eo(e){return e.usage(`$0 magic-transit sites app-configuration delete <app-config-id>
|
|
330
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
|
|
332
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 to={command:`delete <app-config-id>`,describe:`Delete App Config`,builder:eo,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
332
|
+
`);return}let u=await c(`Deleting`,async()=>n.send($a,{account_id:l,site_id:e[`site-id`],app_config_id:e[`app-config-id`]}));o(u,{successLabel:`Deleted`})})};var no={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/app_configs`};function ro(e){return e.usage(`$0 magic-transit sites app-configuration list
|
|
333
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
|
|
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 io={command:`list`,describe:`List App Configs`,builder:ro,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(no,{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 ao(e){return e.usage(`$0 magic-transit sites app-configuration update <app-config-id>
|
|
335
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
|
|
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 oo={command:`update <app-config-id>`,describe:`Update an App Config`,builder:ao,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?m({account_app_id:h(e[`account-app-id`],`account-app-id`,`text`),breakout:e.breakout,managed_app_id:h(e[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:e[`preferred-wans`],priority:e.priority}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({account_app_id:h(e[`account-app-id`],`account-app-id`,`text`),breakout:e.breakout,managed_app_id:h(e[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:e[`preferred-wans`],priority:e.priority}),d=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(d,{successLabel:`Updated`})})},so={command:`app-configuration`,describe:`Operations for sites.app-configuration`,builder:e=>e.command(Qa).command(to).command(io).command(oo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Q={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites`,body:`json`};function co(e){return e.usage(`$0 magic-transit sites create
|
|
337
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
|
|
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 lo={command:`create`,describe:`Create a new Site`,builder:co,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?m({connector_id:h(e[`connector-id`],`connector-id`,`text`),description:h(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:h(e[`location-lat`],`location-lat`,`text`),lon:h(e[`location-lon`],`location-lon`,`text`)},name:h(e.name,`name`,`text`),secondary_connector_id:h(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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 g(`name`,`The name of the site.`));let u=m({connector_id:h(e[`connector-id`],`connector-id`,`text`),description:h(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:h(e[`location-lat`],`location-lat`,`text`),lon:h(e[`location-lon`],`location-lon`,`text`)},name:h(e.name,`name`,`text`),secondary_connector_id:h(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}),d=await c(`Creating`,async()=>n.send(Q,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var uo={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}`};function fo(e){return e.usage(`$0 magic-transit sites delete <site-id>
|
|
339
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
|
|
341
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 po={command:`delete <site-id>`,describe:`Delete Site`,builder:fo,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
341
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(uo,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Deleted`})})};var mo={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}`,body:`json`};function ho(e){return e.usage(`$0 magic-transit sites edit <site-id>
|
|
342
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
|
|
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 go={command:`edit <site-id>`,describe:`Patch Site`,builder:ho,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?m({connector_id:h(e[`connector-id`],`connector-id`,`text`),description:h(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:h(e[`location-lat`],`location-lat`,`text`),lon:h(e[`location-lon`],`location-lon`,`text`)},name:h(e.name,`name`,`text`),secondary_connector_id:h(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(mo,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=m({connector_id:h(e[`connector-id`],`connector-id`,`text`),description:h(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:h(e[`location-lat`],`location-lat`,`text`),lon:h(e[`location-lon`],`location-lon`,`text`)},name:h(e.name,`name`,`text`),secondary_connector_id:h(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}),d=await c(`Updating`,async()=>n.send(mo,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Updated`})})};function _o(e){return e.usage(`$0 magic-transit sites get <site-id>
|
|
344
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
|
|
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 vo={command:`get <site-id>`,describe:`Site Details`,builder:_o,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 yo={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans`,body:`json`};function bo(e){return e.usage(`$0 magic-transit sites lans create <site-id>
|
|
346
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
|
|
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-dhcp-server-reservations`,{type:`string`,description:`Mapping of MAC addresses to IP addresses. Provide as a JSON object or @path/to/file.json.`}).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-dhcp-server-reservations`,`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 xo={command:`create <site-id>`,describe:`Create a new Site LAN`,builder:bo,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?m({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:h(e.name,`name`,`text`),nat:{static_prefix:h(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:d(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:h(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:h(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:h(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`],reservations:p(e[`static-addressing-dhcp-server-reservations`],`static-addressing-dhcp-server-reservations`)},secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:h(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]},[[`static_addressing`,`dhcp_server`,`reservations`]]):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(yo,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Created`});return}let u=m({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:h(e.name,`name`,`text`),nat:{static_prefix:h(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:d(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:h(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:h(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:h(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`],reservations:p(e[`static-addressing-dhcp-server-reservations`],`static-addressing-dhcp-server-reservations`)},secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:h(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]},[[`static_addressing`,`dhcp_server`,`reservations`]]),g=await c(`Creating`,async()=>n.send(yo,{body:u,account_id:l,site_id:e[`site-id`]}));o(g,{successLabel:`Created`})})};var So={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`};function Co(e){return e.usage(`$0 magic-transit sites lans delete <lan-id>
|
|
348
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
|
|
350
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 wo={command:`delete <lan-id>`,describe:`Delete Site LAN`,builder:Co,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
350
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(So,{account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(u,{successLabel:`Deleted`})})};var To={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`,body:`json`};function Eo(e){return e.usage(`$0 magic-transit sites lans edit <lan-id>
|
|
351
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
|
|
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-dhcp-server-reservations`,{type:`string`,description:`Mapping of MAC addresses to IP addresses. Provide as a JSON object or @path/to/file.json.`}).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-dhcp-server-reservations`,`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 Do={command:`edit <lan-id>`,describe:`Patch Site LAN`,builder:Eo,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?m({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:h(e.name,`name`,`text`),nat:{static_prefix:h(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:d(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:h(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:h(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:h(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`],reservations:p(e[`static-addressing-dhcp-server-reservations`],`static-addressing-dhcp-server-reservations`)},secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:h(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]},[[`static_addressing`,`dhcp_server`,`reservations`]]):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(To,{body:t,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(r,{successLabel:`Updated`});return}let u=m({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:h(e.name,`name`,`text`),nat:{static_prefix:h(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:d(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:h(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:h(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:h(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`],reservations:p(e[`static-addressing-dhcp-server-reservations`],`static-addressing-dhcp-server-reservations`)},secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:h(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]},[[`static_addressing`,`dhcp_server`,`reservations`]]),g=await c(`Updating`,async()=>n.send(To,{body:u,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(g,{successLabel:`Updated`})})};var Oo={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`};function ko(e){return e.usage(`$0 magic-transit sites lans get <lan-id>
|
|
353
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
|
|
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 Ao={command:`get <lan-id>`,describe:`Site LAN Details`,builder:ko,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(Oo,{account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(u,{successLabel:`Loaded`})})};var jo={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans`};function Mo(e){return e.usage(`$0 magic-transit sites lans list
|
|
355
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
|
|
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 No={command:`list`,describe:`List Site LANs`,builder:Mo,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(jo,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var Po={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/lans/${t.lan_id}`,body:`json`};function Fo(e){return e.usage(`$0 magic-transit sites lans update <lan-id>
|
|
357
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
|
|
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-dhcp-server-reservations`,{type:`string`,description:`Mapping of MAC addresses to IP addresses. Provide as a JSON object or @path/to/file.json.`}).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-dhcp-server-reservations`,`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 Io={command:`update <lan-id>`,describe:`Update Site LAN`,builder:Fo,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?m({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:h(e.name,`name`,`text`),nat:{static_prefix:h(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:d(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:h(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:h(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:h(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`],reservations:p(e[`static-addressing-dhcp-server-reservations`],`static-addressing-dhcp-server-reservations`)},secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:h(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]},[[`static_addressing`,`dhcp_server`,`reservations`]]):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(Po,{body:t,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(r,{successLabel:`Updated`});return}let u=m({bond_id:e[`bond-id`],ha_link:e[`ha-link`],is_breakout:e[`is-breakout`],is_prioritized:e[`is-prioritized`],name:h(e.name,`name`,`text`),nat:{static_prefix:h(e[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:e.physport,routed_subnets:d(e[`routed-subnets`],`routed-subnets`),static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:e[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:h(e[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:h(e[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:h(e[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:e[`static-addressing-dhcp-server-dns-servers`],reservations:p(e[`static-addressing-dhcp-server-reservations`],`static-addressing-dhcp-server-reservations`)},secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:h(e[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:e[`vlan-tag`]},[[`static_addressing`,`dhcp_server`,`reservations`]]),g=await c(`Updating`,async()=>n.send(Po,{body:u,account_id:l,site_id:e[`site-id`],lan_id:e[`lan-id`]}));o(g,{successLabel:`Updated`})})},Lo={command:`lans`,describe:`Operations for sites.lans`,builder:e=>e.command(xo).command(wo).command(Do).command(Ao).command(No).command(Io).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ro={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites`,query:[`connectorid`]};function zo(e){return e.usage(`$0 magic-transit sites list
|
|
359
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
|
|
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 Bo={command:`list`,describe:`List Sites`,builder:zo,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(Ro,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var Vo={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`,body:`json`};function Ho(e){return e.usage(`$0 magic-transit sites netflow-config create <site-id>
|
|
361
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
|
|
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 Uo={command:`create <site-id>`,describe:`Create NetFlow Configuration`,builder:Ho,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?m({active_timeout:e[`active-timeout`],collector_ip:h(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({active_timeout:e[`active-timeout`],collector_ip:h(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}),d=await c(`Creating`,async()=>n.send(Vo,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Created`})})};var Wo={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`};function Go(e){return e.usage(`$0 magic-transit sites netflow-config delete <site-id>
|
|
363
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
|
|
365
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 Ko={command:`delete <site-id>`,describe:`Delete NetFlow Configuration`,builder:Go,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
365
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(Wo,{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 qo(e){return e.usage(`$0 magic-transit sites netflow-config edit <site-id>
|
|
366
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
|
|
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 Jo={command:`edit <site-id>`,describe:`Update NetFlow Configuration`,builder:qo,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?m({active_timeout:e[`active-timeout`],collector_ip:h(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(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=m({active_timeout:e[`active-timeout`],collector_ip:h(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}),d=await c(`Updating`,async()=>n.send($,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Updated`})})};var Yo={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`};function Xo(e){return e.usage(`$0 magic-transit sites netflow-config get <site-id>
|
|
368
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
|
|
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 Zo={command:`get <site-id>`,describe:`NetFlow Configuration Details`,builder:Xo,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(Yo,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var Qo={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/netflow_config`,body:`json`};function $o(e){return e.usage(`$0 magic-transit sites netflow-config update <site-id>
|
|
370
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
|
|
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 es={command:`update <site-id>`,describe:`Update NetFlow Configuration`,builder:$o,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?m({active_timeout:e[`active-timeout`],collector_ip:h(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(Qo,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=m({active_timeout:e[`active-timeout`],collector_ip:h(e[`collector-ip`],`collector-ip`,`text`),collector_port:e[`collector-port`],inactive_timeout:e[`inactive-timeout`],sampling_rate:e[`sampling-rate`]}),d=await c(`Updating`,async()=>n.send(Qo,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Updated`})})},ts={command:`netflow-config`,describe:`Operations for sites.netflow-config`,builder:e=>e.command(Uo).command(Ko).command(Jo).command(Zo).command(es).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ns={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}`,body:`json`};function rs(e){return e.usage(`$0 magic-transit sites update <site-id>
|
|
372
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
|
|
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 is={command:`update <site-id>`,describe:`Update Site`,builder:rs,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?m({connector_id:h(e[`connector-id`],`connector-id`,`text`),description:h(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:h(e[`location-lat`],`location-lat`,`text`),lon:h(e[`location-lon`],`location-lon`,`text`)},name:h(e.name,`name`,`text`),secondary_connector_id:h(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(ns,{body:t,account_id:l,site_id:e[`site-id`]}));o(r,{successLabel:`Updated`});return}let u=m({connector_id:h(e[`connector-id`],`connector-id`,`text`),description:h(e.description,`description`,`text`),ha_mode:e[`ha-mode`],location:{lat:h(e[`location-lat`],`location-lat`,`text`),lon:h(e[`location-lon`],`location-lon`,`text`)},name:h(e.name,`name`,`text`),secondary_connector_id:h(e[`secondary-connector-id`],`secondary-connector-id`,`text`)}),d=await c(`Updating`,async()=>n.send(ns,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Updated`})})};var as={method:`POST`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans`,body:`json`};function os(e){return e.usage(`$0 magic-transit sites wans create <site-id>
|
|
374
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=>
|
|
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=>h(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(`provisioned-download-kbps`,{type:`number`,description:`Provisioned download rate of the WAN circuit in kilobits per second.`}).option(`provisioned-upload-kbps`,{type:`number`,description:`Provisioned upload rate of the WAN circuit in kilobits per second.`}).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(`static-addressing-secondary-gateway-address`,{type:`string`,description:`Gateway address for the secondary connector of a high availability site.`}).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`,`static-addressing-secondary-gateway-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 ss={command:`create <site-id>`,describe:`Create a new Site WAN`,builder:os,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?m({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:h(e.name,`name`,`text`),physport:e.physport,priority:e.priority,provisioned_download_kbps:e[`provisioned-download-kbps`],provisioned_upload_kbps:e[`provisioned-upload-kbps`],static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:h(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),secondary_gateway_address:h(e[`static-addressing-secondary-gateway-address`],`static-addressing-secondary-gateway-address`,`text`)},vlan_tag:e[`vlan-tag`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(as,{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=m({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:h(e.name,`name`,`text`),physport:e.physport,priority:e.priority,provisioned_download_kbps:e[`provisioned-download-kbps`],provisioned_upload_kbps:e[`provisioned-upload-kbps`],static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:h(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),secondary_gateway_address:h(e[`static-addressing-secondary-gateway-address`],`static-addressing-secondary-gateway-address`,`text`)},vlan_tag:e[`vlan-tag`]}),d=await c(`Creating`,async()=>n.send(as,{body:u,account_id:l,site_id:e[`site-id`]}));o(d,{successLabel:`Created`})})};var cs={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`};function ls(e){return e.usage(`$0 magic-transit sites wans delete <wan-id>
|
|
376
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
|
|
378
|
-
`);return}let u=await c(`Deleting`,async()=>n.send(
|
|
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 us={command:`delete <wan-id>`,describe:`Delete Site WAN`,builder:ls,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 v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
378
|
+
`);return}let u=await c(`Deleting`,async()=>n.send(cs,{account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(u,{successLabel:`Deleted`})})};var ds={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`,body:`json`};function fs(e){return e.usage(`$0 magic-transit sites wans edit <wan-id>
|
|
379
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=>
|
|
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=>h(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(`provisioned-download-kbps`,{type:`number`,description:`Provisioned download rate of the WAN circuit in kilobits per second. Set to null to remove it.`}).option(`provisioned-upload-kbps`,{type:`number`,description:`Provisioned upload rate of the WAN circuit in kilobits per second. Set to null to remove it.`}).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(`static-addressing-secondary-gateway-address`,{type:`string`,description:`Gateway address for the secondary connector of a high availability site. Set to null to remove it.`}).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)`})}const ps={command:`edit <wan-id>`,describe:`Patch Site WAN`,builder:fs,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?m({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:h(e.name,`name`,`text`),physport:e.physport,priority:e.priority,provisioned_download_kbps:e[`provisioned-download-kbps`],provisioned_upload_kbps:e[`provisioned-upload-kbps`],static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:h(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),secondary_gateway_address:h(e[`static-addressing-secondary-gateway-address`],`static-addressing-secondary-gateway-address`,`text`)},vlan_tag:e[`vlan-tag`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(ds,{body:t,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(r,{successLabel:`Updated`});return}let u=m({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:h(e.name,`name`,`text`),physport:e.physport,priority:e.priority,provisioned_download_kbps:e[`provisioned-download-kbps`],provisioned_upload_kbps:e[`provisioned-upload-kbps`],static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:h(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),secondary_gateway_address:h(e[`static-addressing-secondary-gateway-address`],`static-addressing-secondary-gateway-address`,`text`)},vlan_tag:e[`vlan-tag`]}),d=await c(`Updating`,async()=>n.send(ds,{body:u,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(d,{successLabel:`Updated`})})};var ms={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`};function hs(e){return e.usage(`$0 magic-transit sites wans get <wan-id>
|
|
381
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
|
|
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 gs={command:`get <wan-id>`,describe:`Site WAN Details`,builder:hs,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(ms,{account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(u,{successLabel:`Loaded`})})};var _s={method:`GET`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans`};function vs(e){return e.usage(`$0 magic-transit sites wans list
|
|
383
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
|
|
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 ys={command:`list`,describe:`List Site WANs`,builder:vs,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(_s,{account_id:l,site_id:e[`site-id`]}));o(u,{successLabel:`Loaded`})})};var bs={method:`PUT`,path:t=>e`/accounts/${t.account_id}/magic/sites/${t.site_id}/wans/${t.wan_id}`,body:`json`};function xs(e){return e.usage(`$0 magic-transit sites wans update <wan-id>
|
|
385
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=>
|
|
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=>h(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(`provisioned-download-kbps`,{type:`number`,description:`Provisioned download rate of the WAN circuit in kilobits per second. Set to null to remove it.`}).option(`provisioned-upload-kbps`,{type:`number`,description:`Provisioned upload rate of the WAN circuit in kilobits per second. Set to null to remove it.`}).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(`static-addressing-secondary-gateway-address`,{type:`string`,description:`Gateway address for the secondary connector of a high availability site. Set to null to remove it.`}).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)`})}const Ss={command:`update <wan-id>`,describe:`Update Site WAN`,builder:xs,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?m({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:h(e.name,`name`,`text`),physport:e.physport,priority:e.priority,provisioned_download_kbps:e[`provisioned-download-kbps`],provisioned_upload_kbps:e[`provisioned-upload-kbps`],static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:h(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),secondary_gateway_address:h(e[`static-addressing-secondary-gateway-address`],`static-addressing-secondary-gateway-address`,`text`)},vlan_tag:e[`vlan-tag`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(bs,{body:t,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(r,{successLabel:`Updated`});return}let u=m({health_check_rate:e[`health-check-rate`],load_balance_inner_flows:e[`load-balance-inner-flows`],name:h(e.name,`name`,`text`),physport:e.physport,priority:e.priority,provisioned_download_kbps:e[`provisioned-download-kbps`],provisioned_upload_kbps:e[`provisioned-upload-kbps`],static_addressing:{address:h(e[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:h(e[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:h(e[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),secondary_gateway_address:h(e[`static-addressing-secondary-gateway-address`],`static-addressing-secondary-gateway-address`,`text`)},vlan_tag:e[`vlan-tag`]}),d=await c(`Updating`,async()=>n.send(bs,{body:u,account_id:l,site_id:e[`site-id`],wan_id:e[`wan-id`]}));o(d,{successLabel:`Updated`})})},Cs={command:`wans`,describe:`Operations for sites.wans`,builder:e=>e.command(ss).command(us).command(ps).command(gs).command(ys).command(Ss).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ws={command:`sites`,describe:`Magic WAN branch sites — base CRUD, LAN/WAN interface configuration, ACLs, connectors, app configuration, and NetFlow config`,builder:e=>e.command(lo).command(po).command(go).command(vo).command(Bo).command(is).command(Xa).command(so).command(Lo).command(ts).command(Cs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ts={command:`magic-transit`,describe:`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,builder:e=>e.command(Ce).command(Ln).command(Jn).command(cr).command(mr).command(Cr).command(Zr).command(ui).command(ki).command(na).command(ga).command(Pa).command(ws).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ts as default};
|