cf 1.0.0-beta.14 → 1.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/README.md +10 -0
  2. package/dist/_meta/commands.json +3409 -621
  3. package/dist/_meta/hand-written-commands.json +33 -0
  4. package/dist/_meta/schemas.json +2160 -246
  5. package/dist/abuse-reports-CnQBtN1G.mjs +24 -0
  6. package/dist/{access-k1QjF5rE.mjs → access-BzmXSwzj.mjs} +1 -1
  7. package/dist/account-tags-2qPWbW17.mjs +15 -0
  8. package/dist/accounts-B0Byg-AV.mjs +132 -0
  9. package/dist/acm-DgAu0cnk.mjs +15 -0
  10. package/dist/addressing-J1oa0ML2.mjs +105 -0
  11. package/dist/agent-memory-4KGou-tm.mjs +34 -0
  12. package/dist/ai-WY7wVQfA.mjs +31 -0
  13. package/dist/ai-audit-D38HaEoZ.mjs +6 -0
  14. package/dist/ai-gateway-C0gIipT8.mjs +80 -0
  15. package/dist/ai-search-ClwnPU-9.mjs +79 -0
  16. package/dist/ai-security-BIsvFPYV.mjs +10 -0
  17. package/dist/alerting-MHhv28oO.mjs +56 -0
  18. package/dist/analytics-BfBz7bqB.mjs +17 -0
  19. package/dist/analytics_engine-CXVdBF1n.mjs +4 -0
  20. package/dist/api-eMuS5GI1.mjs +3 -0
  21. package/dist/api-security-DUCfcdC1.mjs +154 -0
  22. package/dist/argo-CUlzI4v3.mjs +14 -0
  23. package/dist/artifacts-BLfWGzBg.mjs +43 -0
  24. package/dist/audit-logs-CsfIm2QS.mjs +4 -0
  25. package/dist/auth-8Sm4uLGM.mjs +2 -0
  26. package/dist/auth-C6u9qIGO.mjs +2 -0
  27. package/dist/auth-CGRemu5W.mjs +2 -0
  28. package/dist/{auth-token-Dop0wLCw.mjs → auth-token-DkkYg4DP.mjs} +1 -1
  29. package/dist/{autoconfig-RQ3HS4m1.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
  30. package/dist/basin-catalog-CrKRYJ0b.mjs +46 -0
  31. package/dist/billing-NxehgXrR.mjs +23 -0
  32. package/dist/blocks-Bat9A8V_.mjs +5 -0
  33. package/dist/bot-management-C993iQKL.mjs +9 -0
  34. package/dist/botnet-feed-CZ4vYk5y.mjs +11 -0
  35. package/dist/brand-protection-ADVgIi0l.mjs +27 -0
  36. package/dist/browser-run-CEptKZYl.mjs +42 -0
  37. package/dist/build-Bm6kGyzo.mjs +2 -0
  38. package/dist/{build-CCe7IrWT.mjs → build-sBpqm9ga.mjs} +1 -1
  39. package/dist/builds-DqtiTH7p.mjs +71 -0
  40. package/dist/cache-hX5QxmI0.mjs +45 -0
  41. package/dist/certificate-authorities-BOcybjc1.mjs +6 -0
  42. package/dist/cf-Bq4pA4n6.mjs +18 -0
  43. package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
  44. package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
  45. package/dist/{chunk-DSGVRFIS-CPI5cYtB.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
  46. package/dist/{cli-ht4q6i2y.mjs → cli-R8h3OKZI.mjs} +1 -1
  47. package/dist/client-certificates-Bez_ArKE.mjs +13 -0
  48. package/dist/client-side-security-CSmA50Bv.mjs +63 -0
  49. package/dist/cloud-connector-0Wivqi7S.mjs +6 -0
  50. package/dist/{cloudflared-D83U8Yn3.mjs → cloudflared-By8BzYXc.mjs} +1 -1
  51. package/dist/cloudforce-one-J-rU6k1U.mjs +405 -0
  52. package/dist/{command-9VAc7b30.mjs → command-0BOb1pgV.mjs} +1 -1
  53. package/dist/{command-CyJQ40fc.mjs → command-BCJN-ZM2.mjs} +1 -1
  54. package/dist/{command-OHov3PEc.mjs → command-BG-kLOnS.mjs} +1 -1
  55. package/dist/{command-B_Ixlz8Q.mjs → command-BIsI-mMX.mjs} +1 -1
  56. package/dist/{command-SmWD-MeI.mjs → command-BKDbbA-L.mjs} +1 -1
  57. package/dist/command-BWQIKu6I.mjs +2 -0
  58. package/dist/{command-Ckb9FufU.mjs → command-Bdy69UFU.mjs} +1 -1
  59. package/dist/{command-CtVUNm__.mjs → command-Bgb-3yPg.mjs} +1 -1
  60. package/dist/{command-DtgJilOK.mjs → command-C6w1OdoC.mjs} +1 -1
  61. package/dist/{command-BtDY_MKv.mjs → command-CKW6UhTh.mjs} +1 -1
  62. package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
  63. package/dist/{command-DjEJaOwV.mjs → command-DIs-Nqtl.mjs} +1 -1
  64. package/dist/command-DPn5ANHs.mjs +2 -0
  65. package/dist/{command-CUNMrMou.mjs → command-DZfKHiru.mjs} +1 -1
  66. package/dist/{command-DXaRn1ls.mjs → command-DppVezAB.mjs} +1 -1
  67. package/dist/{completions-CuqAO3N_.mjs → completions-CpNGTlUX.mjs} +1 -1
  68. package/dist/config.mjs +0 -0
  69. package/dist/connector-interrupts-CH-DaLuo.mjs +6 -0
  70. package/dist/connector-telemetry-events-X3Fod9nl.mjs +6 -0
  71. package/dist/connector-telemetry-snapshots-D-WR4npQ.mjs +6 -0
  72. package/dist/connectors-CORKD31m.mjs +15 -0
  73. package/dist/containers-BboUbx3k.mjs +78 -0
  74. package/dist/containers-Di3_Vopq.mjs +376 -0
  75. package/dist/content-scan-DXGREAXa.mjs +14 -0
  76. package/dist/{context-BBLtgdR1.mjs → context-A6T-NKPI.mjs} +2 -2
  77. package/dist/{cps-C5phNoVU.mjs → cps-1BoOLtTq.mjs} +3 -3
  78. package/dist/create-OXylMu6m.mjs +2 -0
  79. package/dist/csamScanner-CHfbfeup.mjs +10 -0
  80. package/dist/ct-alerting-DlH4ILQo.mjs +5 -0
  81. package/dist/custom-certificates-zJqJZ2Th.mjs +17 -0
  82. package/dist/custom-csrs-DoLIGqYL.mjs +11 -0
  83. package/dist/custom-hostnames-YfV-aoAK.mjs +27 -0
  84. package/dist/custom-nameservers-BV43gmgt.mjs +9 -0
  85. package/dist/custom-pages-CoOU1Cdx.mjs +21 -0
  86. package/dist/{d1-EQMUlHTJ.mjs → d1-DujBmzLa.mjs} +31 -31
  87. package/dist/dcv-delegation-CPLsVYOl.mjs +4 -0
  88. package/dist/delegate.mjs +0 -0
  89. package/dist/deploy-context-tEhwEXnA.mjs +56 -0
  90. package/dist/{deploy-input-BCjcuP6u.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
  91. package/dist/{deploy-B22sEVHd.mjs → deploy-wNujfGUJ.mjs} +1 -1
  92. package/dist/{dev-ClhhXuNU.mjs → dev-EtnMYA7K.mjs} +1 -1
  93. package/dist/diagnostics-B3TYPVRi.mjs +15 -0
  94. package/dist/{dist-DmRM6WSZ.mjs → dist-DZRTPMMA.mjs} +4 -4
  95. package/dist/dls-CWm1HRF0.mjs +17 -0
  96. package/dist/dns-CjAFU7Z9.mjs +144 -0
  97. package/dist/dns-firewall-BooBP9ap.mjs +71 -0
  98. package/dist/docs-C5XB7HdG.mjs +3 -0
  99. package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
  100. package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
  101. package/dist/durable-objects-CSrMQDCE.mjs +6 -0
  102. package/dist/email-auth-Bp1Mui-n.mjs +6 -0
  103. package/dist/email-routing-CVF6SwQt.mjs +45 -0
  104. package/dist/email-security-mYZtazae.mjs +158 -0
  105. package/dist/email-sending-BqaKU_Xu.mjs +47 -0
  106. package/dist/error-sanitization-CIQOep3I.mjs +2 -0
  107. package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
  108. package/dist/fieldExtractors-CAGZVmYg.mjs +9 -0
  109. package/dist/firewall-DgTDsYOt.mjs +36 -0
  110. package/dist/flagship-Db3PxxyZ.mjs +28 -0
  111. package/dist/fraud-BEOQczy8.mjs +22 -0
  112. package/dist/get-By1q8YlI.mjs +2 -0
  113. package/dist/get-CRKvqCu6.mjs +2 -0
  114. package/dist/get-iPUHxD1r.mjs +2 -0
  115. package/dist/google-tag-gateway-DjLQ9wo0.mjs +6 -0
  116. package/dist/healthchecks-C3ScnKss.mjs +22 -0
  117. package/dist/{hostnames-DvaUSzsj.mjs → hostnames-DU0k-xO9.mjs} +6 -6
  118. package/dist/hyperdrive-IpCCLCRd.mjs +37 -0
  119. package/dist/iam-96CYM8Vw.mjs +52 -0
  120. package/dist/images-AB9EgZgT.mjs +71 -0
  121. package/dist/index.mjs +1 -1
  122. package/dist/{init-Da8pe296.mjs → init-D2nPoW4f.mjs} +2 -2
  123. package/dist/intel-BKb4RLvS.mjs +76 -0
  124. package/dist/ips-z9APCV_b.mjs +4 -0
  125. package/dist/k2-Bv-HiJ29.mjs +11 -0
  126. package/dist/keyless-certificates-ChgSGHq4.mjs +13 -0
  127. package/dist/keys-BhngDsDa.mjs +4 -0
  128. package/dist/kv-CB5MQVGP.mjs +15 -0
  129. package/dist/{lazy-command-CDWwCsD2.mjs → lazy-command-CaZ1kdlW.mjs} +1 -1
  130. package/dist/leaked-credential-checks-Bsi2WpSU.mjs +18 -0
  131. package/dist/{load-balancers-Bu9pd2SV.mjs → load-balancers-0gXZNCeI.mjs} +40 -40
  132. package/dist/{local-BcPM4I0s.mjs → local-Dil4fTWX.mjs} +1 -1
  133. package/dist/local-DxWDQDnG.mjs +2 -0
  134. package/dist/{local-runtime-BHKyRlCP.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
  135. package/dist/login-CiQGR8ha.mjs +5 -0
  136. package/dist/login-Ik98G4K6.mjs +2 -0
  137. package/dist/logo-matches-DmoF5Otu.mjs +6 -0
  138. package/dist/logos-BL6ohIMH.mjs +7 -0
  139. package/dist/logpush-UVopW68t.mjs +46 -0
  140. package/dist/logs-BVfxiEiM.mjs +36 -0
  141. package/dist/magic-cloud-networking-B5S3aM6f.mjs +71 -0
  142. package/dist/magic-network-monitoring-CDSJPP47.mjs +36 -0
  143. package/dist/magic-transit-TcDTKM43.mjs +386 -0
  144. package/dist/managed-defense-C88HL0pg.mjs +18 -0
  145. package/dist/managed-transforms-Ja41Tahl.mjs +9 -0
  146. package/dist/matches-BL_Y-9Yq.mjs +6 -0
  147. package/dist/mcp-BWp5Q09R.mjs +32 -0
  148. package/dist/mesh-lFPLRWhV.mjs +26 -0
  149. package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
  150. package/dist/monetization-BIc4Bwo2.mjs +20 -0
  151. package/dist/mtls-certificates-CVBw-Jli.mjs +13 -0
  152. package/dist/network-Wig0qbaC.mjs +50 -0
  153. package/dist/network-interconnects-C16z1HuQ.mjs +72 -0
  154. package/dist/o11y-Bhy4qDRm.mjs +93 -0
  155. package/dist/oauth-CfEedDZi.mjs +4 -0
  156. package/dist/oauth-clients-eXjmK5yf.mjs +16 -0
  157. package/dist/{oauth-n8um6MFk.mjs → oauth-oWaW7ICv.mjs} +1 -1
  158. package/dist/oauth-scopes-DZWn50EA.mjs +4 -0
  159. package/dist/organization-QdAQTrKa.mjs +71 -0
  160. package/dist/organizations-CgAQYdK5.mjs +4 -0
  161. package/dist/origin-ca-certificates-BklXqp8X.mjs +11 -0
  162. package/dist/origin-post-quantum-encryption-Dg16ueT4.mjs +6 -0
  163. package/dist/origin-tls-client-auth-d8bDU5zU.mjs +30 -0
  164. package/dist/output-Co4xdFf6.mjs +2 -0
  165. package/dist/page-rules-CgMkC6YR.mjs +39 -0
  166. package/dist/{pages-Bn0Sg1ay.mjs → pages-CkBtOOf8.mjs} +29 -29
  167. package/dist/path-DRw6Y-nd.mjs +2 -0
  168. package/dist/pay-per-crawl-CnGXOWyz.mjs +38 -0
  169. package/dist/pay-per-use-HbfxpATr.mjs +33 -0
  170. package/dist/pipelines-CnO9CCs0.mjs +44 -0
  171. package/dist/precursor-Bc55XJdQ.mjs +4 -0
  172. package/dist/previews-C7vZrajd.mjs +7 -0
  173. package/dist/progress-D5po7ScB.mjs +2 -0
  174. package/dist/prompt-BAJpE3jV.mjs +4 -0
  175. package/dist/queries-BJAH4B74.mjs +9 -0
  176. package/dist/queues-D4G8vvwi.mjs +57 -0
  177. package/dist/r2-CJ8rD6Jb.mjs +128 -0
  178. package/dist/{radar-CdvQL4xm.mjs → radar-DgaxOdcd.mjs} +150 -150
  179. package/dist/raw-fetch-yY-wX5Xx.mjs +2 -0
  180. package/dist/realtime-DU09m7L7.mjs +172 -0
  181. package/dist/registrar-Cj7OfvGs.mjs +43 -0
  182. package/dist/registrar-sandbox-CA0Mua-j.mjs +56 -0
  183. package/dist/{registry-PI6sO95I.mjs → registry-CRnk93ur.mjs} +1 -1
  184. package/dist/reporting-3kDVF5c8.mjs +14 -0
  185. package/dist/{request-headers-D8L95bEQ.mjs → request-headers-D_eQn93b.mjs} +1 -1
  186. package/dist/request-tracers-VBD4R3s3.mjs +4 -0
  187. package/dist/resolve-BpgXeklt.mjs +2 -0
  188. package/dist/resolve-C3FmNlSO.mjs +2 -0
  189. package/dist/resource-sharing-BtUF3psS.mjs +40 -0
  190. package/dist/resource-tagging--90INP8_.mjs +4 -0
  191. package/dist/rules-CcwPngVo.mjs +18 -0
  192. package/dist/rulesets-CfdruY82.mjs +37 -0
  193. package/dist/rum-RLkdfSL7.mjs +30 -0
  194. package/dist/run-CUNhH5CQ.mjs +2 -0
  195. package/dist/{run-CW2Cgi0S.mjs → run-DASYqJsY.mjs} +1 -1
  196. package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
  197. package/dist/{schema-flags-BTItUu1K.mjs → schema-flags-CShtn7ya.mjs} +1 -1
  198. package/dist/scim-BZYsTPIL.mjs +18 -0
  199. package/dist/secrets-store-C_-FkSH_.mjs +24 -0
  200. package/dist/security-insights-BVBEaZmD.mjs +40 -0
  201. package/dist/security-txt--IoHrHee.mjs +9 -0
  202. package/dist/session-Cq3YNLoI.mjs +2 -0
  203. package/dist/shared-zNQNv1im.mjs +2 -0
  204. package/dist/smart-shield-CByC4_60.mjs +24 -0
  205. package/dist/snippets-DB-jiZAV.mjs +20 -0
  206. package/dist/{spawn-D07wH-MH.mjs → spawn-DQttFH05.mjs} +1 -1
  207. package/dist/{spectrum-B6qkjR_Z.mjs → spectrum-Bs2g1BmK.mjs} +14 -14
  208. package/dist/speed-Bq4evEnJ.mjs +24 -0
  209. package/dist/sql-XGci7hZC.mjs +4 -0
  210. package/dist/src-GiuwAT55.mjs +125 -0
  211. package/dist/ssl-KJTLW1NR.mjs +45 -0
  212. package/dist/{startup-profile-CrtCP-6-.mjs → startup-profile-BOaseXnO.mjs} +1 -1
  213. package/dist/startup-profile-BwEZFVGS.mjs +2 -0
  214. package/dist/{state-DIiIGEtR.mjs → state-Boubf1X6.mjs} +1 -1
  215. package/dist/state-CODDG9Nx.mjs +2 -0
  216. package/dist/stream-BotgYspF.mjs +102 -0
  217. package/dist/submit-C5VytaHP.mjs +4 -0
  218. package/dist/{tags-CX23P4jg.mjs → tags-3Hq-B9qp.mjs} +2 -2
  219. package/dist/{telemetry-ZlCi5Xhc.mjs → telemetry-3FJOXl_C.mjs} +1 -1
  220. package/dist/telemetry-BhKfwxyh.mjs +2 -0
  221. package/dist/tenant-BgX5onPc.mjs +10 -0
  222. package/dist/tenant-custom-nameservers-BVG8v1Xo.mjs +9 -0
  223. package/dist/theme-BGHWSKCw.mjs +6 -0
  224. package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
  225. package/dist/{tunnels-NzYpsfi_.mjs → tunnels-CThOI3qH.mjs} +15 -15
  226. package/dist/turnstile-BgZaUx-g.mjs +33 -0
  227. package/dist/ui-BtIBQeaG.mjs +2 -0
  228. package/dist/update-check-Yy7Ivq2V.mjs +2 -0
  229. package/dist/{update-check-HFkPml6x.mjs → update-check-jb89ih_g.mjs} +1 -1
  230. package/dist/update-check-worker.mjs +1 -1
  231. package/dist/url-info-DQERN0Xq.mjs +4 -0
  232. package/dist/url-normalization-Cb1hofqv.mjs +9 -0
  233. package/dist/url-scanner-gHgx1bW7.mjs +16 -0
  234. package/dist/{user-rXca0J9M.mjs → user-CdKzIuSi.mjs} +58 -58
  235. package/dist/values-EwA8Sx0w.mjs +4 -0
  236. package/dist/vectorize-DejgIJIv.mjs +32 -0
  237. package/dist/version-B6MnUIqV.mjs +2 -0
  238. package/dist/{waiting-rooms-DrA3-0bw.mjs → waiting-rooms-BNR1HvAP.mjs} +25 -25
  239. package/dist/web-assets-iglnzkTV.mjs +64 -0
  240. package/dist/web3-JBUU6IVt.mjs +28 -0
  241. package/dist/workers-CDp4kLTJ.mjs +40 -0
  242. package/dist/workers-builds-CSb9Dglt.mjs +14 -0
  243. package/dist/workers-for-platforms-D4srNZvt.mjs +40 -0
  244. package/dist/workers-vpc-LPC8TadH.mjs +13 -0
  245. package/dist/workflows-DN_VqWJC.mjs +52 -0
  246. package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
  247. package/dist/zaraz-DDErl5yc.mjs +22 -0
  248. package/dist/zero-trust-M88XX3uD.mjs +957 -0
  249. package/dist/zone-BsGvedmN.mjs +4 -0
  250. package/dist/zones-l_sRKrVl.mjs +124 -0
  251. package/package.json +15 -18
  252. package/dist/Page-BShsqCXr.mjs +0 -2
  253. package/dist/abuse-reports-CVv52Q2w.mjs +0 -24
  254. package/dist/account-tags-RhvWOkOf.mjs +0 -15
  255. package/dist/accounts--3lrEkmu.mjs +0 -125
  256. package/dist/acm-BJxINEcu.mjs +0 -15
  257. package/dist/addressing-BqByG9JW.mjs +0 -105
  258. package/dist/agent-memory-D4dQMGbh.mjs +0 -34
  259. package/dist/ai-CRkQ4pjC.mjs +0 -31
  260. package/dist/ai-audit-fMSn4c5L.mjs +0 -6
  261. package/dist/ai-gateway-CbhvQK4L.mjs +0 -80
  262. package/dist/ai-search-CvVSnOA0.mjs +0 -79
  263. package/dist/ai-security-Z_qpI92I.mjs +0 -10
  264. package/dist/alerting-CpbCB8br.mjs +0 -56
  265. package/dist/analytics-DkY9dOP1.mjs +0 -17
  266. package/dist/analytics_engine-DE_jvlx_.mjs +0 -4
  267. package/dist/api-security-BHnOU5MM.mjs +0 -154
  268. package/dist/argo-DhC5L_aN.mjs +0 -14
  269. package/dist/args-CfbYkeXd.mjs +0 -2
  270. package/dist/artifacts-CrIupY7P.mjs +0 -43
  271. package/dist/audit-logs-BjeBxTox.mjs +0 -4
  272. package/dist/auth-BNYfOMl0.mjs +0 -2
  273. package/dist/auth-CAWalgW0.mjs +0 -2
  274. package/dist/auth-DOwC01PW.mjs +0 -2
  275. package/dist/banner-D03JEqRs.mjs +0 -2
  276. package/dist/basin-catalog-DZ7QV-_N.mjs +0 -46
  277. package/dist/billing-BFyte9fL.mjs +0 -23
  278. package/dist/bot-management-DXcbV3am.mjs +0 -9
  279. package/dist/botnet-feed-bGGp_cwX.mjs +0 -11
  280. package/dist/brand-protection-DN36XkxH.mjs +0 -27
  281. package/dist/browser-run-hHD1RT43.mjs +0 -42
  282. package/dist/build-BhpWYgNm.mjs +0 -2
  283. package/dist/builds-6aO61R9R.mjs +0 -71
  284. package/dist/cache-C5YJpMqi.mjs +0 -45
  285. package/dist/certificate-authorities-CbqDAktQ.mjs +0 -6
  286. package/dist/cf-oRSQKirD.mjs +0 -18
  287. package/dist/chunk-NDZDTP46-Civns3WA.mjs +0 -361
  288. package/dist/cli-types-9oYmRTHJ.mjs +0 -2
  289. package/dist/client-certificates-balaN_my.mjs +0 -13
  290. package/dist/client-side-security-3_4Ermmg.mjs +0 -63
  291. package/dist/cloud-connector-avx27sLw.mjs +0 -6
  292. package/dist/cloudforce-one-CXdeqJ9l.mjs +0 -405
  293. package/dist/command-DPX9sJVi.mjs +0 -2
  294. package/dist/command-OWe3v69l.mjs +0 -2
  295. package/dist/connector-interrupts-ftd10Du-.mjs +0 -6
  296. package/dist/connector-telemetry-events-TwDZYdEM.mjs +0 -6
  297. package/dist/connector-telemetry-snapshots-CZxkOuC3.mjs +0 -6
  298. package/dist/connectors-6lVSr-fd.mjs +0 -15
  299. package/dist/containers-Dqs_ZnO2.mjs +0 -78
  300. package/dist/containers-ncw3bd3a.mjs +0 -376
  301. package/dist/content-scan-BWFbqfQ0.mjs +0 -14
  302. package/dist/csamScanner-BwZNZu0A.mjs +0 -10
  303. package/dist/ct-alerting-DPp3qLqO.mjs +0 -5
  304. package/dist/custom-certificates-pfpZcr06.mjs +0 -17
  305. package/dist/custom-csrs-DrvGRAkl.mjs +0 -11
  306. package/dist/custom-hostnames-wGtmFbz1.mjs +0 -27
  307. package/dist/custom-nameservers-HTG6MPKv.mjs +0 -9
  308. package/dist/custom-pages-DqEHBSVt.mjs +0 -21
  309. package/dist/dcv-delegation-D6nj0Z5N.mjs +0 -4
  310. package/dist/deploy-context-DmG9rgPO.mjs +0 -56
  311. package/dist/diagnostics-tqHjq-Pl.mjs +0 -15
  312. package/dist/dls-BEHj4X9T.mjs +0 -17
  313. package/dist/dns-firewall-zwbkutyf.mjs +0 -71
  314. package/dist/dns-n4mfYBZg.mjs +0 -144
  315. package/dist/durable-objects-CQ2dHhho.mjs +0 -6
  316. package/dist/email-auth-DOi6yOt3.mjs +0 -6
  317. package/dist/email-routing-WcSPt22u.mjs +0 -45
  318. package/dist/email-security-BXu3OGay.mjs +0 -158
  319. package/dist/email-sending-B9zTlIjt.mjs +0 -47
  320. package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
  321. package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
  322. package/dist/errors-_sob7Ihu.mjs +0 -3
  323. package/dist/fieldExtractors-B37m2lKW.mjs +0 -9
  324. package/dist/firewall-CRtYO0Ha.mjs +0 -36
  325. package/dist/flagship-DvTFZSay.mjs +0 -28
  326. package/dist/fraud-uSyibsit.mjs +0 -22
  327. package/dist/google-tag-gateway-BFXiiokq.mjs +0 -6
  328. package/dist/healthchecks-27u7b7Jb.mjs +0 -22
  329. package/dist/hyperdrive-BzJvPdu6.mjs +0 -37
  330. package/dist/iam-Dl3cU9GI.mjs +0 -52
  331. package/dist/images-C2OkI1j7.mjs +0 -71
  332. package/dist/intel-DoB1g_K7.mjs +0 -76
  333. package/dist/ips-BRt68epr.mjs +0 -4
  334. package/dist/k2-_eq5ZY2t.mjs +0 -11
  335. package/dist/keyless-certificates-DaO2yqYu.mjs +0 -13
  336. package/dist/keys-7BQ3Zq6Y.mjs +0 -4
  337. package/dist/kv-BTYCXKML.mjs +0 -15
  338. package/dist/leaked-credential-checks-CPHOK_dE.mjs +0 -18
  339. package/dist/local-BundUuDT.mjs +0 -2
  340. package/dist/login-BBYC_BtH.mjs +0 -2
  341. package/dist/login-D2uoWhWh.mjs +0 -5
  342. package/dist/logo-matches-Bc1DQ4-g.mjs +0 -6
  343. package/dist/logos-X5B8z7Iv.mjs +0 -7
  344. package/dist/logpush-C2ENi1et.mjs +0 -46
  345. package/dist/logs-BKDz7kBW.mjs +0 -36
  346. package/dist/magic-cloud-networking-B60Gld8A.mjs +0 -71
  347. package/dist/magic-network-monitoring-CxXI3Y-H.mjs +0 -36
  348. package/dist/magic-transit-ZCSaCbl8.mjs +0 -386
  349. package/dist/managed-defense-DrxMb7xi.mjs +0 -18
  350. package/dist/managed-transforms-AI7KrRU1.mjs +0 -9
  351. package/dist/matches-rPMLS3Ip.mjs +0 -6
  352. package/dist/mcp-DXUMvEWt.mjs +0 -32
  353. package/dist/mesh-MmBCQ37q.mjs +0 -26
  354. package/dist/monetization-DQE5VtUO.mjs +0 -20
  355. package/dist/mtls-certificates-DwkEb-Hy.mjs +0 -13
  356. package/dist/network-BcfobxQY.mjs +0 -50
  357. package/dist/network-interconnects-BU3tN_Ab.mjs +0 -72
  358. package/dist/o11y-BBv7nedp.mjs +0 -93
  359. package/dist/oauth-BUr8bPwo.mjs +0 -9
  360. package/dist/oauth-clients-qWVImhHE.mjs +0 -16
  361. package/dist/oauth-scopes-CdeIgJIx.mjs +0 -4
  362. package/dist/organization-CJeOVWH7.mjs +0 -71
  363. package/dist/organizations-BpfoqZcG.mjs +0 -4
  364. package/dist/origin-ca-certificates-Bimf07RF.mjs +0 -11
  365. package/dist/origin-post-quantum-encryption-CM-If38w.mjs +0 -6
  366. package/dist/origin-tls-client-auth-BPwYPhc9.mjs +0 -30
  367. package/dist/output-BOe-3AQG.mjs +0 -2
  368. package/dist/page-rules-DOeekMrj.mjs +0 -39
  369. package/dist/pay-per-crawl-qJpseNNx.mjs +0 -38
  370. package/dist/pay-per-use-C1MWKJ4O.mjs +0 -33
  371. package/dist/pipelines-rCwXQw6S.mjs +0 -44
  372. package/dist/precursor-Bk8Pp6jT.mjs +0 -4
  373. package/dist/previews-BEheHO3T.mjs +0 -4
  374. package/dist/progress-CQqDtgmF.mjs +0 -2
  375. package/dist/prompt-C8FyienX.mjs +0 -3
  376. package/dist/queries-DJ8looyq.mjs +0 -9
  377. package/dist/queues-BBH9Q-Tt.mjs +0 -57
  378. package/dist/r2-CdJKpP2w.mjs +0 -128
  379. package/dist/raw-fetch-DbXN3SlE.mjs +0 -2
  380. package/dist/realtime-onrXppzh.mjs +0 -172
  381. package/dist/registrar-CbEBc5IE.mjs +0 -43
  382. package/dist/registrar-sandbox-BJhn1HFT.mjs +0 -56
  383. package/dist/reporting-bXZY6obP.mjs +0 -14
  384. package/dist/request-tracers-CihskC2A.mjs +0 -4
  385. package/dist/resolve-CaTBV-c6.mjs +0 -2
  386. package/dist/resolve-DCGSzUDQ.mjs +0 -2
  387. package/dist/resource-sharing-DDqcCHVs.mjs +0 -40
  388. package/dist/resource-tagging-D63RpBce.mjs +0 -4
  389. package/dist/rules-CAW0-Wde.mjs +0 -18
  390. package/dist/rulesets-CPir63Qc.mjs +0 -37
  391. package/dist/rum-BfwTcuup.mjs +0 -30
  392. package/dist/run-DEynXvCc.mjs +0 -2
  393. package/dist/scim-CtZ1FeQE.mjs +0 -18
  394. package/dist/secrets-store-BIuBYUJT.mjs +0 -24
  395. package/dist/security-insights-DfUus0bs.mjs +0 -40
  396. package/dist/security-txt-CgZOsAIZ.mjs +0 -9
  397. package/dist/session-BcM8Vyyx.mjs +0 -2
  398. package/dist/shared-CpS23WwR.mjs +0 -2
  399. package/dist/smart-shield-ClgB7r-9.mjs +0 -24
  400. package/dist/snippets-DLO3iFAg.mjs +0 -20
  401. package/dist/speed-DX5X2EIR.mjs +0 -24
  402. package/dist/sql-CF044HDW.mjs +0 -4
  403. package/dist/src-BMATTZU_.mjs +0 -125
  404. package/dist/ssl-CM-rChEC.mjs +0 -45
  405. package/dist/startup-profile-D662WI9s.mjs +0 -2
  406. package/dist/state-D7uNYnoi.mjs +0 -2
  407. package/dist/stream-5EmUOQvy.mjs +0 -102
  408. package/dist/submit-lEAaRSMR.mjs +0 -4
  409. package/dist/telemetry-0Y5hAtCX.mjs +0 -2
  410. package/dist/tenant-DnI7QziH.mjs +0 -10
  411. package/dist/tenant-custom-nameservers-MR0dlcGm.mjs +0 -9
  412. package/dist/theme-CQ_TYifs.mjs +0 -6
  413. package/dist/turnstile-M7sKCEz3.mjs +0 -33
  414. package/dist/ui-YmjF66Ct.mjs +0 -5
  415. package/dist/update-check-aTutXNRd.mjs +0 -2
  416. package/dist/url-info-Dos9VOXV.mjs +0 -4
  417. package/dist/url-normalization-CZbFOq_v.mjs +0 -9
  418. package/dist/url-scanner-B7quLPGW.mjs +0 -16
  419. package/dist/values-D-rrZrDa.mjs +0 -4
  420. package/dist/vectorize-D2tf_oA8.mjs +0 -32
  421. package/dist/version-BGnqDvNR.mjs +0 -2
  422. package/dist/web-assets-DQAfvPT9.mjs +0 -64
  423. package/dist/web3-MI0GQDnu.mjs +0 -28
  424. package/dist/workers-By6Pf8fv.mjs +0 -40
  425. package/dist/workers-builds-6YsWsCmC.mjs +0 -14
  426. package/dist/workers-for-platforms-DL8fC1qR.mjs +0 -40
  427. package/dist/workers-vpc-BYx6sbgd.mjs +0 -13
  428. package/dist/workflows-ByQLnV0E.mjs +0 -52
  429. package/dist/zaraz-CgbpmA85.mjs +0 -22
  430. package/dist/zero-trust-CpjTkkWt.mjs +0 -837
  431. package/dist/zone-DnKIe6po.mjs +0 -4
  432. package/dist/zones--5ZzsDmQ.mjs +0 -124
@@ -1,386 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BcPM4I0s.mjs";import{i as t,n}from"./auth-CAWalgW0.mjs";import{a as r,t as i}from"./context-BBLtgdR1.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-CQqDtgmF.mjs";import{t as c}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.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-C8FyienX.mjs";import{n as _,t as v}from"./raw-fetch-DbXN3SlE.mjs";function ee(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules bulk-delete
3
-
4
- Delete all DNS Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const te={command:`bulk-delete`,describe:`Delete all DNS Protection rules.`,builder:ee,handler:async t=>c({command:`magic-transit advanced-dns-protection configs dns protection rules bulk-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-dns-protection configs dns protection rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function y(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules create
6
-
7
- Create a DNS Protection rule for an account.`).option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const b={command:`create`,describe:`Create DNS Protection rule.`,builder:y,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 x(e){return e.usage(`$0 magic-transit advanced-dns-protection configs dns protection rules delete <rule-id>
8
-
9
- Delete a DNS Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <rule-id>`,describe:`Delete DNS Protection rule.`,builder:x,handler:async t=>c({command:`magic-transit advanced-dns-protection configs dns protection rules 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-dns-protection configs dns protection rules delete`,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({account_id:l,rule_id:t[`rule-id`]}));a(u,{successLabel:`Deleted`})})};function C(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 w={command:`get <rule-id>`,describe:`Get DNS Protection rule.`,builder:C,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 T(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 E={command:`list`,describe:`List all DNS Protection rules.`,builder:T,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 D(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 O={command:`update <rule-id>`,describe:`Update DNS Protection rule.`,builder:D,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`})})},k={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(te).command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`advanced-dns-protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist bulk-delete
17
-
18
- Delete all allowlist prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`bulk-delete`,describe:`Delete all allowlist prefixes.`,builder:P,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist bulk-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 allowlist bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
19
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function I(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist create
20
-
21
- Create an allowlist prefix for an account.`).option(`comment`,{type:`string`,description:`An comment describing the allowlist prefix.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect.`}).option(`prefix`,{type:`string`,description:`The allowlist prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new allowlist prefix to create.`})}const L={command:`create`,describe:`Create allowlist prefix.`,builder:I,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 R(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist list
22
-
23
- List all allowlist prefixes for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List all allowlist prefixes.`,builder:R,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 B(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix delete <prefix-id>
24
-
25
- Delete the allowlist prefix for an account given a UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const V={command:`delete <prefix-id>`,describe:`Delete allowlist prefix.`,builder:B,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist prefix 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 allowlist prefix delete`,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.
26
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.prefix.delete({account_id:l,prefix_id:t[`prefix-id`]}));a(u,{successLabel:`Deleted`})})};function H(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix get <prefix-id>
27
-
28
- Get an allowlist prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <prefix-id>`,describe:`Get allowlist prefix.`,builder:H,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist prefix get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf magic-transit advanced-tcp-protection configs allowlist prefix 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.prefix.get({account_id:l,prefix_id:t[`prefix-id`]}));a(u,{successLabel:`Loaded`})})};function W(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs allowlist prefix update <prefix-id>
29
-
30
- Update an allowlist prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A comment describing the allowlist prefix. Optional.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the allowlist prefix.`})}const G={command:`update <prefix-id>`,describe:`Update allowlist prefix.`,builder:W,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs allowlist prefix 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 prefix 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.prefix.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.prefix.update({...d,account_id:l,prefix_id:t[`prefix-id`]}));a(m,{successLabel:`Updated`})})},K={command:`prefix`,describe:`Operations for advanced-tcp-protection.configs.allowlist.prefix`,builder:e=>e.command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist`,builder:e=>e.command(F).command(L).command(z).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk-delete
31
-
32
- Delete all prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`bulk-delete`,describe:`Delete all prefixes.`,builder:J,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs prefixes bulk-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 bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/prefixes`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
33
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.prefixes.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function X(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes bulk create
34
-
35
- Create multiple prefixes for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The list of new prefixes to create.`})}const Z={command:`create`,describe:`Create multiple prefixes.`,builder:X,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.`)})},Q={command:`bulk`,describe:`Operations for advanced-tcp-protection.configs.prefixes.bulk`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes create
36
-
37
- Create a prefix for an account.`).option(`comment`,{type:`string`,description:`A comment describing the prefix.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection.`}).option(`prefix`,{type:`string`,description:`The prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new prefix to create.`})}const re={command:`create`,describe:`Create prefix.`,builder:ne,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 ie(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes delete <prefix-id>
38
-
39
- Delete the prefix for an account given a UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ae={command:`delete <prefix-id>`,describe:`Delete prefix.`,builder:ie,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.
40
- `);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 oe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes get <prefix-id>
41
-
42
- Get a prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <prefix-id>`,describe:`Get prefix.`,builder:oe,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 ce(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes list
43
-
44
- List all prefixes for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`List all prefixes.`,builder:ce,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 ue(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs prefixes update <prefix-id>
45
-
46
- Update a prefix specified by the given UUID.`).positional(`prefix-id`,{type:`string`,description:`The UUID of the prefix to update.`,demandOption:!0}).option(`comment`,{type:`string`,description:`A new comment for the prefix. Optional.`}).option(`excluded`,{type:`boolean`,description:`Whether to exclude the prefix from protection. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the prefix.`})}const de={command:`update <prefix-id>`,describe:`Update prefix.`,builder:ue,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`})})},fe={command:`prefixes`,describe:`Operations for advanced-tcp-protection.configs.prefixes`,builder:e=>e.command(Y).command(re).command(ae).command(se).command(le).command(de).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters bulk-delete
47
-
48
- Delete all SYN Protection filters for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const me={command:`bulk-delete`,describe:`Delete all SYN Protection filters.`,builder:pe,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters bulk-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 syn protection filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/filters`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
49
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function he(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters create
50
-
51
- Create a SYN Protection filter for an account.`).option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const ge={command:`create`,describe:`Create a SYN Protection filter.`,builder:he,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 _e(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters delete <filter-id>
52
-
53
- Delete a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ve={command:`delete <filter-id>`,describe:`Delete SYN Protection filter.`,builder:_e,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection filters 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 syn protection filters delete`,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.
54
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.filters.delete({account_id:l,filter_id:t[`filter-id`]}));a(u,{successLabel:`Deleted`})})};function ye(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters get <filter-id>
55
-
56
- Get a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <filter-id>`,describe:`Get SYN Protection filter.`,builder:ye,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 xe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters list
57
-
58
- List all SYN Protection filters for an account.`).option(`filter-mode`,{type:`string`,description:`The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'.`}).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List all SYN Protection filters.`,builder:xe,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 Ce(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection filters update <filter-id>
59
-
60
- Update a SYN Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const we={command:`update <filter-id>`,describe:`Update SYN Protection filter.`,builder:Ce,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`})})},Te={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.filters`,builder:e=>e.command(me).command(ge).command(ve).command(be).command(Se).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules bulk-delete
61
-
62
- Delete all SYN Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const De={command:`bulk-delete`,describe:`Delete all SYN Protection rules.`,builder:Ee,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules bulk-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 syn protection rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/syn_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
63
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function Oe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules create
64
-
65
- Create a SYN Protection rule for an account.`).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The type of mitigation. Must be one of 'challenge' or 'retransmit'. Optional. Defaults to 'challenge'.`}).option(`name`,{type:`string`,description:`The name of the SYN Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the SYN Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new SYN Protection rule to add.`})}const ke={command:`create`,describe:`Create SYN Protection rule.`,builder:Oe,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 Ae(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules delete <rule-id>
66
-
67
- Delete a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const je={command:`delete <rule-id>`,describe:`Delete SYN Protection rule.`,builder:Ae,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs syn protection rules 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 syn protection rules delete`,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.
68
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.syn.protection.rules.delete({account_id:l,rule_id:t[`rule-id`]}));a(u,{successLabel:`Deleted`})})};function Me(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules get <rule-id>
69
-
70
- Get a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`get <rule-id>`,describe:`Get SYN Protection rule.`,builder:Me,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 Pe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules list
71
-
72
- List all SYN Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`list`,describe:`List all SYN Protection rules.`,builder:Pe,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 Ie(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs syn protection rules update <rule-id>
73
-
74
- Update a SYN Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the SYN Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`mitigation-type`,{type:`string`,description:`The new mitigation type. Optional. Must be one of 'challenge' or 'retransmit'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The fields to update on the SYN Protection rule.`})}const Le={command:`update <rule-id>`,describe:`Update SYN Protection rule.`,builder:Ie,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`})})},Re={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.syn.protection.rules`,builder:e=>e.command(De).command(ke).command(je).command(Ne).command(Fe).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ze={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.syn.protection`,builder:e=>e.command(Te).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Be={command:`syn`,describe:`Operations for advanced-tcp-protection.configs.syn`,builder:e=>e.command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ve(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters bulk-delete
75
-
76
- Delete all TCP Flow Protection filters for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const He={command:`bulk-delete`,describe:`Delete all TCP Flow Protection filters.`,builder:Ve,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters bulk-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 tcp flow protection filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/filters`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
77
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function Ue(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters create
78
-
79
- Create a TCP Flow Protection filter for an account.`).option(`expression`,{type:`string`,description:`The filter expression.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new filter to create.`})}const We={command:`create`,describe:`Create a TCP Flow Protection filter.`,builder:Ue,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 Ge(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters delete <filter-id>
80
-
81
- Delete a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ke={command:`delete <filter-id>`,describe:`Delete TCP Flow Protection filter.`,builder:Ge,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection filters 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 tcp flow protection filters delete`,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.
82
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.filters.delete({account_id:l,filter_id:t[`filter-id`]}));a(u,{successLabel:`Deleted`})})};function qe(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters get <filter-id>
83
-
84
- Get a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`get <filter-id>`,describe:`Get TCP Flow Protection filter.`,builder:qe,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 Ye(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters list
85
-
86
- List all TCP Flow Protection filters for an account.`).option(`filter-mode`,{type:`string`,description:`The mode of the filters to get. Optional. Valid values: 'enabled', 'disabled', 'monitoring'.`}).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`list`,describe:`List all TCP Flow Protection filters.`,builder:Ye,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 Ze(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection filters update <filter-id>
87
-
88
- Update a TCP Flow Protection filter specified by the given UUID.`).positional(`filter-id`,{type:`string`,description:`The UUID of the filter to update.`,demandOption:!0}).option(`expression`,{type:`string`,description:`The new filter expression. Optional.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the filter.`})}const Qe={command:`update <filter-id>`,describe:`Update TCP Flow Protection filter.`,builder:Ze,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`})})},$e={command:`filters`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.filters`,builder:e=>e.command(He).command(We).command(Ke).command(Je).command(Xe).command(Qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function et(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules bulk-delete
89
-
90
- Delete all TCP Flow Protection rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tt={command:`bulk-delete`,describe:`Delete all TCP Flow Protection rules.`,builder:et,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules bulk-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 tcp flow protection rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/magic/advanced_tcp_protection/configs/tcp_flow_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await g({force:!!t.force})){process.stderr.write(`Aborted.
91
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.bulkDelete({account_id:l}));a(u,{successLabel:`Deleted`})})};function nt(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules create
92
-
93
- Create a TCP Flow Protection rule for an account.`).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the TCP Flow Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the TCP Flow Protection rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new TCP Flow Protection rule.`})}const rt={command:`create`,describe:`Create TCP Flow Protection rule.`,builder:nt,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 it(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules delete <rule-id>
94
-
95
- Delete a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const at={command:`delete <rule-id>`,describe:`Delete TCP Flow Protection rule.`,builder:it,handler:async t=>c({command:`magic-transit advanced-tcp-protection configs tcp flow protection rules 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 tcp flow protection rules delete`,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.
96
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.tcp.flow.protection.rules.delete({account_id:l,rule_id:t[`rule-id`]}));a(u,{successLabel:`Deleted`})})};function ot(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules get <rule-id>
97
-
98
- Get a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const st={command:`get <rule-id>`,describe:`Get TCP Flow Protection rule.`,builder:ot,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
99
-
100
- List all TCP Flow Protection rules for an account.`).option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lt={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 ut(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp flow protection rules update <rule-id>
101
-
102
- Update a TCP Flow Protection rule specified by the given UUID.`).positional(`rule-id`,{type:`string`,description:`The UUID of the TCP Flow Protection rule to update.`,demandOption:!0}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the TCP Flow Protection rule.`})}const dt={command:`update <rule-id>`,describe:`Update TCP Flow Protection rule.`,builder:ut,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`})})},ft={command:`rules`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection.rules`,builder:e=>e.command(tt).command(rt).command(at).command(st).command(lt).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},pt={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow.protection`,builder:e=>e.command($e).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},mt={command:`flow`,describe:`Operations for advanced-tcp-protection.configs.tcp.flow`,builder:e=>e.command(pt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ht(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status get
103
-
104
- Get the protection status of the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gt={command:`get`,describe:`Get protection status.`,builder:ht,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 _t(e){return e.usage(`$0 magic-transit advanced-tcp-protection configs tcp protection status update
105
-
106
- Update the protection status of the account.`).option(`enabled`,{type:`boolean`,description:`Enables or disables protection.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The update to apply to the protection status.`})}const vt={command:`update`,describe:`Update protection status.`,builder:_t,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`})})},yt={command:`status`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection.status`,builder:e=>e.command(gt).command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bt={command:`protection`,describe:`Operations for advanced-tcp-protection.configs.tcp.protection`,builder:e=>e.command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xt={command:`tcp`,describe:`Operations for advanced-tcp-protection.configs.tcp`,builder:e=>e.command(mt).command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},St={command:`configs`,describe:`Operations for advanced-tcp-protection.configs`,builder:e=>e.command(q).command(fe).command(Be).command(xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ct={command:`advanced-tcp-protection`,describe:`Advanced Tcp Protection operations`,builder:e=>e.command(St).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wt(e){return e.usage(`$0 magic-transit apps create
107
-
108
- Creates a new App for an account`).option(`hostnames`,{type:`string`,array:!0,description:`FQDNs to associate with traffic decisions.`}).option(`name`,{type:`string`,description:`Display name for the app.`}).option(`type`,{type:`string`,description:`Category of the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tt={command:`create`,describe:`Create a new App`,builder:wt,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 Et(e){return e.usage(`$0 magic-transit apps delete <account-app-id>
109
-
110
- Deletes specific Account App.`).positional(`account-app-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Dt={command:`delete <account-app-id>`,describe:`Delete Account App`,builder:Et,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.
111
- `);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 Ot(e){return e.usage(`$0 magic-transit apps list
112
-
113
- Lists Apps associated with an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kt={command:`list`,describe:`List Apps`,builder:Ot,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 At(e){return e.usage(`$0 magic-transit apps update <account-app-id>
114
-
115
- Updates an Account App`).positional(`account-app-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`FQDNs to associate with traffic decisions.`}).option(`name`,{type:`string`,description:`Display name for the app.`}).option(`type`,{type:`string`,description:`Category of the app.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const jt={command:`update <account-app-id>`,describe:`Update an App`,builder:At,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`})})},Mt={command:`apps`,describe:`Application-aware traffic policies for Magic WAN that steer traffic by app type`,builder:e=>e.command(Tt).command(Dt).command(kt).command(jt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nt(e){return e.usage(`$0 magic-transit bgp-filter-profiles create
116
-
117
- Creates a new BGP filter profile for an account.`).option(`description`,{type:`string`,description:`Description of the filter profile`,default:``}).option(`match-action`,{type:`string`,description:`Action to take when a route matches one of the targets in this profile`,choices:[`allow`,`deny`]}).coerce(`match-action`,e=>p(e,`match-action`,`text`)).option(`name`,{type:`string`,description:`Friendly name for the filter profile`}).option(`targets`,{type:`string`,array:!0,description:`List of CIDR prefixes. Each entry may carry an optional suffix that specifies which prefix lengths to match relative to the prefix length N: '{X,Y}' matches prefix lengths in the inclusive range [X, Y] where N <= X <= Y <= max (max is 32 for IPv4, 128 for IPv6), '{X}' matches exactly length X (equivalent to {X,X}), '+' is shorthand for {N, max} (the prefix and all more-specific subnets, including at length N itself; valid even when N is the maximum length). Omit the suffix to match the prefix exactly at length N.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pt={command:`create`,describe:`Create BGP Filter Profile`,builder:Nt,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:t[`match-action`],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:t[`match-action`],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 Ft(e){return e.usage(`$0 magic-transit bgp-filter-profiles delete <profile-id>
118
-
119
- Deletes a BGP filter profile.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const It={command:`delete <profile-id>`,describe:`Delete BGP Filter Profile`,builder:Ft,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.
120
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.bgpFilterProfiles.delete({account_id:l,profile_id:t[`profile-id`]}));a(u,{successLabel:`Deleted`})})};function Lt(e){return e.usage(`$0 magic-transit bgp-filter-profiles get <profile-id>
121
-
122
- Gets a specific BGP filter profile for an account.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`get <profile-id>`,describe:`Get BGP Filter Profile`,builder:Lt,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 zt(e){return e.usage(`$0 magic-transit bgp-filter-profiles list
123
-
124
- Lists all BGP filter profiles for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bt={command:`list`,describe:`List BGP Filter Profiles`,builder:zt,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 Vt(e){return e.usage(`$0 magic-transit bgp-filter-profiles update <profile-id>
125
-
126
- Updates a BGP filter profile. Omitted properties are left unchanged. To clear an existing description send \`description: ""\`.`).positional(`profile-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the filter profile`}).option(`match-action`,{type:`string`,description:`Action to take when a route matches one of the targets in this profile`,choices:[`allow`,`deny`]}).coerce(`match-action`,e=>p(e,`match-action`,`text`)).option(`name`,{type:`string`,description:`Friendly name for the filter profile`}).option(`targets`,{type:`string`,array:!0,description:`List of CIDR prefixes. Each entry may carry an optional suffix that specifies which prefix lengths to match relative to the prefix length N: '{X,Y}' matches prefix lengths in the inclusive range [X, Y] where N <= X <= Y <= max (max is 32 for IPv4, 128 for IPv6), '{X}' matches exactly length X (equivalent to {X,X}), '+' is shorthand for {N, max} (the prefix and all more-specific subnets, including at length N itself; valid even when N is the maximum length). Omit the suffix to match the prefix exactly at length N.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:'Partial update for a BGP filter profile. At least one property must be provided; omitted properties are left unchanged. To clear an existing description send `description: ""`.'})}const Ht={command:`update <profile-id>`,describe:`Update BGP Filter Profile`,builder:Vt,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:t[`match-action`],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:t[`match-action`],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`})})},Ut={command:`bgp-filter-profiles`,describe:`BGP filter profiles for controlling which routes are allowed or denied on Magic Transit tunnels`,builder:e=>e.command(Pt).command(It).command(Rt).command(Bt).command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wt(e){return e.usage(`$0 magic-transit bgp-settings get
127
-
128
- Gets the BGP settings for an account, including the default ASN and redistribution configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gt={command:`get`,describe:`Get BGP Settings`,builder:Wt,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 Kt(e){return e.usage(`$0 magic-transit bgp-settings update
129
-
130
- Modifies the BGP settings for an account, including the default ASN and redistribution configuration.`).option(`cloudflare-asn`,{type:`number`,description:`Route advertisements from Cloudflare to ramps in this account will use this ASN.`}).option(`redistribute-static:wan`,{type:`boolean`,description:`Redistribute static WAN routes into BGP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qt={command:`update`,describe:`Update BGP Settings`,builder:Kt,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`})})},Jt={command:`bgp-settings`,describe:`BGP settings for controlling default ASN and route redistribution on Magic Transit tunnels`,builder:e=>e.command(Gt).command(qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yt(e){return e.usage(`$0 magic-transit cf-interconnects bulk-update
131
-
132
- Updates multiple interconnects associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xt={command:`bulk-update`,describe:`Update multiple interconnects`,builder:Yt,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 Zt(e){return e.usage(`$0 magic-transit cf-interconnects get <cf-interconnect-id>
133
-
134
- Lists details for a specific interconnect.`).positional(`cf-interconnect-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qt={command:`get <cf-interconnect-id>`,describe:`List interconnect Details`,builder:Zt,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 $t(e){return e.usage(`$0 magic-transit cf-interconnects list
135
-
136
- Lists interconnects associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const en={command:`list`,describe:`List interconnects`,builder:$t,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 tn(e){return e.usage(`$0 magic-transit cf-interconnects update <cf-interconnect-id>
137
-
138
- Updates a specific interconnect associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`cf-interconnect-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`bgp-as-no`,{type:`number`,description:`Deprecated. Use customer_asn.`}).option(`bgp-cloudflare-endpoint`,{type:`string`,description:`Read-only for v1.5; derived from interface_address.`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session.`}).option(`bgp-customer-endpoint`,{type:`string`,description:`Read-only for v1.5; derived from interface_address.`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
139
-
140
- Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
141
- key is not treated as a secret value. This is *only* supported for preventing
142
- misconfiguration, not for defending against malicious attacks.
143
-
144
- The MD5 key, if set, must be of non-zero length and consist only of the following types of
145
- character:
146
-
147
- * ASCII alphanumerics: \`[a-zA-Z0-9]\`
148
- * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
149
-
150
- In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
151
- quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
152
- (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
153
- these disallowed characters will be rejected.`}).option(`description`,{type:`string`,description:`An optional description of the interconnect.`}).option(`gre-cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel created as part of the Interconnect.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>p(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the interconnect and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the interconnect.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>p(e,`health-check-direction`,`text`)).option(`health-check-source`,{type:`string`,description:"The source IPv4 address used for bidirectional health checks. Supported only for version 1.5 interconnects. It is required when `direction` is `bidirectional` and must be omitted (and is cleared) when `direction` is `unidirectional`. The address must be within RFC1918 space, the approved link-local range 169.254.240.0/20, or the Cloudflare reserved range 198.41.199.224/27."}).option(`interface-address`,{type:`string`,description:`The IPv4 interface address for the interconnect. For MPLS Interconnects,
154
- use a /30 or /31 prefix. For GRE Interconnects, a /30 or /31 prefix
155
- may be used. Version 1.5 interconnects require a /31 prefix and may
156
- also use a prefix from the account's authorized prefixes; otherwise,
157
- select the subnet from RFC 1918 or the approved link-local ranges.
158
- `}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576.`}).option(`name`,{type:`string`,description:`The name of the interconnect. The name cannot share a name with other tunnels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const nn={command:`update <cf-interconnect-id>`,describe:`Update interconnect`,builder:tn,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:d[`health-check-rate`],target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:d[`health-check-type`],direction:d[`health-check-direction`],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`],d[`health-check-rate`]),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`],d[`health-check-type`]),d[`health-check-direction`]!==void 0&&l(g,[`health_check`,`direction`],d[`health-check-direction`]),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`})})},rn={command:`cf-interconnects`,describe:`Cloudflare Network Interconnect (CNI) links for direct physical or virtual peering`,builder:e=>e.command(Xt).command(Qt).command(en).command(nn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function an(e){return e.usage(`$0 magic-transit cf1-sites create
159
-
160
- Creates new CF1 Sites for an account. Each site must have a unique name within the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const on={command:`create`,describe:`Create CF1 Sites`,builder:an,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>
161
-
162
- Deletes a specific CF1 Site for an account.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const 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.
163
- `);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 ln(e){return e.usage(`$0 magic-transit cf1-sites get <cf1-site-id>
164
-
165
- Gets a specific CF1 Site for an account.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const un={command:`get <cf1-site-id>`,describe:`Get CF1 Site`,builder:ln,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 dn(e){return e.usage(`$0 magic-transit cf1-sites list
166
-
167
- Lists CF1 Sites associated with an account. A CF1 Site represents a physical customer network location with optional geographic coordinates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fn={command:`list`,describe:`List CF1 Sites`,builder:dn,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 pn(e){return e.usage(`$0 magic-transit cf1-sites ramps create <cf1-site-id>
168
-
169
- Creates ramps (network connections) for a CF1 Site.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const mn={command:`create <cf1-site-id>`,describe:`Create CF1 Site Ramps`,builder:pn,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 hn(e){return e.usage(`$0 magic-transit cf1-sites ramps delete <ramp-id>
170
-
171
- Deletes a specific ramp from a CF1 Site.`).positional(`ramp-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const gn={command:`delete <ramp-id>`,describe:`Delete CF1 Site Ramp`,builder:hn,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.
172
- `);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 _n(e){return e.usage(`$0 magic-transit cf1-sites ramps get <ramp-id>
173
-
174
- Gets a specific ramp for a CF1 Site.`).positional(`ramp-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vn={command:`get <ramp-id>`,describe:`Get CF1 Site Ramp`,builder:_n,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 yn(e){return e.usage(`$0 magic-transit cf1-sites ramps list
175
-
176
- Lists ramps (network connections) associated with a CF1 Site. Ramps represent GRE tunnels, IPsec tunnels, interconnects, or MCONN links.`).option(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bn={command:`list`,describe:`List CF1 Site Ramps`,builder:yn,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`})})},xn={command:`ramps`,describe:`Operations for cf1-sites.ramps`,builder:e=>e.command(mn).command(gn).command(vn).command(bn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sn(e){return e.usage(`$0 magic-transit cf1-sites update <cf1-site-id>
177
-
178
- Partially updates a specific CF1 Site for an account. Only the fields included in the request body are modified; omitted fields retain their existing values.`).positional(`cf1-site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`A human-provided description of the CF1 Site.`}).option(`location-lat`,{type:`number`,description:`Latitude of the CF1 Site.`}).option(`location-long`,{type:`number`,description:`Longitude of the CF1 Site.`}).option(`location-name`,{type:`string`,description:`Name of nearest town, city, or village.`}).option(`name`,{type:`string`,description:`A human-provided name describing the CF1 Site that should be unique within the account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update payload for a CF1 Site. All properties are optional; only fields supplied in the request body are modified.`})}const Cn={command:`update <cf1-site-id>`,describe:`Update CF1 Site`,builder:Sn,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`})})},$={command:`cf1-sites`,describe:`Operations for cf1-sites`,builder:e=>e.command(on).command(cn).command(un).command(fn).command(Cn).command(xn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wn(e){return e.usage(`$0 magic-transit gre-tunnels bulk-update
179
-
180
- Updates multiple GRE tunnels. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tn={command:`bulk-update`,describe:`Update multiple GRE tunnels`,builder:wn,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 En(e){return e.usage(`$0 magic-transit gre-tunnels create
181
-
182
- Creates a new GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.",default:!1}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
183
-
184
- Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
185
- key is not treated as a secret value. This is *only* supported for preventing
186
- misconfiguration, not for defending against malicious attacks.
187
-
188
- The MD5 key, if set, must be of non-zero length and consist only of the following types of
189
- character:
190
-
191
- * ASCII alphanumerics: \`[a-zA-Z0-9]\`
192
- * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
193
-
194
- In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
195
- quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
196
- (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
197
- these disallowed characters will be rejected.`}).option(`cloudflare-gre-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel.`}).option(`customer-gre-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the GRE tunnel.`}).option(`description`,{type:`string`,description:`An optional description of the GRE tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>p(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>p(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.`,default:1476}).option(`name`,{type:`string`,description:`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`}).option(`ttl`,{type:`number`,description:`Time To Live (TTL) in number of hops of the GRE tunnel.`,default:64}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const Dn={command:`create`,describe:`Create a GRE tunnel`,builder:En,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:d[`health-check-rate`],target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:d[`health-check-type`],direction:d[`health-check-direction`]},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`],d[`health-check-rate`]),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`],d[`health-check-type`]),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],d[`health-check-direction`]),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 On(e){return e.usage(`$0 magic-transit gre-tunnels delete <gre-tunnel-id>
198
-
199
- Disables and removes a specific static GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const kn={command:`delete <gre-tunnel-id>`,describe:`Delete GRE Tunnel`,builder:On,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.
200
- `);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 An(e){return e.usage(`$0 magic-transit gre-tunnels get <gre-tunnel-id>
201
-
202
- Lists informtion for a specific GRE tunnel.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jn={command:`get <gre-tunnel-id>`,describe:`List GRE Tunnel Details`,builder:An,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 Mn(e){return e.usage(`$0 magic-transit gre-tunnels list
203
-
204
- Lists GRE tunnels associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Nn={command:`list`,describe:`List GRE tunnels`,builder:Mn,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 Pn(e){return e.usage(`$0 magic-transit gre-tunnels update <gre-tunnel-id>
205
-
206
- Updates a specific GRE tunnel. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`gre-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`cloudflare-gre-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the GRE tunnel.`}).option(`customer-gre-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the GRE tunnel.`}).option(`description`,{type:`string`,description:`An optional description of the GRE tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>p(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>p(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`mtu`,{type:`number`,description:`Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.`}).option(`name`,{type:`string`,description:`The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.`}).option(`ttl`,{type:`number`,description:`Time To Live (TTL) in number of hops of the GRE tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Fn={command:`update <gre-tunnel-id>`,describe:`Update GRE Tunnel`,builder:Pn,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:d[`health-check-rate`],target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:d[`health-check-type`],direction:d[`health-check-direction`]},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`],d[`health-check-rate`]),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`],d[`health-check-type`]),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],d[`health-check-direction`]),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`})})},In={command:`gre-tunnels`,describe:`GRE tunnel endpoints that connect your network to Cloudflare for Magic Transit`,builder:e=>e.command(Tn).command(Dn).command(kn).command(jn).command(Nn).command(Fn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ln(e){return e.usage(`$0 magic-transit ipsec-tunnels bulk-update
207
-
208
- Update multiple IPsec tunnels associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Rn={command:`bulk-update`,describe:`Update multiple IPsec tunnels`,builder:Ln,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 zn(e){return e.usage(`$0 magic-transit ipsec-tunnels create
209
-
210
- Creates a new IPsec tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.",default:!1}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
211
-
212
- Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
213
- key is not treated as a secret value. This is *only* supported for preventing
214
- misconfiguration, not for defending against malicious attacks.
215
-
216
- The MD5 key, if set, must be of non-zero length and consist only of the following types of
217
- character:
218
-
219
- * ASCII alphanumerics: \`[a-zA-Z0-9]\`
220
- * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
221
-
222
- In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
223
- quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
224
- (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
225
- these disallowed characters will be rejected.`}).option(`cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the IPsec tunnel.`}).option(`custom-remote-identities-fqdn-id`,{type:`string`,description:`A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The
226
- generated IKE IDs can still be used even if this custom value is specified.
227
-
228
- Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
229
-
230
- This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
231
- fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
232
- cannot have the same cloudflare_endpoint.`}).option(`customer-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.`}).option(`description`,{type:`string`,description:`An optional description forthe IPsec tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>p(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>p(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`name`,{type:`string`,description:`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`}).option(`psk`,{type:`string`,description:`A randomly generated or provided string for use in the IPsec tunnel.`}).option(`replay-protection`,{type:`boolean`,description:"If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction.",default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const Bn={command:`create`,describe:`Create an IPsec tunnel`,builder:zn,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:d[`health-check-rate`],target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:d[`health-check-type`],direction:d[`health-check-direction`]},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`],d[`health-check-rate`]),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`],d[`health-check-type`]),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],d[`health-check-direction`]),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 Vn(e){return e.usage(`$0 magic-transit ipsec-tunnels delete <ipsec-tunnel-id>
233
-
234
- Disables and removes a specific static IPsec Tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Hn={command:`delete <ipsec-tunnel-id>`,describe:`Delete IPsec Tunnel`,builder:Vn,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.
235
- `);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 Un(e){return e.usage(`$0 magic-transit ipsec-tunnels get <ipsec-tunnel-id>
236
-
237
- Lists details for a specific IPsec tunnel.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wn={command:`get <ipsec-tunnel-id>`,describe:`List IPsec tunnel details`,builder:Un,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 Gn(e){return e.usage(`$0 magic-transit ipsec-tunnels list
238
-
239
- Lists IPsec tunnels associated with an account.`).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kn={command:`list`,describe:`List IPsec tunnels`,builder:Gn,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 qn(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-generate <ipsec-tunnel-id>
240
-
241
- Generates a Pre-Shared Key for a specific IPsec tunnel used in the IKE session. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes. After a PSK is generated, the PSK is immediately persisted to Cloudflare's edge and cannot be retrieved later. Store the PSK in a safe place.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jn={command:`psk-generate <ipsec-tunnel-id>`,describe:`Generate Pre-Shared Key (PSK) for IPsec tunnels`,builder:qn,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 Yn(e){return e.usage(`$0 magic-transit ipsec-tunnels psk-set
242
-
243
- Sets Pre-Shared Keys for multiple IPsec tunnels associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes. After PSKs are applied, they are immediately persisted to Cloudflare's edge and cannot be retrieved later. Store the PSKs in a safe place.`).option(`validate-only`,{type:`boolean`,description:"If `true`, only run validation without persisting changes."}).option(`psks`,{type:`string`,description:`List of tunnel ID and PSK pairs. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for setting PSKs for multiple IPsec tunnels.`})}const Xn={command:`psk-set`,describe:`Set Pre-Shared Keys (PSK) for IPsec tunnels`,builder:Yn,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 Zn(e){return e.usage(`$0 magic-transit ipsec-tunnels update <ipsec-tunnel-id>
244
-
245
- Updates a specific IPsec tunnel associated with an account. Use \`?validate_only=true\` as an optional query parameter to only run validation without persisting changes.`).positional(`ipsec-tunnel-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false.`}).option(`automatic-return-routing`,{type:`boolean`,description:"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected."}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-export-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes advertised to the customer.`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Prefixes in this list will be advertised to the customer device, in addition to the routes in the Magic routing table.`}).option(`bgp-import-filter-id`,{type:`string`,description:`ID of the BGP filter profile applied to routes received from the customer.`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
246
-
247
- Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
248
- key is not treated as a secret value. This is *only* supported for preventing
249
- misconfiguration, not for defending against malicious attacks.
250
-
251
- The MD5 key, if set, must be of non-zero length and consist only of the following types of
252
- character:
253
-
254
- * ASCII alphanumerics: \`[a-zA-Z0-9]\`
255
- * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
256
-
257
- In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
258
- quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
259
- (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
260
- these disallowed characters will be rejected.`}).option(`cloudflare-endpoint`,{type:`string`,description:`The IP address assigned to the Cloudflare side of the IPsec tunnel.`}).option(`custom-remote-identities-fqdn-id`,{type:`string`,description:`A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The
261
- generated IKE IDs can still be used even if this custom value is specified.
262
-
263
- Must be of the form \`<custom label>.<account ID>.custom.ipsec.cloudflare.com\`.
264
-
265
- This custom ID does not need to be unique. Two IPsec tunnels may have the same custom
266
- fqdn_id. However, if another IPsec tunnel has the same value then the two tunnels
267
- cannot have the same cloudflare_endpoint.`}).option(`customer-endpoint`,{type:`string`,description:`The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work.`}).option(`description`,{type:`string`,description:`An optional description forthe IPsec tunnel.`}).option(`health-check-enabled`,{type:`boolean`,description:`Determines whether to run healthchecks for a tunnel.`}).option(`health-check-rate`,{type:`string`,description:"How frequent the health check is run. The default value is `mid`.",choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`health-check-target-saved`,{type:`string`,description:`The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.`}).option(`health-check-type`,{type:`string`,description:"The type of healthcheck to run, reply or request. The default value is `reply`.",choices:[`reply`,`request`]}).coerce(`health-check-type`,e=>p(e,`health-check-type`,`text`)).option(`health-check-direction`,{type:`string`,description:`The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.`,choices:[`unidirectional`,`bidirectional`]}).coerce(`health-check-direction`,e=>p(e,`health-check-direction`,`text`)).option(`interface-address`,{type:`string`,description:`A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.`}).option(`interface-address6`,{type:`string`,description:`A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127`}).option(`name`,{type:`string`,description:`The name of the IPsec tunnel. The name cannot share a name with other tunnels.`}).option(`psk`,{type:`string`,description:`A randomly generated or provided string for use in the IPsec tunnel.`}).option(`replay-protection`,{type:`boolean`,description:"If `true`, then IPsec replay protection will be supported in the Cloudflare-to-customer direction."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`bgp-customer-asn`,`bgp-export-filter-id`,`bgp-extra-prefixes`,`bgp-import-filter-id`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --bgp-* flag is set`)}return!0})}const Qn={command:`update <ipsec-tunnel-id>`,describe:`Update IPsec Tunnel`,builder:Zn,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:d[`health-check-rate`],target:{saved:p(d[`health-check-target-saved`],`health-check-target-saved`,`text`)},type:d[`health-check-type`],direction:d[`health-check-direction`]},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`],d[`health-check-rate`]),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`],d[`health-check-type`]),d[`health-check-direction`]!==void 0&&l(_,[`health_check`,`direction`],d[`health-check-direction`]),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`})})},$n={command:`ipsec-tunnels`,describe:`IPsec tunnel endpoints with pre-shared key management for encrypted transit`,builder:e=>e.command(Rn).command(Bn).command(Hn).command(Wn).command(Kn).command(Jn).command(Xn).command(Qn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function er(e){return e.usage(`$0 magic-transit pcaps create
268
-
269
- Create new PCAP request for account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const tr={command:`create`,describe:`Create PCAP request`,builder:er,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 nr(e){return e.usage(`$0 magic-transit pcaps download get <pcap-id>
270
-
271
- Download PCAP information into a file. Response is a binary PCAP file.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const rr={command:`get <pcap-id>`,describe:`Download Simple PCAP`,builder:nr,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)})},ir={command:`download`,describe:`Operations for pcaps.download`,builder:e=>e.command(rr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ar(e){return e.usage(`$0 magic-transit pcaps get <pcap-id>
272
-
273
- Get information for a PCAP request by id.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const or={command:`get <pcap-id>`,describe:`Get PCAP request`,builder:ar,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
274
-
275
- Lists all packet capture requests for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const 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 lr(e){return e.usage(`$0 magic-transit pcaps ownership create
276
-
277
- Adds an AWS or GCP bucket to use with full packet captures.`).option(`destination-conf`,{type:`string`,description:"The full URI for the bucket. This field only applies to `full` packet captures."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ur={command:`create`,describe:`Add buckets for full packet captures`,builder:lr,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 dr(e){return e.usage(`$0 magic-transit pcaps ownership delete <ownership-id>
278
-
279
- Deletes buckets added to the packet captures API.`).positional(`ownership-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const fr={command:`delete <ownership-id>`,describe:`Delete buckets for full packet captures`,builder:dr,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.
280
- `);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 pr(e){return e.usage(`$0 magic-transit pcaps ownership get
281
-
282
- List all buckets configured for use with PCAPs API.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mr={command:`get`,describe:`List PCAPs Bucket Ownership`,builder:pr,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 hr(e){return e.usage(`$0 magic-transit pcaps ownership validate
283
-
284
- Validates buckets added to the packet captures API.`).option(`destination-conf`,{type:`string`,description:"The full URI for the bucket. This field only applies to `full` packet captures."}).option(`ownership-challenge`,{type:`string`,description:`The ownership challenge filename stored in the bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const gr={command:`validate`,describe:`Validate buckets for full packet captures`,builder:hr,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`})})},_r={command:`ownership`,describe:`Operations for pcaps.ownership`,builder:e=>e.command(ur).command(fr).command(mr).command(gr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vr(e){return e.usage(`$0 magic-transit pcaps stop <pcap-id>
285
-
286
- Stop full PCAP.`).positional(`pcap-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const yr={command:`stop <pcap-id>`,describe:`Stop full PCAP`,builder:vr,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.
287
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.pcaps.stop({account_id:l,pcap_id:t[`pcap-id`]}));a(u,{successLabel:`Deleted`})})},br={command:`pcaps`,describe:`Packet capture requests for debugging traffic flowing through Magic Transit tunnels`,builder:e=>e.command(tr).command(or).command(cr).command(yr).command(ir).command(_r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xr(e){return e.usage(`$0 magic-transit redundancy-groups create
288
-
289
- Creates a new redundancy group, optionally with tunnel members.`).option(`description`,{type:`string`,description:`Optional description`,default:``}).option(`members`,{type:`string`,description:`Tunnels to add to the group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Human-readable name for the redundancy group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Sr={command:`create`,describe:`Create a Redundancy Group`,builder:xr,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 Cr(e){return e.usage(`$0 magic-transit redundancy-groups delete <redundancy-group-id>
290
-
291
- Deletes a redundancy group. Member tunnels are not deleted — their redundancy_group_id is cleared.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const wr={command:`delete <redundancy-group-id>`,describe:`Delete a Redundancy Group`,builder:Cr,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.
292
- `);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 Tr(e){return e.usage(`$0 magic-transit redundancy-groups get <redundancy-group-id>
293
-
294
- Gets details for a specific redundancy group, including full member tunnel data.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Er={command:`get <redundancy-group-id>`,describe:`Get Redundancy Group Details`,builder:Tr,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 Dr(e){return e.usage(`$0 magic-transit redundancy-groups list
295
-
296
- Lists redundancy groups associated with an account, including full member tunnel data.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Or={command:`list`,describe:`List Redundancy Groups`,builder:Dr,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 kr(e){return e.usage(`$0 magic-transit redundancy-groups update <redundancy-group-id>
297
-
298
- Replaces the name, description, and full set of members for an existing redundancy group.`).positional(`redundancy-group-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional description`}).option(`members`,{type:`string`,description:`Tunnels to add to the group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Human-readable name for the redundancy group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ar={command:`update <redundancy-group-id>`,describe:`Update a Redundancy Group`,builder:kr,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`})})},jr={command:`redundancy-groups`,describe:`Operations for redundancy-groups`,builder:e=>e.command(Sr).command(wr).command(Er).command(Or).command(Ar).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Mr(e){return e.usage(`$0 magic-transit routes bulk-update
299
-
300
- Update multiple Magic static routes. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes. Only fields for a route that need to be changed need be provided.`).option(`routes`,{type:`string`,description:`The routes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Nr={command:`bulk-update`,describe:`Update Many Routes`,builder:Mr,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 Pr(e){return e.usage(`$0 magic-transit routes create
301
-
302
- Creates a new Magic static route. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes.`).option(`description`,{type:`string`,description:`An optional human provided description of the static route.`}).option(`nexthop`,{type:`string`,description:`The next-hop IP Address for the static route.`}).option(`prefix`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`priority`,{type:`number`,description:`Priority of the static route.`}).option(`scope-colo-names`,{type:`string`,array:!0,description:`List of colo names for the ECMP scope.`}).option(`scope-colo-regions`,{type:`string`,array:!0,description:`List of colo regions for the ECMP scope.`}).option(`weight`,{type:`number`,description:`Optional weight of the ECMP scope - if provided.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Fr={command:`create`,describe:`Create a Route`,builder:Pr,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 Ir(e){return e.usage(`$0 magic-transit routes delete <route-id>
303
-
304
- Disable and remove a specific Magic static route.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Lr={command:`delete <route-id>`,describe:`Delete Route`,builder:Ir,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.
305
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.routes.delete({account_id:l,route_id:t[`route-id`]}));a(u,{successLabel:`Deleted`})})};function Rr(e){return e.usage(`$0 magic-transit routes empty
306
-
307
- Delete multiple Magic static routes.`).option(`routes`,{type:`string`,description:`The routes field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const zr={command:`empty`,describe:`Delete Many Routes`,builder:Rr,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.
308
- `);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 Br(e){return e.usage(`$0 magic-transit routes get <route-id>
309
-
310
- Get a specific Magic static route.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Vr={command:`get <route-id>`,describe:`Route Details`,builder:Br,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 Hr(e){return e.usage(`$0 magic-transit routes list
311
-
312
- List all Magic static routes.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ur={command:`list`,describe:`List Routes`,builder:Hr,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 Wr(e){return e.usage(`$0 magic-transit routes update <route-id>
313
-
314
- Update a specific Magic static route. Use \`?validate_only=true\` as an optional query parameter to run validation only without persisting changes.`).positional(`route-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`An optional human provided description of the static route.`}).option(`nexthop`,{type:`string`,description:`The next-hop IP Address for the static route.`}).option(`prefix`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`priority`,{type:`number`,description:`Priority of the static route.`}).option(`scope-colo-names`,{type:`string`,array:!0,description:`List of colo names for the ECMP scope.`}).option(`scope-colo-regions`,{type:`string`,array:!0,description:`List of colo regions for the ECMP scope.`}).option(`weight`,{type:`number`,description:`Optional weight of the ECMP scope - if provided.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Gr={command:`update <route-id>`,describe:`Update Route`,builder:Wr,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`})})},Kr={command:`routes`,describe:`Static routes that direct IP prefix traffic through specific GRE/IPsec tunnels`,builder:e=>e.command(Nr).command(Fr).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 sites acls create <site-id>
315
-
316
- Creates a new Site ACL.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Bidirectional ACL policy for local network traffic within a site.`})}const Jr={command:`create <site-id>`,describe:`Create a new Site ACL`,builder:qr,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 Yr(e){return e.usage(`$0 magic-transit sites acls delete <acl-id>
317
-
318
- Remove a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Xr={command:`delete <acl-id>`,describe:`Delete Site ACL`,builder:Yr,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.
319
- `);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 Zr(e){return e.usage(`$0 magic-transit sites acls edit <acl-id>
320
-
321
- Patch a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`lan-1-lan-id`,`lan-1-lan-name`,`lan-1-port-ranges`,`lan-1-ports`].some(t=>e[t]!==void 0)){let t=[`lan-1-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_1-* flag is set`)}return!0}).check(e=>{if([`lan-2-lan-id`,`lan-2-lan-name`,`lan-2-port-ranges`,`lan-2-ports`].some(t=>e[t]!==void 0)){let t=[`lan-2-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_2-* flag is set`)}return!0})}const Qr={command:`edit <acl-id>`,describe:`Patch Site ACL`,builder:Zr,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 $r(e){return e.usage(`$0 magic-transit sites acls get <acl-id>
322
-
323
- Get a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ei={command:`get <acl-id>`,describe:`Site ACL Details`,builder:$r,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 ti(e){return e.usage(`$0 magic-transit sites acls list
324
-
325
- Lists Site ACLs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ni={command:`list`,describe:`List Site ACLs`,builder:ti,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 ri(e){return e.usage(`$0 magic-transit sites acls update <acl-id>
326
-
327
- Update a specific Site ACL.`).positional(`acl-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`description`,{type:`string`,description:`Description for the ACL.`}).option(`forward-locally`,{type:`boolean`,description:`The desired forwarding action for this ACL policy. If set to "false", the policy will forward traffic to Cloudflare. If set to "true", the policy will forward traffic locally on the Magic Connector. If not included in request, will default to false.`}).option(`lan-1-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-1-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-1-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-1-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-lan-id`,{type:`string`,description:`The identifier for the LAN you want to create an ACL policy with.`}).option(`lan-2-lan-name`,{type:`string`,description:`The name of the LAN based on the provided lan_id.`}).option(`lan-2-port-ranges`,{type:`string`,array:!0,description:`Array of port ranges on the provided LAN that will be included in the ACL. If no ports or port rangess are provided, communication on any port on this LAN is allowed.`}).option(`lan-2-ports`,{type:`string`,array:!0,description:`Array of ports on the provided LAN that will be included in the ACL. If no ports or port ranges are provided, communication on any port on this LAN is allowed.`}).option(`name`,{type:`string`,description:`The name of the ACL.`}).option(`protocols`,{type:`string`,array:!0,description:`The protocols field`}).option(`unidirectional`,{type:`boolean`,description:`The desired traffic direction for this ACL policy. If set to "false", the policy will allow bidirectional traffic. If set to "true", the policy will only allow traffic in one direction. If not included in request, will default to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`lan-1-lan-id`,`lan-1-lan-name`,`lan-1-port-ranges`,`lan-1-ports`].some(t=>e[t]!==void 0)){let t=[`lan-1-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_1-* flag is set`)}return!0}).check(e=>{if([`lan-2-lan-id`,`lan-2-lan-name`,`lan-2-port-ranges`,`lan-2-ports`].some(t=>e[t]!==void 0)){let t=[`lan-2-lan-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --lan_2-* flag is set`)}return!0})}const ii={command:`update <acl-id>`,describe:`Update Site ACL`,builder:ri,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`})})},ai={command:`acls`,describe:`Operations for sites.acls`,builder:e=>e.command(Jr).command(Xr).command(Qr).command(ei).command(ni).command(ii).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oi(e){return e.usage(`$0 magic-transit sites app-configuration create <site-id>
328
-
329
- Creates a new App Config for a site`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`breakout`,{type:`boolean`,description:`Whether to breakout traffic to the app's endpoints directly. Null preserves default behavior.`}).option(`preferred-wans`,{type:`string`,array:!0,description:`WAN interfaces to prefer over default WANs, highest-priority first. Can only be specified for breakout rules (breakout must be true).`}).option(`priority`,{type:`number`,description:`Priority of traffic. 0 is default, anything greater is prioritized. (Currently only 0 and 1 are supported)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const si={command:`create <site-id>`,describe:`Create a new App Config`,builder:oi,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>
330
-
331
- Deletes specific App Config associated with a site.`).positional(`app-config-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const li={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.
332
- `);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 ui(e){return e.usage(`$0 magic-transit sites app-configuration list
333
-
334
- Lists App Configs associated with a site.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const di={command:`list`,describe:`List App Configs`,builder:ui,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 fi(e){return e.usage(`$0 magic-transit sites app-configuration update <app-config-id>
335
-
336
- Updates an App Config for a site`).positional(`app-config-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`account-app-id`,{type:`string`,description:`Magic account app ID.`}).option(`breakout`,{type:`boolean`,description:`Whether to breakout traffic to the app's endpoints directly. Null preserves default behavior.`}).option(`managed-app-id`,{type:`string`,description:`Managed app ID.`}).option(`preferred-wans`,{type:`string`,array:!0,description:`WAN interfaces to prefer over default WANs, highest-priority first. Can only be specified for breakout rules (breakout must be true).`}).option(`priority`,{type:`number`,description:`Priority of traffic. 0 is default, anything greater is prioritized. (Currently only 0 and 1 are supported)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pi={command:`update <app-config-id>`,describe:`Update an App Config`,builder:fi,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`})})},mi={command:`app-configuration`,describe:`Operations for sites.app-configuration`,builder:e=>e.command(si).command(li).command(di).command(pi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hi(e){return e.usage(`$0 magic-transit sites create
337
-
338
- Creates a new Site`).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const gi={command:`create`,describe:`Create a new Site`,builder:hi,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 _i(e){return e.usage(`$0 magic-transit sites delete <site-id>
339
-
340
- Remove a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vi={command:`delete <site-id>`,describe:`Delete Site`,builder:_i,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.
341
- `);return}let u=await s(`Deleting`,async()=>c.magicTransit.sites.delete({account_id:l,site_id:t[`site-id`]}));a(u,{successLabel:`Deleted`})})};function yi(e){return e.usage(`$0 magic-transit sites edit <site-id>
342
-
343
- Patch a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const bi={command:`edit <site-id>`,describe:`Patch Site`,builder:yi,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 xi(e){return e.usage(`$0 magic-transit sites get <site-id>
344
-
345
- Get a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`x-magic-new-hc-target`,{type:`string`,description:`If true, the health check target in the response body will be presented using the new object format. Defaults to false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Si={command:`get <site-id>`,describe:`Site Details`,builder:xi,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 Ci(e){return e.usage(`$0 magic-transit sites lans create <site-id>
346
-
347
- Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const wi={command:`create <site-id>`,describe:`Create a new Site LAN`,builder:Ci,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 Ti(e){return e.usage(`$0 magic-transit sites lans delete <lan-id>
348
-
349
- Remove a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ei={command:`delete <lan-id>`,describe:`Delete Site LAN`,builder:Ti,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.
350
- `);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 Di(e){return e.usage(`$0 magic-transit sites lans edit <lan-id>
351
-
352
- Patch a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Oi={command:`edit <lan-id>`,describe:`Patch Site LAN`,builder:Di,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 ki(e){return e.usage(`$0 magic-transit sites lans get <lan-id>
353
-
354
- Get a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ai={command:`get <lan-id>`,describe:`Site LAN Details`,builder:ki,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 ji(e){return e.usage(`$0 magic-transit sites lans list
355
-
356
- Lists Site LANs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mi={command:`list`,describe:`List Site LANs`,builder:ji,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 Ni(e){return e.usage(`$0 magic-transit sites lans update <lan-id>
357
-
358
- Update a specific Site LAN.`).positional(`lan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`bond-id`,{type:`number`,description:`The bond_id field`}).option(`ha-link`,{type:`boolean`,description:`mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.`}).option(`is-breakout`,{type:`boolean`,description:`mark true to use this LAN for source-based breakout traffic`}).option(`is-prioritized`,{type:`boolean`,description:`mark true to use this LAN for source-based prioritized traffic`}).option(`name`,{type:`string`,description:`The name field`}).option(`nat-static-prefix`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`routed-subnets`,{type:`string`,description:`The routed_subnets field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-dhcp-relay-server-addresses`,{type:`string`,array:!0,description:`List of DHCP server IPs.`}).option(`static-addressing-dhcp-server-dhcp-pool-end`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dhcp-pool-start`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-server`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-dhcp-server-dns-servers`,{type:`string`,array:!0,description:`The static_addressing.dhcp_server.dns_servers field`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-virtual-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-dhcp-relay-server-addresses`,`static-addressing-dhcp-server-dhcp-pool-end`,`static-addressing-dhcp-server-dhcp-pool-start`,`static-addressing-dhcp-server-dns-server`,`static-addressing-dhcp-server-dns-servers`,`static-addressing-secondary-address`,`static-addressing-virtual-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Pi={command:`update <lan-id>`,describe:`Update Site LAN`,builder:Ni,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`})})},Fi={command:`lans`,describe:`Operations for sites.lans`,builder:e=>e.command(wi).command(Ei).command(Oi).command(Ai).command(Mi).command(Pi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ii(e){return e.usage(`$0 magic-transit sites list
359
-
360
- Lists Sites associated with an account. Use connectorid query param to return sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID.`).option(`connectorid`,{type:`string`,description:`Identifier`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Li={command:`list`,describe:`List Sites`,builder:Ii,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 Ri(e){return e.usage(`$0 magic-transit sites netflow-config create <site-id>
361
-
362
- Creates a NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const zi={command:`create <site-id>`,describe:`Create NetFlow Configuration`,builder:Ri,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 Bi(e){return e.usage(`$0 magic-transit sites netflow-config delete <site-id>
363
-
364
- Remove NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Vi={command:`delete <site-id>`,describe:`Delete NetFlow Configuration`,builder:Bi,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.
365
- `);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 Hi(e){return e.usage(`$0 magic-transit sites netflow-config edit <site-id>
366
-
367
- Updates NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ui={command:`edit <site-id>`,describe:`Update NetFlow Configuration`,builder:Hi,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 Wi(e){return e.usage(`$0 magic-transit sites netflow-config get <site-id>
368
-
369
- Get NetFlow configuration for a site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gi={command:`get <site-id>`,describe:`NetFlow Configuration Details`,builder:Wi,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 Ki(e){return e.usage(`$0 magic-transit sites netflow-config update <site-id>
370
-
371
- Updates NetFlow configuration for a site (partial update).`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`active-timeout`,{type:`number`,description:`Timeout in seconds for active flows.`}).option(`collector-ip`,{type:`string`,description:`IPv4 address of the NetFlow collector.`}).option(`collector-port`,{type:`number`,description:`UDP port of the NetFlow collector.`}).option(`inactive-timeout`,{type:`number`,description:`Timeout in seconds for inactive flows.`}).option(`sampling-rate`,{type:`number`,description:`Sampling rate for NetFlow records (1 = every packet).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qi={command:`update <site-id>`,describe:`Update NetFlow Configuration`,builder:Ki,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`})})},Ji={command:`netflow-config`,describe:`Operations for sites.netflow-config`,builder:e=>e.command(zi).command(Vi).command(Ui).command(Gi).command(qi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yi(e){return e.usage(`$0 magic-transit sites update <site-id>
372
-
373
- Update a specific Site.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Magic Connector identifier tag.`}).option(`description`,{type:`string`,description:`The description field`}).option(`ha-mode`,{type:`boolean`,description:`Site high availability mode. If set to true, the site can have two connectors and runs in high availability mode.`}).option(`location-lat`,{type:`string`,description:`Latitude`}).option(`location-lon`,{type:`string`,description:`Longitude`}).option(`name`,{type:`string`,description:`The name of the site.`}).option(`secondary-connector-id`,{type:`string`,description:`Magic Connector identifier tag. Used when high availability mode is on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xi={command:`update <site-id>`,describe:`Update Site`,builder:Yi,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 Zi(e){return e.usage(`$0 magic-transit sites wans create <site-id>
374
-
375
- Creates a new Site WAN.`).positional(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:"Magic WAN health check rate for tunnels created on this link. The default value is `mid`.",choices:[`low`,`mid`,`high`],default:`mid`}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`,default:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const Qi={command:`create <site-id>`,describe:`Create a new Site WAN`,builder:Zi,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:t[`health-check-rate`],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:t[`health-check-rate`],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 $i(e){return e.usage(`$0 magic-transit sites wans delete <wan-id>
376
-
377
- Remove a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ea={command:`delete <wan-id>`,describe:`Delete Site WAN`,builder:$i,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.
378
- `);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 ta(e){return e.usage(`$0 magic-transit sites wans edit <wan-id>
379
-
380
- Patch a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:`Magic WAN health check rate for tunnels created on this link.`,choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const na={command:`edit <wan-id>`,describe:`Patch Site WAN`,builder:ta,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:t[`health-check-rate`],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:t[`health-check-rate`],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 ra(e){return e.usage(`$0 magic-transit sites wans get <wan-id>
381
-
382
- Get a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ia={command:`get <wan-id>`,describe:`Site WAN Details`,builder:ra,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 aa(e){return e.usage(`$0 magic-transit sites wans list
383
-
384
- Lists Site WANs associated with an account.`).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oa={command:`list`,describe:`List Site WANs`,builder:aa,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>
385
-
386
- Update a specific Site WAN.`).positional(`wan-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`site-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`health-check-rate`,{type:`string`,description:`Magic WAN health check rate for tunnels created on this link.`,choices:[`low`,`mid`,`high`]}).coerce(`health-check-rate`,e=>p(e,`health-check-rate`,`text`)).option(`load-balance-inner-flows`,{type:`boolean`,description:`The load_balance_inner_flows field`}).option(`name`,{type:`string`,description:`The name field`}).option(`physport`,{type:`number`,description:`The physport field`}).option(`priority`,{type:`number`,description:`The priority field`}).option(`static-addressing-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`static-addressing-gateway-address`,{type:`string`,description:`A valid IPv4 address.`}).option(`static-addressing-secondary-address`,{type:`string`,description:`A valid CIDR notation representing an IP range.`}).option(`vlan-tag`,{type:`number`,description:`VLAN ID. Use zero for untagged.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`static-addressing-address`,`static-addressing-gateway-address`,`static-addressing-secondary-address`].some(t=>e[t]!==void 0)){let t=[`static-addressing-address`,`static-addressing-gateway-address`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --static_addressing-* flag is set`)}return!0})}const 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:t[`health-check-rate`],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:t[`health-check-rate`],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`})})},la={command:`wans`,describe:`Operations for sites.wans`,builder:e=>e.command(Qi).command(ea).command(na).command(ia).command(oa).command(ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ua={command:`sites`,describe:`Magic WAN branch sites — base CRUD, LAN/WAN interface configuration, ACLs, connectors, app configuration, and NetFlow config`,builder:e=>e.command(gi).command(vi).command(bi).command(Si).command(Li).command(Xi).command(ai).command(mi).command(Fi).command(Ji).command(la).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},da={command:`magic-transit`,describe:`DDoS-protected network transit — GRE/IPsec tunnels, static routes, Magic WAN sites, connectors, and packet captures`,builder:e=>e.command(N).command(Ct).command(Mt).command(Ut).command(Jt).command(rn).command($).command(In).command($n).command(br).command(jr).command(Kr).command(ua).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{da as default};