cf 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/_meta/agent-context.json +3 -3
  2. package/dist/_meta/commands.json +149 -5
  3. package/dist/_meta/hand-written-commands.json +181 -5
  4. package/dist/{abuse-reports-sDBTV0qZ.mjs → abuse-reports-D40QFl-y.mjs} +1 -1
  5. package/dist/{access-DcNzuCue.mjs → access-Dl2IU1ID.mjs} +1 -1
  6. package/dist/{account-BX90zXn5.mjs → account-CPbieCZ4.mjs} +1 -1
  7. package/dist/{account-tags-Bz3JG5hI.mjs → account-tags-skfP7H8k.mjs} +1 -1
  8. package/dist/{accounts-DCuW3xyZ.mjs → accounts-CSgR6909.mjs} +1 -1
  9. package/dist/{acm-zjfShZLS.mjs → acm-CVvCTaNk.mjs} +1 -1
  10. package/dist/{addressing-DORQ64Ux.mjs → addressing-Uq5hEDDP.mjs} +1 -1
  11. package/dist/{agent-context-BgPR_aQr.mjs → agent-context-BvuDdaJb.mjs} +1 -1
  12. package/dist/{agent-memory-C0hAUMeC.mjs → agent-memory-BrHMIU0E.mjs} +1 -1
  13. package/dist/{ai-audit-DnU3vn3E.mjs → ai-audit-BoZuL84i.mjs} +1 -1
  14. package/dist/{ai-gateway-COOrr_Yw.mjs → ai-gateway-DE50Jem1.mjs} +1 -1
  15. package/dist/{ai-search-DKbN9Tyd.mjs → ai-search-Fx7NHCHB.mjs} +1 -1
  16. package/dist/{ai-security-C_I5lo58.mjs → ai-security-DyLbY9kv.mjs} +1 -1
  17. package/dist/{ai-BpEBGMT2.mjs → ai-v2fP1r0s.mjs} +1 -1
  18. package/dist/{alerting-4T8gmZs-.mjs → alerting-5mFZjTcD.mjs} +1 -1
  19. package/dist/{analytics-Bxh4TCP7.mjs → analytics-BygTfozw.mjs} +1 -1
  20. package/dist/{analytics_engine-fV56bjVN.mjs → analytics_engine-4L-q362P.mjs} +1 -1
  21. package/dist/{api-security-COk_i184.mjs → api-security-DjFsRYWx.mjs} +1 -1
  22. package/dist/{argo-DIRfvxvv.mjs → argo-TzXPN7tz.mjs} +1 -1
  23. package/dist/args-CDgWUP4J.mjs +2 -0
  24. package/dist/{artifacts-BBfXNfUg.mjs → artifacts-dEw2UUBV.mjs} +1 -1
  25. package/dist/{audit-logs-BlOrlAWe.mjs → audit-logs-CqY7zzwv.mjs} +1 -1
  26. package/dist/{auth-DPhNN3Ly.mjs → auth-CPLdkOC7.mjs} +1 -1
  27. package/dist/{auth-D3X9HYhD.mjs → auth-DY_Y2bXC.mjs} +2 -2
  28. package/dist/{billing-B9e4PnvN.mjs → billing-DHQuRT8S.mjs} +1 -1
  29. package/dist/{bot-management-D2JVeS-V.mjs → bot-management-CfqG79hF.mjs} +1 -1
  30. package/dist/{botnet-feed-BTzTYs5d.mjs → botnet-feed-BOeNnDoH.mjs} +1 -1
  31. package/dist/{brand-protection-C5Q6Gpw9.mjs → brand-protection-DYttrKIM.mjs} +1 -1
  32. package/dist/{browser-extension-u5uA0Lwk.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
  33. package/dist/{browser-run-CHGOCTdG.mjs → browser-run-373D4e1i.mjs} +1 -1
  34. package/dist/build-D0ir_S70.mjs +2 -0
  35. package/dist/{cache-C6V7PbQM.mjs → cache-DJXBmc3w.mjs} +1 -1
  36. package/dist/{calls-Bye8Tyy-.mjs → calls-COO0Eoz1.mjs} +1 -1
  37. package/dist/{certificate-authorities-B-U_e6JJ.mjs → certificate-authorities-DbHLmKbd.mjs} +1 -1
  38. package/dist/{cf-Ds4JFovl.mjs → cf-yPz_IqW6.mjs} +11 -11
  39. package/dist/{chunk-LQW53VED-22IYZovK.mjs → chunk-LQW53VED-9MACsvSG.mjs} +25 -25
  40. package/dist/{chunk-QBZBEHZB-CKzQKcIp.mjs → chunk-QBZBEHZB-yeyhVUeD.mjs} +1 -1
  41. package/dist/{client-certificates-3RrC-6LG.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
  42. package/dist/{client-side-security-DIdKvRMT.mjs → client-side-security-HOmA37et.mjs} +1 -1
  43. package/dist/{cloud-connector-CL1jPQud.mjs → cloud-connector-C7hw1c1f.mjs} +1 -1
  44. package/dist/{cloudforce-one-DULeqLkR.mjs → cloudforce-one-DLOj76q4.mjs} +1 -1
  45. package/dist/command-BV87D4tR.mjs +2 -0
  46. package/dist/{completions-CqgGKRAC.mjs → completions-BnD46cXe.mjs} +1 -1
  47. package/dist/config.d.mts +305 -332
  48. package/dist/config.mjs +1 -1
  49. package/dist/{connector-interrupts-CXlLObDv.mjs → connector-interrupts-DY-z_LrH.mjs} +1 -1
  50. package/dist/{connector-telemetry-events-BrYX4ig4.mjs → connector-telemetry-events-DCXmcAc9.mjs} +1 -1
  51. package/dist/{connector-telemetry-snapshots-BdeBQYcM.mjs → connector-telemetry-snapshots-D8GNuzx3.mjs} +1 -1
  52. package/dist/{connectors-BQwyBJ4_.mjs → connectors-fEOn-J_i.mjs} +1 -1
  53. package/dist/containers-BDBsEs7-.mjs +58 -0
  54. package/dist/{content-scan-DNzhXYkY.mjs → content-scan-Cmj9--XY.mjs} +1 -1
  55. package/dist/{csamScanner-CFq5s1Q3.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
  56. package/dist/{ct-alerting-CH6UmsGQ.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
  57. package/dist/{custom-certificates-DnG73Wg2.mjs → custom-certificates-C5qrlyhb.mjs} +1 -1
  58. package/dist/{custom-csrs-bhClr2SU.mjs → custom-csrs-BgOnTbBW.mjs} +1 -1
  59. package/dist/{custom-hostnames-C0eiGvG9.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
  60. package/dist/{custom-nameservers-CVMhhLm6.mjs → custom-nameservers-2ZajBkRC.mjs} +1 -1
  61. package/dist/{custom-pages-DTINMR30.mjs → custom-pages-Buki_Cb8.mjs} +1 -1
  62. package/dist/{d1-sKdExJYF.mjs → d1-n2in0cSF.mjs} +1 -1
  63. package/dist/{data-security-mV3a6UfW.mjs → data-security-DzOQMkv3.mjs} +1 -1
  64. package/dist/{dcv-delegation-dBu3jdRw.mjs → dcv-delegation-BTP9LCOm.mjs} +1 -1
  65. package/dist/deploy-BUSz35vq.mjs +2 -0
  66. package/dist/deploy-input-BvD9aRP1.mjs +2 -0
  67. package/dist/dev-DY_DquQx.mjs +4 -0
  68. package/dist/{diagnostics-CJV6qWUA.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
  69. package/dist/{directory-B5zCMusW.mjs → directory-BeiSyg8A.mjs} +1 -1
  70. package/dist/{dispatch-namespaces-Dg5lu5xX.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
  71. package/dist/dist-BBx1io2f.mjs +2 -0
  72. package/dist/dist-Cb9TJ2VV.mjs +9 -0
  73. package/dist/dist-DV7LR38l.mjs +387 -0
  74. package/dist/dist-DvizctjW.mjs +48 -0
  75. package/dist/{dls-t0hnIe_P.mjs → dls-BwoU29mS.mjs} +1 -1
  76. package/dist/{dns-C8FC2hbh.mjs → dns-DISAfuzj.mjs} +1 -1
  77. package/dist/{dns-firewall-CuhhUm55.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
  78. package/dist/dry-run-ILZRVpnp.mjs +2 -0
  79. package/dist/{durable-objects-BLrgM3Cw.mjs → durable-objects-DhDL3San.mjs} +1 -1
  80. package/dist/{email-auth-BmYrl0pO.mjs → email-auth-BROqK6-C.mjs} +1 -1
  81. package/dist/{email-routing-CF3_Z957.mjs → email-routing-BZXHDAOO.mjs} +1 -1
  82. package/dist/{email-security-F7OYcMkZ.mjs → email-security-DVumybrk.mjs} +1 -1
  83. package/dist/{email-sending-EyU3WvGQ.mjs → email-sending-CDQ3_wyz.mjs} +1 -1
  84. package/dist/{fieldExtractors-Cno37T2m.mjs → fieldExtractors-Cy1rxHEF.mjs} +1 -1
  85. package/dist/{firewall-8YWWy4iB.mjs → firewall-C0g5X7Zd.mjs} +1 -1
  86. package/dist/{flagship-C4x0l-8J.mjs → flagship-fFBiZUz-.mjs} +1 -1
  87. package/dist/{fraud-HR_SdUx3.mjs → fraud-CjIETOaM.mjs} +1 -1
  88. package/dist/{google-tag-gateway-BdcS0WnX.mjs → google-tag-gateway-hPa5IHUx.mjs} +1 -1
  89. package/dist/{healthchecks-4qOvjrTN.mjs → healthchecks-CoycpTf9.mjs} +1 -1
  90. package/dist/{hostnames-DehdYOMz.mjs → hostnames-x_Yezxpr.mjs} +1 -1
  91. package/dist/{hyperdrive-3gD3hn70.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
  92. package/dist/{iam-DR72hmii.mjs → iam-Bk7K_PPO.mjs} +1 -1
  93. package/dist/{images-CeKc5JPh.mjs → images-BAEFb9q1.mjs} +1 -1
  94. package/dist/index.mjs +1 -1
  95. package/dist/{intel-DtFix9WL.mjs → intel-DDkyJVaP.mjs} +1 -1
  96. package/dist/interactive-CRnq-B5I.mjs +11 -0
  97. package/dist/{interactive-C7M55Wxx.mjs → interactive-cytQzL94.mjs} +1 -1
  98. package/dist/{ips-CtWCjXAN.mjs → ips-DU0ti0i0.mjs} +1 -1
  99. package/dist/{keyless-certificates-Dk24yQFz.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
  100. package/dist/{keys-BmhG6Kn1.mjs → keys-DqldTZqH.mjs} +1 -1
  101. package/dist/{kv-BuVPAuZP.mjs → kv-CcfCfnwq.mjs} +1 -1
  102. package/dist/{leaked-credential-checks-XcZmt1I-.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
  103. package/dist/{load-balancers-CylN-l7n.mjs → load-balancers-Dg4pDad1.mjs} +1 -1
  104. package/dist/{local-Be3lg_9E.mjs → local-DGiIS1uM.mjs} +1 -1
  105. package/dist/local-runtime--IQr44qq.mjs +2 -0
  106. package/dist/{logexplorer-CvRPoKbj.mjs → logexplorer-Bu2mG5rh.mjs} +1 -1
  107. package/dist/{logo-matches-Heuft3yF.mjs → logo-matches-CWUzxY7G.mjs} +1 -1
  108. package/dist/{logos-DRYjGBDq.mjs → logos-BTfdkDPi.mjs} +1 -1
  109. package/dist/{logpush-Dve9jOMp.mjs → logpush-BZyay3h2.mjs} +1 -1
  110. package/dist/{logs-SC86FE89.mjs → logs-BqF7jjQO.mjs} +1 -1
  111. package/dist/{magic-cloud-networking-DXzeqwX-.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +1 -1
  112. package/dist/{magic-network-monitoring-DW0Jl74i.mjs → magic-network-monitoring-D0FnkjuN.mjs} +1 -1
  113. package/dist/{magic-transit-BK_3asH2.mjs → magic-transit-B5skt0G7.mjs} +1 -1
  114. package/dist/{managed-transforms-B6TV4qoE.mjs → managed-transforms-B6X_crcJ.mjs} +1 -1
  115. package/dist/{matches-Iss9Fo4R.mjs → matches-DeYaB4I0.mjs} +1 -1
  116. package/dist/{mcp-8wxXT6JU.mjs → mcp-ChjBiMx2.mjs} +1 -1
  117. package/dist/{mesh-Bf9UAS4J.mjs → mesh-DRVAFLBX.mjs} +1 -1
  118. package/dist/{moq-ZKMFOeVz.mjs → moq-DE7VDEFS.mjs} +1 -1
  119. package/dist/{mtls-certificates-DoWm6GiE.mjs → mtls-certificates-Cbc3uAkN.mjs} +1 -1
  120. package/dist/{network-B1lBARU9.mjs → network-CDPZNFbn.mjs} +1 -1
  121. package/dist/{network-interconnects-CLYIFHfU.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
  122. package/dist/{oauth-DuEONNgC.mjs → oauth-DAa7SwkM.mjs} +4 -4
  123. package/dist/{oauth-clients-DgiTzLzu.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
  124. package/dist/{oauth-scopes-BOBRMxjm.mjs → oauth-scopes-BE6xF4_h.mjs} +1 -1
  125. package/dist/{observability-Jya7-zkl.mjs → observability-DnyI8rPJ.mjs} +1 -1
  126. package/dist/{organization-CYxYV4e0.mjs → organization-yh0mSUdI.mjs} +1 -1
  127. package/dist/{organizations-SacGUW44.mjs → organizations-B3aU-RCG.mjs} +1 -1
  128. package/dist/{origin-ca-certificates-Ph1bJGQ1.mjs → origin-ca-certificates-BaNWfVqf.mjs} +1 -1
  129. package/dist/{origin-post-quantum-encryption-BBLiGAGB.mjs → origin-post-quantum-encryption-CIUtQgyv.mjs} +1 -1
  130. package/dist/{origin-tls-client-auth-DSDgTN2X.mjs → origin-tls-client-auth-CvEpbX2Q.mjs} +1 -1
  131. package/dist/{page-rules-BqEyFR2c.mjs → page-rules-CzbyXbt6.mjs} +1 -1
  132. package/dist/{pages-CQ7ZVWk1.mjs → pages-CX8yefTI.mjs} +1 -1
  133. package/dist/{pay-per-crawl-BMe_3_Qj.mjs → pay-per-crawl-v4vBOMWD.mjs} +1 -1
  134. package/dist/{pipelines-6De2Pe2C.mjs → pipelines-BZ1KGupx.mjs} +1 -1
  135. package/dist/{precursor-iwK-1P_d.mjs → precursor-D42A9ay5.mjs} +1 -1
  136. package/dist/{progress-BqQcF5QH.mjs → progress-jYW64HY7.mjs} +1 -1
  137. package/dist/{project-settings-C_1-JI6Y.mjs → project-settings-BN7tL0c7.mjs} +2 -2
  138. package/dist/{prompt-B0sWIs9c.mjs → prompt-CyATfGUu.mjs} +1 -1
  139. package/dist/{public-BYCVISMH-DnMJ5Jct.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
  140. package/dist/{queries-c7zvnfEQ.mjs → queries-xvETUjUE.mjs} +1 -1
  141. package/dist/{queues-BU6y16qS.mjs → queues-CpqHDtxF.mjs} +1 -1
  142. package/dist/{r2-data-catalog-B-tw-JdG.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
  143. package/dist/{r2-Jo3QMahK.mjs → r2-jhmLvD1z.mjs} +1 -1
  144. package/dist/{radar-DIYAMEof.mjs → radar-C2J16wpX.mjs} +1 -1
  145. package/dist/{rate-limits-DewOcznT.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
  146. package/dist/{raw-fetch-Cc-MjHeL.mjs → raw-fetch-CNKIypJ7.mjs} +1 -1
  147. package/dist/{realtimekit-cnZEVNDn.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
  148. package/dist/{registrar-BsWr_aPM.mjs → registrar-BI5ewTAk.mjs} +1 -1
  149. package/dist/{registrar-sandbox-BlcpUyIH.mjs → registrar-sandbox-al1znWMc.mjs} +1 -1
  150. package/dist/{registry-jifR3_Y6.mjs → registry-5-I2XLwF.mjs} +1 -1
  151. package/dist/{reporting--1AyTV7k.mjs → reporting-CxsdHAH3.mjs} +1 -1
  152. package/dist/{request-tracers-C_VX7X6-.mjs → request-tracers-DJJCncft.mjs} +1 -1
  153. package/dist/{resource-sharing-Br5dqr3o.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
  154. package/dist/{resource-tagging-C33U6T74.mjs → resource-tagging-aTtpX5e5.mjs} +1 -1
  155. package/dist/{rules-BfjzALMi.mjs → rules-PpsDU89Q.mjs} +1 -1
  156. package/dist/{rulesets-3i_1Vwt-.mjs → rulesets-DP12Aqik.mjs} +1 -1
  157. package/dist/{rum-CjmIckiR.mjs → rum-DxvpzJYc.mjs} +1 -1
  158. package/dist/{schema-1mwmslUV.mjs → schema-DlLbiOJj.mjs} +1 -1
  159. package/dist/{schema-flags-llLJuFFw.mjs → schema-flags-CTfQVGCs.mjs} +1 -1
  160. package/dist/schemas-BFCBlp_W.mjs +65 -0
  161. package/dist/{scim-pApmzA5B.mjs → scim-DJ4AVU20.mjs} +1 -1
  162. package/dist/{secrets-store-DBC9WJau.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
  163. package/dist/{security-center-Djm06dq-.mjs → security-center-008FMs_z.mjs} +1 -1
  164. package/dist/{security-txt-Ci7bP4zH.mjs → security-txt-CqcfrhlN.mjs} +1 -1
  165. package/dist/{share-Dj-MNXrw.mjs → share-D5fzsVAJ.mjs} +1 -1
  166. package/dist/{shared-BJvq4DkR.mjs → shared-DlKGNPiT.mjs} +92 -142
  167. package/dist/{smart-shield--8EpJjrF.mjs → smart-shield-DpFscIk8.mjs} +1 -1
  168. package/dist/{snippets-Dyz0PH60.mjs → snippets-CCKgI2ZX.mjs} +1 -1
  169. package/dist/spawn-C3_tJ3RB.mjs +526 -0
  170. package/dist/{spectrum-rAHWz8rH.mjs → spectrum-LmdqY3ki.mjs} +1 -1
  171. package/dist/{speed-BKepWBXj.mjs → speed-CEK36h3A.mjs} +1 -1
  172. package/dist/src-CEb2fgtT.mjs +108 -0
  173. package/dist/{ssl-KdFiY3ev.mjs → ssl-ChHUyaQm.mjs} +1 -1
  174. package/dist/{startup-profile-GLNPHQ9U.mjs → startup-profile-Dpxg-MjV.mjs} +3 -3
  175. package/dist/{state-Cu3cItUg.mjs → state-DeX23Kmg.mjs} +1 -1
  176. package/dist/{stream-CKJ6Tb0M.mjs → stream-DfUSELMX.mjs} +1 -1
  177. package/dist/{submit-BxbKKhBn.mjs → submit-DF2G5CIz.mjs} +1 -1
  178. package/dist/{tags-DA8dq9fx.mjs → tags-nFJJHlLJ.mjs} +1 -1
  179. package/dist/{tenant-DLXw48hS.mjs → tenant-CRLw1oRU.mjs} +1 -1
  180. package/dist/{tenant-custom-nameservers-9G93XuvU.mjs → tenant-custom-nameservers-BvBQRDcs.mjs} +1 -1
  181. package/dist/{tools-x8bj9E6b.mjs → tools-j8UGEtP1.mjs} +1 -1
  182. package/dist/{tunnel-CNQA5Flp.mjs → tunnel-CMQeBgmb.mjs} +1 -1
  183. package/dist/{tunnels-CC10EOsU.mjs → tunnels-iVA3MrdS.mjs} +1 -1
  184. package/dist/{turnstile-CH58hnf4.mjs → turnstile-DQHP6-_b.mjs} +1 -1
  185. package/dist/{ui-CmnnBm_O.mjs → ui-DJFcf61J.mjs} +1 -1
  186. package/dist/{url-info-BpCgdUtL.mjs → url-info-BVgdb_pf.mjs} +1 -1
  187. package/dist/{url-normalization-BzuynEy1.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
  188. package/dist/{url-scanner-APIZbhB7.mjs → url-scanner-DwuDZLPk.mjs} +1 -1
  189. package/dist/{user-2-NGebfI.mjs → user-I_MbB_KX.mjs} +1 -1
  190. package/dist/{values-S_bNv819.mjs → values-S-Q7-5o8.mjs} +1 -1
  191. package/dist/{vectorize-Bv7feLBC.mjs → vectorize-CNZdF_0A.mjs} +1 -1
  192. package/dist/{waiting-rooms-Dk4LIpvm.mjs → waiting-rooms-Bo-OSsxu.mjs} +1 -1
  193. package/dist/{web-assets-C1UmOyzD.mjs → web-assets-tlFzKdNL.mjs} +1 -1
  194. package/dist/{web3-GnUocVYH.mjs → web3-CdbfoZ2x.mjs} +1 -1
  195. package/dist/{workers-J1-PLwdl.mjs → workers-DQ9Q7czn.mjs} +2 -2
  196. package/dist/{workers-builds-DCHmWOMS.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
  197. package/dist/{workflows-CArfEI2c.mjs → workflows-BhEy-crm.mjs} +1 -1
  198. package/dist/{zaraz-mg2YlR3_.mjs → zaraz-DbKvA_8C.mjs} +1 -1
  199. package/dist/{zero-trust-DVdUPtj1.mjs → zero-trust-DrHCPVOc.mjs} +1 -1
  200. package/dist/{zone-DMAfrDJX.mjs → zone-D2zrbJI2.mjs} +1 -1
  201. package/dist/{zones-CNwxUi7I.mjs → zones-DrpxQ_-A.mjs} +1 -1
  202. package/package.json +9 -8
  203. package/dist/args-DlUhyGU0.mjs +0 -2
  204. package/dist/build-D0FhOj40.mjs +0 -8
  205. package/dist/command-C9VP3xaA.mjs +0 -2
  206. package/dist/containers-BrQtGiNp.mjs +0 -58
  207. package/dist/deploy-BL59O1O1.mjs +0 -2
  208. package/dist/deploy-input-Dz6q-__n.mjs +0 -2
  209. package/dist/dev-BDaavgH1.mjs +0 -4
  210. package/dist/dist-BHi7UhXO.mjs +0 -72
  211. package/dist/dist-BWpErtDM.mjs +0 -384
  212. package/dist/dry-run-DL2V6yFm.mjs +0 -2
  213. package/dist/local-runtime-Ce7k598H.mjs +0 -2
  214. package/dist/spawn-C5Z7oWdp.mjs +0 -519
  215. package/dist/src-gJma71Ec.mjs +0 -108
  216. /package/dist/{alerts-15-IW4jE.mjs → alerts-9PR5sQ_z.mjs} +0 -0
  217. /package/dist/{autorag-CFwRkEKw.mjs → autorag-Bevo1kIH.mjs} +0 -0
  218. /package/dist/{body-parser-BshbixEq.mjs → body-parser-BGVbwPeM.mjs} +0 -0
  219. /package/dist/{brands-BgT1vu9B.mjs → brands-C4M04Man.mjs} +0 -0
  220. /package/dist/{clear-BlCK85Me.mjs → clear-DS0eRXOc.mjs} +0 -0
  221. /package/dist/{cli-types-DAYeL_Mj.mjs → cli-types-C3nVfpSG.mjs} +0 -0
  222. /package/dist/{connector-telemetry-events-latest-BbpcII3_.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
  223. /package/dist/{connector-telemetry-snapshots-latest-DuCiimXl.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
  224. /package/dist/{domain-info-C7LBxPBt.mjs → domain-info-BUiaGCEq.mjs} +0 -0
  225. /package/dist/{health-DZFfafkX.mjs → health-vX6Ml2Na.mjs} +0 -0
  226. /package/dist/{input-validation-QDIYu7Vb.mjs → input-validation-1esLElok.mjs} +0 -0
  227. /package/dist/{internal-BKHC2D1Y.mjs → internal-ROz7anul.mjs} +0 -0
  228. /package/dist/{live-DwCvDmaH.mjs → live-CSxvigCS.mjs} +0 -0
  229. /package/dist/{metadata-B5yfL0ln.mjs → metadata-DEqBUaSv.mjs} +0 -0
  230. /package/dist/{open-PBXRGS4R-CX8K4WYl.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +0 -0
  231. /package/dist/{output-Ccqw2WOb.mjs → output-BqDR9h74.mjs} +0 -0
  232. /package/dist/{rate-limit-analytics-B8Vuu1sU.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
  233. /package/dist/{ready-D9H2zHHI.mjs → ready-6G9zVGPJ.mjs} +0 -0
  234. /package/dist/{recent-submissions-BPo0J80d.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
  235. /package/dist/{refute-2W8NLCN4.mjs → refute-DjkmLSNe.mjs} +0 -0
  236. /package/dist/{resolve-B8CyM1mi.mjs → resolve-DEvdeprv.mjs} +0 -0
  237. /package/dist/{scan-logo-D5x6F1Y0.mjs → scan-logo-545qLcGs.mjs} +0 -0
  238. /package/dist/{scan-page-CWhta3x7.mjs → scan-page-DRQiVufl.mjs} +0 -0
  239. /package/dist/{search-DZmBQJL9.mjs → search-CXbqFoqe.mjs} +0 -0
  240. /package/dist/{signed-url-CQrmWgz5.mjs → signed-url-rU_nvgFA.mjs} +0 -0
  241. /package/dist/{submission-info-C98A0bqq.mjs → submission-info-D6PgXNQP.mjs} +0 -0
  242. /package/dist/{total-queries-BZoaFoDE.mjs → total-queries-XkFyu8H5.mjs} +0 -0
  243. /package/dist/{tracked-domains-CNHogPHx.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
  244. /package/dist/{verify-4e4L9IRk.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{a as r,r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{i as c,n as l,t as u}from"./body-parser-BshbixEq.mjs";import{n as d}from"./input-validation-QDIYu7Vb.mjs";import{a as f,i as p,n as m}from"./prompt-B0sWIs9c.mjs";import{t as h}from"./cli-types-DAYeL_Mj.mjs";import{n as g,t as _}from"./raw-fetch-Cc-MjHeL.mjs";function v(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){o({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({description:d(m.description,`description`,`text`),destination_type:d(m[`destination-type`],`destination-type`,`text`),name:d(m.name,`name`,`text`),policy:d(m.policy,`policy`,`text`),update_mode:d(m[`update-mode`],`update-mode`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`destination-type`]===void 0&&(m[`destination-type`]=await p(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),m.name===void 0&&(m.name=await f(`name`,`The name field`)),m[`update-mode`]===void 0&&(m[`update-mode`]=await p(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`destination-type`]!==void 0&&c(v,[`destination_type`],d(m[`destination-type`],`destination-type`,`text`)),m.name!==void 0&&c(v,[`name`],d(m.name,`name`,`text`)),m.policy!==void 0&&c(v,[`policy`],d(m.policy,`policy`,`text`)),m[`update-mode`]!==void 0&&c(v,[`update_mode`],d(m[`update-mode`],`update-mode`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async r=>{let c={delete_destination:r[`delete-destination`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{i as c,n as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,i as p,n as m}from"./prompt-CyATfGUu.mjs";import{t as h}from"./cli-types-C3nVfpSG.mjs";import{n as g,t as _}from"./raw-fetch-CNKIypJ7.mjs";function v(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){o({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({description:d(m.description,`description`,`text`),destination_type:d(m[`destination-type`],`destination-type`,`text`),name:d(m.name,`name`,`text`),policy:d(m.policy,`policy`,`text`),update_mode:d(m[`update-mode`],`update-mode`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`destination-type`]===void 0&&(m[`destination-type`]=await p(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),m.name===void 0&&(m.name=await f(`name`,`The name field`)),m[`update-mode`]===void 0&&(m[`update-mode`]=await p(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`destination-type`]!==void 0&&c(v,[`destination_type`],d(m[`destination-type`],`destination-type`,`text`)),m.name!==void 0&&c(v,[`name`],d(m.name,`name`,`text`)),m.policy!==void 0&&c(v,[`policy`],d(m.policy,`policy`,`text`)),m[`update-mode`]!==void 0&&c(v,[`update_mode`],d(m[`update-mode`],`update-mode`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async r=>{let c={delete_destination:r[`delete-destination`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>l.magicCloudNetworking.catalogSyncs.delete({account_id:u,sync_id:r[`sync-id`],...c})),{successLabel:`Deleted`})}};function b(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:e,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.edit({body:p,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`})}};function S(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.get({account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.catalogSyncs.list({account_id:l})),{successLabel:`Loaded`})}};function E(e){return e.option(`destination-type`,{type:`string`,description:`Specify type of destination, omit to return all.`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:h(E),handler:async r=>{let c={destination_type:r[`destination-type`]};if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs prebuilt-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/prebuilt-policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({account_id:u,...c})),{successLabel:`Loaded`})}},O={command:`prebuilt-policies`,describe:`Operations for catalog-syncs.prebuilt-policies`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:k,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}/refresh`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.catalogSyncs.refresh({account_id:l,sync_id:r[`sync-id`]})),{successLabel:`Created`})}};function j(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking catalog-syncs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/catalog-syncs/${r[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(r[`sync-id`]))}`,pathParams:{"sync-id":String(r[`sync-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:e,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`),policy:d(r.policy,`policy`,`text`),update_mode:d(r[`update-mode`],`update-mode`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.catalogSyncs.update({body:p,account_id:f,sync_id:r[`sync-id`]})),{successLabel:`Updated`})}},N={command:`catalog-syncs`,describe:`Operations for catalog-syncs`,builder:e=>e.command(ee).command(y).command(x).command(C).command(T).command(A).command(M).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:P,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){o({command:`cf magic-cloud-networking cloud-integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),friendly_name:d(m[`friendly-name`],`friendly-name`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}m[`cloud-type`]===void 0&&(m[`cloud-type`]=await p(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),m[`friendly-name`]===void 0&&(m[`friendly-name`]=await f(`friendly-name`,`The friendly_name field`));let v={};m[`cloud-type`]!==void 0&&c(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`friendly-name`]!==void 0&&c(v,[`friendly_name`],d(m[`friendly-name`],`friendly-name`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function I(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.magicCloudNetworking.cloudIntegrations.delete({account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Deleted`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations discover-all`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/discover`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.cloudIntegrations.discoverAll({account_id:l})),{successLabel:`Created`})}};function B(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:B,handler:async r=>{let c={v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations discover`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}/discover`,pathParams:{"provider-id":String(r[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Creating`,async()=>l.magicCloudNetworking.cloudIntegrations.discover({account_id:u,provider_id:r[`provider-id`],...c})),{successLabel:`Created`})}};function H(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:e,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.edit({body:p,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`})}};function W(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:W,handler:async r=>{let c={status:r.status};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.get({account_id:u,provider_id:r[`provider-id`],...c})),{successLabel:`Loaded`})}};function K(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:K,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations initial-setup`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}/initial_setup`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.cloudIntegrations.initialSetup({account_id:l,provider_id:r[`provider-id`]})),{successLabel:`Loaded`})}};function J(e){return e.option(`status`,{type:`boolean`,description:`Status`}).option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:J,handler:async r=>{let c={status:r.status,order_by:r[`order-by`],desc:r.desc,cloudflare:r.cloudflare};if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.cloudIntegrations.list({account_id:u,...c})),{successLabel:`Loaded`})}};function X(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:X,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking cloud-integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/providers/${r[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(r[`provider-id`]))}`,pathParams:{"provider-id":String(r[`provider-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:e,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`});return}let p=u({aws_arn:d(r[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:d(r[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:d(r[`azure-tenant-id`],`azure-tenant-id`,`text`),description:d(r.description,`description`,`text`),friendly_name:d(r[`friendly-name`],`friendly-name`,`text`),gcp_project_id:d(r[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:d(r[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.cloudIntegrations.update({body:p,account_id:f,provider_id:r[`provider-id`]})),{successLabel:`Updated`})}},Q={command:`cloud-integrations`,describe:`Operations for cloud-integrations`,builder:e=>e.command(F).command(L).command(V).command(z).command(U).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({prefixes:r.prefixes}):l(r.body)});return}let c=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:e,account_id:d})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.edit({body:f,account_id:d})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ie,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.list({account_id:l})),{successLabel:`Loaded`})}};function oe(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:oe,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps address-spaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({prefixes:r.prefixes}):l(r.body)});return}let c=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:e,account_id:d})),{successLabel:`Updated`});return}if(r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let f=u({prefixes:r.prefixes});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.addressSpaces.update({body:f,account_id:d})),{successLabel:`Updated`})}},ce={command:`address-spaces`,describe:`Operations for on-ramps.address-spaces`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:le,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps apply`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/apply`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.onRamps.apply({account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Created`})}};function de(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`adopted-hub-id`,{type:`string`,description:`The adopted_hub_id field`}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`cloud-asn`,{type:`number`,description:`Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect.`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`dynamic-routing`,{type:`boolean`,description:`Enables BGP routing. When enabling this feature, set both install_routes_in_cloud and install_routes_in_magic_wan to false.`}).option(`hub-provider-id`,{type:`string`,description:`The hub_provider_id field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`region`,{type:`string`,description:`The region field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`OnrampTypeSingle`,`OnrampTypeHub`]}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:de,handler:async m=>{let h={};if(m.forwarded!==void 0&&(h.forwarded=String(m.forwarded)),m.dryRun){o({command:`cf magic-cloud-networking on-ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({adopted_hub_id:d(m[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:m[`attached-hubs`],attached_vpcs:m[`attached-vpcs`],cloud_asn:m[`cloud-asn`],cloud_type:d(m[`cloud-type`],`cloud-type`,`text`),description:d(m.description,`description`,`text`),dynamic_routing:m[`dynamic-routing`],hub_provider_id:d(m[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:m[`install-routes-in-cloud`],install_routes_in_magic_wan:m[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:m[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:m[`manage-vpc-to-hub-attachments`],name:d(m.name,`name`,`text`),region:d(m.region,`region`,`text`),type:d(m.type,`type`,`text`),vpc:d(m.vpc,`vpc`,`text`)}):l(m.body)});return}let g=await i(m),_=m.local?e:await t();if(m.accountId=_,m.body){let e=l(m.body);a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}if(m[`cloud-type`]===void 0&&(m[`cloud-type`]=await p(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),m[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(m[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(m[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);m.name===void 0&&(m.name=await f(`name`,`The name field`)),m.type===void 0&&(m.type=await p(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};m[`adopted-hub-id`]!==void 0&&c(v,[`adopted_hub_id`],d(m[`adopted-hub-id`],`adopted-hub-id`,`text`)),m[`attached-hubs`]!==void 0&&c(v,[`attached_hubs`],m[`attached-hubs`]),m[`attached-vpcs`]!==void 0&&c(v,[`attached_vpcs`],m[`attached-vpcs`]),m[`cloud-asn`]!==void 0&&c(v,[`cloud_asn`],m[`cloud-asn`]),m[`cloud-type`]!==void 0&&c(v,[`cloud_type`],d(m[`cloud-type`],`cloud-type`,`text`)),m.description!==void 0&&c(v,[`description`],d(m.description,`description`,`text`)),m[`dynamic-routing`]!==void 0&&c(v,[`dynamic_routing`],m[`dynamic-routing`]),m[`hub-provider-id`]!==void 0&&c(v,[`hub_provider_id`],d(m[`hub-provider-id`],`hub-provider-id`,`text`)),m[`install-routes-in-cloud`]!==void 0&&c(v,[`install_routes_in_cloud`],m[`install-routes-in-cloud`]),m[`install-routes-in-magic-wan`]!==void 0&&c(v,[`install_routes_in_magic_wan`],m[`install-routes-in-magic-wan`]),m[`manage-hub-to-hub-attachments`]!==void 0&&c(v,[`manage_hub_to_hub_attachments`],m[`manage-hub-to-hub-attachments`]),m[`manage-vpc-to-hub-attachments`]!==void 0&&c(v,[`manage_vpc_to_hub_attachments`],m[`manage-vpc-to-hub-attachments`]),m.name!==void 0&&c(v,[`name`],d(m.name,`name`,`text`)),m.region!==void 0&&c(v,[`region`],d(m.region,`region`,`text`)),m.type!==void 0&&c(v,[`type`],d(m.type,`type`,`text`)),m.vpc!==void 0&&c(v,[`vpc`],d(m.vpc,`vpc`,`text`)),a(await s(`Creating`,async()=>r(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function pe(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`destroy`,{type:`boolean`,description:`Destroy`}).option(`force`,{type:`boolean`,description:`Force`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:pe,handler:async r=>{let c={destroy:r.destroy,force:r.force};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
5
5
  `);return}a(await s(`Deleting`,async()=>l.magicCloudNetworking.onRamps.delete({account_id:u,onramp_id:r[`onramp-id`],...c})),{successLabel:`Deleted`})}};function he(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ge={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:he,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:e,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.edit({body:p,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})}};function _e(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ve={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:_e,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/export`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a;let c=await s(`Loading`,async()=>_(`/accounts/${a}/magic/cloud/onramps/${encodeURIComponent(String(r[`onramp-id`]))}/export`,{method:`POST`,local:r.local===!0,persistTo:r.persistTo}));g(r.text===!0?c.toString(`utf-8`):c)}};function ye(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`post-apply-resources`,{type:`boolean`,description:`Post apply resources`}).option(`planned-resources`,{type:`boolean`,description:`Planned resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:ye,handler:async r=>{let c={status:r.status,vpcs:r.vpcs,post_apply_resources:r[`post-apply-resources`],planned_resources:r[`planned-resources`]};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.onRamps.get({account_id:u,onramp_id:r[`onramp-id`],...c})),{successLabel:`Loaded`})}};function xe(e){return e.option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:xe,handler:async r=>{let c={order_by:r[`order-by`],desc:r.desc,status:r.status,vpcs:r.vpcs};if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.onRamps.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:Ce,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}/plan`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicCloudNetworking.onRamps.plan({account_id:l,onramp_id:r[`onramp-id`]})),{successLabel:`Created`})}};function Te(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Te,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking on-ramps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/onramps/${r[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(r[`onramp-id`]))}`,pathParams:{"onramp-id":String(r[`onramp-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)}):l(r.body)});return}let c=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:e,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`});return}let p=u({attached_hubs:r[`attached-hubs`],attached_vpcs:r[`attached-vpcs`],description:d(r.description,`description`,`text`),install_routes_in_cloud:r[`install-routes-in-cloud`],install_routes_in_magic_wan:r[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:r[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:r[`manage-vpc-to-hub-attachments`],name:d(r.name,`name`,`text`),vpc:d(r.vpc,`vpc`,`text`)});a(await s(`Updating`,async()=>c.magicCloudNetworking.onRamps.update({body:p,account_id:f,onramp_id:r[`onramp-id`]})),{successLabel:`Updated`})}},De={command:`on-ramps`,describe:`Operations for on-ramps`,builder:e=>e.command(ue).command(fe).command(me).command(ge).command(ve).command(be).command(Se).command(we).command(Ee).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const Oe={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:$,handler:async r=>{let a={provider_id:r[`provider-id`],resource_type:r[`resource-type`],resource_id:r[`resource-id`],region:r.region,resource_group:r[`resource-group`],search:r.search,order_by:r[`order-by`],desc:r.desc,v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/export`,pathParams:{},query:a,bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>_(`/accounts/${c}/magic/cloud/resources/export${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));g(r.text===!0?u.toString(`utf-8`):u)}};function ke(e){return e.positional(`resource-id`,{type:`string`,description:`Resource ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:ke,handler:async r=>{let c={v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/${r[`resource-id`]==null?`<resource-id>`:encodeURIComponent(String(r[`resource-id`]))}`,pathParams:{"resource-id":String(r[`resource-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.resources.get({account_id:u,resource_id:r[`resource-id`],...c})),{successLabel:`Loaded`})}};function je(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`managed`,{type:`boolean`,description:`Managed`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:h(je),handler:async r=>{let c={provider_id:r[`provider-id`],resource_type:r[`resource-type`],resource_id:r[`resource-id`],region:r.region,resource_group:r[`resource-group`],managed:r.managed,search:r.search,order_by:r[`order-by`],desc:r.desc,per_page:r[`per-page`],page:r.page,cloudflare:r.cloudflare,v2:r.v2};if(r.dryRun){o({command:`cf magic-cloud-networking resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.magicCloudNetworking.resources.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ne(e){return e.option(`policy`,{type:`string`,description:`The policy field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Ne,handler:async r=>{if(r.dryRun){o({command:`cf magic-cloud-networking resources policy-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/cloud/resources/policy-preview`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({policy:d(r.policy,`policy`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...e,account_id:p})),{successLabel:`Created`});return}r.policy===void 0&&(r.policy=await f(`policy`,`The policy field`));let m=u({policy:d(r.policy,`policy`,`text`)});a(await s(`Creating`,async()=>c.magicCloudNetworking.resources.policyPreview({...m,account_id:p})),{successLabel:`Created`})}},Fe={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`magic-cloud-networking`,describe:`magic-cloud-networking`,builder:e=>e.command(N).command(Q).command(De).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{a as r,r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{n as c,r as l,t as u}from"./body-parser-BshbixEq.mjs";import{n as d}from"./input-validation-QDIYu7Vb.mjs";import{a as f,i as p,n as m}from"./prompt-B0sWIs9c.mjs";function h(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create a new network monitoring configuration.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.magicNetworkMonitoring.configs.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await f(`name`,`The account name.`));let h=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Creating`,async()=>p.magicNetworkMonitoring.configs.create({...h,account_id:m})),{successLabel:`Created`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,r as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,i as p,n as m}from"./prompt-CyATfGUu.mjs";function h(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create a new network monitoring configuration.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.magicNetworkMonitoring.configs.create({...e,account_id:m})),{successLabel:`Created`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await f(`name`,`The account name.`));let h=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Creating`,async()=>p.magicNetworkMonitoring.configs.create({...h,account_id:m})),{successLabel:`Created`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.configs.delete({account_id:l})),{successLabel:`Deleted`})}};function y(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`edit`,describe:`Update fields in an existing network monitoring configuration.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.magicNetworkMonitoring.configs.edit({...e,account_id:p})),{successLabel:`Updated`});return}let m=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>f.magicNetworkMonitoring.configs.edit({...m,account_id:p})),{successLabel:`Updated`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Lists default sampling, router IPs, warp devices, and rules for account.`,builder:x,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs full get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config/full`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.configs.full.get({account_id:l})),{successLabel:`Loaded`})}},C={command:`full`,describe:`Operations for configs.full`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Lists default sampling, router IPs and warp devices for account.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.configs.get({account_id:l})),{successLabel:`Loaded`})}};function E(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`warp-devices`,{type:`string`,description:`The warp_devices field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`update`,describe:`Update an existing network monitoring configuration, requires the entire configuration to be updated at once.`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring configs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.magicNetworkMonitoring.configs.update({...e,account_id:m})),{successLabel:`Updated`});return}if(r[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await f(`name`,`The account name.`));let h=u({default_sampling:r[`default-sampling`],name:d(r.name,`name`,`text`),router_ips:r[`router-ips`],warp_devices:l(r[`warp-devices`],`warp-devices`)});a(await s(`Updating`,async()=>p.magicNetworkMonitoring.configs.update({...h,account_id:m})),{successLabel:`Updated`})}},O={command:`configs`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(g).command(v).command(b).command(T).command(D).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`edit <rule-id>`,describe:`Update advertisement for rule.`,builder:k,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules advertisements edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}/advertisement`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.magicNetworkMonitoring.rules.advertisements.edit({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})}},j={command:`advertisements`,describe:`Operations for rules.advertisements`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create multiple network monitoring rules for account in a single request. Supports up to 100 rules per request. All rules in a single request must be of the same type.`,builder:M,handler:async l=>{if(l.dryRun){o({command:`cf magic-network-monitoring rules bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/bulk`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>100){let t=Math.ceil(e.length/100),n=null;for(let i=0;i<e.length;i+=100){let a=e.slice(i,i+100);n=await s(`Creating: batch ${Math.floor(i/100)+1}/${t}`,async()=>r(u,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Created`});return}a(await s(`Creating`,async()=>r(u,`POST`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`update`,describe:`Update multiple network monitoring rules for account in a single request. Supports up to 100 rules per request. All rules in a single request must be of the same type.`,builder:N,handler:async l=>{if(l.dryRun){o({command:`cf magic-network-monitoring rules bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/bulk`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>100){let t=Math.ceil(e.length/100),n=null;for(let i=0;i<e.length;i+=100){let a=e.slice(i,i+100);n=await s(`Updating: batch ${Math.floor(i/100)+1}/${t}`,async()=>r(u,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:a}))}a(n,{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/mnm/rules/bulk`,{body:e})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},F={command:`bulk`,describe:`Operations for rules.bulk`,builder:e=>e.command(ee).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`],default:`1m`}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`create`,describe:`Create network monitoring rules for account. Currently only supports creating a single rule per API request.`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)}):c(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.magicNetworkMonitoring.rules.create({body:e,account_id:m})),{successLabel:`Created`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await f(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await p(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Creating`,async()=>l.magicNetworkMonitoring.rules.create({body:h,account_id:m})),{successLabel:`Created`})}};function R(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const z={command:`delete <rule-id>`,describe:`Delete a network monitoring rule for account.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.magicNetworkMonitoring.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`edit <rule-id>`,describe:`Update a network monitoring rule for account.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)}):c(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.edit({body:e,account_id:m,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await f(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await p(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.edit({body:h,account_id:m,rule_id:r[`rule-id`]})),{successLabel:`Updated`})}};function H(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <rule-id>`,describe:`List a single network monitoring rule for account.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})}};function W(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Lists network monitoring rules for account.`,builder:W,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.magicNetworkMonitoring.rules.list({account_id:l})),{successLabel:`Loaded`})}};function K(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`update`,describe:`Update network monitoring rules for account.`,builder:K,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)}):c(r.body)});return}let l=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.update({body:e,account_id:m})),{successLabel:`Updated`});return}if(r[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await f(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),r.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);r.type===void 0&&(r.type=await p(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=u({automatic_advertisement:r[`automatic-advertisement`],bandwidth_threshold:r[`bandwidth-threshold`],duration:d(r.duration,`duration`,`text`),name:d(r.name,`name`,`text`),packet_threshold:r[`packet-threshold`],prefix_match:d(r[`prefix-match`],`prefix-match`,`text`),prefixes:r.prefixes,type:d(r.type,`type`,`text`),zscore_sensitivity:d(r[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(r[`zscore-target`],`zscore-target`,`text`)});a(await s(`Updating`,async()=>l.magicNetworkMonitoring.rules.update({body:h,account_id:m})),{successLabel:`Updated`})}},J={command:`rules`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).command(q).command(j).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`create`,describe:`Generate authentication token for VPC flow logs export.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf magic-network-monitoring vpc-flows tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mnm/vpc-flows/token`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.magicNetworkMonitoring.vpcFlows.tokens.create({account_id:l})),{successLabel:`Created`})}},Z={command:`tokens`,describe:`Operations for vpc-flows.tokens`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`vpc-flows`,describe:`Ingest VPC flow logs from cloud providers for network visibility and anomaly detection`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`magic-network-monitoring`,describe:`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,builder:e=>e.command(O).command(J).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{a as r,r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{i as c,n as l,r as u,t as d}from"./body-parser-BshbixEq.mjs";import{n as f}from"./input-validation-QDIYu7Vb.mjs";import{a as p,i as m,n as h}from"./prompt-B0sWIs9c.mjs";import{n as g,t as _}from"./raw-fetch-Cc-MjHeL.mjs";function ee(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 te={command:`create`,describe:`Create a DNS Protection rule for an account.`,builder:ee,handler:async r=>{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?d({block_any_queries:r[`block-any-queries`],burst_sensitivity:f(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:f(r.name,`name`,`text`),profile_sensitivity:f(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:f(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:f(r.scope,`scope`,`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.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:u})),{successLabel:`Created`});return}r[`burst-sensitivity`]===void 0&&(r[`burst-sensitivity`]=await p(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.name===void 0&&(r.name=await p(`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 p(`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 p(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.scope===void 0&&(r.scope=await p(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let m=d({block_any_queries:r[`block-any-queries`],burst_sensitivity:f(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:f(r.name,`name`,`text`),profile_sensitivity:f(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:f(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:f(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...m,account_id:u})),{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:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:v,handler:async r=>{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 h({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{i as c,n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f}from"./input-validation-1esLElok.mjs";import{a as p,i as m,n as h}from"./prompt-CyATfGUu.mjs";import{n as g,t as _}from"./raw-fetch-CNKIypJ7.mjs";function ee(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 te={command:`create`,describe:`Create a DNS Protection rule for an account.`,builder:ee,handler:async r=>{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?d({block_any_queries:r[`block-any-queries`],burst_sensitivity:f(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:f(r.name,`name`,`text`),profile_sensitivity:f(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:f(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:f(r.scope,`scope`,`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.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...e,account_id:u})),{successLabel:`Created`});return}r[`burst-sensitivity`]===void 0&&(r[`burst-sensitivity`]=await p(`burst-sensitivity`,`The burst sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.name===void 0&&(r.name=await p(`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 p(`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 p(`rate-sensitivity`,`The rate sensitivity. Must be one of 'low', 'medium', 'high'.`)),r.scope===void 0&&(r.scope=await p(`scope`,`The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.`));let m=d({block_any_queries:r[`block-any-queries`],burst_sensitivity:f(r[`burst-sensitivity`],`burst-sensitivity`,`text`),name:f(r.name,`name`,`text`),profile_sensitivity:f(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:f(r[`rate-sensitivity`],`rate-sensitivity`,`text`),scope:f(r.scope,`scope`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.create({...m,account_id:u})),{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:`account`,describe:`Delete all DNS Protection rules for an account.`,builder:v,handler:async r=>{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 h({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`})}},b={command:`for`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete.for`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(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 S={command:`rule <rule-id>`,describe:`Delete a DNS Protection rule specified by the given UUID.`,builder:x,handler:async r=>{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 h({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`})}},C={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete.protection`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`delete`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules.delete`,builder:e=>e.command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(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 E={command:`get <rule-id>`,describe:`Get a DNS Protection rule specified by the given UUID.`,builder:T,handler:async r=>{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 D(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 O={command:`list`,describe:`List all DNS Protection rules for an account.`,builder:D,handler:async r=>{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 k(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 A={command:`update <rule-id>`,describe:`Update a DNS Protection rule specified by the given UUID.`,builder:k,handler:async r=>{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?d({block_any_queries:r[`block-any-queries`],burst_sensitivity:f(r[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:f(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:f(r[`rate-sensitivity`],`rate-sensitivity`,`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.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...e,account_id:u,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let p=d({block_any_queries:r[`block-any-queries`],burst_sensitivity:f(r[`burst-sensitivity`],`burst-sensitivity`,`text`),profile_sensitivity:f(r[`profile-sensitivity`],`profile-sensitivity`,`text`),rate_sensitivity:f(r[`rate-sensitivity`],`rate-sensitivity`,`text`)});a(await s(`Updating`,async()=>c.magicTransit.advancedDnsProtection.configs.dns.protection.rules.update({...p,account_id:u,rule_id:r[`rule-id`]})),{successLabel:`Updated`})}},j={command:`rules`,describe:`Operations for advanced-dns-protection.configs.dns.protection.rules`,builder:e=>e.command(te).command(E).command(O).command(A).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`protection`,describe:`Operations for advanced-dns-protection.configs.dns.protection`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`dns`,describe:`Operations for advanced-dns-protection.configs.dns`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`configs`,describe:`Operations for advanced-dns-protection.configs`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`advanced-dns-protection`,describe:`Advanced Dns Protection operations`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 L={command:`create`,describe:`Create an allowlist prefix for an account.`,builder:I,handler:async r=>{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?d({comment:f(r.comment,`comment`,`text`),enabled:r.enabled,prefix:f(r.prefix,`prefix`,`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.magicTransit.advancedTcpProtection.configs.allowlist.create({...e,account_id:u})),{successLabel:`Created`});return}if(r.comment===void 0&&(r.comment=await p(`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 p(`prefix`,`The allowlist prefix to add in CIDR format.`));let m=d({comment:f(r.comment,`comment`,`text`),enabled:r.enabled,prefix:f(r.prefix,`prefix`,`text`)});a(await s(`Creating`,async()=>c.magicTransit.advancedTcpProtection.configs.allowlist.create({...m,account_id:u})),{successLabel:`Created`})}};function R(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 z={command:`prefix <prefix-id>`,describe:`Delete the allowlist prefix for an account given a UUID.`,builder:R,handler:async r=>{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 h({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`})}},B={command:`allowlist`,describe:`Operations for advanced-tcp-protection.configs.allowlist.delete.allowlist`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};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 H={command:`account`,describe:`Delete all allowlist prefixes for an account.`,builder:V,handler:async r=>{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 h({force:!!r.force})){process.stderr.write(`Aborted.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";import{n as a,r as o,t as s}from"./body-parser-BshbixEq.mjs";import{n as c}from"./prompt-B0sWIs9c.mjs";function l(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:`delete`,describe:`Disables all Managed Transforms.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
2
+ import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,r as o,t as s}from"./body-parser-BGVbwPeM.mjs";import{n as c}from"./prompt-CyATfGUu.mjs";function l(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:`delete`,describe:`Disables all Managed Transforms.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>o.managedTransforms.delete({zone_id:s})),{successLabel:`Deleted`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})}};function p(e){return e.option(`managed-request-headers`,{type:`string`,description:`The list of Managed Request Transforms. Provide as a JSON array of objects or @path/to/file.json.`}).option(`managed-response-headers`,{type:`string`,description:`The list of Managed Response Transforms. 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:`A Managed Transforms patch object. Both fields are optional; only the sections provided will be updated.`})}const m={command:`update`,describe:`Updates the status of one or more Managed Transforms.`,builder:p,handler:async c=>{if(c.dryRun){r({command:`cf managed-transforms update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed_request_headers:o(c[`managed-request-headers`],`managed-request-headers`),managed_response_headers:o(c[`managed-response-headers`],`managed-response-headers`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.managedTransforms.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({managed_request_headers:o(c[`managed-request-headers`],`managed-request-headers`),managed_response_headers:o(c[`managed-response-headers`],`managed-response-headers`)});n(await i(`Updating`,async()=>l.managedTransforms.update({...d,zone_id:u})),{successLabel:`Updated`})}},h={command:`managed-transforms`,describe:`managed-transforms`,builder:e=>e.command(u).command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";function s(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for string queries based on ID`,builder:s,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){a({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.matches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for string queries based on ID`,builder:u,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){a({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.matches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`matches`,describe:`matches`,builder:e=>e.command(d).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";function s(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for string queries based on ID`,builder:s,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){a({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.matches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for string queries based on ID`,builder:u,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){a({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.matches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`matches`,describe:`matches`,builder:e=>e.command(d).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,r as c,t as l}from"./body-parser-BshbixEq.mjs";import{n as u}from"./input-validation-QDIYu7Vb.mjs";import{a as d,i as f,n as p}from"./prompt-B0sWIs9c.mjs";import{t as m}from"./cli-types-DAYeL_Mj.mjs";function h(e){return e.option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`account-tool-call-timeseries`,describe:`Returns daily or monthly tool-call counts across the account.`,builder:m(h),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp portals account-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/tool-calls/timeseries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.accountToolCallTimeseries({account_id:u,...c})),{successLabel:`Loaded`})}};function _(e){return e.option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`,default:!1}).option(`servers`,{type:`string`,description:`MCP servers attached to the portal and their portal-specific settings. 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 v={command:`create`,describe:`Creates a new MCP portal for managing AI tool access through Cloudflare Access.`,builder:_,handler:async f=>{if(f.dryRun){a({command:`cf mcp portals create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({allow_code_mode:f[`allow-code-mode`],code_mode:u(f[`code-mode`],`code-mode`,`text`),description:u(f.description,`description`,`text`),hostname:u(f.hostname,`hostname`,`text`),id:u(f.id,`id`,`text`),name:u(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],servers:c(f.servers,`servers`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.mcp.portals.create({...e,account_id:m})),{successLabel:`Created`});return}f.hostname===void 0&&(f.hostname=await d(`hostname`,`Hostname where the MCP portal is available.`)),f.id===void 0&&(f.id=await d(`id`,`Unique identifier for the MCP portal.`)),f.name===void 0&&(f.name=await d(`name`,`Display name for the MCP portal.`));let h=l({allow_code_mode:f[`allow-code-mode`],code_mode:u(f[`code-mode`],`code-mode`,`text`),description:u(f.description,`description`,`text`),hostname:u(f.hostname,`hostname`,`text`),id:u(f.id,`id`,`text`),name:u(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],servers:c(f.servers,`servers`)});i(await o(`Creating`,async()=>p.mcp.portals.create({...h,account_id:m})),{successLabel:`Created`})}};function y(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,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 <id>`,describe:`Deletes an MCP portal from the account.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf mcp portals delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force,message:`This operation permanently deletes the MCP portal.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,r as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,i as f,n as p}from"./prompt-CyATfGUu.mjs";import{t as m}from"./cli-types-C3nVfpSG.mjs";function h(e){return e.option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`account-tool-call-timeseries`,describe:`Returns daily or monthly tool-call counts across the account.`,builder:m(h),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp portals account-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/tool-calls/timeseries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.accountToolCallTimeseries({account_id:u,...c})),{successLabel:`Loaded`})}};function _(e){return e.option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`,default:!1}).option(`servers`,{type:`string`,description:`MCP servers attached to the portal and their portal-specific settings. 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 v={command:`create`,describe:`Creates a new MCP portal for managing AI tool access through Cloudflare Access.`,builder:_,handler:async f=>{if(f.dryRun){a({command:`cf mcp portals create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({allow_code_mode:f[`allow-code-mode`],code_mode:u(f[`code-mode`],`code-mode`,`text`),description:u(f.description,`description`,`text`),hostname:u(f.hostname,`hostname`,`text`),id:u(f.id,`id`,`text`),name:u(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],servers:c(f.servers,`servers`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.mcp.portals.create({...e,account_id:m})),{successLabel:`Created`});return}f.hostname===void 0&&(f.hostname=await d(`hostname`,`Hostname where the MCP portal is available.`)),f.id===void 0&&(f.id=await d(`id`,`Unique identifier for the MCP portal.`)),f.name===void 0&&(f.name=await d(`name`,`Display name for the MCP portal.`));let h=l({allow_code_mode:f[`allow-code-mode`],code_mode:u(f[`code-mode`],`code-mode`,`text`),description:u(f.description,`description`,`text`),hostname:u(f.hostname,`hostname`,`text`),id:u(f.id,`id`,`text`),name:u(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],servers:c(f.servers,`servers`)});i(await o(`Creating`,async()=>p.mcp.portals.create({...h,account_id:m})),{successLabel:`Created`})}};function y(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,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 <id>`,describe:`Deletes an MCP portal from the account.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf mcp portals delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force,message:`This operation permanently deletes the MCP portal.`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.mcp.portals.delete({account_id:l,id:s.id})),{successLabel:`Deleted`})}};function x(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id, name, hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Lists all MCP portals configured for the account.`,builder:x,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],search:s.search};if(s.dryRun){a({command:`cf mcp portals list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.list({account_id:u,...c})),{successLabel:`Loaded`})}};function C(e){return e.positional(`portal-id`,{type:`string`,description:`Portal ID`,demandOption:!0}).option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`portal-tool-call-timeseries <portal-id>`,describe:`Returns daily or monthly tool-call counts for a portal.`,builder:m(C),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp portals portal-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/portals/${s[`portal-id`]==null?`<portal-id>`:encodeURIComponent(String(s[`portal-id`]))}/tool-calls/timeseries`,pathParams:{"portal-id":String(s[`portal-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.portalToolCallTimeseries({account_id:u,portal_id:s[`portal-id`],...c})),{successLabel:`Loaded`})}};function T(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`read <id>`,describe:`Read the details of a single MCP Portal, including its configured servers.`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf mcp portals read`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mcp.portals.read({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function D(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,demandOption:!0}).option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`}).option(`servers`,{type:`string`,description:`MCP servers attached to the portal and their portal-specific settings. 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 <id>`,describe:`Updates an MCP portal configuration.`,builder:D,handler:async d=>{if(d.dryRun){a({command:`cf mcp portals update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${d.id==null?`<id>`:encodeURIComponent(String(d.id))}`,pathParams:{id:String(d.id??``)},bodyKind:`json`,body:d.body===void 0?l({allow_code_mode:d[`allow-code-mode`],code_mode:u(d[`code-mode`],`code-mode`,`text`),description:u(d.description,`description`,`text`),hostname:u(d.hostname,`hostname`,`text`),name:u(d.name,`name`,`text`),secure_web_gateway:d[`secure-web-gateway`],servers:c(d.servers,`servers`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.mcp.portals.update({...e,account_id:p,id:d.id})),{successLabel:`Updated`});return}let m=l({allow_code_mode:d[`allow-code-mode`],code_mode:u(d[`code-mode`],`code-mode`,`text`),description:u(d.description,`description`,`text`),hostname:u(d.hostname,`hostname`,`text`),name:u(d.name,`name`,`text`),secure_web_gateway:d[`secure-web-gateway`],servers:c(d.servers,`servers`)});i(await o(`Updating`,async()=>f.mcp.portals.update({...m,account_id:p,id:d.id})),{successLabel:`Updated`})}},k={command:`portals`,describe:`Manage MCP portals, attached servers, and Code Mode settings`,builder:e=>e.command(g).command(v).command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`auth-credentials`,{type:`string`,description:'Static credential for the upstream MCP server. For auth_type "bearer", either a raw token string (e.g. "sk-abc123"), which is wrapped server-side as `Authorization: Bearer <token>`, or a JSON-encoded object of the form `{"headers":{"Header-Name":"value",...}}` for custom or multiple static headers (e.g. Cloudflare Access service tokens: `{"headers":{"cf-access-client-id":"...","cf-access-client-secret":"..."}}`).'}).option(`auth-type`,{type:`string`,description:`Authentication method used to connect to the upstream MCP server.`,choices:[`oauth`,`bearer`,`unauthenticated`]}).option(`client-secret`,{type:`string`,description:`Pre-registered OAuth client_secret. Write-only - accepted on create/update when auth_credentials.auth_mode is 'manual'. Stored AES-GCM-encrypted in server_oauth_secrets; never returned by read endpoints.`}).option(`description`,{type:`string`,description:`Optional description of the MCP server.`}).option(`hostname`,{type:`string`,description:`URL of the upstream MCP endpoint.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP server.`}).option(`is-shared-oauth-callback-enabled`,{type:`boolean`,description:`When true, the gateway worker uses the shared Cloudflare-owned OAuth callback endpoint as the redirect_uri for upstream on-behalf OAuth, instead of the customer portal hostname. Defaults to false (off); opt in per server by setting true.`,default:!1}).option(`name`,{type:`string`,description:`Display name for the MCP server.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound traffic to this MCP server through Zero Trust Secure Web Gateway.`,default:!1}).option(`updated-prompts`,{type:`string`,description:`Server-wide prompt capability overrides. Provide as a JSON array of objects or @path/to/file.json.`}).option(`updated-tools`,{type:`string`,description:`Server-wide tool capability overrides. 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 j={command:`create`,describe:`Creates a new MCP server for connecting to an upstream MCP endpoint.`,builder:A,handler:async p=>{if(p.dryRun){a({command:`cf mcp servers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({auth_credentials:u(p[`auth-credentials`],`auth-credentials`,`text`),auth_type:u(p[`auth-type`],`auth-type`,`text`),client_secret:u(p[`client-secret`],`client-secret`,`text`),description:u(p.description,`description`,`text`),hostname:u(p.hostname,`hostname`,`text`),id:u(p.id,`id`,`text`),is_shared_oauth_callback_enabled:p[`is-shared-oauth-callback-enabled`],name:u(p.name,`name`,`text`),secure_web_gateway:p[`secure-web-gateway`],updated_prompts:c(p[`updated-prompts`],`updated-prompts`),updated_tools:c(p[`updated-tools`],`updated-tools`)}):s(p.body)});return}let m=await r(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=s(p.body);i(await o(`Creating`,async()=>m.mcp.servers.create({...e,account_id:h})),{successLabel:`Created`});return}p[`auth-type`]===void 0&&(p[`auth-type`]=await f(`auth-type`,`Authentication method used to connect to the upstream MCP server.`,[`oauth`,`bearer`,`unauthenticated`])),p.hostname===void 0&&(p.hostname=await d(`hostname`,`URL of the upstream MCP endpoint.`)),p.id===void 0&&(p.id=await d(`id`,`Unique identifier for the MCP server.`)),p.name===void 0&&(p.name=await d(`name`,`Display name for the MCP server.`));let g=l({auth_credentials:u(p[`auth-credentials`],`auth-credentials`,`text`),auth_type:u(p[`auth-type`],`auth-type`,`text`),client_secret:u(p[`client-secret`],`client-secret`,`text`),description:u(p.description,`description`,`text`),hostname:u(p.hostname,`hostname`,`text`),id:u(p.id,`id`,`text`),is_shared_oauth_callback_enabled:p[`is-shared-oauth-callback-enabled`],name:u(p.name,`name`,`text`),secure_web_gateway:p[`secure-web-gateway`],updated_prompts:c(p[`updated-prompts`],`updated-prompts`),updated_tools:c(p[`updated-tools`],`updated-tools`)});i(await o(`Creating`,async()=>m.mcp.servers.create({...g,account_id:h})),{successLabel:`Created`})}};function M(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,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 N={command:`delete <id>`,describe:`Deletes an MCP server from the account.`,builder:M,handler:async s=>{if(s.dryRun){a({command:`cf mcp servers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force,message:`This operation permanently deletes the MCP server, removes it from every portal, and deletes its stored OAuth secrets.`})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>c.mcp.servers.delete({account_id:l,id:s.id})),{successLabel:`Deleted`})}};function P(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id, name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists all MCP servers configured for the account.`,builder:P,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],search:s.search};if(s.dryRun){a({command:`cf mcp servers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.servers.list({account_id:u,...c})),{successLabel:`Loaded`})}};function I(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`read <id>`,describe:`Retrieves an MCP server's configuration and capability sync state.`,builder:I,handler:async s=>{if(s.dryRun){a({command:`cf mcp servers read`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mcp.servers.read({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function R(e){return e.positional(`server-id`,{type:`string`,description:`Server ID`,demandOption:!0}).option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`server-tool-call-timeseries <server-id>`,describe:`Returns daily or monthly tool-call counts for a server.`,builder:m(R),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp servers server-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/servers/${s[`server-id`]==null?`<server-id>`:encodeURIComponent(String(s[`server-id`]))}/tool-calls/timeseries`,pathParams:{"server-id":String(s[`server-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.servers.serverToolCallTimeseries({account_id:u,server_id:s[`server-id`],...c})),{successLabel:`Loaded`})}};function B(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`sync <id>`,describe:`Syncs an MCP server's capabilities and returns the updated server state, including any connection errors.`,builder:B,handler:async s=>{if(s.dryRun){a({command:`cf mcp servers sync`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/sync`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.mcp.servers.sync({account_id:l,id:s.id})),{successLabel:`Created`})}};function H(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`auth-credentials`,{type:`string`,description:'Static credential for the upstream MCP server. For auth_type "bearer", either a raw token string (e.g. "sk-abc123"), which is wrapped server-side as `Authorization: Bearer <token>`, or a JSON-encoded object of the form `{"headers":{"Header-Name":"value",...}}` for custom or multiple static headers (e.g. Cloudflare Access service tokens: `{"headers":{"cf-access-client-id":"...","cf-access-client-secret":"..."}}`).'}).option(`client-secret`,{type:`string`,description:`Pre-registered OAuth client_secret. Write-only - accepted on create/update when auth_credentials.auth_mode is 'manual'. Stored AES-GCM-encrypted in server_oauth_secrets; never returned by read endpoints.`}).option(`description`,{type:`string`,description:`Optional description of the MCP server.`}).option(`is-shared-oauth-callback-enabled`,{type:`boolean`,description:`When true, the gateway worker uses the shared Cloudflare-owned OAuth callback endpoint as the redirect_uri for upstream on-behalf OAuth, instead of the customer portal hostname. Defaults to false (off); opt in per server by setting true.`}).option(`name`,{type:`string`,description:`Display name for the MCP server.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound traffic to this MCP server through Zero Trust Secure Web Gateway.`}).option(`updated-prompts`,{type:`string`,description:`Server-wide prompt capability overrides. Provide as a JSON array of objects or @path/to/file.json.`}).option(`updated-tools`,{type:`string`,description:`Server-wide tool capability overrides. 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 U={command:`update <id>`,describe:`Updates an MCP server's configuration and credentials.`,builder:H,handler:async d=>{if(d.dryRun){a({command:`cf mcp servers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${d.id==null?`<id>`:encodeURIComponent(String(d.id))}`,pathParams:{id:String(d.id??``)},bodyKind:`json`,body:d.body===void 0?l({auth_credentials:u(d[`auth-credentials`],`auth-credentials`,`text`),client_secret:u(d[`client-secret`],`client-secret`,`text`),description:u(d.description,`description`,`text`),is_shared_oauth_callback_enabled:d[`is-shared-oauth-callback-enabled`],name:u(d.name,`name`,`text`),secure_web_gateway:d[`secure-web-gateway`],updated_prompts:c(d[`updated-prompts`],`updated-prompts`),updated_tools:c(d[`updated-tools`],`updated-tools`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.mcp.servers.update({...e,account_id:p,id:d.id})),{successLabel:`Updated`});return}let m=l({auth_credentials:u(d[`auth-credentials`],`auth-credentials`,`text`),client_secret:u(d[`client-secret`],`client-secret`,`text`),description:u(d.description,`description`,`text`),is_shared_oauth_callback_enabled:d[`is-shared-oauth-callback-enabled`],name:u(d.name,`name`,`text`),secure_web_gateway:d[`secure-web-gateway`],updated_prompts:c(d[`updated-prompts`],`updated-prompts`),updated_tools:c(d[`updated-tools`],`updated-tools`)});i(await o(`Updating`,async()=>f.mcp.servers.update({...m,account_id:p,id:d.id})),{successLabel:`Updated`})}},W={command:`servers`,describe:`Manage upstream MCP servers, credentials, capabilities, and sync state`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`mcp`,describe:`mcp`,builder:e=>e.command(k).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,t as c}from"./body-parser-BshbixEq.mjs";import{n as l}from"./input-validation-QDIYu7Vb.mjs";import{a as u,i as d,n as f}from"./prompt-B0sWIs9c.mjs";import{t as p}from"./cli-types-DAYeL_Mj.mjs";function m(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <tunnel-id>`,describe:`Gets the high-availability configuration for a WARP Connector tunnel.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.configurations.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-fnr-id`,{type:`string`,description:`Floating Network Resource ID — the secondary ENI that is moved between nodes on failover.`}).option(`ha-mode`,{type:`string`,description:"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",choices:[`none`,`disabled`,`aws`,`local`]}).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:`update <tunnel-id>`,describe:`Adds or updates the high-availability configuration for a WARP Connector tunnel.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)}):s(u.body)});return}let f=await r(u),p=u.local?e:await t();if(u.accountId=p,u.body){let e=s(u.body);i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...e,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}u[`ha-mode`]===void 0&&(u[`ha-mode`]=await d(`ha-mode`,"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",[`none`,`disabled`,`aws`,`local`]));let m=c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)});i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...m,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}},v={command:`configurations`,describe:`Operations for nodes.configurations`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches connection details for a WARP Connector Tunnel.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connections.list({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},x={command:`connections`,describe:`Operations for nodes.connections`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <connector-id>`,describe:`Fetches connector and connection details for a WARP Connector Tunnel.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``),"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connectors.get({account_id:l,tunnel_id:s[`tunnel-id`],connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},w={command:`connectors`,describe:`Operations for nodes.connectors`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`ha`,{type:`boolean`,description:`Indicates that the tunnel will be created to be highly available. If omitted, defaults to false.`,default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Creates a new Warp Connector Tunnel in an account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ha:d.ha,name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mesh.nodes.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for a tunnel.`));let m=c({ha:d.ha,name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.mesh.nodes.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,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 O={command:`delete <tunnel-id>`,describe:`Deletes a Warp Connector Tunnel from an account.`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation permanently deletes a Mesh node (Warp Connector Tunnel).`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,i as d,n as f}from"./prompt-CyATfGUu.mjs";import{t as p}from"./cli-types-C3nVfpSG.mjs";function m(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <tunnel-id>`,describe:`Gets the high-availability configuration for a WARP Connector tunnel.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.configurations.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-fnr-id`,{type:`string`,description:`Floating Network Resource ID — the secondary ENI that is moved between nodes on failover.`}).option(`ha-mode`,{type:`string`,description:"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",choices:[`none`,`disabled`,`aws`,`local`]}).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:`update <tunnel-id>`,describe:`Adds or updates the high-availability configuration for a WARP Connector tunnel.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)}):s(u.body)});return}let f=await r(u),p=u.local?e:await t();if(u.accountId=p,u.body){let e=s(u.body);i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...e,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}u[`ha-mode`]===void 0&&(u[`ha-mode`]=await d(`ha-mode`,"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",[`none`,`disabled`,`aws`,`local`]));let m=c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)});i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...m,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}},v={command:`configurations`,describe:`Operations for nodes.configurations`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches connection details for a WARP Connector Tunnel.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connections.list({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},x={command:`connections`,describe:`Operations for nodes.connections`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <connector-id>`,describe:`Fetches connector and connection details for a WARP Connector Tunnel.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``),"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connectors.get({account_id:l,tunnel_id:s[`tunnel-id`],connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},w={command:`connectors`,describe:`Operations for nodes.connectors`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`ha`,{type:`boolean`,description:`Indicates that the tunnel will be created to be highly available. If omitted, defaults to false.`,default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Creates a new Warp Connector Tunnel in an account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ha:d.ha,name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mesh.nodes.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for a tunnel.`));let m=c({ha:d.ha,name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.mesh.nodes.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,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 O={command:`delete <tunnel-id>`,describe:`Deletes a Warp Connector Tunnel from an account.`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation permanently deletes a Mesh node (Warp Connector Tunnel).`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.mesh.nodes.delete({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).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 A={command:`edit <tunnel-id>`,describe:`Updates an existing Warp Connector Tunnel.`,builder:k,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.mesh.nodes.edit({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Updating`,async()=>d.mesh.nodes.edit({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`failover <tunnel-id>`,describe:`Triggers a manual failover for a specific WARP Connector Tunnel, setting the specified client as the active connector. The tunnel must be configured for high availability (HA) and the client must be linked to the tunnel.`,builder:j,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes failover`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${d[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(d[`tunnel-id`]))}/failover`,pathParams:{"tunnel-id":String(d[`tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({client_id:l(d[`connector-id`],`connector-id`,`text`)}):s(d.body)});return}let p=await r(d),m=d.local?e:await t();if(d.accountId=m,!await f({force:!!d.force,message:`This operation triggers a manual failover, changing the active connector for a Mesh node.`})){process.stderr.write(`Aborted.
4
4
  `);return}if(d.body){let e=s(d.body);i(await o(`Deleting`,async()=>p.mesh.nodes.failover({...e,account_id:m,tunnel_id:d[`tunnel-id`]})),{successLabel:`Deleted`});return}d[`connector-id`]===void 0&&(d[`connector-id`]=await u(`connector-id`,`UUID of the Cloudflare Tunnel connector.`));let h=c({client_id:l(d[`connector-id`],`connector-id`,`text`)});i(await o(`Deleting`,async()=>p.mesh.nodes.failover({...h,account_id:m,tunnel_id:d[`tunnel-id`]})),{successLabel:`Deleted`})}};function N(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <tunnel-id>`,describe:`Fetches a single Warp Connector Tunnel.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for the tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Lists and filters Warp Connector Tunnels in an account.`,builder:p(F),handler:async s=>{let c={name:s.name,is_deleted:s[`is-deleted`],existed_at:s[`existed-at`],uuid:s.uuid,was_active_at:s[`was-active-at`],was_inactive_at:s[`was-inactive-at`],include_prefix:s[`include-prefix`],exclude_prefix:s[`exclude-prefix`],status:s.status,per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf mesh nodes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mesh.nodes.list({account_id:u,...c})),{successLabel:`Loaded`})}};function L(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <tunnel-id>`,describe:`Gets the token used to associate warp device with a specific Warp Connector tunnel.`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes token get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/token`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.token.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},z={command:`token`,describe:`Operations for nodes.token`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`nodes`,describe:`Operations for nodes`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(I).command(v).command(x).command(w).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`mesh`,describe:`mesh`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,t as c}from"./body-parser-BshbixEq.mjs";import{n as l}from"./input-validation-QDIYu7Vb.mjs";import{a as u,n as d}from"./prompt-B0sWIs9c.mjs";function f(e){return e.option(`name`,{type:`string`,description:`Human-readable name for the relay.`}).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:"Provisions a new MoQ relay instance. Auto-creates a publish+subscribe token and a subscribe-only token. Token values are included in the response (shown once). Config is always set to defaults (upstreams off) and cannot be supplied here — sending a non-empty `config` is rejected (21014); `null` or `{}` is accepted as absent. Use PUT to configure the relay after it exists.",builder:f,handler:async d=>{if(d.dryRun){a({command:`cf moq relays create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.moq.relays.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Human-readable name for the relay.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.moq.relays.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,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 h={command:`delete <relay-id>`,describe:"Soft-deletes a MoQ relay. The relay ID goes in the URL path — `DELETE /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level delete endpoint.",builder:m,handler:async s=>{if(s.dryRun){a({command:`cf moq relays delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Deleting this relay revokes every token issued for it, so publishers and subscribers can no longer connect. This cannot be undone.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,n as d}from"./prompt-CyATfGUu.mjs";function f(e){return e.option(`name`,{type:`string`,description:`Human-readable name for the relay.`}).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:"Provisions a new MoQ relay instance. Auto-creates a publish+subscribe token and a subscribe-only token. Token values are included in the response (shown once). Config is always set to defaults (upstreams off) and cannot be supplied here — sending a non-empty `config` is rejected (21014); `null` or `{}` is accepted as absent. Use PUT to configure the relay after it exists.",builder:f,handler:async d=>{if(d.dryRun){a({command:`cf moq relays create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.moq.relays.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Human-readable name for the relay.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.moq.relays.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,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 h={command:`delete <relay-id>`,describe:"Soft-deletes a MoQ relay. The relay ID goes in the URL path — `DELETE /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level delete endpoint.",builder:m,handler:async s=>{if(s.dryRun){a({command:`cf moq relays delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Deleting this relay revokes every token issued for it, so publishers and subscribers can no longer connect. This cannot be undone.`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.moq.relays.delete({account_id:l,relay_id:s[`relay-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`relay-id`,{type:`string`,description:`Relay unique identifier (32 hex characters).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <relay-id>`,describe:`Retrieves a single MoQ relay including config and status. Tokens are NOT included.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf moq relays get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/moq/relays/${s[`relay-id`]==null?`<relay-id>`:encodeURIComponent(String(s[`relay-id`]))}`,pathParams:{"relay-id":String(s[`relay-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.moq.relays.get({account_id:l,relay_id:s[`relay-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`created-before`,{type:`string`,description:`Cursor for pagination. Returns relays created strictly before this
4
4
  RFC 3339 timestamp (typically the \`created\` value of the first item
5
5
  on the current page, to fetch the previous page).`}).option(`created-after`,{type:`string`,description:`Cursor for pagination. Returns relays created strictly after this
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,t as c}from"./body-parser-BshbixEq.mjs";import{n as l}from"./input-validation-QDIYu7Vb.mjs";import{a as u,n as d}from"./prompt-B0sWIs9c.mjs";import{t as f}from"./cli-types-DAYeL_Mj.mjs";function p(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).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:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async d=>{if(d.dryRun){a({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(d.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);d.certificates===void 0&&(d.certificates=await u(`certificates`,`The uploaded root CA certificate.`));let m=c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)});i(await o(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,n as d}from"./prompt-CyATfGUu.mjs";import{t as f}from"./cli-types-C3nVfpSG.mjs";function p(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).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:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async d=>{if(d.dryRun){a({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(d.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);d.certificates===void 0&&(d.certificates=await u(`certificates`,`The uploaded root CA certificate.`));let m=c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)});i(await o(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.mtlsCertificates.delete({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.get({account_id:l,mtls_certificate_id:s[`mtls-certificate-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:f(S),handler:async s=>{let c={type:s.type};if(s.dryRun){a({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mtlsCertificates.list({account_id:u,...c})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`mtls-certificates`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};