cf 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +55 -55
- package/dist/_meta/commands.json +24282 -24542
- package/dist/_meta/hand-written-commands.json +53 -12
- package/dist/_meta/schemas.json +27680 -28212
- package/dist/abuse-reports-BbaHw4ST.mjs +8 -0
- package/dist/access-D6Xz892p.mjs +11 -0
- package/dist/account-DvxcqeaK.mjs +2 -0
- package/dist/account-tags-CeqfEWpz.mjs +9 -0
- package/dist/accounts-Bx-8BMH9.mjs +30 -0
- package/dist/acm--0opdSGE.mjs +3 -0
- package/dist/addressing-BS1ynzLA.mjs +13 -0
- package/dist/agent-context-BPhyrSns.mjs +8 -0
- package/dist/agent-memory-DczzpEw5.mjs +6 -0
- package/dist/ai-CDdCTcQl.mjs +5 -0
- package/dist/ai-audit-Bx9KMQYh.mjs +2 -0
- package/dist/ai-gateway-BSXJEaYS.mjs +13 -0
- package/dist/ai-search-DRQj1aMu.mjs +7 -0
- package/dist/ai-security-C_Rb0lGT.mjs +4 -0
- package/dist/alerting-BAR9eFs2.mjs +6 -0
- package/dist/analytics-BaUZwNc5.mjs +4 -0
- package/dist/analytics_engine-DkEzlhfT.mjs +2 -0
- package/dist/api-security-jA0lOk6a.mjs +50 -0
- package/dist/argo-Cz4pDagx.mjs +2 -0
- package/dist/artifacts-BcLTGfAv.mjs +5 -0
- package/dist/audit-logs-DbIv4n6u.mjs +2 -0
- package/dist/auth-rW5d3jtr.mjs +5 -0
- package/dist/auth-tvDdC1J-.mjs +8 -0
- package/dist/billing-Md87QjqW.mjs +3 -0
- package/dist/bot-management-VHMo4hpU.mjs +5 -0
- package/dist/botnet-feed-BHqfo3sa.mjs +3 -0
- package/dist/brand-protection-HUeR6Pof.mjs +3 -0
- package/dist/browser-extension-199oZg3X.mjs +3 -0
- package/dist/browser-run-DDasyux-.mjs +4 -0
- package/dist/build-0QlYUfFS.mjs +2 -0
- package/dist/builds-B-lXn6JR.mjs +9 -0
- package/dist/cache-CevKpiTM.mjs +9 -0
- package/dist/certificate-authorities-DAg-aO1B.mjs +2 -0
- package/dist/{cf-yPz_IqW6.mjs → cf-C11NGkjx.mjs} +1 -1
- package/dist/{chunk-LQW53VED-9MACsvSG.mjs → chunk-LQW53VED-CoECHA3R.mjs} +1 -1
- package/dist/{chunk-QBZBEHZB-yeyhVUeD.mjs → chunk-QBZBEHZB-BuiXJn8j.mjs} +1 -1
- package/dist/client-certificates-Bay7oPLE.mjs +3 -0
- package/dist/client-side-security-CbU9xn0k.mjs +37 -0
- package/dist/cloud-connector-AH2ClcSL.mjs +2 -0
- package/dist/cloudforce-one-DwOfS75V.mjs +32 -0
- package/dist/{command-BV87D4tR.mjs → command-CMzMsll4.mjs} +1 -1
- package/dist/{completions-BnD46cXe.mjs → completions-nPO9PdSu.mjs} +1 -1
- package/dist/config-B8lwPpVl.mjs +2 -0
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DcLrqM2V.mjs +2 -0
- package/dist/connector-telemetry-events-PrJWgNs9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +2 -0
- package/dist/connectors-CEAy30E-.mjs +3 -0
- package/dist/containers-BsbDqbSn.mjs +58 -0
- package/dist/content-scan-BdK936iO.mjs +4 -0
- package/dist/cps-oP97-qkm.mjs +2 -0
- package/dist/csamScanner-DUNN4INg.mjs +6 -0
- package/dist/ct-alerting-dV_gsV2w.mjs +3 -0
- package/dist/custom-certificates-DYspvjo4.mjs +5 -0
- package/dist/custom-csrs-DjSWLQRu.mjs +3 -0
- package/dist/custom-hostnames-df1lH6IY.mjs +5 -0
- package/dist/custom-nameservers-CLTbN-9R.mjs +3 -0
- package/dist/custom-pages-DzKnSgL3.mjs +3 -0
- package/dist/d1-JBEqjJoj.mjs +20 -0
- package/dist/data-security-CIktWnXt.mjs +7 -0
- package/dist/dcv-delegation-_r6Vc6VL.mjs +2 -0
- package/dist/{deploy-BUSz35vq.mjs → deploy-QTGENpOM.mjs} +1 -1
- package/dist/{deploy-input-BvD9aRP1.mjs → deploy-input-C7W1Bsji.mjs} +1 -1
- package/dist/{dev-DY_DquQx.mjs → dev-CAubuxCc.mjs} +1 -1
- package/dist/diagnostics-B0DRh714.mjs +3 -0
- package/dist/{dist-DV7LR38l.mjs → dist-12KzRsBM.mjs} +36 -36
- package/dist/{dist-BBx1io2f.mjs → dist-BCVqQpg2.mjs} +1 -1
- package/dist/dist-Cp3uJN1x.mjs +48 -0
- package/dist/dist-DW5BPGFs.mjs +57 -0
- package/dist/{dist-Cb9TJ2VV.mjs → dist-S9K_8gq9.mjs} +1 -1
- package/dist/dls-CFzTHcZM.mjs +3 -0
- package/dist/dns-Dw6u-NV1.mjs +29 -0
- package/dist/dns-firewall-CIPptslp.mjs +57 -0
- package/dist/{dot-prop-6SRZBKHT-wwGHcwAa.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
- package/dist/dry-run-DiVy1lVo.mjs +2 -0
- package/dist/durable-objects-CCkeqqBq.mjs +2 -0
- package/dist/email-auth-kdxO51Oz.mjs +2 -0
- package/dist/email-routing-BLggZdQq.mjs +6 -0
- package/dist/email-security-DjADlgdM.mjs +18 -0
- package/dist/email-sending-Cz7E7GoP.mjs +7 -0
- package/dist/error-sanitization-DfLijlBJ.mjs +2 -0
- package/dist/fieldExtractors-BWaMi6lD.mjs +3 -0
- package/dist/firewall-5t6OBIOl.mjs +8 -0
- package/dist/flagship-CzG_VoNR.mjs +4 -0
- package/dist/fraud-UOg_69Ob.mjs +20 -0
- package/dist/google-tag-gateway-DirkD-Q2.mjs +2 -0
- package/dist/healthchecks-BkHZGTp1.mjs +4 -0
- package/dist/hostnames-EUYOZm21.mjs +3 -0
- package/dist/hyperdrive-ZoLJlJCL.mjs +21 -0
- package/dist/iam-BQ2xSgYN.mjs +6 -0
- package/dist/images-CkEq6ScP.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-DDWEdGyl.mjs +8 -0
- package/dist/interactive-B2E03Fs-.mjs +11 -0
- package/dist/interactive-_B-EqD0Y.mjs +23 -0
- package/dist/ips-54Qmy-Uw.mjs +2 -0
- package/dist/keyless-certificates-CXHLc3Qz.mjs +3 -0
- package/dist/keys-rvI4TC3Z.mjs +2 -0
- package/dist/kv-CAeN1zBy.mjs +5 -0
- package/dist/leaked-credential-checks-CbbwtG-p.mjs +4 -0
- package/dist/lifecycle-XswDq0ZB.mjs +2 -0
- package/dist/load-balancers-BFwdwAIU.mjs +6 -0
- package/dist/{local-DGiIS1uM.mjs → local-C6XsFD_W.mjs} +1 -1
- package/dist/{local-runtime--IQr44qq.mjs → local-runtime-BUGCbx8r.mjs} +1 -1
- package/dist/logexplorer-D8rOPB5I.mjs +17 -0
- package/dist/logo-matches-Y3PxVn7t.mjs +2 -0
- package/dist/logos-BN8SvJhS.mjs +3 -0
- package/dist/logpush-BnLA4WVm.mjs +4 -0
- package/dist/logs-CDo7Y5sA.mjs +3 -0
- package/dist/magic-cloud-networking-wPuLwu-F.mjs +5 -0
- package/dist/magic-network-monitoring-BNERUpxS.mjs +4 -0
- package/dist/magic-transit-6tvVOECW.mjs +111 -0
- package/dist/managed-defense-AYwBOYIH.mjs +2 -0
- package/dist/managed-transforms-HZZNrkC7.mjs +3 -0
- package/dist/matches-Dp91L3dL.mjs +2 -0
- package/dist/mcp-P7pcieiT.mjs +4 -0
- package/dist/mesh-DjFrk6PL.mjs +4 -0
- package/dist/mtls-certificates-DZMoef2H.mjs +3 -0
- package/dist/network-7cd1U6-I.mjs +6 -0
- package/dist/network-interconnects-CQ7cPZjK.mjs +41 -0
- package/dist/oauth-DH3kMXSs.mjs +14 -0
- package/dist/oauth-clients-P9t-eMnx.mjs +4 -0
- package/dist/oauth-scopes-C3r9Qh_y.mjs +2 -0
- package/dist/observability-M1DnLhMR.mjs +10 -0
- package/dist/{open-PBXRGS4R-DIiYQyU9.mjs → open-PBXRGS4R-DARSUDEI.mjs} +1 -1
- package/dist/organization-cUE7GDCt.mjs +45 -0
- package/dist/organizations-C-Hcpd0w.mjs +2 -0
- package/dist/origin-ca-certificates-C8cJMyQH.mjs +3 -0
- package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +2 -0
- package/dist/origin-tls-client-auth-BsjR5EAV.mjs +4 -0
- package/dist/{output-BqDR9h74.mjs → output-COcSQsfn.mjs} +1 -1
- package/dist/page-rules-B-zq1EUb.mjs +27 -0
- package/dist/pages-B6YpkPos.mjs +14 -0
- package/dist/pay-per-crawl-B4wx0lUb.mjs +4 -0
- package/dist/pipelines-BJc_RylD.mjs +6 -0
- package/dist/precursor-CLQu7suY.mjs +4 -0
- package/dist/progress-V6SZV3Ux.mjs +2 -0
- package/dist/prompt-DjRTpML4.mjs +3 -0
- package/dist/queries-DSrrket-.mjs +3 -0
- package/dist/queues-Tf7kPBpn.mjs +7 -0
- package/dist/r2-DmKNnxtC.mjs +25 -0
- package/dist/r2-data-catalog-DBxoifOq.mjs +16 -0
- package/dist/radar-Csk7Ab-b.mjs +2 -0
- package/dist/rate-limits-cdChIg_S.mjs +2 -0
- package/dist/raw-fetch-BVYQR6C5.mjs +2 -0
- package/dist/realtime-CDehZVhV.mjs +20 -0
- package/dist/registrar-sandbox-BxVdfnam.mjs +56 -0
- package/dist/registrar-vflzeNQ9.mjs +43 -0
- package/dist/{registry-5-I2XLwF.mjs → registry-CWUfXloz.mjs} +1 -1
- package/dist/reporting-BaPZ1PHN.mjs +2 -0
- package/dist/request-headers-CC4eHmI2.mjs +3 -0
- package/dist/request-tracers-C_UVBexV.mjs +2 -0
- package/dist/resource-sharing-CoB4S9j1.mjs +6 -0
- package/dist/resource-tagging-CUiUC5g4.mjs +2 -0
- package/dist/rules-4O8076_s.mjs +4 -0
- package/dist/rulesets-C84MxTYo.mjs +5 -0
- package/dist/rum-Bvwkrntx.mjs +4 -0
- package/dist/run-CRfinkSe.mjs +2 -0
- package/dist/schema-C8hU6G9R.mjs +2 -0
- package/dist/{schema-flags-CTfQVGCs.mjs → schema-flags-DC4c6dka.mjs} +1 -1
- package/dist/scim-BvxQmde6.mjs +4 -0
- package/dist/{sdk-ZctLa5jW.mjs → sdk-C12y5qCN.mjs} +2 -2
- package/dist/secrets-store-DOKWiC-j.mjs +7 -0
- package/dist/security-center-Bhy_aC-w.mjs +2 -0
- package/dist/security-txt-L7HJ9tq5.mjs +3 -0
- package/dist/{shared-DlKGNPiT.mjs → shared-YJtB5KZB.mjs} +17 -17
- package/dist/smart-shield-COMXuQ1S.mjs +4 -0
- package/dist/snippets-DffQhlKt.mjs +4 -0
- package/dist/{spawn-C3_tJ3RB.mjs → spawn-C1AISA2V.mjs} +3 -3
- package/dist/spectrum-Cmf7SqQE.mjs +63 -0
- package/dist/speed-m8cdhLFS.mjs +4 -0
- package/dist/src-C8phrg-8.mjs +109 -0
- package/dist/ssl-D4ffsdSw.mjs +15 -0
- package/dist/{startup-profile-Dpxg-MjV.mjs → startup-profile-Dx95Y5cl.mjs} +1 -1
- package/dist/state-CHif8Y5I.mjs +2 -0
- package/dist/stream-DPF5fojV.mjs +16 -0
- package/dist/submit-Br8hfP0_.mjs +2 -0
- package/dist/tags-Bnt4JuxQ.mjs +2 -0
- package/dist/telemetry-Ch1vCICm.mjs +2 -0
- package/dist/telemetry-DjGNSlkU.mjs +5 -0
- package/dist/tenant-D8u0CxoC.mjs +2 -0
- package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +3 -0
- package/dist/{tools-j8UGEtP1.mjs → tools-D9RZkZRc.mjs} +1 -1
- package/dist/tunnels-BkNPpTHa.mjs +5 -0
- package/dist/turnstile-MgwRECJv.mjs +23 -0
- package/dist/ui-DQSZeaG5.mjs +5 -0
- package/dist/url-info-Ddp7MgcI.mjs +2 -0
- package/dist/url-normalization-3ptK9ntV.mjs +3 -0
- package/dist/url-scanner-Psb9ollR.mjs +2 -0
- package/dist/user-DWdshcIu.mjs +12 -0
- package/dist/values-CDKQL1z2.mjs +2 -0
- package/dist/vectorize-CTYYUyQj.mjs +4 -0
- package/dist/waiting-rooms-BUdmwXDY.mjs +11 -0
- package/dist/web-assets-CpDwDEx8.mjs +8 -0
- package/dist/web3-YsjDyAzH.mjs +4 -0
- package/dist/workers-BKKxaZcz.mjs +6 -0
- package/dist/workers-builds-BWo5vUA9.mjs +2 -0
- package/dist/workers-for-platforms-ASJsxYdM.mjs +5 -0
- package/dist/workers-vpc-RkTnRvA2.mjs +3 -0
- package/dist/workflows-KrIFI9ns.mjs +5 -0
- package/dist/zaraz-DglXbVzZ.mjs +2 -0
- package/dist/zero-trust-RilTdSjX.mjs +91 -0
- package/dist/zone-DsBtVkvT.mjs +2 -0
- package/dist/zones-BFxvWFQW.mjs +44 -0
- package/package.json +1 -1
- package/dist/abuse-reports-D40QFl-y.mjs +0 -8
- package/dist/access-Dl2IU1ID.mjs +0 -11
- package/dist/account-CPbieCZ4.mjs +0 -2
- package/dist/account-tags-skfP7H8k.mjs +0 -9
- package/dist/accounts-CSgR6909.mjs +0 -28
- package/dist/acm-CVvCTaNk.mjs +0 -3
- package/dist/addressing-Uq5hEDDP.mjs +0 -13
- package/dist/agent-context-BvuDdaJb.mjs +0 -8
- package/dist/agent-memory-BrHMIU0E.mjs +0 -6
- package/dist/ai-audit-BoZuL84i.mjs +0 -2
- package/dist/ai-gateway-DE50Jem1.mjs +0 -13
- package/dist/ai-search-Fx7NHCHB.mjs +0 -7
- package/dist/ai-security-DyLbY9kv.mjs +0 -4
- package/dist/ai-v2fP1r0s.mjs +0 -5
- package/dist/alerting-5mFZjTcD.mjs +0 -6
- package/dist/analytics-BygTfozw.mjs +0 -3
- package/dist/analytics_engine-4L-q362P.mjs +0 -2
- package/dist/api-security-DjFsRYWx.mjs +0 -50
- package/dist/argo-TzXPN7tz.mjs +0 -2
- package/dist/args-CDgWUP4J.mjs +0 -2
- package/dist/artifacts-dEw2UUBV.mjs +0 -4
- package/dist/audit-logs-CqY7zzwv.mjs +0 -2
- package/dist/auth-CPLdkOC7.mjs +0 -5
- package/dist/auth-DY_Y2bXC.mjs +0 -9
- package/dist/billing-DHQuRT8S.mjs +0 -3
- package/dist/bot-management-CfqG79hF.mjs +0 -5
- package/dist/botnet-feed-BOeNnDoH.mjs +0 -3
- package/dist/brand-protection-DYttrKIM.mjs +0 -3
- package/dist/browser-extension-CTUCdgfn.mjs +0 -3
- package/dist/browser-run-373D4e1i.mjs +0 -4
- package/dist/build-D0ir_S70.mjs +0 -2
- package/dist/cache-DJXBmc3w.mjs +0 -7
- package/dist/calls-COO0Eoz1.mjs +0 -4
- package/dist/certificate-authorities-DbHLmKbd.mjs +0 -2
- package/dist/client-certificates-RBRqYP3f.mjs +0 -3
- package/dist/client-side-security-HOmA37et.mjs +0 -37
- package/dist/cloud-connector-C7hw1c1f.mjs +0 -2
- package/dist/cloudforce-one-DLOj76q4.mjs +0 -36
- package/dist/connector-interrupts-DY-z_LrH.mjs +0 -2
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +0 -2
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +0 -2
- package/dist/connectors-fEOn-J_i.mjs +0 -3
- package/dist/containers-BDBsEs7-.mjs +0 -58
- package/dist/content-scan-Cmj9--XY.mjs +0 -4
- package/dist/csamScanner-BRXyMCyH.mjs +0 -6
- package/dist/ct-alerting-9AvYys-f.mjs +0 -3
- package/dist/custom-certificates-C5qrlyhb.mjs +0 -5
- package/dist/custom-csrs-BgOnTbBW.mjs +0 -3
- package/dist/custom-hostnames-CbQD9aYo.mjs +0 -5
- package/dist/custom-nameservers-2ZajBkRC.mjs +0 -3
- package/dist/custom-pages-Buki_Cb8.mjs +0 -3
- package/dist/d1-n2in0cSF.mjs +0 -20
- package/dist/data-security-DzOQMkv3.mjs +0 -7
- package/dist/dcv-delegation-BTP9LCOm.mjs +0 -2
- package/dist/diagnostics-BvHV8kQb.mjs +0 -3
- package/dist/directory-BeiSyg8A.mjs +0 -3
- package/dist/dispatch-namespaces-Dp8Jjpwy.mjs +0 -7
- package/dist/dist-DvizctjW.mjs +0 -48
- package/dist/dls-BwoU29mS.mjs +0 -3
- package/dist/dns-DISAfuzj.mjs +0 -29
- package/dist/dns-firewall-wBcCx_ua.mjs +0 -57
- package/dist/dry-run-ILZRVpnp.mjs +0 -2
- package/dist/durable-objects-DhDL3San.mjs +0 -2
- package/dist/email-auth-BROqK6-C.mjs +0 -2
- package/dist/email-routing-BZXHDAOO.mjs +0 -6
- package/dist/email-security-DVumybrk.mjs +0 -18
- package/dist/email-sending-CDQ3_wyz.mjs +0 -7
- package/dist/fieldExtractors-Cy1rxHEF.mjs +0 -3
- package/dist/firewall-C0g5X7Zd.mjs +0 -11
- package/dist/flagship-fFBiZUz-.mjs +0 -4
- package/dist/fraud-CjIETOaM.mjs +0 -20
- package/dist/google-tag-gateway-hPa5IHUx.mjs +0 -2
- package/dist/healthchecks-CoycpTf9.mjs +0 -4
- package/dist/hostnames-x_Yezxpr.mjs +0 -3
- package/dist/hyperdrive-BlfrTwSq.mjs +0 -21
- package/dist/iam-Bk7K_PPO.mjs +0 -6
- package/dist/images-BAEFb9q1.mjs +0 -8
- package/dist/intel-DDkyJVaP.mjs +0 -8
- package/dist/interactive-CRnq-B5I.mjs +0 -11
- package/dist/interactive-cytQzL94.mjs +0 -78
- package/dist/ips-DU0ti0i0.mjs +0 -2
- package/dist/keyless-certificates-E1P9jBTb.mjs +0 -3
- package/dist/keys-DqldTZqH.mjs +0 -2
- package/dist/kv-CcfCfnwq.mjs +0 -5
- package/dist/leaked-credential-checks-CqmKaEbd.mjs +0 -4
- package/dist/load-balancers-Dg4pDad1.mjs +0 -6
- package/dist/logexplorer-Bu2mG5rh.mjs +0 -17
- package/dist/logo-matches-CWUzxY7G.mjs +0 -2
- package/dist/logos-BTfdkDPi.mjs +0 -3
- package/dist/logpush-BZyay3h2.mjs +0 -4
- package/dist/logs-BqF7jjQO.mjs +0 -3
- package/dist/magic-cloud-networking-Dhd8pTyM.mjs +0 -5
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +0 -4
- package/dist/magic-transit-B5skt0G7.mjs +0 -111
- package/dist/managed-transforms-B6X_crcJ.mjs +0 -3
- package/dist/matches-DeYaB4I0.mjs +0 -2
- package/dist/mcp-ChjBiMx2.mjs +0 -4
- package/dist/mesh-DRVAFLBX.mjs +0 -4
- package/dist/moq-DE7VDEFS.mjs +0 -13
- package/dist/mtls-certificates-Cbc3uAkN.mjs +0 -3
- package/dist/network-CDPZNFbn.mjs +0 -6
- package/dist/network-interconnects-CMRs_chR.mjs +0 -41
- package/dist/oauth-DAa7SwkM.mjs +0 -14
- package/dist/oauth-clients-DAI_gcuL.mjs +0 -4
- package/dist/oauth-scopes-BE6xF4_h.mjs +0 -2
- package/dist/observability-DnyI8rPJ.mjs +0 -4
- package/dist/organization-yh0mSUdI.mjs +0 -41
- package/dist/organizations-B3aU-RCG.mjs +0 -2
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +0 -3
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +0 -2
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +0 -4
- package/dist/page-rules-CzbyXbt6.mjs +0 -27
- package/dist/pages-CX8yefTI.mjs +0 -14
- package/dist/pay-per-crawl-v4vBOMWD.mjs +0 -4
- package/dist/pipelines-BZ1KGupx.mjs +0 -6
- package/dist/precursor-D42A9ay5.mjs +0 -4
- package/dist/progress-jYW64HY7.mjs +0 -2
- package/dist/project-settings-BN7tL0c7.mjs +0 -3
- package/dist/prompt-CyATfGUu.mjs +0 -3
- package/dist/queries-xvETUjUE.mjs +0 -3
- package/dist/queues-CpqHDtxF.mjs +0 -6
- package/dist/r2-data-catalog-DgKmlTKR.mjs +0 -16
- package/dist/r2-jhmLvD1z.mjs +0 -24
- package/dist/radar-C2J16wpX.mjs +0 -2
- package/dist/rate-limits-CoH9Xma0.mjs +0 -5
- package/dist/raw-fetch-CNKIypJ7.mjs +0 -2
- package/dist/realtimekit-CDs0Z5WW.mjs +0 -7
- package/dist/registrar-BI5ewTAk.mjs +0 -23
- package/dist/registrar-sandbox-al1znWMc.mjs +0 -61
- package/dist/reporting-CxsdHAH3.mjs +0 -2
- package/dist/request-tracers-DJJCncft.mjs +0 -2
- package/dist/resource-sharing-qQGn8AEn.mjs +0 -3
- package/dist/resource-tagging-aTtpX5e5.mjs +0 -2
- package/dist/rules-PpsDU89Q.mjs +0 -4
- package/dist/rulesets-DP12Aqik.mjs +0 -5
- package/dist/rum-DxvpzJYc.mjs +0 -4
- package/dist/schema-DlLbiOJj.mjs +0 -2
- package/dist/scim-DJ4AVU20.mjs +0 -4
- package/dist/secrets-store-D6KDNo_s.mjs +0 -7
- package/dist/security-center-008FMs_z.mjs +0 -2
- package/dist/security-txt-CqcfrhlN.mjs +0 -3
- package/dist/share-D5fzsVAJ.mjs +0 -5
- package/dist/smart-shield-DpFscIk8.mjs +0 -4
- package/dist/snippets-CCKgI2ZX.mjs +0 -4
- package/dist/spectrum-LmdqY3ki.mjs +0 -7
- package/dist/speed-CEK36h3A.mjs +0 -4
- package/dist/src-CEb2fgtT.mjs +0 -108
- package/dist/ssl-ChHUyaQm.mjs +0 -15
- package/dist/state-DeX23Kmg.mjs +0 -2
- package/dist/stream-DfUSELMX.mjs +0 -14
- package/dist/submit-DF2G5CIz.mjs +0 -2
- package/dist/tags-nFJJHlLJ.mjs +0 -2
- package/dist/tenant-CRLw1oRU.mjs +0 -2
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +0 -3
- package/dist/tunnel-CMQeBgmb.mjs +0 -5
- package/dist/tunnels-iVA3MrdS.mjs +0 -2
- package/dist/turnstile-DQHP6-_b.mjs +0 -23
- package/dist/ui-DJFcf61J.mjs +0 -5
- package/dist/url-info-BVgdb_pf.mjs +0 -2
- package/dist/url-normalization-BTcxLxIQ.mjs +0 -3
- package/dist/url-scanner-DwuDZLPk.mjs +0 -2
- package/dist/user-I_MbB_KX.mjs +0 -12
- package/dist/values-S-Q7-5o8.mjs +0 -2
- package/dist/vectorize-CNZdF_0A.mjs +0 -4
- package/dist/waiting-rooms-Bo-OSsxu.mjs +0 -11
- package/dist/web-assets-tlFzKdNL.mjs +0 -8
- package/dist/web3-CdbfoZ2x.mjs +0 -4
- package/dist/workers-DQ9Q7czn.mjs +0 -28
- package/dist/workers-builds-CGRhYx-x.mjs +0 -9
- package/dist/workflows-BhEy-crm.mjs +0 -5
- package/dist/zaraz-DbKvA_8C.mjs +0 -2
- package/dist/zero-trust-DrHCPVOc.mjs +0 -93
- package/dist/zone-D2zrbJI2.mjs +0 -2
- package/dist/zones-DrpxQ_-A.mjs +0 -21
- /package/dist/{Page-9ry_XAVC.mjs → Page-C-JHZnIy.mjs} +0 -0
- /package/dist/{alerts-9PR5sQ_z.mjs → alerts-B2SJO4nd.mjs} +0 -0
- /package/dist/{autorag-Bevo1kIH.mjs → autorag-iNjZXw1n.mjs} +0 -0
- /package/dist/{body-parser-BGVbwPeM.mjs → body-parser-DIlfApuJ.mjs} +0 -0
- /package/dist/{brands-C4M04Man.mjs → brands-BrVnNrT3.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-C3w62dek.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-DVMMVVEs.mjs → chunk-Q72B4Q5Z-CPy_WJKU.mjs} +0 -0
- /package/dist/{clear-DS0eRXOc.mjs → clear-an9o3dJ3.mjs} +0 -0
- /package/dist/{cli-types-C3nVfpSG.mjs → cli-types-CrSoSMPF.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-CKKG6_pD.mjs → connector-telemetry-events-latest-BqWfopFc.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-Bv5OddJr.mjs → connector-telemetry-snapshots-latest-C1m9U1En.mjs} +0 -0
- /package/dist/{domain-info-BUiaGCEq.mjs → domain-info-B0Ykqv5l.mjs} +0 -0
- /package/dist/{health-vX6Ml2Na.mjs → health-CIUg1C5o.mjs} +0 -0
- /package/dist/{input-validation-1esLElok.mjs → input-validation-BxchZ9jE.mjs} +0 -0
- /package/dist/{internal-ROz7anul.mjs → internal-DmpATljO.mjs} +0 -0
- /package/dist/{live-CSxvigCS.mjs → live-B66u3_0g.mjs} +0 -0
- /package/dist/{metadata-DEqBUaSv.mjs → metadata-D062SVyy.mjs} +0 -0
- /package/dist/{public-BMg6-Hxh-DgIH5obr.mjs → public-BMg6-Hxh-BfUOZTDP.mjs} +0 -0
- /package/dist/{rate-limit-analytics-CgHgKjmV.mjs → rate-limit-analytics-BknoecoM.mjs} +0 -0
- /package/dist/{ready-6G9zVGPJ.mjs → ready-C-H2cwp_.mjs} +0 -0
- /package/dist/{recent-submissions-B3Smh-QM.mjs → recent-submissions-DyuH_n5u.mjs} +0 -0
- /package/dist/{refute-DjkmLSNe.mjs → refute-uSlzkQKq.mjs} +0 -0
- /package/dist/{resolve-DEvdeprv.mjs → resolve-B8CyM1mi.mjs} +0 -0
- /package/dist/{scan-logo-545qLcGs.mjs → scan-logo-DMk--WT7.mjs} +0 -0
- /package/dist/{scan-page-DRQiVufl.mjs → scan-page-DEHnAOJo.mjs} +0 -0
- /package/dist/{schemas-BFCBlp_W.mjs → schemas-O_ZNaF8R.mjs} +0 -0
- /package/dist/{search-CXbqFoqe.mjs → search-BlKeSfVD.mjs} +0 -0
- /package/dist/{signed-url-rU_nvgFA.mjs → signed-url-CiGmGkLQ.mjs} +0 -0
- /package/dist/{submission-info-D6PgXNQP.mjs → submission-info-DHlTHDrs.mjs} +0 -0
- /package/dist/{theme-CrIBazAF.mjs → theme-CeVf-5qG.mjs} +0 -0
- /package/dist/{total-queries-XkFyu8H5.mjs → total-queries-D5WvVfYi.mjs} +0 -0
- /package/dist/{tracked-domains-CmcRXHj_.mjs → tracked-domains-9deBK9bp.mjs} +0 -0
- /package/dist/{verify-CM1NakP0.mjs → verify-S-TmhUDr.mjs} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p}from"./input-validation-BxchZ9jE.mjs";import{a as m,i as h,n as g}from"./prompt-DjRTpML4.mjs";import{n as _,t as ee}from"./raw-fetch-BVYQR6C5.mjs";function te(e){return e.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 a DNS Protection rule for an account.`,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 n()??`<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 t();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.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 b={command:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:y,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},x={command:`for`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete.for`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`rule <rule-id>`,describe:`Delete a DNS Protection rule specified by the given UUID.`,builder:S,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules delete protection rule`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete protection rule`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.protection.rule({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})},w={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete.protection`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`delete`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete`,builder:e=>e.command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <rule-id>`,describe:`Get a DNS Protection rule specified by the given UUID.`,builder:E,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function O(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List all DNS Protection rules for an account.`,builder:O,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.list({account_id:u,...c})),{successLabel:`Loaded`})})};function A(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to update.`,demandOption:!0}).option(`block-any-queries`,{type:`boolean`,description:`The new value for whether to block DNS ANY queries. Optional.`}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`profile-sensitivity`,{type:`string`,description:`The new profile sensitivity. Optional. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the DNS Protection rule.`})}const j={command:`update <rule-id>`,describe:`Update a DNS Protection rule specified by the given UUID.`,builder:A,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules update`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let d=f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...d,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},M={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(v).command(D).command(k).command(j).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`advanced-dns-protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`comment`,{type:`string`,description:`An comment describing the allowlist prefix.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect.`}).option(`prefix`,{type:`string`,description:`The allowlist prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new allowlist prefix to create.`})}const R={command:`create`,describe:`Create an allowlist prefix for an account.`,builder:L,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({comment:p(r.comment,`comment`,`text`),enabled:r.enabled,prefix:p(r.prefix,`prefix`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.comment===void 0&&(r.comment=await m(`comment`,`An comment describing the allowlist prefix.`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.prefix===void 0&&(r.prefix=await m(`prefix`,`The allowlist prefix to add in CIDR format.`));let d=f({comment:p(r.comment,`comment`,`text`),enabled:r.enabled,prefix:p(r.prefix,`prefix`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...d,account_id:l})),{successLabel:`Created`})})};function z(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`prefix <prefix-id>`,describe:`Delete the allowlist prefix for an account given a UUID.`,builder:z,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.delete.allowlist.prefix({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Deleted`})})},V={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist.delete.allowlist`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.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 U={command:`account`,describe:`Delete all allowlist prefixes for an account.`,builder:H,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},W={command:`for`,describe:`Operations for advanced-tcp-protection.configs.allowlist.delete.for`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`delete`,describe:`Operations for advanced-tcp-protection.configs.allowlist.delete`,builder:e=>e.command(V).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <prefix-id>`,describe:`Get an allowlist prefix specified by the given UUID.`,builder:K,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.get({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})})};function J(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List all allowlist prefixes for an account.`,builder:J,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.allowlist.list({account_id:u,...c})),{successLabel:`Loaded`})})};function X(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A comment describing the allowlist prefix. Optional.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the allowlist prefix.`})}const Z={command:`update <prefix-id>`,describe:`Update an allowlist prefix specified by the given UUID.`,builder:X,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({comment:p(r.comment,`comment`,`text`),enabled:r.enabled}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.update({...e,account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`});return}let d=f({comment:p(r.comment,`comment`,`text`),enabled:r.enabled});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.update({...d,account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`})})},Q={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist`,builder:e=>e.command(R).command(q).command(Y).command(Z).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The list of new prefixes to create.`})}const re={command:`create`,describe:`Create multiple prefixes for an account.`,builder:ne,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs prefixes bulk create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs prefixes bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/bulk`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.bulk.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.`)})},ie={command:`bulk`,describe:`Operations for advanced-tcp-protection.configs.prefixes.bulk`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`comment`,{type:`string`,description:`A comment describing the prefix.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection.`}).option(`prefix`,{type:`string`,description:`The prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new prefix to create.`})}const oe={command:`create`,describe:`Create a prefix for an account.`,builder:ae,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs prefixes create`,classification:{safeFlags:[`excluded`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({comment:p(r.comment,`comment`,`text`),excluded:r.excluded,prefix:p(r.prefix,`prefix`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.comment===void 0&&(r.comment=await m(`comment`,`A comment describing the prefix.`)),r.excluded===void 0)throw Error(`--excluded is required (or pass --body with this field set).`);r.prefix===void 0&&(r.prefix=await m(`prefix`,`The prefix to add in CIDR format.`));let d=f({comment:p(r.comment,`comment`,`text`),excluded:r.excluded,prefix:p(r.prefix,`prefix`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.create({body:d,account_id:l})),{successLabel:`Created`})})};function se(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ce={command:`delete <prefix-id>`,describe:`Delete the prefix for an account given a UUID.`,builder:se,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs prefixes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.delete({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Deleted`})})};function le(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <prefix-id>`,describe:`Get a prefix specified by the given UUID.`,builder:le,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs prefixes get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.get({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})})};function de(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`List all prefixes for an account.`,builder:de,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs prefixes list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.prefixes.list({account_id:u,...c})),{successLabel:`Loaded`})})};function pe(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A new comment for the prefix. Optional.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the prefix.`})}const me={command:`update <prefix-id>`,describe:`Update a prefix specified by the given UUID.`,builder:pe,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs prefixes update`,classification:{safeFlags:[`excluded`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs prefixes update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({comment:p(r.comment,`comment`,`text`),excluded:r.excluded}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.update({...e,account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`});return}let d=f({comment:p(r.comment,`comment`,`text`),excluded:r.excluded});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.update({...d,account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`})})},he={command:`prefixes`,describe:`Operations for advanced-tcp-protection.configs.prefixes`,builder:e=>e.command(oe).command(ce).command(ue).command(fe).command(me).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const _e={command:`create`,describe:`Create a SYN Protection filter for an account.`,builder:ge,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({expression:p(r.expression,`expression`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.create({body:e,account_id:l})),{successLabel:`Created`});return}r.expression===void 0&&(r.expression=await m(`expression`,`The filter expression.`));let d=f({expression:p(r.expression,`expression`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.create({body:d,account_id:l})),{successLabel:`Created`})})};function ve(e){return e.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 ye={command:`account`,describe:`Delete all SYN Protection filters for an account.`,builder:ve,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},be={command:`for`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters.delete.for`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Se={command:`filter <filter-id>`,describe:`Delete a SYN Protection filter specified by the given UUID.`,builder:xe,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters delete protection filter`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters delete protection filter`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
9
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.delete.protection.filter({account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Deleted`})})},Ce={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters.delete.protection`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`delete`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters.delete`,builder:e=>e.command(be).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <filter-id>`,describe:`Get a SYN Protection filter specified by the given UUID.`,builder:Te,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.get({account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Loaded`})})};function De(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List all SYN Protection filters for an account.`,builder:De,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.syn.protection.filters.list({account_id:u,...c})),{successLabel:`Loaded`})})};function ke(e){return e.positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const Ae={command:`update <filter-id>`,describe:`Update a SYN Protection filter specified by the given UUID.`,builder:ke,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({expression:p(r.expression,`expression`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.update({body:e,account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Updated`});return}let d=f({expression:p(r.expression,`expression`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.update({body:d,account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Updated`})})},je={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters`,builder:e=>e.command(_e).command(Ee).command(Oe).command(Ae).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The type of mitigation. Must be one of 'challenge' or 'retransmit'. Optional. Defaults to 'challenge'.`}).option(`name`,{type:`string`,description:`The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new SYN Protection rule to add.`})}const Ne={command:`create`,describe:`Create a SYN Protection rule for an account.`,builder:Me,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(r[`mitigation-type`],`mitigation-type`,`text`),name:p(r.name,`name`,`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 t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.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 SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),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 SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let d=f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(r[`mitigation-type`],`mitigation-type`,`text`),name:p(r.name,`name`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.create({...d,account_id:l})),{successLabel:`Created`})})};function Pe(e){return e.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 Fe={command:`account`,describe:`Delete all SYN Protection rules for an account.`,builder:Pe,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},Ie={command:`for`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules.delete.for`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Re={command:`rule <rule-id>`,describe:`Delete a SYN Protection rule specified by the given UUID.`,builder:Le,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules delete protection rule`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules delete protection rule`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
11
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.delete.protection.rule({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})},ze={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules.delete.protection`,builder:e=>e.command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Be={command:`delete`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules.delete`,builder:e=>e.command(Ie).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ve(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`get <rule-id>`,describe:`Get a SYN Protection rule specified by the given UUID.`,builder:Ve,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function Ue(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`list`,describe:`List all SYN Protection rules for an account.`,builder:Ue,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.syn.protection.rules.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Ge(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The new mitigation type. Optional. Must be one of 'challenge' or 'retransmit'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The fields to update on the SYN Protection rule.`})}const Ke={command:`update <rule-id>`,describe:`Update a SYN Protection rule specified by the given UUID.`,builder:Ge,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(r[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let d=f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(r[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.update({...d,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},qe={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules`,builder:e=>e.command(Ne).command(He).command(We).command(Ke).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Je={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.syn.protection`,builder:e=>e.command(je).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ye={command:`syn`,describe:`Operations for advanced-tcp-protection.configs.syn`,builder:e=>e.command(Je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xe(e){return e.option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const Ze={command:`create`,describe:`Create a TCP Flow Protection filter for an account.`,builder:Xe,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({expression:p(r.expression,`expression`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.create({body:e,account_id:l})),{successLabel:`Created`});return}r.expression===void 0&&(r.expression=await m(`expression`,`The filter expression.`));let d=f({expression:p(r.expression,`expression`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.create({body:d,account_id:l})),{successLabel:`Created`})})};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const $e={command:`account`,describe:`Delete all TCP Flow Protection filters for an account.`,builder:Qe,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
12
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},et={command:`for`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters.delete.for`,builder:e=>e.command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const nt={command:`filter <filter-id>`,describe:`Delete a TCP Flow Protection filter specified by the given UUID.`,builder:tt,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters delete protection filter`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters delete protection filter`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
13
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.delete.protection.filter({account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Deleted`})})},rt={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters.delete.protection`,builder:e=>e.command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},it={command:`delete`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters.delete`,builder:e=>e.command(et).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function at(e){return e.positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`get <filter-id>`,describe:`Get a TCP Flow Protection filter specified by the given UUID.`,builder:at,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.get({account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Loaded`})})};function st(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`list`,describe:`List all TCP Flow Protection filters for an account.`,builder:st,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.list({account_id:u,...c})),{successLabel:`Loaded`})})};function lt(e){return e.positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const ut={command:`update <filter-id>`,describe:`Update a TCP Flow Protection filter specified by the given UUID.`,builder:lt,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({expression:p(r.expression,`expression`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.update({body:e,account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Updated`});return}let d=f({expression:p(r.expression,`expression`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.update({body:d,account_id:l,filter_id:r[`filter-id`]})),{successLabel:`Updated`})})},dt={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters`,builder:e=>e.command(Ze).command(ot).command(ct).command(ut).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ft(e){return e.option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the TCP Flow Protection rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new TCP Flow Protection rule.`})}const pt={command:`create`,describe:`Create a TCP Flow Protection rule for an account.`,builder:ft,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`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 t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.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 TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),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 TCP Flow Protection rule.`));let d=f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.create({...d,account_id:l})),{successLabel:`Created`})})};function mt(e){return e.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:`account`,describe:`Delete all TCP Flow Protection rules for an account.`,builder:mt,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},gt={command:`for`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules.delete.for`,builder:e=>e.command(ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _t(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vt={command:`rule <rule-id>`,describe:`Delete a TCP Flow Protection rule specified by the given UUID.`,builder:_t,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules delete protection rule`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules delete protection rule`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
15
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.delete.protection.rule({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})},yt={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules.delete.protection`,builder:e=>e.command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bt={command:`delete`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules.delete`,builder:e=>e.command(gt).command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xt(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`get <rule-id>`,describe:`Get a TCP Flow Protection rule specified by the given UUID.`,builder:xt,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function Ct(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wt={command:`list`,describe:`List all TCP Flow Protection rules for an account.`,builder:Ct,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Tt(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the TCP Flow Protection rule.`})}const Et={command:`update <rule-id>`,describe:`Update a TCP Flow Protection rule specified by the given UUID.`,builder:Tt,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let d=f({burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.update({...d,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},Dt={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules`,builder:e=>e.command(pt).command(St).command(wt).command(Et).command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ot={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection`,builder:e=>e.command(dt).command(Dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},kt={command:`flow`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow`,builder:e=>e.command(Ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function At(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jt={command:`get`,describe:`Get the protection status of the account.`,builder:At,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp protection status get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp protection status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_protection_status`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.protection.status.get({account_id:l})),{successLabel:`Loaded`})})};function Mt(e){return e.option(`enabled`,{type:`boolean`,description:`Enables or disables protection.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The update to apply to the protection status.`})}const Nt={command:`update`,describe:`Update the protection status of the account.`,builder:Mt,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs tcp protection status update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs tcp protection status update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_protection_status`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({enabled:r.enabled}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.protection.status.update({...e,account_id:l})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=f({enabled:r.enabled});a(await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.protection.status.update({...d,account_id:l})),{successLabel:`Updated`})})},Pt={command:`status`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection.status`,builder:e=>e.command(jt).command(Nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ft={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection`,builder:e=>e.command(Pt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},It={command:`tcp`,describe:`Operations for advanced-tcp-protection.configs.tcp`,builder:e=>e.command(kt).command(Ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Lt={command:`configs`,describe:`Operations for advanced-tcp-protection.configs`,builder:e=>e.command(Q).command(he).command(Ye).command(It).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Rt={command:`advanced-tcp-protection`,describe:`Advanced Tcp Protection operations`,builder:e=>e.command(Lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zt(e){return e.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:`Creates a new App for an account`,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 n()??`<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 t();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.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:`Deletes specific 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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
16
|
+
`);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.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 Wt={command:`edit <account-app-id>`,describe:`Updates an Account App`,builder:Ut,handler:async r=>c({command:`magic-transit apps edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit apps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.apps.edit({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.edit({body:d,account_id:l,account_app_id:r[`account-app-id`]})),{successLabel:`Updated`})})};function Gt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kt={command:`list`,describe:`Lists Apps associated with an account.`,builder:Gt,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 n()??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.apps.list({account_id:l})),{successLabel:`Loaded`})})};function qt(e){return e.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 Jt={command:`update <account-app-id>`,describe:`Updates an Account App`,builder:qt,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 n()??`<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 t();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`})})},Yt={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).command(Jt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xt(e){return e.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 Zt={command:`create`,describe:`Creates a new BGP filter profile for an account.`,builder:Xt,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 n()??`<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 t();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 Qt(e){return e.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 $t={command:`delete <profile-id>`,describe:`Deletes a BGP filter profile.`,builder:Qt,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
17
|
+
`);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.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 tn={command:`get <profile-id>`,describe:`Gets a specific BGP filter profile for an account.`,builder:en,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.bgpFilterProfiles.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function nn(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rn={command:`list`,describe:`Lists all BGP filter profiles for an account.`,builder:nn,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 n()??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.bgpFilterProfiles.list({account_id:l})),{successLabel:`Loaded`})})};function an(e){return e.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 on={command:`update <profile-id>`,describe:'Updates a BGP filter profile. Omitted properties are left unchanged. To clear an existing description send `description: ""`.',builder:an,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 n()??`<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 t();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`})})},sn={command:`bgp-filter-profiles`,describe:`BGP filter profiles for controlling which routes are allowed or denied on Magic Transit tunnels`,builder:e=>e.command(Zt).command($t).command(tn).command(rn).command(on).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function cn(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ln={command:`get`,describe:`Gets the BGP settings for an account, including the default ASN and redistribution configuration.`,builder:cn,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 n()??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.bgpSettings.get({account_id:l})),{successLabel:`Loaded`})})};function un(e){return e.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 dn={command:`update`,describe:`Modifies the BGP settings for an account, including the default ASN and redistribution configuration.`,builder:un,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 n()??`<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 t();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`})})},fn={command:`bgp-settings`,describe:`BGP settings for controlling default ASN and route redistribution on Magic Transit tunnels`,builder:e=>e.command(ln).command(dn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pn(e){return e.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 mn={command:`bulk-update`,describe:"Updates multiple interconnects associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:pn,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 n()??`<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 t();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 hn(e){return e.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 gn={command:`get <cf-interconnect-id>`,describe:`Lists details for a specific interconnect.`,builder:hn,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 n()??`<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 t();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 _n(e){return e.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:`Lists interconnects associated with an account.`,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 n()??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();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.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.
|
|
18
|
+
|
|
19
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
20
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
21
|
+
misconfiguration, not for defending against malicious attacks.
|
|
22
|
+
|
|
23
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
24
|
+
character:
|
|
25
|
+
|
|
26
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
27
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
28
|
+
|
|
29
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
30
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
31
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
32
|
+
these disallowed characters will be rejected.`}).option(`description`,{type:`string`,description:`An optional description of the interconnect.`}).option(`gre-cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).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 interconnect and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the interconnect.`,choices:[`unidirectional`,`bidirectional`]}).option(`health-check-source`,{type:`string`,description:"The source IPv4 address used for bidirectional health checks. Supported only for version 1.5 interconnects. It is required when `direction` is `bidirectional` and must be omitted (and is cleared) when `direction` is `unidirectional`. The address must be within RFC1918 space, the approved link-local range 169.254.240.0/20, or the Cloudflare reserved range 198.41.199.224/27."}).option(`interface-address`,{type:`string`,description:`The IPv4 interface address for the interconnect. For MPLS Interconnects,
|
|
33
|
+
use a /30 or /31 prefix. For GRE Interconnects, a /30 or /31 prefix
|
|
34
|
+
may be used. Version 1.5 interconnects require a /31 prefix and may
|
|
35
|
+
also use a prefix from the account's authorized prefixes; otherwise,
|
|
36
|
+
select the subnet from RFC 1918 or the approved link-local ranges.
|
|
37
|
+
`}).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 bn={command:`update <cf-interconnect-id>`,describe:"Updates a specific interconnect associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:yn,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 n()??`<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 t();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`})})},xn={command:`cf-interconnects`,describe:`Cloudflare Network Interconnect (CNI) links for direct physical or virtual peering`,builder:e=>e.command(mn).command(gn).command(vn).command(bn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sn(e){return e.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 Cn={command:`create`,describe:`Creates new CF1 Sites for an account. Each site must have a unique name within the account.`,builder:Sn,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 n()??`<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 t();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 wn(e){return e.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 Tn={command:`delete <cf1-site-id>`,describe:`Deletes a specific CF1 Site for an account.`,builder:wn,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
38
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.cf1Sites.delete({account_id:l,cf1_site_id:r[`cf1-site-id`]})),{successLabel:`Deleted`})})};function En(e){return e.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 Dn={command:`get <cf1-site-id>`,describe:`Gets a specific CF1 Site for an account.`,builder:En,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 n()??`<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 t();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 On(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kn={command:`list`,describe:`Lists CF1 Sites associated with an account. A CF1 Site represents a physical customer network location with optional geographic coordinates.`,builder:On,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 n()??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.cf1Sites.list({account_id:l})),{successLabel:`Loaded`})})};function An(e){return e.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 jn={command:`create <cf1-site-id>`,describe:`Creates ramps (network connections) for a CF1 Site.`,builder:An,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 n()??`<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 t();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 Mn(e){return e.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 Nn={command:`delete <ramp-id>`,describe:`Deletes a specific ramp from a CF1 Site.`,builder:Mn,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
39
|
+
`);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 Pn(e){return e.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 Fn={command:`get <ramp-id>`,describe:`Gets a specific ramp for a CF1 Site.`,builder:Pn,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 n()??`<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 t();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 $(e){return e.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 In={command:`list`,describe:`Lists ramps (network connections) associated with a CF1 Site. Ramps represent GRE tunnels, IPsec tunnels, interconnects, or MCONN links.`,builder:$,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 n()??`<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 t();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`})})},Ln={command:`ramps`,describe:`Operations for cf1-sites.ramps`,builder:e=>e.command(jn).command(Nn).command(Fn).command(In).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Rn(e){return e.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 zn={command:`update <cf1-site-id>`,describe:`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.`,builder:Rn,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 n()??`<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 t();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`})})},Bn={command:`cf1-sites`,describe:`Operations for cf1-sites`,builder:e=>e.command(Cn).command(Tn).command(Dn).command(kn).command(zn).command(Ln).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vn(e){return e.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 Hn={command:`bulk-update`,describe:"Updates multiple GRE tunnels. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:Vn,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 n()??`<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 t();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 Un(e){return e.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.
|
|
40
|
+
|
|
41
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
42
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
43
|
+
misconfiguration, not for defending against malicious attacks.
|
|
44
|
+
|
|
45
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
46
|
+
character:
|
|
47
|
+
|
|
48
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
49
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
50
|
+
|
|
51
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
52
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
53
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
54
|
+
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 Wn={command:`create`,describe:"Creates a new GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:Un,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 n()??`<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 t();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 Gn(e){return e.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 Kn={command:`delete <gre-tunnel-id>`,describe:"Disables and removes a specific static GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:Gn,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 n()??`<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 t();if(l.accountId=d,!await g({force:!!l.force})){process.stderr.write(`Aborted.
|
|
55
|
+
`);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 qn(e){return e.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 Jn={command:`get <gre-tunnel-id>`,describe:`Lists informtion for a specific GRE tunnel.`,builder:qn,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 n()??`<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 t();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 Yn(e){return e.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 Xn={command:`list`,describe:`Lists GRE tunnels associated with an account.`,builder:Yn,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 n()??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();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 Zn(e){return e.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 Qn={command:`update <gre-tunnel-id>`,describe:"Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:Zn,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 n()??`<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 t();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`})})},$n={command:`gre-tunnels`,describe:`GRE tunnel endpoints that connect your network to Cloudflare for Magic Transit`,builder:e=>e.command(Hn).command(Wn).command(Kn).command(Jn).command(Xn).command(Qn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function er(e){return e.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 tr={command:`bulk-update`,describe:"Update multiple IPsec tunnels associated with an account. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.",builder:er,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 n()??`<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 t();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 nr(e){return e.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.
|
|
56
|
+
|
|
57
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
58
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
59
|
+
misconfiguration, not for defending against malicious attacks.
|
|
60
|
+
|
|
61
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
62
|
+
character:
|
|
63
|
+
|
|
64
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
65
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
66
|
+
|
|
67
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
68
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
69
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
70
|
+
these disallowed characters will be rejected.`}).option(`cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the IPsec tunnel.`}).option(`custom-remote-identities-fqdn-id`,{type:`string`,description:`A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The
|
|
71
|
+
generated IKE IDs can still be used even if this custom value is specified.
|
|
72
|
+
|
|
73
|
+
Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
74
|
+
|
|
75
|
+
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
76
|
+
fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
|
|
77
|
+
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 rr={command:`create`,describe:"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.",builder:nr,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 n()??`<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 t();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 ir(e){return e.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 ar={command:`delete <ipsec-tunnel-id>`,describe:"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.",builder:ir,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 n()??`<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 t();if(l.accountId=d,!await g({force:!!l.force})){process.stderr.write(`Aborted.
|
|
78
|
+
`);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 or(e){return e.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 sr={command:`get <ipsec-tunnel-id>`,describe:`Lists details for a specific IPsec tunnel.`,builder:or,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 n()??`<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 t();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 cr(e){return e.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 lr={command:`list`,describe:`Lists IPsec tunnels associated with an account.`,builder:cr,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 n()??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();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 ur(e){return e.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 dr={command:`psk-generate <ipsec-tunnel-id>`,describe:"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.",builder:ur,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 n()??`<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 t();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 fr(e){return e.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 pr={command:`psk-set`,describe:"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.",builder:fr,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 n()??`<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 t();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 mr(e){return e.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.
|
|
79
|
+
|
|
80
|
+
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
81
|
+
key is not treated as a secret value. This is *only* supported for preventing
|
|
82
|
+
misconfiguration, not for defending against malicious attacks.
|
|
83
|
+
|
|
84
|
+
The MD5 key, if set, must be of non-zero length and consist only of the following types of
|
|
85
|
+
character:
|
|
86
|
+
|
|
87
|
+
* ASCII alphanumerics: \`[a-zA-Z0-9]\`
|
|
88
|
+
* Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
|
|
89
|
+
|
|
90
|
+
In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
|
|
91
|
+
quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
|
|
92
|
+
(0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
|
|
93
|
+
these disallowed characters will be rejected.`}).option(`cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the IPsec tunnel.`}).option(`custom-remote-identities-fqdn-id`,{type:`string`,description:`A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The
|
|
94
|
+
generated IKE IDs can still be used even if this custom value is specified.
|
|
95
|
+
|
|
96
|
+
Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
|
|
97
|
+
|
|
98
|
+
This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
|
|
99
|
+
fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
|
|
100
|
+
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 hr={command:`update <ipsec-tunnel-id>`,describe:"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.",builder:mr,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 n()??`<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 t();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`})})},gr={command:`ipsec-tunnels`,describe:`IPsec tunnel endpoints with pre-shared key management for encrypted transit`,builder:e=>e.command(tr).command(rr).command(ar).command(sr).command(lr).command(dr).command(pr).command(hr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _r(e){return e.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 new PCAP request for account.`,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 n()??`<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 t();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.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 br={command:`get <pcap-id>`,describe:`Download PCAP information into a file. Response is a binary PCAP file.`,builder:yr,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 n()??`<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 t();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)})},xr={command:`download`,describe:`Operations for pcaps.download`,builder:e=>e.command(br).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sr(e){return e.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 Cr={command:`get <pcap-id>`,describe:`Get information for a PCAP request by id.`,builder:Sr,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.pcaps.get({account_id:l,pcap_id:r[`pcap-id`]})),{successLabel:`Loaded`})})};function wr(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tr={command:`list`,describe:`Lists all packet capture requests for an account.`,builder:wr,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 n()??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.pcaps.list({account_id:l})),{successLabel:`Loaded`})})};function Er(e){return e.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 Dr={command:`create`,describe:`Adds an AWS or GCP bucket to use with full packet captures.`,builder:Er,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 n()??`<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 t();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 Or(e){return e.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 kr={command:`delete <ownership-id>`,describe:`Deletes buckets added to the packet captures API.`,builder:Or,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
101
|
+
`);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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jr={command:`get`,describe:`List all buckets configured for use with PCAPs API.`,builder:Ar,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 n()??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.pcaps.ownership.get({account_id:l})),{successLabel:`Loaded`})})};function Mr(e){return e.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 Nr={command:`validate`,describe:`Validates buckets added to the packet captures API.`,builder:Mr,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 n()??`<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 t();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`})})},Pr={command:`ownership`,describe:`Operations for pcaps.ownership`,builder:e=>e.command(Dr).command(kr).command(jr).command(Nr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fr(e){return e.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 Ir={command:`stop <pcap-id>`,describe:`Stop full PCAP.`,builder:Fr,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 n()??`<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 t();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.
|
|
102
|
+
`);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.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 zr={command:`create`,describe:`Creates a new redundancy group, optionally with tunnel members.`,builder:Rr,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 n()??`<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 t();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 Br(e){return e.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 Vr={command:`delete <redundancy-group-id>`,describe:`Deletes a redundancy group. Member tunnels are not deleted — their redundancy_group_id is cleared.`,builder:Br,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
103
|
+
`);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.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 Ur={command:`get <redundancy-group-id>`,describe:`Gets details for a specific redundancy group, including full member tunnel data.`,builder:Hr,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 n()??`<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 t();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 Wr(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gr={command:`list`,describe:`Lists redundancy groups associated with an account, including full member tunnel data.`,builder:Wr,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 n()??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.redundancyGroups.list({account_id:l})),{successLabel:`Loaded`})})};function Kr(e){return e.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 qr={command:`update <redundancy-group-id>`,describe:`Replaces the name, description, and full set of members for an existing redundancy group.`,builder:Kr,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 n()??`<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 t();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`})})},Jr={command:`redundancy-groups`,describe:`Operations for redundancy-groups`,builder:e=>e.command(zr).command(Vr).command(Ur).command(Gr).command(qr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yr(e){return e.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 Xr={command:`bulk-update`,describe:"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.",builder:Yr,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 n()??`<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 t();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 Zr(e){return e.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 Qr={command:`create`,describe:"Creates a new Magic static route. Use `?validate_only=true` as an optional query parameter to run validation only without persisting changes.",builder:Zr,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 n()??`<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 t();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 $r(e){return e.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 ei={command:`delete <route-id>`,describe:`Disable and remove a specific Magic static route.`,builder:$r,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
104
|
+
`);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.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 ni={command:`empty`,describe:`Delete multiple Magic static routes.`,builder:ti,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
105
|
+
`);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 ri(e){return e.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 ii={command:`get <route-id>`,describe:`Get a specific Magic static route.`,builder:ri,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.routes.get({account_id:l,route_id:r[`route-id`]})),{successLabel:`Loaded`})})};function ai(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oi={command:`list`,describe:`List all Magic static routes.`,builder:ai,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 n()??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.routes.list({account_id:l})),{successLabel:`Loaded`})})};function si(e){return e.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 ci={command:`update <route-id>`,describe:"Update a specific Magic static route. Use `?validate_only=true` as an optional query parameter to run validation only without persisting changes.",builder:si,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 n()??`<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 t();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`})})},li={command:`routes`,describe:`Static routes that direct IP prefix traffic through specific GRE/IPsec tunnels`,builder:e=>e.command(Xr).command(Qr).command(ei).command(ni).command(ii).command(oi).command(ci).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ui(e){return e.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 di={command:`create <site-id>`,describe:`Creates a new Site ACL.`,builder:ui,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 n()??`<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 t();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 fi(e){return e.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 pi={command:`delete <acl-id>`,describe:`Remove a specific Site ACL.`,builder:fi,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
106
|
+
`);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.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 hi={command:`edit <acl-id>`,describe:`Patch a specific Site ACL.`,builder:mi,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 n()??`<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 t();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 gi(e){return e.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 _i={command:`get <acl-id>`,describe:`Get a specific Site ACL.`,builder:gi,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 n()??`<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 t();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 vi(e){return e.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 yi={command:`list`,describe:`Lists Site ACLs associated with an account.`,builder:vi,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.acls.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function bi(e){return e.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 xi={command:`update <acl-id>`,describe:`Update a specific Site ACL.`,builder:bi,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 n()??`<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 t();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`})})},Si={command:`acls`,describe:`Operations for sites.acls`,builder:e=>e.command(di).command(pi).command(hi).command(_i).command(yi).command(xi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ci(e){return e.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 wi={command:`create <site-id>`,describe:`Creates a new App Config for a site`,builder:Ci,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 n()??`<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 t();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 Ti(e){return e.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 Ei={command:`delete <app-config-id>`,describe:`Deletes specific App Config associated with a site.`,builder:Ti,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
107
|
+
`);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.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:`edit <app-config-id>`,describe:`Updates an App Config for a site`,builder:Di,handler:async r=>c({command:`magic-transit sites app-configuration edit`,classification:{safeFlags:[`breakout`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit sites app-configuration edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.appConfiguration.edit({body: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.edit({body:d,account_id:l,site_id:r[`site-id`],app_config_id:r[`app-config-id`]})),{successLabel:`Updated`})})};function ki(e){return e.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 Ai={command:`list`,describe:`Lists App Configs associated with a site.`,builder:ki,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.appConfiguration.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function ji(e){return e.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 Mi={command:`update <app-config-id>`,describe:`Updates an App Config for a site`,builder:ji,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 n()??`<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 t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.sites.appConfiguration.update({body: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({body:d,account_id:l,site_id:r[`site-id`],app_config_id:r[`app-config-id`]})),{successLabel:`Updated`})})},Ni={command:`app-configuration`,describe:`Operations for sites.app-configuration`,builder:e=>e.command(wi).command(Ei).command(Oi).command(Ai).command(Mi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pi(e){return e.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:`create`,describe:`Creates a new Site`,builder:Pi,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 n()??`<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 t();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 Ii(e){return e.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 Li={command:`delete <site-id>`,describe:`Remove a specific Site.`,builder:Ii,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
108
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.delete({account_id:l,site_id:r[`site-id`]})),{successLabel:`Deleted`})})};function Ri(e){return e.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 zi={command:`edit <site-id>`,describe:`Patch a specific Site.`,builder:Ri,handler:async r=>c({command:`magic-transit sites edit`,classification:{safeFlags:[`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 n()??`<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`),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 t();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`),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 Bi(e){return e.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 Vi={command:`get <site-id>`,describe:`Get a specific Site.`,builder:Bi,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 n()??`<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 t();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 Hi(e){return e.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 Ui={command:`create <site-id>`,describe:`Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address.`,builder:Hi,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 n()??`<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 t();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 Wi(e){return e.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 Gi={command:`delete <lan-id>`,describe:`Remove a specific Site LAN.`,builder:Wi,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
109
|
+
`);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 Ki(e){return e.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 qi={command:`edit <lan-id>`,describe:`Patch a specific Site LAN.`,builder:Ki,handler:async r=>c({command:`magic-transit sites lans edit`,classification:{safeFlags:[`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 n()??`<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`],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 t();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`],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 Ji(e){return e.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 Yi={command:`get <lan-id>`,describe:`Get a specific Site LAN.`,builder:Ji,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 n()??`<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 t();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 Xi(e){return e.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 Zi={command:`list`,describe:`Lists Site LANs associated with an account.`,builder:Xi,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.lans.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function Qi(e){return e.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 $i={command:`update <lan-id>`,describe:`Update a specific Site LAN.`,builder:Qi,handler:async r=>c({command:`magic-transit sites lans update`,classification:{safeFlags:[`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 n()??`<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`],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 t();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`],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`})})},ea={command:`lans`,describe:`Operations for sites.lans`,builder:e=>e.command(Ui).command(Gi).command(qi).command(Yi).command(Zi).command($i).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ta(e){return e.option(`connectorid`,{type:`string`,description:`Identifier`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const na={command:`list`,describe:`Lists Sites associated with an account. Use connectorid query param to return sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID.`,builder:ta,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 n()??`<account-id>`}/magic/sites`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.sites.list({account_id:u,...c})),{successLabel:`Loaded`})})};function ra(e){return e.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:`create <site-id>`,describe:`Creates a NetFlow configuration for a site.`,builder:ra,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 n()??`<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 t();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 aa(e){return e.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 oa={command:`delete <site-id>`,describe:`Remove NetFlow configuration for a site.`,builder:aa,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
110
|
+
`);return}a(await s(`Deleting`,async()=>c.magicTransit.sites.netflowConfig.delete({account_id:l,site_id:r[`site-id`]})),{successLabel:`Deleted`})})};function sa(e){return e.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:`edit <site-id>`,describe:`Updates NetFlow configuration for a site.`,builder:sa,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 n()??`<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 t();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 la(e){return e.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 ua={command:`get <site-id>`,describe:`Get NetFlow configuration for a site.`,builder:la,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.netflowConfig.get({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function da(e){return e.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 fa={command:`update <site-id>`,describe:`Updates NetFlow configuration for a site (partial update).`,builder:da,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 n()??`<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 t();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`})})},pa={command:`netflow-config`,describe:`Operations for sites.netflow-config`,builder:e=>e.command(ia).command(oa).command(ca).command(ua).command(fa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ma(e){return e.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 ha={command:`update <site-id>`,describe:`Update a specific Site.`,builder:ma,handler:async r=>c({command:`magic-transit sites update`,classification:{safeFlags:[`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 n()??`<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`),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 t();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`),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 ga(e){return e.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 _a={command:`create <site-id>`,describe:`Creates a new Site WAN.`,builder:ga,handler:async r=>c({command:`magic-transit sites wans create`,classification:{safeFlags:[`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 n()??`<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({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 t();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({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 va(e){return e.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 ya={command:`delete <wan-id>`,describe:`Remove a specific Site WAN.`,builder:va,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 n()??`<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 t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
111
|
+
`);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 ba(e){return e.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 xa={command:`edit <wan-id>`,describe:`Patch a specific Site WAN.`,builder:ba,handler:async r=>c({command:`magic-transit sites wans edit`,classification:{safeFlags:[`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 n()??`<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({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 t();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({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 Sa(e){return e.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 Ca={command:`get <wan-id>`,describe:`Get a specific Site WAN.`,builder:Sa,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 n()??`<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 t();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 wa(e){return e.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 Ta={command:`list`,describe:`Lists Site WANs associated with an account.`,builder:wa,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 n()??`<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 t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.sites.wans.list({account_id:l,site_id:r[`site-id`]})),{successLabel:`Loaded`})})};function Ea(e){return e.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 Da={command:`update <wan-id>`,describe:`Update a specific Site WAN.`,builder:Ea,handler:async r=>c({command:`magic-transit sites wans update`,classification:{safeFlags:[`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 n()??`<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({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 t();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({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`})})},Oa={command:`wans`,describe:`Operations for sites.wans`,builder:e=>e.command(_a).command(ya).command(xa).command(Ca).command(Ta).command(Da).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ka={command:`sites`,describe:`Magic WAN branch sites — base CRUD, LAN/WAN interface configuration, ACLs, connectors, app configuration, and NetFlow config`,builder:e=>e.command(Fi).command(Li).command(zi).command(Vi).command(na).command(ha).command(Si).command(Ni).command(ea).command(pa).command(Oa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Aa={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(Yt).command(sn).command(fn).command(xn).command(Bn).command($n).command(gr).command(Lr).command(Jr).command(li).command(ka).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Aa as default};
|