cf 1.0.0-beta.5 → 1.0.0-beta.6
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 +5047 -5068
- package/dist/_meta/hand-written-commands.json +1 -1
- package/dist/_meta/schemas.json +3026 -3123
- package/dist/abuse-reports-BtI6fvRl.mjs +24 -0
- package/dist/{access-DRlrq_cq.mjs → access-CqOyTHw4.mjs} +1 -1
- package/dist/{account-tags-DMCYk5rR.mjs → account-tags-7I77Dwsd.mjs} +1 -1
- package/dist/{accounts-BlVDzIWc.mjs → accounts-Cq-eOPzL.mjs} +32 -26
- package/dist/{acm-CCc33e4l.mjs → acm-CSXnlN6o.mjs} +1 -1
- package/dist/{addressing-BA-5A3jQ.mjs → addressing-C5XvjNhk.mjs} +1 -1
- package/dist/{agent-memory-Csgs8W5u.mjs → agent-memory-CSzr9gty.mjs} +1 -1
- package/dist/{ai-BN_pzw7p.mjs → ai-C0xWIvsG.mjs} +7 -9
- package/dist/{ai-audit-Dbln3Ai6.mjs → ai-audit-B43vm1KJ.mjs} +1 -1
- package/dist/{ai-gateway-BhASWwdp.mjs → ai-gateway-BK3MbIzT.mjs} +1 -1
- package/dist/{ai-search-DvA8g4xr.mjs → ai-search-TrFTxBbn.mjs} +1 -1
- package/dist/{ai-security-nualpneg.mjs → ai-security-JrYa27qd.mjs} +1 -1
- package/dist/{alerting-HUbVuQMl.mjs → alerting-B1-ZwfVT.mjs} +1 -1
- package/dist/{analytics-ClKN9YnQ.mjs → analytics-B-wlVtDV.mjs} +1 -1
- package/dist/{analytics_engine-DP_O5HIq.mjs → analytics_engine-DWzzQzOs.mjs} +1 -1
- package/dist/{api-security-Ce_9nFH9.mjs → api-security-BWFWWmXl.mjs} +1 -1
- package/dist/{argo-CLLBrtiV.mjs → argo-DHPGTvCT.mjs} +1 -1
- package/dist/{artifacts-CIxZX3VM.mjs → artifacts-mmBDk3wO.mjs} +1 -1
- package/dist/{audit-logs-DjzIj9T4.mjs → audit-logs-CCF5e500.mjs} +1 -1
- package/dist/{auth-CgPQplnD.mjs → auth-Dnp10uLy.mjs} +1 -1
- package/dist/{auth-B_Utev-x.mjs → auth-gOCL6Pm0.mjs} +2 -2
- package/dist/{autoconfig-BunaOShS.mjs → autoconfig-DqEPKpj0.mjs} +1 -1
- package/dist/basin-catalog-hRY01t_Z.mjs +44 -0
- package/dist/{billing-tHlHhEVf.mjs → billing-C_ev-9nh.mjs} +1 -1
- package/dist/{bot-management-ChV-gaXh.mjs → bot-management-CyYsXkZt.mjs} +1 -1
- package/dist/{botnet-feed-DQWBOEqC.mjs → botnet-feed-Dj5R5v2o.mjs} +1 -1
- package/dist/{brand-protection-B3afeuOj.mjs → brand-protection-CmQ6Iu0I.mjs} +1 -1
- package/dist/{browser-run-eQMomr1x.mjs → browser-run-sWHTsCSB.mjs} +1 -1
- package/dist/build-Dyt1M_Ib.mjs +2 -0
- package/dist/{build-VUz0URCV.mjs → build-_qqitpn0.mjs} +1 -1
- package/dist/{builds-wTOvlp0S.mjs → builds-c21rTfcg.mjs} +1 -1
- package/dist/{cache-s4HK0we7.mjs → cache-CuNjJl6m.mjs} +27 -27
- package/dist/{certificate-authorities-CaPUfYzA.mjs → certificate-authorities-DRUUzvI3.mjs} +1 -1
- package/dist/{cli-CT-QJu7q.mjs → cli-Caa776EB.mjs} +1 -1
- package/dist/{client-certificates-BfNDnT8H.mjs → client-certificates-BSi1CEGk.mjs} +1 -1
- package/dist/{client-side-security-BV7iORbb.mjs → client-side-security-BdxUX3Y8.mjs} +1 -1
- package/dist/{cloud-connector-CGT8ezvv.mjs → cloud-connector-B46ajuAj.mjs} +1 -1
- package/dist/{cloudforce-one-BDhbXtA_.mjs → cloudforce-one-adbVR2Ah.mjs} +47 -56
- package/dist/{command-DJF4wdrM.mjs → command-B47VlNBp.mjs} +1 -1
- package/dist/{command-ozwmaY7n.mjs → command-B5Itp2BM.mjs} +1 -1
- package/dist/{command-DjNcY4cf.mjs → command-BDCTd8Ra.mjs} +1 -1
- package/dist/{command-Cox9Wh1i.mjs → command-BmXnByw9.mjs} +1 -1
- package/dist/{command-C3Qhz4kU.mjs → command-Bw-M_qxb.mjs} +1 -1
- package/dist/{command-BgBsFEYv.mjs → command-C2bU5Etc.mjs} +1 -1
- package/dist/{command-DQcG8PK-.mjs → command-CHcCSvVz.mjs} +1 -1
- package/dist/{command-C8gLcKlB.mjs → command-CRgQ0dM3.mjs} +1 -1
- package/dist/{command-DH67hNLj.mjs → command-CVg0qT13.mjs} +1 -1
- package/dist/{command-DpEQ07Xe.mjs → command-CkJvjkfK.mjs} +1 -1
- package/dist/{command-C_l69o2b.mjs → command-DV196MKR.mjs} +1 -1
- package/dist/{command-lYaHS62l.mjs → command-Du3MiYA7.mjs} +1 -1
- package/dist/{command-SgtzgQrs.mjs → command-eBmGBTA7.mjs} +1 -1
- package/dist/{command-G_VL3Jf8.mjs → command-eqgT8zz4.mjs} +1 -1
- package/dist/{completions-VR53Fiec.mjs → completions-DbT6O2ol.mjs} +1 -1
- package/dist/{connector-interrupts-hfttjm-b.mjs → connector-interrupts-BhfMiPcq.mjs} +1 -1
- package/dist/{connector-telemetry-events-5nVvivYA.mjs → connector-telemetry-events-CxKECRgO.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DKk_7VQa.mjs → connector-telemetry-snapshots-BHi-jHE5.mjs} +1 -1
- package/dist/{connectors-CvX4Z3cg.mjs → connectors-gkP2aNSN.mjs} +1 -1
- package/dist/{containers-BU9RquYh.mjs → containers-BY8pinEV.mjs} +1 -1
- package/dist/{containers-BQxj87na.mjs → containers-DUvBpnRo.mjs} +1 -1
- package/dist/{content-scan-hWh-aGbO.mjs → content-scan-BCPhAjMZ.mjs} +1 -1
- package/dist/{context-CPVzoKbN.mjs → context-CE7QFX-z.mjs} +1 -1
- package/dist/{cps-o8QQFfnF.mjs → cps-B35EPUAk.mjs} +1 -1
- package/dist/{csamScanner-DHod3Hak.mjs → csamScanner-DcTA9oLR.mjs} +1 -1
- package/dist/{ct-alerting-D-_YsE1x.mjs → ct-alerting-B3CS-CPk.mjs} +1 -1
- package/dist/{custom-certificates-UnaVRb3W.mjs → custom-certificates-IjJJhl7_.mjs} +1 -1
- package/dist/{custom-csrs-BCJ7LOUe.mjs → custom-csrs-ChYOaEQg.mjs} +1 -1
- package/dist/{custom-hostnames-DOluVIfa.mjs → custom-hostnames-Bai3cqAD.mjs} +1 -1
- package/dist/{custom-nameservers-CvIucaA2.mjs → custom-nameservers-DsukmLNZ.mjs} +1 -1
- package/dist/{custom-pages-DzrXSeCR.mjs → custom-pages-CiboX-9D.mjs} +1 -1
- package/dist/d1-s293SFAJ.mjs +41 -0
- package/dist/{dcv-delegation-9bMHPSoc.mjs → dcv-delegation-BfgvmpQT.mjs} +1 -1
- package/dist/{deploy-BT_EVz0K.mjs → deploy-CvxNMDbS.mjs} +1 -1
- package/dist/{deploy-input-YW632ysz.mjs → deploy-input-CNrImP7B.mjs} +1 -1
- package/dist/{dev-jRnP9IIJ.mjs → dev-Z6vYszaT.mjs} +1 -1
- package/dist/{diagnostics-BIe-XR-P.mjs → diagnostics-Ops0RjxG.mjs} +1 -1
- package/dist/discover-CcGReXr0.mjs +2 -0
- package/dist/{dist-COohnEBL.mjs → dist-Dgnf_i4w.mjs} +1 -1
- package/dist/{dls-BuKO5QWL.mjs → dls-uo7NYEqE.mjs} +1 -1
- package/dist/{dns-DzVN-WA4.mjs → dns-B-NwBOpQ.mjs} +52 -43
- package/dist/{dns-firewall-Dx_XvWKJ.mjs → dns-firewall-LTIP13nb.mjs} +1 -1
- package/dist/durable-objects-o7uB3YYg.mjs +6 -0
- package/dist/{email-auth-DqIyzEcR.mjs → email-auth-BUdBDCaE.mjs} +1 -1
- package/dist/{email-routing-8rhAmzOY.mjs → email-routing-BPRliM3z.mjs} +1 -1
- package/dist/{email-security-BRq5J31C.mjs → email-security-dbLE3I5c.mjs} +50 -50
- package/dist/{email-sending-Bsfk4Jia.mjs → email-sending-BLlGy5Mn.mjs} +1 -1
- package/dist/error-sanitization-CEf4JTNN.mjs +2 -0
- package/dist/{error-sanitization-Dc4bLj8k.mjs → error-sanitization-CcNUzN1f.mjs} +1 -1
- package/dist/{fieldExtractors-COaK02vB.mjs → fieldExtractors-M-KfLOGw.mjs} +1 -1
- package/dist/{firewall-Dar706zc.mjs → firewall-DzbLwqo3.mjs} +1 -1
- package/dist/flagship-DcXWEywy.mjs +28 -0
- package/dist/{fraud-H-mdJfRU.mjs → fraud-CGXRWANi.mjs} +1 -1
- package/dist/generate-t4dFfFRV.mjs +2 -0
- package/dist/{google-tag-gateway-zqXS_12f.mjs → google-tag-gateway-B3Z3Puwl.mjs} +1 -1
- package/dist/{healthchecks-x889sT8g.mjs → healthchecks-BIiV29q7.mjs} +1 -1
- package/dist/{hostnames-DqB5I-_U.mjs → hostnames-ueWsZFwv.mjs} +1 -1
- package/dist/{hyperdrive-sR7Mwif9.mjs → hyperdrive-Bxk9LZf5.mjs} +1 -1
- package/dist/{iam-CKt7U41p.mjs → iam-kA9gcv79.mjs} +1 -1
- package/dist/{images-CakdBcMc.mjs → images-CK4J5as7.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-CVyWV_Ow.mjs → init-COcG8sp5.mjs} +2 -2
- package/dist/{intel-Dcv1vMsK.mjs → intel-z7DkM9Xc.mjs} +1 -1
- package/dist/{ips-Ce9_k1Vh.mjs → ips-BXdBK4Co.mjs} +1 -1
- package/dist/{keyless-certificates-Cf_6sc7K.mjs → keyless-certificates-Dp9xTYtD.mjs} +1 -1
- package/dist/{keys-DW2A43fL.mjs → keys-DrVlj4VI.mjs} +1 -1
- package/dist/{kv-BKBWXf8s.mjs → kv-WX-dlUT1.mjs} +1 -1
- package/dist/{lazy-command-BOjQB_U7.mjs → lazy-command-g04RHlS2.mjs} +1 -1
- package/dist/{leaked-credential-checks-D-gwxxaF.mjs → leaked-credential-checks-BMQ0VhCd.mjs} +1 -1
- package/dist/{load-balancers-DHUVei95.mjs → load-balancers-BbkSL89c.mjs} +1 -1
- package/dist/local-BWhuu9TH.mjs +2 -0
- package/dist/{local-B3OyWKkW.mjs → local-Cyk8fPvL.mjs} +1 -1
- package/dist/{local-runtime-Co5vVDlI.mjs → local-runtime-CWWJJB2E.mjs} +1 -1
- package/dist/{login-CptngugC.mjs → login-CyU_ZTNI.mjs} +1 -1
- package/dist/{login-D37fy09s.mjs → login-DYQ8UgJQ.mjs} +1 -1
- package/dist/{logo-matches-D1aNSBnZ.mjs → logo-matches-HFmD2hK6.mjs} +1 -1
- package/dist/{logos-SyEjq15s.mjs → logos-Di2PABE_.mjs} +1 -1
- package/dist/{logpush-l9tVWnua.mjs → logpush-DEqdt0I0.mjs} +1 -1
- package/dist/logs-Ckfw-3Q_.mjs +37 -0
- package/dist/{magic-cloud-networking-CN2Qd2Lx.mjs → magic-cloud-networking-C0yBJKMb.mjs} +1 -1
- package/dist/{magic-network-monitoring-8jxG-tPc.mjs → magic-network-monitoring-CLvaiI7s.mjs} +1 -1
- package/dist/{magic-transit-DLhIQz2l.mjs → magic-transit-Bhb1kxYj.mjs} +108 -112
- package/dist/{managed-defense-CgKdTd9J.mjs → managed-defense-COL3aqXw.mjs} +1 -1
- package/dist/{managed-transforms-BASi4j_s.mjs → managed-transforms-cK0strTK.mjs} +1 -1
- package/dist/{matches-BCV6x948.mjs → matches-Df4WEz0x.mjs} +1 -1
- package/dist/{mcp-DQODvLQm.mjs → mcp-DK_5OUVl.mjs} +1 -1
- package/dist/{mesh-S_yYh-w3.mjs → mesh-CVXpTYED.mjs} +1 -1
- package/dist/{migrate-B4kBnkpV.mjs → migrate-CipwWhJE.mjs} +1 -1
- package/dist/monetization-BHk0S5BF.mjs +20 -0
- package/dist/{mtls-certificates-XJXK21J_.mjs → mtls-certificates-8pzdxzOX.mjs} +1 -1
- package/dist/{network-DA81Mcdh.mjs → network-ClNeXTvG.mjs} +1 -1
- package/dist/{network-interconnects-OttR92s7.mjs → network-interconnects-t3jSoV7o.mjs} +1 -1
- package/dist/{oauth-ChXrM0q9.mjs → oauth-CJamdfrC.mjs} +1 -1
- package/dist/{oauth-CKeW8CqE.mjs → oauth-CNSirGUu.mjs} +1 -1
- package/dist/{oauth-clients-Ba-YZsxB.mjs → oauth-clients-DBxdvlJC.mjs} +1 -1
- package/dist/{oauth-scopes-XqOk2zCQ.mjs → oauth-scopes-D39GYkt6.mjs} +1 -1
- package/dist/{observability-BdIbZ1D8.mjs → observability-ZV1yPflB.mjs} +1 -1
- package/dist/{organization-DnQ2_txo.mjs → organization-Bk-TkQlB.mjs} +7 -7
- package/dist/{organizations-BkI0IhEg.mjs → organizations-hXITNpPl.mjs} +1 -1
- package/dist/{origin-ca-certificates-Br91H1EG.mjs → origin-ca-certificates-DsLR_Z2e.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-BcpK8DaG.mjs → origin-post-quantum-encryption-C_egsVQu.mjs} +1 -1
- package/dist/{origin-tls-client-auth-CYK6YnzK.mjs → origin-tls-client-auth-DPG6A6kz.mjs} +1 -1
- package/dist/{page-rules-DpOcNsJr.mjs → page-rules-B8lrkiiF.mjs} +1 -1
- package/dist/pages-Cx4doLvQ.mjs +54 -0
- package/dist/{pay-per-crawl-BORpCGxC.mjs → pay-per-crawl-BUVHqPPA.mjs} +1 -1
- package/dist/{pay-per-use-CZw-KHEz.mjs → pay-per-use-CzYgryid.mjs} +1 -1
- package/dist/{pipelines-DDDyJ6Oe.mjs → pipelines-CGHmwc4a.mjs} +1 -1
- package/dist/{precursor-DrH1i64o.mjs → precursor--Jim5u4y.mjs} +1 -1
- package/dist/{previews-CiYBBKj8.mjs → previews-BKO1pZyG.mjs} +1 -1
- package/dist/{progress-DS2fwfNP.mjs → progress-CRjK46r1.mjs} +1 -1
- package/dist/{prompt-doX80PCd.mjs → prompt-C_90YsVE.mjs} +1 -1
- package/dist/{queries-CD6h6iEP.mjs → queries-z2pjzXlA.mjs} +1 -1
- package/dist/{queues-3TpjE349.mjs → queues-D0IXxSa7.mjs} +1 -1
- package/dist/{r2-CV_hSFkM.mjs → r2-DQ7w9dCM.mjs} +1 -1
- package/dist/r2-data-catalog-DpktRU5y.mjs +2 -0
- package/dist/{radar-6-4_LoQ1.mjs → radar-DyLO7Zg1.mjs} +1 -1
- package/dist/{raw-fetch-_Z55VEDY.mjs → raw-fetch-C8SdmQBp.mjs} +1 -1
- package/dist/{realtime-B5ce977I.mjs → realtime-mQzLbDxe.mjs} +1 -1
- package/dist/{registrar-CF-3h2dN.mjs → registrar-ClbtM5Dy.mjs} +2 -2
- package/dist/{registrar-sandbox-BDRZbyAV.mjs → registrar-sandbox-BIEHm_Jp.mjs} +2 -2
- package/dist/{reporting-CiS-RBNJ.mjs → reporting-CjkMzSsZ.mjs} +1 -1
- package/dist/{request-headers-DPbWytRv.mjs → request-headers-jr2VznA9.mjs} +1 -1
- package/dist/{request-tracers-Drcpv8ha.mjs → request-tracers-BoSXOTox.mjs} +1 -1
- package/dist/{resource-sharing-BI3CoOjl.mjs → resource-sharing-CFS39nJq.mjs} +1 -1
- package/dist/{resource-tagging-D4i_-E0W.mjs → resource-tagging-CZ5mvMhE.mjs} +1 -1
- package/dist/{rules-C4I4CLoq.mjs → rules-CfqumI45.mjs} +4 -4
- package/dist/{rulesets-c2efesdy.mjs → rulesets-o3jsPv4U.mjs} +20 -20
- package/dist/{rum-DT58nW8a.mjs → rum-BZ0rYlun.mjs} +1 -1
- package/dist/run-D0_7wBp2.mjs +2 -0
- package/dist/{run-CJ-6owN3.mjs → run-huwFFwXd.mjs} +1 -1
- package/dist/{schema-flags-DDW79Tda.mjs → schema-flags-nL7pHvaE.mjs} +1 -1
- package/dist/{scim-PfJWMuRu.mjs → scim-0-eR9pvC.mjs} +1 -1
- package/dist/{sdk-Bx29ZKK3.mjs → sdk-Bmz7t_CD.mjs} +1 -1
- package/dist/{secrets-store-7jrgww1J.mjs → secrets-store-Duc29Zs-.mjs} +1 -1
- package/dist/security-insights-5CuLC-Yo.mjs +40 -0
- package/dist/{security-txt-ButEG3qy.mjs → security-txt-qm2PqCPz.mjs} +1 -1
- package/dist/{shared-JNtE--kh.mjs → shared-BDIrEKWt.mjs} +1 -1
- package/dist/{smart-shield-DgbYuUFC.mjs → smart-shield-BXLH9OM0.mjs} +1 -1
- package/dist/{snippets-De-xVTIb.mjs → snippets-DZG6UWeH.mjs} +1 -1
- package/dist/{spawn-IM_tQldH.mjs → spawn-KZqyx6KK.mjs} +1 -1
- package/dist/{spectrum-DcknX0jS.mjs → spectrum-Be4ImAIY.mjs} +1 -1
- package/dist/{speed-Cn_p-ieT.mjs → speed-CNWujfIC.mjs} +1 -1
- package/dist/{src-BYjublVL.mjs → src-CW6py11z.mjs} +5 -5
- package/dist/{ssl-Bkn4ke9Q.mjs → ssl-BIlS4Qs8.mjs} +1 -1
- package/dist/{stream-Cx78uNm_.mjs → stream-C5RvTAKF.mjs} +1 -1
- package/dist/{submit-Gu34n1a6.mjs → submit-Bpru4P79.mjs} +1 -1
- package/dist/{tags-BQqO7TLX.mjs → tags-Rv7X1rU9.mjs} +1 -1
- package/dist/{telemetry-Qc-g_0fL.mjs → telemetry-0npQCuKc.mjs} +1 -1
- package/dist/telemetry-B4_YhD82.mjs +2 -0
- package/dist/tenant-CjYf6OPN.mjs +10 -0
- package/dist/{tenant-custom-nameservers-B5Nf5hLr.mjs → tenant-custom-nameservers-BbHaaEhv.mjs} +1 -1
- package/dist/{tunnels-ndJtol-f.mjs → tunnels-CLWPaIIF.mjs} +1 -1
- package/dist/{turnstile-Cd65N6jD.mjs → turnstile-C5ezKSoz.mjs} +1 -1
- package/dist/update-check-CebyUyqG.mjs +2 -0
- package/dist/{update-check-AraGlAQf.mjs → update-check-aOpHVlzB.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-info-CQKJ5A-x.mjs → url-info-Gcf8-MyB.mjs} +1 -1
- package/dist/{url-normalization-BPXZwYu0.mjs → url-normalization-Dvg8mZRk.mjs} +1 -1
- package/dist/{url-scanner-Bq43LJ98.mjs → url-scanner-BZCsgh0O.mjs} +1 -1
- package/dist/{user-D4InwQxA.mjs → user-BnkvXmjc.mjs} +1 -1
- package/dist/{values-C3YLablc.mjs → values-yUGls__L.mjs} +1 -1
- package/dist/{vectorize-CYt0qXQ5.mjs → vectorize-BiXngTuI.mjs} +3 -3
- package/dist/version-C3q1GMTe.mjs +2 -0
- package/dist/{waiting-rooms-B3ksWao9.mjs → waiting-rooms-BoLWF74U.mjs} +1 -1
- package/dist/{web-assets-DNiElHgV.mjs → web-assets-CEJ9Zne1.mjs} +1 -1
- package/dist/{web3-DfMKMDix.mjs → web3-CIjm7EuJ.mjs} +1 -1
- package/dist/workers-DdtWb7Ws.mjs +38 -0
- package/dist/{workers-builds-DbEy311-.mjs → workers-builds-DT4tA-KT.mjs} +1 -1
- package/dist/workers-for-platforms-CaCr8ApU.mjs +42 -0
- package/dist/{workers-vpc-BEnB6e_3.mjs → workers-vpc-DRtjG39D.mjs} +1 -1
- package/dist/{workflows-CX3Zer8w.mjs → workflows-DRme6yrC.mjs} +2 -2
- package/dist/{wrangler-migration-BDkh1_IV.mjs → wrangler-migration-BDnS1puc.mjs} +1 -1
- package/dist/{zaraz-DR1KbYY-.mjs → zaraz-DmjDEnUJ.mjs} +1 -1
- package/dist/{zero-trust-CLoXVq1e.mjs → zero-trust-BRAHExxa.mjs} +427 -441
- package/dist/{zone-B9qejq6W.mjs → zone-CclLvb-g.mjs} +1 -1
- package/dist/{zones-BxU08wO0.mjs → zones-C6tc2OOV.mjs} +1 -1
- package/package.json +3 -2
- package/dist/abuse-reports-DoqL_52r.mjs +0 -26
- package/dist/account-DfC3gRTf.mjs +0 -12
- package/dist/build-DFa0ngeO.mjs +0 -2
- package/dist/d1-BCg7BhWi.mjs +0 -45
- package/dist/discover-DgHRf-qo.mjs +0 -2
- package/dist/durable-objects-DnU6OsEb.mjs +0 -8
- package/dist/error-sanitization-Cu-8OKRA.mjs +0 -2
- package/dist/flagship-CTchDpyw.mjs +0 -28
- package/dist/generate-qMU-2MgC.mjs +0 -2
- package/dist/local-qOpZjDed.mjs +0 -2
- package/dist/logs-EW0Pq-gf.mjs +0 -48
- package/dist/pages-Cw4DM-1N.mjs +0 -60
- package/dist/r2-data-catalog-D_YHTMFG.mjs +0 -44
- package/dist/run-D0esoYSn.mjs +0 -2
- package/dist/security-center-BhUM_Flh.mjs +0 -30
- package/dist/telemetry-D2UwfCd1.mjs +0 -2
- package/dist/tenant-Dr0hGlhU.mjs +0 -12
- package/dist/update-check-D5-zqJoN.mjs +0 -2
- package/dist/version-DyZwKU6l.mjs +0 -2
- package/dist/workers-C8uiRedD.mjs +0 -40
- package/dist/workers-for-platforms-BjvcY5A1.mjs +0 -25
- /package/dist/{alerts-DqZgVSCT.mjs → alerts-DY_7Nknx.mjs} +0 -0
- /package/dist/{autorag-Cq9k9Ye6.mjs → autorag-K396-M2S.mjs} +0 -0
- /package/dist/{cloudflared-91JvyShh.mjs → cloudflared-Ciq4L97v.mjs} +0 -0
- /package/dist/{command-C72KLHMc.mjs → command-D1Z5uf_S.mjs} +0 -0
- /package/dist/{discover-VRFBjse7.mjs → discover-B_3A4a_t.mjs} +0 -0
- /package/dist/{generate-iV6OVNin.mjs → generate-QUDsysBJ.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Bw9qmxMx.mjs → rate-limit-analytics-YsGha5pH.mjs} +0 -0
- /package/dist/{rate-limits-CDm_xzKt.mjs → rate-limits-kH13NRdf.mjs} +0 -0
- /package/dist/{ready-BXGqY1Wi.mjs → ready-DYun4Fpn.mjs} +0 -0
- /package/dist/{recent-submissions-AhGZD3a3.mjs → recent-submissions-18NaOGOo.mjs} +0 -0
- /package/dist/{refute-D_w5Gw20.mjs → refute-BhMiJcE1.mjs} +0 -0
- /package/dist/{registry-DBMUTYqf.mjs → registry-CSv7HR1J.mjs} +0 -0
- /package/dist/{scan-logo-BZzFam-Q.mjs → scan-logo-7y0pqFMk.mjs} +0 -0
- /package/dist/{scan-page-BPA8nSPM.mjs → scan-page-B6jnK3QI.mjs} +0 -0
- /package/dist/{schema-CueLBLXC.mjs → schema-JVvksQ1J.mjs} +0 -0
- /package/dist/{search-De0UlXYN.mjs → search-Rn3Eefv8.mjs} +0 -0
- /package/dist/{signed-url-ziDz9frX.mjs → signed-url-Dzwy9Xiw.mjs} +0 -0
- /package/dist/{submission-info-83D2DCCG.mjs → submission-info-SNhkDRRZ.mjs} +0 -0
- /package/dist/{tools-BJbI_f35.mjs → tools-CFEubTr4.mjs} +0 -0
- /package/dist/{total-queries-Dhol31Kn.mjs → total-queries-B20xslrH.mjs} +0 -0
- /package/dist/{tracked-domains-DoOPs6Vd.mjs → tracked-domains-BCvIOZOK.mjs} +0 -0
- /package/dist/{verify-CxpGEnJb.mjs → verify-DOeBG4PL.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{a as r,r as i}from"./auth-gOCL6Pm0.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-CRjK46r1.mjs";import{t as c}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-C_90YsVE.mjs";import{n as _,t as ee}from"./raw-fetch-C8SdmQBp.mjs";function te(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules create
|
|
3
3
|
|
|
4
4
|
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 v={command:`create`,describe:`Create DNS Protection rule.`,builder:te,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules create`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:l})),{successLabel:`Created`});return}r[`burst-sensitivity`]===void 0&&(r[`burst-sensitivity`]=await m(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.name===void 0&&(r.name=await m(`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'.`)),r[`profile-sensitivity`]===void 0&&(r[`profile-sensitivity`]=await m(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),r[`rate-sensitivity`]===void 0&&(r[`rate-sensitivity`]=await m(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.scope===void 0&&(r.scope=await m(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let d=f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...d,account_id:l})),{successLabel:`Created`})})};function y(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules delete for account
|
|
5
5
|
|
|
@@ -105,34 +105,32 @@ Update the protection status of the account.`).option(`enabled`,{type:`boolean`,
|
|
|
105
105
|
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 Bt={command:`create`,describe:`Create a new App`,builder:zt,handler:async r=>c({command:`magic-transit apps create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({hostnames:r.hostnames,name:p(r.name,`name`,`text`),type:p(r.type,`type`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.apps.create({body:e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await m(`name`,`Display name for the app.`)),r.type===void 0&&(r.type=await m(`type`,`Category of the app.`));let d=f({hostnames:r.hostnames,name:p(r.name,`name`,`text`),type:p(r.type,`type`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.apps.create({body:d,account_id:l})),{successLabel:`Created`})})};function Vt(e){return e.usage(`$0 magic-transit apps delete <account-app-id>
|
|
106
106
|
|
|
107
107
|
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 Ht={command:`delete <account-app-id>`,describe:`Delete Account App`,builder:Vt,handler:async r=>c({command:`magic-transit apps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/apps/${r[`account-app-id`]==null?`<account-app-id>`:encodeURIComponent(String(r[`account-app-id`]))}`,pathParams:{"account-app-id":String(r[`account-app-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
108
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.apps.delete({account_id:l,account_app_id:r[`account-app-id`]})),{successLabel:`Deleted`})})};function Ut(e){return e.usage(`$0 magic-transit apps
|
|
108
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.apps.delete({account_id:l,account_app_id:r[`account-app-id`]})),{successLabel:`Deleted`})})};function Ut(e){return e.usage(`$0 magic-transit apps list
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
Lists Apps associated with an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`list`,describe:`List Apps`,builder:Ut,handler:async r=>c({command:`magic-transit apps list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.apps.list({account_id:l})),{successLabel:`Loaded`})})};function Gt(e){return e.usage(`$0 magic-transit apps update <account-app-id>
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
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 Kt={command:`update <account-app-id>`,describe:`Update an App`,builder:Gt,handler:async r=>c({command:`magic-transit apps update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/apps/${r[`account-app-id`]==null?`<account-app-id>`:encodeURIComponent(String(r[`account-app-id`]))}`,pathParams:{"account-app-id":String(r[`account-app-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({hostnames:r.hostnames,name:p(r.name,`name`,`text`),type:p(r.type,`type`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.apps.update({body:e,account_id:l,account_app_id:r[`account-app-id`]})),{successLabel:`Updated`});return}let d=f({hostnames:r.hostnames,name:p(r.name,`name`,`text`),type:p(r.type,`type`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.apps.update({body:d,account_id:l,account_app_id:r[`account-app-id`]})),{successLabel:`Updated`})})},qt={command:`apps`,describe:`Application-aware traffic policies for Magic WAN that steer traffic by app type`,builder:e=>e.command(Bt).command(Ht).command(Wt).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jt(e){return e.usage(`$0 magic-transit bgp-filter-profiles create
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
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`]}).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 Yt={command:`create`,describe:`Create BGP Filter Profile`,builder:Jt,handler:async r=>c({command:`magic-transit bgp-filter-profiles create`,classification:{safeFlags:[`match-action`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-filter-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),match_action:p(r[`match-action`],`match-action`,`text`),name:p(r.name,`name`,`text`),targets:r.targets}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.bgpFilterProfiles.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`match-action`]===void 0&&(r[`match-action`]=await h(`match-action`,`Action to take when a route matches one of the targets in this profile`,[`allow`,`deny`])),r.name===void 0&&(r.name=await m(`name`,`Friendly name for the filter profile`)),r.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let d=f({description:p(r.description,`description`,`text`),match_action:p(r[`match-action`],`match-action`,`text`),name:p(r.name,`name`,`text`),targets:r.targets});a(await s(`Creating`,async()=>c.magicTransit.bgpFilterProfiles.create({...d,account_id:l})),{successLabel:`Created`})})};function Xt(e){return e.usage(`$0 magic-transit bgp-filter-profiles delete <profile-id>
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
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 Zt={command:`delete <profile-id>`,describe:`Delete BGP Filter Profile`,builder:Xt,handler:async r=>c({command:`magic-transit bgp-filter-profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-filter-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/filter_profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
117
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.bgpFilterProfiles.delete({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Deleted`})})};function Qt(e){return e.usage(`$0 magic-transit bgp-filter-profiles get <profile-id>
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.bgpFilterProfiles.delete({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Deleted`})})};function en(e){return e.usage(`$0 magic-transit bgp-filter-profiles get <profile-id>
|
|
119
|
+
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 $t={command:`get <profile-id>`,describe:`Get BGP Filter Profile`,builder:Qt,handler:async r=>c({command:`magic-transit bgp-filter-profiles get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-filter-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/filter_profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.bgpFilterProfiles.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function en(e){return e.usage(`$0 magic-transit bgp-filter-profiles list
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
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 tn={command:`list`,describe:`List BGP Filter Profiles`,builder:en,handler:async r=>c({command:`magic-transit bgp-filter-profiles list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-filter-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.bgpFilterProfiles.list({account_id:l})),{successLabel:`Loaded`})})};function nn(e){return e.usage(`$0 magic-transit bgp-filter-profiles update <profile-id>
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
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`]}).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 rn={command:`update <profile-id>`,describe:`Update BGP Filter Profile`,builder:nn,handler:async r=>c({command:`magic-transit bgp-filter-profiles update`,classification:{safeFlags:[`match-action`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-filter-profiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/filter_profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),match_action:p(r[`match-action`],`match-action`,`text`),name:p(r.name,`name`,`text`),targets:r.targets}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.bgpFilterProfiles.update({...e,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`});return}let d=f({description:p(r.description,`description`,`text`),match_action:p(r[`match-action`],`match-action`,`text`),name:p(r.name,`name`,`text`),targets:r.targets});a(await s(`Updating`,async()=>c.magicTransit.bgpFilterProfiles.update({...d,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`})})},an={command:`bgp-filter-profiles`,describe:`BGP filter profiles for controlling which routes are allowed or denied on Magic Transit tunnels`,builder:e=>e.command(Yt).command(Zt).command($t).command(tn).command(rn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function on(e){return e.usage(`$0 magic-transit bgp-settings get
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
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 sn={command:`get`,describe:`Get BGP Settings`,builder:on,handler:async r=>c({command:`magic-transit bgp-settings get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.bgpSettings.get({account_id:l})),{successLabel:`Loaded`})})};function cn(e){return e.usage(`$0 magic-transit bgp-settings update
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
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 ln={command:`update`,describe:`Update BGP Settings`,builder:cn,handler:async r=>c({command:`magic-transit bgp-settings update`,classification:{safeFlags:[`redistribute-static:wan`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit bgp-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({cloudflare_asn:r[`cloudflare-asn`],redistribute:{"static:wan":r[`redistribute-static:wan`]}}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.bgpSettings.update({...e,account_id:l})),{successLabel:`Updated`});return}let d=f({cloudflare_asn:r[`cloudflare-asn`],redistribute:{"static:wan":r[`redistribute-static:wan`]}});a(await s(`Updating`,async()=>c.magicTransit.bgpSettings.update({...d,account_id:l})),{successLabel:`Updated`})})},un={command:`bgp-settings`,describe:`BGP settings for controlling default ASN and route redistribution on Magic Transit tunnels`,builder:e=>e.command(sn).command(ln).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dn(e){return e.usage(`$0 magic-transit cf-interconnects bulk-update
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
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 fn={command:`bulk-update`,describe:`Update multiple interconnects`,builder:dn,handler:async l=>c({command:`magic-transit cf-interconnects bulk-update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit cf-interconnects bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let d=await i(l),f=l.local?e:await n();if(l.accountId=f,l.body){let e=u(l.body);a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/magic/cf_interconnects`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/magic/cf_interconnects`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function pn(e){return e.usage(`$0 magic-transit cf-interconnects get <cf-interconnect-id>
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
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 mn={command:`get <cf-interconnect-id>`,describe:`List interconnect Details`,builder:pn,handler:async l=>c({command:`magic-transit cf-interconnects get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit cf-interconnects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf_interconnects/${l[`cf-interconnect-id`]==null?`<cf-interconnect-id>`:encodeURIComponent(String(l[`cf-interconnect-id`]))}`,pathParams:{"cf-interconnect-id":String(l[`cf-interconnect-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/cf_interconnects/${encodeURIComponent(String(l[`cf-interconnect-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function hn(e){return e.usage(`$0 magic-transit cf-interconnects list
|
|
132
132
|
|
|
133
|
-
Lists
|
|
134
|
-
|
|
135
|
-
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 vn={command:`list`,describe:`List interconnects`,builder:_n,handler:async l=>c({command:`magic-transit cf-interconnects list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit cf-interconnects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/cf_interconnects`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function yn(e){return e.usage(`$0 magic-transit cf-interconnects update <cf-interconnect-id>
|
|
133
|
+
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 gn={command:`list`,describe:`List interconnects`,builder:hn,handler:async l=>c({command:`magic-transit cf-interconnects list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit cf-interconnects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/cf_interconnects`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function _n(e){return e.usage(`$0 magic-transit cf-interconnects update <cf-interconnect-id>
|
|
136
134
|
|
|
137
135
|
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.
|
|
138
136
|
|
|
@@ -154,29 +152,29 @@ use a /30 or /31 prefix. For GRE Interconnects, a /30 or /31 prefix
|
|
|
154
152
|
may be used. Version 1.5 interconnects require a /31 prefix and may
|
|
155
153
|
also use a prefix from the account's authorized prefixes; otherwise,
|
|
156
154
|
select the subnet from RFC 1918 or the approved link-local ranges.
|
|
157
|
-
`}).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
|
|
155
|
+
`}).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 vn={command:`update <cf-interconnect-id>`,describe:`Update interconnect`,builder:_n,handler:async d=>c({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`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){o({command:`cf magic-transit cf-interconnects update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf_interconnects/${d[`cf-interconnect-id`]==null?`<cf-interconnect-id>`:encodeURIComponent(String(d[`cf-interconnect-id`]))}`,pathParams:{"cf-interconnect-id":String(d[`cf-interconnect-id`]??``)},bodyKind:`json`,body:d.body===void 0?f({automatic_return_routing:d[`automatic-return-routing`],bgp:{as_no:d[`bgp-as-no`],cloudflare_endpoint:p(d[`bgp-cloudflare-endpoint`],`bgp-cloudflare-endpoint`,`text`),customer_asn:d[`bgp-customer-asn`],customer_endpoint:p(d[`bgp-customer-endpoint`],`bgp-customer-endpoint`,`text`),export_filter_id:p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:d[`bgp-extra-prefixes`],import_filter_id:p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)},description:p(d.description,`description`,`text`),gre:{cloudflare_endpoint:p(d[`gre-cloudflare-endpoint`],`gre-cloudflare-endpoint`,`text`)},health_check:{enabled:d[`health-check-enabled`],rate:p(d[`health-check-rate`],`health-check-rate`,`text`),target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:p(d[`health-check-type`],`health-check-type`,`text`),direction:p(d[`health-check-direction`],`health-check-direction`,`text`),source:p(d[`health-check-source`],`health-check-source`,`text`)},interface_address:p(d[`interface-address`],`interface-address`,`text`),interface_address6:p(d[`interface-address6`],`interface-address6`,`text`),mtu:d.mtu,name:p(d.name,`name`,`text`)}):u(d.body)});return}let m=await i(d),h=d.local?e:await n();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/magic/cf_interconnects/${encodeURIComponent(String(d[`cf-interconnect-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};d[`automatic-return-routing`]!==void 0&&l(g,[`automatic_return_routing`],d[`automatic-return-routing`]),d[`bgp-as-no`]!==void 0&&l(g,[`bgp`,`as_no`],d[`bgp-as-no`]),d[`bgp-cloudflare-endpoint`]!==void 0&&l(g,[`bgp`,`cloudflare_endpoint`],p(d[`bgp-cloudflare-endpoint`],`bgp-cloudflare-endpoint`,`text`)),d[`bgp-customer-asn`]!==void 0&&l(g,[`bgp`,`customer_asn`],d[`bgp-customer-asn`]),d[`bgp-customer-endpoint`]!==void 0&&l(g,[`bgp`,`customer_endpoint`],p(d[`bgp-customer-endpoint`],`bgp-customer-endpoint`,`text`)),d[`bgp-export-filter-id`]!==void 0&&l(g,[`bgp`,`export_filter_id`],p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),d[`bgp-extra-prefixes`]!==void 0&&l(g,[`bgp`,`extra_prefixes`],d[`bgp-extra-prefixes`]),d[`bgp-import-filter-id`]!==void 0&&l(g,[`bgp`,`import_filter_id`],p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),d[`bgp-md5-key`]!==void 0&&l(g,[`bgp`,`md5_key`],p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)),d.description!==void 0&&l(g,[`description`],p(d.description,`description`,`text`)),d[`gre-cloudflare-endpoint`]!==void 0&&l(g,[`gre`,`cloudflare_endpoint`],p(d[`gre-cloudflare-endpoint`],`gre-cloudflare-endpoint`,`text`)),d[`health-check-enabled`]!==void 0&&l(g,[`health_check`,`enabled`],d[`health-check-enabled`]),d[`health-check-rate`]!==void 0&&l(g,[`health_check`,`rate`],p(d[`health-check-rate`],`health-check-rate`,`text`)),d[`health-check-target-saved`]!==void 0&&l(g,[`health_check`,`target`,`saved`],p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)),d[`health-check-type`]!==void 0&&l(g,[`health_check`,`type`],p(d[`health-check-type`],`health-check-type`,`text`)),d[`health-check-direction`]!==void 0&&l(g,[`health_check`,`direction`],p(d[`health-check-direction`],`health-check-direction`,`text`)),d[`health-check-source`]!==void 0&&l(g,[`health_check`,`source`],p(d[`health-check-source`],`health-check-source`,`text`)),d[`interface-address`]!==void 0&&l(g,[`interface_address`],p(d[`interface-address`],`interface-address`,`text`)),d[`interface-address6`]!==void 0&&l(g,[`interface_address6`],p(d[`interface-address6`],`interface-address6`,`text`)),d.mtu!==void 0&&l(g,[`mtu`],d.mtu),d.name!==void 0&&l(g,[`name`],p(d.name,`name`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/magic/cf_interconnects/${encodeURIComponent(String(d[`cf-interconnect-id`]))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},yn={command:`cf-interconnects`,describe:`Cloudflare Network Interconnect (CNI) links for direct physical or virtual peering`,builder:e=>e.command(fn).command(mn).command(gn).command(vn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bn(e){return e.usage(`$0 magic-transit cf1-sites create
|
|
158
156
|
|
|
159
|
-
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
|
|
157
|
+
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 xn={command:`create`,describe:`Create CF1 Sites`,builder:bn,handler:async r=>c({command:`magic-transit cf1-sites create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.cf1Sites.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Sn(e){return e.usage(`$0 magic-transit cf1-sites delete <cf1-site-id>
|
|
160
158
|
|
|
161
|
-
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
|
|
162
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.cf1Sites.delete({account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Deleted`})})};function
|
|
159
|
+
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 Cn={command:`delete <cf1-site-id>`,describe:`Delete CF1 Site`,builder:Sn,handler:async r=>c({command:`magic-transit cf1-sites delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
160
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.cf1Sites.delete({account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Deleted`})})};function wn(e){return e.usage(`$0 magic-transit cf1-sites get <cf1-site-id>
|
|
163
161
|
|
|
164
|
-
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
|
|
162
|
+
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 Tn={command:`get <cf1-site-id>`,describe:`Get CF1 Site`,builder:wn,handler:async r=>c({command:`magic-transit cf1-sites get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.cf1Sites.get({account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Loaded`})})};function En(e){return e.usage(`$0 magic-transit cf1-sites list
|
|
165
163
|
|
|
166
|
-
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
|
|
164
|
+
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 Dn={command:`list`,describe:`List CF1 Sites`,builder:En,handler:async r=>c({command:`magic-transit cf1-sites list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.cf1Sites.list({account_id:l})),{successLabel:`Loaded`})})};function On(e){return e.usage(`$0 magic-transit cf1-sites ramps create <cf1-site-id>
|
|
167
165
|
|
|
168
|
-
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
|
|
166
|
+
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 kn={command:`create <cf1-site-id>`,describe:`Create CF1 Site Ramps`,builder:On,handler:async r=>c({command:`magic-transit cf1-sites ramps create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}/ramps`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.cf1Sites.ramps.create({body:e,account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function An(e){return e.usage(`$0 magic-transit cf1-sites ramps delete <ramp-id>
|
|
169
167
|
|
|
170
|
-
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
|
|
171
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.cf1Sites.ramps.delete({account_id:l,cf1_site_id:r[`cf1-site-id`],ramp_id:r[`ramp-id`]})),{successLabel:`Deleted`})})};function
|
|
168
|
+
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 jn={command:`delete <ramp-id>`,describe:`Delete CF1 Site Ramp`,builder:An,handler:async r=>c({command:`magic-transit cf1-sites ramps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}/ramps/${r[`ramp-id`]==null?`<ramp-id>`:encodeURIComponent(String(r[`ramp-id`]))}`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``),"ramp-id":String(r[`ramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
169
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.cf1Sites.ramps.delete({account_id:l,cf1_site_id:r[`cf1-site-id`],ramp_id:r[`ramp-id`]})),{successLabel:`Deleted`})})};function $(e){return e.usage(`$0 magic-transit cf1-sites ramps get <ramp-id>
|
|
172
170
|
|
|
173
|
-
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
|
|
171
|
+
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 Mn={command:`get <ramp-id>`,describe:`Get CF1 Site Ramp`,builder:$,handler:async r=>c({command:`magic-transit cf1-sites ramps get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}/ramps/${r[`ramp-id`]==null?`<ramp-id>`:encodeURIComponent(String(r[`ramp-id`]))}`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``),"ramp-id":String(r[`ramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.cf1Sites.ramps.get({account_id:l,cf1_site_id:r[`cf1-site-id`],ramp_id:r[`ramp-id`]})),{successLabel:`Loaded`})})};function Nn(e){return e.usage(`$0 magic-transit cf1-sites ramps list
|
|
174
172
|
|
|
175
|
-
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
|
|
173
|
+
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 Pn={command:`list`,describe:`List CF1 Site Ramps`,builder:Nn,handler:async r=>c({command:`magic-transit cf1-sites ramps list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}/ramps`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.cf1Sites.ramps.list({account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Loaded`})})},Fn={command:`ramps`,describe:`Operations for cf1-sites.ramps`,builder:e=>e.command(kn).command(jn).command(Mn).command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function In(e){return e.usage(`$0 magic-transit cf1-sites update <cf1-site-id>
|
|
176
174
|
|
|
177
|
-
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
|
|
175
|
+
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 Ln={command:`update <cf1-site-id>`,describe:`Update CF1 Site`,builder:In,handler:async r=>c({command:`magic-transit cf1-sites update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit cf1-sites update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/cf1_sites/${r[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(r[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(r[`cf1-site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),location:{lat:r[`location-lat`],long:r[`location-long`],name:p(r[`location-name`],`location-name`,`text`)},name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.cf1Sites.update({...e,account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Updated`});return}let d=f({description:p(r.description,`description`,`text`),location:{lat:r[`location-lat`],long:r[`location-long`],name:p(r[`location-name`],`location-name`,`text`)},name:p(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.cf1Sites.update({...d,account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Updated`})})},Rn={command:`cf1-sites`,describe:`Operations for cf1-sites`,builder:e=>e.command(xn).command(Cn).command(Tn).command(Dn).command(Ln).command(Fn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zn(e){return e.usage(`$0 magic-transit gre-tunnels bulk-update
|
|
178
176
|
|
|
179
|
-
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
|
|
177
|
+
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 Bn={command:`bulk-update`,describe:`Update multiple GRE tunnels`,builder:zn,handler:async l=>c({command:`magic-transit gre-tunnels bulk-update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit gre-tunnels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let d=await i(l),f=l.local?e:await n();if(l.accountId=f,l.body){let e=u(l.body);a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/magic/gre_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/magic/gre_tunnels`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function Vn(e){return e.usage(`$0 magic-transit gre-tunnels create
|
|
180
178
|
|
|
181
179
|
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.
|
|
182
180
|
|
|
@@ -193,18 +191,18 @@ character:
|
|
|
193
191
|
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
194
192
|
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
195
193
|
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
196
|
-
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`]}).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`]}).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`]}).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
|
|
194
|
+
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`]}).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`]}).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`]}).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 Hn={command:`create`,describe:`Create a GRE tunnel`,builder:Vn,handler:async d=>c({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`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){o({command:`cf magic-transit gre-tunnels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({automatic_return_routing:d[`automatic-return-routing`],bgp:{customer_asn:d[`bgp-customer-asn`],export_filter_id:p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:d[`bgp-extra-prefixes`],import_filter_id:p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_gre_endpoint:p(d[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`),customer_gre_endpoint:p(d[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`),description:p(d.description,`description`,`text`),health_check:{enabled:d[`health-check-enabled`],rate:p(d[`health-check-rate`],`health-check-rate`,`text`),target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:p(d[`health-check-type`],`health-check-type`,`text`),direction:p(d[`health-check-direction`],`health-check-direction`,`text`)},interface_address:p(d[`interface-address`],`interface-address`,`text`),interface_address6:p(d[`interface-address6`],`interface-address6`,`text`),mtu:d.mtu,name:p(d.name,`name`,`text`),ttl:d.ttl}):u(d.body)});return}let h=await i(d),g=d.local?e:await n();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/magic/gre_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d[`cloudflare-gre-endpoint`]===void 0&&(d[`cloudflare-gre-endpoint`]=await m(`cloudflare-gre-endpoint`,`The IP address assigned to the Cloudflare side of the GRE tunnel.`)),d[`customer-gre-endpoint`]===void 0&&(d[`customer-gre-endpoint`]=await m(`customer-gre-endpoint`,`The IP address assigned to the customer side of the GRE tunnel.`)),d[`interface-address`]===void 0&&(d[`interface-address`]=await m(`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.`)),d.name===void 0&&(d.name=await m(`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 _={};d[`automatic-return-routing`]!==void 0&&l(_,[`automatic_return_routing`],d[`automatic-return-routing`]),d[`bgp-customer-asn`]!==void 0&&l(_,[`bgp`,`customer_asn`],d[`bgp-customer-asn`]),d[`bgp-export-filter-id`]!==void 0&&l(_,[`bgp`,`export_filter_id`],p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),d[`bgp-extra-prefixes`]!==void 0&&l(_,[`bgp`,`extra_prefixes`],d[`bgp-extra-prefixes`]),d[`bgp-import-filter-id`]!==void 0&&l(_,[`bgp`,`import_filter_id`],p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),d[`bgp-md5-key`]!==void 0&&l(_,[`bgp`,`md5_key`],p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)),d[`cloudflare-gre-endpoint`]!==void 0&&l(_,[`cloudflare_gre_endpoint`],p(d[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`)),d[`customer-gre-endpoint`]!==void 0&&l(_,[`customer_gre_endpoint`],p(d[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`)),d.description!==void 0&&l(_,[`description`],p(d.description,`description`,`text`)),d[`health-check-enabled`]!==void 0&&l(_,[`health_check`,`enabled`],d[`health-check-enabled`]),d[`health-check-rate`]!==void 0&&l(_,[`health_check`,`rate`],p(d[`health-check-rate`],`health-check-rate`,`text`)),d[`health-check-target-saved`]!==void 0&&l(_,[`health_check`,`target`,`saved`],p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)),d[`health-check-type`]!==void 0&&l(_,[`health_check`,`type`],p(d[`health-check-type`],`health-check-type`,`text`)),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],p(d[`health-check-direction`],`health-check-direction`,`text`)),d[`interface-address`]!==void 0&&l(_,[`interface_address`],p(d[`interface-address`],`interface-address`,`text`)),d[`interface-address6`]!==void 0&&l(_,[`interface_address6`],p(d[`interface-address6`],`interface-address6`,`text`)),d.mtu!==void 0&&l(_,[`mtu`],d.mtu),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d.ttl!==void 0&&l(_,[`ttl`],d.ttl),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/magic/gre_tunnels`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function Un(e){return e.usage(`$0 magic-transit gre-tunnels delete <gre-tunnel-id>
|
|
197
195
|
|
|
198
|
-
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
|
|
199
|
-
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(l[`gre-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function
|
|
196
|
+
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 Wn={command:`delete <gre-tunnel-id>`,describe:`Delete GRE Tunnel`,builder:Un,handler:async l=>c({command:`magic-transit gre-tunnels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit gre-tunnels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/gre_tunnels/${l[`gre-tunnel-id`]==null?`<gre-tunnel-id>`:encodeURIComponent(String(l[`gre-tunnel-id`]))}`,pathParams:{"gre-tunnel-id":String(l[`gre-tunnel-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();if(l.accountId=d,!await g({force:!!l.force})){process.stderr.write(`Aborted.
|
|
197
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(l[`gre-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Gn(e){return e.usage(`$0 magic-transit gre-tunnels get <gre-tunnel-id>
|
|
200
198
|
|
|
201
|
-
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
|
|
199
|
+
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 Kn={command:`get <gre-tunnel-id>`,describe:`List GRE Tunnel Details`,builder:Gn,handler:async l=>c({command:`magic-transit gre-tunnels get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit gre-tunnels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/gre_tunnels/${l[`gre-tunnel-id`]==null?`<gre-tunnel-id>`:encodeURIComponent(String(l[`gre-tunnel-id`]))}`,pathParams:{"gre-tunnel-id":String(l[`gre-tunnel-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(l[`gre-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function qn(e){return e.usage(`$0 magic-transit gre-tunnels list
|
|
202
200
|
|
|
203
|
-
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
|
|
201
|
+
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 Jn={command:`list`,describe:`List GRE tunnels`,builder:qn,handler:async l=>c({command:`magic-transit gre-tunnels list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit gre-tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/gre_tunnels`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function Yn(e){return e.usage(`$0 magic-transit gre-tunnels update <gre-tunnel-id>
|
|
204
202
|
|
|
205
|
-
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`]}).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`]}).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`]}).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
|
|
203
|
+
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`]}).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`]}).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`]}).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 Xn={command:`update <gre-tunnel-id>`,describe:`Update GRE Tunnel`,builder:Yn,handler:async d=>c({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`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){o({command:`cf magic-transit gre-tunnels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/gre_tunnels/${d[`gre-tunnel-id`]==null?`<gre-tunnel-id>`:encodeURIComponent(String(d[`gre-tunnel-id`]))}`,pathParams:{"gre-tunnel-id":String(d[`gre-tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?f({automatic_return_routing:d[`automatic-return-routing`],cloudflare_gre_endpoint:p(d[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`),customer_gre_endpoint:p(d[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`),description:p(d.description,`description`,`text`),health_check:{enabled:d[`health-check-enabled`],rate:p(d[`health-check-rate`],`health-check-rate`,`text`),target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:p(d[`health-check-type`],`health-check-type`,`text`),direction:p(d[`health-check-direction`],`health-check-direction`,`text`)},interface_address:p(d[`interface-address`],`interface-address`,`text`),interface_address6:p(d[`interface-address6`],`interface-address6`,`text`),mtu:d.mtu,name:p(d.name,`name`,`text`),ttl:d.ttl}):u(d.body)});return}let h=await i(d),g=d.local?e:await n();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(h,`PUT`,`/accounts/${g}/magic/gre_tunnels/${encodeURIComponent(String(d[`gre-tunnel-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}d[`cloudflare-gre-endpoint`]===void 0&&(d[`cloudflare-gre-endpoint`]=await m(`cloudflare-gre-endpoint`,`The IP address assigned to the Cloudflare side of the GRE tunnel.`)),d[`customer-gre-endpoint`]===void 0&&(d[`customer-gre-endpoint`]=await m(`customer-gre-endpoint`,`The IP address assigned to the customer side of the GRE tunnel.`)),d[`interface-address`]===void 0&&(d[`interface-address`]=await m(`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.`)),d.name===void 0&&(d.name=await m(`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 _={};d[`automatic-return-routing`]!==void 0&&l(_,[`automatic_return_routing`],d[`automatic-return-routing`]),d[`cloudflare-gre-endpoint`]!==void 0&&l(_,[`cloudflare_gre_endpoint`],p(d[`cloudflare-gre-endpoint`],`cloudflare-gre-endpoint`,`text`)),d[`customer-gre-endpoint`]!==void 0&&l(_,[`customer_gre_endpoint`],p(d[`customer-gre-endpoint`],`customer-gre-endpoint`,`text`)),d.description!==void 0&&l(_,[`description`],p(d.description,`description`,`text`)),d[`health-check-enabled`]!==void 0&&l(_,[`health_check`,`enabled`],d[`health-check-enabled`]),d[`health-check-rate`]!==void 0&&l(_,[`health_check`,`rate`],p(d[`health-check-rate`],`health-check-rate`,`text`)),d[`health-check-target-saved`]!==void 0&&l(_,[`health_check`,`target`,`saved`],p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)),d[`health-check-type`]!==void 0&&l(_,[`health_check`,`type`],p(d[`health-check-type`],`health-check-type`,`text`)),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],p(d[`health-check-direction`],`health-check-direction`,`text`)),d[`interface-address`]!==void 0&&l(_,[`interface_address`],p(d[`interface-address`],`interface-address`,`text`)),d[`interface-address6`]!==void 0&&l(_,[`interface_address6`],p(d[`interface-address6`],`interface-address6`,`text`)),d.mtu!==void 0&&l(_,[`mtu`],d.mtu),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d.ttl!==void 0&&l(_,[`ttl`],d.ttl),a(await s(`Updating`,async()=>r(h,`PUT`,`/accounts/${g}/magic/gre_tunnels/${encodeURIComponent(String(d[`gre-tunnel-id`]))}`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},Zn={command:`gre-tunnels`,describe:`GRE tunnel endpoints that connect your network to Cloudflare for Magic Transit`,builder:e=>e.command(Bn).command(Hn).command(Wn).command(Kn).command(Jn).command(Xn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qn(e){return e.usage(`$0 magic-transit ipsec-tunnels bulk-update
|
|
206
204
|
|
|
207
|
-
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
|
|
205
|
+
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 $n={command:`bulk-update`,describe:`Update multiple IPsec tunnels`,builder:Qn,handler:async l=>c({command:`magic-transit ipsec-tunnels bulk-update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit ipsec-tunnels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let d=await i(l),f=l.local?e:await n();if(l.accountId=f,l.body){let e=u(l.body);a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/magic/ipsec_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/magic/ipsec_tunnels`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function er(e){return e.usage(`$0 magic-transit ipsec-tunnels create
|
|
208
206
|
|
|
209
207
|
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.
|
|
210
208
|
|
|
@@ -228,18 +226,18 @@ Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
|
228
226
|
|
|
229
227
|
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
230
228
|
fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
|
|
231
|
-
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`]}).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`]}).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`]}).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
|
|
229
|
+
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`]}).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`]}).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`]}).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 tr={command:`create`,describe:`Create an IPsec tunnel`,builder:er,handler:async d=>c({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`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){o({command:`cf magic-transit ipsec-tunnels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({automatic_return_routing:d[`automatic-return-routing`],bgp:{customer_asn:d[`bgp-customer-asn`],export_filter_id:p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:d[`bgp-extra-prefixes`],import_filter_id:p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_endpoint:p(d[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`),custom_remote_identities:{fqdn_id:p(d[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)},customer_endpoint:p(d[`customer-endpoint`],`customer-endpoint`,`text`),description:p(d.description,`description`,`text`),health_check:{enabled:d[`health-check-enabled`],rate:p(d[`health-check-rate`],`health-check-rate`,`text`),target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:p(d[`health-check-type`],`health-check-type`,`text`),direction:p(d[`health-check-direction`],`health-check-direction`,`text`)},interface_address:p(d[`interface-address`],`interface-address`,`text`),interface_address6:p(d[`interface-address6`],`interface-address6`,`text`),name:p(d.name,`name`,`text`),psk:p(d.psk,`psk`,`text`),replay_protection:d[`replay-protection`]}):u(d.body)});return}let h=await i(d),g=d.local?e:await n();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/magic/ipsec_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d[`cloudflare-endpoint`]===void 0&&(d[`cloudflare-endpoint`]=await m(`cloudflare-endpoint`,`The IP address assigned to the Cloudflare side of the IPsec tunnel.`)),d[`interface-address`]===void 0&&(d[`interface-address`]=await m(`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.`)),d.name===void 0&&(d.name=await m(`name`,`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`));let _={};d[`automatic-return-routing`]!==void 0&&l(_,[`automatic_return_routing`],d[`automatic-return-routing`]),d[`bgp-customer-asn`]!==void 0&&l(_,[`bgp`,`customer_asn`],d[`bgp-customer-asn`]),d[`bgp-export-filter-id`]!==void 0&&l(_,[`bgp`,`export_filter_id`],p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),d[`bgp-extra-prefixes`]!==void 0&&l(_,[`bgp`,`extra_prefixes`],d[`bgp-extra-prefixes`]),d[`bgp-import-filter-id`]!==void 0&&l(_,[`bgp`,`import_filter_id`],p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),d[`bgp-md5-key`]!==void 0&&l(_,[`bgp`,`md5_key`],p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)),d[`cloudflare-endpoint`]!==void 0&&l(_,[`cloudflare_endpoint`],p(d[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`)),d[`custom-remote-identities-fqdn-id`]!==void 0&&l(_,[`custom_remote_identities`,`fqdn_id`],p(d[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)),d[`customer-endpoint`]!==void 0&&l(_,[`customer_endpoint`],p(d[`customer-endpoint`],`customer-endpoint`,`text`)),d.description!==void 0&&l(_,[`description`],p(d.description,`description`,`text`)),d[`health-check-enabled`]!==void 0&&l(_,[`health_check`,`enabled`],d[`health-check-enabled`]),d[`health-check-rate`]!==void 0&&l(_,[`health_check`,`rate`],p(d[`health-check-rate`],`health-check-rate`,`text`)),d[`health-check-target-saved`]!==void 0&&l(_,[`health_check`,`target`,`saved`],p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)),d[`health-check-type`]!==void 0&&l(_,[`health_check`,`type`],p(d[`health-check-type`],`health-check-type`,`text`)),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],p(d[`health-check-direction`],`health-check-direction`,`text`)),d[`interface-address`]!==void 0&&l(_,[`interface_address`],p(d[`interface-address`],`interface-address`,`text`)),d[`interface-address6`]!==void 0&&l(_,[`interface_address6`],p(d[`interface-address6`],`interface-address6`,`text`)),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d.psk!==void 0&&l(_,[`psk`],p(d.psk,`psk`,`text`)),d[`replay-protection`]!==void 0&&l(_,[`replay_protection`],d[`replay-protection`]),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/magic/ipsec_tunnels`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function nr(e){return e.usage(`$0 magic-transit ipsec-tunnels delete <ipsec-tunnel-id>
|
|
232
230
|
|
|
233
|
-
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
|
|
234
|
-
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function
|
|
231
|
+
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 rr={command:`delete <ipsec-tunnel-id>`,describe:`Delete IPsec Tunnel`,builder:nr,handler:async l=>c({command:`magic-transit ipsec-tunnels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit ipsec-tunnels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels/${l[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,pathParams:{"ipsec-tunnel-id":String(l[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();if(l.accountId=d,!await g({force:!!l.force})){process.stderr.write(`Aborted.
|
|
232
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function ir(e){return e.usage(`$0 magic-transit ipsec-tunnels get <ipsec-tunnel-id>
|
|
235
233
|
|
|
236
|
-
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
|
|
234
|
+
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 ar={command:`get <ipsec-tunnel-id>`,describe:`List IPsec tunnel details`,builder:ir,handler:async l=>c({command:`magic-transit ipsec-tunnels get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit ipsec-tunnels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels/${l[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,pathParams:{"ipsec-tunnel-id":String(l[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function or(e){return e.usage(`$0 magic-transit ipsec-tunnels list
|
|
237
235
|
|
|
238
|
-
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
|
|
236
|
+
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 sr={command:`list`,describe:`List IPsec tunnels`,builder:or,handler:async l=>c({command:`magic-transit ipsec-tunnels list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit ipsec-tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/ipsec_tunnels`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function cr(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-generate <ipsec-tunnel-id>
|
|
239
237
|
|
|
240
|
-
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
|
|
238
|
+
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 lr={command:`psk-generate <ipsec-tunnel-id>`,describe:`Generate Pre-Shared Key (PSK) for IPsec tunnels`,builder:cr,handler:async r=>c({command:`magic-transit ipsec-tunnels psk-generate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit ipsec-tunnels psk-generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels/${r[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(r[`ipsec-tunnel-id`]))}/psk_generate`,pathParams:{"ipsec-tunnel-id":String(r[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Creating`,async()=>c.magicTransit.ipsecTunnels.pskGenerate({account_id:l,ipsec_tunnel_id:r[`ipsec-tunnel-id`]})),{successLabel:`Created`})})};function ur(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-set
|
|
241
239
|
|
|
242
|
-
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
|
|
240
|
+
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 dr={command:`psk-set`,describe:`Set Pre-Shared Keys (PSK) for IPsec tunnels`,builder:ur,handler:async r=>c({command:`magic-transit ipsec-tunnels psk-set`,classification:{safeFlags:[`validate-only`,`dry-run`]}},r,async()=>{let c={validate_only:r[`validate-only`]};if(r.dryRun){o({command:`cf magic-transit ipsec-tunnels psk-set`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels/psk`,pathParams:{},query:c,bodyKind:`json`,body:r.body===void 0?f({psks:d(r.psks,`psks`)}):u(r.body)});return}let l=await i(r),p=r.local?e:await n();if(r.accountId=p,r.body){let e=u(r.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>l.magicTransit.ipsecTunnels.pskSet({...e,account_id:p,...c})),{successLabel:`Created`});return}if(r.psks===void 0)throw Error(`--psks is required (or pass --body with this field set).`);let m=f({psks:d(r.psks,`psks`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>l.magicTransit.ipsecTunnels.pskSet({...m,account_id:p,...c})),{successLabel:`Created`})})};function fr(e){return e.usage(`$0 magic-transit ipsec-tunnels update <ipsec-tunnel-id>
|
|
243
241
|
|
|
244
242
|
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.
|
|
245
243
|
|
|
@@ -263,125 +261,123 @@ Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
|
263
261
|
|
|
264
262
|
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
265
263
|
fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
|
|
266
|
-
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`]}).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`]}).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`]}).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
|
|
267
|
-
|
|
268
|
-
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 vr={command:`create`,describe:`Create PCAP request`,builder:_r,handler:async r=>c({command:`magic-transit pcaps create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.pcaps.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function yr(e){return e.usage(`$0 magic-transit pcaps download get <pcap-id>
|
|
264
|
+
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`]}).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`]}).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`]}).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 pr={command:`update <ipsec-tunnel-id>`,describe:`Update IPsec Tunnel`,builder:fr,handler:async d=>c({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`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){o({command:`cf magic-transit ipsec-tunnels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/ipsec_tunnels/${d[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(d[`ipsec-tunnel-id`]))}`,pathParams:{"ipsec-tunnel-id":String(d[`ipsec-tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?f({automatic_return_routing:d[`automatic-return-routing`],bgp:{customer_asn:d[`bgp-customer-asn`],export_filter_id:p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`),extra_prefixes:d[`bgp-extra-prefixes`],import_filter_id:p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`),md5_key:p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)},cloudflare_endpoint:p(d[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`),custom_remote_identities:{fqdn_id:p(d[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)},customer_endpoint:p(d[`customer-endpoint`],`customer-endpoint`,`text`),description:p(d.description,`description`,`text`),health_check:{enabled:d[`health-check-enabled`],rate:p(d[`health-check-rate`],`health-check-rate`,`text`),target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:p(d[`health-check-type`],`health-check-type`,`text`),direction:p(d[`health-check-direction`],`health-check-direction`,`text`)},interface_address:p(d[`interface-address`],`interface-address`,`text`),interface_address6:p(d[`interface-address6`],`interface-address6`,`text`),name:p(d.name,`name`,`text`),psk:p(d.psk,`psk`,`text`),replay_protection:d[`replay-protection`]}):u(d.body)});return}let h=await i(d),g=d.local?e:await n();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(h,`PUT`,`/accounts/${g}/magic/ipsec_tunnels/${encodeURIComponent(String(d[`ipsec-tunnel-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}d[`cloudflare-endpoint`]===void 0&&(d[`cloudflare-endpoint`]=await m(`cloudflare-endpoint`,`The IP address assigned to the Cloudflare side of the IPsec tunnel.`)),d[`interface-address`]===void 0&&(d[`interface-address`]=await m(`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.`)),d.name===void 0&&(d.name=await m(`name`,`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`));let _={};d[`automatic-return-routing`]!==void 0&&l(_,[`automatic_return_routing`],d[`automatic-return-routing`]),d[`bgp-customer-asn`]!==void 0&&l(_,[`bgp`,`customer_asn`],d[`bgp-customer-asn`]),d[`bgp-export-filter-id`]!==void 0&&l(_,[`bgp`,`export_filter_id`],p(d[`bgp-export-filter-id`],`bgp-export-filter-id`,`text`)),d[`bgp-extra-prefixes`]!==void 0&&l(_,[`bgp`,`extra_prefixes`],d[`bgp-extra-prefixes`]),d[`bgp-import-filter-id`]!==void 0&&l(_,[`bgp`,`import_filter_id`],p(d[`bgp-import-filter-id`],`bgp-import-filter-id`,`text`)),d[`bgp-md5-key`]!==void 0&&l(_,[`bgp`,`md5_key`],p(d[`bgp-md5-key`],`bgp-md5-key`,`text`)),d[`cloudflare-endpoint`]!==void 0&&l(_,[`cloudflare_endpoint`],p(d[`cloudflare-endpoint`],`cloudflare-endpoint`,`text`)),d[`custom-remote-identities-fqdn-id`]!==void 0&&l(_,[`custom_remote_identities`,`fqdn_id`],p(d[`custom-remote-identities-fqdn-id`],`custom-remote-identities-fqdn-id`,`text`)),d[`customer-endpoint`]!==void 0&&l(_,[`customer_endpoint`],p(d[`customer-endpoint`],`customer-endpoint`,`text`)),d.description!==void 0&&l(_,[`description`],p(d.description,`description`,`text`)),d[`health-check-enabled`]!==void 0&&l(_,[`health_check`,`enabled`],d[`health-check-enabled`]),d[`health-check-rate`]!==void 0&&l(_,[`health_check`,`rate`],p(d[`health-check-rate`],`health-check-rate`,`text`)),d[`health-check-target-saved`]!==void 0&&l(_,[`health_check`,`target`,`saved`],p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)),d[`health-check-type`]!==void 0&&l(_,[`health_check`,`type`],p(d[`health-check-type`],`health-check-type`,`text`)),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],p(d[`health-check-direction`],`health-check-direction`,`text`)),d[`interface-address`]!==void 0&&l(_,[`interface_address`],p(d[`interface-address`],`interface-address`,`text`)),d[`interface-address6`]!==void 0&&l(_,[`interface_address6`],p(d[`interface-address6`],`interface-address6`,`text`)),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d.psk!==void 0&&l(_,[`psk`],p(d.psk,`psk`,`text`)),d[`replay-protection`]!==void 0&&l(_,[`replay_protection`],d[`replay-protection`]),a(await s(`Updating`,async()=>r(h,`PUT`,`/accounts/${g}/magic/ipsec_tunnels/${encodeURIComponent(String(d[`ipsec-tunnel-id`]))}`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},mr={command:`ipsec-tunnels`,describe:`IPsec tunnel endpoints with pre-shared key management for encrypted transit`,builder:e=>e.command($n).command(tr).command(rr).command(ar).command(sr).command(lr).command(dr).command(pr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hr(e){return e.usage(`$0 magic-transit pcaps create
|
|
269
265
|
|
|
270
|
-
|
|
266
|
+
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 gr={command:`create`,describe:`Create PCAP request`,builder:hr,handler:async r=>c({command:`magic-transit pcaps create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.pcaps.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function _r(e){return e.usage(`$0 magic-transit pcaps download get <pcap-id>
|
|
271
267
|
|
|
272
|
-
|
|
268
|
+
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 vr={command:`get <pcap-id>`,describe:`Download Simple PCAP`,builder:_r,handler:async r=>c({command:`magic-transit pcaps download get`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/${r[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(r[`pcap-id`]))}/download`,pathParams:{"pcap-id":String(r[`pcap-id`]??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await n();r.accountId=a;let c=await s(`Loading`,async()=>ee(`/accounts/${a}/pcaps/${encodeURIComponent(String(r[`pcap-id`]))}/download`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?c.toString(`utf-8`):c)})},yr={command:`download`,describe:`Operations for pcaps.download`,builder:e=>e.command(vr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function br(e){return e.usage(`$0 magic-transit pcaps get <pcap-id>
|
|
273
269
|
|
|
274
|
-
|
|
270
|
+
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 xr={command:`get <pcap-id>`,describe:`Get PCAP request`,builder:br,handler:async r=>c({command:`magic-transit pcaps get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/${r[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(r[`pcap-id`]))}`,pathParams:{"pcap-id":String(r[`pcap-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.pcaps.get({account_id:l,pcap_id:r[`pcap-id`]})),{successLabel:`Loaded`})})};function Sr(e){return e.usage(`$0 magic-transit pcaps list
|
|
275
271
|
|
|
276
|
-
|
|
272
|
+
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 Cr={command:`list`,describe:`List packet capture requests`,builder:Sr,handler:async r=>c({command:`magic-transit pcaps list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.pcaps.list({account_id:l})),{successLabel:`Loaded`})})};function wr(e){return e.usage(`$0 magic-transit pcaps ownership create
|
|
277
273
|
|
|
278
|
-
|
|
279
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.pcaps.ownership.delete({account_id:l,ownership_id:r[`ownership-id`]})),{successLabel:`Deleted`})})};function Ar(e){return e.usage(`$0 magic-transit pcaps ownership get
|
|
274
|
+
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 Tr={command:`create`,describe:`Add buckets for full packet captures`,builder:wr,handler:async r=>c({command:`magic-transit pcaps ownership create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({destination_conf:p(r[`destination-conf`],`destination-conf`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.create({...e,account_id:l})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await m(`destination-conf`,"The full URI for the bucket. This field only applies to `full` packet captures."));let d=f({destination_conf:p(r[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.create({...d,account_id:l})),{successLabel:`Created`})})};function Er(e){return e.usage(`$0 magic-transit pcaps ownership delete <ownership-id>
|
|
280
275
|
|
|
281
|
-
|
|
276
|
+
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 Dr={command:`delete <ownership-id>`,describe:`Delete buckets for full packet captures`,builder:Er,handler:async r=>c({command:`magic-transit pcaps ownership delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps ownership delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/ownership/${r[`ownership-id`]==null?`<ownership-id>`:encodeURIComponent(String(r[`ownership-id`]))}`,pathParams:{"ownership-id":String(r[`ownership-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
277
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.pcaps.ownership.delete({account_id:l,ownership_id:r[`ownership-id`]})),{successLabel:`Deleted`})})};function Or(e){return e.usage(`$0 magic-transit pcaps ownership get
|
|
282
278
|
|
|
283
|
-
|
|
279
|
+
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 kr={command:`get`,describe:`List PCAPs Bucket Ownership`,builder:Or,handler:async r=>c({command:`magic-transit pcaps ownership get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps ownership get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.pcaps.ownership.get({account_id:l})),{successLabel:`Loaded`})})};function Ar(e){return e.usage(`$0 magic-transit pcaps ownership validate
|
|
284
280
|
|
|
285
|
-
|
|
286
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.pcaps.stop({account_id:l,pcap_id:r[`pcap-id`]})),{successLabel:`Deleted`})})},Lr={command:`pcaps`,describe:`Packet capture requests for debugging traffic flowing through Magic Transit tunnels`,builder:e=>e.command(vr).command(Cr).command(Tr).command(Ir).command(xr).command(Pr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Rr(e){return e.usage(`$0 magic-transit redundancy-groups create
|
|
281
|
+
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 jr={command:`validate`,describe:`Validate buckets for full packet captures`,builder:Ar,handler:async r=>c({command:`magic-transit pcaps ownership validate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/ownership/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({destination_conf:p(r[`destination-conf`],`destination-conf`,`text`),ownership_challenge:p(r[`ownership-challenge`],`ownership-challenge`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.validate({...e,account_id:l})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await m(`destination-conf`,"The full URI for the bucket. This field only applies to `full` packet captures.")),r[`ownership-challenge`]===void 0&&(r[`ownership-challenge`]=await m(`ownership-challenge`,`The ownership challenge filename stored in the bucket.`));let d=f({destination_conf:p(r[`destination-conf`],`destination-conf`,`text`),ownership_challenge:p(r[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.validate({...d,account_id:l})),{successLabel:`Created`})})},Mr={command:`ownership`,describe:`Operations for pcaps.ownership`,builder:e=>e.command(Tr).command(Dr).command(kr).command(jr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nr(e){return e.usage(`$0 magic-transit pcaps stop <pcap-id>
|
|
287
282
|
|
|
288
|
-
|
|
283
|
+
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 Pr={command:`stop <pcap-id>`,describe:`Stop full PCAP`,builder:Nr,handler:async r=>c({command:`magic-transit pcaps stop`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit pcaps stop`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/pcaps/${r[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(r[`pcap-id`]))}/stop`,pathParams:{"pcap-id":String(r[`pcap-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force,message:`This operation halts an in-progress full packet capture. Any unsaved capture data will be lost.`})){process.stderr.write(`Aborted.
|
|
284
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.pcaps.stop({account_id:l,pcap_id:r[`pcap-id`]})),{successLabel:`Deleted`})})},Fr={command:`pcaps`,describe:`Packet capture requests for debugging traffic flowing through Magic Transit tunnels`,builder:e=>e.command(gr).command(xr).command(Cr).command(Pr).command(yr).command(Mr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ir(e){return e.usage(`$0 magic-transit redundancy-groups create
|
|
289
285
|
|
|
290
|
-
|
|
291
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.redundancyGroups.delete({account_id:l,redundancy_group_id:r[`redundancy-group-id`]})),{successLabel:`Deleted`})})};function Hr(e){return e.usage(`$0 magic-transit redundancy-groups get <redundancy-group-id>
|
|
286
|
+
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 Lr={command:`create`,describe:`Create a Redundancy Group`,builder:Ir,handler:async r=>c({command:`magic-transit redundancy-groups create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit redundancy-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),members:d(r.members,`members`),name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.redundancyGroups.create({body:e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await m(`name`,`Human-readable name for the redundancy group`));let h=f({description:p(r.description,`description`,`text`),members:d(r.members,`members`),name:p(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.redundancyGroups.create({body:h,account_id:l})),{successLabel:`Created`})})};function Rr(e){return e.usage(`$0 magic-transit redundancy-groups delete <redundancy-group-id>
|
|
292
287
|
|
|
293
|
-
|
|
288
|
+
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 zr={command:`delete <redundancy-group-id>`,describe:`Delete a Redundancy Group`,builder:Rr,handler:async r=>c({command:`magic-transit redundancy-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit redundancy-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/redundancy_groups/${r[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(r[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(r[`redundancy-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
289
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.redundancyGroups.delete({account_id:l,redundancy_group_id:r[`redundancy-group-id`]})),{successLabel:`Deleted`})})};function Br(e){return e.usage(`$0 magic-transit redundancy-groups get <redundancy-group-id>
|
|
294
290
|
|
|
295
|
-
|
|
291
|
+
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 Vr={command:`get <redundancy-group-id>`,describe:`Get Redundancy Group Details`,builder:Br,handler:async r=>c({command:`magic-transit redundancy-groups get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit redundancy-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/redundancy_groups/${r[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(r[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(r[`redundancy-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.redundancyGroups.get({account_id:l,redundancy_group_id:r[`redundancy-group-id`]})),{successLabel:`Loaded`})})};function Hr(e){return e.usage(`$0 magic-transit redundancy-groups list
|
|
296
292
|
|
|
297
|
-
|
|
293
|
+
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 Ur={command:`list`,describe:`List Redundancy Groups`,builder:Hr,handler:async r=>c({command:`magic-transit redundancy-groups list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit redundancy-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.redundancyGroups.list({account_id:l})),{successLabel:`Loaded`})})};function Wr(e){return e.usage(`$0 magic-transit redundancy-groups update <redundancy-group-id>
|
|
298
294
|
|
|
299
|
-
|
|
295
|
+
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 Gr={command:`update <redundancy-group-id>`,describe:`Update a Redundancy Group`,builder:Wr,handler:async r=>c({command:`magic-transit redundancy-groups update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit redundancy-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/redundancy_groups/${r[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(r[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(r[`redundancy-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),members:d(r.members,`members`),name:p(r.name,`name`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.redundancyGroups.update({body:e,account_id:l,redundancy_group_id:r[`redundancy-group-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await m(`name`,`Human-readable name for the redundancy group`));let h=f({description:p(r.description,`description`,`text`),members:d(r.members,`members`),name:p(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.redundancyGroups.update({body:h,account_id:l,redundancy_group_id:r[`redundancy-group-id`]})),{successLabel:`Updated`})})},Kr={command:`redundancy-groups`,describe:`Operations for redundancy-groups`,builder:e=>e.command(Lr).command(zr).command(Vr).command(Ur).command(Gr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qr(e){return e.usage(`$0 magic-transit routes bulk-update
|
|
300
296
|
|
|
301
|
-
|
|
297
|
+
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 Jr={command:`bulk-update`,describe:`Update Many Routes`,builder:qr,handler:async r=>c({command:`magic-transit routes bulk-update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({routes:d(r.routes,`routes`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.routes.bulkUpdate({...e,account_id:l})),{successLabel:`Updated`});return}if(r.routes===void 0)throw Error(`--routes is required (or pass --body with this field set).`);let p=f({routes:d(r.routes,`routes`)});a(await s(`Updating`,async()=>c.magicTransit.routes.bulkUpdate({...p,account_id:l})),{successLabel:`Updated`})})};function Yr(e){return e.usage(`$0 magic-transit routes create
|
|
302
298
|
|
|
303
|
-
|
|
304
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.routes.delete({account_id:l,route_id:r[`route-id`]})),{successLabel:`Deleted`})})};function ti(e){return e.usage(`$0 magic-transit routes empty
|
|
299
|
+
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 Xr={command:`create`,describe:`Create a Route`,builder:Yr,handler:async r=>c({command:`magic-transit routes create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),nexthop:p(r.nexthop,`nexthop`,`text`),prefix:p(r.prefix,`prefix`,`text`),priority:r.priority,scope:{colo_names:r[`scope-colo-names`],colo_regions:r[`scope-colo-regions`]},weight:r.weight}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.routes.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.nexthop===void 0&&(r.nexthop=await m(`nexthop`,`The next-hop IP Address for the static route.`)),r.prefix===void 0&&(r.prefix=await m(`prefix`,`IP Prefix in Classless Inter-Domain Routing format.`)),r.priority===void 0)throw Error(`--priority is required (or pass --body with this field set).`);let d=f({description:p(r.description,`description`,`text`),nexthop:p(r.nexthop,`nexthop`,`text`),prefix:p(r.prefix,`prefix`,`text`),priority:r.priority,scope:{colo_names:r[`scope-colo-names`],colo_regions:r[`scope-colo-regions`]},weight:r.weight});a(await s(`Creating`,async()=>c.magicTransit.routes.create({...d,account_id:l})),{successLabel:`Created`})})};function Zr(e){return e.usage(`$0 magic-transit routes delete <route-id>
|
|
305
300
|
|
|
306
|
-
|
|
307
|
-
`);return}
|
|
301
|
+
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 Qr={command:`delete <route-id>`,describe:`Delete Route`,builder:Zr,handler:async r=>c({command:`magic-transit routes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes/${r[`route-id`]==null?`<route-id>`:encodeURIComponent(String(r[`route-id`]))}`,pathParams:{"route-id":String(r[`route-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
302
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.routes.delete({account_id:l,route_id:r[`route-id`]})),{successLabel:`Deleted`})})};function $r(e){return e.usage(`$0 magic-transit routes empty
|
|
308
303
|
|
|
309
|
-
|
|
304
|
+
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 ei={command:`empty`,describe:`Delete Many Routes`,builder:$r,handler:async r=>c({command:`magic-transit routes empty`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes empty`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({routes:d(r.routes,`routes`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
305
|
+
`);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.magicTransit.routes.empty({...e,account_id:l})),{successLabel:`Deleted`});return}if(r.routes===void 0)throw Error(`--routes is required (or pass --body with this field set).`);let p=f({routes:d(r.routes,`routes`)});a(await s(`Deleting`,async()=>c.magicTransit.routes.empty({...p,account_id:l})),{successLabel:`Deleted`})})};function ti(e){return e.usage(`$0 magic-transit routes get <route-id>
|
|
310
306
|
|
|
311
|
-
|
|
307
|
+
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 ni={command:`get <route-id>`,describe:`Route Details`,builder:ti,handler:async r=>c({command:`magic-transit routes get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes/${r[`route-id`]==null?`<route-id>`:encodeURIComponent(String(r[`route-id`]))}`,pathParams:{"route-id":String(r[`route-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.routes.get({account_id:l,route_id:r[`route-id`]})),{successLabel:`Loaded`})})};function ri(e){return e.usage(`$0 magic-transit routes list
|
|
312
308
|
|
|
313
|
-
|
|
309
|
+
List all Magic static routes.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ii={command:`list`,describe:`List Routes`,builder:ri,handler:async r=>c({command:`magic-transit routes list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.routes.list({account_id:l})),{successLabel:`Loaded`})})};function ai(e){return e.usage(`$0 magic-transit routes update <route-id>
|
|
314
310
|
|
|
315
|
-
|
|
311
|
+
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 oi={command:`update <route-id>`,describe:`Update Route`,builder:ai,handler:async r=>c({command:`magic-transit routes update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit routes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/routes/${r[`route-id`]==null?`<route-id>`:encodeURIComponent(String(r[`route-id`]))}`,pathParams:{"route-id":String(r[`route-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),nexthop:p(r.nexthop,`nexthop`,`text`),prefix:p(r.prefix,`prefix`,`text`),priority:r.priority,scope:{colo_names:r[`scope-colo-names`],colo_regions:r[`scope-colo-regions`]},weight:r.weight}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.routes.update({body:e,account_id:l,route_id:r[`route-id`]})),{successLabel:`Updated`});return}if(r.nexthop===void 0&&(r.nexthop=await m(`nexthop`,`The next-hop IP Address for the static route.`)),r.prefix===void 0&&(r.prefix=await m(`prefix`,`IP Prefix in Classless Inter-Domain Routing format.`)),r.priority===void 0)throw Error(`--priority is required (or pass --body with this field set).`);let d=f({description:p(r.description,`description`,`text`),nexthop:p(r.nexthop,`nexthop`,`text`),prefix:p(r.prefix,`prefix`,`text`),priority:r.priority,scope:{colo_names:r[`scope-colo-names`],colo_regions:r[`scope-colo-regions`]},weight:r.weight});a(await s(`Updating`,async()=>c.magicTransit.routes.update({body:d,account_id:l,route_id:r[`route-id`]})),{successLabel:`Updated`})})},si={command:`routes`,describe:`Static routes that direct IP prefix traffic through specific GRE/IPsec tunnels`,builder:e=>e.command(Jr).command(Xr).command(Qr).command(ei).command(ni).command(ii).command(oi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ci(e){return e.usage(`$0 magic-transit sites acls create <site-id>
|
|
316
312
|
|
|
317
|
-
|
|
318
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.acls.delete({account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Deleted`})})};function mi(e){return e.usage(`$0 magic-transit sites acls edit <acl-id>
|
|
313
|
+
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 li={command:`create <site-id>`,describe:`Create a new Site ACL`,builder:ci,handler:async r=>c({command:`magic-transit sites acls create`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/acls`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),forward_locally:r[`forward-locally`],lan_1:{lan_id:p(r[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(r[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:r[`lan-1-port-ranges`],ports:r[`lan-1-ports`]},lan_2:{lan_id:p(r[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(r[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:r[`lan-2-port-ranges`],ports:r[`lan-2-ports`]},name:p(r.name,`name`,`text`),protocols:r.protocols,unidirectional:r.unidirectional}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.sites.acls.create({...e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`});return}r[`lan-1-lan-id`]===void 0&&(r[`lan-1-lan-id`]=await m(`lan-1-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),r[`lan-2-lan-id`]===void 0&&(r[`lan-2-lan-id`]=await m(`lan-2-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),r.name===void 0&&(r.name=await m(`name`,`The name of the ACL.`));let d=f({description:p(r.description,`description`,`text`),forward_locally:r[`forward-locally`],lan_1:{lan_id:p(r[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(r[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:r[`lan-1-port-ranges`],ports:r[`lan-1-ports`]},lan_2:{lan_id:p(r[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(r[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:r[`lan-2-port-ranges`],ports:r[`lan-2-ports`]},name:p(r.name,`name`,`text`),protocols:r.protocols,unidirectional:r.unidirectional});a(await s(`Creating`,async()=>c.magicTransit.sites.acls.create({...d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`})})};function ui(e){return e.usage(`$0 magic-transit sites acls delete <acl-id>
|
|
319
314
|
|
|
320
|
-
|
|
315
|
+
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 di={command:`delete <acl-id>`,describe:`Delete Site ACL`,builder:ui,handler:async r=>c({command:`magic-transit sites acls delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"acl-id":String(r[`acl-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
316
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.acls.delete({account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Deleted`})})};function fi(e){return e.usage(`$0 magic-transit sites acls edit <acl-id>
|
|
321
317
|
|
|
322
|
-
|
|
318
|
+
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 pi={command:`edit <acl-id>`,describe:`Patch Site ACL`,builder:fi,handler:async r=>c({command:`magic-transit sites acls edit`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites acls edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"acl-id":String(r[`acl-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),forward_locally:r[`forward-locally`],lan_1:{lan_id:p(r[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(r[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:r[`lan-1-port-ranges`],ports:r[`lan-1-ports`]},lan_2:{lan_id:p(r[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(r[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:r[`lan-2-port-ranges`],ports:r[`lan-2-ports`]},name:p(r.name,`name`,`text`),protocols:r.protocols,unidirectional:r.unidirectional}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.acls.edit({body:e,account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Updated`});return}let d=f({description:p(r.description,`description`,`text`),forward_locally:r[`forward-locally`],lan_1:{lan_id:p(r[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(r[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:r[`lan-1-port-ranges`],ports:r[`lan-1-ports`]},lan_2:{lan_id:p(r[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(r[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:r[`lan-2-port-ranges`],ports:r[`lan-2-ports`]},name:p(r.name,`name`,`text`),protocols:r.protocols,unidirectional:r.unidirectional});a(await s(`Updating`,async()=>c.magicTransit.sites.acls.edit({body:d,account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Updated`})})};function mi(e){return e.usage(`$0 magic-transit sites acls get <acl-id>
|
|
323
319
|
|
|
324
|
-
|
|
320
|
+
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 hi={command:`get <acl-id>`,describe:`Site ACL Details`,builder:mi,handler:async r=>c({command:`magic-transit sites acls get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"acl-id":String(r[`acl-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.acls.get({account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Loaded`})})};function gi(e){return e.usage(`$0 magic-transit sites acls list
|
|
325
321
|
|
|
326
|
-
|
|
322
|
+
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 _i={command:`list`,describe:`List Site ACLs`,builder:gi,handler:async r=>c({command:`magic-transit sites acls list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/acls`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.acls.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function vi(e){return e.usage(`$0 magic-transit sites acls update <acl-id>
|
|
327
323
|
|
|
328
|
-
|
|
324
|
+
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 yi={command:`update <acl-id>`,describe:`Update Site ACL`,builder:vi,handler:async r=>c({command:`magic-transit sites acls update`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/acls/${r[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(r[`acl-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"acl-id":String(r[`acl-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({description:p(r.description,`description`,`text`),forward_locally:r[`forward-locally`],lan_1:{lan_id:p(r[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(r[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:r[`lan-1-port-ranges`],ports:r[`lan-1-ports`]},lan_2:{lan_id:p(r[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(r[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:r[`lan-2-port-ranges`],ports:r[`lan-2-ports`]},name:p(r.name,`name`,`text`),protocols:r.protocols,unidirectional:r.unidirectional}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.acls.update({body:e,account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Updated`});return}let d=f({description:p(r.description,`description`,`text`),forward_locally:r[`forward-locally`],lan_1:{lan_id:p(r[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(r[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:r[`lan-1-port-ranges`],ports:r[`lan-1-ports`]},lan_2:{lan_id:p(r[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(r[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:r[`lan-2-port-ranges`],ports:r[`lan-2-ports`]},name:p(r.name,`name`,`text`),protocols:r.protocols,unidirectional:r.unidirectional});a(await s(`Updating`,async()=>c.magicTransit.sites.acls.update({body:d,account_id:l,site_id:r[`site-id`],acl_id:r[`acl-id`]})),{successLabel:`Updated`})})},bi={command:`acls`,describe:`Operations for sites.acls`,builder:e=>e.command(li).command(di).command(pi).command(hi).command(_i).command(yi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xi(e){return e.usage(`$0 magic-transit sites app-configuration create <site-id>
|
|
329
325
|
|
|
330
|
-
|
|
331
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.appConfiguration.delete({account_id:l,site_id:r[`site-id`],app_config_id:r[`app-config-id`]})),{successLabel:`Deleted`})})};function Di(e){return e.usage(`$0 magic-transit sites app-configuration edit <app-config-id>
|
|
326
|
+
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 Si={command:`create <site-id>`,describe:`Create a new App Config`,builder:xi,handler:async r=>c({command:`magic-transit sites app-configuration create`,classification:{safeFlags:[`breakout`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites app-configuration create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/app_configs`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({breakout:r.breakout,preferred_wans:r[`preferred-wans`],priority:r.priority}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.sites.appConfiguration.create({...e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`});return}let d=f({breakout:r.breakout,preferred_wans:r[`preferred-wans`],priority:r.priority});a(await s(`Creating`,async()=>c.magicTransit.sites.appConfiguration.create({...d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`})})};function Ci(e){return e.usage(`$0 magic-transit sites app-configuration delete <app-config-id>
|
|
332
327
|
|
|
333
|
-
|
|
328
|
+
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 wi={command:`delete <app-config-id>`,describe:`Delete App Config`,builder:Ci,handler:async r=>c({command:`magic-transit sites app-configuration delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites app-configuration delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/app_configs/${r[`app-config-id`]==null?`<app-config-id>`:encodeURIComponent(String(r[`app-config-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"app-config-id":String(r[`app-config-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
329
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.appConfiguration.delete({account_id:l,site_id:r[`site-id`],app_config_id:r[`app-config-id`]})),{successLabel:`Deleted`})})};function Ti(e){return e.usage(`$0 magic-transit sites app-configuration list
|
|
334
330
|
|
|
335
|
-
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
|
|
331
|
+
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 Ei={command:`list`,describe:`List App Configs`,builder:Ti,handler:async r=>c({command:`magic-transit sites app-configuration list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites app-configuration list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/app_configs`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.appConfiguration.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function Di(e){return e.usage(`$0 magic-transit sites app-configuration update <app-config-id>
|
|
336
332
|
|
|
337
|
-
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
|
|
333
|
+
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 Oi={command:`update <app-config-id>`,describe:`Update an App Config`,builder:Di,handler:async r=>c({command:`magic-transit sites app-configuration update`,classification:{safeFlags:[`breakout`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites app-configuration update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/app_configs/${r[`app-config-id`]==null?`<app-config-id>`:encodeURIComponent(String(r[`app-config-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"app-config-id":String(r[`app-config-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({account_app_id:p(r[`account-app-id`],`account-app-id`,`text`),breakout:r.breakout,managed_app_id:p(r[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:r[`preferred-wans`],priority:r.priority}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.appConfiguration.update({...e,account_id:l,site_id:r[`site-id`],app_config_id:r[`app-config-id`]})),{successLabel:`Updated`});return}let d=f({account_app_id:p(r[`account-app-id`],`account-app-id`,`text`),breakout:r.breakout,managed_app_id:p(r[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:r[`preferred-wans`],priority:r.priority});a(await s(`Updating`,async()=>c.magicTransit.sites.appConfiguration.update({...d,account_id:l,site_id:r[`site-id`],app_config_id:r[`app-config-id`]})),{successLabel:`Updated`})})},ki={command:`app-configuration`,describe:`Operations for sites.app-configuration`,builder:e=>e.command(Si).command(wi).command(Ei).command(Oi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ai(e){return e.usage(`$0 magic-transit sites create
|
|
338
334
|
|
|
339
|
-
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
|
|
335
|
+
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 ji={command:`create`,describe:`Create a new Site`,builder:Ai,handler:async r=>c({command:`magic-transit sites create`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({connector_id:p(r[`connector-id`],`connector-id`,`text`),description:p(r.description,`description`,`text`),ha_mode:r[`ha-mode`],location:{lat:p(r[`location-lat`],`location-lat`,`text`),lon:p(r[`location-lon`],`location-lon`,`text`)},name:p(r.name,`name`,`text`),secondary_connector_id:p(r[`secondary-connector-id`],`secondary-connector-id`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.sites.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await m(`name`,`The name of the site.`));let d=f({connector_id:p(r[`connector-id`],`connector-id`,`text`),description:p(r.description,`description`,`text`),ha_mode:r[`ha-mode`],location:{lat:p(r[`location-lat`],`location-lat`,`text`),lon:p(r[`location-lon`],`location-lon`,`text`)},name:p(r.name,`name`,`text`),secondary_connector_id:p(r[`secondary-connector-id`],`secondary-connector-id`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.sites.create({...d,account_id:l})),{successLabel:`Created`})})};function Mi(e){return e.usage(`$0 magic-transit sites delete <site-id>
|
|
340
336
|
|
|
341
|
-
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
|
|
342
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.delete({account_id:l,site_id:r[`site-id`]})),{successLabel:`Deleted`})})};function
|
|
337
|
+
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 Ni={command:`delete <site-id>`,describe:`Delete Site`,builder:Mi,handler:async r=>c({command:`magic-transit sites delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
338
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.delete({account_id:l,site_id:r[`site-id`]})),{successLabel:`Deleted`})})};function Pi(e){return e.usage(`$0 magic-transit sites edit <site-id>
|
|
343
339
|
|
|
344
|
-
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(`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
|
|
340
|
+
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 Fi={command:`edit <site-id>`,describe:`Patch Site`,builder:Pi,handler:async r=>c({command:`magic-transit sites edit`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({connector_id:p(r[`connector-id`],`connector-id`,`text`),description:p(r.description,`description`,`text`),ha_mode:r[`ha-mode`],location:{lat:p(r[`location-lat`],`location-lat`,`text`),lon:p(r[`location-lon`],`location-lon`,`text`)},name:p(r.name,`name`,`text`),secondary_connector_id:p(r[`secondary-connector-id`],`secondary-connector-id`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.edit({body:e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`});return}let d=f({connector_id:p(r[`connector-id`],`connector-id`,`text`),description:p(r.description,`description`,`text`),ha_mode:r[`ha-mode`],location:{lat:p(r[`location-lat`],`location-lat`,`text`),lon:p(r[`location-lon`],`location-lon`,`text`)},name:p(r.name,`name`,`text`),secondary_connector_id:p(r[`secondary-connector-id`],`secondary-connector-id`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.sites.edit({body:d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`})})};function Ii(e){return e.usage(`$0 magic-transit sites get <site-id>
|
|
345
341
|
|
|
346
|
-
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
|
|
342
|
+
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 Li={command:`get <site-id>`,describe:`Site Details`,builder:Ii,handler:async l=>c({command:`magic-transit sites get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){o({command:`cf magic-transit sites get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${l[`site-id`]==null?`<site-id>`:encodeURIComponent(String(l[`site-id`]))}`,pathParams:{"site-id":String(l[`site-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/magic/sites/${encodeURIComponent(String(l[`site-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function Ri(e){return e.usage(`$0 magic-transit sites lans create <site-id>
|
|
347
343
|
|
|
348
|
-
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-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-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
|
|
344
|
+
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-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-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 zi={command:`create <site-id>`,describe:`Create a new Site LAN`,builder:Ri,handler:async r=>c({command:`magic-transit sites lans create`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites lans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/lans`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({bond_id:r[`bond-id`],ha_link:r[`ha-link`],is_breakout:r[`is-breakout`],is_prioritized:r[`is-prioritized`],name:p(r.name,`name`,`text`),nat:{static_prefix:p(r[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:r.physport,routed_subnets:d(r[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:r[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(r[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(r[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_servers:r[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(r[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:r[`vlan-tag`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.sites.lans.create({...e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`});return}let m=f({bond_id:r[`bond-id`],ha_link:r[`ha-link`],is_breakout:r[`is-breakout`],is_prioritized:r[`is-prioritized`],name:p(r.name,`name`,`text`),nat:{static_prefix:p(r[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:r.physport,routed_subnets:d(r[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:r[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(r[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(r[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_servers:r[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(r[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:r[`vlan-tag`]});a(await s(`Creating`,async()=>c.magicTransit.sites.lans.create({...m,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`})})};function Bi(e){return e.usage(`$0 magic-transit sites lans delete <lan-id>
|
|
349
345
|
|
|
350
|
-
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
|
|
351
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.lans.delete({account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Deleted`})})};function
|
|
346
|
+
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 Vi={command:`delete <lan-id>`,describe:`Delete Site LAN`,builder:Bi,handler:async r=>c({command:`magic-transit sites lans delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites lans delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/lans/${r[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(r[`lan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"lan-id":String(r[`lan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
347
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.lans.delete({account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Deleted`})})};function Hi(e){return e.usage(`$0 magic-transit sites lans edit <lan-id>
|
|
352
348
|
|
|
353
|
-
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(`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-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-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
|
|
349
|
+
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-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-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 Ui={command:`edit <lan-id>`,describe:`Patch Site LAN`,builder:Hi,handler:async r=>c({command:`magic-transit sites lans edit`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites lans edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/lans/${r[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(r[`lan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"lan-id":String(r[`lan-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({bond_id:r[`bond-id`],ha_link:r[`ha-link`],is_breakout:r[`is-breakout`],is_prioritized:r[`is-prioritized`],name:p(r.name,`name`,`text`),nat:{static_prefix:p(r[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:r.physport,routed_subnets:d(r[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:r[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(r[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(r[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_servers:r[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(r[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:r[`vlan-tag`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.lans.edit({body:e,account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Updated`});return}let m=f({bond_id:r[`bond-id`],ha_link:r[`ha-link`],is_breakout:r[`is-breakout`],is_prioritized:r[`is-prioritized`],name:p(r.name,`name`,`text`),nat:{static_prefix:p(r[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:r.physport,routed_subnets:d(r[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:r[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(r[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(r[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_servers:r[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(r[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:r[`vlan-tag`]});a(await s(`Updating`,async()=>c.magicTransit.sites.lans.edit({body:m,account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Updated`})})};function Wi(e){return e.usage(`$0 magic-transit sites lans get <lan-id>
|
|
354
350
|
|
|
355
|
-
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
|
|
351
|
+
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 Gi={command:`get <lan-id>`,describe:`Site LAN Details`,builder:Wi,handler:async r=>c({command:`magic-transit sites lans get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites lans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/lans/${r[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(r[`lan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"lan-id":String(r[`lan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.lans.get({account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Loaded`})})};function Ki(e){return e.usage(`$0 magic-transit sites lans list
|
|
356
352
|
|
|
357
|
-
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
|
|
353
|
+
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 qi={command:`list`,describe:`List Site LANs`,builder:Ki,handler:async r=>c({command:`magic-transit sites lans list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites lans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/lans`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.lans.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function Ji(e){return e.usage(`$0 magic-transit sites lans update <lan-id>
|
|
358
354
|
|
|
359
|
-
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(`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-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-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
|
|
355
|
+
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-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-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 Yi={command:`update <lan-id>`,describe:`Update Site LAN`,builder:Ji,handler:async r=>c({command:`magic-transit sites lans update`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites lans update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/lans/${r[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(r[`lan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"lan-id":String(r[`lan-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({bond_id:r[`bond-id`],ha_link:r[`ha-link`],is_breakout:r[`is-breakout`],is_prioritized:r[`is-prioritized`],name:p(r.name,`name`,`text`),nat:{static_prefix:p(r[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:r.physport,routed_subnets:d(r[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:r[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(r[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(r[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_servers:r[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(r[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:r[`vlan-tag`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.lans.update({body:e,account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Updated`});return}let m=f({bond_id:r[`bond-id`],ha_link:r[`ha-link`],is_breakout:r[`is-breakout`],is_prioritized:r[`is-prioritized`],name:p(r.name,`name`,`text`),nat:{static_prefix:p(r[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:r.physport,routed_subnets:d(r[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:r[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(r[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(r[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_servers:r[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(r[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:r[`vlan-tag`]});a(await s(`Updating`,async()=>c.magicTransit.sites.lans.update({body:m,account_id:l,site_id:r[`site-id`],lan_id:r[`lan-id`]})),{successLabel:`Updated`})})},Xi={command:`lans`,describe:`Operations for sites.lans`,builder:e=>e.command(zi).command(Vi).command(Ui).command(Gi).command(qi).command(Yi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zi(e){return e.usage(`$0 magic-transit sites list
|
|
360
356
|
|
|
361
|
-
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
|
|
357
|
+
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 Qi={command:`list`,describe:`List Sites`,builder:Zi,handler:async r=>c({command:`magic-transit sites list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={connectorid:r.connectorid};if(r.dryRun){o({command:`cf magic-transit sites list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.sites.list({account_id:u,...c})),{successLabel:`Loaded`})})};function $i(e){return e.usage(`$0 magic-transit sites netflow-config create <site-id>
|
|
362
358
|
|
|
363
|
-
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
|
|
359
|
+
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 ea={command:`create <site-id>`,describe:`Create NetFlow Configuration`,builder:$i,handler:async r=>c({command:`magic-transit sites netflow-config create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites netflow-config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({active_timeout:r[`active-timeout`],collector_ip:p(r[`collector-ip`],`collector-ip`,`text`),collector_port:r[`collector-port`],inactive_timeout:r[`inactive-timeout`],sampling_rate:r[`sampling-rate`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.sites.netflowConfig.create({body:e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`});return}let d=f({active_timeout:r[`active-timeout`],collector_ip:p(r[`collector-ip`],`collector-ip`,`text`),collector_port:r[`collector-port`],inactive_timeout:r[`inactive-timeout`],sampling_rate:r[`sampling-rate`]});a(await s(`Creating`,async()=>c.magicTransit.sites.netflowConfig.create({body:d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`})})};function ta(e){return e.usage(`$0 magic-transit sites netflow-config delete <site-id>
|
|
364
360
|
|
|
365
|
-
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
|
|
366
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.netflowConfig.delete({account_id:l,site_id:r[`site-id`]})),{successLabel:`Deleted`})})};function
|
|
361
|
+
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 na={command:`delete <site-id>`,describe:`Delete NetFlow Configuration`,builder:ta,handler:async r=>c({command:`magic-transit sites netflow-config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites netflow-config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
362
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.netflowConfig.delete({account_id:l,site_id:r[`site-id`]})),{successLabel:`Deleted`})})};function ra(e){return e.usage(`$0 magic-transit sites netflow-config edit <site-id>
|
|
367
363
|
|
|
368
|
-
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
|
|
364
|
+
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 ia={command:`edit <site-id>`,describe:`Update NetFlow Configuration`,builder:ra,handler:async r=>c({command:`magic-transit sites netflow-config edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites netflow-config edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({active_timeout:r[`active-timeout`],collector_ip:p(r[`collector-ip`],`collector-ip`,`text`),collector_port:r[`collector-port`],inactive_timeout:r[`inactive-timeout`],sampling_rate:r[`sampling-rate`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.edit({body:e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`});return}let d=f({active_timeout:r[`active-timeout`],collector_ip:p(r[`collector-ip`],`collector-ip`,`text`),collector_port:r[`collector-port`],inactive_timeout:r[`inactive-timeout`],sampling_rate:r[`sampling-rate`]});a(await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.edit({body:d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`})})};function aa(e){return e.usage(`$0 magic-transit sites netflow-config get <site-id>
|
|
369
365
|
|
|
370
|
-
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
|
|
366
|
+
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 oa={command:`get <site-id>`,describe:`NetFlow Configuration Details`,builder:aa,handler:async r=>c({command:`magic-transit sites netflow-config get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites netflow-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.netflowConfig.get({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function sa(e){return e.usage(`$0 magic-transit sites netflow-config update <site-id>
|
|
371
367
|
|
|
372
|
-
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
|
|
368
|
+
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 ca={command:`update <site-id>`,describe:`Update NetFlow Configuration`,builder:sa,handler:async r=>c({command:`magic-transit sites netflow-config update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites netflow-config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({active_timeout:r[`active-timeout`],collector_ip:p(r[`collector-ip`],`collector-ip`,`text`),collector_port:r[`collector-port`],inactive_timeout:r[`inactive-timeout`],sampling_rate:r[`sampling-rate`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.update({body:e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`});return}let d=f({active_timeout:r[`active-timeout`],collector_ip:p(r[`collector-ip`],`collector-ip`,`text`),collector_port:r[`collector-port`],inactive_timeout:r[`inactive-timeout`],sampling_rate:r[`sampling-rate`]});a(await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.update({body:d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`})})},la={command:`netflow-config`,describe:`Operations for sites.netflow-config`,builder:e=>e.command(ea).command(na).command(ia).command(oa).command(ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ua(e){return e.usage(`$0 magic-transit sites update <site-id>
|
|
373
369
|
|
|
374
|
-
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(`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
|
|
370
|
+
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 da={command:`update <site-id>`,describe:`Update Site`,builder:ua,handler:async r=>c({command:`magic-transit sites update`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({connector_id:p(r[`connector-id`],`connector-id`,`text`),description:p(r.description,`description`,`text`),ha_mode:r[`ha-mode`],location:{lat:p(r[`location-lat`],`location-lat`,`text`),lon:p(r[`location-lon`],`location-lon`,`text`)},name:p(r.name,`name`,`text`),secondary_connector_id:p(r[`secondary-connector-id`],`secondary-connector-id`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.update({body:e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`});return}let d=f({connector_id:p(r[`connector-id`],`connector-id`,`text`),description:p(r.description,`description`,`text`),ha_mode:r[`ha-mode`],location:{lat:p(r[`location-lat`],`location-lat`,`text`),lon:p(r[`location-lon`],`location-lon`,`text`)},name:p(r.name,`name`,`text`),secondary_connector_id:p(r[`secondary-connector-id`],`secondary-connector-id`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.sites.update({body:d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Updated`})})};function fa(e){return e.usage(`$0 magic-transit sites wans create <site-id>
|
|
375
371
|
|
|
376
|
-
Creates a new Site WAN.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const
|
|
372
|
+
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`}).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`,default:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const pa={command:`create <site-id>`,describe:`Create a new Site WAN`,builder:fa,handler:async r=>c({command:`magic-transit sites wans create`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites wans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/wans`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({health_check_rate:p(r[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:r[`load-balance-inner-flows`],name:p(r.name,`name`,`text`),physport:r.physport,priority:r.priority,static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(r[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:r[`vlan-tag`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.sites.wans.create({...e,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`});return}if(r.physport===void 0)throw Error(`--physport is required (or pass --body with this field set).`);let d=f({health_check_rate:p(r[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:r[`load-balance-inner-flows`],name:p(r.name,`name`,`text`),physport:r.physport,priority:r.priority,static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(r[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:r[`vlan-tag`]});a(await s(`Creating`,async()=>c.magicTransit.sites.wans.create({...d,account_id:l,site_id:r[`site-id`]})),{successLabel:`Created`})})};function ma(e){return e.usage(`$0 magic-transit sites wans delete <wan-id>
|
|
377
373
|
|
|
378
|
-
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
|
|
379
|
-
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.wans.delete({account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Deleted`})})};function
|
|
374
|
+
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 ha={command:`delete <wan-id>`,describe:`Delete Site WAN`,builder:ma,handler:async r=>c({command:`magic-transit sites wans delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites wans delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/wans/${r[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(r[`wan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"wan-id":String(r[`wan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
375
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.wans.delete({account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Deleted`})})};function ga(e){return e.usage(`$0 magic-transit sites wans edit <wan-id>
|
|
380
376
|
|
|
381
|
-
Patch a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const
|
|
377
|
+
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`]}).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const _a={command:`edit <wan-id>`,describe:`Patch Site WAN`,builder:ga,handler:async r=>c({command:`magic-transit sites wans edit`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites wans edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/wans/${r[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(r[`wan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"wan-id":String(r[`wan-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({health_check_rate:p(r[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:r[`load-balance-inner-flows`],name:p(r.name,`name`,`text`),physport:r.physport,priority:r.priority,static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(r[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:r[`vlan-tag`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.wans.edit({body:e,account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Updated`});return}let d=f({health_check_rate:p(r[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:r[`load-balance-inner-flows`],name:p(r.name,`name`,`text`),physport:r.physport,priority:r.priority,static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(r[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:r[`vlan-tag`]});a(await s(`Updating`,async()=>c.magicTransit.sites.wans.edit({body:d,account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Updated`})})};function va(e){return e.usage(`$0 magic-transit sites wans get <wan-id>
|
|
382
378
|
|
|
383
|
-
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
|
|
379
|
+
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 ya={command:`get <wan-id>`,describe:`Site WAN Details`,builder:va,handler:async r=>c({command:`magic-transit sites wans get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites wans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/wans/${r[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(r[`wan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"wan-id":String(r[`wan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.wans.get({account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Loaded`})})};function ba(e){return e.usage(`$0 magic-transit sites wans list
|
|
384
380
|
|
|
385
|
-
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
|
|
381
|
+
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 xa={command:`list`,describe:`List Site WANs`,builder:ba,handler:async r=>c({command:`magic-transit sites wans list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites wans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/wans`,pathParams:{"site-id":String(r[`site-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.wans.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function Sa(e){return e.usage(`$0 magic-transit sites wans update <wan-id>
|
|
386
382
|
|
|
387
|
-
Update a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const
|
|
383
|
+
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`]}).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Ca={command:`update <wan-id>`,describe:`Update Site WAN`,builder:Sa,handler:async r=>c({command:`magic-transit sites wans update`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites wans update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/magic/sites/${r[`site-id`]==null?`<site-id>`:encodeURIComponent(String(r[`site-id`]))}/wans/${r[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(r[`wan-id`]))}`,pathParams:{"site-id":String(r[`site-id`]??``),"wan-id":String(r[`wan-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({health_check_rate:p(r[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:r[`load-balance-inner-flows`],name:p(r.name,`name`,`text`),physport:r.physport,priority:r.priority,static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(r[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:r[`vlan-tag`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.wans.update({body:e,account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Updated`});return}let d=f({health_check_rate:p(r[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:r[`load-balance-inner-flows`],name:p(r.name,`name`,`text`),physport:r.physport,priority:r.priority,static_addressing:{address:p(r[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(r[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(r[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:r[`vlan-tag`]});a(await s(`Updating`,async()=>c.magicTransit.sites.wans.update({body:d,account_id:l,site_id:r[`site-id`],wan_id:r[`wan-id`]})),{successLabel:`Updated`})})},wa={command:`wans`,describe:`Operations for sites.wans`,builder:e=>e.command(pa).command(ha).command(_a).command(ya).command(xa).command(Ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ta={command:`sites`,describe:`Magic WAN branch sites — base CRUD, LAN/WAN interface configuration, ACLs, connectors, app configuration, and NetFlow config`,builder:e=>e.command(ji).command(Ni).command(Fi).command(Li).command(Qi).command(da).command(bi).command(ki).command(Xi).command(la).command(wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ea={command:`magic-transit`,describe:`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,builder:e=>e.command(I).command(Rt).command(qt).command(an).command(un).command(yn).command(Rn).command(Zn).command(mr).command(Fr).command(Kr).command(si).command(Ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ea as default};
|