cf 0.13.0 → 0.14.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 (266) hide show
  1. package/dist/_meta/agent-context.json +189 -187
  2. package/dist/_meta/commands.json +2591 -2248
  3. package/dist/_meta/hand-written-commands.json +146 -1
  4. package/dist/_meta/schemas.json +1548 -1313
  5. package/dist/{abuse-reports-BbaHw4ST.mjs → abuse-reports-CDFjJ2e8.mjs} +1 -1
  6. package/dist/{access-D6Xz892p.mjs → access-BoT1waG4.mjs} +1 -1
  7. package/dist/{account-DvxcqeaK.mjs → account-agnMUKWj.mjs} +1 -1
  8. package/dist/{account-tags-CeqfEWpz.mjs → account-tags-BRMMHCee.mjs} +1 -1
  9. package/dist/{accounts-Bx-8BMH9.mjs → accounts-Cut77dAt.mjs} +2 -2
  10. package/dist/{acm--0opdSGE.mjs → acm-C8WgXNCl.mjs} +1 -1
  11. package/dist/{addressing-BS1ynzLA.mjs → addressing-CR8EV42x.mjs} +1 -1
  12. package/dist/{agent-context-BPhyrSns.mjs → agent-context-Wj5TRRbW.mjs} +1 -1
  13. package/dist/{agent-memory-DczzpEw5.mjs → agent-memory-CVJpKKZy.mjs} +1 -1
  14. package/dist/{ai-CDdCTcQl.mjs → ai-BbNYt-yI.mjs} +1 -1
  15. package/dist/{ai-audit-Bx9KMQYh.mjs → ai-audit-mVajM-2i.mjs} +1 -1
  16. package/dist/{ai-gateway-BSXJEaYS.mjs → ai-gateway-BsepSA_v.mjs} +2 -2
  17. package/dist/{ai-search-DRQj1aMu.mjs → ai-search-DbEJqm5-.mjs} +1 -1
  18. package/dist/{ai-security-C_Rb0lGT.mjs → ai-security-DmyB5EYk.mjs} +1 -1
  19. package/dist/{alerting-BAR9eFs2.mjs → alerting-dmy3hd8O.mjs} +3 -3
  20. package/dist/analytics-B1xBMla0.mjs +5 -0
  21. package/dist/{analytics_engine-DkEzlhfT.mjs → analytics_engine-DazCn3iC.mjs} +1 -1
  22. package/dist/{api-security-jA0lOk6a.mjs → api-security-0HXCzfHk.mjs} +1 -1
  23. package/dist/{argo-Cz4pDagx.mjs → argo-DSHsE8zv.mjs} +1 -1
  24. package/dist/{artifacts-BcLTGfAv.mjs → artifacts-CwiU9Mxu.mjs} +1 -1
  25. package/dist/{audit-logs-DbIv4n6u.mjs → audit-logs-DwFtMDwH.mjs} +1 -1
  26. package/dist/{auth-rW5d3jtr.mjs → auth-B0ZyXc3y.mjs} +1 -1
  27. package/dist/{auth-tvDdC1J-.mjs → auth-DWxtJ918.mjs} +2 -2
  28. package/dist/{billing-Md87QjqW.mjs → billing-Cbpadkgu.mjs} +1 -1
  29. package/dist/{bot-management-VHMo4hpU.mjs → bot-management-B6M2Vyyn.mjs} +1 -1
  30. package/dist/{botnet-feed-BHqfo3sa.mjs → botnet-feed-Dn8UuE4h.mjs} +1 -1
  31. package/dist/{brand-protection-HUeR6Pof.mjs → brand-protection-B5R0b3pu.mjs} +1 -1
  32. package/dist/{browser-extension-199oZg3X.mjs → browser-extension-D55pYZf_.mjs} +1 -1
  33. package/dist/{browser-run-DDasyux-.mjs → browser-run-C1b2VkGB.mjs} +1 -1
  34. package/dist/build-CP2JUfV1.mjs +2 -0
  35. package/dist/{builds-B-lXn6JR.mjs → builds-CVEXO_4a.mjs} +8 -8
  36. package/dist/{cache-CevKpiTM.mjs → cache-BU5xX82E.mjs} +1 -1
  37. package/dist/{certificate-authorities-DAg-aO1B.mjs → certificate-authorities--tZTWJWD.mjs} +1 -1
  38. package/dist/cf-BV2HLCQm.mjs +18 -0
  39. package/dist/{chunk-QBZBEHZB-BuiXJn8j.mjs → chunk-QBZBEHZB-BcCMlc8C.mjs} +1 -1
  40. package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +103 -0
  41. package/dist/{client-certificates-Bay7oPLE.mjs → client-certificates-DX84qeYG.mjs} +1 -1
  42. package/dist/{client-side-security-CbU9xn0k.mjs → client-side-security-DsSO2rZQ.mjs} +1 -1
  43. package/dist/{cloud-connector-AH2ClcSL.mjs → cloud-connector-cf8qlxap.mjs} +1 -1
  44. package/dist/{cloudforce-one-DwOfS75V.mjs → cloudforce-one-DzVXorbu.mjs} +2 -2
  45. package/dist/command-BL6weJf3.mjs +3 -0
  46. package/dist/command-DYrspBc0.mjs +2 -0
  47. package/dist/{completions-nPO9PdSu.mjs → completions-Dn621okY.mjs} +1 -1
  48. package/dist/{config-B8lwPpVl.mjs → config-BY6KpMZs.mjs} +1 -1
  49. package/dist/config.d.mts +1 -1729
  50. package/dist/config.mjs +1 -1
  51. package/dist/{connector-interrupts-DcLrqM2V.mjs → connector-interrupts-DqpqPPkp.mjs} +1 -1
  52. package/dist/{connector-telemetry-events-PrJWgNs9.mjs → connector-telemetry-events-CCD-_B-8.mjs} +1 -1
  53. package/dist/{connector-telemetry-snapshots-CIjJm5yu.mjs → connector-telemetry-snapshots-D3CeGGhk.mjs} +1 -1
  54. package/dist/{connectors-CEAy30E-.mjs → connectors-aPQspZdg.mjs} +1 -1
  55. package/dist/{containers-BsbDqbSn.mjs → containers-D0Kjl8h-.mjs} +1 -1
  56. package/dist/{content-scan-BdK936iO.mjs → content-scan-BVx18XmS.mjs} +1 -1
  57. package/dist/{cps-oP97-qkm.mjs → cps-ByazyM0x.mjs} +1 -1
  58. package/dist/{csamScanner-DUNN4INg.mjs → csamScanner-OG5lQxBC.mjs} +1 -1
  59. package/dist/{ct-alerting-dV_gsV2w.mjs → ct-alerting-BJx5n8Zf.mjs} +1 -1
  60. package/dist/{custom-certificates-DYspvjo4.mjs → custom-certificates-BuJ2e9TA.mjs} +1 -1
  61. package/dist/{custom-csrs-DjSWLQRu.mjs → custom-csrs-CR_5qbST.mjs} +1 -1
  62. package/dist/{custom-hostnames-df1lH6IY.mjs → custom-hostnames-BzDTsQXb.mjs} +1 -1
  63. package/dist/{custom-nameservers-CLTbN-9R.mjs → custom-nameservers-OfMPRGkD.mjs} +1 -1
  64. package/dist/custom-pages-BmGXoTIo.mjs +3 -0
  65. package/dist/d1-DedC8N0N.mjs +21 -0
  66. package/dist/data-security-B2UB26ry.mjs +7 -0
  67. package/dist/{dcv-delegation-_r6Vc6VL.mjs → dcv-delegation-C11vmzbG.mjs} +1 -1
  68. package/dist/{deploy-QTGENpOM.mjs → deploy-BtETDvDA.mjs} +1 -1
  69. package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-BoLTdQzS.mjs} +1 -1
  70. package/dist/{dev-CAubuxCc.mjs → dev-B5WcIpEr.mjs} +2 -2
  71. package/dist/{diagnostics-B0DRh714.mjs → diagnostics-Cf6BLpAo.mjs} +1 -1
  72. package/dist/dialog-Bud0hiYv.mjs +2 -0
  73. package/dist/{dist-DW5BPGFs.mjs → dist-BRg_z9Ut.mjs} +1 -1
  74. package/dist/{shared-YJtB5KZB.mjs → dist-CFQREIRi.mjs} +86 -86
  75. package/dist/dist-CyisSore.mjs +371 -0
  76. package/dist/dist-Dr4Hg_Up.mjs +48 -0
  77. package/dist/{dls-CFzTHcZM.mjs → dls-R6PvHbhj.mjs} +1 -1
  78. package/dist/{dns-Dw6u-NV1.mjs → dns-Cl8se64c.mjs} +1 -1
  79. package/dist/{dns-firewall-CIPptslp.mjs → dns-firewall-WtmKilDT.mjs} +1 -1
  80. package/dist/dry-run-YSQndLvt.mjs +2 -0
  81. package/dist/{durable-objects-CCkeqqBq.mjs → durable-objects-jfVU6yp_.mjs} +1 -1
  82. package/dist/{email-auth-kdxO51Oz.mjs → email-auth-DPmZ85eW.mjs} +1 -1
  83. package/dist/{email-routing-BLggZdQq.mjs → email-routing-Bf6DbNTr.mjs} +1 -1
  84. package/dist/{email-security-DjADlgdM.mjs → email-security-DTifjSxM.mjs} +1 -1
  85. package/dist/{email-sending-Cz7E7GoP.mjs → email-sending-Dm3WkFHV.mjs} +1 -1
  86. package/dist/{error-sanitization-DfLijlBJ.mjs → error-sanitization-D8zuyPj_.mjs} +1 -1
  87. package/dist/{fieldExtractors-BWaMi6lD.mjs → fieldExtractors-CeXZL0-I.mjs} +1 -1
  88. package/dist/{firewall-5t6OBIOl.mjs → firewall-D5N2APXO.mjs} +1 -1
  89. package/dist/{flagship-CzG_VoNR.mjs → flagship-sUOy9jei.mjs} +1 -1
  90. package/dist/{fraud-UOg_69Ob.mjs → fraud-WLW2Ep1Z.mjs} +1 -1
  91. package/dist/{google-tag-gateway-DirkD-Q2.mjs → google-tag-gateway-lbww1FaJ.mjs} +1 -1
  92. package/dist/{healthchecks-BkHZGTp1.mjs → healthchecks-0ih8Qjiw.mjs} +1 -1
  93. package/dist/{hostnames-EUYOZm21.mjs → hostnames-Ba6FuL8K.mjs} +1 -1
  94. package/dist/{hyperdrive-ZoLJlJCL.mjs → hyperdrive-DMqcU639.mjs} +1 -1
  95. package/dist/{iam-BQ2xSgYN.mjs → iam-CXlYm0uC.mjs} +1 -1
  96. package/dist/{images-CkEq6ScP.mjs → images-D_g1oli6.mjs} +1 -1
  97. package/dist/index.mjs +1 -1
  98. package/dist/{intel-DDWEdGyl.mjs → intel-B8bS0ARd.mjs} +1 -1
  99. package/dist/interactive-CGOh-aYq.mjs +32 -0
  100. package/dist/{ips-54Qmy-Uw.mjs → ips-68fzniN4.mjs} +1 -1
  101. package/dist/{keyless-certificates-CXHLc3Qz.mjs → keyless-certificates-CeLnqBvX.mjs} +1 -1
  102. package/dist/{keys-rvI4TC3Z.mjs → keys-DkVdS2lF.mjs} +1 -1
  103. package/dist/{kv-CAeN1zBy.mjs → kv-gDAN50BQ.mjs} +1 -1
  104. package/dist/{leaked-credential-checks-CbbwtG-p.mjs → leaked-credential-checks-DfnvHpvg.mjs} +1 -1
  105. package/dist/{lifecycle-XswDq0ZB.mjs → lifecycle-CadF_i2n.mjs} +1 -1
  106. package/dist/{load-balancers-BFwdwAIU.mjs → load-balancers-m0HqyXPZ.mjs} +1 -1
  107. package/dist/{local-C6XsFD_W.mjs → local-BwL_gesw.mjs} +1 -1
  108. package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-Dj8k-p62.mjs} +1 -1
  109. package/dist/{logo-matches-Y3PxVn7t.mjs → logo-matches-DPbHlsKQ.mjs} +1 -1
  110. package/dist/{logos-BN8SvJhS.mjs → logos-DFBJFAYJ.mjs} +1 -1
  111. package/dist/{logpush-BnLA4WVm.mjs → logpush-gzmlZayc.mjs} +1 -1
  112. package/dist/logs-BuzwQgt5.mjs +18 -0
  113. package/dist/{magic-cloud-networking-wPuLwu-F.mjs → magic-cloud-networking-BbHCi1Vp.mjs} +1 -1
  114. package/dist/{magic-network-monitoring-BNERUpxS.mjs → magic-network-monitoring-kWMmnPTG.mjs} +1 -1
  115. package/dist/{magic-transit-6tvVOECW.mjs → magic-transit-ClSmJDKw.mjs} +1 -1
  116. package/dist/{managed-defense-AYwBOYIH.mjs → managed-defense-EOihg1UR.mjs} +1 -1
  117. package/dist/{managed-transforms-HZZNrkC7.mjs → managed-transforms-BZ_XdGE2.mjs} +1 -1
  118. package/dist/{matches-Dp91L3dL.mjs → matches-B6sG0_fr.mjs} +1 -1
  119. package/dist/{mcp-P7pcieiT.mjs → mcp--kK0vS5i.mjs} +1 -1
  120. package/dist/{mesh-DjFrk6PL.mjs → mesh-DfXYUHOO.mjs} +1 -1
  121. package/dist/{mtls-certificates-DZMoef2H.mjs → mtls-certificates-DZd-0X7l.mjs} +1 -1
  122. package/dist/{network-7cd1U6-I.mjs → network-U6f_5ihp.mjs} +1 -1
  123. package/dist/{network-interconnects-CQ7cPZjK.mjs → network-interconnects-DKZGTiYM.mjs} +1 -1
  124. package/dist/oauth-BdVr2hJp.mjs +14 -0
  125. package/dist/{oauth-clients-P9t-eMnx.mjs → oauth-clients-CY3OkPhC.mjs} +1 -1
  126. package/dist/{oauth-scopes-C3r9Qh_y.mjs → oauth-scopes-BTY7_5L-.mjs} +1 -1
  127. package/dist/{observability-M1DnLhMR.mjs → observability-Bsp-LdmJ.mjs} +1 -1
  128. package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-ClEt4E8F.mjs} +3 -3
  129. package/dist/{organization-cUE7GDCt.mjs → organization-BSeMdj-7.mjs} +1 -1
  130. package/dist/{organizations-C-Hcpd0w.mjs → organizations-BroR48Nv.mjs} +1 -1
  131. package/dist/{origin-ca-certificates-C8cJMyQH.mjs → origin-ca-certificates-jC-EMn6W.mjs} +1 -1
  132. package/dist/{origin-post-quantum-encryption-DjZJCk8M.mjs → origin-post-quantum-encryption-DIspLvA0.mjs} +1 -1
  133. package/dist/{origin-tls-client-auth-BsjR5EAV.mjs → origin-tls-client-auth-CZ_nUEcM.mjs} +1 -1
  134. package/dist/{page-rules-B-zq1EUb.mjs → page-rules-ZcdjPohY.mjs} +1 -1
  135. package/dist/{pages-B6YpkPos.mjs → pages-W4tKa7xk.mjs} +1 -1
  136. package/dist/pay-per-crawl-BNM1mJmP.mjs +5 -0
  137. package/dist/pay-per-use-DKxlnkH3.mjs +2 -0
  138. package/dist/{pipelines-BJc_RylD.mjs → pipelines-Dug0BR-c.mjs} +1 -1
  139. package/dist/{precursor-CLQu7suY.mjs → precursor-D-11DkRU.mjs} +1 -1
  140. package/dist/previews-D_Nv4dR6.mjs +4 -0
  141. package/dist/{progress-V6SZV3Ux.mjs → progress-a5IKeKni.mjs} +1 -1
  142. package/dist/project-settings-Bc3wYHo8.mjs +3 -0
  143. package/dist/prompt-BP8XrQSj.mjs +3 -0
  144. package/dist/{queries-DSrrket-.mjs → queries-BdA2vJoe.mjs} +1 -1
  145. package/dist/{queues-Tf7kPBpn.mjs → queues-Bu06ZqUE.mjs} +1 -1
  146. package/dist/{r2-DmKNnxtC.mjs → r2-COC9wMKb.mjs} +1 -1
  147. package/dist/{r2-data-catalog-DBxoifOq.mjs → r2-data-catalog-CX5Rl5Qx.mjs} +1 -1
  148. package/dist/{radar-Csk7Ab-b.mjs → radar-L-yoLIHF.mjs} +1 -1
  149. package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNH2V8qH.mjs} +1 -1
  150. package/dist/{realtime-CDehZVhV.mjs → realtime-JKIiXfzi.mjs} +1 -1
  151. package/dist/{registrar-vflzeNQ9.mjs → registrar-_dYUZrK0.mjs} +2 -2
  152. package/dist/{registrar-sandbox-BxVdfnam.mjs → registrar-sandbox-D1yfW_Q_.mjs} +2 -2
  153. package/dist/{registry-CWUfXloz.mjs → registry-BrtVdMrC.mjs} +1 -1
  154. package/dist/{reporting-BaPZ1PHN.mjs → reporting-3fyoMcmb.mjs} +1 -1
  155. package/dist/request-headers-BhQQAfJt.mjs +2 -0
  156. package/dist/{request-tracers-C_UVBexV.mjs → request-tracers-TisEth2p.mjs} +1 -1
  157. package/dist/{resolve-B8CyM1mi.mjs → resolve-CYUp6YgC.mjs} +1 -1
  158. package/dist/{resource-sharing-CoB4S9j1.mjs → resource-sharing-C4-dnohU.mjs} +1 -1
  159. package/dist/{resource-tagging-CUiUC5g4.mjs → resource-tagging-BRDifKqM.mjs} +1 -1
  160. package/dist/{rules-4O8076_s.mjs → rules-BCF3gIkw.mjs} +2 -2
  161. package/dist/{rulesets-C84MxTYo.mjs → rulesets-wp6rllt3.mjs} +1 -1
  162. package/dist/{rum-Bvwkrntx.mjs → rum-B77awgoB.mjs} +1 -1
  163. package/dist/run-BS8otL3u.mjs +2 -0
  164. package/dist/{schema-C8hU6G9R.mjs → schema-DmuJtMN5.mjs} +1 -1
  165. package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CUGxFeZe.mjs} +4 -4
  166. package/dist/{scim-BvxQmde6.mjs → scim-C9BmUYil.mjs} +1 -1
  167. package/dist/{sdk-C12y5qCN.mjs → sdk-Bvqx-_3z.mjs} +1 -1
  168. package/dist/{secrets-store-DOKWiC-j.mjs → secrets-store-ckkZR2dM.mjs} +1 -1
  169. package/dist/{security-center-Bhy_aC-w.mjs → security-center-BCahKT57.mjs} +1 -1
  170. package/dist/{security-txt-L7HJ9tq5.mjs → security-txt-0SI5du7I.mjs} +1 -1
  171. package/dist/shared-D0B-7q-D.mjs +2 -0
  172. package/dist/{smart-shield-COMXuQ1S.mjs → smart-shield-BDPbrZa4.mjs} +1 -1
  173. package/dist/{snippets-DffQhlKt.mjs → snippets-CVRR_h0i.mjs} +1 -1
  174. package/dist/spawn-DP4T92ss.mjs +519 -0
  175. package/dist/{spectrum-Cmf7SqQE.mjs → spectrum-CjNXQIQE.mjs} +3 -3
  176. package/dist/{speed-m8cdhLFS.mjs → speed-CrXCHk3h.mjs} +1 -1
  177. package/dist/src-BbnV77C4.mjs +108 -0
  178. package/dist/{ssl-D4ffsdSw.mjs → ssl-DKORhHkh.mjs} +1 -1
  179. package/dist/{startup-profile-Dx95Y5cl.mjs → startup-profile-CBIH6yZy.mjs} +3 -3
  180. package/dist/{state-CHif8Y5I.mjs → state-QUu6HfxC.mjs} +1 -1
  181. package/dist/{stream-DPF5fojV.mjs → stream-wY3zi3FK.mjs} +1 -1
  182. package/dist/{submit-Br8hfP0_.mjs → submit-B-4oCBSk.mjs} +1 -1
  183. package/dist/{tags-Bnt4JuxQ.mjs → tags-5uJEkYJZ.mjs} +1 -1
  184. package/dist/{telemetry-DjGNSlkU.mjs → telemetry-2s9Y3FaN.mjs} +1 -1
  185. package/dist/{telemetry-Ch1vCICm.mjs → telemetry-n3NJourL.mjs} +1 -1
  186. package/dist/{tenant-D8u0CxoC.mjs → tenant-BkFvv2o3.mjs} +1 -1
  187. package/dist/{tenant-custom-nameservers-BrWMyslZ.mjs → tenant-custom-nameservers-DcjC1q0r.mjs} +1 -1
  188. package/dist/{tools-D9RZkZRc.mjs → tools-Dz1JCrHd.mjs} +1 -1
  189. package/dist/tunnel-Cd4ipbvJ.mjs +2 -0
  190. package/dist/{tunnels-BkNPpTHa.mjs → tunnels-9Zg3ePwD.mjs} +1 -1
  191. package/dist/{turnstile-MgwRECJv.mjs → turnstile-BTwKYpzD.mjs} +1 -1
  192. package/dist/{url-info-Ddp7MgcI.mjs → url-info-D7Y61BFd.mjs} +1 -1
  193. package/dist/{url-normalization-3ptK9ntV.mjs → url-normalization-B4n8HiNQ.mjs} +1 -1
  194. package/dist/{url-scanner-Psb9ollR.mjs → url-scanner-CiCIltSQ.mjs} +1 -1
  195. package/dist/{user-DWdshcIu.mjs → user-DDFDGJ0Y.mjs} +1 -1
  196. package/dist/{values-CDKQL1z2.mjs → values-DRznB_Cl.mjs} +1 -1
  197. package/dist/{vectorize-CTYYUyQj.mjs → vectorize-CbznPhzq.mjs} +1 -1
  198. package/dist/waiting-rooms-CKP5hYBK.mjs +11 -0
  199. package/dist/{web-assets-CpDwDEx8.mjs → web-assets-C-ZoSkkh.mjs} +1 -1
  200. package/dist/{web3-YsjDyAzH.mjs → web3-DwlN4dOw.mjs} +1 -1
  201. package/dist/{workers-builds-BWo5vUA9.mjs → workers-builds-ECw_x_kp.mjs} +1 -1
  202. package/dist/{workers-for-platforms-ASJsxYdM.mjs → workers-for-platforms-BYGy46R6.mjs} +2 -2
  203. package/dist/{workers-vpc-RkTnRvA2.mjs → workers-vpc-CCosFcxz.mjs} +1 -1
  204. package/dist/workers-zFMrbUkg.mjs +6 -0
  205. package/dist/{workflows-KrIFI9ns.mjs → workflows-C8GXGDRW.mjs} +1 -1
  206. package/dist/{zaraz-DglXbVzZ.mjs → zaraz-B5UIREaz.mjs} +1 -1
  207. package/dist/{zero-trust-RilTdSjX.mjs → zero-trust-DUp0XoIo.mjs} +50 -50
  208. package/dist/{zone-DsBtVkvT.mjs → zone-BGLkk-mL.mjs} +1 -1
  209. package/dist/{zones-BFxvWFQW.mjs → zones-CwYjNXMH.mjs} +1 -1
  210. package/package.json +11 -11
  211. package/dist/analytics-BaUZwNc5.mjs +0 -4
  212. package/dist/build-0QlYUfFS.mjs +0 -2
  213. package/dist/cf-C11NGkjx.mjs +0 -18
  214. package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
  215. package/dist/command-CMzMsll4.mjs +0 -2
  216. package/dist/custom-pages-DzKnSgL3.mjs +0 -3
  217. package/dist/d1-JBEqjJoj.mjs +0 -20
  218. package/dist/data-security-CIktWnXt.mjs +0 -7
  219. package/dist/dist-12KzRsBM.mjs +0 -387
  220. package/dist/dist-BCVqQpg2.mjs +0 -2
  221. package/dist/dist-Cp3uJN1x.mjs +0 -48
  222. package/dist/dist-S9K_8gq9.mjs +0 -9
  223. package/dist/dry-run-DiVy1lVo.mjs +0 -2
  224. package/dist/interactive-B2E03Fs-.mjs +0 -11
  225. package/dist/interactive-_B-EqD0Y.mjs +0 -23
  226. package/dist/logexplorer-D8rOPB5I.mjs +0 -17
  227. package/dist/logs-CDo7Y5sA.mjs +0 -3
  228. package/dist/oauth-DH3kMXSs.mjs +0 -14
  229. package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
  230. package/dist/prompt-DjRTpML4.mjs +0 -3
  231. package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
  232. package/dist/request-headers-CC4eHmI2.mjs +0 -3
  233. package/dist/run-CRfinkSe.mjs +0 -2
  234. package/dist/schemas-O_ZNaF8R.mjs +0 -65
  235. package/dist/spawn-C1AISA2V.mjs +0 -526
  236. package/dist/src-C8phrg-8.mjs +0 -109
  237. package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
  238. package/dist/workers-BKKxaZcz.mjs +0 -6
  239. /package/dist/{alerts-B2SJO4nd.mjs → alerts-CarPLL8k.mjs} +0 -0
  240. /package/dist/{autorag-iNjZXw1n.mjs → autorag-zK-3harf.mjs} +0 -0
  241. /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-Cmw7PZ7a.mjs} +0 -0
  242. /package/dist/{brands-BrVnNrT3.mjs → brands-CpgTsX8h.mjs} +0 -0
  243. /package/dist/{clear-an9o3dJ3.mjs → clear-C5gzBA8G.mjs} +0 -0
  244. /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-abvWQN3T.mjs} +0 -0
  245. /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-BY-dbhQZ.mjs} +0 -0
  246. /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-DoMvHvCO.mjs} +0 -0
  247. /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-Cw3G4nap.mjs} +0 -0
  248. /package/dist/{health-CIUg1C5o.mjs → health-DkEXPkS6.mjs} +0 -0
  249. /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-nF-0Ze2h.mjs} +0 -0
  250. /package/dist/{internal-DmpATljO.mjs → internal-4fU2r5en.mjs} +0 -0
  251. /package/dist/{live-B66u3_0g.mjs → live-B4iGrwY2.mjs} +0 -0
  252. /package/dist/{metadata-D062SVyy.mjs → metadata-C5fJJr-k.mjs} +0 -0
  253. /package/dist/{output-COcSQsfn.mjs → output-Z2lQmPUW.mjs} +0 -0
  254. /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-DNsAFIeM.mjs} +0 -0
  255. /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-CsOim7bm.mjs} +0 -0
  256. /package/dist/{ready-C-H2cwp_.mjs → ready-tTe-zcIw.mjs} +0 -0
  257. /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-B3eTV5yC.mjs} +0 -0
  258. /package/dist/{refute-uSlzkQKq.mjs → refute-BY76YVrT.mjs} +0 -0
  259. /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-DdoF_a5y.mjs} +0 -0
  260. /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-sSgLwwZN.mjs} +0 -0
  261. /package/dist/{search-BlKeSfVD.mjs → search-BFvQr-sl.mjs} +0 -0
  262. /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-Cr8hiZPJ.mjs} +0 -0
  263. /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-DT2mLnu1.mjs} +0 -0
  264. /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-6gs5iy9T.mjs} +0 -0
  265. /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-D6XKO2EV.mjs} +0 -0
  266. /package/dist/{verify-S-TmhUDr.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,n as p}from"./prompt-DjRTpML4.mjs";function m(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:m,handler:async l=>c({command:`logpush account-datasets fields get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/datasets/${l[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(l[`dataset-id`]))}/fields`,pathParams:{"account-or-zone":String(t),"dataset-id":String(l[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountDatasets.fields.get({account_or_zone:u,account_or_zone_id:d,dataset_id:l[`dataset-id`]})),{successLabel:`Loaded`})})},g={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account or zone for a dataset.`,builder:ee,handler:async l=>c({command:`logpush account-datasets jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/datasets/${l[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(l[`dataset-id`]))}/jobs`,pathParams:{"account-or-zone":String(t),"dataset-id":String(l[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountDatasets.jobs.get({account_or_zone:u,account_or_zone_id:d,dataset_id:l[`dataset-id`]})),{successLabel:`Loaded`})})},v={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.account_abuse_protection_events.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_bgp_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`filter-attack-traffic`,{type:`boolean`,description:"When true, excludes DDoS attack traffic from logs. This option is supported for the `http_requests`, `firewall_events`, and `network_analytics_logs` datasets.",default:!1}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Specifies the sampling rate as a floating number greater than 0 and at most 1. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new Logpush job for an account or zone.`,builder:b,handler:async p=>c({command:`logpush account-jobs create`,classification:{safeFlags:[`dataset`,`enabled`,`filter-attack-traffic`,`frequency`,`kind`,`output-options-cve-2021-44228`,`output-options-merge-subrequests`,`output-options-output-type`,`output-options-timestamp-format`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({dataset:d(p.dataset,`dataset`,`text`),destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),enabled:p.enabled,filter:d(p.filter,`filter`,`text`),filter_attack_traffic:p[`filter-attack-traffic`],frequency:d(p.frequency,`frequency`,`text`),kind:d(p.kind,`kind`,`text`),logpull_options:d(p[`logpull-options`],`logpull-options`,`text`),name:d(p.name,`name`,`text`),output_options:{"CVE-2021-44228":p[`output-options-cve-2021-44228`],batch_prefix:d(p[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(p[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(p[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:p[`output-options-field-names`],merge_subrequests:p[`output-options-merge-subrequests`],output_type:d(p[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(p[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(p[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(p[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(p[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:p[`output-options-sample-rate`],timestamp_format:d(p[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountJobs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({dataset:d(p.dataset,`dataset`,`text`),destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),enabled:p.enabled,filter:d(p.filter,`filter`,`text`),filter_attack_traffic:p[`filter-attack-traffic`],frequency:d(p.frequency,`frequency`,`text`),kind:d(p.kind,`kind`,`text`),logpull_options:d(p[`logpull-options`],`logpull-options`,`text`),name:d(p.name,`name`,`text`),output_options:{"CVE-2021-44228":p[`output-options-cve-2021-44228`],batch_prefix:d(p[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(p[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(p[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:p[`output-options-field-names`],merge_subrequests:p[`output-options-merge-subrequests`],output_type:d(p[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(p[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(p[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(p[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(p[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:p[`output-options-sample-rate`],timestamp_format:d(p[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountJobs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function S(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:S,handler:async l=>c({command:`logpush account-jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(l[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();if(u===`zones`?l.zoneId=d:l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the Logpush job.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,n as p}from"./prompt-BP8XrQSj.mjs";function m(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:m,handler:async l=>c({command:`logpush account-datasets fields get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/datasets/${l[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(l[`dataset-id`]))}/fields`,pathParams:{"account-or-zone":String(t),"dataset-id":String(l[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountDatasets.fields.get({account_or_zone:u,account_or_zone_id:d,dataset_id:l[`dataset-id`]})),{successLabel:`Loaded`})})},g={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account or zone for a dataset.`,builder:ee,handler:async l=>c({command:`logpush account-datasets jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/datasets/${l[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(l[`dataset-id`]))}/jobs`,pathParams:{"account-or-zone":String(t),"dataset-id":String(l[`dataset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountDatasets.jobs.get({account_or_zone:u,account_or_zone_id:d,dataset_id:l[`dataset-id`]})),{successLabel:`Loaded`})})},v={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.account_abuse_protection_events.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_bgp_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`filter-attack-traffic`,{type:`boolean`,description:"When true, excludes DDoS attack traffic from logs. This option is supported for the `http_requests`, `firewall_events`, and `network_analytics_logs` datasets.",default:!1}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Specifies the sampling rate as a floating number greater than 0 and at most 1. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new Logpush job for an account or zone.`,builder:b,handler:async p=>c({command:`logpush account-jobs create`,classification:{safeFlags:[`dataset`,`enabled`,`filter-attack-traffic`,`frequency`,`kind`,`output-options-cve-2021-44228`,`output-options-merge-subrequests`,`output-options-output-type`,`output-options-timestamp-format`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({dataset:d(p.dataset,`dataset`,`text`),destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),enabled:p.enabled,filter:d(p.filter,`filter`,`text`),filter_attack_traffic:p[`filter-attack-traffic`],frequency:d(p.frequency,`frequency`,`text`),kind:d(p.kind,`kind`,`text`),logpull_options:d(p[`logpull-options`],`logpull-options`,`text`),name:d(p.name,`name`,`text`),output_options:{"CVE-2021-44228":p[`output-options-cve-2021-44228`],batch_prefix:d(p[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(p[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(p[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:p[`output-options-field-names`],merge_subrequests:p[`output-options-merge-subrequests`],output_type:d(p[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(p[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(p[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(p[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(p[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:p[`output-options-sample-rate`],timestamp_format:d(p[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountJobs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({dataset:d(p.dataset,`dataset`,`text`),destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),enabled:p.enabled,filter:d(p.filter,`filter`,`text`),filter_attack_traffic:p[`filter-attack-traffic`],frequency:d(p.frequency,`frequency`,`text`),kind:d(p.kind,`kind`,`text`),logpull_options:d(p[`logpull-options`],`logpull-options`,`text`),name:d(p.name,`name`,`text`),output_options:{"CVE-2021-44228":p[`output-options-cve-2021-44228`],batch_prefix:d(p[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(p[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(p[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:p[`output-options-field-names`],merge_subrequests:p[`output-options-merge-subrequests`],output_type:d(p[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(p[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(p[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(p[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(p[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:p[`output-options-sample-rate`],timestamp_format:d(p[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountJobs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function S(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:S,handler:async l=>c({command:`logpush account-jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(l[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();if(u===`zones`?l.zoneId=d:l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the Logpush job.`})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.logpush.accountJobs.delete({account_or_zone:u,account_or_zone_id:d,job_id:l[`job-id`]})),{successLabel:`Deleted`})})};function w(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:w,handler:async l=>c({command:`logpush account-jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(l[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountJobs.get({account_or_zone:u,account_or_zone_id:d,job_id:l[`job-id`]})),{successLabel:`Loaded`})})};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Lists Logpush jobs for an account or zone.`,builder:E,handler:async l=>c({command:`logpush account-jobs list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf logpush account-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.logpush.accountJobs.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function O(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`filter-attack-traffic`,{type:`boolean`,description:"When true, excludes DDoS attack traffic from logs. This option is supported for the `http_requests`, `firewall_events`, and `network_analytics_logs` datasets."}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Specifies the sampling rate as a floating number greater than 0 and at most 1. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:O,handler:async f=>c({command:`logpush account-jobs update`,classification:{safeFlags:[`enabled`,`filter-attack-traffic`,`frequency`,`kind`,`output-options-cve-2021-44228`,`output-options-merge-subrequests`,`output-options-output-type`,`output-options-timestamp-format`,`dry-run`]}},f,async()=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/jobs/${f[`job-id`]==null?`<job-id>`:encodeURIComponent(String(f[`job-id`]))}`,pathParams:{"account-or-zone":String(t),"job-id":String(f[`job-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?u({destination_conf:d(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:d(f.filter,`filter`,`text`),filter_attack_traffic:f[`filter-attack-traffic`],frequency:d(f.frequency,`frequency`,`text`),kind:d(f.kind,`kind`,`text`),logpull_options:d(f[`logpull-options`],`logpull-options`,`text`),name:d(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:d(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(f[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:f[`output-options-field-names`],merge_subrequests:f[`output-options-merge-subrequests`],output_type:d(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:d(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(f[`ownership-challenge`],`ownership-challenge`,`text`)}):l(f.body)});return}let c=await i(f),p=f.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:f.zone},c,{quiet:f.quiet}):f.local?e:await t();if(p===`zones`?f.zoneId=m:f.accountId=m,f.body){let e=l(f.body);a(await s(`Updating`,async()=>c.logpush.accountJobs.update({...e,account_or_zone:p,account_or_zone_id:m,job_id:f[`job-id`]})),{successLabel:`Updated`});return}let h=u({destination_conf:d(f[`destination-conf`],`destination-conf`,`text`),enabled:f.enabled,filter:d(f.filter,`filter`,`text`),filter_attack_traffic:f[`filter-attack-traffic`],frequency:d(f.frequency,`frequency`,`text`),kind:d(f.kind,`kind`,`text`),logpull_options:d(f[`logpull-options`],`logpull-options`,`text`),name:d(f.name,`name`,`text`),output_options:{"CVE-2021-44228":f[`output-options-cve-2021-44228`],batch_prefix:d(f[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(f[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(f[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:f[`output-options-field-names`],merge_subrequests:f[`output-options-merge-subrequests`],output_type:d(f[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(f[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(f[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(f[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(f[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:f[`output-options-sample-rate`],timestamp_format:d(f[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(f[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Updating`,async()=>c.logpush.accountJobs.update({...h,account_or_zone:p,account_or_zone_id:m,job_id:f[`job-id`]})),{successLabel:`Updated`})})},A={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:j,handler:async p=>c({command:`logpush account-ownership create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/ownership`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountOwnership.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountOwnership.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function N(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:N,handler:async p=>c({command:`logpush account-ownership validate create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/ownership/validate`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountOwnership.validate.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),p[`ownership-challenge`]===void 0&&(p[`ownership-challenge`]=await f(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(p[`ownership-challenge`],`ownership-challenge`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountOwnership.validate.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},F={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(M).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:L,handler:async p=>c({command:`logpush account-validate destination-exists-delete`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/validate/destination/exists`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountValidate.destinationExistsDelete({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountValidate.destinationExistsDelete({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function z(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`delete`,describe:`Validates destination.`,builder:z,handler:async p=>c({command:`logpush account-validate destination delete`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/validate/destination`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountValidate.destination.delete({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`destination-conf`]===void 0&&(p[`destination-conf`]=await f(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let g=u({destination_conf:d(p[`destination-conf`],`destination-conf`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountValidate.destination.delete({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},te={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:V,handler:async p=>c({command:`logpush account-validate origin create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logpush/validate/origin`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({logpull_options:d(p[`logpull-options`],`logpull-options`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await t();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.logpush.accountValidate.origin.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`logpull-options`]===void 0&&(p[`logpull-options`]=await f(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let g=u({logpull_options:d(p[`logpull-options`],`logpull-options`,`text`)});a(await s(`Creating`,async()=>c.logpush.accountValidate.origin.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},U={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(R).command(te).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`fields`,{type:`string`,description:`Comma-separated list of fields.`}).option(`filter`,{type:`string`,description:`Filters to drill down into specific events.`}).option(`sample`,{type:`number`,description:`The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:G,handler:async e=>c({command:`logpush edge create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.logpush.edge.create({...r,zone_id:n})),{successLabel:`Created`});return}let c=u({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample});a(await s(`Creating`,async()=>t.logpush.edge.create({...c,zone_id:n})),{successLabel:`Created`})})};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:q,handler:async e=>c({command:`logpush edge get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf logpush edge get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.logpush.edge.get({zone_id:n})),{successLabel:`Loaded`})})},Y={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`version-id`,{type:`number`,description:`Specific version ID to retrieve. When omitted, the latest version is returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <transformer-id>`,describe:"Returns the SQL query content for a transformer. Without query params, returns the latest version. With `version_id`, returns the specified version.",builder:X,handler:async r=>c({command:`logpush transformers content get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={version_id:r[`version-id`]};if(r.dryRun){o({command:`cf logpush transformers content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}/content`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.logpush.transformers.content.get({account_id:u,transformer_id:r[`transformer-id`],...c})),{successLabel:`Loaded`})})},Q={command:`content`,describe:`Operations for transformers.content`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`code`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`description`,{type:`string`,description:`Optional customer-provided description.`}).option(`name`,{type:`string`,description:`Customer-provided name for identification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`create`,describe:`Creates a new custom log transformer for an account.`,builder:ne,handler:async r=>c({command:`logpush transformers create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.logpush.transformers.create({...e,account_id:p})),{successLabel:`Created`});return}r.code===void 0&&(r.code=await f(`code`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`)),r.name===void 0&&(r.name=await f(`name`,`Customer-provided name for identification.`));let m=u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.logpush.transformers.create({...m,account_id:p})),{successLabel:`Created`})})};function ie(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ae={command:`delete <transformer-id>`,describe:`Deletes a custom log transformer. Returns 409 Conflict if any active logpush jobs reference the transformer.`,builder:ie,handler:async r=>c({command:`logpush transformers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.logpush.transformers.delete({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Deleted`})})};function oe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <transformer-id>`,describe:`Gets a single custom log transformer by ID.`,builder:oe,handler:async r=>c({command:`logpush transformers get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.transformers.get({account_id:l,transformer_id:r[`transformer-id`]})),{successLabel:`Loaded`})})};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`Lists all custom log transformers for an account.`,builder:ce,handler:async r=>c({command:`logpush transformers list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.logpush.transformers.list({account_id:l})),{successLabel:`Loaded`})})};function ue(e){return e.option(`sql`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`preview`,describe:`Executes a SQL transformer against a single input record and returns the transformed output. This is a stateless endpoint — nothing is persisted.`,builder:ue,handler:async r=>c({command:`logpush transformers preview`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/preview`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({sql:d(r.sql,`sql`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Loading`,async()=>c.logpush.transformers.preview({...e,account_id:p})),{successLabel:`Loaded`});return}r.sql===void 0&&(r.sql=await f(`sql`,`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`));let m=u({sql:d(r.sql,`sql`,`text`)});a(await s(`Loading`,async()=>c.logpush.transformers.preview({...m,account_id:p})),{successLabel:`Loaded`})})};function fe(e){return e.positional(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`code`,{type:`string`,description:`The SQL transformer query. Maximum 32 KB. The query must contain a FROM clause referencing a valid logpush dataset.`}).option(`description`,{type:`string`,description:`Optional customer-provided description.`}).option(`name`,{type:`string`,description:`Customer-provided name for identification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pe={command:`update <transformer-id>`,describe:"Updates an existing custom log transformer. When `code` is provided, the SQL query is validated and a new version is created. When `code` is omitted, only the name and description are updated. Omitting `description` clears the existing description.",builder:fe,handler:async r=>c({command:`logpush transformers update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf logpush transformers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.logpush.transformers.update({...e,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await f(`name`,`Customer-provided name for identification.`));let m=u({code:d(r.code,`code`,`text`),description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.logpush.transformers.update({...m,account_id:p,transformer_id:r[`transformer-id`]})),{successLabel:`Updated`})})};function $(e){return e.option(`transformer-id`,{type:`string`,description:`The transformer ID.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Maximum number of versions to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Returns version metadata for a transformer, newest first. Each version corresponds to a SQL query update.`,builder:$,handler:async r=>c({command:`logpush transformers versions list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit};if(r.dryRun){o({command:`cf logpush transformers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logpush/transformers/${r[`transformer-id`]==null?`<transformer-id>`:encodeURIComponent(String(r[`transformer-id`]))}/versions`,pathParams:{"transformer-id":String(r[`transformer-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.logpush.transformers.versions.list({account_id:u,transformer_id:r[`transformer-id`],...c})),{successLabel:`Loaded`})})},he={command:`versions`,describe:`Operations for transformers.versions`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`transformers`,describe:`Operations for transformers`,builder:e=>e.command(re).command(ae).command(se).command(le).command(de).command(pe).command(Q).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`logpush`,describe:`logpush`,builder:e=>e.command(y).command(A).command(I).command(W).command(Y).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{_e as default};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{a as i,r as a}from"./auth-DWxtJ918.mjs";import{t as o}from"./output-Z2lQmPUW.mjs";import{t as s}from"./dry-run-YSQndLvt.mjs";import{t as c}from"./progress-a5IKeKni.mjs";import{t as l}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as u,r as d,t as f}from"./body-parser-Cmw7PZ7a.mjs";import{n as p,t as m}from"./input-validation-nF-0Ze2h.mjs";import{a as h,n as g}from"./prompt-BP8XrQSj.mjs";import{t as _}from"./cli-types-abvWQN3T.mjs";function v(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 y={command:`create`,describe:`Updates CMB config.`,builder:v,handler:async r=>l({command:`logs control cmb config create`,classification:{safeFlags:[`allow-out-of-region-access`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf logs control cmb config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:p(r.regions,`regions`,`text`)}):u(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:e,account_id:l})),{successLabel:`Created`});return}let d=f({allow_out_of_region_access:r[`allow-out-of-region-access`],regions:p(r.regions,`regions`,`text`)});o(await c(`Creating`,async()=>i.logs.control.cmb.config.create({body:d,account_id:l})),{successLabel:`Created`})})};function b(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 x={command:`delete`,describe:`Deletes CMB config.`,builder:b,handler:async r=>l({command:`logs control cmb config delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf logs control cmb config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`This operation deletes the CMB config.`})){process.stderr.write(`Aborted.
3
+ `);return}o(await c(`Deleting`,async()=>i.logs.control.cmb.config.delete({account_id:l})),{successLabel:`Deleted`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Gets CMB config.`,builder:S,handler:async r=>l({command:`logs control cmb config get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf logs control cmb config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.logs.control.cmb.config.get({account_id:l})),{successLabel:`Loaded`})})},w={command:`config`,describe:`Operations for control.cmb.config`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(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 D={command:`create`,describe:`Updates log retention flag for Logpull API.`,builder:E,handler:async e=>l({command:`logs control retention create`,classification:{safeFlags:[`flag`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf logs control retention create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({flag:e.flag}):u(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=u(e.body);o(await c(`Creating`,async()=>t.logs.control.retention.create({body:r,zone_id:n})),{successLabel:`Created`});return}let i=f({flag:e.flag});o(await c(`Creating`,async()=>t.logs.control.retention.create({body:i,zone_id:n})),{successLabel:`Created`})})};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:O,handler:async e=>l({command:`logs control retention get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf logs control retention get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.logs.control.retention.get({zone_id:n})),{successLabel:`Loaded`})})},A={command:`retention`,describe:`Operations for control.retention`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`control`,describe:`Log control operations`,builder:e=>e.command(T).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})}const N={command:`available`,describe:`Returns all dataset types that this account or zone can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account or zone. When creating or updating a dataset, only fields available to your account or zone can be enabled. If you request a field that is not available, you will receive an error.`,builder:M,handler:async i=>l({command:`logs datasets available`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logs datasets available`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/available`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.logs.datasets.available({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function P(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`fields`,{type:`string`,description:`Controls which fields the API ingests. Defaults to all available
4
+ fields when absent.
5
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are ingested.
6
+ If provided, replaces the dataset's default filter entirely.
7
+ See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
8
+ for syntax and examples.
9
+ `}).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 Log Explorer dataset for the account or zone. List available account or zone datasets to see the dataset types and fields you can use. The `fields` property is optional. If not specified, all available fields will be enabled. For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:P,handler:async i=>l({command:`logs datasets create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logs datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?f({dataset:p(i.dataset,`dataset`,`text`),fields:d(i.fields,`fields`),filter:p(i.filter,`filter`,`text`)}):u(i.body)});return}let l=await a(i),m=i.zone===void 0?`accounts`:`zones`,g=m===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(m===`zones`?i.zoneId=g:i.accountId=g,i.body){let e=u(i.body);o(await c(`Creating`,async()=>l.logs.datasets.create({...e,account_or_zone:m,account_or_zone_id:g})),{successLabel:`Created`});return}i.dataset===void 0&&(i.dataset=await h(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let _=f({dataset:p(i.dataset,`dataset`,`text`),fields:d(i.fields,`fields`),filter:p(i.filter,`filter`,`text`)});o(await c(`Creating`,async()=>l.logs.datasets.create({..._,account_or_zone:m,account_or_zone_id:g})),{successLabel:`Created`})})};function I(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset 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 <dataset-id>`,describe:`Deletes a Log Explorer dataset for the account or zone. Dataset deletion must not be protected.`,builder:I,handler:async i=>l({command:`logs datasets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logs datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"dataset-id":String(i[`dataset-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await g({force:!!i.force,message:`This operation deletes a Log Explorer dataset for the account.`})){process.stderr.write(`Aborted.
10
+ `);return}o(await c(`Deleting`,async()=>l.logs.datasets.delete({account_or_zone:u,account_or_zone_id:d,dataset_id:i[`dataset-id`]})),{successLabel:`Deleted`})})};function R(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,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:`Retrieve a single Log Explorer dataset by ID for the account or zone.`,builder:R,handler:async i=>l({command:`logs datasets get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logs datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"dataset-id":String(i[`dataset-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.logs.datasets.get({account_or_zone:u,account_or_zone_id:d,dataset_id:i[`dataset-id`]})),{successLabel:`Loaded`})})};function z(e){return e.option(`include-zones`,{type:`boolean`,description:`Set to true to include zone-scoped datasets belonging to this account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:"Returns all Log Explorer datasets configured for the account or zone. Pass `include_zones=true` to also include zone-level datasets that belong to this account or zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:z,handler:async i=>l({command:`logs datasets list`,classification:{safeFlags:[`include-zones`,`dry-run`]}},i,async()=>{let l={include_zones:i[`include-zones`]};if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logs datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.logs.datasets.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function V(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`deletion-protection`,{type:`boolean`,description:"Set to `false` to allow deletion of this dataset."}).option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).option(`fields`,{type:`string`,description:`Controls which fields the API ingests after the update. Defaults
11
+ to all available fields when absent.
12
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are
13
+ ingested. If omitted, the existing filter is left unchanged. Set
14
+ to an empty string (\`""\`) to clear the filter. Otherwise,
15
+ replaces the dataset's filter entirely.
16
+ See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
17
+ for syntax and examples.
18
+ `}).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:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of an account or zone dataset.`,builder:V,handler:async i=>l({command:`logs datasets update`,classification:{safeFlags:[`deletion-protection`,`enabled`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logs datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"dataset-id":String(i[`dataset-id`]??``)},bodyKind:`json`,body:i.body===void 0?f({deletion_protection:i[`deletion-protection`],enabled:i.enabled,fields:d(i.fields,`fields`),filter:p(i.filter,`filter`,`text`)}):u(i.body)});return}let l=await a(i),m=i.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(m===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=u(i.body);o(await c(`Updating`,async()=>l.logs.datasets.update({...e,account_or_zone:m,account_or_zone_id:h,dataset_id:i[`dataset-id`]})),{successLabel:`Updated`});return}if(i.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let g=f({deletion_protection:i[`deletion-protection`],enabled:i.enabled,fields:d(i.fields,`fields`),filter:p(i.filter,`filter`,`text`)});o(await c(`Updating`,async()=>l.logs.datasets.update({...g,account_or_zone:m,account_or_zone_id:h,dataset_id:i[`dataset-id`]})),{successLabel:`Updated`})})},U={command:`datasets`,describe:`Operations for datasets`,builder:e=>e.command(N).command(F).command(L).command(ee).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(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 G={command:`get`,describe:`Lists R2 objects containing logs matching the provided query parameters.`,builder:W,handler:async r=>l({command:`logs list get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let l={start:r.start,end:r.end,bucket:r.bucket,prefix:r.prefix,limit:r.limit},u={};if(r[`r2-access-key-id`]!==void 0&&(u[`R2-Access-Key-Id`]=String(r[`r2-access-key-id`])),r[`r2-secret-access-key`]!==void 0&&(u[`R2-Secret-Access-Key`]=String(r[`r2-secret-access-key`])),r.dryRun){s({command:`cf logs list get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/list`,pathParams:{},query:l,bodyKind:`none`});return}let d=await a(r),f=r.local?e:await t();r.accountId=f,o(await c(`Loading`,async()=>i(d,`GET`,`/accounts/${f}/logs/list`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},K={command:`list`,describe:`Operations for list`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const J={command:`query`,describe:`Run a SQL query against account or zone-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' List configured account or zone datasets to see enabled account or zone-level datasets. Zone-level datasets will not appear here. List available account or zone datasets to inspect their schemas and timestamp fields. For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:q,handler:async u=>l({command:`logs query`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;s({command:`cf logs query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/query/sql`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`octet-stream`,body:u.body});return}let l=await a(u),d=u.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:u.zone},l,{quiet:u.quiet}):u.local?e:await t();if(d===`zones`?u.zoneId=f:u.accountId=f,u.file){let e=m(u.file);o(await c(`Loading`,async()=>i(l,`POST`,`/${d}/${f}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}if(u.body){let e=p(u.body,`body`,`binary`);o(await c(`Loading`,async()=>i(l,`POST`,`/${d}/${f}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}o(await c(`Loading`,async()=>l.logs.query({account_or_zone:d,account_or_zone_id:f})),{successLabel:`Loaded`})})};function Y(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 X={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:_(Y),handler:async e=>l({command:`logs rayid get`,classification:{safeFlags:[`timestamps`,`dry-run`]}},e,async()=>{let t={fields:e.fields,timestamps:e.timestamps};if(e.dryRun){s({command:`cf logs rayid get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/rayids/${e[`ray-id`]==null?`<ray-id>`:encodeURIComponent(String(e[`ray-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"ray-id":String(e[`ray-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.logs.rayid.get({zone_id:i,ray_id:e[`ray-id`],...t})),{successLabel:`Loaded`})})},Z={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={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:Q,handler:async e=>l({command:`logs received fields get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf logs received fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received/fields`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.logs.received.fields.get({zone_id:n})),{successLabel:`Loaded`})})},te={command:`fields`,describe:`Operations for received.fields`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(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 re={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:_(ne),handler:async e=>l({command:`logs received get`,classification:{safeFlags:[`timestamps`,`dry-run`]}},e,async()=>{let t={start:e.start,end:e.end,fields:e.fields,sample:e.sample,count:e.count,timestamps:e.timestamps};if(e.dryRun){s({command:`cf logs received get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.logs.received.get({zone_id:i,...t})),{successLabel:`Loaded`})})},ie={command:`received`,describe:`Received log operations`,builder:e=>e.command(re).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(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 oe={command:`get`,describe:`Returns logs stored in R2 that match the provided query parameters.`,builder:ae,handler:async r=>l({command:`logs retrieve get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let l={start:r.start,end:r.end,bucket:r.bucket,prefix:r.prefix},u={};if(r[`r2-access-key-id`]!==void 0&&(u[`R2-Access-Key-Id`]=String(r[`r2-access-key-id`])),r[`r2-secret-access-key`]!==void 0&&(u[`R2-Secret-Access-Key`]=String(r[`r2-secret-access-key`])),r.dryRun){s({command:`cf logs retrieve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/retrieve`,pathParams:{},query:l,bodyKind:`none`});return}let d=await a(r),f=r.local?e:await t();r.accountId=f,o(await c(`Loading`,async()=>i(d,`GET`,`/accounts/${f}/logs/retrieve`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},se={command:`retrieve`,describe:`Operations for retrieve`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(J).command(j).command(U).command(K).command(Z).command(ie).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ce as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p,i as m,n as h}from"./prompt-DjRTpML4.mjs";import{t as g}from"./cli-types-CrSoSMPF.mjs";import{n as _,t as v}from"./raw-fetch-BVYQR6C5.mjs";function ee(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:ee,handler:async h=>c({command:`magic-cloud-networking catalog-syncs create`,classification:{safeFlags:[`destination-type`,`update-mode`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({description:f(h.description,`description`,`text`),destination_type:f(h[`destination-type`],`destination-type`,`text`),name:f(h.name,`name`,`text`),policy:f(h.policy,`policy`,`text`),update_mode:f(h[`update-mode`],`update-mode`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}h[`destination-type`]===void 0&&(h[`destination-type`]=await m(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),h.name===void 0&&(h.name=await p(`name`,`The name field`)),h[`update-mode`]===void 0&&(h[`update-mode`]=await m(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`destination-type`]!==void 0&&l(v,[`destination_type`],f(h[`destination-type`],`destination-type`,`text`)),h.name!==void 0&&l(v,[`name`],f(h.name,`name`,`text`)),h.policy!==void 0&&l(v,[`policy`],f(h.policy,`policy`,`text`)),h[`update-mode`]!==void 0&&l(v,[`update_mode`],f(h[`update-mode`],`update-mode`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function y(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:y,handler:async r=>c({command:`magic-cloud-networking catalog-syncs delete`,classification:{safeFlags:[`delete-destination`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{let c={delete_destination:r[`delete-destination`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await h({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as l,n as u,t as d}from"./body-parser-Cmw7PZ7a.mjs";import{n as f}from"./input-validation-nF-0Ze2h.mjs";import{a as p,i as m,n as h}from"./prompt-BP8XrQSj.mjs";import{t as g}from"./cli-types-abvWQN3T.mjs";import{n as _,t as v}from"./raw-fetch-DNH2V8qH.mjs";function ee(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:ee,handler:async h=>c({command:`magic-cloud-networking catalog-syncs create`,classification:{safeFlags:[`destination-type`,`update-mode`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({description:f(h.description,`description`,`text`),destination_type:f(h[`destination-type`],`destination-type`,`text`),name:f(h.name,`name`,`text`),policy:f(h.policy,`policy`,`text`),update_mode:f(h[`update-mode`],`update-mode`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}h[`destination-type`]===void 0&&(h[`destination-type`]=await m(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),h.name===void 0&&(h.name=await p(`name`,`The name field`)),h[`update-mode`]===void 0&&(h[`update-mode`]=await m(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`destination-type`]!==void 0&&l(v,[`destination_type`],f(h[`destination-type`],`destination-type`,`text`)),h.name!==void 0&&l(v,[`name`],f(h.name,`name`,`text`)),h.policy!==void 0&&l(v,[`policy`],f(h.policy,`policy`,`text`)),h[`update-mode`]!==void 0&&l(v,[`update_mode`],f(h[`update-mode`],`update-mode`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function y(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:y,handler:async r=>c({command:`magic-cloud-networking catalog-syncs delete`,classification:{safeFlags:[`delete-destination`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{let c={delete_destination:r[`delete-destination`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await h({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>l.magicCloudNetworking.catalogSyncs.delete({account_id:u,sync_id:r[`sync-id`],...c})),{successLabel:`Deleted`})})};function x(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:x,handler:async r=>c({command:`magic-cloud-networking catalog-syncs edit`,classification:{safeFlags:[`update-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:p,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`})})};function C(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:C,handler:async r=>c({command:`magic-cloud-networking catalog-syncs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.get({account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Loaded`})})};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:T,handler:async r=>c({command:`magic-cloud-networking catalog-syncs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.list({account_id:l})),{successLabel:`Loaded`})})};function D(e){return e.option(`destination-type`,{type:`string`,description:`Specify type of destination, omit to return all.`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:g(D),handler:async r=>c({command:`magic-cloud-networking catalog-syncs prebuilt-policies list`,classification:{safeFlags:[`destination-type`,`dry-run`]}},r,async()=>{let c={destination_type:r[`destination-type`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs prebuilt-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/prebuilt-policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({account_id:u,...c})),{successLabel:`Loaded`})})},k={command:`prebuilt-policies`,describe:`Operations for catalog-syncs.prebuilt-policies`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:A,handler:async r=>c({command:`magic-cloud-networking catalog-syncs refresh`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}/refresh`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.catalogSyncs.refresh({account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Created`})})};function M(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:M,handler:async r=>c({command:`magic-cloud-networking catalog-syncs update`,classification:{safeFlags:[`update-mode`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:e,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=d({description:f(r.description,`description`,`text`),name:f(r.name,`name`,`text`),policy:f(r.policy,`policy`,`text`),update_mode:f(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:p,account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Updated`})})},P={command:`catalog-syncs`,describe:`Operations for catalog-syncs`,builder:e=>e.command(te).command(b).command(S).command(w).command(E).command(j).command(N).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:F,handler:async h=>c({command:`magic-cloud-networking cloud-integrations create`,classification:{safeFlags:[`cloud-type`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking cloud-integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({cloud_type:f(h[`cloud-type`],`cloud-type`,`text`),description:f(h.description,`description`,`text`),friendly_name:f(h[`friendly-name`],`friendly-name`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}h[`cloud-type`]===void 0&&(h[`cloud-type`]=await m(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),h[`friendly-name`]===void 0&&(h[`friendly-name`]=await p(`friendly-name`,`The friendly_name field`));let v={};h[`cloud-type`]!==void 0&&l(v,[`cloud_type`],f(h[`cloud-type`],`cloud-type`,`text`)),h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`friendly-name`]!==void 0&&l(v,[`friendly_name`],f(h[`friendly-name`],`friendly-name`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function L(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const R={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:L,handler:async r=>c({command:`magic-cloud-networking cloud-integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.magicCloudNetworking.cloudIntegrations.delete({account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Deleted`})})};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:z,handler:async r=>c({command:`magic-cloud-networking cloud-integrations discover-all`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations discover-all`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/discover`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.cloudIntegrations.discoverAll({account_id:l})),{successLabel:`Created`})})};function V(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:V,handler:async r=>c({command:`magic-cloud-networking cloud-integrations discover`,classification:{safeFlags:[`v2`,`dry-run`]}},r,async()=>{let c={v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations discover`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}/discover`,pathParams:{"provider-id":String(r[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Creating`,async()=>l.magicCloudNetworking.cloudIntegrations.discover({account_id:u,provider_id:r[`provider-id`],...c})),{successLabel:`Created`})})};function U(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:U,handler:async r=>c({command:`magic-cloud-networking cloud-integrations edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:p,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`})})};function G(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:G,handler:async r=>c({command:`magic-cloud-networking cloud-integrations get`,classification:{safeFlags:[`status`,`dry-run`]}},r,async()=>{let c={status:r.status};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.get({account_id:u,provider_id:r[`provider-id`],...c})),{successLabel:`Loaded`})})};function q(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:q,handler:async r=>c({command:`magic-cloud-networking cloud-integrations initial-setup`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations initial-setup`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}/initial_setup`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.cloudIntegrations.initialSetup({account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Loaded`})})};function Y(e){return e.option(`status`,{type:`boolean`,description:`Status`}).option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:Y,handler:async r=>c({command:`magic-cloud-networking cloud-integrations list`,classification:{safeFlags:[`status`,`desc`,`cloudflare`,`dry-run`]}},r,async()=>{let c={status:r.status,order_by:r[`order-by`],desc:r.desc,cloudflare:r.cloudflare};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Z(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:Z,handler:async r=>c({command:`magic-cloud-networking cloud-integrations update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=d({aws_arn:f(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:f(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:f(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:f(r.description,`description`,`text`),friendly_name:f(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:f(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:f(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:p,account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Updated`})})},ne={command:`cloud-integrations`,describe:`Operations for cloud-integrations`,builder:e=>e.command(I).command(R).command(H).command(B).command(W).command(K).command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:re,handler:async r=>c({command:`magic-cloud-networking on-ramps address-spaces edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({prefixes:r.prefixes}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=d({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:f,account_id:l})),{successLabel:`Updated`})})};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ae,handler:async r=>c({command:`magic-cloud-networking on-ramps address-spaces list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.list({account_id:l})),{successLabel:`Loaded`})})};function se(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:se,handler:async r=>c({command:`magic-cloud-networking on-ramps address-spaces update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({prefixes:r.prefixes}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=d({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:f,account_id:l})),{successLabel:`Updated`})})},le={command:`address-spaces`,describe:`Operations for on-ramps.address-spaces`,builder:e=>e.command(ie).command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:ue,handler:async r=>c({command:`magic-cloud-networking on-ramps apply`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps apply`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/apply`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.onRamps.apply({account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Created`})})};function fe(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`adopted-hub-id`,{type:`string`,description:`The adopted_hub_id field`}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`cloud-asn`,{type:`number`,description:`Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect.`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`dynamic-routing`,{type:`boolean`,description:`Enables BGP routing. When enabling this feature, set both install_routes_in_cloud and install_routes_in_magic_wan to false.`}).option(`hub-provider-id`,{type:`string`,description:`The hub_provider_id field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`region`,{type:`string`,description:`The region field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`OnrampTypeSingle`,`OnrampTypeHub`]}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:fe,handler:async h=>c({command:`magic-cloud-networking on-ramps create`,classification:{safeFlags:[`cloud-type`,`dynamic-routing`,`install-routes-in-cloud`,`install-routes-in-magic-wan`,`manage-hub-to-hub-attachments`,`manage-vpc-to-hub-attachments`,`type`,`dry-run`]}},h,async()=>{let c={};if(h.forwarded!==void 0&&(c.forwarded=String(h.forwarded)),h.dryRun){o({command:`cf magic-cloud-networking on-ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},bodyKind:`json`,body:h.body===void 0?d({adopted_hub_id:f(h[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:h[`attached-hubs`],attached_vpcs:h[`attached-vpcs`],cloud_asn:h[`cloud-asn`],cloud_type:f(h[`cloud-type`],`cloud-type`,`text`),description:f(h.description,`description`,`text`),dynamic_routing:h[`dynamic-routing`],hub_provider_id:f(h[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:h[`install-routes-in-cloud`],install_routes_in_magic_wan:h[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:h[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:h[`manage-vpc-to-hub-attachments`],name:f(h.name,`name`,`text`),region:f(h.region,`region`,`text`),type:f(h.type,`type`,`text`),vpc:f(h.vpc,`vpc`,`text`)}):u(h.body)});return}let g=await i(h),_=h.local?e:await t();if(h.accountId=_,h.body){let e=u(h.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(h[`cloud-type`]===void 0&&(h[`cloud-type`]=await m(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),h[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(h[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(h[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);h.name===void 0&&(h.name=await p(`name`,`The name field`)),h.type===void 0&&(h.type=await m(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};h[`adopted-hub-id`]!==void 0&&l(v,[`adopted_hub_id`],f(h[`adopted-hub-id`],`adopted-hub-id`,`text`)),h[`attached-hubs`]!==void 0&&l(v,[`attached_hubs`],h[`attached-hubs`]),h[`attached-vpcs`]!==void 0&&l(v,[`attached_vpcs`],h[`attached-vpcs`]),h[`cloud-asn`]!==void 0&&l(v,[`cloud_asn`],h[`cloud-asn`]),h[`cloud-type`]!==void 0&&l(v,[`cloud_type`],f(h[`cloud-type`],`cloud-type`,`text`)),h.description!==void 0&&l(v,[`description`],f(h.description,`description`,`text`)),h[`dynamic-routing`]!==void 0&&l(v,[`dynamic_routing`],h[`dynamic-routing`]),h[`hub-provider-id`]!==void 0&&l(v,[`hub_provider_id`],f(h[`hub-provider-id`],`hub-provider-id`,`text`)),h[`install-routes-in-cloud`]!==void 0&&l(v,[`install_routes_in_cloud`],h[`install-routes-in-cloud`]),h[`install-routes-in-magic-wan`]!==void 0&&l(v,[`install_routes_in_magic_wan`],h[`install-routes-in-magic-wan`]),h[`manage-hub-to-hub-attachments`]!==void 0&&l(v,[`manage_hub_to_hub_attachments`],h[`manage-hub-to-hub-attachments`]),h[`manage-vpc-to-hub-attachments`]!==void 0&&l(v,[`manage_vpc_to_hub_attachments`],h[`manage-vpc-to-hub-attachments`]),h.name!==void 0&&l(v,[`name`],f(h.name,`name`,`text`)),h.region!==void 0&&l(v,[`region`],f(h.region,`region`,`text`)),h.type!==void 0&&l(v,[`type`],f(h.type,`type`,`text`)),h.vpc!==void 0&&l(v,[`vpc`],f(h.vpc,`vpc`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function me(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`destroy`,{type:`boolean`,description:`Destroy`}).option(`force`,{type:`boolean`,description:`Force`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:me,handler:async r=>c({command:`magic-cloud-networking on-ramps delete`,classification:{safeFlags:[`destroy`,`force`,`dry-run`]}},r,async()=>{let c={destroy:r.destroy,force:r.force};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await h({force:!!r.force})){process.stderr.write(`Aborted.
5
5
  `);return}a(await s(`Deleting`,async()=>l.magicCloudNetworking.onRamps.delete({account_id:u,onramp_id:r[`onramp-id`],...c})),{successLabel:`Deleted`})})};function ge(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:ge,handler:async r=>c({command:`magic-cloud-networking on-ramps edit`,classification:{safeFlags:[`install-routes-in-cloud`,`install-routes-in-magic-wan`,`manage-hub-to-hub-attachments`,`manage-vpc-to-hub-attachments`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:e,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:p,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})})};function ve(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ye={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:ve,handler:async r=>c({command:`magic-cloud-networking on-ramps export`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/export`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a;let c=await s(`Loading`,async()=>v(`/accounts/${a}/magic/cloud/onramps/${encodeURIComponent(String(r[`onramp-id`]))}/export`,{method:`POST`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?c.toString(`utf-8`):c)})};function be(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`post-apply-resources`,{type:`boolean`,description:`Post apply resources`}).option(`planned-resources`,{type:`boolean`,description:`Planned resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:be,handler:async r=>c({command:`magic-cloud-networking on-ramps get`,classification:{safeFlags:[`status`,`vpcs`,`post-apply-resources`,`planned-resources`,`dry-run`]}},r,async()=>{let c={status:r.status,vpcs:r.vpcs,post_apply_resources:r[`post-apply-resources`],planned_resources:r[`planned-resources`]};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.onRamps.get({account_id:u,onramp_id:r[`onramp-id`],...c})),{successLabel:`Loaded`})})};function Se(e){return e.option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:Se,handler:async r=>c({command:`magic-cloud-networking on-ramps list`,classification:{safeFlags:[`desc`,`status`,`vpcs`,`dry-run`]}},r,async()=>{let c={order_by:r[`order-by`],desc:r.desc,status:r.status,vpcs:r.vpcs};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.onRamps.list({account_id:u,...c})),{successLabel:`Loaded`})})};function we(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:we,handler:async r=>c({command:`magic-cloud-networking on-ramps plan`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/plan`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.onRamps.plan({account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Created`})})};function Ee(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const De={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Ee,handler:async r=>c({command:`magic-cloud-networking on-ramps update`,classification:{safeFlags:[`install-routes-in-cloud`,`install-routes-in-magic-wan`,`manage-hub-to-hub-attachments`,`manage-vpc-to-hub-attachments`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:e,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=d({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:f(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:f(r.name,`name`,`text`),vpc:f(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:p,account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})})},$={command:`on-ramps`,describe:`Operations for on-ramps`,builder:e=>e.command(de).command(pe).command(he).command(_e).command(ye).command(xe).command(Ce).command(Te).command(De).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ke={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:Oe,handler:async r=>c({command:`magic-cloud-networking resources export`,classification:{safeFlags:[`desc`,`v2`,`dry-run`,`text`]}},r,async()=>{let a={provider_id:r[`provider-id`],resource_type:r[`resource-type`],resource_id:r[`resource-id`],region:r.region,resource_group:r[`resource-group`],search:r.search,order_by:r[`order-by`],desc:r.desc,v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/export`,pathParams:{},query:a,bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>v(`/accounts/${c}/magic/cloud/resources/export${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?u.toString(`utf-8`):u)})};function Ae(e){return e.positional(`resource-id`,{type:`string`,description:`Resource ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:Ae,handler:async r=>c({command:`magic-cloud-networking resources get`,classification:{safeFlags:[`v2`,`dry-run`]}},r,async()=>{let c={v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/${r[`resource-id`]==null?`<resource-id>`:encodeURIComponent(String(r[`resource-id`]))}`,pathParams:{"resource-id":String(r[`resource-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.resources.get({account_id:u,resource_id:r[`resource-id`],...c})),{successLabel:`Loaded`})})};function Me(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`managed`,{type:`boolean`,description:`Managed`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:g(Me),handler:async r=>c({command:`magic-cloud-networking resources list`,classification:{safeFlags:[`managed`,`desc`,`cloudflare`,`v2`,`dry-run`]}},r,async()=>{let c={provider_id:r[`provider-id`],resource_type:r[`resource-type`],resource_id:r[`resource-id`],region:r.region,resource_group:r[`resource-group`],managed:r.managed,search:r.search,order_by:r[`order-by`],desc:r.desc,per_page:r[`per-page`],page:r.page,cloudflare:r.cloudflare,v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.resources.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Pe(e){return e.option(`policy`,{type:`string`,description:`The policy field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Fe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Pe,handler:async r=>c({command:`magic-cloud-networking resources policy-preview`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-cloud-networking resources policy-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/policy-preview`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({policy:f(r.policy,`policy`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...e,account_id:l})),{successLabel:`Created`});return}r.policy===void 0&&(r.policy=await p(`policy`,`The policy field`));let m=d({policy:f(r.policy,`policy`,`text`)});a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...m,account_id:l})),{successLabel:`Created`})})},Ie={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(ke).command(je).command(Ne).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Le={command:`magic-cloud-networking`,describe:`magic-cloud-networking`,builder:e=>e.command(P).command(ne).command($).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Le as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,r as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p,i as m,n as h}from"./prompt-DjRTpML4.mjs";function g(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Create a new network monitoring configuration.`,builder:g,handler:async r=>c({command:`magic-network-monitoring configs create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.magicNetworkMonitoring.configs.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`The account name.`));let h=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Creating`,async()=>c.magicNetworkMonitoring.configs.create({...h,account_id:m})),{successLabel:`Created`})})};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:v,handler:async r=>c({command:`magic-network-monitoring configs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as l,r as u,t as d}from"./body-parser-Cmw7PZ7a.mjs";import{n as f}from"./input-validation-nF-0Ze2h.mjs";import{a as p,i as m,n as h}from"./prompt-BP8XrQSj.mjs";function g(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Create a new network monitoring configuration.`,builder:g,handler:async r=>c({command:`magic-network-monitoring configs create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.magicNetworkMonitoring.configs.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`The account name.`));let h=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Creating`,async()=>c.magicNetworkMonitoring.configs.create({...h,account_id:m})),{successLabel:`Created`})})};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:v,handler:async r=>c({command:`magic-network-monitoring configs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.configs.delete({account_id:l})),{successLabel:`Deleted`})})};function b(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`edit`,describe:`Update fields in an existing network monitoring configuration.`,builder:b,handler:async r=>c({command:`magic-network-monitoring configs edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.edit({...e,account_id:p})),{successLabel:`Updated`});return}let m=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.edit({...m,account_id:p})),{successLabel:`Updated`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists default sampling, router IPs, warp devices, and rules for account.`,builder:S,handler:async r=>c({command:`magic-network-monitoring configs full get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs full get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config/full`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.configs.full.get({account_id:l})),{successLabel:`Loaded`})})},w={command:`full`,describe:`Operations for configs.full`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Lists default sampling, router IPs and warp devices for account.`,builder:T,handler:async r=>c({command:`magic-network-monitoring configs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.configs.get({account_id:l})),{successLabel:`Loaded`})})};function D(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update`,describe:`Update an existing network monitoring configuration, requires the entire configuration to be updated at once.`,builder:D,handler:async r=>c({command:`magic-network-monitoring configs update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.update({...e,account_id:m})),{successLabel:`Updated`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await p(`name`,`The account name.`));let h=d({default_sampling:r[`default-sampling`],name:f(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:u(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.configs.update({...h,account_id:m})),{successLabel:`Updated`})})},k={command:`configs`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(_).command(y).command(x).command(E).command(O).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`edit <rule-id>`,describe:`Update advertisement for rule.`,builder:A,handler:async r=>c({command:`magic-network-monitoring rules advertisements edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules advertisements edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}/advertisement`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.advertisements.edit({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},M={command:`advertisements`,describe:`Operations for rules.advertisements`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`create`,describe:`Create multiple network monitoring rules for account in a single request. Supports up to 100 rules per request. All rules in a single request must be of the same type.`,builder:ee,handler:async u=>c({command:`magic-network-monitoring rules bulk create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){o({command:`cf magic-network-monitoring rules bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/bulk`,pathParams:{},bodyKind:`json`,body:u.body===void 0?void 0:l(u.body)});return}let c=await i(u),d=u.local?e:await t();if(u.accountId=d,u.body){let e=l(u.body);if(Array.isArray(e)&&e.length>100){let t=Math.ceil(e.length/100),n=null;for(let i=0;i<e.length;i+=100){let a=e.slice(i,i+100);n=await s(`Creating: batch ${Math.floor(i/100)+1}/${t}`,async()=>r(c,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Created`});return}a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Created`});return}if(u.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update`,describe:`Update multiple network monitoring rules for account in a single request. Supports up to 100 rules per request. All rules in a single request must be of the same type.`,builder:P,handler:async u=>c({command:`magic-network-monitoring rules bulk update`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){o({command:`cf magic-network-monitoring rules bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/bulk`,pathParams:{},bodyKind:`json`,body:u.body===void 0?void 0:l(u.body)});return}let c=await i(u),d=u.local?e:await t();if(u.accountId=d,u.body){let e=l(u.body);if(Array.isArray(e)&&e.length>100){let t=Math.ceil(e.length/100),n=null;for(let i=0;i<e.length;i+=100){let a=e.slice(i,i+100);n=await s(`Updating: batch ${Math.floor(i/100)+1}/${t}`,async()=>r(c,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Updated`});return}if(u.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},I={command:`bulk`,describe:`Operations for rules.bulk`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`],default:`1m`}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`create`,describe:`Create network monitoring rules for account. Currently only supports creating a single rule per API request.`,builder:L,handler:async r=>c({command:`magic-network-monitoring rules create`,classification:{safeFlags:[`automatic-advertisement`,`duration`,`prefix-match`,`type`,`zscore-sensitivity`,`zscore-target`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.magicNetworkMonitoring.rules.create({body:e,account_id:u})),{successLabel:`Created`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await p(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await m(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Creating`,async()=>c.magicNetworkMonitoring.rules.create({body:h,account_id:u})),{successLabel:`Created`})})};function z(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`delete <rule-id>`,describe:`Delete a network monitoring rule for account.`,builder:z,handler:async r=>c({command:`magic-network-monitoring rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})};function V(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`edit <rule-id>`,describe:`Update a network monitoring rule for account.`,builder:V,handler:async r=>c({command:`magic-network-monitoring rules edit`,classification:{safeFlags:[`automatic-advertisement`,`duration`,`prefix-match`,`type`,`zscore-sensitivity`,`zscore-target`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.edit({body:e,account_id:u,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await p(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await m(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.edit({body:h,account_id:u,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})};function U(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <rule-id>`,describe:`List a single network monitoring rule for account.`,builder:U,handler:async r=>c({command:`magic-network-monitoring rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function G(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`Lists network monitoring rules for account.`,builder:G,handler:async r=>c({command:`magic-network-monitoring rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.rules.list({account_id:l})),{successLabel:`Loaded`})})};function q(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`update`,describe:`Update network monitoring rules for account.`,builder:q,handler:async r=>c({command:`magic-network-monitoring rules update`,classification:{safeFlags:[`automatic-advertisement`,`duration`,`prefix-match`,`type`,`zscore-sensitivity`,`zscore-target`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.update({body:e,account_id:u})),{successLabel:`Updated`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await p(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await m(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=d({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:f(r.duration,`duration`,`text`),name:f(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:f(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:f(r.type,`type`,`text`),zscore_sensitivity:f(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:f(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.update({body:h,account_id:u})),{successLabel:`Updated`})})},Y={command:`rules`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(R).command(B).command(H).command(W).command(K).command(J).command(M).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`create`,describe:`Generate authentication token for VPC flow logs export.`,builder:X,handler:async r=>c({command:`magic-network-monitoring vpc-flows tokens create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-network-monitoring vpc-flows tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/vpc-flows/token`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicNetworkMonitoring.vpcFlows.tokens.create({account_id:l})),{successLabel:`Created`})})},Q={command:`tokens`,describe:`Operations for vpc-flows.tokens`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`vpc-flows`,describe:`Ingest VPC flow logs from cloud providers for network visibility and anomaly detection`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`magic-network-monitoring`,describe:`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,builder:e=>e.command(k).command(Y).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p}from"./input-validation-BxchZ9jE.mjs";import{a as m,i as h,n as g}from"./prompt-DjRTpML4.mjs";import{n as _,t as ee}from"./raw-fetch-BVYQR6C5.mjs";function te(e){return e.option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const v={command:`create`,describe:`Create a DNS Protection rule for an account.`,builder:te,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules create`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:l})),{successLabel:`Created`});return}r[`burst-sensitivity`]===void 0&&(r[`burst-sensitivity`]=await m(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.name===void 0&&(r.name=await m(`name`,`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),r[`profile-sensitivity`]===void 0&&(r[`profile-sensitivity`]=await m(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),r[`rate-sensitivity`]===void 0&&(r[`rate-sensitivity`]=await m(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.scope===void 0&&(r.scope=await m(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let d=f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...d,account_id:l})),{successLabel:`Created`})})};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:y,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-Cmw7PZ7a.mjs";import{n as p}from"./input-validation-nF-0Ze2h.mjs";import{a as m,i as h,n as g}from"./prompt-BP8XrQSj.mjs";import{n as _,t as ee}from"./raw-fetch-DNH2V8qH.mjs";function te(e){return e.option(`block-any-queries`,{type:`boolean`,description:`Whether to block DNS ANY queries. Optional. Defaults to true.`}).option(`burst-sensitivity`,{type:`string`,description:`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`name`,{type:`string`,description:`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`}).option(`profile-sensitivity`,{type:`string`,description:`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`}).option(`scope`,{type:`string`,description:`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new DNS Protection rule to add.`})}const v={command:`create`,describe:`Create a DNS Protection rule for an account.`,builder:te,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules create`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:l})),{successLabel:`Created`});return}r[`burst-sensitivity`]===void 0&&(r[`burst-sensitivity`]=await m(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.name===void 0&&(r.name=await m(`name`,`The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.`)),r[`profile-sensitivity`]===void 0&&(r[`profile-sensitivity`]=await m(`profile-sensitivity`,`The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`)),r[`rate-sensitivity`]===void 0&&(r[`rate-sensitivity`]=await m(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.scope===void 0&&(r.scope=await m(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let d=f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:p(r.name,`name`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:p(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...d,account_id:l})),{successLabel:`Created`})})};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:y,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.for.account({account_id:l})),{successLabel:`Deleted`})})},x={command:`for`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete.for`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`rule <rule-id>`,describe:`Delete a DNS Protection rule specified by the given UUID.`,builder:S,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules delete protection rule`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules delete protection rule`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.delete.protection.rule({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})},w={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete.protection`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`delete`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete`,builder:e=>e.command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <rule-id>`,describe:`Get a DNS Protection rule specified by the given UUID.`,builder:E,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function O(e){return e.option(`page`,{type:`number`,description:`The page number for pagination. Defaults to 1.`}).option(`per-page`,{type:`number`,description:`The number of items per page. Must be between 10 and 1000. Defaults to 25.`}).option(`order`,{type:`string`,description:`The field to order by. Defaults to 'prefix'.`}).option(`direction`,{type:`string`,description:`The direction of ordering (ASC or DESC). Defaults to 'ASC'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List all DNS Protection rules for an account.`,builder:O,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicTransit.advancedDnsProtection.configs.dns.protection.rules.list({account_id:u,...c})),{successLabel:`Loaded`})})};function A(e){return e.positional(`rule-id`,{type:`string`,description:`The UUID of the DNS Protection rule to update.`,demandOption:!0}).option(`block-any-queries`,{type:`boolean`,description:`The new value for whether to block DNS ANY queries. Optional.`}).option(`burst-sensitivity`,{type:`string`,description:`The new burst sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`profile-sensitivity`,{type:`string`,description:`The new profile sensitivity. Optional. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.`}).option(`rate-sensitivity`,{type:`string`,description:`The new rate sensitivity. Optional. Must be one of 'low', 'medium', 'high'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updates to apply to the DNS Protection rule.`})}const j={command:`update <rule-id>`,describe:`Update a DNS Protection rule specified by the given UUID.`,builder:A,handler:async r=>c({command:`magic-transit advanced-dns-protection configs dns protection rules update`,classification:{safeFlags:[`block-any-queries`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-dns-protection configs dns protection rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_dns_protection/configs/dns_protection/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let d=f({block_any_queries:r[`block-any-queries`],burst_sensitivity:p(r[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:p(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:p(r[`rate-sensitivity`],`rate-sensitivity`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...d,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},M={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(v).command(D).command(k).command(j).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`advanced-dns-protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`comment`,{type:`string`,description:`An comment describing the allowlist prefix.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable the allowlist prefix into effect.`}).option(`prefix`,{type:`string`,description:`The allowlist prefix to add in CIDR format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new allowlist prefix to create.`})}const R={command:`create`,describe:`Create an allowlist prefix for an account.`,builder:L,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({comment:p(r.comment,`comment`,`text`),enabled:r.enabled,prefix:p(r.prefix,`prefix`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.comment===void 0&&(r.comment=await m(`comment`,`An comment describing the allowlist prefix.`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.prefix===void 0&&(r.prefix=await m(`prefix`,`The allowlist prefix to add in CIDR format.`));let d=f({comment:p(r.comment,`comment`,`text`),enabled:r.enabled,prefix:p(r.prefix,`prefix`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...d,account_id:l})),{successLabel:`Created`})})};function z(e){return e.positional(`prefix-id`,{type:`string`,description:`The UUID of the allowlist prefix to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`prefix <prefix-id>`,describe:`Delete the allowlist prefix for an account given a UUID.`,builder:z,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist delete allowlist prefix`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
5
5
  `);return}a(await s(`Deleting`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.delete.allowlist.prefix({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Deleted`})})},V={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist.delete.allowlist`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const U={command:`account`,describe:`Delete all allowlist prefixes for an account.`,builder:H,handler:async r=>c({command:`magic-transit advanced-tcp-protection configs allowlist delete for account`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf magic-transit advanced-tcp-protection configs allowlist delete for account`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/advanced_tcp_protection/configs/allowlist`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.