cf 1.0.0-beta.11 → 1.0.0-beta.13

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.
Files changed (448) hide show
  1. package/bin/cf +1 -1
  2. package/dist/_meta/commands.json +3119 -2067
  3. package/dist/_meta/hand-written-commands.json +14 -1
  4. package/dist/_meta/schemas.json +1856 -1132
  5. package/dist/abuse-reports-BjU1s8cf.mjs +24 -0
  6. package/dist/{access-DuHs0Mii.mjs → access-C_G2MZnA.mjs} +1 -1
  7. package/dist/account-tags-CaXDDeZ4.mjs +15 -0
  8. package/dist/accounts-BALwxDQY.mjs +131 -0
  9. package/dist/{acm-BgSr3Ig4.mjs → acm-CP9EaXQN.mjs} +7 -7
  10. package/dist/addressing-DRlaxqrI.mjs +93 -0
  11. package/dist/agent-context-DFEgYjEQ.mjs +2 -0
  12. package/dist/agent-memory-vGhlfZBx.mjs +34 -0
  13. package/dist/ai-CJtbWfB9.mjs +31 -0
  14. package/dist/{ai-audit-Bn_BfMFS.mjs → ai-audit-C0BJNqZZ.mjs} +3 -3
  15. package/dist/ai-gateway-BQtv3U3x.mjs +80 -0
  16. package/dist/ai-search-DGU1Y5By.mjs +79 -0
  17. package/dist/ai-security-CFTaYk_X.mjs +10 -0
  18. package/dist/alerting-1hun27JC.mjs +56 -0
  19. package/dist/analytics-DXUSjvzT.mjs +17 -0
  20. package/dist/analytics_engine-CQsnL09C.mjs +4 -0
  21. package/dist/ansi-styles-kSC6bEIq.mjs +2 -0
  22. package/dist/{api-security-gB1FHrHq.mjs → api-security-BXhrfR6-.mjs} +57 -57
  23. package/dist/argo-LPUCTnee.mjs +14 -0
  24. package/dist/artifacts-Dt6easua.mjs +43 -0
  25. package/dist/{audit-logs-CpPUjMUP.mjs → audit-logs-CVznAM2Z.mjs} +2 -2
  26. package/dist/auth-CGLsxbc6.mjs +2 -0
  27. package/dist/auth-CrmVwfpJ.mjs +2 -0
  28. package/dist/{auth-7Fk7PVIC.mjs → auth-eQr-kQCH.mjs} +1 -1
  29. package/dist/{auth-token-DeG33BMQ.mjs → auth-token-pNQrX_9O.mjs} +1 -1
  30. package/dist/autoconfig-sD7Frryg.mjs +532 -0
  31. package/dist/{banner-Xk4xBN8U.mjs → banner-D03JEqRs.mjs} +1 -1
  32. package/dist/basin-catalog-ZQICw-zF.mjs +46 -0
  33. package/dist/billing-Dy1-dV_B.mjs +23 -0
  34. package/dist/bot-management-DTgPwL7O.mjs +9 -0
  35. package/dist/botnet-feed-xb98Cj3Y.mjs +11 -0
  36. package/dist/brand-protection-Ck3okE2k.mjs +27 -0
  37. package/dist/browser-run-DJGJSzFX.mjs +42 -0
  38. package/dist/build-B1L6xrgC.mjs +2 -0
  39. package/dist/build-HmSXqjGn.mjs +2 -0
  40. package/dist/builds-CYxcZtkG.mjs +71 -0
  41. package/dist/cache-D9tSfovH.mjs +45 -0
  42. package/dist/{certificate-authorities-NUQzCDK8.mjs → certificate-authorities-CpiveTFC.mjs} +3 -3
  43. package/dist/cf-BxsXrVeh.mjs +18 -0
  44. package/dist/chunk-DSGVRFIS-C1_SEtRK.mjs +2 -0
  45. package/dist/chunk-NDZDTP46-Bjx_wtJe.mjs +361 -0
  46. package/dist/chunk-TAK63GWY-DdMktrgc.mjs +319 -0
  47. package/dist/chunk-U6NEESU5-DqqRCaWH.mjs +2 -0
  48. package/dist/chunk-WMOON6TZ-C0dmPHpM.mjs +2 -0
  49. package/dist/{cli-aChy8ou_.mjs → cli-DeJc9U8z.mjs} +1 -1
  50. package/dist/cli-exit-CstFZ1eJ.mjs +2 -0
  51. package/dist/{client-certificates-qgLpBn8t.mjs → client-certificates-CF6YZyvP.mjs} +6 -6
  52. package/dist/{client-side-security-DZO6Xw14.mjs → client-side-security-BLoe9kS5.mjs} +14 -14
  53. package/dist/{cloud-connector-C7vGDCzX.mjs → cloud-connector-DXRUHsjt.mjs} +3 -3
  54. package/dist/cloudflared--1Ws1RJy.mjs +2 -0
  55. package/dist/cloudforce-one-CBLxXi6v.mjs +447 -0
  56. package/dist/{command-07vhr56i.mjs → command-83uVfXh9.mjs} +1 -1
  57. package/dist/{command-Cdx___59.mjs → command-BDe67N_n.mjs} +1 -1
  58. package/dist/command-BlIb6RR2.mjs +2 -0
  59. package/dist/{command-dAYWrB5y.mjs → command-Bpzp8Mz2.mjs} +1 -1
  60. package/dist/{command-eM48o0J6.mjs → command-BvfKhMl7.mjs} +1 -1
  61. package/dist/command-CG6RvZs0.mjs +2 -0
  62. package/dist/{command-D0MKPucK.mjs → command-CcuLC6CJ.mjs} +1 -1
  63. package/dist/{command-Ds5OVat3.mjs → command-Cu7dcaHT.mjs} +1 -1
  64. package/dist/{command-BsmF3J_l.mjs → command-D3fyhdy-.mjs} +1 -1
  65. package/dist/{command-Dv6YavZa.mjs → command-DUhX8Dcr.mjs} +1 -1
  66. package/dist/{command-maDJWJgu.mjs → command-Dh7RmjFu.mjs} +1 -1
  67. package/dist/{command-C2pNxAeL.mjs → command-DwXiDOeH.mjs} +1 -1
  68. package/dist/{command-CrtDkZNs.mjs → command-UiHLJ8Ji.mjs} +1 -1
  69. package/dist/command-_rqD0hXF.mjs +2 -0
  70. package/dist/{command-B6TpINoN.mjs → command-oNVwyjGB.mjs} +1 -1
  71. package/dist/{completions-D0280hul.mjs → completions-D06AO7A8.mjs} +12 -12
  72. package/dist/connector-interrupts-DelTmNyw.mjs +6 -0
  73. package/dist/connector-telemetry-events-BwxR3G8d.mjs +6 -0
  74. package/dist/connector-telemetry-snapshots-Bqq-hrpJ.mjs +6 -0
  75. package/dist/connectors-D-m3rEpk.mjs +15 -0
  76. package/dist/containers-CVNfEjJs.mjs +78 -0
  77. package/dist/containers-DeoZyeQe.mjs +375 -0
  78. package/dist/{content-scan-BCtWBCqd.mjs → content-scan-W0BNzbQp.mjs} +7 -7
  79. package/dist/{context-CquYYyS3.mjs → context-q7UaYK69.mjs} +2 -2
  80. package/dist/{cps-C8BbnbuD.mjs → cps-BZ6hqRb5.mjs} +3 -3
  81. package/dist/{csamScanner-CsJ9H2fA.mjs → csamScanner-Bo1t3CLh.mjs} +3 -3
  82. package/dist/ct-alerting-E03faC7p.mjs +5 -0
  83. package/dist/{custom-certificates-CA8HqolM.mjs → custom-certificates-CUySSPzi.mjs} +7 -7
  84. package/dist/{custom-csrs-D0P2vWJE.mjs → custom-csrs-gNpWkJPQ.mjs} +5 -5
  85. package/dist/{custom-hostnames-CzYMChbh.mjs → custom-hostnames-abGBAbx7.mjs} +12 -12
  86. package/dist/{custom-nameservers-Cet3oF56.mjs → custom-nameservers-BgNXol1P.mjs} +5 -5
  87. package/dist/{custom-pages-DUkHIaTP.mjs → custom-pages-DMKX3aoD.mjs} +10 -10
  88. package/dist/d1-CE08YqYk.mjs +93 -0
  89. package/dist/{dcv-delegation-BkdRVEAH.mjs → dcv-delegation-B5YUEWu0.mjs} +2 -2
  90. package/dist/delegate.mjs +1 -1
  91. package/dist/deploy-CWNm1-5v.mjs +2 -0
  92. package/dist/deploy-context-Dr6bxNcB.mjs +56 -0
  93. package/dist/deploy-input-Cc0_2QlW.mjs +2 -0
  94. package/dist/{dev-BHkVwAea.mjs → dev-ZA8itQE7.mjs} +2 -2
  95. package/dist/diagnostics-UMbG6m4n.mjs +15 -0
  96. package/dist/dialog-D4Y9ocuF.mjs +2 -0
  97. package/dist/discover-DIDEGKo3.mjs +2 -0
  98. package/dist/discover-P20XeGBF.mjs +2 -0
  99. package/dist/dist-BHEmAAHr.mjs +487 -0
  100. package/dist/dist-uRuGmkMB.mjs +60 -0
  101. package/dist/dls-DIl16mLp.mjs +17 -0
  102. package/dist/{dns-BLNa0GrP.mjs → dns-QUpgljRG.mjs} +63 -63
  103. package/dist/{dns-firewall-ChCvC5rT.mjs → dns-firewall-BZwJXHLj.mjs} +9 -9
  104. package/dist/dot-prop-IITUZ2XW-BnPfnQkb.mjs +2 -0
  105. package/dist/dotenv-DpXaxfho.mjs +4 -0
  106. package/dist/dry-run-DRj2_uV3.mjs +2 -0
  107. package/dist/durable-objects-BCj4ykpU.mjs +6 -0
  108. package/dist/{email-auth-C28s03aI.mjs → email-auth-DlHIYhCk.mjs} +3 -3
  109. package/dist/{email-routing-Ci-xjXIN.mjs → email-routing-UKVS4DYy.mjs} +22 -22
  110. package/dist/email-security-CZjfRIg0.mjs +158 -0
  111. package/dist/{email-sending-kTVAlVKO.mjs → email-sending-Dquc880C.mjs} +22 -22
  112. package/dist/error-sanitization-DE_zSrXw.mjs +2 -0
  113. package/dist/error-sanitization-DOCQ9Ykh.mjs +2 -0
  114. package/dist/fieldExtractors-BbwDRquU.mjs +9 -0
  115. package/dist/{firewall-BND3qSY2.mjs → firewall--mTfDnCJ.mjs} +17 -17
  116. package/dist/flagship-cfoSwwM9.mjs +28 -0
  117. package/dist/{fraud-DgyYv_CC.mjs → fraud-Dcsq3EYK.mjs} +3 -3
  118. package/dist/{generate-VxmGG8BF.mjs → generate-CeeWW3eX.mjs} +1 -1
  119. package/dist/generate-D80-1GnZ.mjs +2 -0
  120. package/dist/{google-tag-gateway-v3p7murv.mjs → google-tag-gateway-DPKSkZQi.mjs} +3 -3
  121. package/dist/gt-3bcLGJ7V.mjs +3 -0
  122. package/dist/{healthchecks-CByb4qYA.mjs → healthchecks-D78hIIBC.mjs} +10 -10
  123. package/dist/{hostnames-3CqeMF5g.mjs → hostnames-sF999-6H.mjs} +5 -5
  124. package/dist/{hyperdrive-CmyYTE-K.mjs → hyperdrive-qWACKfA4.mjs} +10 -10
  125. package/dist/iam-Bvg_PayW.mjs +52 -0
  126. package/dist/images-DI_lEZ4L.mjs +71 -0
  127. package/dist/index.mjs +1 -1
  128. package/dist/init-1w_mcgk3.mjs +43 -0
  129. package/dist/intel-BxElBUMP.mjs +76 -0
  130. package/dist/interactive-BW9T1D1q.mjs +48 -0
  131. package/dist/interactive-DGUWZ2Gk.mjs +2 -0
  132. package/dist/{ips-WWvPwSBc.mjs → ips-DWoaKxi7.mjs} +2 -2
  133. package/dist/k2-tFjaftl-.mjs +11 -0
  134. package/dist/{keyless-certificates-DqILy3t9.mjs → keyless-certificates-BrvxHU4J.mjs} +6 -6
  135. package/dist/keys-DcwTYKRf.mjs +4 -0
  136. package/dist/kv-htXS-7uP.mjs +15 -0
  137. package/dist/{lazy-command--5YpWUVY.mjs → lazy-command-BDiIwpss.mjs} +1 -1
  138. package/dist/{leaked-credential-checks-C0U1oYM5.mjs → leaked-credential-checks-bvGrLOmQ.mjs} +8 -8
  139. package/dist/lifecycle-oud60haK.mjs +2 -0
  140. package/dist/{load-balancers-BJKI9lm7.mjs → load-balancers-BNTUt4yG.mjs} +40 -40
  141. package/dist/local-DlDumOSC.mjs +2 -0
  142. package/dist/{local-rYpzEQb-.mjs → local-DlT72Xpn.mjs} +1 -1
  143. package/dist/{local-runtime-DZTTIe6x.mjs → local-runtime-CokO6qaX.mjs} +1 -1
  144. package/dist/{login-bnylLTit.mjs → login-BGF_I_LT.mjs} +1 -1
  145. package/dist/login-Ccw-mYwT.mjs +2 -0
  146. package/dist/logo-matches-tE8LTKgg.mjs +6 -0
  147. package/dist/logos-Bj845Mcw.mjs +7 -0
  148. package/dist/logpush-Cs8JdvKi.mjs +46 -0
  149. package/dist/{logs-c3b3USyS.mjs → logs-C92XZvNu.mjs} +11 -11
  150. package/dist/magic-cloud-networking-hNp5MMw-.mjs +71 -0
  151. package/dist/magic-network-monitoring-68GuWAnv.mjs +36 -0
  152. package/dist/magic-transit-DNd7gu4j.mjs +383 -0
  153. package/dist/managed-defense-B_wCAuFD.mjs +18 -0
  154. package/dist/{managed-transforms-DcYAvqTe.mjs → managed-transforms-DZdxHPOh.mjs} +4 -4
  155. package/dist/{matches-hnU16rSJ.mjs → matches-B65CkflD.mjs} +3 -3
  156. package/dist/mcp-DrJW5ayK.mjs +32 -0
  157. package/dist/mesh-DfVzYTn1.mjs +26 -0
  158. package/dist/metadata-Df5kCWJv.mjs +2 -0
  159. package/dist/{migrate-BNvUWrjy.mjs → migrate-CZNq63Uj.mjs} +1 -1
  160. package/dist/{monetization-Dsqj9DCA.mjs → monetization-BGaI8CMO.mjs} +9 -9
  161. package/dist/mtls-certificates-BsU2emDD.mjs +13 -0
  162. package/dist/network-BEMD8P0U.mjs +50 -0
  163. package/dist/network-interconnects-DMu_fcbo.mjs +68 -0
  164. package/dist/o11y-C1a4gDGF.mjs +93 -0
  165. package/dist/{oauth-CeZ3d_dB.mjs → oauth-Bj5Ne1o8.mjs} +1 -1
  166. package/dist/oauth-clients-p4Etdqy_.mjs +16 -0
  167. package/dist/{oauth-w0fWmrwU.mjs → oauth-mspHHU5U.mjs} +1 -1
  168. package/dist/{oauth-scopes-CxpRD6d7.mjs → oauth-scopes-B2IabFza.mjs} +2 -2
  169. package/dist/open-PCXX3ZDZ-D55O2jpQ.mjs +4 -0
  170. package/dist/{organization-DNieJ1xJ.mjs → organization-CdXt7AVZ.mjs} +16 -16
  171. package/dist/{organizations-BIXPmTy5.mjs → organizations-5S6xEp7T.mjs} +2 -2
  172. package/dist/{origin-ca-certificates-dVJvSIH8.mjs → origin-ca-certificates-_VJAoK1D.mjs} +5 -5
  173. package/dist/{origin-post-quantum-encryption-CO6tDW1t.mjs → origin-post-quantum-encryption-GcldDsT2.mjs} +3 -3
  174. package/dist/{origin-tls-client-auth-DeTY8aN2.mjs → origin-tls-client-auth-DZHld9fA.mjs} +14 -14
  175. package/dist/output-BOe-3AQG.mjs +2 -0
  176. package/dist/{page-rules-DA552Ra4.mjs → page-rules-o1tAMMsD.mjs} +7 -7
  177. package/dist/pages-CmiOhjSl.mjs +54 -0
  178. package/dist/pay-per-crawl-BsnOxGYU.mjs +38 -0
  179. package/dist/pay-per-use-BXWMCSyE.mjs +33 -0
  180. package/dist/pipelines-DWLQC0F6.mjs +44 -0
  181. package/dist/precursor-B6DjBib6.mjs +4 -0
  182. package/dist/previews-dUKEBGSM.mjs +4 -0
  183. package/dist/process-2wmDCy17.mjs +2 -0
  184. package/dist/{progress-TLUEIYE6.mjs → progress-BtkTVcHI.mjs} +1 -1
  185. package/dist/prompt-RlgRrmbm.mjs +3 -0
  186. package/dist/queries-yLwoJRHV.mjs +9 -0
  187. package/dist/queues-CnJRaE1o.mjs +57 -0
  188. package/dist/r2-CuC6-zQX.mjs +128 -0
  189. package/dist/{radar-Bez6k9Dw.mjs → radar-DrQLcbkq.mjs} +150 -150
  190. package/dist/{raw-fetch-DNxNCoeP.mjs → raw-fetch-B4NvWuZD.mjs} +1 -1
  191. package/dist/realtime-CjsnzHxD.mjs +172 -0
  192. package/dist/registrar-BgOsxTnX.mjs +43 -0
  193. package/dist/registrar-sandbox-3ikBD9fB.mjs +56 -0
  194. package/dist/{registry-CsSLAAOE.mjs → registry-CHowrQsZ.mjs} +1 -1
  195. package/dist/reporting-hE127s5r.mjs +14 -0
  196. package/dist/request-headers-DiJeDAn1.mjs +2 -0
  197. package/dist/request-tracers-BCwLxmPN.mjs +4 -0
  198. package/dist/resolve-CaTBV-c6.mjs +2 -0
  199. package/dist/resolve-DCGSzUDQ.mjs +2 -0
  200. package/dist/resource-sharing-2qvWUuMa.mjs +40 -0
  201. package/dist/resource-tagging-Dwx7iL3v.mjs +4 -0
  202. package/dist/rules-DxVQ6jIg.mjs +18 -0
  203. package/dist/rulesets-Cdh8YjI9.mjs +37 -0
  204. package/dist/rum-a4CMq4Qu.mjs +30 -0
  205. package/dist/run-BvHwWWUX.mjs +2 -0
  206. package/dist/run-CkbrPJPx.mjs +2 -0
  207. package/dist/schema-elj12WOx.mjs +2 -0
  208. package/dist/schema-flags-BzoBGPWk.mjs +5 -0
  209. package/dist/scim-B8XlXl8v.mjs +18 -0
  210. package/dist/secrets-store-Cqhedh_i.mjs +24 -0
  211. package/dist/{security-insights-DVAqroY5.mjs → security-insights-le2-DteL.mjs} +20 -20
  212. package/dist/{security-txt-rfrrdiZV.mjs → security-txt-cCArWXur.mjs} +4 -4
  213. package/dist/{session-B6mFkaVZ.mjs → session-C1BhT1ZJ.mjs} +1 -1
  214. package/dist/shared-BPjcpXuA.mjs +2 -0
  215. package/dist/{smart-shield-_HA814Im.mjs → smart-shield-Csyh8hwB.mjs} +11 -11
  216. package/dist/{snippets-mRelEw0p.mjs → snippets-DUWx25q6.mjs} +8 -8
  217. package/dist/source-mXUcrTVw.mjs +6 -0
  218. package/dist/spawn-IysxuTNW.mjs +10 -0
  219. package/dist/{spectrum-BwtOiaDw.mjs → spectrum-Da3UYSOR.mjs} +11 -11
  220. package/dist/{speed-DmqsZtiJ.mjs → speed-NxlMnB2e.mjs} +11 -11
  221. package/dist/sql-CNdHAlQ8.mjs +4 -0
  222. package/dist/src-JfLDUxFr.mjs +125 -0
  223. package/dist/{ssl-DCvfveJB.mjs → ssl-BtaX2WEJ.mjs} +16 -16
  224. package/dist/startup-profile-B2l0ChVu.mjs +2 -0
  225. package/dist/startup-profile-CdJWgNjd.mjs +29 -0
  226. package/dist/{state-BPwdiNO_.mjs → state-BDSvdSdP.mjs} +1 -1
  227. package/dist/state-JB4_BU1o.mjs +2 -0
  228. package/dist/stream-C1Ijjzn4.mjs +102 -0
  229. package/dist/submit-MdkuU_Pt.mjs +4 -0
  230. package/dist/{tags-Djw0e-4j.mjs → tags-CA1xMM96.mjs} +2 -2
  231. package/dist/telemetry-BsYO3nxG.mjs +2 -0
  232. package/dist/{telemetry-DrFNujdx.mjs → telemetry-Cm39QJ-M.mjs} +1 -1
  233. package/dist/{tenant-tc1wb_ym.mjs → tenant-BB6Oszcl.mjs} +5 -5
  234. package/dist/{tenant-custom-nameservers-XCbXryBZ.mjs → tenant-custom-nameservers-BsbgYAEo.mjs} +4 -4
  235. package/dist/{theme-BIWQFmZ0.mjs → theme-CQ_TYifs.mjs} +2 -2
  236. package/dist/{tools-CB4NleeJ.mjs → tools-CSc5DmFi.mjs} +1 -1
  237. package/dist/tunnels-CRFtyHWz.mjs +29 -0
  238. package/dist/turnstile-DBXWo_Xe.mjs +33 -0
  239. package/dist/{ui-D1hhIDIs.mjs → ui-YmjF66Ct.mjs} +1 -1
  240. package/dist/update-check-C2oVEbXx.mjs +2 -0
  241. package/dist/update-check-CMXSdres.mjs +2 -0
  242. package/dist/update-check-worker.mjs +1 -1
  243. package/dist/url-info-t-XAs0Mk.mjs +4 -0
  244. package/dist/{url-normalization-Dbypc9wz.mjs → url-normalization-Cs4F8e0a.mjs} +4 -4
  245. package/dist/url-scanner-CBIoDbTx.mjs +16 -0
  246. package/dist/{user-3uwLMH78.mjs → user-CevdOMoa.mjs} +52 -52
  247. package/dist/values-CjNlkbIh.mjs +4 -0
  248. package/dist/vectorize-9d9tPmg5.mjs +32 -0
  249. package/dist/version-BdVUXLnK.mjs +2 -0
  250. package/dist/waiting-rooms--5WmrWb3.mjs +53 -0
  251. package/dist/{web-assets-BfEprX1S.mjs → web-assets-BHot_MU8.mjs} +30 -30
  252. package/dist/{web3-DNbp5sZw.mjs → web3-CYfWAF6b.mjs} +13 -13
  253. package/dist/workers-S17M0n3h.mjs +40 -0
  254. package/dist/workers-builds-Dw7ho3So.mjs +14 -0
  255. package/dist/workers-for-platforms-A3yjyLh3.mjs +40 -0
  256. package/dist/{workers-vpc-LVfayM2-.mjs → workers-vpc-BZ2xXtC3.mjs} +7 -7
  257. package/dist/workflows-BgGrVpSR.mjs +43 -0
  258. package/dist/{wrangler-migration-B0mKHqGd.mjs → wrangler-migration-C6FKHER1.mjs} +1 -1
  259. package/dist/{zaraz-BY60ZUQ4.mjs → zaraz-BsD2dMI3.mjs} +11 -11
  260. package/dist/zero-trust-CA3iGQbG.mjs +837 -0
  261. package/dist/{zone-BVDW2UGd.mjs → zone-D2M4EZD0.mjs} +2 -2
  262. package/dist/{zones-CcZL0YQp.mjs → zones-BoOC_JzC.mjs} +43 -43
  263. package/package.json +33 -35
  264. package/dist/abuse-reports-DX5xgeka.mjs +0 -24
  265. package/dist/account-tags-CiKwgOWd.mjs +0 -15
  266. package/dist/accounts-DfXSHrkF.mjs +0 -138
  267. package/dist/addressing-B70NFnrX.mjs +0 -93
  268. package/dist/agent-context-GRiQ4zRU.mjs +0 -2
  269. package/dist/agent-memory-DJRquHeq.mjs +0 -34
  270. package/dist/ai-CP2oIS-I.mjs +0 -29
  271. package/dist/ai-gateway-CrrEtzUP.mjs +0 -82
  272. package/dist/ai-search-C4YWVTCa.mjs +0 -79
  273. package/dist/ai-security-Bt_fG65f.mjs +0 -10
  274. package/dist/alerting-CRr88fVR.mjs +0 -56
  275. package/dist/analytics-XqS9OP5B.mjs +0 -20
  276. package/dist/analytics_engine-CzmYem4f.mjs +0 -4
  277. package/dist/ansi-styles-eKEZXVwN.mjs +0 -2
  278. package/dist/argo-wFCAsYx7.mjs +0 -10
  279. package/dist/artifacts-qFjlNRqb.mjs +0 -43
  280. package/dist/auth-BmJ946bE.mjs +0 -2
  281. package/dist/auth-Br-t8vL_.mjs +0 -2
  282. package/dist/autoconfig-D-copdZG.mjs +0 -511
  283. package/dist/basin-catalog-CshcpsAH.mjs +0 -46
  284. package/dist/billing-B-xNxxiP.mjs +0 -23
  285. package/dist/bot-management-DhafeA2J.mjs +0 -9
  286. package/dist/botnet-feed-D6uCLE_D.mjs +0 -11
  287. package/dist/brand-protection-c3WiHbYn.mjs +0 -27
  288. package/dist/browser-run-D9_cwaSD.mjs +0 -46
  289. package/dist/build-9ihDp-Gy.mjs +0 -2
  290. package/dist/build-DrG6TqMw.mjs +0 -2
  291. package/dist/builds-Dl8if-2k.mjs +0 -71
  292. package/dist/cache-CIZokBjd.mjs +0 -45
  293. package/dist/cf-DfQfIu3q.mjs +0 -18
  294. package/dist/chunk-FT2NMTJB-BFqlGcem.mjs +0 -97
  295. package/dist/chunk-KKDV4JPS-B_t8sDTz.mjs +0 -2
  296. package/dist/chunk-U6NEESU5-BhF4rnpx.mjs +0 -2
  297. package/dist/chunk-WMOON6TZ-B8xCqjB1.mjs +0 -2
  298. package/dist/cli-exit-Dqoo6Jgb.mjs +0 -2
  299. package/dist/cloudflared-CEfZhSQH.mjs +0 -2
  300. package/dist/cloudforce-one-CE7y5UkF.mjs +0 -447
  301. package/dist/command-BWC9CbE7.mjs +0 -2
  302. package/dist/command-C65Ed0o9.mjs +0 -2
  303. package/dist/command-DHdWKtqx.mjs +0 -2
  304. package/dist/connector-interrupts-CVjFhU-C.mjs +0 -6
  305. package/dist/connector-telemetry-events-Bu3LKP6T.mjs +0 -6
  306. package/dist/connector-telemetry-snapshots-BbDTIc06.mjs +0 -6
  307. package/dist/connectors-DGtx-rPI.mjs +0 -15
  308. package/dist/containers-CzNbBrYE.mjs +0 -239
  309. package/dist/containers-DEFrbNgO.mjs +0 -78
  310. package/dist/ct-alerting-CYsQZO2H.mjs +0 -5
  311. package/dist/d1-B2duXfH2.mjs +0 -41
  312. package/dist/deploy-BdWBEbLj.mjs +0 -2
  313. package/dist/deploy-input-LmLfj6kI.mjs +0 -2
  314. package/dist/diagnostics-9Wj5UWBL.mjs +0 -15
  315. package/dist/dialog-Dpi-UVbz.mjs +0 -2
  316. package/dist/discover-BYkHr5Ja.mjs +0 -2
  317. package/dist/discover-t6E9lpf3.mjs +0 -2
  318. package/dist/dist-Cpb7_h4N.mjs +0 -57
  319. package/dist/dist-D1iG7guo.mjs +0 -366
  320. package/dist/dist-zep5OXGt.mjs +0 -48
  321. package/dist/dls-Caya7FZc.mjs +0 -17
  322. package/dist/dot-prop-IITUZ2XW-BsZYdILY.mjs +0 -2
  323. package/dist/dotenv-CcQjGlV0.mjs +0 -4
  324. package/dist/dry-run-p9Q7nMZ5.mjs +0 -2
  325. package/dist/durable-objects-DuRbdp7N.mjs +0 -6
  326. package/dist/email-security-DPU6xvI9.mjs +0 -158
  327. package/dist/error-sanitization-BbEw--0B.mjs +0 -2
  328. package/dist/error-sanitization-p5rmb53x.mjs +0 -2
  329. package/dist/fieldExtractors-ceaXu4zD.mjs +0 -9
  330. package/dist/flagship-DfxbNzgx.mjs +0 -28
  331. package/dist/generate-9P8Q_RiO.mjs +0 -2
  332. package/dist/gt-KlYHH-UC.mjs +0 -2
  333. package/dist/iam-CV_M681j.mjs +0 -52
  334. package/dist/images-DaLPjskW.mjs +0 -71
  335. package/dist/init-CBKifk5L.mjs +0 -39
  336. package/dist/intel-MpftjuPB.mjs +0 -76
  337. package/dist/interactive-D80kbTap.mjs +0 -32
  338. package/dist/interactive-mJQ_IrGd.mjs +0 -2
  339. package/dist/k2-D0QYUFqT.mjs +0 -13
  340. package/dist/keys-DhX4AcqF.mjs +0 -4
  341. package/dist/kv-DLUfUL0_.mjs +0 -15
  342. package/dist/lifecycle-Cyc3fmyN.mjs +0 -2
  343. package/dist/local-DkYQiSQQ.mjs +0 -2
  344. package/dist/login-CnE2Ii_F.mjs +0 -2
  345. package/dist/logo-matches-DFZybI0C.mjs +0 -6
  346. package/dist/logos-Da2YtqSN.mjs +0 -7
  347. package/dist/logpush-Q7WIEHS1.mjs +0 -46
  348. package/dist/magic-cloud-networking-BoyDmFq3.mjs +0 -71
  349. package/dist/magic-network-monitoring-BkUbpMUp.mjs +0 -36
  350. package/dist/magic-transit-4-THD45G.mjs +0 -383
  351. package/dist/managed-defense-CTMqSp6z.mjs +0 -18
  352. package/dist/mcp-kZX4irfN.mjs +0 -32
  353. package/dist/mesh-Dxzvvso6.mjs +0 -26
  354. package/dist/metadata-C33s4rc-.mjs +0 -2
  355. package/dist/mtls-certificates-BSbMwIna.mjs +0 -13
  356. package/dist/network-interconnects-osO_vAPu.mjs +0 -73
  357. package/dist/network-mEnXTEiG.mjs +0 -50
  358. package/dist/oauth-clients-CWPHi-Yn.mjs +0 -16
  359. package/dist/observability-BxL2RqWZ.mjs +0 -80
  360. package/dist/open-PCXX3ZDZ-C7gpxSsl.mjs +0 -4
  361. package/dist/output-ClYel9WX.mjs +0 -2
  362. package/dist/pages-B0x7tidm.mjs +0 -54
  363. package/dist/pay-per-crawl-DoTg9VP7.mjs +0 -65
  364. package/dist/pay-per-use-yRO2QBfe.mjs +0 -6
  365. package/dist/pipelines-CQxrm9ao.mjs +0 -44
  366. package/dist/precursor-FiGYDRV9.mjs +0 -4
  367. package/dist/previews-BthBa50j.mjs +0 -4
  368. package/dist/prompt-Ck_1PCHm.mjs +0 -3
  369. package/dist/queries-C0RRdol7.mjs +0 -9
  370. package/dist/queues-sLgvjsRP.mjs +0 -57
  371. package/dist/r2-C2PllL6i.mjs +0 -125
  372. package/dist/realtime-D-HSXznX.mjs +0 -172
  373. package/dist/registrar-DwHrG9QR.mjs +0 -43
  374. package/dist/registrar-sandbox-jNukmzQP.mjs +0 -56
  375. package/dist/reporting-DolhAb10.mjs +0 -14
  376. package/dist/request-headers-Lhj314mk.mjs +0 -2
  377. package/dist/request-tracers-w72hKc33.mjs +0 -4
  378. package/dist/resolve-CGKqk7q8.mjs +0 -2
  379. package/dist/resolve-Djf2xgBx.mjs +0 -2
  380. package/dist/resource-sharing-DTrSkqI4.mjs +0 -40
  381. package/dist/resource-tagging-aURR4fIJ.mjs +0 -4
  382. package/dist/rules-C8a7cV-W.mjs +0 -18
  383. package/dist/rulesets-RJ6yBefy.mjs +0 -37
  384. package/dist/rum-Bk1dPW4p.mjs +0 -30
  385. package/dist/run-BJOAPmsz.mjs +0 -2
  386. package/dist/run-iFM5TxtQ.mjs +0 -2
  387. package/dist/schema-flags-PagOq-G2.mjs +0 -5
  388. package/dist/schema-v7mOxMdx.mjs +0 -2
  389. package/dist/scim-C0FmjkkV.mjs +0 -18
  390. package/dist/secrets-store-cG_5RMzK.mjs +0 -24
  391. package/dist/shared-BqsWoApw.mjs +0 -2
  392. package/dist/source-38bULAR8.mjs +0 -6
  393. package/dist/spawn-BzPhcLJI.mjs +0 -10
  394. package/dist/src--KDGqL5N.mjs +0 -109
  395. package/dist/startup-profile-BCe9k9sR.mjs +0 -17
  396. package/dist/startup-profile-WrwRyMwH.mjs +0 -2
  397. package/dist/state-a1tTOGjm.mjs +0 -2
  398. package/dist/stream-aroClJeD.mjs +0 -102
  399. package/dist/submit-BBKhoKT8.mjs +0 -4
  400. package/dist/telemetry-DoBQOGRk.mjs +0 -2
  401. package/dist/tunnels-C2FTswb6.mjs +0 -29
  402. package/dist/turnstile-BV4Mdd-j.mjs +0 -33
  403. package/dist/update-check-CFt6cMOi.mjs +0 -2
  404. package/dist/update-check-Dtj9fzNe.mjs +0 -2
  405. package/dist/url-info-CeegsDK7.mjs +0 -4
  406. package/dist/url-scanner-BFXMrpJF.mjs +0 -16
  407. package/dist/values-BTncDc3U.mjs +0 -4
  408. package/dist/vectorize-CtMAtx8r.mjs +0 -32
  409. package/dist/version-oN1bmOgM.mjs +0 -2
  410. package/dist/waiting-rooms-1xDvjF13.mjs +0 -53
  411. package/dist/workers-DK_JgS4Y.mjs +0 -38
  412. package/dist/workers-builds-CdhwmmsQ.mjs +0 -14
  413. package/dist/workers-for-platforms-CP6IqxrK.mjs +0 -42
  414. package/dist/workflows-CA5K8FFb.mjs +0 -43
  415. package/dist/zero-trust-CQNohO7_.mjs +0 -821
  416. /package/dist/{Page-DAgOEX17.mjs → Page-BShsqCXr.mjs} +0 -0
  417. /package/dist/{alerts-D3iKtzoN.mjs → alerts-BSON-vFh.mjs} +0 -0
  418. /package/dist/{args-CXgkQKK7.mjs → args-CfbYkeXd.mjs} +0 -0
  419. /package/dist/{autorag-pvRfDwne.mjs → autorag-kNrLiqDX.mjs} +0 -0
  420. /package/dist/{body-parser-NjzJZMOV.mjs → body-parser-DkHKPkJ7.mjs} +0 -0
  421. /package/dist/{brands-DP5Ndir1.mjs → brands-bBJgbbOH.mjs} +0 -0
  422. /package/dist/{browser-extension-Dee2Y1qn.mjs → browser-extension-C1_fcw7h.mjs} +0 -0
  423. /package/dist/{clear-qLKPlJqb.mjs → clear-BW9vLgI3.mjs} +0 -0
  424. /package/dist/{cli-types-_Kmwfpnp.mjs → cli-types-9oYmRTHJ.mjs} +0 -0
  425. /package/dist/{connector-telemetry-events-latest-_aCmWeZx.mjs → connector-telemetry-events-latest-BQdOvbWh.mjs} +0 -0
  426. /package/dist/{connector-telemetry-snapshots-latest-CffEplpV.mjs → connector-telemetry-snapshots-latest-CtdN_dGu.mjs} +0 -0
  427. /package/dist/{delegate-CCGgla7X.mjs → delegate-Tgfxa-MZ.mjs} +0 -0
  428. /package/dist/{domain-info-BQh9XapD.mjs → domain-info-BkcBcyfF.mjs} +0 -0
  429. /package/dist/{errors-cuuW88wR.mjs → errors-_sob7Ihu.mjs} +0 -0
  430. /package/dist/{health--10IShMi.mjs → health-CTaCeVyC.mjs} +0 -0
  431. /package/dist/{input-validation-0CeePPHp.mjs → input-validation-D7z60HJH.mjs} +0 -0
  432. /package/dist/{internal-BUs583vv.mjs → internal-BYS7hO8c.mjs} +0 -0
  433. /package/dist/{live-VCSxA0N9.mjs → live-BJE_YWE1.mjs} +0 -0
  434. /package/dist/{project-settings-Bf6rReo1.mjs → project-settings-nBMEx1f-.mjs} +0 -0
  435. /package/dist/{r2-data-catalog-Bg7zq1IB.mjs → r2-data-catalog-BRo-Rx2I.mjs} +0 -0
  436. /package/dist/{rate-limit-analytics-D3q0mGv2.mjs → rate-limit-analytics-BiRyU0Xd.mjs} +0 -0
  437. /package/dist/{rate-limits-BIxlBuMn.mjs → rate-limits-Cr2zpncO.mjs} +0 -0
  438. /package/dist/{ready-CAgelFmC.mjs → ready-B3pLxnjc.mjs} +0 -0
  439. /package/dist/{recent-submissions-B3TOjNmk.mjs → recent-submissions-JLOvuZq-.mjs} +0 -0
  440. /package/dist/{refute-BZNkFpBB.mjs → refute-Dp3VodMn.mjs} +0 -0
  441. /package/dist/{scan-logo-StecHiaf.mjs → scan-logo-3Zr6CDJB.mjs} +0 -0
  442. /package/dist/{scan-page-B4adr-vD.mjs → scan-page-CxeudOzj.mjs} +0 -0
  443. /package/dist/{search-Devngw4M.mjs → search-B_P5ZTQj.mjs} +0 -0
  444. /package/dist/{signed-url-ChR5eXXd.mjs → signed-url-D5RwvrQq.mjs} +0 -0
  445. /package/dist/{submission-info-BGb81HZN.mjs → submission-info-_t78q2OE.mjs} +0 -0
  446. /package/dist/{total-queries-_wa6KxEl.mjs → total-queries-CPrKEciQ.mjs} +0 -0
  447. /package/dist/{tracked-domains-BesKGqfI.mjs → tracked-domains-CTRItgFT.mjs} +0 -0
  448. /package/dist/{verify-CYM5GlPu.mjs → verify-5KcvRk-q.mjs} +0 -0
