cf 0.10.0 → 0.12.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 (352) hide show
  1. package/README.md +15 -5
  2. package/dist/_meta/agent-context.json +13 -5
  3. package/dist/_meta/commands.json +2393 -262
  4. package/dist/_meta/hand-written-commands.json +960 -0
  5. package/dist/_meta/schemas.json +1882 -155
  6. package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
  7. package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
  8. package/dist/account-CPbieCZ4.mjs +2 -0
  9. package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
  10. package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
  11. package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
  12. package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
  13. package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
  14. package/dist/agent-memory-BrHMIU0E.mjs +6 -0
  15. package/dist/ai-audit-BoZuL84i.mjs +2 -0
  16. package/dist/ai-gateway-DE50Jem1.mjs +13 -0
  17. package/dist/ai-search-Fx7NHCHB.mjs +7 -0
  18. package/dist/ai-security-DyLbY9kv.mjs +4 -0
  19. package/dist/ai-v2fP1r0s.mjs +5 -0
  20. package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
  21. package/dist/analytics-BygTfozw.mjs +3 -0
  22. package/dist/analytics_engine-4L-q362P.mjs +2 -0
  23. package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
  24. package/dist/argo-TzXPN7tz.mjs +2 -0
  25. package/dist/args-CDgWUP4J.mjs +2 -0
  26. package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
  27. package/dist/audit-logs-CqY7zzwv.mjs +2 -0
  28. package/dist/auth-CPLdkOC7.mjs +5 -0
  29. package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
  30. package/dist/billing-DHQuRT8S.mjs +3 -0
  31. package/dist/body-parser-BGVbwPeM.mjs +2 -0
  32. package/dist/bot-management-CfqG79hF.mjs +5 -0
  33. package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
  34. package/dist/brand-protection-DYttrKIM.mjs +3 -0
  35. package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
  36. package/dist/browser-run-373D4e1i.mjs +4 -0
  37. package/dist/build-D0ir_S70.mjs +2 -0
  38. package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
  39. package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
  40. package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
  41. package/dist/cf-yPz_IqW6.mjs +18 -0
  42. package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
  44. package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
  45. package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
  46. package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
  47. package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
  48. package/dist/command-BV87D4tR.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
  50. package/dist/config.d.mts +1451 -1366
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
  53. package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
  54. package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
  55. package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
  56. package/dist/containers-BDBsEs7-.mjs +58 -0
  57. package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
  58. package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
  59. package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
  60. package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
  61. package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
  62. package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
  63. package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
  64. package/dist/custom-pages-Buki_Cb8.mjs +3 -0
  65. package/dist/d1-n2in0cSF.mjs +20 -0
  66. package/dist/data-security-DzOQMkv3.mjs +7 -0
  67. package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
  68. package/dist/delegate.mjs +1 -1
  69. package/dist/deploy-BUSz35vq.mjs +2 -0
  70. package/dist/deploy-input-BvD9aRP1.mjs +2 -0
  71. package/dist/dev-DY_DquQx.mjs +4 -0
  72. package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
  73. package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
  74. package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
  75. package/dist/dist-BBx1io2f.mjs +2 -0
  76. package/dist/dist-Cb9TJ2VV.mjs +9 -0
  77. package/dist/dist-DV7LR38l.mjs +387 -0
  78. package/dist/dist-DvizctjW.mjs +48 -0
  79. package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
  80. package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
  81. package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-ILZRVpnp.mjs +2 -0
  84. package/dist/durable-objects-DhDL3San.mjs +2 -0
  85. package/dist/email-auth-BROqK6-C.mjs +2 -0
  86. package/dist/email-routing-BZXHDAOO.mjs +6 -0
  87. package/dist/email-security-DVumybrk.mjs +18 -0
  88. package/dist/email-sending-CDQ3_wyz.mjs +7 -0
  89. package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
  90. package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
  91. package/dist/flagship-fFBiZUz-.mjs +4 -0
  92. package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
  93. package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
  94. package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
  95. package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
  96. package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
  97. package/dist/iam-Bk7K_PPO.mjs +6 -0
  98. package/dist/images-BAEFb9q1.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
  101. package/dist/interactive-CRnq-B5I.mjs +11 -0
  102. package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
  103. package/dist/ips-DU0ti0i0.mjs +2 -0
  104. package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
  105. package/dist/keys-DqldTZqH.mjs +2 -0
  106. package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
  107. package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
  108. package/dist/load-balancers-Dg4pDad1.mjs +6 -0
  109. package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
  110. package/dist/local-runtime--IQr44qq.mjs +2 -0
  111. package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
  112. package/dist/logo-matches-CWUzxY7G.mjs +2 -0
  113. package/dist/logos-BTfdkDPi.mjs +3 -0
  114. package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
  115. package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
  116. package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
  117. package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
  118. package/dist/magic-transit-B5skt0G7.mjs +111 -0
  119. package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
  120. package/dist/matches-DeYaB4I0.mjs +2 -0
  121. package/dist/mcp-ChjBiMx2.mjs +4 -0
  122. package/dist/mesh-DRVAFLBX.mjs +4 -0
  123. package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
  124. package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
  125. package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
  126. package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
  127. package/dist/oauth-DAa7SwkM.mjs +14 -0
  128. package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
  129. package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
  130. package/dist/observability-DnyI8rPJ.mjs +4 -0
  131. package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
  132. package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
  133. package/dist/organizations-B3aU-RCG.mjs +2 -0
  134. package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
  135. package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
  136. package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
  137. package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
  138. package/dist/page-rules-CzbyXbt6.mjs +27 -0
  139. package/dist/pages-CX8yefTI.mjs +14 -0
  140. package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
  141. package/dist/pipelines-BZ1KGupx.mjs +6 -0
  142. package/dist/precursor-D42A9ay5.mjs +4 -0
  143. package/dist/progress-jYW64HY7.mjs +2 -0
  144. package/dist/project-settings-BN7tL0c7.mjs +3 -0
  145. package/dist/prompt-CyATfGUu.mjs +3 -0
  146. package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
  147. package/dist/queries-xvETUjUE.mjs +3 -0
  148. package/dist/queues-CpqHDtxF.mjs +6 -0
  149. package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
  150. package/dist/r2-jhmLvD1z.mjs +24 -0
  151. package/dist/radar-C2J16wpX.mjs +2 -0
  152. package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
  153. package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
  154. package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
  155. package/dist/registrar-BI5ewTAk.mjs +23 -0
  156. package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
  157. package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
  158. package/dist/reporting-CxsdHAH3.mjs +2 -0
  159. package/dist/request-tracers-DJJCncft.mjs +2 -0
  160. package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
  161. package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
  162. package/dist/rules-PpsDU89Q.mjs +4 -0
  163. package/dist/rulesets-DP12Aqik.mjs +5 -0
  164. package/dist/rum-DxvpzJYc.mjs +4 -0
  165. package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
  166. package/dist/schema-flags-CTfQVGCs.mjs +5 -0
  167. package/dist/schemas-BFCBlp_W.mjs +65 -0
  168. package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
  169. package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
  170. package/dist/security-center-008FMs_z.mjs +2 -0
  171. package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
  172. package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
  173. package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
  174. package/dist/smart-shield-DpFscIk8.mjs +4 -0
  175. package/dist/snippets-CCKgI2ZX.mjs +4 -0
  176. package/dist/spawn-C3_tJ3RB.mjs +526 -0
  177. package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
  178. package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
  179. package/dist/src-CEb2fgtT.mjs +108 -0
  180. package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
  181. package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
  182. package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
  183. package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
  184. package/dist/submit-DF2G5CIz.mjs +2 -0
  185. package/dist/tags-nFJJHlLJ.mjs +2 -0
  186. package/dist/tenant-CRLw1oRU.mjs +2 -0
  187. package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
  188. package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
  189. package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
  190. package/dist/tunnels-iVA3MrdS.mjs +2 -0
  191. package/dist/turnstile-DQHP6-_b.mjs +23 -0
  192. package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
  193. package/dist/url-info-BVgdb_pf.mjs +2 -0
  194. package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
  195. package/dist/url-scanner-DwuDZLPk.mjs +2 -0
  196. package/dist/user-I_MbB_KX.mjs +12 -0
  197. package/dist/values-S-Q7-5o8.mjs +2 -0
  198. package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
  199. package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
  200. package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
  201. package/dist/web3-CdbfoZ2x.mjs +4 -0
  202. package/dist/workers-DQ9Q7czn.mjs +28 -0
  203. package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
  204. package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
  205. package/dist/zaraz-DbKvA_8C.mjs +2 -0
  206. package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
  207. package/dist/zone-D2zrbJI2.mjs +2 -0
  208. package/dist/zones-DrpxQ_-A.mjs +21 -0
  209. package/package.json +12 -8
  210. package/dist/account-CYRm3yoN.mjs +0 -2
  211. package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
  212. package/dist/ai-audit-BWZGvbca.mjs +0 -2
  213. package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
  214. package/dist/ai-search-BmdskMjR.mjs +0 -7
  215. package/dist/ai-security-CsmfcaUx.mjs +0 -4
  216. package/dist/ai-viHB1tgI.mjs +0 -5
  217. package/dist/analytics-vOxw8Hy0.mjs +0 -3
  218. package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
  219. package/dist/argo-CQfCgazW.mjs +0 -2
  220. package/dist/args-DlUhyGU0.mjs +0 -2
  221. package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
  222. package/dist/auth-D0xZxAEa.mjs +0 -5
  223. package/dist/billing-aJgapeRm.mjs +0 -3
  224. package/dist/body-parser-C-c9gfH1.mjs +0 -2
  225. package/dist/bot-management-Y2q5d-pi.mjs +0 -5
  226. package/dist/botnet-feed-DANJqfmE.mjs +0 -3
  227. package/dist/brand-protection-CjpZWBjp.mjs +0 -3
  228. package/dist/browser-run-BFn9h2Tz.mjs +0 -4
  229. package/dist/build-DcflwvqN.mjs +0 -2
  230. package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
  231. package/dist/cf-C7DU4819.mjs +0 -18
  232. package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
  233. package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
  234. package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
  235. package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
  236. package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
  237. package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
  238. package/dist/containers-CKW081JA.mjs +0 -54
  239. package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
  240. package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
  241. package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
  242. package/dist/custom-pages-M7jA2Hit.mjs +0 -3
  243. package/dist/d1-BFvMd6-S.mjs +0 -20
  244. package/dist/data-security-Bji4Or_j.mjs +0 -7
  245. package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
  246. package/dist/deploy-CZ7bgNDu.mjs +0 -2
  247. package/dist/dev-V10MG-Bg.mjs +0 -4
  248. package/dist/dist-CgrMkXFx.mjs +0 -72
  249. package/dist/durable-objects-D8FQORrL.mjs +0 -2
  250. package/dist/email-auth-DJK0Eb30.mjs +0 -2
  251. package/dist/email-routing-NpmiKIrl.mjs +0 -6
  252. package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
  253. package/dist/email-sending-dn-353Nx.mjs +0 -7
  254. package/dist/fieldExtractors-ahysj57J.mjs +0 -3
  255. package/dist/flagship-BusjRNIb.mjs +0 -4
  256. package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
  257. package/dist/iam-Cj63Kjc6.mjs +0 -6
  258. package/dist/images-CBWXCDhy.mjs +0 -8
  259. package/dist/ips-qs9eGJnI.mjs +0 -2
  260. package/dist/keys-D7N0j4-x.mjs +0 -2
  261. package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
  262. package/dist/local-runtime-Dh3keC5v.mjs +0 -2
  263. package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
  264. package/dist/logo-matches-CJcthPHf.mjs +0 -2
  265. package/dist/logos-BS65zN8q.mjs +0 -3
  266. package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
  267. package/dist/magic-transit-BtsFePMx.mjs +0 -111
  268. package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
  269. package/dist/matches-InA1hwII.mjs +0 -2
  270. package/dist/mcp-mJ7bekNJ.mjs +0 -4
  271. package/dist/mesh-BK4S1Ezy.mjs +0 -4
  272. package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
  273. package/dist/oauth-B0ETkNcX.mjs +0 -15
  274. package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
  275. package/dist/observability-BWE0Gg3V.mjs +0 -4
  276. package/dist/organizations-DLhiRt8g.mjs +0 -2
  277. package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
  278. package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
  279. package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
  280. package/dist/page-rules-BSz1gO-_.mjs +0 -18
  281. package/dist/pages-DVDogxPs.mjs +0 -14
  282. package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
  283. package/dist/pipelines-BszRk4sM.mjs +0 -6
  284. package/dist/precursor-BPNjQr76.mjs +0 -4
  285. package/dist/progress-CsHIt3Tp.mjs +0 -2
  286. package/dist/prompt-DdegNPpg.mjs +0 -3
  287. package/dist/queries-JL1H1Biz.mjs +0 -3
  288. package/dist/queues-DpkYdRUE.mjs +0 -6
  289. package/dist/r2-CKozthw_.mjs +0 -24
  290. package/dist/radar-C-92vggG.mjs +0 -2
  291. package/dist/raw-fetch-CteyTOM2.mjs +0 -2
  292. package/dist/registrar-DKKN0M29.mjs +0 -21
  293. package/dist/reporting-fg_GKXe1.mjs +0 -2
  294. package/dist/request-tracers-CkMya96z.mjs +0 -2
  295. package/dist/resource-tagging-z48JGHCq.mjs +0 -2
  296. package/dist/rules-BTmNjDN-.mjs +0 -4
  297. package/dist/rulesets-CsoSM-17.mjs +0 -5
  298. package/dist/rum-DB4iO2q5.mjs +0 -4
  299. package/dist/schema-flags-iGoOriJt.mjs +0 -5
  300. package/dist/security-center-DFKeHq5c.mjs +0 -2
  301. package/dist/session-D6KHthHf.mjs +0 -2
  302. package/dist/shared-VppSAQf4.mjs +0 -2
  303. package/dist/smart-shield-D6X8L7p8.mjs +0 -4
  304. package/dist/snippets-DIpc9pb_.mjs +0 -4
  305. package/dist/spawn-O1RS01vr.mjs +0 -523
  306. package/dist/src-D_HETJNy.mjs +0 -108
  307. package/dist/submit--xTzyNPy.mjs +0 -2
  308. package/dist/tags-efICDkah.mjs +0 -2
  309. package/dist/tenant-CerHuToJ.mjs +0 -2
  310. package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
  311. package/dist/triggers-BEsiiKAf.mjs +0 -2
  312. package/dist/tunnels-D0J8lJoI.mjs +0 -2
  313. package/dist/turnstile-CFmtY5bn.mjs +0 -23
  314. package/dist/url-info-DBCeRWwb.mjs +0 -2
  315. package/dist/url-scanner-CNyvg65L.mjs +0 -2
  316. package/dist/user-bifVEQq5.mjs +0 -12
  317. package/dist/values-OxkdP1tV.mjs +0 -2
  318. package/dist/versions-BVL-Ludh.mjs +0 -2
  319. package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
  320. package/dist/web3-y_cY91V_.mjs +0 -4
  321. package/dist/workers-jDcq14GH.mjs +0 -24
  322. package/dist/zaraz-27zwjLvv.mjs +0 -2
  323. package/dist/zone-BJix2KQ9.mjs +0 -2
  324. package/dist/zones-Bkj5i92c.mjs +0 -21
  325. /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
  326. /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
  327. /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
  328. /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  329. /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
  330. /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
  331. /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
  332. /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
  333. /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
  334. /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
  335. /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
  336. /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
  337. /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
  338. /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
  339. /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
  340. /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
  341. /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
  342. /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
  343. /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
  344. /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
  345. /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
  346. /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
  347. /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
  348. /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
  349. /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
  350. /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
  351. /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
  352. /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,n as f}from"./prompt-DdegNPpg.mjs";function p(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 m={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:p,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.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/${c[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(c[`dataset-id`]))}/fields`,pathParams:{"account-or-zone":String(t),"dataset-id":String(c[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.logpush.accountDatasets.fields.get({account_or_zone:u,account_or_zone_id:d,dataset_id:c[`dataset-id`]})),{successLabel:`Loaded`})}},h={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(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 ee={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account or zone for a dataset.`,builder:g,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.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/${c[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(c[`dataset-id`]))}/jobs`,pathParams:{"account-or-zone":String(t),"dataset-id":String(c[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.logpush.accountDatasets.jobs.get({account_or_zone:u,account_or_zone_id:d,dataset_id:c[`dataset-id`]})),{successLabel:`Loaded`})}},_={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(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(`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 b={command:`create`,describe:`Creates a new Logpush job for an account or zone.`,builder:y,handler:async f=>{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 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:f.body===void 0?l({dataset:u(f.dataset,`dataset`,`text`),destination_conf:u(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:u(f.filter,`filter`,`text`),frequency:u(f.frequency,`frequency`,`text`),kind:u(f.kind,`kind`,`text`),logpull_options:u(f[`logpull-options`],`logpull-options`,`text`),name:u(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:u(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(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:u(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:u(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(f[`ownership-challenge`],`ownership-challenge`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountJobs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`destination-conf`]===void 0&&(f[`destination-conf`]=await d(`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=l({dataset:u(f.dataset,`dataset`,`text`),destination_conf:u(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:u(f.filter,`filter`,`text`),frequency:u(f.frequency,`frequency`,`text`),kind:u(f.kind,`kind`,`text`),logpull_options:u(f[`logpull-options`],`logpull-options`,`text`),name:u(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:u(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(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:u(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:u(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(f[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountJobs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function x(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 S={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:x,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${c[`job-id`]==null?`<job-id>`:encodeURIComponent(String(c[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(c[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await f({force:!!c.force,message:`This operation deletes the Logpush job.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,n as f}from"./prompt-CyATfGUu.mjs";function p(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 m={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:p,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.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/${c[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(c[`dataset-id`]))}/fields`,pathParams:{"account-or-zone":String(t),"dataset-id":String(c[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.logpush.accountDatasets.fields.get({account_or_zone:u,account_or_zone_id:d,dataset_id:c[`dataset-id`]})),{successLabel:`Loaded`})}},h={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(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 ee={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account or zone for a dataset.`,builder:g,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.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/${c[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(c[`dataset-id`]))}/jobs`,pathParams:{"account-or-zone":String(t),"dataset-id":String(c[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.logpush.accountDatasets.jobs.get({account_or_zone:u,account_or_zone_id:d,dataset_id:c[`dataset-id`]})),{successLabel:`Loaded`})}},_={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(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(`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 b={command:`create`,describe:`Creates a new Logpush job for an account or zone.`,builder:y,handler:async f=>{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 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:f.body===void 0?l({dataset:u(f.dataset,`dataset`,`text`),destination_conf:u(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:u(f.filter,`filter`,`text`),frequency:u(f.frequency,`frequency`,`text`),kind:u(f.kind,`kind`,`text`),logpull_options:u(f[`logpull-options`],`logpull-options`,`text`),name:u(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:u(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(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:u(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:u(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(f[`ownership-challenge`],`ownership-challenge`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountJobs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`destination-conf`]===void 0&&(f[`destination-conf`]=await d(`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=l({dataset:u(f.dataset,`dataset`,`text`),destination_conf:u(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:u(f.filter,`filter`,`text`),frequency:u(f.frequency,`frequency`,`text`),kind:u(f.kind,`kind`,`text`),logpull_options:u(f[`logpull-options`],`logpull-options`,`text`),name:u(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:u(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(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:u(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:u(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(f[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountJobs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function x(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 S={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:x,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${c[`job-id`]==null?`<job-id>`:encodeURIComponent(String(c[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(c[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await f({force:!!c.force,message:`This operation deletes the Logpush job.`})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>l.logpush.accountJobs.delete({account_or_zone:u,account_or_zone_id:d,job_id:c[`job-id`]})),{successLabel:`Deleted`})}};function C(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 w={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:C,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${c[`job-id`]==null?`<job-id>`:encodeURIComponent(String(c[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(c[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.logpush.accountJobs.get({account_or_zone:u,account_or_zone_id:d,job_id:c[`job-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:`Lists Logpush jobs for an account or zone.`,builder:T,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.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 l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.logpush.accountJobs.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function D(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(`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 O={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:D,handler:async d=>{if(d.dryRun){let e=d.zone===void 0?await n():void 0,t=d.zone===void 0?`accounts`:`zones`,r=d.zone??e??`<account-id>`;o({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${d[`job-id`]==null?`<job-id>`:encodeURIComponent(String(d[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(d[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:d.body===void 0?l({destination_conf:u(d[`destination-conf`],`destination-conf`,`text`),enabled:d.enabled,filter:u(d.filter,`filter`,`text`),frequency:u(d.frequency,`frequency`,`text`),kind:u(d.kind,`kind`,`text`),logpull_options:u(d[`logpull-options`],`logpull-options`,`text`),name:u(d.name,`name`,`text`),output_options:{"CVE-2021-44228":d[`output-options-cve-2021-44228`],batch_prefix:u(d[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(d[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(d[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:d[`output-options-field-names`],merge_subrequests:d[`output-options-merge-subrequests`],output_type:u(d[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(d[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(d[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(d[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(d[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:d[`output-options-sample-rate`],timestamp_format:u(d[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(d[`ownership-challenge`],`ownership-challenge`,`text`)}):c(d.body)});return}let f=await i(d),p=d.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:d.zone},f,{quiet:d.quiet}):d.local?e:await t();if(p===`zones`?d.zoneId=m:d.accountId=m,d.body){let e=c(d.body);a(await s(`Updating`,async()=>f.logpush.accountJobs.update({...e,account_or_zone:p,account_or_zone_id:m,job_id:d[`job-id`]})),{successLabel:`Updated`});return}let h=l({destination_conf:u(d[`destination-conf`],`destination-conf`,`text`),enabled:d.enabled,filter:u(d.filter,`filter`,`text`),frequency:u(d.frequency,`frequency`,`text`),kind:u(d.kind,`kind`,`text`),logpull_options:u(d[`logpull-options`],`logpull-options`,`text`),name:u(d.name,`name`,`text`),output_options:{"CVE-2021-44228":d[`output-options-cve-2021-44228`],batch_prefix:u(d[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:u(d[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:u(d[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:d[`output-options-field-names`],merge_subrequests:d[`output-options-merge-subrequests`],output_type:u(d[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:u(d[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:u(d[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:u(d[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:u(d[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:d[`output-options-sample-rate`],timestamp_format:u(d[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:u(d[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Updating`,async()=>f.logpush.accountJobs.update({...h,account_or_zone:p,account_or_zone_id:m,job_id:d[`job-id`]})),{successLabel:`Updated`})}},k={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(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 j={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:A,handler:async f=>{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-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:f.body===void 0?l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountOwnership.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`destination-conf`]===void 0&&(f[`destination-conf`]=await d(`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=l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountOwnership.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function M(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 N={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:M,handler:async f=>{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-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:f.body===void 0?l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`),ownership_challenge:u(f[`ownership-challenge`],`ownership-challenge`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountOwnership.validate.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`destination-conf`]===void 0&&(f[`destination-conf`]=await d(`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`})),f[`ownership-challenge`]===void 0&&(f[`ownership-challenge`]=await d(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let g=l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`),ownership_challenge:u(f[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountOwnership.validate.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},P={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(j).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 L={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:I,handler:async f=>{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-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:f.body===void 0?l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountValidate.destinationExistsDelete({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`destination-conf`]===void 0&&(f[`destination-conf`]=await d(`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=l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountValidate.destinationExistsDelete({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function R(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 z={command:`delete`,describe:`Validates destination.`,builder:R,handler:async f=>{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-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:f.body===void 0?l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountValidate.destination.delete({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`destination-conf`]===void 0&&(f[`destination-conf`]=await d(`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=l({destination_conf:u(f[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountValidate.destination.delete({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},B={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(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 V={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:te,handler:async f=>{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-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:f.body===void 0?l({logpull_options:u(f[`logpull-options`],`logpull-options`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.logpush.accountValidate.origin.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`logpull-options`]===void 0&&(f[`logpull-options`]=await d(`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=l({logpull_options:u(f[`logpull-options`],`logpull-options`,`text`)});a(await s(`Creating`,async()=>p.logpush.accountValidate.origin.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},H={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(L).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(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 G={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:W,handler:async e=>{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?l({fields:u(e.fields,`fields`,`text`),filter:u(e.filter,`filter`,`text`),sample:e.sample}):c(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=c(e.body);a(await s(`Creating`,async()=>t.logpush.edge.create({...r,zone_id:n})),{successLabel:`Created`});return}let d=l({fields:u(e.fields,`fields`,`text`),filter:u(e.filter,`filter`,`text`),sample:e.sample});a(await s(`Creating`,async()=>t.logpush.edge.create({...d,zone_id:n})),{successLabel:`Created`})}};function K(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:K,handler:async e=>{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`})}},J={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(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 X={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:Y,handler:async r=>{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`})}},Z={command:`content`,describe:`Operations for transformers.content`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(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 ne={command:`create`,describe:`Creates a new custom log transformer for an account.`,builder:Q,handler:async r=>{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?l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.logpush.transformers.create({...e,account_id:p})),{successLabel:`Created`});return}r.code===void 0&&(r.code=await d(`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 d(`name`,`Customer-provided name for identification.`));let m=l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>f.logpush.transformers.create({...m,account_id:p})),{successLabel:`Created`})}};function re(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 ie={command:`delete <transformer-id>`,describe:`Deletes a custom log transformer. Returns 409 Conflict if any active logpush jobs reference the transformer.`,builder:re,handler:async r=>{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 f({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.logpush.transformers.delete({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Deleted`})}};function ae(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 oe={command:`get <transformer-id>`,describe:`Gets a single custom log transformer by ID.`,builder:ae,handler:async r=>{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 $(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`Lists all custom log transformers for an account.`,builder:$,handler:async r=>{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 ce(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 le={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:ce,handler:async r=>{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?l({sql:u(r.sql,`sql`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Loading`,async()=>f.logpush.transformers.preview({...e,account_id:p})),{successLabel:`Loaded`});return}r.sql===void 0&&(r.sql=await d(`sql`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`));let m=l({sql:u(r.sql,`sql`,`text`)});a(await s(`Loading`,async()=>f.logpush.transformers.preview({...m,account_id:p})),{successLabel:`Loaded`})}};function ue(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 de={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:ue,handler:async r=>{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?l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.logpush.transformers.update({...e,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await d(`name`,`Customer-provided name for identification.`));let m=l({code:u(r.code,`code`,`text`),description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`)});a(await s(`Updating`,async()=>f.logpush.transformers.update({...m,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`})}};function fe(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 pe={command:`list`,describe:`Returns version metadata for a transformer, newest first. Each version corresponds to a SQL query update.`,builder:fe,handler:async r=>{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`})}},me={command:`versions`,describe:`Operations for transformers.versions`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`transformers`,describe:`Operations for transformers`,builder:e=>e.command(ne).command(ie).command(oe).command(se).command(le).command(de).command(Z).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`logpush`,describe:`logpush`,builder:e=>e.command(v).command(k).command(F).command(U).command(J).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ge as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d}from"./input-validation-Bav2M9F-.mjs";import{n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(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 h={command:`create`,describe:`Updates CMB config.`,builder:m,handler:async r=>{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?u({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:d(r.regions,`regions`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:d(r.regions,`regions`,`text`)});o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:p,account_id:f})),{successLabel:`Created`})}};function g(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 _={command:`delete`,describe:`Deletes CMB config.`,builder:g,handler:async r=>{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 f({force:!!r.force,message:`This operation deletes the CMB config.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{n as f}from"./prompt-CyATfGUu.mjs";import{t as p}from"./cli-types-C3nVfpSG.mjs";function m(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 h={command:`create`,describe:`Updates CMB config.`,builder:m,handler:async r=>{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?u({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:d(r.regions,`regions`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:d(r.regions,`regions`,`text`)});o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:p,account_id:f})),{successLabel:`Created`})}};function g(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 _={command:`delete`,describe:`Deletes CMB config.`,builder:g,handler:async r=>{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 f({force:!!r.force,message:`This operation deletes the CMB config.`})){process.stderr.write(`Aborted.
3
3
  `);return}o(await c(`Deleting`,async()=>i.logs.control.cmb.config.delete({account_id:l})),{successLabel:`Deleted`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get`,describe:`Gets CMB config.`,builder:v,handler:async r=>{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`})}},b={command:`config`,describe:`Operations for control.cmb.config`,builder:e=>e.command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(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 C={command:`create`,describe:`Updates log retention flag for Logpull API.`,builder:S,handler:async e=>{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?u({flag:e.flag}):l(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=l(e.body);o(await c(`Creating`,async()=>t.logs.control.retention.create({body:r,zone_id:n})),{successLabel:`Created`});return}let i=u({flag:e.flag});o(await c(`Creating`,async()=>t.logs.control.retention.create({body:i,zone_id:n})),{successLabel:`Created`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:w,handler:async e=>{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`})}},E={command:`retention`,describe:`Operations for control.retention`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`control`,describe:`Log control operations`,builder:e=>e.command(x).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(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 k={command:`get`,describe:`Lists R2 objects containing logs matching the provided query parameters.`,builder:O,handler:async r=>{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`})}},A={command:`list`,describe:`Operations for list`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(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 M={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:p(j),handler:async e=>{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`})}},N={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={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:P,handler:async e=>{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`})}},I={command:`fields`,describe:`Operations for received.fields`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(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 R={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:p(L),handler:async e=>{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`})}},z={command:`received`,describe:`Received log operations`,builder:e=>e.command(R).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(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 V={command:`get`,describe:`Returns logs stored in R2 that match the provided query parameters.`,builder:B,handler:async r=>{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`})}},H={command:`retrieve`,describe:`Operations for retrieve`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(D).command(A).command(N).command(z).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{a as r,r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,r as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d}from"./input-validation-Bav2M9F-.mjs";import{a as f,i as p,n as m}from"./prompt-DdegNPpg.mjs";import{t as h}from"./cli-types-BsTty22w.mjs";import{n as g,t as _}from"./raw-fetch-CteyTOM2.mjs";function v(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 ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.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:m.body===void 0?u({description:d(m.description,`description`,`text`),destination_type:d(m[`destination-type`],`destination-type`,`text`),name:d(m.name,`name`,`text`),policy:d(m.policy,`policy`,`text`),update_mode:d(m[`update-mode`],`update-mode`,`text`)}):c(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=c(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`destination-type`]===void 0&&(m[`destination-type`]=await p(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),m.name===void 0&&(m.name=await f(`name`,`The name field`)),m[`update-mode`]===void 0&&(m[`update-mode`]=await p(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`destination-type`]!==void 0&&l(v,[`destination_type`],d(m[`destination-type`],`destination-type`,`text`)),m.name!==void 0&&l(v,[`name`],d(m.name,`name`,`text`)),m.policy!==void 0&&l(v,[`policy`],d(m.policy,`policy`,`text`)),m[`update-mode`]!==void 0&&l(v,[`update_mode`],d(m[`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(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(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 y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async r=>{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 m({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 b(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 x={command:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:b,handler:async r=>{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?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>l.magicCloudNetworking.catalogSyncs.edit({body:p,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`})}};function S(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 C={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:S,handler:async r=>{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 w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:w,handler:async r=>{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 E(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 D={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:h(E),handler:async r=>{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`})}},O={command:`prebuilt-policies`,describe:`Operations for catalog-syncs.prebuilt-policies`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(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 A={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:k,handler:async r=>{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 j(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 M={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:j,handler:async r=>{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?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.catalogSyncs.update({body:e,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>l.magicCloudNetworking.catalogSyncs.update({body:p,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`})}},N={command:`catalog-syncs`,describe:`Operations for catalog-syncs`,builder:e=>e.command(ee).command(y).command(x).command(C).command(T).command(A).command(M).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(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 F={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:P,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.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:m.body===void 0?u({cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),friendly_name:d(m[`friendly-name`],`friendly-name`,`text`)}):c(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=c(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`cloud-type`]===void 0&&(m[`cloud-type`]=await p(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),m[`friendly-name`]===void 0&&(m[`friendly-name`]=await f(`friendly-name`,`The friendly_name field`));let v={};m[`cloud-type`]!==void 0&&l(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`friendly-name`]!==void 0&&l(v,[`friendly_name`],d(m[`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(h).length>0?h:void 0})),{successLabel:`Created`})}};function I(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 L={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:I,handler:async r=>{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 m({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 R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:R,handler:async r=>{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 B(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 V={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:B,handler:async r=>{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 H(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 U={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:H,handler:async r=>{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?u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>l.magicCloudNetworking.cloudIntegrations.edit({body:p,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`})}};function W(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 G={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:W,handler:async r=>{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 K(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 q={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:K,handler:async r=>{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 J(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 Y={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:J,handler:async r=>{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 X(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 Z={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:X,handler:async r=>{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?u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>l.magicCloudNetworking.cloudIntegrations.update({body:p,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`})}},Q={command:`cloud-integrations`,describe:`Operations for cloud-integrations`,builder:e=>e.command(F).command(L).command(V).command(z).command(U).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(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 re={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:ne,handler:async r=>{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?u({prefixes:r.prefixes}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:d})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:r.prefixes});a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.edit({body:f,account_id:d})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ie,handler:async r=>{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 oe(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 se={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:oe,handler:async r=>{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?u({prefixes:r.prefixes}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:d})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:r.prefixes});a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.addressSpaces.update({body:f,account_id:d})),{successLabel:`Updated`})}},ce={command:`address-spaces`,describe:`Operations for on-ramps.address-spaces`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(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 ue={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:le,handler:async r=>{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 de(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 fe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:de,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.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:m.body===void 0?u({adopted_hub_id:d(m[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:m[`attached-hubs`],attached_vpcs:m[`attached-vpcs`],cloud_asn:m[`cloud-asn`],cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),dynamic_routing:m[`dynamic-routing`],hub_provider_id:d(m[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:m[`install-routes-in-cloud`],install_routes_in_magic_wan:m[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:m[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:m[`manage-vpc-to-hub-attachments`],name:d(m.name,`name`,`text`),region:d(m.region,`region`,`text`),type:d(m.type,`type`,`text`),vpc:d(m.vpc,`vpc`,`text`)}):c(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=c(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}if(m[`cloud-type`]===void 0&&(m[`cloud-type`]=await p(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),m[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(m[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(m[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);m.name===void 0&&(m.name=await f(`name`,`The name field`)),m.type===void 0&&(m.type=await p(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};m[`adopted-hub-id`]!==void 0&&l(v,[`adopted_hub_id`],d(m[`adopted-hub-id`],`adopted-hub-id`,`text`)),m[`attached-hubs`]!==void 0&&l(v,[`attached_hubs`],m[`attached-hubs`]),m[`attached-vpcs`]!==void 0&&l(v,[`attached_vpcs`],m[`attached-vpcs`]),m[`cloud-asn`]!==void 0&&l(v,[`cloud_asn`],m[`cloud-asn`]),m[`cloud-type`]!==void 0&&l(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&l(v,[`description`],d(m.description,`description`,`text`)),m[`dynamic-routing`]!==void 0&&l(v,[`dynamic_routing`],m[`dynamic-routing`]),m[`hub-provider-id`]!==void 0&&l(v,[`hub_provider_id`],d(m[`hub-provider-id`],`hub-provider-id`,`text`)),m[`install-routes-in-cloud`]!==void 0&&l(v,[`install_routes_in_cloud`],m[`install-routes-in-cloud`]),m[`install-routes-in-magic-wan`]!==void 0&&l(v,[`install_routes_in_magic_wan`],m[`install-routes-in-magic-wan`]),m[`manage-hub-to-hub-attachments`]!==void 0&&l(v,[`manage_hub_to_hub_attachments`],m[`manage-hub-to-hub-attachments`]),m[`manage-vpc-to-hub-attachments`]!==void 0&&l(v,[`manage_vpc_to_hub_attachments`],m[`manage-vpc-to-hub-attachments`]),m.name!==void 0&&l(v,[`name`],d(m.name,`name`,`text`)),m.region!==void 0&&l(v,[`region`],d(m.region,`region`,`text`)),m.type!==void 0&&l(v,[`type`],d(m.type,`type`,`text`)),m.vpc!==void 0&&l(v,[`vpc`],d(m.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(h).length>0?h:void 0})),{successLabel:`Created`})}};function pe(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 me={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:pe,handler:async r=>{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 m({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 he(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 ge={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:he,handler:async r=>{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?u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.edit({body:e,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.edit({body:p,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})}};function _e(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 ve={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:_e,handler:async r=>{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()=>_(`/accounts/${a}/magic/cloud/onramps/${encodeURIComponent(String(r[`onramp-id`]))}/export`,{method:`POST`,local:r.local===!0,persistTo:r.persistTo}));g(r.text===!0?c.toString(`utf-8`):c)}};function ye(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 be={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:ye,handler:async r=>{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 xe(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 Se={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:xe,handler:async r=>{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 Ce(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 we={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:Ce,handler:async r=>{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 Te(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 Ee={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Te,handler:async r=>{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?u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.update({body:e,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>l.magicCloudNetworking.onRamps.update({body:p,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})}},De={command:`on-ramps`,describe:`Operations for on-ramps`,builder:e=>e.command(ue).command(fe).command(me).command(ge).command(ve).command(be).command(Se).command(we).command(Ee).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(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 Oe={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:$,handler:async r=>{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()=>_(`/accounts/${c}/magic/cloud/resources/export${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));g(r.text===!0?u.toString(`utf-8`):u)}};function ke(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 Ae={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:ke,handler:async r=>{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 je(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 Me={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:h(je),handler:async r=>{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 Ne(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 Pe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Ne,handler:async r=>{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?u({policy:d(r.policy,`policy`,`text`)}):c(r.body)});return}let l=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.magicCloudNetworking.resources.policyPreview({...e,account_id:p})),{successLabel:`Created`});return}r.policy===void 0&&(r.policy=await f(`policy`,`The policy field`));let m=u({policy:d(r.policy,`policy`,`text`)});a(await s(`Creating`,async()=>l.magicCloudNetworking.resources.policyPreview({...m,account_id:p})),{successLabel:`Created`})}},Fe={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`magic-cloud-networking`,describe:`magic-cloud-networking`,builder:e=>e.command(N).command(Q).command(De).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{i as c,n as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,i as p,n as m}from"./prompt-CyATfGUu.mjs";import{t as h}from"./cli-types-C3nVfpSG.mjs";import{n as g,t as _}from"./raw-fetch-CNKIypJ7.mjs";function v(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 ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.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:m.body===void 0?u({description:d(m.description,`description`,`text`),destination_type:d(m[`destination-type`],`destination-type`,`text`),name:d(m.name,`name`,`text`),policy:d(m.policy,`policy`,`text`),update_mode:d(m[`update-mode`],`update-mode`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`destination-type`]===void 0&&(m[`destination-type`]=await p(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),m.name===void 0&&(m.name=await f(`name`,`The name field`)),m[`update-mode`]===void 0&&(m[`update-mode`]=await p(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`destination-type`]!==void 0&&c(v,[`destination_type`],d(m[`destination-type`],`destination-type`,`text`)),m.name!==void 0&&c(v,[`name`],d(m.name,`name`,`text`)),m.policy!==void 0&&c(v,[`policy`],d(m.policy,`policy`,`text`)),m[`update-mode`]!==void 0&&c(v,[`update_mode`],d(m[`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(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(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 y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async r=>{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 m({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 b(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 x={command:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:b,handler:async r=>{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?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:p,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`})}};function S(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 C={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:S,handler:async r=>{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 w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:w,handler:async r=>{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 E(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 D={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:h(E),handler:async r=>{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`})}},O={command:`prebuilt-policies`,describe:`Operations for catalog-syncs.prebuilt-policies`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(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 A={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:k,handler:async r=>{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 j(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 M={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:j,handler:async r=>{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?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:e,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:p,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`})}},N={command:`catalog-syncs`,describe:`Operations for catalog-syncs`,builder:e=>e.command(ee).command(y).command(x).command(C).command(T).command(A).command(M).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(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 F={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:P,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.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:m.body===void 0?u({cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),friendly_name:d(m[`friendly-name`],`friendly-name`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`cloud-type`]===void 0&&(m[`cloud-type`]=await p(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),m[`friendly-name`]===void 0&&(m[`friendly-name`]=await f(`friendly-name`,`The friendly_name field`));let v={};m[`cloud-type`]!==void 0&&c(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`friendly-name`]!==void 0&&c(v,[`friendly_name`],d(m[`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(h).length>0?h:void 0})),{successLabel:`Created`})}};function I(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 L={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:I,handler:async r=>{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 m({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 R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:R,handler:async r=>{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 B(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 V={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:B,handler:async r=>{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 H(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 U={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:H,handler:async r=>{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?u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:p,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`})}};function W(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 G={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:W,handler:async r=>{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 K(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 q={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:K,handler:async r=>{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 J(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 Y={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:J,handler:async r=>{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 X(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 Z={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:X,handler:async r=>{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?u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:p,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`})}},Q={command:`cloud-integrations`,describe:`Operations for cloud-integrations`,builder:e=>e.command(F).command(L).command(V).command(z).command(U).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(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 re={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:ne,handler:async r=>{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?u({prefixes:r.prefixes}):l(r.body)});return}let c=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:d})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:f,account_id:d})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ie,handler:async r=>{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 oe(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 se={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:oe,handler:async r=>{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?u({prefixes:r.prefixes}):l(r.body)});return}let c=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:d})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:f,account_id:d})),{successLabel:`Updated`})}},ce={command:`address-spaces`,describe:`Operations for on-ramps.address-spaces`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(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 ue={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:le,handler:async r=>{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 de(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 fe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:de,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.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:m.body===void 0?u({adopted_hub_id:d(m[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:m[`attached-hubs`],attached_vpcs:m[`attached-vpcs`],cloud_asn:m[`cloud-asn`],cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),dynamic_routing:m[`dynamic-routing`],hub_provider_id:d(m[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:m[`install-routes-in-cloud`],install_routes_in_magic_wan:m[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:m[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:m[`manage-vpc-to-hub-attachments`],name:d(m.name,`name`,`text`),region:d(m.region,`region`,`text`),type:d(m.type,`type`,`text`),vpc:d(m.vpc,`vpc`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}if(m[`cloud-type`]===void 0&&(m[`cloud-type`]=await p(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),m[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(m[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(m[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);m.name===void 0&&(m.name=await f(`name`,`The name field`)),m.type===void 0&&(m.type=await p(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};m[`adopted-hub-id`]!==void 0&&c(v,[`adopted_hub_id`],d(m[`adopted-hub-id`],`adopted-hub-id`,`text`)),m[`attached-hubs`]!==void 0&&c(v,[`attached_hubs`],m[`attached-hubs`]),m[`attached-vpcs`]!==void 0&&c(v,[`attached_vpcs`],m[`attached-vpcs`]),m[`cloud-asn`]!==void 0&&c(v,[`cloud_asn`],m[`cloud-asn`]),m[`cloud-type`]!==void 0&&c(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`dynamic-routing`]!==void 0&&c(v,[`dynamic_routing`],m[`dynamic-routing`]),m[`hub-provider-id`]!==void 0&&c(v,[`hub_provider_id`],d(m[`hub-provider-id`],`hub-provider-id`,`text`)),m[`install-routes-in-cloud`]!==void 0&&c(v,[`install_routes_in_cloud`],m[`install-routes-in-cloud`]),m[`install-routes-in-magic-wan`]!==void 0&&c(v,[`install_routes_in_magic_wan`],m[`install-routes-in-magic-wan`]),m[`manage-hub-to-hub-attachments`]!==void 0&&c(v,[`manage_hub_to_hub_attachments`],m[`manage-hub-to-hub-attachments`]),m[`manage-vpc-to-hub-attachments`]!==void 0&&c(v,[`manage_vpc_to_hub_attachments`],m[`manage-vpc-to-hub-attachments`]),m.name!==void 0&&c(v,[`name`],d(m.name,`name`,`text`)),m.region!==void 0&&c(v,[`region`],d(m.region,`region`,`text`)),m.type!==void 0&&c(v,[`type`],d(m.type,`type`,`text`)),m.vpc!==void 0&&c(v,[`vpc`],d(m.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(h).length>0?h:void 0})),{successLabel:`Created`})}};function pe(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 me={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:pe,handler:async r=>{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 m({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 he(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 ge={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:he,handler:async r=>{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?u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:e,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:p,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})}};function _e(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 ve={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:_e,handler:async r=>{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()=>_(`/accounts/${a}/magic/cloud/onramps/${encodeURIComponent(String(r[`onramp-id`]))}/export`,{method:`POST`,local:r.local===!0,persistTo:r.persistTo}));g(r.text===!0?c.toString(`utf-8`):c)}};function ye(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 be={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:ye,handler:async r=>{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 xe(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 Se={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:xe,handler:async r=>{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 Ce(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 we={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:Ce,handler:async r=>{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 Te(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 Ee={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Te,handler:async r=>{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?u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:e,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(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:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:p,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})}},De={command:`on-ramps`,describe:`Operations for on-ramps`,builder:e=>e.command(ue).command(fe).command(me).command(ge).command(ve).command(be).command(Se).command(we).command(Ee).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(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 Oe={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:$,handler:async r=>{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()=>_(`/accounts/${c}/magic/cloud/resources/export${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));g(r.text===!0?u.toString(`utf-8`):u)}};function ke(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 Ae={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:ke,handler:async r=>{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 je(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 Me={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:h(je),handler:async r=>{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 Ne(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 Pe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Ne,handler:async r=>{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?u({policy:d(r.policy,`policy`,`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.magicCloudNetworking.resources.policyPreview({...e,account_id:p})),{successLabel:`Created`});return}r.policy===void 0&&(r.policy=await f(`policy`,`The policy field`));let m=u({policy:d(r.policy,`policy`,`text`)});a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...m,account_id:p})),{successLabel:`Created`})}},Fe={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`magic-cloud-networking`,describe:`magic-cloud-networking`,builder:e=>e.command(N).command(Q).command(De).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,r as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,i as p,n as m}from"./prompt-CyATfGUu.mjs";function h(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 g={command:`create`,describe:`Create a new network monitoring configuration.`,builder:h,handler:async r=>{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?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.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 f(`name`,`The account name.`));let h=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Creating`,async()=>p.magicNetworkMonitoring.configs.create({...h,account_id:m})),{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:`Delete an existing network monitoring configuration.`,builder:_,handler:async r=>{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 m({force:!!r.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.configs.delete({account_id:l})),{successLabel:`Deleted`})}};function y(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 b={command:`edit`,describe:`Update fields in an existing network monitoring configuration.`,builder:y,handler:async r=>{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?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.magicNetworkMonitoring.configs.edit({...e,account_id:p})),{successLabel:`Updated`});return}let m=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>f.magicNetworkMonitoring.configs.edit({...m,account_id:p})),{successLabel:`Updated`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Lists default sampling, router IPs, warp devices, and rules for account.`,builder:x,handler:async r=>{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`})}},C={command:`full`,describe:`Operations for configs.full`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Lists default sampling, router IPs and warp devices for account.`,builder:w,handler:async r=>{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 E(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 D={command:`update`,describe:`Update an existing network monitoring configuration, requires the entire configuration to be updated at once.`,builder:E,handler:async r=>{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?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.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 f(`name`,`The account name.`));let h=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>p.magicNetworkMonitoring.configs.update({...h,account_id:m})),{successLabel:`Updated`})}},O={command:`configs`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(g).command(v).command(b).command(T).command(D).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(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 A={command:`edit <rule-id>`,describe:`Update advertisement for rule.`,builder:k,handler:async r=>{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`})}},j={command:`advertisements`,describe:`Operations for rules.advertisements`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(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 ee={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:M,handler:async l=>{if(l.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:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.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(u,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Created`});return}a(await s(`Creating`,async()=>r(u,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function N(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 P={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:N,handler:async l=>{if(l.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:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.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(u,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},F={command:`bulk`,describe:`Operations for rules.bulk`,builder:e=>e.command(ee).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 L={command:`create`,describe:`Create network monitoring rules for account. Currently only supports creating a single rule per API request.`,builder:I,handler:async r=>{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?u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)}):c(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.magicNetworkMonitoring.rules.create({body:e,account_id:m})),{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 f(`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 p(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Creating`,async()=>l.magicNetworkMonitoring.rules.create({body:h,account_id:m})),{successLabel:`Created`})}};function R(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 z={command:`delete <rule-id>`,describe:`Delete a network monitoring rule for account.`,builder:R,handler:async r=>{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 m({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 B(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 V={command:`edit <rule-id>`,describe:`Update a network monitoring rule for account.`,builder:B,handler:async r=>{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?u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)}):c(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.edit({body:e,account_id:m,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 f(`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 p(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.edit({body:h,account_id:m,rule_id:r[`rule-id`]})),{successLabel:`Updated`})}};function H(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 U={command:`get <rule-id>`,describe:`List a single network monitoring rule for account.`,builder:H,handler:async r=>{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 W(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Lists network monitoring rules for account.`,builder:W,handler:async r=>{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 K(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 q={command:`update`,describe:`Update network monitoring rules for account.`,builder:K,handler:async r=>{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?u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)}):c(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.update({body:e,account_id:m})),{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 f(`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 p(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.update({body:h,account_id:m})),{successLabel:`Updated`})}},J={command:`rules`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).command(q).command(j).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`create`,describe:`Generate authentication token for VPC flow logs export.`,builder:Y,handler:async r=>{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`})}},Z={command:`tokens`,describe:`Operations for vpc-flows.tokens`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`vpc-flows`,describe:`Ingest VPC flow logs from cloud providers for network visibility and anomaly detection`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`magic-network-monitoring`,describe:`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,builder:e=>e.command(O).command(J).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};