cf 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/dist/_meta/commands.json +6724 -3970
  2. package/dist/_meta/hand-written-commands.json +150 -32
  3. package/dist/_meta/schemas.json +2083 -2159
  4. package/dist/abuse-reports-BAQR1w79.mjs +26 -0
  5. package/dist/access-C8KMplzp.mjs +27 -0
  6. package/dist/account-B-KQSR0L.mjs +12 -0
  7. package/dist/account-tags-EncLJpLc.mjs +15 -0
  8. package/dist/accounts-BA4Mp3A_.mjs +132 -0
  9. package/dist/acm-ByxUJcqF.mjs +15 -0
  10. package/dist/addressing-C-ym0h0G.mjs +93 -0
  11. package/dist/agent-memory-CkPSiZDI.mjs +34 -0
  12. package/dist/ai-DkE_Q64s.mjs +31 -0
  13. package/dist/ai-audit-pPcjYWI5.mjs +6 -0
  14. package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
  15. package/dist/ai-search-DLD_kDS1.mjs +79 -0
  16. package/dist/ai-security-jyZcBl9g.mjs +10 -0
  17. package/dist/alerting-DOROjm8E.mjs +56 -0
  18. package/dist/analytics-rQ-h-plT.mjs +21 -0
  19. package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
  20. package/dist/{lifecycle-XswDq0ZB.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
  21. package/dist/api-security-B8p8vp8u.mjs +154 -0
  22. package/dist/argo-g8SjUb_t.mjs +10 -0
  23. package/dist/artifacts-B1PaeF5h.mjs +43 -0
  24. package/dist/audit-logs-DmU_PHy_.mjs +4 -0
  25. package/dist/auth-CZqics6E.mjs +2 -0
  26. package/dist/auth-Cp7gT-AF.mjs +8 -0
  27. package/dist/billing-CvTbUg-H.mjs +23 -0
  28. package/dist/bot-management-z53tbcbH.mjs +9 -0
  29. package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
  30. package/dist/brand-protection-DzV211IQ.mjs +27 -0
  31. package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
  32. package/dist/browser-run-DYQvMAyo.mjs +46 -0
  33. package/dist/build-BPIp8J5F.mjs +2 -0
  34. package/dist/build-OC77a1zq.mjs +2 -0
  35. package/dist/builds-CwKRqjQ5.mjs +71 -0
  36. package/dist/cache-CugNPPsJ.mjs +45 -0
  37. package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
  38. package/dist/cf-oadujOtC.mjs +18 -0
  39. package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
  40. package/dist/chunk-DL5FNmn1.mjs +2 -0
  41. package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
  42. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
  43. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
  44. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
  45. package/dist/client-certificates-DZUIqBTB.mjs +13 -0
  46. package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
  47. package/dist/cloud-connector-avpf86kG.mjs +6 -0
  48. package/dist/cloudflared-DhItYrCq.mjs +2 -0
  49. package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
  50. package/dist/command-B2Qe-WUa.mjs +2 -0
  51. package/dist/command-CF0giIIc.mjs +3 -0
  52. package/dist/command-D45NW-R3.mjs +2 -0
  53. package/dist/command-DIvPLK8x.mjs +2 -0
  54. package/dist/{completions-nPO9PdSu.mjs → completions-xPLd1cvL.mjs} +3 -3
  55. package/dist/{config-B8lwPpVl.mjs → config-B4vIa0zp.mjs} +1 -1
  56. package/dist/config.d.mts +1 -1729
  57. package/dist/config.mjs +1 -1
  58. package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
  59. package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
  60. package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
  61. package/dist/connectors-BSmhzNB7.mjs +15 -0
  62. package/dist/containers-B5vDcFzo.mjs +78 -0
  63. package/dist/{shared-YJtB5KZB.mjs → containers-CFzvhmyz.mjs} +85 -84
  64. package/dist/content-scan-CeLZAcbT.mjs +14 -0
  65. package/dist/cps-BlI_Od72.mjs +6 -0
  66. package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
  67. package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
  68. package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
  69. package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
  70. package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
  71. package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
  72. package/dist/custom-pages-BgfhGksj.mjs +21 -0
  73. package/dist/d1-P2kWbdID.mjs +45 -0
  74. package/dist/data-security-pBIozmRL.mjs +71 -0
  75. package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
  76. package/dist/delegate-GctF_lrq.mjs +2 -0
  77. package/dist/delegate.mjs +1 -1
  78. package/dist/{deploy-QTGENpOM.mjs → deploy-CVYdt3NK.mjs} +1 -1
  79. package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-DpOgndz4.mjs} +1 -1
  80. package/dist/dev-PPUBjWcm.mjs +4 -0
  81. package/dist/diagnostics-C62habGQ.mjs +15 -0
  82. package/dist/dialog-C_ccBiZp.mjs +2 -0
  83. package/dist/dist-B4pQ4CXK.mjs +48 -0
  84. package/dist/{dist-DW5BPGFs.mjs → dist-BpadEMNY.mjs} +1 -1
  85. package/dist/dist-dc4E1u01.mjs +272 -0
  86. package/dist/dls-CpkcyQ8C.mjs +17 -0
  87. package/dist/dns-DG1X4Wap.mjs +135 -0
  88. package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
  89. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
  90. package/dist/dry-run-CLX6Pbtq.mjs +2 -0
  91. package/dist/durable-objects-D214VhxH.mjs +8 -0
  92. package/dist/email-auth-Ba4ONan2.mjs +6 -0
  93. package/dist/email-routing-BlqKnqNM.mjs +45 -0
  94. package/dist/email-security-Dl1E1Dko.mjs +160 -0
  95. package/dist/email-sending-DIRSSRIz.mjs +47 -0
  96. package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
  97. package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
  98. package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
  99. package/dist/firewall-DdsDh8GD.mjs +56 -0
  100. package/dist/flagship-CkUIVW7c.mjs +28 -0
  101. package/dist/fraud-BUpZgvQT.mjs +22 -0
  102. package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
  103. package/dist/healthchecks-DjQWb3EM.mjs +22 -0
  104. package/dist/hostnames-ClBLPbct.mjs +11 -0
  105. package/dist/hyperdrive-U54xZsWU.mjs +37 -0
  106. package/dist/iam-T-wWmOep.mjs +52 -0
  107. package/dist/images-ia5UG1GW.mjs +71 -0
  108. package/dist/index.mjs +1 -1
  109. package/dist/intel-BhswZLMI.mjs +76 -0
  110. package/dist/interactive-B6woOLo-.mjs +32 -0
  111. package/dist/interactive-DnUvQHjc.mjs +2 -0
  112. package/dist/ips-Dad_EvhM.mjs +4 -0
  113. package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
  114. package/dist/keys-DjIPvqj4.mjs +4 -0
  115. package/dist/kv-DzXVnK94.mjs +21 -0
  116. package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
  117. package/dist/lifecycle-Ichnb2x1.mjs +2 -0
  118. package/dist/load-balancers-3wGHPsYz.mjs +76 -0
  119. package/dist/local-B6b2OIBW.mjs +2 -0
  120. package/dist/local-BrfySqnx.mjs +2 -0
  121. package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
  122. package/dist/login-CEQbOgBM.mjs +5 -0
  123. package/dist/login-DEWvGuaU.mjs +2 -0
  124. package/dist/logo-matches-YGRPstPi.mjs +6 -0
  125. package/dist/logos-BirufUgo.mjs +7 -0
  126. package/dist/logpush-BlNbUHyV.mjs +46 -0
  127. package/dist/logs-DmFlVF9q.mjs +48 -0
  128. package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
  129. package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
  130. package/dist/magic-transit-CBVOK2aa.mjs +387 -0
  131. package/dist/managed-defense-BdW6s483.mjs +18 -0
  132. package/dist/managed-transforms-BIeiofIS.mjs +9 -0
  133. package/dist/matches-CAnwci0P.mjs +6 -0
  134. package/dist/mcp-BfhOMGFE.mjs +32 -0
  135. package/dist/mesh-CxUL2Wf-.mjs +26 -0
  136. package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
  137. package/dist/network-C68psMbz.mjs +50 -0
  138. package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
  139. package/dist/oauth-D4bkeMAw.mjs +14 -0
  140. package/dist/oauth-DouM-qz0.mjs +2 -0
  141. package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
  142. package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
  143. package/dist/observability-DpYxkFeZ.mjs +80 -0
  144. package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-C4CKEADM.mjs} +3 -3
  145. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
  146. package/dist/organization-Dg55Xfz7.mjs +75 -0
  147. package/dist/organizations-QnyzGjB2.mjs +4 -0
  148. package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
  149. package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
  150. package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
  151. package/dist/{output-COcSQsfn.mjs → output-Bia1u2k5.mjs} +1 -1
  152. package/dist/page-rules--D3eXrCf.mjs +39 -0
  153. package/dist/pages-Ce8DDgNr.mjs +60 -0
  154. package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
  155. package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
  156. package/dist/pipelines-CAqCgBLh.mjs +44 -0
  157. package/dist/precursor-DBnn4Q35.mjs +4 -0
  158. package/dist/previews-y_nSqWK5.mjs +4 -0
  159. package/dist/progress-Bi02B6v4.mjs +2 -0
  160. package/dist/project-settings-DSXevRvj.mjs +3 -0
  161. package/dist/prompt-Bx2PB-tt.mjs +3 -0
  162. package/dist/queries-dg-CVXjf.mjs +9 -0
  163. package/dist/queues-C_ilLbRI.mjs +63 -0
  164. package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
  165. package/dist/r2-hZAkra-l.mjs +127 -0
  166. package/dist/radar-BO9b0aZy.mjs +300 -0
  167. package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
  168. package/dist/realtime-eSavuSeE.mjs +172 -0
  169. package/dist/registrar-Ct30kOXZ.mjs +43 -0
  170. package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
  171. package/dist/{registry-CWUfXloz.mjs → registry-vreNkX6u.mjs} +1 -1
  172. package/dist/reporting-B-F5aWUJ.mjs +14 -0
  173. package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
  174. package/dist/request-tracers-CaubpUFV.mjs +4 -0
  175. package/dist/resolve-BXemCSyA.mjs +2 -0
  176. package/dist/resolve-CUDKxUrW.mjs +2 -0
  177. package/dist/resource-sharing-6Snv-b69.mjs +40 -0
  178. package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
  179. package/dist/rules-C26eyeA5.mjs +18 -0
  180. package/dist/rulesets-BKzIwVtJ.mjs +37 -0
  181. package/dist/rum-Xdw5hyWY.mjs +30 -0
  182. package/dist/run-BBBMrSrs.mjs +2 -0
  183. package/dist/run-BRucX7Rz.mjs +2 -0
  184. package/dist/{schema-C8hU6G9R.mjs → schema-DqtYndhB.mjs} +1 -1
  185. package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CebDI0f1.mjs} +4 -4
  186. package/dist/scim-odJTXiIe.mjs +18 -0
  187. package/dist/{sdk-C12y5qCN.mjs → sdk-CvIO3tWS.mjs} +1 -1
  188. package/dist/secrets-store-RYpWWzaw.mjs +24 -0
  189. package/dist/security-center-B3D95vCa.mjs +30 -0
  190. package/dist/security-txt-BSytVv-9.mjs +9 -0
  191. package/dist/shared-D67owd9x.mjs +2 -0
  192. package/dist/smart-shield-C83Sfnf4.mjs +24 -0
  193. package/dist/snippets-B6oE9WIa.mjs +20 -0
  194. package/dist/source-BR4_k2ad.mjs +6 -0
  195. package/dist/spawn-CKqJ9J4_.mjs +523 -0
  196. package/dist/spectrum-CfxY--X_.mjs +83 -0
  197. package/dist/speed-DzK-kiWt.mjs +24 -0
  198. package/dist/src-B3h6tKMt.mjs +108 -0
  199. package/dist/ssl-dnjzPcSB.mjs +45 -0
  200. package/dist/startup-profile-CYEokTVe.mjs +2 -0
  201. package/dist/startup-profile-CgWHy4rE.mjs +17 -0
  202. package/dist/state-BxCejn42.mjs +2 -0
  203. package/dist/state-DSzkxXML.mjs +2 -0
  204. package/dist/stream-oFyhS4Wi.mjs +102 -0
  205. package/dist/submit-4f-ravmC.mjs +4 -0
  206. package/dist/tags-DrIP6Uiq.mjs +4 -0
  207. package/dist/{telemetry-DjGNSlkU.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
  208. package/dist/telemetry-Ds4epd3D.mjs +2 -0
  209. package/dist/telemetry-mKEb8lYB.mjs +2 -0
  210. package/dist/tenant-C-gc3NWv.mjs +12 -0
  211. package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
  212. package/dist/{tools-D9RZkZRc.mjs → tools-BMKpYraQ.mjs} +1 -1
  213. package/dist/tunnels-D0QYsskp.mjs +29 -0
  214. package/dist/turnstile-C6Q3spRB.mjs +33 -0
  215. package/dist/ui-DH95w1Qk.mjs +5 -0
  216. package/dist/undici-DTSBJHNS.mjs +96 -0
  217. package/dist/update-check-BBS1K1jt.mjs +2 -0
  218. package/dist/update-check-CTLoakFV.mjs +2 -0
  219. package/dist/update-check-worker.mjs +2 -0
  220. package/dist/url-info-Cs0V89qq.mjs +4 -0
  221. package/dist/url-normalization-DaEQYy5h.mjs +9 -0
  222. package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
  223. package/dist/user-BV1VY3Kl.mjs +112 -0
  224. package/dist/values-qDS63E43.mjs +4 -0
  225. package/dist/vectorize-NFzD3mP5.mjs +32 -0
  226. package/dist/version-W6_TN_kN.mjs +2 -0
  227. package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
  228. package/dist/web-assets-Gd6z8dbt.mjs +64 -0
  229. package/dist/web3-DCJx4NRp.mjs +28 -0
  230. package/dist/workers-B-j-1ygi.mjs +36 -0
  231. package/dist/workers-builds-DPrNKjZW.mjs +14 -0
  232. package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
  233. package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
  234. package/dist/workflows-C2KKIJjl.mjs +43 -0
  235. package/dist/zaraz-CVLCs1IX.mjs +22 -0
  236. package/dist/zero-trust-BtJi4OXF.mjs +795 -0
  237. package/dist/zone-hKgt0WzO.mjs +4 -0
  238. package/dist/zones-CCNyaD3J.mjs +124 -0
  239. package/package.json +15 -12
  240. package/dist/_meta/agent-context.json +0 -193
  241. package/dist/abuse-reports-BbaHw4ST.mjs +0 -8
  242. package/dist/access-D6Xz892p.mjs +0 -11
  243. package/dist/account-DvxcqeaK.mjs +0 -2
  244. package/dist/account-tags-CeqfEWpz.mjs +0 -9
  245. package/dist/accounts-Bx-8BMH9.mjs +0 -30
  246. package/dist/acm--0opdSGE.mjs +0 -3
  247. package/dist/addressing-BS1ynzLA.mjs +0 -13
  248. package/dist/agent-context-BPhyrSns.mjs +0 -8
  249. package/dist/agent-memory-DczzpEw5.mjs +0 -6
  250. package/dist/ai-CDdCTcQl.mjs +0 -5
  251. package/dist/ai-audit-Bx9KMQYh.mjs +0 -2
  252. package/dist/ai-gateway-BSXJEaYS.mjs +0 -13
  253. package/dist/ai-search-DRQj1aMu.mjs +0 -7
  254. package/dist/ai-security-C_Rb0lGT.mjs +0 -4
  255. package/dist/alerting-BAR9eFs2.mjs +0 -6
  256. package/dist/analytics-BaUZwNc5.mjs +0 -4
  257. package/dist/analytics_engine-DkEzlhfT.mjs +0 -2
  258. package/dist/api-security-jA0lOk6a.mjs +0 -50
  259. package/dist/argo-Cz4pDagx.mjs +0 -2
  260. package/dist/artifacts-BcLTGfAv.mjs +0 -5
  261. package/dist/audit-logs-DbIv4n6u.mjs +0 -2
  262. package/dist/auth-rW5d3jtr.mjs +0 -5
  263. package/dist/auth-tvDdC1J-.mjs +0 -8
  264. package/dist/billing-Md87QjqW.mjs +0 -3
  265. package/dist/bot-management-VHMo4hpU.mjs +0 -5
  266. package/dist/botnet-feed-BHqfo3sa.mjs +0 -3
  267. package/dist/brand-protection-HUeR6Pof.mjs +0 -3
  268. package/dist/browser-extension-199oZg3X.mjs +0 -3
  269. package/dist/browser-run-DDasyux-.mjs +0 -4
  270. package/dist/build-0QlYUfFS.mjs +0 -2
  271. package/dist/builds-B-lXn6JR.mjs +0 -9
  272. package/dist/cache-CevKpiTM.mjs +0 -9
  273. package/dist/certificate-authorities-DAg-aO1B.mjs +0 -2
  274. package/dist/cf-C11NGkjx.mjs +0 -18
  275. package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
  276. package/dist/chunk-QBZBEHZB-BuiXJn8j.mjs +0 -2
  277. package/dist/chunk-vbHwaUoU.mjs +0 -2
  278. package/dist/client-certificates-Bay7oPLE.mjs +0 -3
  279. package/dist/client-side-security-CbU9xn0k.mjs +0 -37
  280. package/dist/cloud-connector-AH2ClcSL.mjs +0 -2
  281. package/dist/cloudforce-one-DwOfS75V.mjs +0 -32
  282. package/dist/command-CMzMsll4.mjs +0 -2
  283. package/dist/connector-interrupts-DcLrqM2V.mjs +0 -2
  284. package/dist/connector-telemetry-events-PrJWgNs9.mjs +0 -2
  285. package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +0 -2
  286. package/dist/connectors-CEAy30E-.mjs +0 -3
  287. package/dist/containers-BsbDqbSn.mjs +0 -58
  288. package/dist/content-scan-BdK936iO.mjs +0 -4
  289. package/dist/cps-oP97-qkm.mjs +0 -2
  290. package/dist/csamScanner-DUNN4INg.mjs +0 -6
  291. package/dist/ct-alerting-dV_gsV2w.mjs +0 -3
  292. package/dist/custom-certificates-DYspvjo4.mjs +0 -5
  293. package/dist/custom-csrs-DjSWLQRu.mjs +0 -3
  294. package/dist/custom-hostnames-df1lH6IY.mjs +0 -5
  295. package/dist/custom-nameservers-CLTbN-9R.mjs +0 -3
  296. package/dist/custom-pages-DzKnSgL3.mjs +0 -3
  297. package/dist/d1-JBEqjJoj.mjs +0 -20
  298. package/dist/data-security-CIktWnXt.mjs +0 -7
  299. package/dist/dcv-delegation-_r6Vc6VL.mjs +0 -2
  300. package/dist/dev-CAubuxCc.mjs +0 -4
  301. package/dist/diagnostics-B0DRh714.mjs +0 -3
  302. package/dist/dist-12KzRsBM.mjs +0 -387
  303. package/dist/dist-BCVqQpg2.mjs +0 -2
  304. package/dist/dist-Cp3uJN1x.mjs +0 -48
  305. package/dist/dist-S9K_8gq9.mjs +0 -9
  306. package/dist/dls-CFzTHcZM.mjs +0 -3
  307. package/dist/dns-Dw6u-NV1.mjs +0 -29
  308. package/dist/dns-firewall-CIPptslp.mjs +0 -57
  309. package/dist/dry-run-DiVy1lVo.mjs +0 -2
  310. package/dist/durable-objects-CCkeqqBq.mjs +0 -2
  311. package/dist/email-auth-kdxO51Oz.mjs +0 -2
  312. package/dist/email-routing-BLggZdQq.mjs +0 -6
  313. package/dist/email-security-DjADlgdM.mjs +0 -18
  314. package/dist/email-sending-Cz7E7GoP.mjs +0 -7
  315. package/dist/error-sanitization-DfLijlBJ.mjs +0 -2
  316. package/dist/fieldExtractors-BWaMi6lD.mjs +0 -3
  317. package/dist/firewall-5t6OBIOl.mjs +0 -8
  318. package/dist/flagship-CzG_VoNR.mjs +0 -4
  319. package/dist/fraud-UOg_69Ob.mjs +0 -20
  320. package/dist/google-tag-gateway-DirkD-Q2.mjs +0 -2
  321. package/dist/healthchecks-BkHZGTp1.mjs +0 -4
  322. package/dist/hostnames-EUYOZm21.mjs +0 -3
  323. package/dist/hyperdrive-ZoLJlJCL.mjs +0 -21
  324. package/dist/iam-BQ2xSgYN.mjs +0 -6
  325. package/dist/images-CkEq6ScP.mjs +0 -8
  326. package/dist/intel-DDWEdGyl.mjs +0 -8
  327. package/dist/interactive-B2E03Fs-.mjs +0 -11
  328. package/dist/interactive-_B-EqD0Y.mjs +0 -23
  329. package/dist/ips-54Qmy-Uw.mjs +0 -2
  330. package/dist/keyless-certificates-CXHLc3Qz.mjs +0 -3
  331. package/dist/keys-rvI4TC3Z.mjs +0 -2
  332. package/dist/kv-CAeN1zBy.mjs +0 -5
  333. package/dist/leaked-credential-checks-CbbwtG-p.mjs +0 -4
  334. package/dist/load-balancers-BFwdwAIU.mjs +0 -6
  335. package/dist/local-C6XsFD_W.mjs +0 -2
  336. package/dist/logexplorer-D8rOPB5I.mjs +0 -17
  337. package/dist/logo-matches-Y3PxVn7t.mjs +0 -2
  338. package/dist/logos-BN8SvJhS.mjs +0 -3
  339. package/dist/logpush-BnLA4WVm.mjs +0 -4
  340. package/dist/logs-CDo7Y5sA.mjs +0 -3
  341. package/dist/magic-cloud-networking-wPuLwu-F.mjs +0 -5
  342. package/dist/magic-network-monitoring-BNERUpxS.mjs +0 -4
  343. package/dist/magic-transit-6tvVOECW.mjs +0 -111
  344. package/dist/managed-defense-AYwBOYIH.mjs +0 -2
  345. package/dist/managed-transforms-HZZNrkC7.mjs +0 -3
  346. package/dist/matches-Dp91L3dL.mjs +0 -2
  347. package/dist/mcp-P7pcieiT.mjs +0 -4
  348. package/dist/mesh-DjFrk6PL.mjs +0 -4
  349. package/dist/mtls-certificates-DZMoef2H.mjs +0 -3
  350. package/dist/network-7cd1U6-I.mjs +0 -6
  351. package/dist/network-interconnects-CQ7cPZjK.mjs +0 -41
  352. package/dist/oauth-DH3kMXSs.mjs +0 -14
  353. package/dist/oauth-clients-P9t-eMnx.mjs +0 -4
  354. package/dist/oauth-scopes-C3r9Qh_y.mjs +0 -2
  355. package/dist/observability-M1DnLhMR.mjs +0 -10
  356. package/dist/organization-cUE7GDCt.mjs +0 -45
  357. package/dist/organizations-C-Hcpd0w.mjs +0 -2
  358. package/dist/origin-ca-certificates-C8cJMyQH.mjs +0 -3
  359. package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +0 -2
  360. package/dist/origin-tls-client-auth-BsjR5EAV.mjs +0 -4
  361. package/dist/page-rules-B-zq1EUb.mjs +0 -27
  362. package/dist/pages-B6YpkPos.mjs +0 -14
  363. package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
  364. package/dist/pipelines-BJc_RylD.mjs +0 -6
  365. package/dist/precursor-CLQu7suY.mjs +0 -4
  366. package/dist/progress-V6SZV3Ux.mjs +0 -2
  367. package/dist/prompt-DjRTpML4.mjs +0 -3
  368. package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
  369. package/dist/queries-DSrrket-.mjs +0 -3
  370. package/dist/queues-Tf7kPBpn.mjs +0 -7
  371. package/dist/r2-DmKNnxtC.mjs +0 -25
  372. package/dist/r2-data-catalog-DBxoifOq.mjs +0 -16
  373. package/dist/radar-Csk7Ab-b.mjs +0 -2
  374. package/dist/realtime-CDehZVhV.mjs +0 -20
  375. package/dist/registrar-sandbox-BxVdfnam.mjs +0 -56
  376. package/dist/registrar-vflzeNQ9.mjs +0 -43
  377. package/dist/reporting-BaPZ1PHN.mjs +0 -2
  378. package/dist/request-headers-CC4eHmI2.mjs +0 -3
  379. package/dist/request-tracers-C_UVBexV.mjs +0 -2
  380. package/dist/resolve-B8CyM1mi.mjs +0 -2
  381. package/dist/resource-sharing-CoB4S9j1.mjs +0 -6
  382. package/dist/resource-tagging-CUiUC5g4.mjs +0 -2
  383. package/dist/rules-4O8076_s.mjs +0 -4
  384. package/dist/rulesets-C84MxTYo.mjs +0 -5
  385. package/dist/rum-Bvwkrntx.mjs +0 -4
  386. package/dist/run-CRfinkSe.mjs +0 -2
  387. package/dist/schemas-O_ZNaF8R.mjs +0 -65
  388. package/dist/scim-BvxQmde6.mjs +0 -4
  389. package/dist/secrets-store-DOKWiC-j.mjs +0 -7
  390. package/dist/security-center-Bhy_aC-w.mjs +0 -2
  391. package/dist/security-txt-L7HJ9tq5.mjs +0 -3
  392. package/dist/smart-shield-COMXuQ1S.mjs +0 -4
  393. package/dist/snippets-DffQhlKt.mjs +0 -4
  394. package/dist/spawn-C1AISA2V.mjs +0 -526
  395. package/dist/spectrum-Cmf7SqQE.mjs +0 -63
  396. package/dist/speed-m8cdhLFS.mjs +0 -4
  397. package/dist/src-C8phrg-8.mjs +0 -109
  398. package/dist/ssl-D4ffsdSw.mjs +0 -15
  399. package/dist/startup-profile-Dx95Y5cl.mjs +0 -17
  400. package/dist/state-CHif8Y5I.mjs +0 -2
  401. package/dist/stream-DPF5fojV.mjs +0 -16
  402. package/dist/submit-Br8hfP0_.mjs +0 -2
  403. package/dist/tags-Bnt4JuxQ.mjs +0 -2
  404. package/dist/telemetry-Ch1vCICm.mjs +0 -2
  405. package/dist/tenant-D8u0CxoC.mjs +0 -2
  406. package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +0 -3
  407. package/dist/tunnels-BkNPpTHa.mjs +0 -5
  408. package/dist/turnstile-MgwRECJv.mjs +0 -23
  409. package/dist/ui-DQSZeaG5.mjs +0 -5
  410. package/dist/url-info-Ddp7MgcI.mjs +0 -2
  411. package/dist/url-normalization-3ptK9ntV.mjs +0 -3
  412. package/dist/url-scanner-Psb9ollR.mjs +0 -2
  413. package/dist/user-DWdshcIu.mjs +0 -12
  414. package/dist/values-CDKQL1z2.mjs +0 -2
  415. package/dist/vectorize-CTYYUyQj.mjs +0 -4
  416. package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
  417. package/dist/web-assets-CpDwDEx8.mjs +0 -8
  418. package/dist/web3-YsjDyAzH.mjs +0 -4
  419. package/dist/workers-BKKxaZcz.mjs +0 -6
  420. package/dist/workers-builds-BWo5vUA9.mjs +0 -2
  421. package/dist/workers-for-platforms-ASJsxYdM.mjs +0 -5
  422. package/dist/workers-vpc-RkTnRvA2.mjs +0 -3
  423. package/dist/workflows-KrIFI9ns.mjs +0 -5
  424. package/dist/zaraz-DglXbVzZ.mjs +0 -2
  425. package/dist/zero-trust-RilTdSjX.mjs +0 -91
  426. package/dist/zone-DsBtVkvT.mjs +0 -2
  427. package/dist/zones-BFxvWFQW.mjs +0 -44
  428. /package/dist/{alerts-B2SJO4nd.mjs → alerts-CstOk8n0.mjs} +0 -0
  429. /package/dist/{autorag-iNjZXw1n.mjs → autorag-PRTwXGgn.mjs} +0 -0
  430. /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
  431. /package/dist/{brands-BrVnNrT3.mjs → brands-BHRXlWDm.mjs} +0 -0
  432. /package/dist/{clear-an9o3dJ3.mjs → clear-UvKESVx3.mjs} +0 -0
  433. /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-tt_LZMbn.mjs} +0 -0
  434. /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
  435. /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
  436. /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-BqTDXNBo.mjs} +0 -0
  437. /package/dist/{health-CIUg1C5o.mjs → health-CwPzzrV6.mjs} +0 -0
  438. /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
  439. /package/dist/{internal-DmpATljO.mjs → internal-WLHfxX64.mjs} +0 -0
  440. /package/dist/{live-B66u3_0g.mjs → live-D_k7eHdv.mjs} +0 -0
  441. /package/dist/{metadata-D062SVyy.mjs → metadata-APBiectA.mjs} +0 -0
  442. /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
  443. /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-C3K9smdl.mjs} +0 -0
  444. /package/dist/{ready-C-H2cwp_.mjs → ready-CvwvbdTX.mjs} +0 -0
  445. /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
  446. /package/dist/{refute-uSlzkQKq.mjs → refute-CIAFMj00.mjs} +0 -0
  447. /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
  448. /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
  449. /package/dist/{search-BlKeSfVD.mjs → search-12jA1b4l.mjs} +0 -0
  450. /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
  451. /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
  452. /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
  453. /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-CJTc9Pde.mjs} +0 -0
  454. /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
  455. /package/dist/{verify-S-TmhUDr.mjs → verify-CZW5Fo1q.mjs} +0 -0
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,n as p}from"./prompt-DjRTpML4.mjs";function m(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:m,handler:async l=>c({command:`logpush account-datasets fields get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/datasets/${l[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(l[`dataset-id`]))}/fields`,pathParams:{"account-or-zone":String(t),"dataset-id":String(l[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountDatasets.fields.get({account_or_zone:u,account_or_zone_id:d,dataset_id:l[`dataset-id`]})),{successLabel:`Loaded`})})},g={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account or zone for a dataset.`,builder:ee,handler:async l=>c({command:`logpush account-datasets jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/datasets/${l[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(l[`dataset-id`]))}/jobs`,pathParams:{"account-or-zone":String(t),"dataset-id":String(l[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountDatasets.jobs.get({account_or_zone:u,account_or_zone_id:d,dataset_id:l[`dataset-id`]})),{successLabel:`Loaded`})})},v={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.account_abuse_protection_events.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_bgp_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`filter-attack-traffic`,{type:`boolean`,description:"When true, excludes DDoS attack traffic from logs. This option is supported for the `http_requests`, `firewall_events`, and `network_analytics_logs` datasets.",default:!1}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Specifies the sampling rate as a floating number greater than 0 and at most 1. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 x={command:`create`,describe:`Creates a new Logpush job for an account or zone.`,builder:b,handler:async p=>c({command:`logpush account-jobs create`,classification:{safeFlags:[`dataset`,`enabled`,`filter-attack-traffic`,`frequency`,`kind`,`output-options-cve-2021-44228`,`output-options-merge-subrequests`,`output-options-output-type`,`output-options-timestamp-format`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({dataset:d(p.dataset,`dataset`,`text`),destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),enabled:p.enabled,filter:d(p.filter,`filter`,`text`),filter_attack_traffic:p[`filter-attack-traffic`],frequency:d(p.frequency,`frequency`,`text`),kind:d(p.kind,`kind`,`text`),logpull_options:d(p[`logpull-options`],`logpull-options`,`text`),name:d(p.name,`name`,`text`),output_options:{"CVE-2021-44228":p[`output-options-cve-2021-44228`],batch_prefix:d(p[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(p[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(p[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:p[`output-options-field-names`],merge_subrequests:p[`output-options-merge-subrequests`],output_type:d(p[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(p[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(p[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(p[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(p[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:p[`output-options-sample-rate`],timestamp_format:d(p[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountJobs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({dataset:d(p.dataset,`dataset`,`text`),destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),enabled:p.enabled,filter:d(p.filter,`filter`,`text`),filter_attack_traffic:p[`filter-attack-traffic`],frequency:d(p.frequency,`frequency`,`text`),kind:d(p.kind,`kind`,`text`),logpull_options:d(p[`logpull-options`],`logpull-options`,`text`),name:d(p.name,`name`,`text`),output_options:{"CVE-2021-44228":p[`output-options-cve-2021-44228`],batch_prefix:d(p[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(p[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(p[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:p[`output-options-field-names`],merge_subrequests:p[`output-options-merge-subrequests`],output_type:d(p[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(p[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(p[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(p[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(p[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:p[`output-options-sample-rate`],timestamp_format:d(p[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountJobs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function S(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:S,handler:async l=>c({command:`logpush account-jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(l[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();if(u===`zones`?l.zoneId=d:l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the Logpush job.`})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>c.logpush.accountJobs.delete({account_or_zone:u,account_or_zone_id:d,job_id:l[`job-id`]})),{successLabel:`Deleted`})})};function w(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:w,handler:async l=>c({command:`logpush account-jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(l[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountJobs.get({account_or_zone:u,account_or_zone_id:d,job_id:l[`job-id`]})),{successLabel:`Loaded`})})};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Lists Logpush jobs for an account or zone.`,builder:E,handler:async l=>c({command:`logpush account-jobs list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountJobs.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function O(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`filter-attack-traffic`,{type:`boolean`,description:"When true, excludes DDoS attack traffic from logs. This option is supported for the `http_requests`, `firewall_events`, and `network_analytics_logs` datasets."}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Specifies the sampling rate as a floating number greater than 0 and at most 1. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 k={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:O,handler:async f=>c({command:`logpush account-jobs update`,classification:{safeFlags:[`enabled`,`filter-attack-traffic`,`frequency`,`kind`,`output-options-cve-2021-44228`,`output-options-merge-subrequests`,`output-options-output-type`,`output-options-timestamp-format`,`dry-run`]}},f,async()=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${f[`job-id`]==null?`<job-id>`:encodeURIComponent(String(f[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(f[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?u({destination_conf:d(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:d(f.filter,`filter`,`text`),filter_attack_traffic:f[`filter-attack-traffic`],frequency:d(f.frequency,`frequency`,`text`),kind:d(f.kind,`kind`,`text`),logpull_options:d(f[`logpull-options`],`logpull-options`,`text`),name:d(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:d(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(f[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:f[`output-options-field-names`],merge_subrequests:f[`output-options-merge-subrequests`],output_type:d(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:d(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(f[`ownership-challenge`],`ownership-challenge`,`text`)}):l(f.body)});return}let c=await i(f),p=f.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:f.zone},c,{quiet:f.quiet}):f.local?e:await t();if(p===`zones`?f.zoneId=m:f.accountId=m,f.body){let e=l(f.body);a(await s(`Updating`,async()=>c.logpush.accountJobs.update({...e,account_or_zone:p,account_or_zone_id:m,job_id:f[`job-id`]})),{successLabel:`Updated`});return}let h=u({destination_conf:d(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:d(f.filter,`filter`,`text`),filter_attack_traffic:f[`filter-attack-traffic`],frequency:d(f.frequency,`frequency`,`text`),kind:d(f.kind,`kind`,`text`),logpull_options:d(f[`logpull-options`],`logpull-options`,`text`),name:d(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:d(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(f[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:f[`output-options-field-names`],merge_subrequests:f[`output-options-merge-subrequests`],output_type:d(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:d(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(f[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Updating`,async()=>c.logpush.accountJobs.update({...h,account_or_zone:p,account_or_zone_id:m,job_id:f[`job-id`]})),{successLabel:`Updated`})})},A={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 M={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:j,handler:async p=>c({command:`logpush account-ownership create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/ownership`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountOwnership.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountOwnership.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function N(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 P={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:N,handler:async p=>c({command:`logpush account-ownership validate create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/ownership/validate`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountOwnership.validate.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),p[`ownership-challenge`]===void 0&&(p[`ownership-challenge`]=await f(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountOwnership.validate.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},F={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(M).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:L,handler:async p=>c({command:`logpush account-validate destination-exists-delete`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/validate/destination/exists`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountValidate.destinationExistsDelete({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountValidate.destinationExistsDelete({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function z(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 B={command:`delete`,describe:`Validates destination.`,builder:z,handler:async p=>c({command:`logpush account-validate destination delete`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/validate/destination`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountValidate.destination.delete({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountValidate.destination.delete({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},te={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).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 H={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:V,handler:async p=>c({command:`logpush account-validate origin create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/validate/origin`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({logpull_options:d(p[`logpull-options`],`logpull-options`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountValidate.origin.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`logpull-options`]===void 0&&(p[`logpull-options`]=await f(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let g=u({logpull_options:d(p[`logpull-options`],`logpull-options`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountValidate.origin.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},U={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(R).command(te).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`fields`,{type:`string`,description:`Comma-separated list of fields.`}).option(`filter`,{type:`string`,description:`Filters to drill down into specific events.`}).option(`sample`,{type:`number`,description:`The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so 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 K={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:G,handler:async e=>c({command:`logpush edge create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.logpush.edge.create({...r,zone_id:n})),{successLabel:`Created`});return}let c=u({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample});a(await s(`Creating`,async()=>t.logpush.edge.create({...c,zone_id:n})),{successLabel:`Created`})})};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:q,handler:async e=>c({command:`logpush edge get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf logpush edge get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.edge.get({zone_id:n})),{successLabel:`Loaded`})})},Y={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`version-id`,{type:`number`,description:`Specific version ID to retrieve. When omitted, the latest version is returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <transformer-id>`,describe:"Returns the SQL query content for a transformer. Without query params, returns the latest version. With `version_id`, returns the specified version.",builder:X,handler:async r=>c({command:`logpush transformers content get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={version_id:r[`version-id`]};if(r.dryRun){o({command:`cf logpush transformers content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}/content`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.logpush.transformers.content.get({account_id:u,transformer_id:r[`transformer-id`],...c})),{successLabel:`Loaded`})})},Q={command:`content`,describe:`Operations for transformers.content`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`code`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`description`,{type:`string`,description:`Optional customer-provided description.`}).option(`name`,{type:`string`,description:`Customer-provided name for identification.`}).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 re={command:`create`,describe:`Creates a new custom log transformer for an account.`,builder:ne,handler:async r=>c({command:`logpush transformers create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.logpush.transformers.create({...e,account_id:p})),{successLabel:`Created`});return}r.code===void 0&&(r.code=await f(`code`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`)),r.name===void 0&&(r.name=await f(`name`,`Customer-provided name for identification.`));let m=u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.logpush.transformers.create({...m,account_id:p})),{successLabel:`Created`})})};function ie(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,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 <transformer-id>`,describe:`Deletes a custom log transformer. Returns 409 Conflict if any active logpush jobs reference the transformer.`,builder:ie,handler:async r=>c({command:`logpush transformers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>c.logpush.transformers.delete({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Deleted`})})};function oe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <transformer-id>`,describe:`Gets a single custom log transformer by ID.`,builder:oe,handler:async r=>c({command:`logpush transformers get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.transformers.get({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Loaded`})})};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`Lists all custom log transformers for an account.`,builder:ce,handler:async r=>c({command:`logpush transformers list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.transformers.list({account_id:l})),{successLabel:`Loaded`})})};function ue(e){return e.option(`sql`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).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 de={command:`preview`,describe:`Executes a SQL transformer against a single input record and returns the transformed output. This is a stateless endpoint — nothing is persisted.`,builder:ue,handler:async r=>c({command:`logpush transformers preview`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/preview`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({sql:d(r.sql,`sql`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Loading`,async()=>c.logpush.transformers.preview({...e,account_id:p})),{successLabel:`Loaded`});return}r.sql===void 0&&(r.sql=await f(`sql`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`));let m=u({sql:d(r.sql,`sql`,`text`)});a(await s(`Loading`,async()=>c.logpush.transformers.preview({...m,account_id:p})),{successLabel:`Loaded`})})};function fe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`code`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`description`,{type:`string`,description:`Optional customer-provided description.`}).option(`name`,{type:`string`,description:`Customer-provided name for identification.`}).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 pe={command:`update <transformer-id>`,describe:"Updates an existing custom log transformer. When `code` is provided, the SQL query is validated and a new version is created. When `code` is omitted, only the name and description are updated. Omitting `description` clears the existing description.",builder:fe,handler:async r=>c({command:`logpush transformers update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.logpush.transformers.update({...e,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await f(`name`,`Customer-provided name for identification.`));let m=u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.logpush.transformers.update({...m,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`})})};function $(e){return e.option(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Maximum number of versions to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Returns version metadata for a transformer, newest first. Each version corresponds to a SQL query update.`,builder:$,handler:async r=>c({command:`logpush transformers versions list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit};if(r.dryRun){o({command:`cf logpush transformers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}/versions`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.logpush.transformers.versions.list({account_id:u,transformer_id:r[`transformer-id`],...c})),{successLabel:`Loaded`})})},he={command:`versions`,describe:`Operations for transformers.versions`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`transformers`,describe:`Operations for transformers`,builder:e=>e.command(re).command(ae).command(se).command(le).command(de).command(pe).command(Q).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`logpush`,describe:`logpush`,builder:e=>e.command(y).command(A).command(I).command(W).command(Y).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{_e as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{a as i,r as a}from"./auth-tvDdC1J-.mjs";import{t as o}from"./output-COcSQsfn.mjs";import{t as s}from"./dry-run-DiVy1lVo.mjs";import{t as c}from"./progress-V6SZV3Ux.mjs";import{t as l}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{n as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.option(`allow-out-of-region-access`,{type:`boolean`,description:`Allow out of region access`}).option(`regions`,{type:`string`,description:`Name of the region.`}).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 g={command:`create`,describe:`Updates CMB config.`,builder:h,handler:async r=>l({command:`logs control cmb config create`,classification:{safeFlags:[`allow-out-of-region-access`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf logs control cmb config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:f(r.regions,`regions`,`text`)}):u(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:e,account_id:l})),{successLabel:`Created`});return}let p=d({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:f(r.regions,`regions`,`text`)});o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:p,account_id:l})),{successLabel:`Created`})})};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Deletes CMB config.`,builder:_,handler:async r=>l({command:`logs control cmb config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf logs control cmb config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`This operation deletes the CMB config.`})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.logs.control.cmb.config.delete({account_id:l})),{successLabel:`Deleted`})})};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Gets CMB config.`,builder:y,handler:async r=>l({command:`logs control cmb config get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf logs control cmb config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.logs.control.cmb.config.get({account_id:l})),{successLabel:`Loaded`})})},x={command:`config`,describe:`Operations for control.cmb.config`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`flag`,{type:`boolean`,description:`The log retention flag for Logpull API.`}).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 w={command:`create`,describe:`Updates log retention flag for Logpull API.`,builder:C,handler:async e=>l({command:`logs control retention create`,classification:{safeFlags:[`flag`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf logs control retention create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({flag:e.flag}):u(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=u(e.body);o(await c(`Creating`,async()=>t.logs.control.retention.create({body:r,zone_id:n})),{successLabel:`Created`});return}let i=d({flag:e.flag});o(await c(`Creating`,async()=>t.logs.control.retention.create({body:i,zone_id:n})),{successLabel:`Created`})})};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:T,handler:async e=>l({command:`logs control retention get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf logs control retention get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.logs.control.retention.get({zone_id:n})),{successLabel:`Loaded`})})},D={command:`retention`,describe:`Operations for control.retention`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`control`,describe:`Log control operations`,builder:e=>e.command(S).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`limit`,{type:`number`,description:`Maximum number of results to return.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Lists R2 objects containing logs matching the provided query parameters.`,builder:k,handler:async r=>l({command:`logs list get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let l={start:r.start,end:r.end,bucket:r.bucket,prefix:r.prefix,limit:r.limit},u={};if(r[`r2-access-key-id`]!==void 0&&(u[`R2-Access-Key-Id`]=String(r[`r2-access-key-id`])),r[`r2-secret-access-key`]!==void 0&&(u[`R2-Secret-Access-Key`]=String(r[`r2-secret-access-key`])),r.dryRun){s({command:`cf logs list get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/list`,pathParams:{},query:l,bodyKind:`none`});return}let d=await a(r),f=r.local?e:await t();r.accountId=f,o(await c(`Loading`,async()=>i(d,`GET`,`/accounts/${f}/logs/list`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},j={command:`list`,describe:`Operations for list`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.positional(`ray-id`,{type:`string`,description:`Ray identifier.`,demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <ray-id>`,describe:"The `/rayids` api route allows lookups by specific rayid. The rayids route will return zero, one, or more records (ray ids are not unique).",builder:m(M),handler:async e=>l({command:`logs rayid get`,classification:{safeFlags:[`timestamps`,`dry-run`]}},e,async()=>{let t={fields:e.fields,timestamps:e.timestamps};if(e.dryRun){s({command:`cf logs rayid get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/rayids/${e[`ray-id`]==null?`<ray-id>`:encodeURIComponent(String(e[`ray-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"ray-id":String(e[`ray-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.logs.rayid.get({zone_id:i,ray_id:e[`ray-id`],...t})),{successLabel:`Loaded`})})},P={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Lists all fields available. The response is json object with key-value pairs, where keys are field names, and values are descriptions.`,builder:F,handler:async e=>l({command:`logs received fields get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf logs received fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received/fields`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.logs.received.fields.get({zone_id:n})),{successLabel:`Loaded`})})},L={command:`fields`,describe:`Operations for received.fields`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`start`,{type:`string`,description:`Sets the (inclusive) beginning of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than seven days.`}).option(`end`,{type:`string`,description:"Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. `end` must be at least five minutes earlier than now and must be later than `start`. Difference between `start` and `end` must be not greater than one hour.",demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`sample`,{type:`number`,description:"When `?sample=` is provided, a sample of matching records is returned. If `sample=0.1` then 10% of records will be returned. Sampling is random: repeated calls will not only return different records, but likely will also vary slightly in number of returned records. When `?count=` is also specified, `count` is applied to the number of returned records, not the sampled records. So, with `sample=0.05` and `count=7`, when there is a total of 100 records available, approximately five will be returned. When there are 1000 records, seven will be returned. When there are 10,000 records, seven will be returned."}).option(`count`,{type:`number`,description:"When `?count=` is provided, the response will contain up to `count` results. Since results are not sorted, you are likely to get different data for repeated requests. `count` must be an integer > 0."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:'The `/received` api route allows customers to retrieve their edge HTTP logs. The basic access pattern is "give me all the logs for zone Z for minute M", where the minute M refers to the time records were received at Cloudflare\'s central data center. `start` is inclusive, and `end` is exclusive. Because of that, to get all data, at minutely cadence, starting at 10AM, the proper values are: `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap will be handled properly.',builder:m(R),handler:async e=>l({command:`logs received get`,classification:{safeFlags:[`timestamps`,`dry-run`]}},e,async()=>{let t={start:e.start,end:e.end,fields:e.fields,sample:e.sample,count:e.count,timestamps:e.timestamps};if(e.dryRun){s({command:`cf logs received get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.logs.received.get({zone_id:i,...t})),{successLabel:`Loaded`})})},B={command:`received`,describe:`Received log operations`,builder:e=>e.command(z).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Returns logs stored in R2 that match the provided query parameters.`,builder:V,handler:async r=>l({command:`logs retrieve get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let l={start:r.start,end:r.end,bucket:r.bucket,prefix:r.prefix},u={};if(r[`r2-access-key-id`]!==void 0&&(u[`R2-Access-Key-Id`]=String(r[`r2-access-key-id`])),r[`r2-secret-access-key`]!==void 0&&(u[`R2-Secret-Access-Key`]=String(r[`r2-secret-access-key`])),r.dryRun){s({command:`cf logs retrieve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/retrieve`,pathParams:{},query:l,bodyKind:`none`});return}let d=await a(r),f=r.local?e:await t();r.accountId=f,o(await c(`Loading`,async()=>i(d,`GET`,`/accounts/${f}/logs/retrieve`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},U={command:`retrieve`,describe:`Operations for retrieve`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(O).command(j).command(P).command(B).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p,i as m,n as h}from"./prompt-DjRTpML4.mjs";import{t as g}from"./cli-types-CrSoSMPF.mjs";import{n as _,t as v}from"./raw-fetch-BVYQR6C5.mjs";function ee(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).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 te={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:ee,handler:async h=>c({command:`magic-cloud-networking catalog-syncs create`,classification:{safeFlags:[`destination-type`,`update-mode`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({description:f(h.description,`description`,`text`),destination_type:f(h[`destination-type`],`destination-type`,`text`),name:f(h.name,`name`,`text`),policy:f(h.policy,`policy`,`text`),update_mode:f(h[`update-mode`],`update-mode`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}h[`destination-type`]===void 0&&(h[`destination-type`]=await m(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),h.name===void 0&&(h.name=await p(`name`,`The name field`)),h[`update-mode`]===void 0&&(h[`update-mode`]=await m(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`destination-type`]!==void 0&&l(v,[`destination_type`],f(h[`destination-type`],`destination-type`,`text`)),h.name!==void 0&&l(v,[`name`],f(h.name,`name`,`text`)),h.policy!==void 0&&l(v,[`policy`],f(h.policy,`policy`,`text`)),h[`update-mode`]!==void 0&&l(v,[`update_mode`],f(h[`update-mode`],`update-mode`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function y(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:y,handler:async r=>c({command:`magic-cloud-networking catalog-syncs delete`,classification:{safeFlags:[`delete-destination`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{let c={delete_destination:r[`delete-destination`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await h({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>l.magicCloudNetworking.catalogSyncs.delete({account_id:u,sync_id:r[`sync-id`],...c})),{successLabel:`Deleted`})})};function x(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).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 S={command:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:x,handler:async r=>c({command:`magic-cloud-networking catalog-syncs edit`,classification:{safeFlags:[`update-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:p,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`})})};function C(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:C,handler:async r=>c({command:`magic-cloud-networking catalog-syncs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.get({account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Loaded`})})};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:T,handler:async r=>c({command:`magic-cloud-networking catalog-syncs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.list({account_id:l})),{successLabel:`Loaded`})})};function D(e){return e.option(`destination-type`,{type:`string`,description:`Specify type of destination, omit to return all.`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:g(D),handler:async r=>c({command:`magic-cloud-networking catalog-syncs prebuilt-policies list`,classification:{safeFlags:[`destination-type`,`dry-run`]}},r,async()=>{let c={destination_type:r[`destination-type`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs prebuilt-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/prebuilt-policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({account_id:u,...c})),{successLabel:`Loaded`})})},k={command:`prebuilt-policies`,describe:`Operations for catalog-syncs.prebuilt-policies`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:A,handler:async r=>c({command:`magic-cloud-networking catalog-syncs refresh`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}/refresh`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.catalogSyncs.refresh({account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Created`})})};function M(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:M,handler:async r=>c({command:`magic-cloud-networking catalog-syncs update`,classification:{safeFlags:[`update-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:e,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:p,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`})})},P={command:`catalog-syncs`,describe:`Operations for catalog-syncs`,builder:e=>e.command(te).command(b).command(S).command(w).command(E).command(j).command(N).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).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 I={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:F,handler:async h=>c({command:`magic-cloud-networking cloud-integrations create`,classification:{safeFlags:[`cloud-type`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking cloud-integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({cloud_type:f(h[`cloud-type`],`cloud-type`,`text`),description:f(h.description,`description`,`text`),friendly_name:f(h[`friendly-name`],`friendly-name`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}h[`cloud-type`]===void 0&&(h[`cloud-type`]=await m(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),h[`friendly-name`]===void 0&&(h[`friendly-name`]=await p(`friendly-name`,`The friendly_name field`));let v={};h[`cloud-type`]!==void 0&&l(v,[`cloud_type`],f(h[`cloud-type`],`cloud-type`,`text`)),h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`friendly-name`]!==void 0&&l(v,[`friendly_name`],f(h[`friendly-name`],`friendly-name`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function L(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,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 R={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:L,handler:async r=>c({command:`magic-cloud-networking cloud-integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>c.magicCloudNetworking.cloudIntegrations.delete({account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Deleted`})})};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:z,handler:async r=>c({command:`magic-cloud-networking cloud-integrations discover-all`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations discover-all`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/discover`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.cloudIntegrations.discoverAll({account_id:l})),{successLabel:`Created`})})};function V(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:V,handler:async r=>c({command:`magic-cloud-networking cloud-integrations discover`,classification:{safeFlags:[`v2`,`dry-run`]}},r,async()=>{let c={v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations discover`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}/discover`,pathParams:{"provider-id":String(r[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Creating`,async()=>l.magicCloudNetworking.cloudIntegrations.discover({account_id:u,provider_id:r[`provider-id`],...c})),{successLabel:`Created`})})};function U(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).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 W={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:U,handler:async r=>c({command:`magic-cloud-networking cloud-integrations edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:p,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`})})};function G(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:G,handler:async r=>c({command:`magic-cloud-networking cloud-integrations get`,classification:{safeFlags:[`status`,`dry-run`]}},r,async()=>{let c={status:r.status};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.get({account_id:u,provider_id:r[`provider-id`],...c})),{successLabel:`Loaded`})})};function q(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:q,handler:async r=>c({command:`magic-cloud-networking cloud-integrations initial-setup`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations initial-setup`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}/initial_setup`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.cloudIntegrations.initialSetup({account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Loaded`})})};function Y(e){return e.option(`status`,{type:`boolean`,description:`Status`}).option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:Y,handler:async r=>c({command:`magic-cloud-networking cloud-integrations list`,classification:{safeFlags:[`status`,`desc`,`cloudflare`,`dry-run`]}},r,async()=>{let c={status:r.status,order_by:r[`order-by`],desc:r.desc,cloudflare:r.cloudflare};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Z(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).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 Q={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:Z,handler:async r=>c({command:`magic-cloud-networking cloud-integrations update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:p,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`})})},ne={command:`cloud-integrations`,describe:`Operations for cloud-integrations`,builder:e=>e.command(I).command(R).command(H).command(B).command(W).command(K).command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).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 ie={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:re,handler:async r=>c({command:`magic-cloud-networking on-ramps address-spaces edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({prefixes:r.prefixes}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=d({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:f,account_id:l})),{successLabel:`Updated`})})};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ae,handler:async r=>c({command:`magic-cloud-networking on-ramps address-spaces list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.list({account_id:l})),{successLabel:`Loaded`})})};function se(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).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 ce={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:se,handler:async r=>c({command:`magic-cloud-networking on-ramps address-spaces update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({prefixes:r.prefixes}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=d({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:f,account_id:l})),{successLabel:`Updated`})})},le={command:`address-spaces`,describe:`Operations for on-ramps.address-spaces`,builder:e=>e.command(ie).command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:ue,handler:async r=>c({command:`magic-cloud-networking on-ramps apply`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps apply`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/apply`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.onRamps.apply({account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Created`})})};function fe(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`adopted-hub-id`,{type:`string`,description:`The adopted_hub_id field`}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`cloud-asn`,{type:`number`,description:`Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect.`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`dynamic-routing`,{type:`boolean`,description:`Enables BGP routing. When enabling this feature, set both install_routes_in_cloud and install_routes_in_magic_wan to false.`}).option(`hub-provider-id`,{type:`string`,description:`The hub_provider_id field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`region`,{type:`string`,description:`The region field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`OnrampTypeSingle`,`OnrampTypeHub`]}).option(`vpc`,{type:`string`,description:`The vpc field`}).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 pe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:fe,handler:async h=>c({command:`magic-cloud-networking on-ramps create`,classification:{safeFlags:[`cloud-type`,`dynamic-routing`,`install-routes-in-cloud`,`install-routes-in-magic-wan`,`manage-hub-to-hub-attachments`,`manage-vpc-to-hub-attachments`,`type`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking on-ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({adopted_hub_id:f(h[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:h[`attached-hubs`],attached_vpcs:h[`attached-vpcs`],cloud_asn:h[`cloud-asn`],cloud_type:f(h[`cloud-type`],`cloud-type`,`text`),description:f(h.description,`description`,`text`),dynamic_routing:h[`dynamic-routing`],hub_provider_id:f(h[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:h[`install-routes-in-cloud`],install_routes_in_magic_wan:h[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:h[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:h[`manage-vpc-to-hub-attachments`],name:f(h.name,`name`,`text`),region:f(h.region,`region`,`text`),type:f(h.type,`type`,`text`),vpc:f(h.vpc,`vpc`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(h[`cloud-type`]===void 0&&(h[`cloud-type`]=await m(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),h[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(h[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(h[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);h.name===void 0&&(h.name=await p(`name`,`The name field`)),h.type===void 0&&(h.type=await m(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};h[`adopted-hub-id`]!==void 0&&l(v,[`adopted_hub_id`],f(h[`adopted-hub-id`],`adopted-hub-id`,`text`)),h[`attached-hubs`]!==void 0&&l(v,[`attached_hubs`],h[`attached-hubs`]),h[`attached-vpcs`]!==void 0&&l(v,[`attached_vpcs`],h[`attached-vpcs`]),h[`cloud-asn`]!==void 0&&l(v,[`cloud_asn`],h[`cloud-asn`]),h[`cloud-type`]!==void 0&&l(v,[`cloud_type`],f(h[`cloud-type`],`cloud-type`,`text`)),h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`dynamic-routing`]!==void 0&&l(v,[`dynamic_routing`],h[`dynamic-routing`]),h[`hub-provider-id`]!==void 0&&l(v,[`hub_provider_id`],f(h[`hub-provider-id`],`hub-provider-id`,`text`)),h[`install-routes-in-cloud`]!==void 0&&l(v,[`install_routes_in_cloud`],h[`install-routes-in-cloud`]),h[`install-routes-in-magic-wan`]!==void 0&&l(v,[`install_routes_in_magic_wan`],h[`install-routes-in-magic-wan`]),h[`manage-hub-to-hub-attachments`]!==void 0&&l(v,[`manage_hub_to_hub_attachments`],h[`manage-hub-to-hub-attachments`]),h[`manage-vpc-to-hub-attachments`]!==void 0&&l(v,[`manage_vpc_to_hub_attachments`],h[`manage-vpc-to-hub-attachments`]),h.name!==void 0&&l(v,[`name`],f(h.name,`name`,`text`)),h.region!==void 0&&l(v,[`region`],f(h.region,`region`,`text`)),h.type!==void 0&&l(v,[`type`],f(h.type,`type`,`text`)),h.vpc!==void 0&&l(v,[`vpc`],f(h.vpc,`vpc`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function me(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`destroy`,{type:`boolean`,description:`Destroy`}).option(`force`,{type:`boolean`,description:`Force`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:me,handler:async r=>c({command:`magic-cloud-networking on-ramps delete`,classification:{safeFlags:[`destroy`,`force`,`dry-run`]}},r,async()=>{let c={destroy:r.destroy,force:r.force};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await h({force:!!r.force})){process.stderr.write(`Aborted.
5
- `);return}a(await s(`Deleting`,async()=>l.magicCloudNetworking.onRamps.delete({account_id:u,onramp_id:r[`onramp-id`],...c})),{successLabel:`Deleted`})})};function ge(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).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 _e={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:ge,handler:async r=>c({command:`magic-cloud-networking on-ramps edit`,classification:{safeFlags:[`install-routes-in-cloud`,`install-routes-in-magic-wan`,`manage-hub-to-hub-attachments`,`manage-vpc-to-hub-attachments`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:e,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:p,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})})};function ve(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,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 ye={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:ve,handler:async r=>c({command:`magic-cloud-networking on-ramps export`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/export`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a;let c=await s(`Loading`,async()=>v(`/accounts/${a}/magic/cloud/onramps/${encodeURIComponent(String(r[`onramp-id`]))}/export`,{method:`POST`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?c.toString(`utf-8`):c)})};function be(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`post-apply-resources`,{type:`boolean`,description:`Post apply resources`}).option(`planned-resources`,{type:`boolean`,description:`Planned resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:be,handler:async r=>c({command:`magic-cloud-networking on-ramps get`,classification:{safeFlags:[`status`,`vpcs`,`post-apply-resources`,`planned-resources`,`dry-run`]}},r,async()=>{let c={status:r.status,vpcs:r.vpcs,post_apply_resources:r[`post-apply-resources`],planned_resources:r[`planned-resources`]};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.onRamps.get({account_id:u,onramp_id:r[`onramp-id`],...c})),{successLabel:`Loaded`})})};function Se(e){return e.option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:Se,handler:async r=>c({command:`magic-cloud-networking on-ramps list`,classification:{safeFlags:[`desc`,`status`,`vpcs`,`dry-run`]}},r,async()=>{let c={order_by:r[`order-by`],desc:r.desc,status:r.status,vpcs:r.vpcs};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.onRamps.list({account_id:u,...c})),{successLabel:`Loaded`})})};function we(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:we,handler:async r=>c({command:`magic-cloud-networking on-ramps plan`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/plan`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.onRamps.plan({account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Created`})})};function Ee(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).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 De={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Ee,handler:async r=>c({command:`magic-cloud-networking on-ramps update`,classification:{safeFlags:[`install-routes-in-cloud`,`install-routes-in-magic-wan`,`manage-hub-to-hub-attachments`,`manage-vpc-to-hub-attachments`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:e,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:p,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})})},$={command:`on-ramps`,describe:`Operations for on-ramps`,builder:e=>e.command(de).command(pe).command(he).command(_e).command(ye).command(xe).command(Ce).command(Te).command(De).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`v2`,{type:`boolean`,description:`V2`}).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 ke={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:Oe,handler:async r=>c({command:`magic-cloud-networking resources export`,classification:{safeFlags:[`desc`,`v2`,`dry-run`,`text`]}},r,async()=>{let a={provider_id:r[`provider-id`],resource_type:r[`resource-type`],resource_id:r[`resource-id`],region:r.region,resource_group:r[`resource-group`],search:r.search,order_by:r[`order-by`],desc:r.desc,v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/export`,pathParams:{},query:a,bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>v(`/accounts/${c}/magic/cloud/resources/export${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?u.toString(`utf-8`):u)})};function Ae(e){return e.positional(`resource-id`,{type:`string`,description:`Resource ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:Ae,handler:async r=>c({command:`magic-cloud-networking resources get`,classification:{safeFlags:[`v2`,`dry-run`]}},r,async()=>{let c={v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/${r[`resource-id`]==null?`<resource-id>`:encodeURIComponent(String(r[`resource-id`]))}`,pathParams:{"resource-id":String(r[`resource-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.resources.get({account_id:u,resource_id:r[`resource-id`],...c})),{successLabel:`Loaded`})})};function Me(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`managed`,{type:`boolean`,description:`Managed`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:g(Me),handler:async r=>c({command:`magic-cloud-networking resources list`,classification:{safeFlags:[`managed`,`desc`,`cloudflare`,`v2`,`dry-run`]}},r,async()=>{let c={provider_id:r[`provider-id`],resource_type:r[`resource-type`],resource_id:r[`resource-id`],region:r.region,resource_group:r[`resource-group`],managed:r.managed,search:r.search,order_by:r[`order-by`],desc:r.desc,per_page:r[`per-page`],page:r.page,cloudflare:r.cloudflare,v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.resources.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Pe(e){return e.option(`policy`,{type:`string`,description:`The policy field`}).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 Fe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Pe,handler:async r=>c({command:`magic-cloud-networking resources policy-preview`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking resources policy-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/policy-preview`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({policy:f(r.policy,`policy`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...e,account_id:l})),{successLabel:`Created`});return}r.policy===void 0&&(r.policy=await p(`policy`,`The policy field`));let m=d({policy:f(r.policy,`policy`,`text`)});a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...m,account_id:l})),{successLabel:`Created`})})},Ie={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(ke).command(je).command(Ne).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Le={command:`magic-cloud-networking`,describe:`magic-cloud-networking`,builder:e=>e.command(P).command(ne).command($).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Le as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,r as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p,i as m,n as h}from"./prompt-DjRTpML4.mjs";function g(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices 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 _={command:`create`,describe:`Create a new network monitoring configuration.`,builder:g,handler:async r=>c({command:`magic-network-monitoring configs create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.magicNetworkMonitoring.configs.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`The account name.`));let h=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Creating`,async()=>c.magicNetworkMonitoring.configs.create({...h,account_id:m})),{successLabel:`Created`})})};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:v,handler:async r=>c({command:`magic-network-monitoring configs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.configs.delete({account_id:l})),{successLabel:`Deleted`})})};function b(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices 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 x={command:`edit`,describe:`Update fields in an existing network monitoring configuration.`,builder:b,handler:async r=>c({command:`magic-network-monitoring configs edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.edit({...e,account_id:p})),{successLabel:`Updated`});return}let m=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.edit({...m,account_id:p})),{successLabel:`Updated`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists default sampling, router IPs, warp devices, and rules for account.`,builder:S,handler:async r=>c({command:`magic-network-monitoring configs full get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs full get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config/full`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.configs.full.get({account_id:l})),{successLabel:`Loaded`})})},w={command:`full`,describe:`Operations for configs.full`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Lists default sampling, router IPs and warp devices for account.`,builder:T,handler:async r=>c({command:`magic-network-monitoring configs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.configs.get({account_id:l})),{successLabel:`Loaded`})})};function D(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices 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 O={command:`update`,describe:`Update an existing network monitoring configuration, requires the entire configuration to be updated at once.`,builder:D,handler:async r=>c({command:`magic-network-monitoring configs update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.update({...e,account_id:m})),{successLabel:`Updated`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`The account name.`));let h=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.update({...h,account_id:m})),{successLabel:`Updated`})})},k={command:`configs`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(_).command(y).command(x).command(E).command(O).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`edit <rule-id>`,describe:`Update advertisement for rule.`,builder:A,handler:async r=>c({command:`magic-network-monitoring rules advertisements edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules advertisements edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}/advertisement`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.advertisements.edit({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},M={command:`advertisements`,describe:`Operations for rules.advertisements`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`create`,describe:`Create multiple network monitoring rules for account in a single request. Supports up to 100 rules per request. All rules in a single request must be of the same type.`,builder:ee,handler:async u=>c({command:`magic-network-monitoring rules bulk create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){o({command:`cf magic-network-monitoring rules bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/bulk`,pathParams:{},bodyKind:`json`,body:u.body===void 0?void 0:l(u.body)});return}let c=await i(u),d=u.local?e:await t();if(u.accountId=d,u.body){let e=l(u.body);if(Array.isArray(e)&&e.length>100){let t=Math.ceil(e.length/100),n=null;for(let i=0;i<e.length;i+=100){let a=e.slice(i,i+100);n=await s(`Creating: batch ${Math.floor(i/100)+1}/${t}`,async()=>r(c,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Created`});return}a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Created`});return}if(u.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update`,describe:`Update multiple network monitoring rules for account in a single request. Supports up to 100 rules per request. All rules in a single request must be of the same type.`,builder:P,handler:async u=>c({command:`magic-network-monitoring rules bulk update`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){o({command:`cf magic-network-monitoring rules bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/bulk`,pathParams:{},bodyKind:`json`,body:u.body===void 0?void 0:l(u.body)});return}let c=await i(u),d=u.local?e:await t();if(u.accountId=d,u.body){let e=l(u.body);if(Array.isArray(e)&&e.length>100){let t=Math.ceil(e.length/100),n=null;for(let i=0;i<e.length;i+=100){let a=e.slice(i,i+100);n=await s(`Updating: batch ${Math.floor(i/100)+1}/${t}`,async()=>r(c,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Updated`});return}if(u.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},I={command:`bulk`,describe:`Operations for rules.bulk`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`],default:`1m`}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`create`,describe:`Create network monitoring rules for account. Currently only supports creating a single rule per API request.`,builder:L,handler:async r=>c({command:`magic-network-monitoring rules create`,classification:{safeFlags:[`automatic-advertisement`,`duration`,`prefix-match`,`type`,`zscore-sensitivity`,`zscore-target`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.magicNetworkMonitoring.rules.create({body:e,account_id:u})),{successLabel:`Created`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await p(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await m(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Creating`,async()=>c.magicNetworkMonitoring.rules.create({body:h,account_id:u})),{successLabel:`Created`})})};function z(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`delete <rule-id>`,describe:`Delete a network monitoring rule for account.`,builder:z,handler:async r=>c({command:`magic-network-monitoring rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})};function V(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).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 H={command:`edit <rule-id>`,describe:`Update a network monitoring rule for account.`,builder:V,handler:async r=>c({command:`magic-network-monitoring rules edit`,classification:{safeFlags:[`automatic-advertisement`,`duration`,`prefix-match`,`type`,`zscore-sensitivity`,`zscore-target`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.edit({body:e,account_id:u,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await p(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await m(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.edit({body:h,account_id:u,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})};function U(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,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:`List a single network monitoring rule for account.`,builder:U,handler:async r=>c({command:`magic-network-monitoring rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function G(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`Lists network monitoring rules for account.`,builder:G,handler:async r=>c({command:`magic-network-monitoring rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.rules.list({account_id:l})),{successLabel:`Loaded`})})};function q(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).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 J={command:`update`,describe:`Update network monitoring rules for account.`,builder:q,handler:async r=>c({command:`magic-network-monitoring rules update`,classification:{safeFlags:[`automatic-advertisement`,`duration`,`prefix-match`,`type`,`zscore-sensitivity`,`zscore-target`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.update({body:e,account_id:u})),{successLabel:`Updated`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await p(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await m(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.update({body:h,account_id:u})),{successLabel:`Updated`})})},Y={command:`rules`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(R).command(B).command(H).command(W).command(K).command(J).command(M).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`create`,describe:`Generate authentication token for VPC flow logs export.`,builder:X,handler:async r=>c({command:`magic-network-monitoring vpc-flows tokens create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring vpc-flows tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/vpc-flows/token`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicNetworkMonitoring.vpcFlows.tokens.create({account_id:l})),{successLabel:`Created`})})},Q={command:`tokens`,describe:`Operations for vpc-flows.tokens`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`vpc-flows`,describe:`Ingest VPC flow logs from cloud providers for network visibility and anomaly detection`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`magic-network-monitoring`,describe:`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,builder:e=>e.command(k).command(Y).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};