@@ -0,0 +1,383 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-DlT72Xpn.mjs";import{i as t,n}from"./auth-CGLsxbc6.mjs";import{a as r,t as i}from"./context-q7UaYK69.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-BtkTVcHI.mjs";import{t as c}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-DkHKPkJ7.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-RlgRrmbm.mjs";import{n as _,t as v}from"./raw-fetch-B4NvWuZD.mjs";function ee(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules create
3
+
4
+ Create a DNS Protection rule for an account.`).option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const te={command:`create`,describe:`Create DNS Protection rule.`,builder:ee,handler:async t=>c({command:`magic-transit advanced-dns-protection configs dns protection rules create`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({block_any_queries:t[`block-any-queries`],burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(t.name,`name`,`text`),profile_sensitivity:p(t[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(t.scope,`scope`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}t[`burst-sensitivity`]===void 0&&(t[`burst-sensitivity`]=await m(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),t.name===void 0&&(t.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'.`)),t[`profile-sensitivity`]===void 0&&(t[`profile-sensitivity`]=await m(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),t[`rate-sensitivity`]===void 0&&(t[`rate-sensitivity`]=await m(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),t.scope===void 0&&(t.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:t[`block-any-queries`],burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(t.name,`name`,`text`),profile_sensitivity:p(t[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(t.scope,`scope`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function y(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules delete for account
5
+
6
+ Delete all DNS Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`account`,describe:`Delete all DNS Protection rules.`,builder:y,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
7
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.for.account({account_id:l}));a(u,{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.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules delete protection rule <rule-id>
8
+
9
+ Delete a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`rule <rule-id>`,describe:`Delete DNS Protection rule.`,builder:S,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
10
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.protection.rule({account_id:l,rule_id:t[`rule-id`]}));a(u,{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.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules get <rule-id>
11
+
12
+ Get a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <rule-id>`,describe:`Get DNS Protection rule.`,builder:E,handler:async t=>c({command:`magic-transit advanced-dns-protection configs dns protection rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-dns-protection configs dns protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.get({account_id:l,rule_id:t[`rule-id`]}));a(u,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules list
13
+
14
+ List all DNS Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List all DNS Protection rules.`,builder:O,handler:async t=>c({command:`magic-transit advanced-dns-protection configs dns protection rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-dns-protection configs dns protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function A(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules update <rule-id>
15
+
16
+ Update a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to update.`,demandOption:!0}).option(`block-any-queries`,{type:`boolean`,description:`The new value for whether to block DNS ANY queries. Optional.`}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`profile-sensitivity`,{type:`string`,description:`The new profile sensitivity. Optional. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the DNS Protection rule.`})}const j={command:`update <rule-id>`,describe:`Update DNS Protection rule.`,builder:A,handler:async t=>c({command:`magic-transit advanced-dns-protection configs dns protection rules update`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-dns-protection configs dns protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({block_any_queries:t[`block-any-queries`],burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:p(t[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...e,account_id:l,rule_id:t[`rule-id`]}));a(n,{successLabel:`Updated`});return}let d=f({block_any_queries:t[`block-any-queries`],burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:p(t[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...d,account_id:l,rule_id:t[`rule-id`]}));a(m,{successLabel:`Updated`})})},M={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(te).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.usage(`$0 magic-transit advanced-tcp-protection configs allowlist create
17
+
18
+ Create an allowlist prefix for an account.`).option(`comment`,{type:`string`,description:`An comment describing the allowlist prefix.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect.`}).option(`prefix`,{type:`string`,description:`The allowlist prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new allowlist prefix to create.`})}const R={command:`create`,describe:`Create allowlist prefix.`,builder:L,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({comment:p(t.comment,`comment`,`text`),enabled:t.enabled,prefix:p(t.prefix,`prefix`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}if(t.comment===void 0&&(t.comment=await m(`comment`,`An comment describing the allowlist prefix.`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.prefix===void 0&&(t.prefix=await m(`prefix`,`The allowlist prefix to add in CIDR format.`));let d=f({comment:p(t.comment,`comment`,`text`),enabled:t.enabled,prefix:p(t.prefix,`prefix`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function z(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix <prefix-id>
19
+
20
+ Delete the allowlist prefix for an account given a UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`prefix <prefix-id>`,describe:`Delete allowlist prefix.`,builder:z,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${t[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(t[`prefix-id`]))}`,pathParams:{"prefix-id":String(t[`prefix-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
21
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.delete.allowlist.prefix({account_id:l,prefix_id:t[`prefix-id`]}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs allowlist delete for account
22
+
23
+ Delete all allowlist prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const U={command:`account`,describe:`Delete all allowlist prefixes.`,builder:H,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
24
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.delete.for.account({account_id:l}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs allowlist get <prefix-id>
25
+
26
+ Get an allowlist prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <prefix-id>`,describe:`Get allowlist prefix.`,builder:K,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${t[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(t[`prefix-id`]))}`,pathParams:{"prefix-id":String(t[`prefix-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.get({account_id:l,prefix_id:t[`prefix-id`]}));a(u,{successLabel:`Loaded`})})};function J(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist list
27
+
28
+ List all allowlist prefixes for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List all allowlist prefixes.`,builder:J,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.allowlist.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function X(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist update <prefix-id>
29
+
30
+ Update an allowlist prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A comment describing the allowlist prefix. Optional.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the allowlist prefix.`})}const Z={command:`update <prefix-id>`,describe:`Update allowlist prefix.`,builder:X,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${t[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(t[`prefix-id`]))}`,pathParams:{"prefix-id":String(t[`prefix-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({comment:p(t.comment,`comment`,`text`),enabled:t.enabled}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.update({...e,account_id:l,prefix_id:t[`prefix-id`]}));a(n,{successLabel:`Updated`});return}let d=f({comment:p(t.comment,`comment`,`text`),enabled:t.enabled}),m=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.update({...d,account_id:l,prefix_id:t[`prefix-id`]}));a(m,{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.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk create
31
+
32
+ Create multiple prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The list of new prefixes to create.`})}const re={command:`create`,describe:`Create multiple prefixes.`,builder:ne,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes bulk create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs prefixes bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/bulk`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.bulk.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}if(t.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.usage(`$0 magic-transit advanced-tcp-protection configs prefixes create
33
+
34
+ Create a prefix for an account.`).option(`comment`,{type:`string`,description:`A comment describing the prefix.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection.`}).option(`prefix`,{type:`string`,description:`The prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new prefix to create.`})}const oe={command:`create`,describe:`Create prefix.`,builder:ae,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes create`,classification:{safeFlags:[`excluded`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({comment:p(t.comment,`comment`,`text`),excluded:t.excluded,prefix:p(t.prefix,`prefix`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}if(t.comment===void 0&&(t.comment=await m(`comment`,`A comment describing the prefix.`)),t.excluded===void 0)throw Error(`--excluded is required (or pass --body with this field set).`);t.prefix===void 0&&(t.prefix=await m(`prefix`,`The prefix to add in CIDR format.`));let d=f({comment:p(t.comment,`comment`,`text`),excluded:t.excluded,prefix:p(t.prefix,`prefix`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.create({body:d,account_id:l}));a(h,{successLabel:`Created`})})};function se(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes delete <prefix-id>
35
+
36
+ Delete the prefix for an account given a UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ce={command:`delete <prefix-id>`,describe:`Delete prefix.`,builder:se,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${t[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(t[`prefix-id`]))}`,pathParams:{"prefix-id":String(t[`prefix-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
37
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.delete({account_id:l,prefix_id:t[`prefix-id`]}));a(u,{successLabel:`Deleted`})})};function le(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes get <prefix-id>
38
+
39
+ Get a prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <prefix-id>`,describe:`Get prefix.`,builder:le,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${t[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(t[`prefix-id`]))}`,pathParams:{"prefix-id":String(t[`prefix-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.get({account_id:l,prefix_id:t[`prefix-id`]}));a(u,{successLabel:`Loaded`})})};function de(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes list
40
+
41
+ List all prefixes for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`List all prefixes.`,builder:de,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.prefixes.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function pe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes update <prefix-id>
42
+
43
+ Update a prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A new comment for the prefix. Optional.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the prefix.`})}const me={command:`update <prefix-id>`,describe:`Update prefix.`,builder:pe,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes update`,classification:{safeFlags:[`excluded`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs prefixes update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes/${t[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(t[`prefix-id`]))}`,pathParams:{"prefix-id":String(t[`prefix-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({comment:p(t.comment,`comment`,`text`),excluded:t.excluded}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.update({...e,account_id:l,prefix_id:t[`prefix-id`]}));a(n,{successLabel:`Updated`});return}let d=f({comment:p(t.comment,`comment`,`text`),excluded:t.excluded}),m=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.update({...d,account_id:l,prefix_id:t[`prefix-id`]}));a(m,{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.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters create
44
+
45
+ Create a SYN Protection filter for an account.`).option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const _e={command:`create`,describe:`Create a SYN Protection filter.`,builder:ge,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({expression:p(t.expression,`expression`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}t.expression===void 0&&(t.expression=await m(`expression`,`The filter expression.`));let d=f({expression:p(t.expression,`expression`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.create({body:d,account_id:l}));a(h,{successLabel:`Created`})})};function ve(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters delete for account
46
+
47
+ Delete all SYN Protection filters for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ye={command:`account`,describe:`Delete all SYN Protection filters.`,builder:ve,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
48
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.delete.for.account({account_id:l}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters delete protection filter <filter-id>
49
+
50
+ Delete a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Se={command:`filter <filter-id>`,describe:`Delete SYN Protection filter.`,builder:xe,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
51
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.delete.protection.filter({account_id:l,filter_id:t[`filter-id`]}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters get <filter-id>
52
+
53
+ Get a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <filter-id>`,describe:`Get SYN Protection filter.`,builder:Te,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.get({account_id:l,filter_id:t[`filter-id`]}));a(u,{successLabel:`Loaded`})})};function De(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters list
54
+
55
+ List all SYN Protection filters for an account.`).option(`filter-mode`,{type:`string`,description:`The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'.`}).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List all SYN Protection filters.`,builder:De,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={mode:t[`filter-mode`],page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.syn.protection.filters.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function ke(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters update <filter-id>
56
+
57
+ Update a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const Ae={command:`update <filter-id>`,describe:`Update SYN Protection filter.`,builder:ke,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection filters update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({expression:p(t.expression,`expression`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.update({body:e,account_id:l,filter_id:t[`filter-id`]}));a(n,{successLabel:`Updated`});return}let d=f({expression:p(t.expression,`expression`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.update({body:d,account_id:l,filter_id:t[`filter-id`]}));a(m,{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.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules create
58
+
59
+ Create a SYN Protection rule for an account.`).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The type of mitigation. Must be one of 'challenge' or 'retransmit'. Optional. Defaults to 'challenge'.`}).option(`name`,{type:`string`,description:`The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new SYN Protection rule to add.`})}const Ne={command:`create`,describe:`Create SYN Protection rule.`,builder:Me,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(t[`mitigation-type`],`mitigation-type`,`text`),name:p(t.name,`name`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(t.scope,`scope`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}t[`burst-sensitivity`]===void 0&&(t[`burst-sensitivity`]=await m(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),t.name===void 0&&(t.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'.`)),t[`rate-sensitivity`]===void 0&&(t[`rate-sensitivity`]=await m(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),t.scope===void 0&&(t.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(t[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(t[`mitigation-type`],`mitigation-type`,`text`),name:p(t.name,`name`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(t.scope,`scope`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function Pe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules delete for account
60
+
61
+ Delete all SYN Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Fe={command:`account`,describe:`Delete all SYN Protection rules.`,builder:Pe,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
62
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.delete.for.account({account_id:l}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules delete protection rule <rule-id>
63
+
64
+ Delete a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Re={command:`rule <rule-id>`,describe:`Delete SYN Protection rule.`,builder:Le,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
65
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.delete.protection.rule({account_id:l,rule_id:t[`rule-id`]}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules get <rule-id>
66
+
67
+ Get a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`get <rule-id>`,describe:`Get SYN Protection rule.`,builder:Ve,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.get({account_id:l,rule_id:t[`rule-id`]}));a(u,{successLabel:`Loaded`})})};function Ue(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules list
68
+
69
+ List all SYN Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`list`,describe:`List all SYN Protection rules.`,builder:Ue,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.syn.protection.rules.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function Ge(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules update <rule-id>
70
+
71
+ Update a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The new mitigation type. Optional. Must be one of 'challenge' or 'retransmit'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The fields to update on the SYN Protection rule.`})}const Ke={command:`update <rule-id>`,describe:`Update SYN Protection rule.`,builder:Ge,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs syn protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(t[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.update({...e,account_id:l,rule_id:t[`rule-id`]}));a(n,{successLabel:`Updated`});return}let d=f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),mitigation_type:p(t[`mitigation-type`],`mitigation-type`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.update({...d,account_id:l,rule_id:t[`rule-id`]}));a(m,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters create
72
+
73
+ Create a TCP Flow Protection filter for an account.`).option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const Ze={command:`create`,describe:`Create a TCP Flow Protection filter.`,builder:Xe,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({expression:p(t.expression,`expression`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}t.expression===void 0&&(t.expression=await m(`expression`,`The filter expression.`));let d=f({expression:p(t.expression,`expression`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.create({body:d,account_id:l}));a(h,{successLabel:`Created`})})};function Qe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters delete for account
74
+
75
+ Delete all TCP Flow Protection filters for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const $e={command:`account`,describe:`Delete all TCP Flow Protection filters.`,builder:Qe,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
76
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.delete.for.account({account_id:l}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters delete protection filter <filter-id>
77
+
78
+ Delete a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const nt={command:`filter <filter-id>`,describe:`Delete TCP Flow Protection filter.`,builder:tt,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
79
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.delete.protection.filter({account_id:l,filter_id:t[`filter-id`]}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters get <filter-id>
80
+
81
+ Get a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`get <filter-id>`,describe:`Get TCP Flow Protection filter.`,builder:at,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.get({account_id:l,filter_id:t[`filter-id`]}));a(u,{successLabel:`Loaded`})})};function st(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters list
82
+
83
+ List all TCP Flow Protection filters for an account.`).option(`filter-mode`,{type:`string`,description:`The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'.`}).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`list`,describe:`List all TCP Flow Protection filters.`,builder:st,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={mode:t[`filter-mode`],page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function lt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters update <filter-id>
84
+
85
+ Update a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const ut={command:`update <filter-id>`,describe:`Update TCP Flow Protection filter.`,builder:lt,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection filters update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({expression:p(t.expression,`expression`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.update({body:e,account_id:l,filter_id:t[`filter-id`]}));a(n,{successLabel:`Updated`});return}let d=f({expression:p(t.expression,`expression`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.update({body:d,account_id:l,filter_id:t[`filter-id`]}));a(m,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules create
86
+
87
+ Create a TCP Flow Protection rule for an account.`).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the TCP Flow Protection rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new TCP Flow Protection rule.`})}const pt={command:`create`,describe:`Create TCP Flow Protection rule.`,builder:ft,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(t.name,`name`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(t.scope,`scope`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}t[`burst-sensitivity`]===void 0&&(t[`burst-sensitivity`]=await m(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),t.name===void 0&&(t.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'.`)),t[`rate-sensitivity`]===void 0&&(t[`rate-sensitivity`]=await m(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),t.scope===void 0&&(t.scope=await m(`scope`,`The scope for the TCP Flow Protection rule.`));let d=f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(t.name,`name`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(t.scope,`scope`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function mt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules delete for account
88
+
89
+ Delete all TCP Flow Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ht={command:`account`,describe:`Delete all TCP Flow Protection rules.`,builder:mt,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
90
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.delete.for.account({account_id:l}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules delete protection rule <rule-id>
91
+
92
+ Delete a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vt={command:`rule <rule-id>`,describe:`Delete TCP Flow Protection rule.`,builder:_t,handler:async t=>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`}}}},t,async()=>{if(t.dryRun){let e=await r();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/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
93
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.delete.protection.rule({account_id:l,rule_id:t[`rule-id`]}));a(u,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules get <rule-id>
94
+
95
+ Get a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`get <rule-id>`,describe:`Get TCP Flow Protection rule.`,builder:xt,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.get({account_id:l,rule_id:t[`rule-id`]}));a(u,{successLabel:`Loaded`})})};function Ct(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules list
96
+
97
+ List all TCP Flow Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wt={command:`list`,describe:`List all TCP Flow Protection rules.`,builder:Ct,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function Tt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules update <rule-id>
98
+
99
+ Update a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the TCP Flow Protection rule.`})}const Et={command:`update <rule-id>`,describe:`Update TCP Flow Protection rule.`,builder:Tt,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp flow protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.update({...e,account_id:l,rule_id:t[`rule-id`]}));a(n,{successLabel:`Updated`});return}let d=f({burst_sensitivity:p(t[`burst-sensitivity`],`burst-sensitivity`,`text`),rate_sensitivity:p(t[`rate-sensitivity`],`rate-sensitivity`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.update({...d,account_id:l,rule_id:t[`rule-id`]}));a(m,{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.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status get
100
+
101
+ Get the protection status of the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jt={command:`get`,describe:`Get protection status.`,builder:At,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp protection status get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp protection status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_protection_status`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.protection.status.get({account_id:l}));a(u,{successLabel:`Loaded`})})};function Mt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status update
102
+
103
+ Update the protection status of the account.`).option(`enabled`,{type:`boolean`,description:`Enables or disables protection.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The update to apply to the protection status.`})}const Nt={command:`update`,describe:`Update protection status.`,builder:Mt,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp protection status update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs tcp protection status update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_protection_status`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({enabled:t.enabled}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.protection.status.update({...e,account_id:l}));a(n,{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=f({enabled:t.enabled}),p=await s(`Updating`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.protection.status.update({...d,account_id:l}));a(p,{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.usage(`$0 magic-transit apps create
104
+
105
+ Creates a new App for an account`).option(`hostnames`,{type:`string`,array:!0,description:`FQDNs to associate with traffic decisions.`}).option(`name`,{type:`string`,description:`Display name for the app.`}).option(`type`,{type:`string`,description:`Category of the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Bt={command:`create`,describe:`Create a new App`,builder:zt,handler:async t=>c({command:`magic-transit apps create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({hostnames:t.hostnames,name:p(t.name,`name`,`text`),type:p(t.type,`type`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.apps.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await m(`name`,`Display name for the app.`)),t.type===void 0&&(t.type=await m(`type`,`Category of the app.`));let d=f({hostnames:t.hostnames,name:p(t.name,`name`,`text`),type:p(t.type,`type`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.apps.create({body:d,account_id:l}));a(h,{successLabel:`Created`})})};function Vt(e){return e.usage(`$0 magic-transit apps delete <account-app-id>
106
+
107
+ Deletes specific Account App.`).positional(`account-app-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ht={command:`delete <account-app-id>`,describe:`Delete Account App`,builder:Vt,handler:async t=>c({command:`magic-transit apps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/apps/${t[`account-app-id`]==null?`<account-app-id>`:encodeURIComponent(String(t[`account-app-id`]))}`,pathParams:{"account-app-id":String(t[`account-app-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
108
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.apps.delete({account_id:l,account_app_id:t[`account-app-id`]}));a(u,{successLabel:`Deleted`})})};function Ut(e){return e.usage(`$0 magic-transit apps list
109
+
110
+ Lists Apps associated with an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`list`,describe:`List Apps`,builder:Ut,handler:async t=>c({command:`magic-transit apps list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/apps`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.apps.list({account_id:l}));a(u,{successLabel:`Loaded`})})};function Gt(e){return e.usage(`$0 magic-transit apps update <account-app-id>
111
+
112
+ Updates an Account App`).positional(`account-app-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`FQDNs to associate with traffic decisions.`}).option(`name`,{type:`string`,description:`Display name for the app.`}).option(`type`,{type:`string`,description:`Category of the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Kt={command:`update <account-app-id>`,describe:`Update an App`,builder:Gt,handler:async t=>c({command:`magic-transit apps update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/apps/${t[`account-app-id`]==null?`<account-app-id>`:encodeURIComponent(String(t[`account-app-id`]))}`,pathParams:{"account-app-id":String(t[`account-app-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({hostnames:t.hostnames,name:p(t.name,`name`,`text`),type:p(t.type,`type`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.apps.update({body:e,account_id:l,account_app_id:t[`account-app-id`]}));a(n,{successLabel:`Updated`});return}let d=f({hostnames:t.hostnames,name:p(t.name,`name`,`text`),type:p(t.type,`type`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.apps.update({body:d,account_id:l,account_app_id:t[`account-app-id`]}));a(m,{successLabel:`Updated`})})},qt={command:`apps`,describe:`Application-aware traffic policies for Magic WAN that steer traffic by app type`,builder:e=>e.command(Bt).command(Ht).command(Wt).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jt(e){return e.usage(`$0 magic-transit bgp-filter-profiles create
113
+
114
+ Creates a new BGP filter profile for an account.`).option(`description`,{type:`string`,description:`Description of the filter profile`,default:``}).option(`match-action`,{type:`string`,description:`Action to take when a route matches one of the targets in this profile`,choices:[`allow`,`deny`]}).option(`name`,{type:`string`,description:`Friendly name for the filter profile`}).option(`targets`,{type:`string`,array:!0,description:`List of CIDR prefixes. Each entry may carry an optional suffix that specifies which prefix lengths to match relative to the prefix length N: '{X,Y}' matches prefix lengths in the inclusive range [X, Y] where N <= X <= Y <= max (max is 32 for IPv4, 128 for IPv6), '{X}' matches exactly length X (equivalent to {X,X}), '+' is shorthand for {N, max} (the prefix and all more-specific subnets, including at length N itself; valid even when N is the maximum length). Omit the suffix to match the prefix exactly at length N.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Yt={command:`create`,describe:`Create BGP Filter Profile`,builder:Jt,handler:async t=>c({command:`magic-transit bgp-filter-profiles create`,classification:{safeFlags:[`match-action`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-filter-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),match_action:p(t[`match-action`],`match-action`,`text`),name:p(t.name,`name`,`text`),targets:t.targets}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.bgpFilterProfiles.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}if(t[`match-action`]===void 0&&(t[`match-action`]=await h(`match-action`,`Action to take when a route matches one of the targets in this profile`,[`allow`,`deny`])),t.name===void 0&&(t.name=await m(`name`,`Friendly name for the filter profile`)),t.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let d=f({description:p(t.description,`description`,`text`),match_action:p(t[`match-action`],`match-action`,`text`),name:p(t.name,`name`,`text`),targets:t.targets}),g=await s(`Creating`,async()=>c.magicTransit.bgpFilterProfiles.create({...d,account_id:l}));a(g,{successLabel:`Created`})})};function Xt(e){return e.usage(`$0 magic-transit bgp-filter-profiles delete <profile-id>
115
+
116
+ Deletes a BGP filter profile.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Zt={command:`delete <profile-id>`,describe:`Delete BGP Filter Profile`,builder:Xt,handler:async t=>c({command:`magic-transit bgp-filter-profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-filter-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/filter_profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
117
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.bgpFilterProfiles.delete({account_id:l,profile_id:t[`profile-id`]}));a(u,{successLabel:`Deleted`})})};function Qt(e){return e.usage(`$0 magic-transit bgp-filter-profiles get <profile-id>
118
+
119
+ Gets a specific BGP filter profile for an account.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $t={command:`get <profile-id>`,describe:`Get BGP Filter Profile`,builder:Qt,handler:async t=>c({command:`magic-transit bgp-filter-profiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-filter-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/filter_profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.bgpFilterProfiles.get({account_id:l,profile_id:t[`profile-id`]}));a(u,{successLabel:`Loaded`})})};function en(e){return e.usage(`$0 magic-transit bgp-filter-profiles list
120
+
121
+ Lists all BGP filter profiles for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tn={command:`list`,describe:`List BGP Filter Profiles`,builder:en,handler:async t=>c({command:`magic-transit bgp-filter-profiles list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-filter-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/filter_profiles`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.bgpFilterProfiles.list({account_id:l}));a(u,{successLabel:`Loaded`})})};function nn(e){return e.usage(`$0 magic-transit bgp-filter-profiles update <profile-id>
122
+
123
+ Updates a BGP filter profile. Omitted properties are left unchanged. To clear an existing description send \`description: ""\`.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the filter profile`}).option(`match-action`,{type:`string`,description:`Action to take when a route matches one of the targets in this profile`,choices:[`allow`,`deny`]}).option(`name`,{type:`string`,description:`Friendly name for the filter profile`}).option(`targets`,{type:`string`,array:!0,description:`List of CIDR prefixes. Each entry may carry an optional suffix that specifies which prefix lengths to match relative to the prefix length N: '{X,Y}' matches prefix lengths in the inclusive range [X, Y] where N <= X <= Y <= max (max is 32 for IPv4, 128 for IPv6), '{X}' matches exactly length X (equivalent to {X,X}), '+' is shorthand for {N, max} (the prefix and all more-specific subnets, including at length N itself; valid even when N is the maximum length). Omit the suffix to match the prefix exactly at length N.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:'Partial update for a BGP filter profile. At least one property must be provided; omitted properties are left unchanged. To clear an existing description send `description: ""`.'})}const rn={command:`update <profile-id>`,describe:`Update BGP Filter Profile`,builder:nn,handler:async t=>c({command:`magic-transit bgp-filter-profiles update`,classification:{safeFlags:[`match-action`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-filter-profiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/filter_profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),match_action:p(t[`match-action`],`match-action`,`text`),name:p(t.name,`name`,`text`),targets:t.targets}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.bgpFilterProfiles.update({...e,account_id:l,profile_id:t[`profile-id`]}));a(n,{successLabel:`Updated`});return}let d=f({description:p(t.description,`description`,`text`),match_action:p(t[`match-action`],`match-action`,`text`),name:p(t.name,`name`,`text`),targets:t.targets}),m=await s(`Updating`,async()=>c.magicTransit.bgpFilterProfiles.update({...d,account_id:l,profile_id:t[`profile-id`]}));a(m,{successLabel:`Updated`})})},an={command:`bgp-filter-profiles`,describe:`BGP filter profiles for controlling which routes are allowed or denied on Magic Transit tunnels`,builder:e=>e.command(Yt).command(Zt).command($t).command(tn).command(rn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function on(e){return e.usage(`$0 magic-transit bgp-settings get
124
+
125
+ Gets the BGP settings for an account, including the default ASN and redistribution configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sn={command:`get`,describe:`Get BGP Settings`,builder:on,handler:async t=>c({command:`magic-transit bgp-settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.bgpSettings.get({account_id:l}));a(u,{successLabel:`Loaded`})})};function cn(e){return e.usage(`$0 magic-transit bgp-settings update
126
+
127
+ Modifies the BGP settings for an account, including the default ASN and redistribution configuration.`).option(`cloudflare-asn`,{type:`number`,description:`Route advertisements from Cloudflare to ramps in this account will use this ASN.`}).option(`redistribute-static:wan`,{type:`boolean`,description:`Redistribute static WAN routes into BGP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ln={command:`update`,describe:`Update BGP Settings`,builder:cn,handler:async t=>c({command:`magic-transit bgp-settings update`,classification:{safeFlags:[`redistribute-static:wan`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit bgp-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/bgp/settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({cloudflare_asn:t[`cloudflare-asn`],redistribute:{"static:wan":t[`redistribute-static:wan`]}}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.bgpSettings.update({...e,account_id:l}));a(n,{successLabel:`Updated`});return}let d=f({cloudflare_asn:t[`cloudflare-asn`],redistribute:{"static:wan":t[`redistribute-static:wan`]}}),p=await s(`Updating`,async()=>c.magicTransit.bgpSettings.update({...d,account_id:l}));a(p,{successLabel:`Updated`})})},un={command:`bgp-settings`,describe:`BGP settings for controlling default ASN and route redistribution on Magic Transit tunnels`,builder:e=>e.command(sn).command(ln).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dn(e){return e.usage(`$0 magic-transit cf-interconnects bulk-update
128
+
129
+ Updates multiple interconnects associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fn={command:`bulk-update`,describe:`Update multiple interconnects`,builder:dn,handler:async l=>c({command:`magic-transit cf-interconnects bulk-update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit cf-interconnects bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let d=await n(l),f=l.local?e:await i();if(l.accountId=f,l.body){let e=u(l.body),n=await s(`Updating`,async()=>t(d,`PUT`,`/accounts/${f}/magic/cf_interconnects`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{successLabel:`Updated`});return}let p=await s(`Updating`,async()=>t(d,`PUT`,`/accounts/${f}/magic/cf_interconnects`,{headers:Object.keys(c).length>0?c:void 0}));a(p,{successLabel:`Updated`})})};function pn(e){return e.usage(`$0 magic-transit cf-interconnects get <cf-interconnect-id>
130
+
131
+ Lists details for a specific interconnect.`).positional(`cf-interconnect-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mn={command:`get <cf-interconnect-id>`,describe:`List interconnect Details`,builder:pn,handler:async l=>c({command:`magic-transit cf-interconnects get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit cf-interconnects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/cf_interconnects/${encodeURIComponent(String(l[`cf-interconnect-id`]))}`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function hn(e){return e.usage(`$0 magic-transit cf-interconnects list
132
+
133
+ Lists interconnects associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gn={command:`list`,describe:`List interconnects`,builder:hn,handler:async l=>c({command:`magic-transit cf-interconnects list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit cf-interconnects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf_interconnects`,pathParams:{},bodyKind:`none`});return}let u=await n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/cf_interconnects`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function _n(e){return e.usage(`$0 magic-transit cf-interconnects update <cf-interconnect-id>
134
+
135
+ Updates a specific interconnect associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`cf-interconnect-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`bgp-as-no`,{type:`number`,description:`Deprecated. Use customer_asn.`}).option(`bgp-cloudflare-endpoint`,{type:`string`,description:`Read-only for v1.5; derived from interface_address.`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session.`}).option(`bgp-customer-endpoint`,{type:`string`,description:`Read-only for v1.5; derived from interface_address.`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
136
+
137
+ Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
138
+ key is not treated as a secret value. This is *only* supported for preventing
139
+ misconfiguration, not for defending against malicious attacks.
140
+
141
+ The MD5 key, if set, must be of non-zero length and consist only of the following types of
142
+ character:
143
+
144
+ * ASCII alphanumerics: \`[a-zA-Z0-9]\`
145
+ * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
146
+
147
+ In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
148
+ quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
149
+ (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
150
+ 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,
151
+ use a /30 or /31 prefix. For GRE Interconnects, a /30 or /31 prefix
152
+ may be used. Version 1.5 interconnects require a /31 prefix and may
153
+ also use a prefix from the account's authorized prefixes; otherwise,
154
+ select the subnet from RFC 1918 or the approved link-local ranges.
155
+ `}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576.`}).option(`name`,{type:`string`,description:`The name of the interconnect. The name cannot share a name with other tunnels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const vn={command:`update <cf-interconnect-id>`,describe:`Update interconnect`,builder:_n,handler:async d=>c({command:`magic-transit cf-interconnects update`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`dry-run`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){let e=await r();o({command:`cf magic-transit cf-interconnects update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(d),h=d.local?e:await i();if(d.accountId=h,d.body){let e=u(d.body),n=await s(`Updating`,async()=>t(m,`PUT`,`/accounts/${h}/magic/cf_interconnects/${encodeURIComponent(String(d[`cf-interconnect-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{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`));let _=await s(`Updating`,async()=>t(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}));a(_,{successLabel:`Updated`})})},yn={command:`cf-interconnects`,describe:`Cloudflare Network Interconnect (CNI) links for direct physical or virtual peering`,builder:e=>e.command(fn).command(mn).command(gn).command(vn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bn(e){return e.usage(`$0 magic-transit cf1-sites create
156
+
157
+ Creates new CF1 Sites for an account. Each site must have a unique name within the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xn={command:`create`,describe:`Create CF1 Sites`,builder:bn,handler:async t=>c({command:`magic-transit cf1-sites create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.cf1Sites.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Sn(e){return e.usage(`$0 magic-transit cf1-sites delete <cf1-site-id>
158
+
159
+ Deletes a specific CF1 Site for an account.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Cn={command:`delete <cf1-site-id>`,describe:`Delete CF1 Site`,builder:Sn,handler:async t=>c({command:`magic-transit cf1-sites delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
160
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.cf1Sites.delete({account_id:l,cf1_site_id:t[`cf1-site-id`]}));a(u,{successLabel:`Deleted`})})};function wn(e){return e.usage(`$0 magic-transit cf1-sites get <cf1-site-id>
161
+
162
+ Gets a specific CF1 Site for an account.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tn={command:`get <cf1-site-id>`,describe:`Get CF1 Site`,builder:wn,handler:async t=>c({command:`magic-transit cf1-sites get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.cf1Sites.get({account_id:l,cf1_site_id:t[`cf1-site-id`]}));a(u,{successLabel:`Loaded`})})};function En(e){return e.usage(`$0 magic-transit cf1-sites list
163
+
164
+ Lists CF1 Sites associated with an account. A CF1 Site represents a physical customer network location with optional geographic coordinates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dn={command:`list`,describe:`List CF1 Sites`,builder:En,handler:async t=>c({command:`magic-transit cf1-sites list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.cf1Sites.list({account_id:l}));a(u,{successLabel:`Loaded`})})};function On(e){return e.usage(`$0 magic-transit cf1-sites ramps create <cf1-site-id>
165
+
166
+ Creates ramps (network connections) for a CF1 Site.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const kn={command:`create <cf1-site-id>`,describe:`Create CF1 Site Ramps`,builder:On,handler:async t=>c({command:`magic-transit cf1-sites ramps create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}/ramps`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.cf1Sites.ramps.create({body:e,account_id:l,cf1_site_id:t[`cf1-site-id`]}));a(n,{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function An(e){return e.usage(`$0 magic-transit cf1-sites ramps delete <ramp-id>
167
+
168
+ Deletes a specific ramp from a CF1 Site.`).positional(`ramp-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const jn={command:`delete <ramp-id>`,describe:`Delete CF1 Site Ramp`,builder:An,handler:async t=>c({command:`magic-transit cf1-sites ramps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}/ramps/${t[`ramp-id`]==null?`<ramp-id>`:encodeURIComponent(String(t[`ramp-id`]))}`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``),"ramp-id":String(t[`ramp-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
169
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.cf1Sites.ramps.delete({account_id:l,cf1_site_id:t[`cf1-site-id`],ramp_id:t[`ramp-id`]}));a(u,{successLabel:`Deleted`})})};function $(e){return e.usage(`$0 magic-transit cf1-sites ramps get <ramp-id>
170
+
171
+ Gets a specific ramp for a CF1 Site.`).positional(`ramp-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mn={command:`get <ramp-id>`,describe:`Get CF1 Site Ramp`,builder:$,handler:async t=>c({command:`magic-transit cf1-sites ramps get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}/ramps/${t[`ramp-id`]==null?`<ramp-id>`:encodeURIComponent(String(t[`ramp-id`]))}`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``),"ramp-id":String(t[`ramp-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.cf1Sites.ramps.get({account_id:l,cf1_site_id:t[`cf1-site-id`],ramp_id:t[`ramp-id`]}));a(u,{successLabel:`Loaded`})})};function Nn(e){return e.usage(`$0 magic-transit cf1-sites ramps list
172
+
173
+ Lists ramps (network connections) associated with a CF1 Site. Ramps represent GRE tunnels, IPsec tunnels, interconnects, or MCONN links.`).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pn={command:`list`,describe:`List CF1 Site Ramps`,builder:Nn,handler:async t=>c({command:`magic-transit cf1-sites ramps list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}/ramps`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.cf1Sites.ramps.list({account_id:l,cf1_site_id:t[`cf1-site-id`]}));a(u,{successLabel:`Loaded`})})},Fn={command:`ramps`,describe:`Operations for cf1-sites.ramps`,builder:e=>e.command(kn).command(jn).command(Mn).command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function In(e){return e.usage(`$0 magic-transit cf1-sites update <cf1-site-id>
174
+
175
+ Partially updates a specific CF1 Site for an account. Only the fields included in the request body are modified; omitted fields retain their existing values.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`A human-provided description of the CF1 Site.`}).option(`location-lat`,{type:`number`,description:`Latitude of the CF1 Site.`}).option(`location-long`,{type:`number`,description:`Longitude of the CF1 Site.`}).option(`location-name`,{type:`string`,description:`Name of nearest town, city, or village.`}).option(`name`,{type:`string`,description:`A human-provided name describing the CF1 Site that should be unique within the account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update payload for a CF1 Site. All properties are optional; only fields supplied in the request body are modified.`})}const Ln={command:`update <cf1-site-id>`,describe:`Update CF1 Site`,builder:In,handler:async t=>c({command:`magic-transit cf1-sites update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit cf1-sites update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/cf1_sites/${t[`cf1-site-id`]==null?`<cf1-site-id>`:encodeURIComponent(String(t[`cf1-site-id`]))}`,pathParams:{"cf1-site-id":String(t[`cf1-site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),location:{lat:t[`location-lat`],long:t[`location-long`],name:p(t[`location-name`],`location-name`,`text`)},name:p(t.name,`name`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.cf1Sites.update({...e,account_id:l,cf1_site_id:t[`cf1-site-id`]}));a(n,{successLabel:`Updated`});return}let d=f({description:p(t.description,`description`,`text`),location:{lat:t[`location-lat`],long:t[`location-long`],name:p(t[`location-name`],`location-name`,`text`)},name:p(t.name,`name`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.cf1Sites.update({...d,account_id:l,cf1_site_id:t[`cf1-site-id`]}));a(m,{successLabel:`Updated`})})},Rn={command:`cf1-sites`,describe:`Operations for cf1-sites`,builder:e=>e.command(xn).command(Cn).command(Tn).command(Dn).command(Ln).command(Fn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zn(e){return e.usage(`$0 magic-transit gre-tunnels bulk-update
176
+
177
+ Updates multiple GRE tunnels. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Bn={command:`bulk-update`,describe:`Update multiple GRE tunnels`,builder:zn,handler:async l=>c({command:`magic-transit gre-tunnels bulk-update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit gre-tunnels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let d=await n(l),f=l.local?e:await i();if(l.accountId=f,l.body){let e=u(l.body),n=await s(`Updating`,async()=>t(d,`PUT`,`/accounts/${f}/magic/gre_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{successLabel:`Updated`});return}let p=await s(`Updating`,async()=>t(d,`PUT`,`/accounts/${f}/magic/gre_tunnels`,{headers:Object.keys(c).length>0?c:void 0}));a(p,{successLabel:`Updated`})})};function Vn(e){return e.usage(`$0 magic-transit gre-tunnels create
178
+
179
+ Creates a new GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.",default:!1}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
180
+
181
+ Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
182
+ key is not treated as a secret value. This is *only* supported for preventing
183
+ misconfiguration, not for defending against malicious attacks.
184
+
185
+ The MD5 key, if set, must be of non-zero length and consist only of the following types of
186
+ character:
187
+
188
+ * ASCII alphanumerics: \`[a-zA-Z0-9]\`
189
+ * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
190
+
191
+ In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
192
+ quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
193
+ (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
194
+ these disallowed characters will be rejected.`}).option(`cloudflare-gre-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel.`}).option(`customer-gre-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the GRE tunnel.`}).option(`description`,{type:`string`,description:`An optional description of the GRE tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.`,default:1476}).option(`name`,{type:`string`,description:`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`}).option(`ttl`,{type:`number`,description:`Time To Live (TTL) in number of hops of the GRE tunnel.`,default:64}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const Hn={command:`create`,describe:`Create a GRE tunnel`,builder:Vn,handler:async d=>c({command:`magic-transit gre-tunnels create`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`dry-run`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){let e=await r();o({command:`cf magic-transit gre-tunnels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(d),g=d.local?e:await i();if(d.accountId=g,d.body){let e=u(d.body),n=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/magic/gre_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{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);let v=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/magic/gre_tunnels`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0}));a(v,{successLabel:`Created`})})};function Un(e){return e.usage(`$0 magic-transit gre-tunnels delete <gre-tunnel-id>
195
+
196
+ Disables and removes a specific static GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Wn={command:`delete <gre-tunnel-id>`,describe:`Delete GRE Tunnel`,builder:Un,handler:async l=>c({command:`magic-transit gre-tunnels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit gre-tunnels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(l),d=l.local?e:await i();if(l.accountId=d,!await g({force:!!l.force})){process.stderr.write(`Aborted.
197
+ `);return}let f=await s(`Deleting`,async()=>t(u,`DELETE`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(l[`gre-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Deleted`})})};function Gn(e){return e.usage(`$0 magic-transit gre-tunnels get <gre-tunnel-id>
198
+
199
+ Lists informtion for a specific GRE tunnel.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kn={command:`get <gre-tunnel-id>`,describe:`List GRE Tunnel Details`,builder:Gn,handler:async l=>c({command:`magic-transit gre-tunnels get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit gre-tunnels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/gre_tunnels/${encodeURIComponent(String(l[`gre-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function qn(e){return e.usage(`$0 magic-transit gre-tunnels list
200
+
201
+ Lists GRE tunnels associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jn={command:`list`,describe:`List GRE tunnels`,builder:qn,handler:async l=>c({command:`magic-transit gre-tunnels list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit gre-tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/gre_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/gre_tunnels`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function Yn(e){return e.usage(`$0 magic-transit gre-tunnels update <gre-tunnel-id>
202
+
203
+ Updates a specific GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`cloudflare-gre-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel.`}).option(`customer-gre-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the GRE tunnel.`}).option(`description`,{type:`string`,description:`An optional description of the GRE tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.`}).option(`name`,{type:`string`,description:`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`}).option(`ttl`,{type:`number`,description:`Time To Live (TTL) in number of hops of the GRE tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xn={command:`update <gre-tunnel-id>`,describe:`Update GRE Tunnel`,builder:Yn,handler:async d=>c({command:`magic-transit gre-tunnels update`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`dry-run`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){let e=await r();o({command:`cf magic-transit gre-tunnels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(d),g=d.local?e:await i();if(d.accountId=g,d.body){let e=u(d.body),n=await s(`Updating`,async()=>t(h,`PUT`,`/accounts/${g}/magic/gre_tunnels/${encodeURIComponent(String(d[`gre-tunnel-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{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);let v=await s(`Updating`,async()=>t(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}));a(v,{successLabel:`Updated`})})},Zn={command:`gre-tunnels`,describe:`GRE tunnel endpoints that connect your network to Cloudflare for Magic Transit`,builder:e=>e.command(Bn).command(Hn).command(Wn).command(Kn).command(Jn).command(Xn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qn(e){return e.usage(`$0 magic-transit ipsec-tunnels bulk-update
204
+
205
+ Update multiple IPsec tunnels associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $n={command:`bulk-update`,describe:`Update multiple IPsec tunnels`,builder:Qn,handler:async l=>c({command:`magic-transit ipsec-tunnels bulk-update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let d=await n(l),f=l.local?e:await i();if(l.accountId=f,l.body){let e=u(l.body),n=await s(`Updating`,async()=>t(d,`PUT`,`/accounts/${f}/magic/ipsec_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{successLabel:`Updated`});return}let p=await s(`Updating`,async()=>t(d,`PUT`,`/accounts/${f}/magic/ipsec_tunnels`,{headers:Object.keys(c).length>0?c:void 0}));a(p,{successLabel:`Updated`})})};function er(e){return e.usage(`$0 magic-transit ipsec-tunnels create
206
+
207
+ Creates a new IPsec tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.",default:!1}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
208
+
209
+ Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
210
+ key is not treated as a secret value. This is *only* supported for preventing
211
+ misconfiguration, not for defending against malicious attacks.
212
+
213
+ The MD5 key, if set, must be of non-zero length and consist only of the following types of
214
+ character:
215
+
216
+ * ASCII alphanumerics: \`[a-zA-Z0-9]\`
217
+ * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
218
+
219
+ In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
220
+ quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
221
+ (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
222
+ 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
223
+ generated IKE IDs can still be used even if this custom value is specified.
224
+
225
+ Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
226
+
227
+ This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
228
+ fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
229
+ cannot have the same cloudflare_endpoint.`}).option(`customer-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.`}).option(`description`,{type:`string`,description:`An optional description forthe IPsec tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`name`,{type:`string`,description:`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`}).option(`psk`,{type:`string`,description:`A randomly generated or provided string for use in the IPsec tunnel.`}).option(`replay-protection`,{type:`boolean`,description:"If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.",default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const tr={command:`create`,describe:`Create an IPsec tunnel`,builder:er,handler:async d=>c({command:`magic-transit ipsec-tunnels create`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`replay-protection`,`dry-run`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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),sensitiveBodyPaths:[[`psk`]]});return}let h=await n(d),g=d.local?e:await i();if(d.accountId=g,d.body){let e=u(d.body),n=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/magic/ipsec_tunnels`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{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`]);let v=await s(`Creating`,async()=>t(h,`POST`,`/accounts/${g}/magic/ipsec_tunnels`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0}));a(v,{successLabel:`Created`})})};function nr(e){return e.usage(`$0 magic-transit ipsec-tunnels delete <ipsec-tunnel-id>
230
+
231
+ Disables and removes a specific static IPsec Tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const rr={command:`delete <ipsec-tunnel-id>`,describe:`Delete IPsec Tunnel`,builder:nr,handler:async l=>c({command:`magic-transit ipsec-tunnels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(l),d=l.local?e:await i();if(l.accountId=d,!await g({force:!!l.force})){process.stderr.write(`Aborted.
232
+ `);return}let f=await s(`Deleting`,async()=>t(u,`DELETE`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Deleted`})})};function ir(e){return e.usage(`$0 magic-transit ipsec-tunnels get <ipsec-tunnel-id>
233
+
234
+ Lists details for a specific IPsec tunnel.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ar={command:`get <ipsec-tunnel-id>`,describe:`List IPsec tunnel details`,builder:ir,handler:async l=>c({command:`magic-transit ipsec-tunnels get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/ipsec_tunnels/${encodeURIComponent(String(l[`ipsec-tunnel-id`]))}`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function or(e){return e.usage(`$0 magic-transit ipsec-tunnels list
235
+
236
+ Lists IPsec tunnels associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sr={command:`list`,describe:`List IPsec tunnels`,builder:or,handler:async l=>c({command:`magic-transit ipsec-tunnels list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/ipsec_tunnels`,pathParams:{},bodyKind:`none`});return}let u=await n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/ipsec_tunnels`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function cr(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-generate <ipsec-tunnel-id>
237
+
238
+ Generates a Pre-Shared Key for a specific IPsec tunnel used in the IKE session. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes. After a PSK is generated, the PSK is immediately persisted to Cloudflare's edge and cannot be retrieved later. Store the PSK in a safe place.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lr={command:`psk-generate <ipsec-tunnel-id>`,describe:`Generate Pre-Shared Key (PSK) for IPsec tunnels`,builder:cr,handler:async t=>c({command:`magic-transit ipsec-tunnels psk-generate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels psk-generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/ipsec_tunnels/${t[`ipsec-tunnel-id`]==null?`<ipsec-tunnel-id>`:encodeURIComponent(String(t[`ipsec-tunnel-id`]))}/psk_generate`,pathParams:{"ipsec-tunnel-id":String(t[`ipsec-tunnel-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Creating`,async()=>c.magicTransit.ipsecTunnels.pskGenerate({account_id:l,ipsec_tunnel_id:t[`ipsec-tunnel-id`]}));a(u,{successLabel:`Created`})})};function ur(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-set
239
+
240
+ Sets Pre-Shared Keys for multiple IPsec tunnels associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes. After PSKs are applied, they are immediately persisted to Cloudflare's edge and cannot be retrieved later. Store the PSKs in a safe place.`).option(`validate-only`,{type:`boolean`,description:"If `true`, only run validation without persisting changes."}).option(`psks`,{type:`string`,description:`List of tunnel ID and PSK pairs. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for setting PSKs for multiple IPsec tunnels.`})}const dr={command:`psk-set`,describe:`Set Pre-Shared Keys (PSK) for IPsec tunnels`,builder:ur,handler:async t=>c({command:`magic-transit ipsec-tunnels psk-set`,classification:{safeFlags:[`validate-only`,`dry-run`]}},t,async()=>{let c={validate_only:t[`validate-only`]};if(t.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels psk-set`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/ipsec_tunnels/psk`,pathParams:{},query:c,bodyKind:`json`,body:t.body===void 0?f({psks:d(t.psks,`psks`)}):u(t.body)});return}let l=await n(t),p=t.local?e:await i();if(t.accountId=p,t.body){let e=u(t.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let n=await s(`Creating`,async()=>l.magicTransit.ipsecTunnels.pskSet({...e,account_id:p,...c}));a(n,{successLabel:`Created`});return}if(t.psks===void 0)throw Error(`--psks is required (or pass --body with this field set).`);let m=f({psks:d(t.psks,`psks`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let h=await s(`Creating`,async()=>l.magicTransit.ipsecTunnels.pskSet({...m,account_id:p,...c}));a(h,{successLabel:`Created`})})};function fr(e){return e.usage(`$0 magic-transit ipsec-tunnels update <ipsec-tunnel-id>
241
+
242
+ Updates a specific IPsec tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
243
+
244
+ Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
245
+ key is not treated as a secret value. This is *only* supported for preventing
246
+ misconfiguration, not for defending against malicious attacks.
247
+
248
+ The MD5 key, if set, must be of non-zero length and consist only of the following types of
249
+ character:
250
+
251
+ * ASCII alphanumerics: \`[a-zA-Z0-9]\`
252
+ * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
253
+
254
+ In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
255
+ quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
256
+ (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
257
+ 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
258
+ generated IKE IDs can still be used even if this custom value is specified.
259
+
260
+ Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
261
+
262
+ This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
263
+ fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
264
+ cannot have the same cloudflare_endpoint.`}).option(`customer-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.`}).option(`description`,{type:`string`,description:`An optional description forthe IPsec tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`name`,{type:`string`,description:`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`}).option(`psk`,{type:`string`,description:`A randomly generated or provided string for use in the IPsec tunnel.`}).option(`replay-protection`,{type:`boolean`,description:"If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const pr={command:`update <ipsec-tunnel-id>`,describe:`Update IPsec Tunnel`,builder:fr,handler:async d=>c({command:`magic-transit ipsec-tunnels update`,classification:{safeFlags:[`automatic-return-routing`,`health-check-enabled`,`health-check-rate`,`health-check-type`,`health-check-direction`,`replay-protection`,`dry-run`]}},d,async()=>{let c={};if(d[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(d[`x-magic-new-hc-target`])),d.dryRun){let e=await r();o({command:`cf magic-transit ipsec-tunnels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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),sensitiveBodyPaths:[[`psk`]]});return}let h=await n(d),g=d.local?e:await i();if(d.accountId=g,d.body){let e=u(d.body),n=await s(`Updating`,async()=>t(h,`PUT`,`/accounts/${g}/magic/ipsec_tunnels/${encodeURIComponent(String(d[`ipsec-tunnel-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0}));a(n,{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`]);let v=await s(`Updating`,async()=>t(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}));a(v,{successLabel:`Updated`})})},mr={command:`ipsec-tunnels`,describe:`IPsec tunnel endpoints with pre-shared key management for encrypted transit`,builder:e=>e.command($n).command(tr).command(rr).command(ar).command(sr).command(lr).command(dr).command(pr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hr(e){return e.usage(`$0 magic-transit pcaps create
265
+
266
+ Create new PCAP request for account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const gr={command:`create`,describe:`Create PCAP request`,builder:hr,handler:async t=>c({command:`magic-transit pcaps create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.pcaps.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function _r(e){return e.usage(`$0 magic-transit pcaps download get <pcap-id>
267
+
268
+ Download PCAP information into a file. Response is a binary PCAP file.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const vr={command:`get <pcap-id>`,describe:`Download Simple PCAP`,builder:_r,handler:async t=>c({command:`magic-transit pcaps download get`,classification:{safeFlags:[`dry-run`,`text`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/${t[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(t[`pcap-id`]))}/download`,pathParams:{"pcap-id":String(t[`pcap-id`]??``)},bodyKind:`none`});return}await n(t);let a=t.local?e:await i();t.accountId=a;let c=await s(`Loading`,async()=>v(`/accounts/${a}/pcaps/${encodeURIComponent(String(t[`pcap-id`]))}/download`,{method:`GET`,local:t.local===!0,persistTo:t.persistTo}));_(t.text===!0?c.toString(`utf-8`):c)})},yr={command:`download`,describe:`Operations for pcaps.download`,builder:e=>e.command(vr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function br(e){return e.usage(`$0 magic-transit pcaps get <pcap-id>
269
+
270
+ Get information for a PCAP request by id.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xr={command:`get <pcap-id>`,describe:`Get PCAP request`,builder:br,handler:async t=>c({command:`magic-transit pcaps get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/${t[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(t[`pcap-id`]))}`,pathParams:{"pcap-id":String(t[`pcap-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.pcaps.get({account_id:l,pcap_id:t[`pcap-id`]}));a(u,{successLabel:`Loaded`})})};function Sr(e){return e.usage(`$0 magic-transit pcaps list
271
+
272
+ Lists all packet capture requests for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cr={command:`list`,describe:`List packet capture requests`,builder:Sr,handler:async t=>c({command:`magic-transit pcaps list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.pcaps.list({account_id:l}));a(u,{successLabel:`Loaded`})})};function wr(e){return e.usage(`$0 magic-transit pcaps ownership create
273
+
274
+ Adds an AWS or GCP bucket to use with full packet captures.`).option(`destination-conf`,{type:`string`,description:"The full URI for the bucket. This field only applies to `full` packet captures."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tr={command:`create`,describe:`Add buckets for full packet captures`,builder:wr,handler:async t=>c({command:`magic-transit pcaps ownership create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({destination_conf:p(t[`destination-conf`],`destination-conf`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`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(t[`destination-conf`],`destination-conf`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function Er(e){return e.usage(`$0 magic-transit pcaps ownership delete <ownership-id>
275
+
276
+ Deletes buckets added to the packet captures API.`).positional(`ownership-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Dr={command:`delete <ownership-id>`,describe:`Delete buckets for full packet captures`,builder:Er,handler:async t=>c({command:`magic-transit pcaps ownership delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps ownership delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/ownership/${t[`ownership-id`]==null?`<ownership-id>`:encodeURIComponent(String(t[`ownership-id`]))}`,pathParams:{"ownership-id":String(t[`ownership-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
277
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.pcaps.ownership.delete({account_id:l,ownership_id:t[`ownership-id`]}));a(u,{successLabel:`Deleted`})})};function Or(e){return e.usage(`$0 magic-transit pcaps ownership get
278
+
279
+ List all buckets configured for use with PCAPs API.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kr={command:`get`,describe:`List PCAPs Bucket Ownership`,builder:Or,handler:async t=>c({command:`magic-transit pcaps ownership get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps ownership get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/ownership`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.pcaps.ownership.get({account_id:l}));a(u,{successLabel:`Loaded`})})};function Ar(e){return e.usage(`$0 magic-transit pcaps ownership validate
280
+
281
+ Validates buckets added to the packet captures API.`).option(`destination-conf`,{type:`string`,description:"The full URI for the bucket. This field only applies to `full` packet captures."}).option(`ownership-challenge`,{type:`string`,description:`The ownership challenge filename stored in the bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const jr={command:`validate`,describe:`Validate buckets for full packet captures`,builder:Ar,handler:async t=>c({command:`magic-transit pcaps ownership validate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/ownership/validate`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({destination_conf:p(t[`destination-conf`],`destination-conf`,`text`),ownership_challenge:p(t[`ownership-challenge`],`ownership-challenge`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.validate({...e,account_id:l}));a(n,{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await m(`destination-conf`,"The full URI for the bucket. This field only applies to `full` packet captures.")),t[`ownership-challenge`]===void 0&&(t[`ownership-challenge`]=await m(`ownership-challenge`,`The ownership challenge filename stored in the bucket.`));let d=f({destination_conf:p(t[`destination-conf`],`destination-conf`,`text`),ownership_challenge:p(t[`ownership-challenge`],`ownership-challenge`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.pcaps.ownership.validate({...d,account_id:l}));a(h,{successLabel:`Created`})})},Mr={command:`ownership`,describe:`Operations for pcaps.ownership`,builder:e=>e.command(Tr).command(Dr).command(kr).command(jr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nr(e){return e.usage(`$0 magic-transit pcaps stop <pcap-id>
282
+
283
+ Stop full PCAP.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Pr={command:`stop <pcap-id>`,describe:`Stop full PCAP`,builder:Nr,handler:async t=>c({command:`magic-transit pcaps stop`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit pcaps stop`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pcaps/${t[`pcap-id`]==null?`<pcap-id>`:encodeURIComponent(String(t[`pcap-id`]))}/stop`,pathParams:{"pcap-id":String(t[`pcap-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force,message:`This operation halts an in-progress full packet capture. Any unsaved capture data will be lost.`})){process.stderr.write(`Aborted.
284
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.pcaps.stop({account_id:l,pcap_id:t[`pcap-id`]}));a(u,{successLabel:`Deleted`})})},Fr={command:`pcaps`,describe:`Packet capture requests for debugging traffic flowing through Magic Transit tunnels`,builder:e=>e.command(gr).command(xr).command(Cr).command(Pr).command(yr).command(Mr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ir(e){return e.usage(`$0 magic-transit redundancy-groups create
285
+
286
+ Creates a new redundancy group, optionally with tunnel members.`).option(`description`,{type:`string`,description:`Optional description`,default:``}).option(`members`,{type:`string`,description:`Tunnels to add to the group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Human-readable name for the redundancy group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Lr={command:`create`,describe:`Create a Redundancy Group`,builder:Ir,handler:async t=>c({command:`magic-transit redundancy-groups create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit redundancy-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),members:d(t.members,`members`),name:p(t.name,`name`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.redundancyGroups.create({body:e,account_id:l}));a(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await m(`name`,`Human-readable name for the redundancy group`));let h=f({description:p(t.description,`description`,`text`),members:d(t.members,`members`),name:p(t.name,`name`,`text`)}),g=await s(`Creating`,async()=>c.magicTransit.redundancyGroups.create({body:h,account_id:l}));a(g,{successLabel:`Created`})})};function Rr(e){return e.usage(`$0 magic-transit redundancy-groups delete <redundancy-group-id>
287
+
288
+ Deletes a redundancy group. Member tunnels are not deleted — their redundancy_group_id is cleared.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const zr={command:`delete <redundancy-group-id>`,describe:`Delete a Redundancy Group`,builder:Rr,handler:async t=>c({command:`magic-transit redundancy-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit redundancy-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/redundancy_groups/${t[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(t[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(t[`redundancy-group-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
289
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.redundancyGroups.delete({account_id:l,redundancy_group_id:t[`redundancy-group-id`]}));a(u,{successLabel:`Deleted`})})};function Br(e){return e.usage(`$0 magic-transit redundancy-groups get <redundancy-group-id>
290
+
291
+ Gets details for a specific redundancy group, including full member tunnel data.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Vr={command:`get <redundancy-group-id>`,describe:`Get Redundancy Group Details`,builder:Br,handler:async t=>c({command:`magic-transit redundancy-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit redundancy-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/redundancy_groups/${t[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(t[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(t[`redundancy-group-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.redundancyGroups.get({account_id:l,redundancy_group_id:t[`redundancy-group-id`]}));a(u,{successLabel:`Loaded`})})};function Hr(e){return e.usage(`$0 magic-transit redundancy-groups list
292
+
293
+ Lists redundancy groups associated with an account, including full member tunnel data.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ur={command:`list`,describe:`List Redundancy Groups`,builder:Hr,handler:async t=>c({command:`magic-transit redundancy-groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit redundancy-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/redundancy_groups`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.redundancyGroups.list({account_id:l}));a(u,{successLabel:`Loaded`})})};function Wr(e){return e.usage(`$0 magic-transit redundancy-groups update <redundancy-group-id>
294
+
295
+ Replaces the name, description, and full set of members for an existing redundancy group.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description`}).option(`members`,{type:`string`,description:`Tunnels to add to the group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Human-readable name for the redundancy group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Gr={command:`update <redundancy-group-id>`,describe:`Update a Redundancy Group`,builder:Wr,handler:async t=>c({command:`magic-transit redundancy-groups update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit redundancy-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/redundancy_groups/${t[`redundancy-group-id`]==null?`<redundancy-group-id>`:encodeURIComponent(String(t[`redundancy-group-id`]))}`,pathParams:{"redundancy-group-id":String(t[`redundancy-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),members:d(t.members,`members`),name:p(t.name,`name`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.redundancyGroups.update({body:e,account_id:l,redundancy_group_id:t[`redundancy-group-id`]}));a(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await m(`name`,`Human-readable name for the redundancy group`));let h=f({description:p(t.description,`description`,`text`),members:d(t.members,`members`),name:p(t.name,`name`,`text`)}),g=await s(`Updating`,async()=>c.magicTransit.redundancyGroups.update({body:h,account_id:l,redundancy_group_id:t[`redundancy-group-id`]}));a(g,{successLabel:`Updated`})})},Kr={command:`redundancy-groups`,describe:`Operations for redundancy-groups`,builder:e=>e.command(Lr).command(zr).command(Vr).command(Ur).command(Gr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qr(e){return e.usage(`$0 magic-transit routes bulk-update
296
+
297
+ Update multiple Magic static routes. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes. Only fields for a route that need to be changed need be provided.`).option(`routes`,{type:`string`,description:`The routes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Jr={command:`bulk-update`,describe:`Update Many Routes`,builder:qr,handler:async t=>c({command:`magic-transit routes bulk-update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({routes:d(t.routes,`routes`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.routes.bulkUpdate({...e,account_id:l}));a(n,{successLabel:`Updated`});return}if(t.routes===void 0)throw Error(`--routes is required (or pass --body with this field set).`);let p=f({routes:d(t.routes,`routes`)}),m=await s(`Updating`,async()=>c.magicTransit.routes.bulkUpdate({...p,account_id:l}));a(m,{successLabel:`Updated`})})};function Yr(e){return e.usage(`$0 magic-transit routes create
298
+
299
+ Creates a new Magic static route. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes.`).option(`description`,{type:`string`,description:`An optional human provided description of the static route.`}).option(`nexthop`,{type:`string`,description:`The next-hop IP Address for the static route.`}).option(`prefix`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`priority`,{type:`number`,description:`Priority of the static route.`}).option(`scope-colo-names`,{type:`string`,array:!0,description:`List of colo names for the ECMP scope.`}).option(`scope-colo-regions`,{type:`string`,array:!0,description:`List of colo regions for the ECMP scope.`}).option(`weight`,{type:`number`,description:`Optional weight of the ECMP scope - if provided.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xr={command:`create`,describe:`Create a Route`,builder:Yr,handler:async t=>c({command:`magic-transit routes create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),nexthop:p(t.nexthop,`nexthop`,`text`),prefix:p(t.prefix,`prefix`,`text`),priority:t.priority,scope:{colo_names:t[`scope-colo-names`],colo_regions:t[`scope-colo-regions`]},weight:t.weight}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.routes.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}if(t.nexthop===void 0&&(t.nexthop=await m(`nexthop`,`The next-hop IP Address for the static route.`)),t.prefix===void 0&&(t.prefix=await m(`prefix`,`IP Prefix in Classless Inter-Domain Routing format.`)),t.priority===void 0)throw Error(`--priority is required (or pass --body with this field set).`);let d=f({description:p(t.description,`description`,`text`),nexthop:p(t.nexthop,`nexthop`,`text`),prefix:p(t.prefix,`prefix`,`text`),priority:t.priority,scope:{colo_names:t[`scope-colo-names`],colo_regions:t[`scope-colo-regions`]},weight:t.weight}),h=await s(`Creating`,async()=>c.magicTransit.routes.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function Zr(e){return e.usage(`$0 magic-transit routes delete <route-id>
300
+
301
+ Disable and remove a specific Magic static route.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qr={command:`delete <route-id>`,describe:`Delete Route`,builder:Zr,handler:async t=>c({command:`magic-transit routes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes/${t[`route-id`]==null?`<route-id>`:encodeURIComponent(String(t[`route-id`]))}`,pathParams:{"route-id":String(t[`route-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
302
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.routes.delete({account_id:l,route_id:t[`route-id`]}));a(u,{successLabel:`Deleted`})})};function $r(e){return e.usage(`$0 magic-transit routes empty
303
+
304
+ Delete multiple Magic static routes.`).option(`routes`,{type:`string`,description:`The routes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ei={command:`empty`,describe:`Delete Many Routes`,builder:$r,handler:async t=>c({command:`magic-transit routes empty`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes empty`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({routes:d(t.routes,`routes`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
305
+ `);return}if(t.body){let e=u(t.body),n=await s(`Deleting`,async()=>c.magicTransit.routes.empty({...e,account_id:l}));a(n,{successLabel:`Deleted`});return}if(t.routes===void 0)throw Error(`--routes is required (or pass --body with this field set).`);let p=f({routes:d(t.routes,`routes`)}),m=await s(`Deleting`,async()=>c.magicTransit.routes.empty({...p,account_id:l}));a(m,{successLabel:`Deleted`})})};function ti(e){return e.usage(`$0 magic-transit routes get <route-id>
306
+
307
+ Get a specific Magic static route.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ni={command:`get <route-id>`,describe:`Route Details`,builder:ti,handler:async t=>c({command:`magic-transit routes get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes/${t[`route-id`]==null?`<route-id>`:encodeURIComponent(String(t[`route-id`]))}`,pathParams:{"route-id":String(t[`route-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.routes.get({account_id:l,route_id:t[`route-id`]}));a(u,{successLabel:`Loaded`})})};function ri(e){return e.usage(`$0 magic-transit routes list
308
+
309
+ List all Magic static routes.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ii={command:`list`,describe:`List Routes`,builder:ri,handler:async t=>c({command:`magic-transit routes list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.routes.list({account_id:l}));a(u,{successLabel:`Loaded`})})};function ai(e){return e.usage(`$0 magic-transit routes update <route-id>
310
+
311
+ Update a specific Magic static route. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`An optional human provided description of the static route.`}).option(`nexthop`,{type:`string`,description:`The next-hop IP Address for the static route.`}).option(`prefix`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`priority`,{type:`number`,description:`Priority of the static route.`}).option(`scope-colo-names`,{type:`string`,array:!0,description:`List of colo names for the ECMP scope.`}).option(`scope-colo-regions`,{type:`string`,array:!0,description:`List of colo regions for the ECMP scope.`}).option(`weight`,{type:`number`,description:`Optional weight of the ECMP scope - if provided.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oi={command:`update <route-id>`,describe:`Update Route`,builder:ai,handler:async t=>c({command:`magic-transit routes update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit routes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/routes/${t[`route-id`]==null?`<route-id>`:encodeURIComponent(String(t[`route-id`]))}`,pathParams:{"route-id":String(t[`route-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),nexthop:p(t.nexthop,`nexthop`,`text`),prefix:p(t.prefix,`prefix`,`text`),priority:t.priority,scope:{colo_names:t[`scope-colo-names`],colo_regions:t[`scope-colo-regions`]},weight:t.weight}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.routes.update({body:e,account_id:l,route_id:t[`route-id`]}));a(n,{successLabel:`Updated`});return}if(t.nexthop===void 0&&(t.nexthop=await m(`nexthop`,`The next-hop IP Address for the static route.`)),t.prefix===void 0&&(t.prefix=await m(`prefix`,`IP Prefix in Classless Inter-Domain Routing format.`)),t.priority===void 0)throw Error(`--priority is required (or pass --body with this field set).`);let d=f({description:p(t.description,`description`,`text`),nexthop:p(t.nexthop,`nexthop`,`text`),prefix:p(t.prefix,`prefix`,`text`),priority:t.priority,scope:{colo_names:t[`scope-colo-names`],colo_regions:t[`scope-colo-regions`]},weight:t.weight}),h=await s(`Updating`,async()=>c.magicTransit.routes.update({body:d,account_id:l,route_id:t[`route-id`]}));a(h,{successLabel:`Updated`})})},si={command:`routes`,describe:`Static routes that direct IP prefix traffic through specific GRE/IPsec tunnels`,builder:e=>e.command(Jr).command(Xr).command(Qr).command(ei).command(ni).command(ii).command(oi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ci(e){return e.usage(`$0 magic-transit sites acls create <site-id>
312
+
313
+ Creates a new Site ACL.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Bidirectional ACL policy for local network traffic within a site.`})}const li={command:`create <site-id>`,describe:`Create a new Site ACL`,builder:ci,handler:async t=>c({command:`magic-transit sites acls create`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/acls`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),forward_locally:t[`forward-locally`],lan_1:{lan_id:p(t[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(t[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:t[`lan-1-port-ranges`],ports:t[`lan-1-ports`]},lan_2:{lan_id:p(t[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(t[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:t[`lan-2-port-ranges`],ports:t[`lan-2-ports`]},name:p(t.name,`name`,`text`),protocols:t.protocols,unidirectional:t.unidirectional}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.sites.acls.create({...e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Created`});return}t[`lan-1-lan-id`]===void 0&&(t[`lan-1-lan-id`]=await m(`lan-1-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),t[`lan-2-lan-id`]===void 0&&(t[`lan-2-lan-id`]=await m(`lan-2-lan-id`,`The identifier for the LAN you want to create an ACL policy with.`)),t.name===void 0&&(t.name=await m(`name`,`The name of the ACL.`));let d=f({description:p(t.description,`description`,`text`),forward_locally:t[`forward-locally`],lan_1:{lan_id:p(t[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(t[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:t[`lan-1-port-ranges`],ports:t[`lan-1-ports`]},lan_2:{lan_id:p(t[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(t[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:t[`lan-2-port-ranges`],ports:t[`lan-2-ports`]},name:p(t.name,`name`,`text`),protocols:t.protocols,unidirectional:t.unidirectional}),h=await s(`Creating`,async()=>c.magicTransit.sites.acls.create({...d,account_id:l,site_id:t[`site-id`]}));a(h,{successLabel:`Created`})})};function ui(e){return e.usage(`$0 magic-transit sites acls delete <acl-id>
314
+
315
+ Remove a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const di={command:`delete <acl-id>`,describe:`Delete Site ACL`,builder:ui,handler:async t=>c({command:`magic-transit sites acls delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"acl-id":String(t[`acl-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
316
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.acls.delete({account_id:l,site_id:t[`site-id`],acl_id:t[`acl-id`]}));a(u,{successLabel:`Deleted`})})};function fi(e){return e.usage(`$0 magic-transit sites acls edit <acl-id>
317
+
318
+ Patch a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`lan-1-lan-id`,`lan-1-lan-name`,`lan-1-port-ranges`,`lan-1-ports`].some(t=>e[t]!==void 0)){let t=[`lan-1-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_1-* flag is set`)}return!0}).check(e=>{if([`lan-2-lan-id`,`lan-2-lan-name`,`lan-2-port-ranges`,`lan-2-ports`].some(t=>e[t]!==void 0)){let t=[`lan-2-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_2-* flag is set`)}return!0})}const pi={command:`edit <acl-id>`,describe:`Patch Site ACL`,builder:fi,handler:async t=>c({command:`magic-transit sites acls edit`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites acls edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"acl-id":String(t[`acl-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),forward_locally:t[`forward-locally`],lan_1:{lan_id:p(t[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(t[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:t[`lan-1-port-ranges`],ports:t[`lan-1-ports`]},lan_2:{lan_id:p(t[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(t[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:t[`lan-2-port-ranges`],ports:t[`lan-2-ports`]},name:p(t.name,`name`,`text`),protocols:t.protocols,unidirectional:t.unidirectional}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.acls.edit({body:e,account_id:l,site_id:t[`site-id`],acl_id:t[`acl-id`]}));a(n,{successLabel:`Updated`});return}let d=f({description:p(t.description,`description`,`text`),forward_locally:t[`forward-locally`],lan_1:{lan_id:p(t[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(t[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:t[`lan-1-port-ranges`],ports:t[`lan-1-ports`]},lan_2:{lan_id:p(t[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(t[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:t[`lan-2-port-ranges`],ports:t[`lan-2-ports`]},name:p(t.name,`name`,`text`),protocols:t.protocols,unidirectional:t.unidirectional}),m=await s(`Updating`,async()=>c.magicTransit.sites.acls.edit({body:d,account_id:l,site_id:t[`site-id`],acl_id:t[`acl-id`]}));a(m,{successLabel:`Updated`})})};function mi(e){return e.usage(`$0 magic-transit sites acls get <acl-id>
319
+
320
+ Get a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hi={command:`get <acl-id>`,describe:`Site ACL Details`,builder:mi,handler:async t=>c({command:`magic-transit sites acls get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"acl-id":String(t[`acl-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.acls.get({account_id:l,site_id:t[`site-id`],acl_id:t[`acl-id`]}));a(u,{successLabel:`Loaded`})})};function gi(e){return e.usage(`$0 magic-transit sites acls list
321
+
322
+ Lists Site ACLs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _i={command:`list`,describe:`List Site ACLs`,builder:gi,handler:async t=>c({command:`magic-transit sites acls list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/acls`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.acls.list({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Loaded`})})};function vi(e){return e.usage(`$0 magic-transit sites acls update <acl-id>
323
+
324
+ Update a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`lan-1-lan-id`,`lan-1-lan-name`,`lan-1-port-ranges`,`lan-1-ports`].some(t=>e[t]!==void 0)){let t=[`lan-1-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_1-* flag is set`)}return!0}).check(e=>{if([`lan-2-lan-id`,`lan-2-lan-name`,`lan-2-port-ranges`,`lan-2-ports`].some(t=>e[t]!==void 0)){let t=[`lan-2-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_2-* flag is set`)}return!0})}const yi={command:`update <acl-id>`,describe:`Update Site ACL`,builder:vi,handler:async t=>c({command:`magic-transit sites acls update`,classification:{safeFlags:[`forward-locally`,`unidirectional`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"acl-id":String(t[`acl-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({description:p(t.description,`description`,`text`),forward_locally:t[`forward-locally`],lan_1:{lan_id:p(t[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(t[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:t[`lan-1-port-ranges`],ports:t[`lan-1-ports`]},lan_2:{lan_id:p(t[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(t[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:t[`lan-2-port-ranges`],ports:t[`lan-2-ports`]},name:p(t.name,`name`,`text`),protocols:t.protocols,unidirectional:t.unidirectional}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.acls.update({body:e,account_id:l,site_id:t[`site-id`],acl_id:t[`acl-id`]}));a(n,{successLabel:`Updated`});return}let d=f({description:p(t.description,`description`,`text`),forward_locally:t[`forward-locally`],lan_1:{lan_id:p(t[`lan-1-lan-id`],`lan-1-lan-id`,`text`),lan_name:p(t[`lan-1-lan-name`],`lan-1-lan-name`,`text`),port_ranges:t[`lan-1-port-ranges`],ports:t[`lan-1-ports`]},lan_2:{lan_id:p(t[`lan-2-lan-id`],`lan-2-lan-id`,`text`),lan_name:p(t[`lan-2-lan-name`],`lan-2-lan-name`,`text`),port_ranges:t[`lan-2-port-ranges`],ports:t[`lan-2-ports`]},name:p(t.name,`name`,`text`),protocols:t.protocols,unidirectional:t.unidirectional}),m=await s(`Updating`,async()=>c.magicTransit.sites.acls.update({body:d,account_id:l,site_id:t[`site-id`],acl_id:t[`acl-id`]}));a(m,{successLabel:`Updated`})})},bi={command:`acls`,describe:`Operations for sites.acls`,builder:e=>e.command(li).command(di).command(pi).command(hi).command(_i).command(yi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xi(e){return e.usage(`$0 magic-transit sites app-configuration create <site-id>
325
+
326
+ Creates a new App Config for a site`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`breakout`,{type:`boolean`,description:`Whether to breakout traffic to the app's endpoints directly. Null preserves default behavior.`}).option(`preferred-wans`,{type:`string`,array:!0,description:`WAN interfaces to prefer over default WANs, highest-priority first. Can only be specified for breakout rules (breakout must be true).`}).option(`priority`,{type:`number`,description:`Priority of traffic. 0 is default, anything greater is prioritized. (Currently only 0 and 1 are supported)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Si={command:`create <site-id>`,describe:`Create a new App Config`,builder:xi,handler:async t=>c({command:`magic-transit sites app-configuration create`,classification:{safeFlags:[`breakout`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites app-configuration create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/app_configs`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({breakout:t.breakout,preferred_wans:t[`preferred-wans`],priority:t.priority}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.sites.appConfiguration.create({...e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Created`});return}let d=f({breakout:t.breakout,preferred_wans:t[`preferred-wans`],priority:t.priority}),p=await s(`Creating`,async()=>c.magicTransit.sites.appConfiguration.create({...d,account_id:l,site_id:t[`site-id`]}));a(p,{successLabel:`Created`})})};function Ci(e){return e.usage(`$0 magic-transit sites app-configuration delete <app-config-id>
327
+
328
+ Deletes specific App Config associated with a site.`).positional(`app-config-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const wi={command:`delete <app-config-id>`,describe:`Delete App Config`,builder:Ci,handler:async t=>c({command:`magic-transit sites app-configuration delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites app-configuration delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/app_configs/${t[`app-config-id`]==null?`<app-config-id>`:encodeURIComponent(String(t[`app-config-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"app-config-id":String(t[`app-config-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
329
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.appConfiguration.delete({account_id:l,site_id:t[`site-id`],app_config_id:t[`app-config-id`]}));a(u,{successLabel:`Deleted`})})};function Ti(e){return e.usage(`$0 magic-transit sites app-configuration list
330
+
331
+ Lists App Configs associated with a site.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ei={command:`list`,describe:`List App Configs`,builder:Ti,handler:async t=>c({command:`magic-transit sites app-configuration list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites app-configuration list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/app_configs`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.appConfiguration.list({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Loaded`})})};function Di(e){return e.usage(`$0 magic-transit sites app-configuration update <app-config-id>
332
+
333
+ Updates an App Config for a site`).positional(`app-config-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`account-app-id`,{type:`string`,description:`Magic account app ID.`}).option(`breakout`,{type:`boolean`,description:`Whether to breakout traffic to the app's endpoints directly. Null preserves default behavior.`}).option(`managed-app-id`,{type:`string`,description:`Managed app ID.`}).option(`preferred-wans`,{type:`string`,array:!0,description:`WAN interfaces to prefer over default WANs, highest-priority first. Can only be specified for breakout rules (breakout must be true).`}).option(`priority`,{type:`number`,description:`Priority of traffic. 0 is default, anything greater is prioritized. (Currently only 0 and 1 are supported)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oi={command:`update <app-config-id>`,describe:`Update an App Config`,builder:Di,handler:async t=>c({command:`magic-transit sites app-configuration update`,classification:{safeFlags:[`breakout`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites app-configuration update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/app_configs/${t[`app-config-id`]==null?`<app-config-id>`:encodeURIComponent(String(t[`app-config-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"app-config-id":String(t[`app-config-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({account_app_id:p(t[`account-app-id`],`account-app-id`,`text`),breakout:t.breakout,managed_app_id:p(t[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:t[`preferred-wans`],priority:t.priority}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.appConfiguration.update({...e,account_id:l,site_id:t[`site-id`],app_config_id:t[`app-config-id`]}));a(n,{successLabel:`Updated`});return}let d=f({account_app_id:p(t[`account-app-id`],`account-app-id`,`text`),breakout:t.breakout,managed_app_id:p(t[`managed-app-id`],`managed-app-id`,`text`),preferred_wans:t[`preferred-wans`],priority:t.priority}),m=await s(`Updating`,async()=>c.magicTransit.sites.appConfiguration.update({...d,account_id:l,site_id:t[`site-id`],app_config_id:t[`app-config-id`]}));a(m,{successLabel:`Updated`})})},ki={command:`app-configuration`,describe:`Operations for sites.app-configuration`,builder:e=>e.command(Si).command(wi).command(Ei).command(Oi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ai(e){return e.usage(`$0 magic-transit sites create
334
+
335
+ Creates a new Site`).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ji={command:`create`,describe:`Create a new Site`,builder:Ai,handler:async t=>c({command:`magic-transit sites create`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({connector_id:p(t[`connector-id`],`connector-id`,`text`),description:p(t.description,`description`,`text`),ha_mode:t[`ha-mode`],location:{lat:p(t[`location-lat`],`location-lat`,`text`),lon:p(t[`location-lon`],`location-lon`,`text`)},name:p(t.name,`name`,`text`),secondary_connector_id:p(t[`secondary-connector-id`],`secondary-connector-id`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.sites.create({...e,account_id:l}));a(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await m(`name`,`The name of the site.`));let d=f({connector_id:p(t[`connector-id`],`connector-id`,`text`),description:p(t.description,`description`,`text`),ha_mode:t[`ha-mode`],location:{lat:p(t[`location-lat`],`location-lat`,`text`),lon:p(t[`location-lon`],`location-lon`,`text`)},name:p(t.name,`name`,`text`),secondary_connector_id:p(t[`secondary-connector-id`],`secondary-connector-id`,`text`)}),h=await s(`Creating`,async()=>c.magicTransit.sites.create({...d,account_id:l}));a(h,{successLabel:`Created`})})};function Mi(e){return e.usage(`$0 magic-transit sites delete <site-id>
336
+
337
+ Remove a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ni={command:`delete <site-id>`,describe:`Delete Site`,builder:Mi,handler:async t=>c({command:`magic-transit sites delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
338
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.delete({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Deleted`})})};function Pi(e){return e.usage(`$0 magic-transit sites edit <site-id>
339
+
340
+ Patch a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Fi={command:`edit <site-id>`,describe:`Patch Site`,builder:Pi,handler:async t=>c({command:`magic-transit sites edit`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({connector_id:p(t[`connector-id`],`connector-id`,`text`),description:p(t.description,`description`,`text`),ha_mode:t[`ha-mode`],location:{lat:p(t[`location-lat`],`location-lat`,`text`),lon:p(t[`location-lon`],`location-lon`,`text`)},name:p(t.name,`name`,`text`),secondary_connector_id:p(t[`secondary-connector-id`],`secondary-connector-id`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.edit({body:e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Updated`});return}let d=f({connector_id:p(t[`connector-id`],`connector-id`,`text`),description:p(t.description,`description`,`text`),ha_mode:t[`ha-mode`],location:{lat:p(t[`location-lat`],`location-lat`,`text`),lon:p(t[`location-lon`],`location-lon`,`text`)},name:p(t.name,`name`,`text`),secondary_connector_id:p(t[`secondary-connector-id`],`secondary-connector-id`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.sites.edit({body:d,account_id:l,site_id:t[`site-id`]}));a(m,{successLabel:`Updated`})})};function Ii(e){return e.usage(`$0 magic-transit sites get <site-id>
341
+
342
+ Get a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Li={command:`get <site-id>`,describe:`Site Details`,builder:Ii,handler:async l=>c({command:`magic-transit sites get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`x-magic-new-hc-target`]!==void 0&&(c[`x-magic-new-hc-target`]=String(l[`x-magic-new-hc-target`])),l.dryRun){let e=await r();o({command:`cf magic-transit sites get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<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 n(l),d=l.local?e:await i();l.accountId=d;let f=await s(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/magic/sites/${encodeURIComponent(String(l[`site-id`]))}`,{headers:Object.keys(c).length>0?c:void 0}));a(f,{successLabel:`Loaded`})})};function Ri(e){return e.usage(`$0 magic-transit sites lans create <site-id>
343
+
344
+ Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const zi={command:`create <site-id>`,describe:`Create a new Site LAN`,builder:Ri,handler:async t=>c({command:`magic-transit sites lans create`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites lans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/lans`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({bond_id:t[`bond-id`],ha_link:t[`ha-link`],is_breakout:t[`is-breakout`],is_prioritized:t[`is-prioritized`],name:p(t.name,`name`,`text`),nat:{static_prefix:p(t[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:t.physport,routed_subnets:d(t[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:t[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(t[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(t[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:p(t[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:t[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(t[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:t[`vlan-tag`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.sites.lans.create({...e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Created`});return}let m=f({bond_id:t[`bond-id`],ha_link:t[`ha-link`],is_breakout:t[`is-breakout`],is_prioritized:t[`is-prioritized`],name:p(t.name,`name`,`text`),nat:{static_prefix:p(t[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:t.physport,routed_subnets:d(t[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:t[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(t[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(t[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:p(t[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:t[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(t[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:t[`vlan-tag`]}),h=await s(`Creating`,async()=>c.magicTransit.sites.lans.create({...m,account_id:l,site_id:t[`site-id`]}));a(h,{successLabel:`Created`})})};function Bi(e){return e.usage(`$0 magic-transit sites lans delete <lan-id>
345
+
346
+ Remove a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Vi={command:`delete <lan-id>`,describe:`Delete Site LAN`,builder:Bi,handler:async t=>c({command:`magic-transit sites lans delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites lans delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/lans/${t[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(t[`lan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"lan-id":String(t[`lan-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
347
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.lans.delete({account_id:l,site_id:t[`site-id`],lan_id:t[`lan-id`]}));a(u,{successLabel:`Deleted`})})};function Hi(e){return e.usage(`$0 magic-transit sites lans edit <lan-id>
348
+
349
+ Patch a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Ui={command:`edit <lan-id>`,describe:`Patch Site LAN`,builder:Hi,handler:async t=>c({command:`magic-transit sites lans edit`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites lans edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/lans/${t[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(t[`lan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"lan-id":String(t[`lan-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({bond_id:t[`bond-id`],ha_link:t[`ha-link`],is_breakout:t[`is-breakout`],is_prioritized:t[`is-prioritized`],name:p(t.name,`name`,`text`),nat:{static_prefix:p(t[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:t.physport,routed_subnets:d(t[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:t[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(t[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(t[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:p(t[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:t[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(t[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:t[`vlan-tag`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.lans.edit({body:e,account_id:l,site_id:t[`site-id`],lan_id:t[`lan-id`]}));a(n,{successLabel:`Updated`});return}let m=f({bond_id:t[`bond-id`],ha_link:t[`ha-link`],is_breakout:t[`is-breakout`],is_prioritized:t[`is-prioritized`],name:p(t.name,`name`,`text`),nat:{static_prefix:p(t[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:t.physport,routed_subnets:d(t[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:t[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(t[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(t[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:p(t[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:t[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(t[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:t[`vlan-tag`]}),h=await s(`Updating`,async()=>c.magicTransit.sites.lans.edit({body:m,account_id:l,site_id:t[`site-id`],lan_id:t[`lan-id`]}));a(h,{successLabel:`Updated`})})};function Wi(e){return e.usage(`$0 magic-transit sites lans get <lan-id>
350
+
351
+ Get a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gi={command:`get <lan-id>`,describe:`Site LAN Details`,builder:Wi,handler:async t=>c({command:`magic-transit sites lans get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites lans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/lans/${t[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(t[`lan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"lan-id":String(t[`lan-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.lans.get({account_id:l,site_id:t[`site-id`],lan_id:t[`lan-id`]}));a(u,{successLabel:`Loaded`})})};function Ki(e){return e.usage(`$0 magic-transit sites lans list
352
+
353
+ Lists Site LANs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qi={command:`list`,describe:`List Site LANs`,builder:Ki,handler:async t=>c({command:`magic-transit sites lans list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites lans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/lans`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.lans.list({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Loaded`})})};function Ji(e){return e.usage(`$0 magic-transit sites lans update <lan-id>
354
+
355
+ Update a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Yi={command:`update <lan-id>`,describe:`Update Site LAN`,builder:Ji,handler:async t=>c({command:`magic-transit sites lans update`,classification:{safeFlags:[`ha-link`,`is-breakout`,`is-prioritized`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites lans update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/lans/${t[`lan-id`]==null?`<lan-id>`:encodeURIComponent(String(t[`lan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"lan-id":String(t[`lan-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({bond_id:t[`bond-id`],ha_link:t[`ha-link`],is_breakout:t[`is-breakout`],is_prioritized:t[`is-prioritized`],name:p(t.name,`name`,`text`),nat:{static_prefix:p(t[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:t.physport,routed_subnets:d(t[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:t[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(t[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(t[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:p(t[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:t[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(t[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:t[`vlan-tag`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.lans.update({body:e,account_id:l,site_id:t[`site-id`],lan_id:t[`lan-id`]}));a(n,{successLabel:`Updated`});return}let m=f({bond_id:t[`bond-id`],ha_link:t[`ha-link`],is_breakout:t[`is-breakout`],is_prioritized:t[`is-prioritized`],name:p(t.name,`name`,`text`),nat:{static_prefix:p(t[`nat-static-prefix`],`nat-static-prefix`,`text`)},physport:t.physport,routed_subnets:d(t[`routed-subnets`],`routed-subnets`),static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),dhcp_relay:{server_addresses:t[`static-addressing-dhcp-relay-server-addresses`]},dhcp_server:{dhcp_pool_end:p(t[`static-addressing-dhcp-server-dhcp-pool-end`],`static-addressing-dhcp-server-dhcp-pool-end`,`text`),dhcp_pool_start:p(t[`static-addressing-dhcp-server-dhcp-pool-start`],`static-addressing-dhcp-server-dhcp-pool-start`,`text`),dns_server:p(t[`static-addressing-dhcp-server-dns-server`],`static-addressing-dhcp-server-dns-server`,`text`),dns_servers:t[`static-addressing-dhcp-server-dns-servers`]},secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`),virtual_address:p(t[`static-addressing-virtual-address`],`static-addressing-virtual-address`,`text`)},vlan_tag:t[`vlan-tag`]}),h=await s(`Updating`,async()=>c.magicTransit.sites.lans.update({body:m,account_id:l,site_id:t[`site-id`],lan_id:t[`lan-id`]}));a(h,{successLabel:`Updated`})})},Xi={command:`lans`,describe:`Operations for sites.lans`,builder:e=>e.command(zi).command(Vi).command(Ui).command(Gi).command(qi).command(Yi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zi(e){return e.usage(`$0 magic-transit sites list
356
+
357
+ Lists Sites associated with an account. Use connectorid query param to return sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID.`).option(`connectorid`,{type:`string`,description:`Identifier`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qi={command:`list`,describe:`List Sites`,builder:Zi,handler:async t=>c({command:`magic-transit sites list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={connectorid:t.connectorid};if(t.dryRun){let e=await r();o({command:`cf magic-transit sites list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.magicTransit.sites.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function $i(e){return e.usage(`$0 magic-transit sites netflow-config create <site-id>
358
+
359
+ Creates a NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ea={command:`create <site-id>`,describe:`Create NetFlow Configuration`,builder:$i,handler:async t=>c({command:`magic-transit sites netflow-config create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites netflow-config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({active_timeout:t[`active-timeout`],collector_ip:p(t[`collector-ip`],`collector-ip`,`text`),collector_port:t[`collector-port`],inactive_timeout:t[`inactive-timeout`],sampling_rate:t[`sampling-rate`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.sites.netflowConfig.create({body:e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Created`});return}let d=f({active_timeout:t[`active-timeout`],collector_ip:p(t[`collector-ip`],`collector-ip`,`text`),collector_port:t[`collector-port`],inactive_timeout:t[`inactive-timeout`],sampling_rate:t[`sampling-rate`]}),m=await s(`Creating`,async()=>c.magicTransit.sites.netflowConfig.create({body:d,account_id:l,site_id:t[`site-id`]}));a(m,{successLabel:`Created`})})};function ta(e){return e.usage(`$0 magic-transit sites netflow-config delete <site-id>
360
+
361
+ Remove NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const na={command:`delete <site-id>`,describe:`Delete NetFlow Configuration`,builder:ta,handler:async t=>c({command:`magic-transit sites netflow-config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites netflow-config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
362
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.netflowConfig.delete({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Deleted`})})};function ra(e){return e.usage(`$0 magic-transit sites netflow-config edit <site-id>
363
+
364
+ Updates NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ia={command:`edit <site-id>`,describe:`Update NetFlow Configuration`,builder:ra,handler:async t=>c({command:`magic-transit sites netflow-config edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites netflow-config edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({active_timeout:t[`active-timeout`],collector_ip:p(t[`collector-ip`],`collector-ip`,`text`),collector_port:t[`collector-port`],inactive_timeout:t[`inactive-timeout`],sampling_rate:t[`sampling-rate`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.edit({body:e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Updated`});return}let d=f({active_timeout:t[`active-timeout`],collector_ip:p(t[`collector-ip`],`collector-ip`,`text`),collector_port:t[`collector-port`],inactive_timeout:t[`inactive-timeout`],sampling_rate:t[`sampling-rate`]}),m=await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.edit({body:d,account_id:l,site_id:t[`site-id`]}));a(m,{successLabel:`Updated`})})};function aa(e){return e.usage(`$0 magic-transit sites netflow-config get <site-id>
365
+
366
+ Get NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oa={command:`get <site-id>`,describe:`NetFlow Configuration Details`,builder:aa,handler:async t=>c({command:`magic-transit sites netflow-config get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites netflow-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.netflowConfig.get({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Loaded`})})};function sa(e){return e.usage(`$0 magic-transit sites netflow-config update <site-id>
367
+
368
+ Updates NetFlow configuration for a site (partial update).`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ca={command:`update <site-id>`,describe:`Update NetFlow Configuration`,builder:sa,handler:async t=>c({command:`magic-transit sites netflow-config update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites netflow-config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/netflow_config`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({active_timeout:t[`active-timeout`],collector_ip:p(t[`collector-ip`],`collector-ip`,`text`),collector_port:t[`collector-port`],inactive_timeout:t[`inactive-timeout`],sampling_rate:t[`sampling-rate`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.update({body:e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Updated`});return}let d=f({active_timeout:t[`active-timeout`],collector_ip:p(t[`collector-ip`],`collector-ip`,`text`),collector_port:t[`collector-port`],inactive_timeout:t[`inactive-timeout`],sampling_rate:t[`sampling-rate`]}),m=await s(`Updating`,async()=>c.magicTransit.sites.netflowConfig.update({body:d,account_id:l,site_id:t[`site-id`]}));a(m,{successLabel:`Updated`})})},la={command:`netflow-config`,describe:`Operations for sites.netflow-config`,builder:e=>e.command(ea).command(na).command(ia).command(oa).command(ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ua(e){return e.usage(`$0 magic-transit sites update <site-id>
369
+
370
+ Update a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const da={command:`update <site-id>`,describe:`Update Site`,builder:ua,handler:async t=>c({command:`magic-transit sites update`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({connector_id:p(t[`connector-id`],`connector-id`,`text`),description:p(t.description,`description`,`text`),ha_mode:t[`ha-mode`],location:{lat:p(t[`location-lat`],`location-lat`,`text`),lon:p(t[`location-lon`],`location-lon`,`text`)},name:p(t.name,`name`,`text`),secondary_connector_id:p(t[`secondary-connector-id`],`secondary-connector-id`,`text`)}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.update({body:e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Updated`});return}let d=f({connector_id:p(t[`connector-id`],`connector-id`,`text`),description:p(t.description,`description`,`text`),ha_mode:t[`ha-mode`],location:{lat:p(t[`location-lat`],`location-lat`,`text`),lon:p(t[`location-lon`],`location-lon`,`text`)},name:p(t.name,`name`,`text`),secondary_connector_id:p(t[`secondary-connector-id`],`secondary-connector-id`,`text`)}),m=await s(`Updating`,async()=>c.magicTransit.sites.update({body:d,account_id:l,site_id:t[`site-id`]}));a(m,{successLabel:`Updated`})})};function fa(e){return e.usage(`$0 magic-transit sites wans create <site-id>
371
+
372
+ Creates a new Site WAN.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:"Magic WAN health check rate for tunnels created on this link. The default value is `mid`.",choices:[`low`,`mid`,`high`],default:`mid`}).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`,default:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const pa={command:`create <site-id>`,describe:`Create a new Site WAN`,builder:fa,handler:async t=>c({command:`magic-transit sites wans create`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites wans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/wans`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({health_check_rate:p(t[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:t[`load-balance-inner-flows`],name:p(t.name,`name`,`text`),physport:t.physport,priority:t.priority,static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(t[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:t[`vlan-tag`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Creating`,async()=>c.magicTransit.sites.wans.create({...e,account_id:l,site_id:t[`site-id`]}));a(n,{successLabel:`Created`});return}if(t.physport===void 0)throw Error(`--physport is required (or pass --body with this field set).`);let d=f({health_check_rate:p(t[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:t[`load-balance-inner-flows`],name:p(t.name,`name`,`text`),physport:t.physport,priority:t.priority,static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(t[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:t[`vlan-tag`]}),m=await s(`Creating`,async()=>c.magicTransit.sites.wans.create({...d,account_id:l,site_id:t[`site-id`]}));a(m,{successLabel:`Created`})})};function ma(e){return e.usage(`$0 magic-transit sites wans delete <wan-id>
373
+
374
+ Remove a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ha={command:`delete <wan-id>`,describe:`Delete Site WAN`,builder:ma,handler:async t=>c({command:`magic-transit sites wans delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites wans delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/wans/${t[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(t[`wan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"wan-id":String(t[`wan-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
375
+ `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.wans.delete({account_id:l,site_id:t[`site-id`],wan_id:t[`wan-id`]}));a(u,{successLabel:`Deleted`})})};function ga(e){return e.usage(`$0 magic-transit sites wans edit <wan-id>
376
+
377
+ Patch a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:`Magic WAN health check rate for tunnels created on this link.`,choices:[`low`,`mid`,`high`]}).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const _a={command:`edit <wan-id>`,describe:`Patch Site WAN`,builder:ga,handler:async t=>c({command:`magic-transit sites wans edit`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites wans edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/wans/${t[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(t[`wan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"wan-id":String(t[`wan-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({health_check_rate:p(t[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:t[`load-balance-inner-flows`],name:p(t.name,`name`,`text`),physport:t.physport,priority:t.priority,static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(t[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:t[`vlan-tag`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.wans.edit({body:e,account_id:l,site_id:t[`site-id`],wan_id:t[`wan-id`]}));a(n,{successLabel:`Updated`});return}let d=f({health_check_rate:p(t[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:t[`load-balance-inner-flows`],name:p(t.name,`name`,`text`),physport:t.physport,priority:t.priority,static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(t[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:t[`vlan-tag`]}),m=await s(`Updating`,async()=>c.magicTransit.sites.wans.edit({body:d,account_id:l,site_id:t[`site-id`],wan_id:t[`wan-id`]}));a(m,{successLabel:`Updated`})})};function va(e){return e.usage(`$0 magic-transit sites wans get <wan-id>
378
+
379
+ Get a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ya={command:`get <wan-id>`,describe:`Site WAN Details`,builder:va,handler:async t=>c({command:`magic-transit sites wans get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites wans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/wans/${t[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(t[`wan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"wan-id":String(t[`wan-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.wans.get({account_id:l,site_id:t[`site-id`],wan_id:t[`wan-id`]}));a(u,{successLabel:`Loaded`})})};function ba(e){return e.usage(`$0 magic-transit sites wans list
380
+
381
+ Lists Site WANs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xa={command:`list`,describe:`List Site WANs`,builder:ba,handler:async t=>c({command:`magic-transit sites wans list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites wans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/wans`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.magicTransit.sites.wans.list({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Loaded`})})};function Sa(e){return e.usage(`$0 magic-transit sites wans update <wan-id>
382
+
383
+ Update a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:`Magic WAN health check rate for tunnels created on this link.`,choices:[`low`,`mid`,`high`]}).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Ca={command:`update <wan-id>`,describe:`Update Site WAN`,builder:Sa,handler:async t=>c({command:`magic-transit sites wans update`,classification:{safeFlags:[`health-check-rate`,`load-balance-inner-flows`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit sites wans update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/sites/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}/wans/${t[`wan-id`]==null?`<wan-id>`:encodeURIComponent(String(t[`wan-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``),"wan-id":String(t[`wan-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({health_check_rate:p(t[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:t[`load-balance-inner-flows`],name:p(t.name,`name`,`text`),physport:t.physport,priority:t.priority,static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(t[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:t[`vlan-tag`]}):u(t.body)});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,t.body){let e=u(t.body),n=await s(`Updating`,async()=>c.magicTransit.sites.wans.update({body:e,account_id:l,site_id:t[`site-id`],wan_id:t[`wan-id`]}));a(n,{successLabel:`Updated`});return}let d=f({health_check_rate:p(t[`health-check-rate`],`health-check-rate`,`text`),load_balance_inner_flows:t[`load-balance-inner-flows`],name:p(t.name,`name`,`text`),physport:t.physport,priority:t.priority,static_addressing:{address:p(t[`static-addressing-address`],`static-addressing-address`,`text`),gateway_address:p(t[`static-addressing-gateway-address`],`static-addressing-gateway-address`,`text`),secondary_address:p(t[`static-addressing-secondary-address`],`static-addressing-secondary-address`,`text`)},vlan_tag:t[`vlan-tag`]}),m=await s(`Updating`,async()=>c.magicTransit.sites.wans.update({body:d,account_id:l,site_id:t[`site-id`],wan_id:t[`wan-id`]}));a(m,{successLabel:`Updated`})})},wa={command:`wans`,describe:`Operations for sites.wans`,builder:e=>e.command(pa).command(ha).command(_a).command(ya).command(xa).command(Ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ta={command:`sites`,describe:`Magic WAN branch sites — base CRUD, LAN/WAN interface configuration, ACLs, connectors, app configuration, and NetFlow config`,builder:e=>e.command(ji).command(Ni).command(Fi).command(Li).command(Qi).command(da).command(bi).command(ki).command(Xi).command(la).command(wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ea={command:`magic-transit`,describe:`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,builder:e=>e.command(I).command(Rt).command(qt).command(an).command(un).command(yn).command(Rn).command(Zn).command(mr).command(Fr).command(Kr).command(si).command(Ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ea as default};