cf 0.9.0 → 0.10.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 (262) hide show
  1. package/README.md +5 -0
  2. package/dist/_meta/agent-context.json +34 -35
  3. package/dist/_meta/commands.json +6834 -10044
  4. package/dist/_meta/schemas.json +11228 -12752
  5. package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CGF4zcKf.mjs} +2 -2
  6. package/dist/{access-RbqBFrSC.mjs → access-lhLJo1v2.mjs} +1 -1
  7. package/dist/{account-D7xvYqDx.mjs → account-CYRm3yoN.mjs} +1 -1
  8. package/dist/account-tags-B88TotoH.mjs +9 -0
  9. package/dist/accounts-BSIAT_iP.mjs +28 -0
  10. package/dist/{acm-Szq4CoQN.mjs → acm-VULm1djv.mjs} +1 -1
  11. package/dist/{addressing-CgTTbuCF.mjs → addressing-BHPBIkRY.mjs} +1 -1
  12. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-KBy48G1b.mjs} +1 -1
  13. package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-DDv_Gxr7.mjs} +2 -2
  14. package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-BWZGvbca.mjs} +1 -1
  15. package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-jeB-sAgP.mjs} +1 -1
  16. package/dist/ai-search-BmdskMjR.mjs +7 -0
  17. package/dist/{ai-security-AUfzagSE.mjs → ai-security-CsmfcaUx.mjs} +1 -1
  18. package/dist/{ai-Cn0BniR4.mjs → ai-viHB1tgI.mjs} +1 -1
  19. package/dist/{alerting-DbXVpGv3.mjs → alerting-Bl8OqViR.mjs} +4 -4
  20. package/dist/analytics-vOxw8Hy0.mjs +3 -0
  21. package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-DO4-C0wD.mjs} +1 -1
  22. package/dist/{api-security-pSJdgmtK.mjs → api-security-4FVrD4n8.mjs} +1 -1
  23. package/dist/argo-CQfCgazW.mjs +2 -0
  24. package/dist/args-DlUhyGU0.mjs +2 -0
  25. package/dist/artifacts-CVDGnr2V.mjs +4 -0
  26. package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-CzpwvQ6A.mjs} +1 -1
  27. package/dist/{auth-MeSu8lFz.mjs → auth-D0xZxAEa.mjs} +1 -1
  28. package/dist/{auth-C6MhC9EZ.mjs → auth-MQEamPN9.mjs} +2 -2
  29. package/dist/{billing-0RNCYBJM.mjs → billing-aJgapeRm.mjs} +2 -2
  30. package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Y2q5d-pi.mjs} +1 -1
  31. package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-DANJqfmE.mjs} +1 -1
  32. package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CjpZWBjp.mjs} +1 -1
  33. package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-BtpCbh-2.mjs} +1 -1
  34. package/dist/browser-run-BFn9h2Tz.mjs +4 -0
  35. package/dist/{build-Nivzj54_.mjs → build-DcflwvqN.mjs} +1 -1
  36. package/dist/{cache-BgRIDcFJ.mjs → cache-VyWK1SjY.mjs} +1 -1
  37. package/dist/{calls-JrRne0U0.mjs → calls-BxoRYxs4.mjs} +1 -1
  38. package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-D7OAFxF_.mjs} +1 -1
  39. package/dist/{cf-BUKsENG5.mjs → cf-C7DU4819.mjs} +2 -2
  40. package/dist/{chunk-LQW53VED-Xakf_rUn.mjs → chunk-LQW53VED-DLrXV-hE.mjs} +2 -2
  41. package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-DDUv8K0a.mjs} +1 -1
  42. package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-D4ysjwWT.mjs} +1 -1
  43. package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-Bhec6z2P.mjs} +1 -1
  44. package/dist/cloudforce-one-J_hn9ss9.mjs +36 -0
  45. package/dist/config.mjs +1 -1
  46. package/dist/connector-interrupts-Dycx8zFx.mjs +2 -0
  47. package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-BmxOSNtN.mjs} +1 -1
  48. package/dist/connector-telemetry-events-latest-BY2556uL.mjs +2 -0
  49. package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CdcqfKnH.mjs} +1 -1
  50. package/dist/connector-telemetry-snapshots-latest-BHYdxUEF.mjs +2 -0
  51. package/dist/{connectors-BRCQSsos.mjs → connectors-BqxYMMtQ.mjs} +1 -1
  52. package/dist/{containers-CfKOM_f5.mjs → containers-CKW081JA.mjs} +8 -8
  53. package/dist/{content-scan-CB4xHGv1.mjs → content-scan-Dgd7A8KF.mjs} +1 -1
  54. package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DYL37wLc.mjs} +1 -1
  55. package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-CkhSbfAs.mjs} +1 -1
  56. package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-BzAOnEoT.mjs} +1 -1
  57. package/dist/custom-csrs-CgzG3pd3.mjs +3 -0
  58. package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-q_nsnlye.mjs} +4 -4
  59. package/dist/custom-nameservers-BUBmfhUe.mjs +3 -0
  60. package/dist/custom-pages-M7jA2Hit.mjs +3 -0
  61. package/dist/{d1-FmAh7T7l.mjs → d1-BFvMd6-S.mjs} +1 -1
  62. package/dist/{data-security-2fmzF_Me.mjs → data-security-Bji4Or_j.mjs} +2 -2
  63. package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-BuoRQ1Yh.mjs} +1 -1
  64. package/dist/{deploy-BzFbjH6a.mjs → deploy-CZ7bgNDu.mjs} +1 -1
  65. package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-CrvuoDGJ.mjs} +1 -1
  66. package/dist/{dev-CWaf-qW4.mjs → dev-V10MG-Bg.mjs} +1 -1
  67. package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-BTH-8nJH.mjs} +2 -2
  68. package/dist/{directory-CGNWfVQc.mjs → directory-BlH6N6Qy.mjs} +1 -1
  69. package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-BCjH1JzB.mjs} +1 -1
  70. package/dist/{dist-COfwjT96.mjs → dist-CgrMkXFx.mjs} +1 -1
  71. package/dist/{dls-CobKlH4N.mjs → dls-BF5iN78p.mjs} +1 -1
  72. package/dist/{dns-OfJXNYkK.mjs → dns-CeCTNqRk.mjs} +11 -11
  73. package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-B54MaLGm.mjs} +1 -1
  74. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
  75. package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-D8FQORrL.mjs} +1 -1
  76. package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DJK0Eb30.mjs} +1 -1
  77. package/dist/email-routing-NpmiKIrl.mjs +6 -0
  78. package/dist/{email-security-D-P8ln2L.mjs → email-security-BLZ7WZ9Z.mjs} +2 -2
  79. package/dist/email-sending-dn-353Nx.mjs +7 -0
  80. package/dist/fieldExtractors-ahysj57J.mjs +3 -0
  81. package/dist/firewall-CBPGJ43p.mjs +11 -0
  82. package/dist/{flagship-CPkQMist.mjs → flagship-BusjRNIb.mjs} +3 -3
  83. package/dist/{fraud-BhX0QNUl.mjs → fraud-BIhS8pLf.mjs} +1 -1
  84. package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-TZZ3F1tV.mjs} +1 -1
  85. package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-FiXIk-KP.mjs} +2 -2
  86. package/dist/{hostnames-CGAFkYT1.mjs → hostnames-Bx0mykMR.mjs} +1 -1
  87. package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-C8qCabBF.mjs} +1 -1
  88. package/dist/{iam-Su_hpatD.mjs → iam-Cj63Kjc6.mjs} +1 -1
  89. package/dist/{images-D2ZflvBi.mjs → images-CBWXCDhy.mjs} +1 -1
  90. package/dist/index.mjs +1 -1
  91. package/dist/{intel-DPGzVovJ.mjs → intel-B-9Z_sJs.mjs} +2 -2
  92. package/dist/{interactive-CM2G03lr.mjs → interactive-DtsCYfrK.mjs} +1 -1
  93. package/dist/{ips-C5-NH1b0.mjs → ips-qs9eGJnI.mjs} +1 -1
  94. package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-THHvoXX3.mjs} +1 -1
  95. package/dist/{keys-B0FBtlOD.mjs → keys-D7N0j4-x.mjs} +1 -1
  96. package/dist/{kv-BbZ9st5o.mjs → kv-BFDUCnft.mjs} +1 -1
  97. package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DUlUCOoJ.mjs} +1 -1
  98. package/dist/load-balancers-D2zbQ8fT.mjs +6 -0
  99. package/dist/{local-eEF0NF51.mjs → local-D-aVNu6A.mjs} +1 -1
  100. package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-Dh3keC5v.mjs} +1 -1
  101. package/dist/logexplorer-CUsfZ_bS.mjs +13 -0
  102. package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-CJcthPHf.mjs} +1 -1
  103. package/dist/{logos-DS0krPAz.mjs → logos-BS65zN8q.mjs} +1 -1
  104. package/dist/logpush-BK34mMQs.mjs +4 -0
  105. package/dist/{logs-C07M9zn-.mjs → logs-CLAqX9h2.mjs} +1 -1
  106. package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-h_ozrC5S.mjs} +1 -1
  107. package/dist/magic-network-monitoring-C7tAPNKP.mjs +4 -0
  108. package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-BtsFePMx.mjs} +5 -5
  109. package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-Cm_KVCMB.mjs} +1 -1
  110. package/dist/{matches-CIaCrdrs.mjs → matches-InA1hwII.mjs} +1 -1
  111. package/dist/{mcp-D2afM8MD.mjs → mcp-mJ7bekNJ.mjs} +1 -1
  112. package/dist/mesh-BK4S1Ezy.mjs +4 -0
  113. package/dist/{moq-BBQVNGo1.mjs → moq-qmuVPAO0.mjs} +1 -1
  114. package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-CU4OAAXY.mjs} +1 -1
  115. package/dist/{network-CmuJqtFJ.mjs → network-D74cSy3t.mjs} +1 -1
  116. package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-BJ0Nc48J.mjs} +1 -1
  117. package/dist/{oauth-BjHjJtnn.mjs → oauth-B0ETkNcX.mjs} +2 -2
  118. package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-Br-smLxQ.mjs} +1 -1
  119. package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-D5bF11ju.mjs} +1 -1
  120. package/dist/observability-BWE0Gg3V.mjs +4 -0
  121. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-R-qesf18.mjs} +1 -1
  122. package/dist/{organization-DQIfNVCT.mjs → organization-NX7yCZrq.mjs} +1 -1
  123. package/dist/{organizations-L_ycAy6r.mjs → organizations-DLhiRt8g.mjs} +1 -1
  124. package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-Ff4McZRQ.mjs} +1 -1
  125. package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-UuTr4_SW.mjs} +1 -1
  126. package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DOJ1zlH3.mjs} +1 -1
  127. package/dist/{output-DgW1hQGX.mjs → output-DrpYYfnB.mjs} +1 -1
  128. package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-BSz1gO-_.mjs} +1 -1
  129. package/dist/{pages-CskAn5mR.mjs → pages-DVDogxPs.mjs} +4 -4
  130. package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-BrLXK7gT.mjs} +1 -1
  131. package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-BszRk4sM.mjs} +2 -2
  132. package/dist/{precursor-DgRWBN9_.mjs → precursor-BPNjQr76.mjs} +1 -1
  133. package/dist/progress-CsHIt3Tp.mjs +2 -0
  134. package/dist/{prompt-DM4z101s.mjs → prompt-DdegNPpg.mjs} +1 -1
  135. package/dist/{queries-DrqcK0ZX.mjs → queries-JL1H1Biz.mjs} +1 -1
  136. package/dist/{queues-CutvMZcc.mjs → queues-DpkYdRUE.mjs} +1 -1
  137. package/dist/{r2-sFI62vhq.mjs → r2-CKozthw_.mjs} +4 -4
  138. package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-Du7hN9jA.mjs} +1 -1
  139. package/dist/radar-C-92vggG.mjs +2 -0
  140. package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-yBF3qoYD.mjs} +1 -1
  141. package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-CteyTOM2.mjs} +1 -1
  142. package/dist/realtimekit-CIP7lP-a.mjs +7 -0
  143. package/dist/{registrar-C0EsXf83.mjs → registrar-DKKN0M29.mjs} +3 -3
  144. package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-DiXg8p_1.mjs} +3 -3
  145. package/dist/{registry-CJvn75Bq.mjs → registry-Bck_zFkz.mjs} +1 -1
  146. package/dist/{reporting-BB6sqe6r.mjs → reporting-fg_GKXe1.mjs} +1 -1
  147. package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-CkMya96z.mjs} +1 -1
  148. package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-D1pSDvtf.mjs} +1 -1
  149. package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-z48JGHCq.mjs} +1 -1
  150. package/dist/{rules-C2BxykEe.mjs → rules-BTmNjDN-.mjs} +1 -1
  151. package/dist/rulesets-CsoSM-17.mjs +5 -0
  152. package/dist/{rum-Dyno5zj3.mjs → rum-DB4iO2q5.mjs} +1 -1
  153. package/dist/{schema-BeXPWeK9.mjs → schema-B34Q9tLF.mjs} +1 -1
  154. package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-iGoOriJt.mjs} +1 -1
  155. package/dist/{scim-Bb2xHpIz.mjs → scim-CcSyfKCH.mjs} +1 -1
  156. package/dist/sdk-ZctLa5jW.mjs +3 -0
  157. package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-DFmvtphu.mjs} +1 -1
  158. package/dist/security-center-DFKeHq5c.mjs +2 -0
  159. package/dist/{security-txt-Bh_2gymk.mjs → security-txt-DqnFpjMI.mjs} +1 -1
  160. package/dist/{session-Br-q_UIW.mjs → session-D6KHthHf.mjs} +1 -1
  161. package/dist/{share-DfTpOxhk.mjs → share-BuwYUzOL.mjs} +1 -1
  162. package/dist/{shared-BNjZc02w.mjs → shared-VppSAQf4.mjs} +1 -1
  163. package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-D6X8L7p8.mjs} +2 -2
  164. package/dist/{snippets-nSLwH8uJ.mjs → snippets-DIpc9pb_.mjs} +1 -1
  165. package/dist/{spawn-Bj8QRFJ5.mjs → spawn-O1RS01vr.mjs} +2 -2
  166. package/dist/{spectrum-DuhSUTZI.mjs → spectrum-b7N1ZRAm.mjs} +1 -1
  167. package/dist/{speed-Dgby_e1J.mjs → speed-cw31yFva.mjs} +1 -1
  168. package/dist/src-D_HETJNy.mjs +108 -0
  169. package/dist/{ssl-BsxTHasY.mjs → ssl-CsEhRVTO.mjs} +1 -1
  170. package/dist/{state-C1m9nwUm.mjs → state-Bb5Cbc_L.mjs} +1 -1
  171. package/dist/{stream-CkEOX5Ko.mjs → stream-DFOao6Gu.mjs} +3 -3
  172. package/dist/{submit-BjdywxTq.mjs → submit--xTzyNPy.mjs} +1 -1
  173. package/dist/{tags-CFAw_Sce.mjs → tags-efICDkah.mjs} +1 -1
  174. package/dist/{tenant-C66iOy5O.mjs → tenant-CerHuToJ.mjs} +1 -1
  175. package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-C4otMBm2.mjs} +1 -1
  176. package/dist/{tools-D2Xxfkrc.mjs → tools-BHfBOZOU.mjs} +1 -1
  177. package/dist/{triggers-Dv22ZXM4.mjs → triggers-BEsiiKAf.mjs} +1 -1
  178. package/dist/{tunnel-BatkLdds.mjs → tunnel-DkMiNtVY.mjs} +1 -1
  179. package/dist/{tunnels-CstoXOoq.mjs → tunnels-D0J8lJoI.mjs} +1 -1
  180. package/dist/{turnstile-IoRtama4.mjs → turnstile-CFmtY5bn.mjs} +2 -2
  181. package/dist/{ui-DjQ4AQww.mjs → ui-DE8CNn6c.mjs} +1 -1
  182. package/dist/{url-info-Hjhwr2la.mjs → url-info-DBCeRWwb.mjs} +1 -1
  183. package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-ClfFiruK.mjs} +1 -1
  184. package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-CNyvg65L.mjs} +1 -1
  185. package/dist/{user-CVHm-cnB.mjs → user-bifVEQq5.mjs} +2 -2
  186. package/dist/{values-Cmlw5wGZ.mjs → values-OxkdP1tV.mjs} +1 -1
  187. package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CVKu7lEt.mjs} +1 -1
  188. package/dist/{versions-CU6Av1vh.mjs → versions-BVL-Ludh.mjs} +1 -1
  189. package/dist/waiting-rooms-CmRAl51T.mjs +11 -0
  190. package/dist/{web-assets-DmSKaxzf.mjs → web-assets-C2s9kzWf.mjs} +1 -1
  191. package/dist/{web3-DVv4jNul.mjs → web3-y_cY91V_.mjs} +1 -1
  192. package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B55-oXOa.mjs} +4 -4
  193. package/dist/{workers-D8czeT64.mjs → workers-jDcq14GH.mjs} +6 -6
  194. package/dist/{workflows-BOi5MTEN.mjs → workflows-B-kGHxFu.mjs} +2 -2
  195. package/dist/{zaraz-CGSSFJng.mjs → zaraz-27zwjLvv.mjs} +1 -1
  196. package/dist/zero-trust-DV3sIOvu.mjs +92 -0
  197. package/dist/{zone-Bx5ElO9U.mjs → zone-BJix2KQ9.mjs} +1 -1
  198. package/dist/{zones-_SnlZMiM.mjs → zones-Bkj5i92c.mjs} +1 -1
  199. package/package.json +2 -2
  200. package/dist/account-tags-CKRh1jra.mjs +0 -9
  201. package/dist/accounts-2pGhN4s8.mjs +0 -28
  202. package/dist/ai-search-2xP8FP_W.mjs +0 -7
  203. package/dist/analytics-UQrIx99t.mjs +0 -3
  204. package/dist/argo-Br60zF3y.mjs +0 -2
  205. package/dist/artifacts-D8HMRQmb.mjs +0 -4
  206. package/dist/browser-run-C5pYOwtf.mjs +0 -4
  207. package/dist/cloudforce-one-Cp4bQmrG.mjs +0 -30
  208. package/dist/connector-interrupts-BR47snkh.mjs +0 -2
  209. package/dist/custom-csrs-D0zBkQT5.mjs +0 -4
  210. package/dist/custom-nameservers-G2MWpRwY.mjs +0 -3
  211. package/dist/custom-pages-BINNZTds.mjs +0 -4
  212. package/dist/email-CGOC_evd.mjs +0 -2
  213. package/dist/email-routing-CRvIUSFm.mjs +0 -6
  214. package/dist/email-sending-BwRN8PMW.mjs +0 -7
  215. package/dist/filters-DczM8qpH.mjs +0 -4
  216. package/dist/firewall-BMiETRmM.mjs +0 -11
  217. package/dist/load-balancers-Ct5cyyF9.mjs +0 -7
  218. package/dist/logexplorer-BhsAWxCr.mjs +0 -24
  219. package/dist/logpush-CFQBi88z.mjs +0 -5
  220. package/dist/magic-network-monitoring-CY3CHSpX.mjs +0 -4
  221. package/dist/media-CnxgOViL.mjs +0 -2
  222. package/dist/mesh-DLNLi3UT.mjs +0 -4
  223. package/dist/observability-B5p3iwrq.mjs +0 -4
  224. package/dist/progress-C-oFUtvC.mjs +0 -2
  225. package/dist/radar-Cu9rsTw_.mjs +0 -2
  226. package/dist/realtimekit-msnGHBbf.mjs +0 -7
  227. package/dist/rulesets-BHvhAeG_.mjs +0 -8
  228. package/dist/sdk-m4xeaua4.mjs +0 -3
  229. package/dist/security-center-DRC4Mf3R.mjs +0 -2
  230. package/dist/src-CgAVPA4I.mjs +0 -108
  231. package/dist/waiting-rooms-ku9UsAr9.mjs +0 -11
  232. package/dist/zero-trust-BmA0VkgF.mjs +0 -102
  233. package/dist/zone-tags-izd3WWmy.mjs +0 -9
  234. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  235. /package/dist/{alerts-B85uj2Vx.mjs → alerts-CRmjqOZi.mjs} +0 -0
  236. /package/dist/{autorag-Do9l_LyY.mjs → autorag-BD7cu5NU.mjs} +0 -0
  237. /package/dist/{body-parser-CYD7PKFC.mjs → body-parser-C-c9gfH1.mjs} +0 -0
  238. /package/dist/{brands-DateHCdd.mjs → brands-BhALBkX2.mjs} +0 -0
  239. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
  240. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  241. /package/dist/{clear-CB2kgcEB.mjs → clear-BgF8No7D.mjs} +0 -0
  242. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-BsTty22w.mjs} +0 -0
  243. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C50W5GhA.mjs} +0 -0
  244. /package/dist/{health-buY5f5pp.mjs → health-BFNZqiAm.mjs} +0 -0
  245. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-Bav2M9F-.mjs} +0 -0
  246. /package/dist/{internal-CwyoJUHh.mjs → internal-BTeSewwB.mjs} +0 -0
  247. /package/dist/{live-wEpA5V_n.mjs → live-Dkiyu30_.mjs} +0 -0
  248. /package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BwQqexwo-CNW_dPly.mjs} +0 -0
  249. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-Dz-Wv1T0.mjs} +0 -0
  250. /package/dist/{ready-CBSCPiHE.mjs → ready-TKOkKeRg.mjs} +0 -0
  251. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-3Asm6eIi.mjs} +0 -0
  252. /package/dist/{refute-u7ZPQJZy.mjs → refute-BVz9nMyd.mjs} +0 -0
  253. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-CeBbH6Pq.mjs} +0 -0
  254. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-ZteA-PUV.mjs} +0 -0
  255. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-DWDSyzQ7.mjs} +0 -0
  256. /package/dist/{search-D9WDwnV4.mjs → search-DGNc37HK.mjs} +0 -0
  257. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-B5Qpn2mn.mjs} +0 -0
  258. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-FjUolE6A.mjs} +0 -0
  259. /package/dist/{theme-BePJemMn.mjs → theme-CeVf-5qG.mjs} +0 -0
  260. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-NHJj1HGq.mjs} +0 -0
  261. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CniKVHIp.mjs} +0 -0
  262. /package/dist/{verify-2yi0H93r.mjs → verify-DS1PWAJe.mjs} +0 -0
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){a({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});i(await o(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){a({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"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.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,n as f}from"./prompt-DM4z101s.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const h={command:`create`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async r=>{if(r.dryRun){o({command:`cf custom-csrs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({common_name:u(r[`common-name`],`common-name`,`text`),country:u(r.country,`country`,`text`),description:u(r.description,`description`,`text`),key_type:u(r[`key-type`],`key-type`,`text`),locality:u(r.locality,`locality`,`text`),name:u(r.name,`name`,`text`),organization:u(r.organization,`organization`,`text`),organizational_unit:u(r[`organizational-unit`],`organizational-unit`,`text`),sans:r.sans,state:u(r.state,`state`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.customCsrs.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`common-name`]===void 0&&(r[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),r.country===void 0&&(r.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),r.locality===void 0&&(r.locality=await d(`locality`,`City or locality name.`)),r.organization===void 0&&(r.organization=await d(`organization`,`Organization name.`)),r.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);r.state===void 0&&(r.state=await d(`state`,`State or province name.`));let m=l({common_name:u(r[`common-name`],`common-name`,`text`),country:u(r.country,`country`,`text`),description:u(r.description,`description`,`text`),key_type:u(r[`key-type`],`key-type`,`text`),locality:u(r.locality,`locality`,`text`),name:u(r.name,`name`,`text`),organization:u(r.organization,`organization`,`text`),organizational_unit:u(r[`organizational-unit`],`organizational-unit`,`text`),sans:r.sans,state:u(r.state,`state`,`text`)});a(await s(`Creating`,async()=>f.customCsrs.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required. The list should include the common name.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const _={command:`customCsrsForAZoneCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for a zone. Cloudflare generates and securely stores the private key associated with the CSR. The CSR can then be provided to a Certificate Authority for signing. Once signed, the certificate is uploaded via the Custom SSL endpoint using the CSR ID.`,builder:g,handler:async e=>{if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.customCsrs.customCsrsForAZoneCreateCustomCsr({...r,zone_id:n})),{successLabel:`Created`});return}if(e[`common-name`]===void 0&&(e[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),e.country===void 0&&(e.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),e.locality===void 0&&(e.locality=await d(`locality`,`City or locality name.`)),e.organization===void 0&&(e.organization=await d(`organization`,`Organization name.`)),e.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);e.state===void 0&&(e.state=await d(`state`,`State or province name.`));let f=l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)});a(await s(`Creating`,async()=>t.customCsrs.customCsrsForAZoneCreateCustomCsr({...f,zone_id:n})),{successLabel:`Created`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`customCsrsForAZoneCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:v,handler:async e=>{if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customCsrs.customCsrsForAZoneCustomCsrDetails({zone_id:n,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Loaded`})}};function b(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,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 x={command:`customCsrsForAZoneDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key. A CSR cannot be deleted if any custom certificates still reference it.`,builder:b,handler:async e=>{if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await f({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>t.customCsrs.customCsrsForAZoneDeleteCustomCsr({zone_id:n,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Deleted`})}};function S(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`customCsrsForAZoneListCustomCsrs`,describe:`List all custom Certificate Signing Requests (CSRs) for a zone.`,builder:S,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf custom-csrs customCsrsForAZoneListCustomCsrs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.customCsrs.customCsrsForAZoneListCustomCsrs({zone_id:c,...t})),{successLabel:`Loaded`})}};function w(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,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 T={command:`delete <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf custom-csrs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs/${r[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(r[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(r[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>c.customCsrs.delete({account_id:l,custom_csr_id:r[`custom-csr-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf custom-csrs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs/${r[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(r[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(r[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customCsrs.get({account_id:l,custom_csr_id:r[`custom-csr-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List all custom Certificate Signing Requests (CSRs) for an account.`,builder:p(O),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 custom-csrs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_csrs`,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.customCsrs.list({account_id:u,...c})),{successLabel:`Loaded`})}},A={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-DM4z101s.mjs";function f(e){return e.option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,default:1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Adds a custom nameserver to the account for use as a vanity nameserver on zones.`,builder:f,handler:async d=>{if(d.dryRun){a({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ns_name:l(d[`ns-name`],`ns-name`,`text`),ns_set:d[`ns-set`]}):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.customNameservers.create({body:e,account_id:p})),{successLabel:`Created`});return}d[`ns-name`]===void 0&&(d[`ns-name`]=await u(`ns-name`,`The FQDN of the name server.`));let m=c({ns_name:l(d[`ns-name`],`ns-name`,`text`),ns_set:d[`ns-set`]});i(await o(`Creating`,async()=>f.customNameservers.create({body:m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name 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 h={command:`delete <custom-ns-id>`,describe:`Removes a custom nameserver from the account.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns/${s[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(s[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(s[`custom-ns-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
- `);return}i(await o(`Deleting`,async()=>c.customNameservers.delete({account_id:l,custom_ns_id:s[`custom-ns-id`]})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`List an account's custom nameservers.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.customNameservers.get({account_id:l})),{successLabel:`Loaded`})}},v={command:`custom-nameservers`,describe:`custom-nameservers`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p}from"./prompt-DM4z101s.mjs";function m(e){return e.option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Creates a signed JWT token used to preview custom pages before they are published.`,builder:m,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/preview_tokens`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({act:u(r.act,`act`,`text`),target:u(r.target,`target`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.customPages.accountCustomPages.previewTokens.create({body:e,account_identifier:p})),{successLabel:`Created`});return}r.act===void 0&&(r.act=await d(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),r.target===void 0&&(r.target=await d(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),r.url===void 0&&(r.url=await d(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let m=l({act:u(r.act,`act`,`text`),target:u(r.target,`target`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Creating`,async()=>f.customPages.accountCustomPages.previewTokens.create({body:m,account_identifier:p})),{successLabel:`Created`})}},ee={command:`preview-tokens`,describe:`Account preview tokens operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom 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:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?l({state:u(r.state,`state`,`text`),url:u(r.url,`url`,`text`)}):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.customPages.accountCustomPages.update({...e,account_identifier:m,identifier:r.identifier})),{successLabel:`Updated`});return}r.state===void 0&&(r.state=await f(`state`,`The custom page state.`,[`default`,`customized`])),r.url===void 0&&(r.url=await d(`url`,`The URL associated with the custom page.`));let h=l({state:u(r.state,`state`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Updating`,async()=>p.customPages.accountCustomPages.update({...h,account_identifier:m,identifier:r.identifier})),{successLabel:`Updated`})}},v={command:`account-custom-pages`,describe:`Account-scoped custom page operations`,builder:e=>e.command(_).command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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:`asset`,describe:`Creates a new custom asset at the account level.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.customPages.assets.create.custom.asset({...e,account_identifier:p})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the custom asset.`)),r.name===void 0&&(r.name=await d(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),r.url===void 0&&(r.url=await d(`url`,`The URL where the asset content is fetched from.`));let m=l({description:u(r.description,`description`,`text`),name:u(r.name,`name`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Creating`,async()=>f.customPages.assets.create.custom.asset({...m,account_identifier:p})),{successLabel:`Created`})}},x={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`v2 <zone-identifier>`,describe:`Creates a new custom asset at the zone level.`,builder:S,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),name:u(e.name,`name`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.customPages.assets.create.v2({...r,zone_identifier:n})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the custom asset.`)),e.name===void 0&&(e.name=await d(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),e.url===void 0&&(e.url=await d(`url`,`The URL where the asset content is fetched from.`));let f=l({description:u(e.description,`description`,`text`),name:u(e.name,`name`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Creating`,async()=>t.customPages.assets.create.v2({...f,zone_identifier:n})),{successLabel:`Created`})}},w={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,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 E={command:`asset <asset-name>`,describe:`Deletes an existing custom asset.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets/${r[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(r[`asset-name`]))}`,pathParams:{"asset-name":String(r[`asset-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>c.customPages.assets.delete.custom.asset({account_identifier:l,asset_name:r[`asset-name`]})),{successLabel:`Deleted`})}},D={command:`custom`,describe:`Operations for assets.delete.custom`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{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 k={command:`v2 <asset-name>`,describe:`Deletes an existing custom asset.`,builder:O,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets delete v2`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>t.customPages.assets.delete.v2({zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Deleted`})}},A={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`asset <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets/${r[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(r[`asset-name`]))}`,pathParams:{"asset-name":String(r[`asset-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customPages.assets.get.custom.asset({account_identifier:l,asset_name:r[`asset-name`]})),{successLabel:`Loaded`})}},N={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`v2 <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:P,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customPages.assets.get.v2({zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Loaded`})}},I={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(F).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`assets`,describe:`Fetches all the custom assets at the account level.`,builder:L,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets`,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.customPages.assets.list.custom.assets({account_identifier:u,...c})),{successLabel:`Loaded`})}},z={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`v2 <zone-identifier>`,describe:`Fetches all the custom assets at the zone level.`,builder:te,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf custom-pages assets list v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.customPages.assets.list.v2({zone_identifier:c,...t})),{successLabel:`Loaded`})}},V={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(B).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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:`asset <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/assets/${r[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(r[`asset-name`]))}`,pathParams:{"asset-name":String(r[`asset-name`]??``)},bodyKind:`json`,body:r.body===void 0?l({description:u(r.description,`description`,`text`),url:u(r.url,`url`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.customPages.assets.update.custom.asset({...e,account_identifier:p,asset_name:r[`asset-name`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the custom asset.`)),r.url===void 0&&(r.url=await d(`url`,`The URL where the asset content is fetched from.`));let m=l({description:u(r.description,`description`,`text`),url:u(r.url,`url`,`text`)});a(await s(`Updating`,async()=>f.customPages.assets.update.custom.asset({...m,account_identifier:p,asset_name:r[`asset-name`]})),{successLabel:`Updated`})}},W={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`v2 <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:G,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages assets update v2`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.customPages.assets.update.v2({...r,zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the custom asset.`)),e.url===void 0&&(e.url=await d(`url`,`The URL where the asset content is fetched from.`));let f=l({description:u(e.description,`description`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Updating`,async()=>t.customPages.assets.update.v2({...f,zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Updated`})}},q={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(K).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`assets`,describe:`Assets operations`,builder:e=>e.command(w).command(A).command(I).command(V).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customPages.get({account_identifier:l,identifier:r.identifier})),{successLabel:`Loaded`})}};function Z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Fetches all the custom pages at the account level.`,builder:Z,handler:async r=>{if(r.dryRun){o({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_pages`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.customPages.list({account_identifier:l})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom 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 re={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:ne,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({state:u(e.state,`state`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.customPages.update({...r,zone_identifier:n,identifier:e.identifier})),{successLabel:`Updated`});return}e.state===void 0&&(e.state=await f(`state`,`The custom page state.`,[`default`,`customized`])),e.url===void 0&&(e.url=await d(`url`,`The URL associated with the custom page.`));let p=l({state:u(e.state,`state`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Updating`,async()=>t.customPages.update({...p,zone_identifier:n,identifier:e.identifier})),{successLabel:`Updated`})}};function ie(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:ie,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages zone-custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customPages.zoneCustomPages.get({zone_identifier:n,identifier:e.identifier})),{successLabel:`Loaded`})}};function oe(e){return e.option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Fetches all the custom pages at the zone level.`,builder:oe,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages zone-custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.customPages.zoneCustomPages.list({zone_identifier:n})),{successLabel:`Loaded`})}};function se(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create <zone-identifier>`,describe:`Creates a signed JWT token used to preview custom pages before they are published. The API gateway rewrites zone-scoped requests to the account-level service endpoint.`,builder:se,handler:async e=>{if(e.dryRun){o({command:`cf custom-pages zone-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/preview_tokens`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?l({act:u(e.act,`act`,`text`),target:u(e.target,`target`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.customPages.zoneCustomPages.previewTokens.create({body:r,zone_identifier:n})),{successLabel:`Created`});return}e.act===void 0&&(e.act=await d(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),e.target===void 0&&(e.target=await d(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),e.url===void 0&&(e.url=await d(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let f=l({act:u(e.act,`act`,`text`),target:u(e.target,`target`,`text`),url:u(e.url,`url`,`text`)});a(await s(`Creating`,async()=>t.customPages.zoneCustomPages.previewTokens.create({body:f,zone_identifier:n})),{successLabel:`Created`})}},le={command:`preview-tokens`,describe:`Zone preview tokens operations`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ue={command:`zone-custom-pages`,describe:`Zone-scoped custom page operations`,builder:e=>e.command(ae).command($).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`custom-pages`,describe:`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,builder:e=>e.command(X).command(Q).command(re).command(v).command(J).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{de as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- const e={command:`email`,describe:`email`,builder:e=>e.demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{e as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p}from"./prompt-DM4z101s.mjs";import{t as m}from"./cli-types-BWdZbsFE.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({email:u(r.email,`email`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await d(`email`,`The contact email address of the user.`));let m=l({email:u(r.email,`email`,`text`)});a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address 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 _={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>c.emailRouting.addresses.delete({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.emailRouting.addresses.get({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists existing destination addresses.`,builder:m(b),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],direction:r.direction,verified:r.verified};if(r.dryRun){o({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,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.emailRouting.addresses.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?l({status:u(r.status,`status`,`text`)}):c(r.body)});return}let d=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()=>d.emailRouting.addresses.update({...e,account_id:p,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`});return}r.status===void 0&&(r.status=await f(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=l({status:u(r.status,`status`,`text`)});a(await s(`Updating`,async()=>d.emailRouting.addresses.update({...m,account_id:p,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`})}},w={command:`addresses`,describe:`Verified destination email addresses that can receive forwarded mail`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:T,handler:async e=>{if(e.dryRun){o({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{successLabel:`Deleted`})}};function D(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:D,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:d,zone_id:n})),{successLabel:`Created`})}};function k(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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 A={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:k,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
5
- `);return}if(e.body){let r=c(e.body);a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:d,zone_id:n})),{successLabel:`Deleted`})}};function j(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:j,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:d,zone_id:n})),{successLabel:`Updated`})}};function N(e){return e.option(`subdomain`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:N,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){o({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.emailRouting.dns.get({zone_id:c,...t})),{successLabel:`Loaded`})}},F={command:`dns`,describe:`DNS records required for email routing (MX, SPF, DKIM) — enable, lock, or disable`,builder:e=>e.command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).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:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:I,handler:async e=>{if(e.dryRun){o({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let u=l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.edit({...u,zone_id:n})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:R,handler:async e=>{if(e.dryRun){o({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:z,handler:async e=>{if(e.dryRun){o({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:V,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{successLabel:`Loaded`})}};function U(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to a specific destination address. Forward actions require exactly one verified destination address.`,builder:U,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:u(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...d,zone_id:n})),{successLabel:`Updated`})}},G={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require exactly one verified destination address.`,builder:K,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.rules.create({...d,zone_id:n})),{successLabel:`Created`})}};function J(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule 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 <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:J,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
6
- `);return}a(await s(`Deleting`,async()=>t.emailRouting.rules.delete({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Deleted`})}};function X(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <rule-identifier>`,describe:`Get information for a specific routing rule already created.`,builder:X,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.get({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Loaded`})}};function Q(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list-account`,describe:`Lists existing routing rules across all zones in the account.`,builder:m(Q),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],enabled:r.enabled};if(r.dryRun){o({command:`cf email-routing rules list-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/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.emailRouting.rules.listAccount({account_id:u,...c})),{successLabel:`Loaded`})}};function re(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Lists existing routing rules.`,builder:m(re),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],enabled:e.enabled};if(e.dryRun){o({command:`cf email-routing rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.emailRouting.rules.list({zone_id:c,...t})),{successLabel:`Loaded`})}};function ae(e){return e.option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`plan`,describe:`Computes the Email Routing rule changes that would be needed to reconcile a Wrangler-managed desired ruleset. This endpoint is read-only and does not create, update, or delete rules.`,builder:ae,handler:async r=>{if(r.dryRun){o({command:`cf email-routing rules plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/rules/plan`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({owner_worker_tag:u(r[`owner-worker-tag`],`owner-worker-tag`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.emailRouting.rules.plan({...e,account_id:p})),{successLabel:`Created`});return}r[`owner-worker-tag`]===void 0&&(r[`owner-worker-tag`]=await d(`owner-worker-tag`,"Public tag (script_tag) of the Worker that owns this rule. Required when `source` is `wrangler`. "));let m=l({owner_worker_tag:u(r[`owner-worker-tag`],`owner-worker-tag`,`text`)});a(await s(`Creating`,async()=>f.emailRouting.rules.plan({...m,account_id:p})),{successLabel:`Created`})}};function $(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).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 <rule-identifier>`,describe:`Update actions and matches, or enable/disable specific routing rules. Forward actions require exactly one verified destination address.`,builder:$,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.update({...r,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.update({...d,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`})}},ce={command:`rules`,describe:`Routing rules that match incoming email addresses and forward to destination mailboxes`,builder:e=>e.command(q).command(Y).command(Z).command(ie).command(ne).command(oe).command(se).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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 ue={command:`unlock`,describe:`Unlock MX records previously locked by Email Routing. Deprecated - use PATCH /zones/{zone_id}/email/routing/dns instead.`,builder:le,handler:async e=>{if(e.dryRun){o({command:`cf email-routing unlock`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/unlock`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.unlock({body:r,zone_id:n})),{successLabel:`Created`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.unlock({body:d,zone_id:n})),{successLabel:`Created`})}};function de(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).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:`update`,describe:`Update the settings for your Email Routing zone.`,builder:de,handler:async e=>{if(e.dryRun){o({command:`cf email-routing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.update({...r,zone_id:n})),{successLabel:`Updated`});return}let u=l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.update({...u,zone_id:n})),{successLabel:`Updated`})}},pe={command:`email-routing`,describe:`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,builder:e=>e.command(E).command(L).command(te).command(B).command(ue).command(fe).command(w).command(F).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{pe as default};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{a as i,r as a}from"./auth-C6MhC9EZ.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-C-oFUtvC.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d}from"./input-validation-BBKJRoRB.mjs";import{a as f,n as p}from"./prompt-DM4z101s.mjs";import{t as m}from"./cli-types-BWdZbsFE.mjs";function h(e){return e.positional(`message-id`,{type:`string`,description:`Message ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <message-id>`,describe:`Returns the raw RFC 5322 MIME message for the given account and message id.`,builder:h,handler:async r=>{if(r.dryRun){s({command:`cf email-sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/messages/${r[`message-id`]==null?`<message-id>`:encodeURIComponent(String(r[`message-id`]))}`,pathParams:{"message-id":String(r[`message-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.emailSending.get({account_id:l,message_id:r[`message-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Returns the current daily sending quota for the account and, when a quota is resolved, the account's current usage against it. Quota is null when not yet available; usage is null when there is no resolved quota or usage is temporarily unavailable.`,builder:_,handler:async r=>{if(r.dryRun){s({command:`cf email-sending limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/limits`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.emailSending.limits.get({account_id:l})),{successLabel:`Loaded`})}},y={command:`limits`,describe:`Operations for limits`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).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:`send-raw`,describe:`Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`,builder:b,handler:async r=>{if(r.dryRun){s({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({from:d(r.from,`from`,`text`),mime_message:d(r[`mime-message`],`mime-message`,`text`),recipients:r.recipients}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.emailSending.sendRaw({...e,account_id:p})),{successLabel:`Created`});return}if(r.from===void 0&&(r.from=await f(`from`,`Sender email address.`)),r[`mime-message`]===void 0&&(r[`mime-message`]=await f(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),r.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let m=u({from:d(r.from,`from`,`text`),mime_message:d(r[`mime-message`],`mime-message`,`text`),recipients:r.recipients});o(await c(`Creating`,async()=>i.emailSending.sendRaw({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`send`,describe:`Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({bcc:{address:d(r[`bcc-address`],`bcc-address`,`text`),name:d(r[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(r[`cc-address`],`cc-address`,`text`),name:d(r[`cc-name`],`cc-name`,`text`)},from:{address:d(r[`from-address`],`from-address`,`text`),name:d(r[`from-name`],`from-name`,`text`)},html:d(r.html,`html`,`text`),reply_to:{address:d(r[`reply-to-address`],`reply-to-address`,`text`),name:d(r[`reply-to-name`],`reply-to-name`,`text`)},subject:d(r.subject,`subject`,`text`),text:d(r.text,`text`,`text`),to:{address:d(r[`to-address`],`to-address`,`text`),name:d(r[`to-name`],`to-name`,`text`)}}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.emailSending.send({...e,account_id:p})),{successLabel:`Created`});return}r.subject===void 0&&(r.subject=await f(`subject`,`Email subject line.`));let m=u({bcc:{address:d(r[`bcc-address`],`bcc-address`,`text`),name:d(r[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(r[`cc-address`],`cc-address`,`text`),name:d(r[`cc-name`],`cc-name`,`text`)},from:{address:d(r[`from-address`],`from-address`,`text`),name:d(r[`from-name`],`from-name`,`text`)},html:d(r.html,`html`,`text`),reply_to:{address:d(r[`reply-to-address`],`reply-to-address`,`text`),name:d(r[`reply-to-name`],`reply-to-name`,`text`)},subject:d(r.subject,`subject`,`text`),text:d(r.text,`text`,`text`),to:{address:d(r[`to-address`],`to-address`,`text`),name:d(r[`to-name`],`to-name`,`text`)}});o(await c(`Creating`,async()=>i.emailSending.send({...m,account_id:p})),{successLabel:`Created`})}};function w(e){return e.option(`name`,{type:`string`,description:"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."}).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 T={command:`create`,describe:"Creates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present. A leftmost wildcard such as `*.example.com` is accepted only for accounts with wildcard Email Sending enabled. Wildcard senders share the base domain's DKIM signing identity and `cf-bounce.<base>` return path.",builder:w,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.emailSending.subdomains.create({...r,zone_id:n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."));let i=u({name:d(e.name,`name`,`text`)});o(await c(`Creating`,async()=>t.emailSending.subdomains.create({...i,zone_id:n})),{successLabel:`Created`})}};function E(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain 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 D={command:`delete <subdomain-id>`,describe:`Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`,builder:E,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>t.emailSending.subdomains.delete({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`fix <subdomain-id>`,describe:`Idempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.`,builder:O,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains dns fix`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Creating`,async()=>t.emailSending.subdomains.dns.fix({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Created`})}};function A(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get-status <subdomain-id>`,describe:`Returns the desired DNS records for a sending subdomain along with a live diff against actual DNS state. Use this to detect missing, unlocked, foreign, or multi-record conflicts before deciding whether to call the fix endpoint. For wildcard sending rows, each call also rechecks the governing organizational-domain DMARC policy and reports policy drift that DNS Fix cannot repair.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains dns get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns/status`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.emailSending.subdomains.dns.getStatus({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function M(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <subdomain-id>`,describe:`Returns the expected DNS records for a sending subdomain.`,builder:M,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.emailSending.subdomains.dns.get({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}},P={command:`dns`,describe:`Operations for subdomains.dns`,builder:e=>e.command(k).command(N).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <subdomain-id>`,describe:`Gets information for a specific sending subdomain.`,builder:F,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.emailSending.subdomains.get({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists all sending-enabled subdomains for the zone.`,builder:I,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.emailSending.subdomains.list({zone_id:n})),{successLabel:`Loaded`})}};function R(e){return e.option(`name`,{type:`string`,description:"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."}).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:`preview`,describe:`Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status. A leftmost wildcard requires wildcard Email Sending to be enabled for the account and previews base-scoped DKIM and return-path records.`,builder:R,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Loading`,async()=>t.emailSending.subdomains.preview({...r,zone_id:n})),{successLabel:`Loaded`});return}e.name===void 0&&(e.name=await f(`name`,"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."));let i=u({name:d(e.name,`name`,`text`)});o(await c(`Loading`,async()=>t.emailSending.subdomains.preview({...i,zone_id:n})),{successLabel:`Loaded`})}};function B(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`start-at`,{type:`string`,description:`Start at`,demandOption:!0}).option(`end-at`,{type:`string`,description:`End at`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get-complaints <subdomain-id>`,describe:`Returns the matched complaint count for a sending subdomain in a half-open time window of up to seven days.`,builder:B,handler:async e=>{let t={start_at:e[`start-at`],end_at:e[`end-at`]};if(e.dryRun){s({command:`cf email-sending subdomains reputation get-complaints`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/reputation/complaints`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.emailSending.subdomains.reputation.getComplaints({zone_id:i,subdomain_id:e[`subdomain-id`],...t})),{successLabel:`Loaded`})}},H={command:`reputation`,describe:`Operations for subdomains.reputation`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`drop-suppressed-recipients`,{type:`boolean`,description:`Whether a send request that includes a recipient suppressed on
4
- this subdomain drops that recipient and still delivers to the
5
- rest, instead of failing the entire request.
6
- `}).option(`preview-enabled`,{type:`boolean`,description:`Whether sent messages from this subdomain can be previewed in the activity log.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"At least one of `preview_enabled` or `drop_suppressed_recipients` must be provided. A field omitted from the request body is left unchanged. "})}const W={command:`update <subdomain-id>`,describe:`Updates the activity-log preview preference for a sending subdomain.`,builder:U,handler:async e=>{if(e.dryRun){s({command:`cf email-sending subdomains update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({drop_suppressed_recipients:e[`drop-suppressed-recipients`],preview_enabled:e[`preview-enabled`]}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.emailSending.subdomains.update({...r,zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`});return}let i=u({drop_suppressed_recipients:e[`drop-suppressed-recipients`],preview_enabled:e[`preview-enabled`]});o(await c(`Updating`,async()=>t.emailSending.subdomains.update({...i,zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`})}},G={command:`subdomains`,describe:`Sending subdomain operations`,builder:e=>e.command(T).command(D).command(ee).command(L).command(z).command(W).command(P).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`note`,{type:`string`,description:`The note field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:`Creates an account-wide suppression. If a mutable legacy zone-linked row already exists, it is promoted without changing its identifier.`,builder:K,handler:async r=>{if(r.dryRun){s({command:`cf email-sending suppressions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/suppressions`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({email:d(r.email,`email`,`text`),expires_at:d(r[`expires-at`],`expires-at`,`text`),note:d(r.note,`note`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.emailSending.suppressions.create({...e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await f(`email`,`The email field`));let m=u({email:d(r.email,`email`,`text`),expires_at:d(r[`expires-at`],`expires-at`,`text`),note:d(r.note,`note`,`text`)});o(await c(`Creating`,async()=>i.emailSending.suppressions.create({...m,account_id:p})),{successLabel:`Created`})}};function J(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression 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 Y={command:`delete <suppression-id>`,describe:`Deletes the suppression, its note, and every legacy internal zone membership, allowing future delivery attempts to the address.`,builder:J,handler:async r=>{if(r.dryRun){s({command:`cf email-sending suppressions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/suppressions/${r[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(r[`suppression-id`]))}`,pathParams:{"suppression-id":String(r[`suppression-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`This operation removes an Email Sending suppression and may allow email delivery to resume for the address.`})){process.stderr.write(`Aborted.
7
- `);return}o(await c(`Deleting`,async()=>i.emailSending.suppressions.delete({account_id:l,suppression_id:r[`suppression-id`]})),{successLabel:`Deleted`})}};function X(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`expires-at`,{type:`string`,description:"New expiry. Send `null` to make the suppression permanent; omit to leave it unchanged."}).option(`note`,{type:`string`,description:`Replacement advisory note. Send an empty string to clear it; omit to leave it unchanged.`}).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:`edit <suppression-id>`,describe:`Updates expiry or advisory note fields without changing legacy internal zone memberships.`,builder:X,handler:async r=>{if(r.dryRun){s({command:`cf email-sending suppressions edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/suppressions/${r[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(r[`suppression-id`]))}`,pathParams:{"suppression-id":String(r[`suppression-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({expires_at:d(r[`expires-at`],`expires-at`,`text`),note:d(r.note,`note`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.emailSending.suppressions.edit({...e,account_id:f,suppression_id:r[`suppression-id`]})),{successLabel:`Updated`});return}let p=u({expires_at:d(r[`expires-at`],`expires-at`,`text`),note:d(r.note,`note`,`text`)});o(await c(`Updating`,async()=>i.emailSending.suppressions.edit({...p,account_id:f,suppression_id:r[`suppression-id`]})),{successLabel:`Updated`})}};function Q(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <suppression-id>`,describe:`Gets an Email Sending suppression owned by the account.`,builder:Q,handler:async r=>{if(r.dryRun){s({command:`cf email-sending suppressions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/suppressions/${r[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(r[`suppression-id`]))}`,pathParams:{"suppression-id":String(r[`suppression-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.emailSending.suppressions.get({account_id:l,suppression_id:r[`suppression-id`]})),{successLabel:`Loaded`})}};function te(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 ne={command:`import`,describe:`Imports up to 1,000 account-level Email Sending suppressions in one request.`,builder:te,handler:async r=>{if(r.dryRun){s({command:`cf email-sending suppressions import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/suppressions/bulk`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:l(r.body)});return}let u=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Creating`,async()=>u.emailSending.suppressions.import({...e,account_id:d})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>i(u,`POST`,`/accounts/${d}/email/sending/suppressions/bulk`)),{successLabel:`Created`})}};function re(e){return e.option(`per-page`,{type:`number`,description:`Per page`}).option(`cursor`,{type:`string`,description:"Opaque pagination cursor returned as `result_info.next_cursor`. It carries the filters that produced it."}).option(`email`,{type:`string`,description:`Exact email-address filter.`}).option(`search`,{type:`string`,description:"A complete address is an exact match; a value ending in `@` matches that username across every domain. Prefix searches may return short intermediate pages while the bounded account scan advances."}).option(`reason`,{type:`string`,description:`Reason`,choices:[`manual`,`complaint`,`hard_bounce`,`soft_bounce`,`policy`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Lists every active Email Sending suppression owned by the account, including legacy rows with internal zone memberships.`,builder:m(re),handler:async r=>{let i={per_page:r[`per-page`],cursor:r.cursor,email:r.email,search:r.search,reason:r.reason};if(r.dryRun){s({command:`cf email-sending suppressions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/sending/suppressions`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.emailSending.suppressions.list({account_id:u,...i})),{successLabel:`Loaded`})}},ae={command:`suppressions`,describe:`Operations for suppressions`,builder:e=>e.command(q).command(Y).command(Z).command($).command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},oe={command:`email-sending`,describe:`Send emails and manage sending subdomains`,builder:e=>e.command(g).command(C).command(x).command(y).command(G).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{oe as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-BjHjJtnn.mjs";import{r as t}from"./auth-C6MhC9EZ.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-C-oFUtvC.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{n as c}from"./prompt-DM4z101s.mjs";import{t as l}from"./cli-types-BWdZbsFE.mjs";function u(e){return e.option(`id`,{type:`string`,description:`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 d={command:`bulk-delete`,describe:`Deletes one or more existing filters.`,builder:u,handler:async a=>{let o={id:a.id};if(a.dryRun){r({command:`cf filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),l=await e({zone:a.zone},s,{quiet:a.quiet});if(a.zoneId=l,!await c({force:!!a.force})){process.stderr.write(`Aborted.
3
- `);return}n(await i(`Deleting`,async()=>s.filters.bulkDelete({zone_id:l,...o})),{successLabel:`Deleted`})}};function f(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:`bulk-update`,describe:`Updates one or more existing filters.`,builder:f,handler:async o=>{if(o.dryRun){r({command:`cf filters bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Updating`,async()=>s.filters.bulkUpdate({body:e,zone_id:c})),{successLabel:`Updated`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};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 h={command:`create`,describe:`Creates one or more filters.`,builder:m,handler:async o=>{if(o.dryRun){r({command:`cf filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Creating`,async()=>s.filters.create({body:e,zone_id:c})),{successLabel:`Created`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,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 _={command:`delete <filter-id>`,describe:`Deletes an existing filter.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf filters delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/filters/${a[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(a[`filter-id`]))}`,pathParams:{"filter-id":String(a[`filter-id`]??``),"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.
4
- `);return}n(await i(`Deleting`,async()=>o.filters.delete({zone_id:s,filter_id:a[`filter-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <filter-id>`,describe:`Fetches the details of a filter.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/filters/${a[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(a[`filter-id`]))}`,pathParams:{"filter-id":String(a[`filter-id`]??``),"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.filters.get({zone_id:s,filter_id:a[`filter-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`expression`,{type:`string`,description:`A case-insensitive string to find in the expression.`}).option(`description`,{type:`string`,description:`A case-insensitive string to find in the description.`}).option(`ref`,{type:`string`,description:`The filter ref (a short reference tag) to search for. Must be an exact match.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of filters per page.`}).option(`id`,{type:`string`,description:`The unique identifier of the filter.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Fetches filters in a zone. You can filter the results using several optional parameters.`,builder:l(b),handler:async a=>{let o={paused:a.paused,expression:a.expression,description:a.description,ref:a.ref,page:a.page,per_page:a[`per-page`],id:a.id};if(a.dryRun){r({command:`cf filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.filters.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function S(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the filter.`}).option(`expression`,{type:`string`,description:`The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`ref`,{type:`string`,description:`A short reference tag. Allows you to select related filters.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <filter-id>`,describe:`Updates an existing filter.`,builder:S,handler:async c=>{if(c.dryRun){r({command:`cf filters update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/filters/${c[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(c[`filter-id`]))}`,pathParams:{"filter-id":String(c[`filter-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({description:s(c.description,`description`,`text`),expression:s(c.expression,`expression`,`text`),paused:c.paused,ref:s(c.ref,`ref`,`text`)}):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.filters.update({body:e,zone_id:u,filter_id:c[`filter-id`]})),{successLabel:`Updated`});return}let d=o({description:s(c.description,`description`,`text`),expression:s(c.expression,`expression`,`text`),paused:c.paused,ref:s(c.ref,`ref`,`text`)});n(await i(`Updating`,async()=>l.filters.update({body:d,zone_id:u,filter_id:c[`filter-id`]})),{successLabel:`Updated`})}},w={command:`filters`,describe:`Filter expressions used by legacy firewall rules to match requests — prefer Rulesets for new configurations`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{a as i,r as a}from"./auth-C6MhC9EZ.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-C-oFUtvC.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d}from"./input-validation-BBKJRoRB.mjs";import{i as f,n as p}from"./prompt-DM4z101s.mjs";import{t as m}from"./cli-types-BWdZbsFE.mjs";function ee(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Creates a new IP Access rule for an account. The rule will apply to all zones in the account. Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.`,builder:ee,handler:async r=>{if(r.dryRun){s({command:`cf firewall access-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/firewall/access_rules/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({configuration:{target:d(r[`configuration-target`],`configuration-target`,`text`),value:d(r[`configuration-value`],`configuration-value`,`text`)},mode:d(r.mode,`mode`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.firewall.accessRules.create({...e,account_id:p})),{successLabel:`Created`});return}r.mode===void 0&&(r.mode=await f(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let m=u({configuration:{target:d(r[`configuration-target`],`configuration-target`,`text`),value:d(r[`configuration-value`],`configuration-value`,`text`)},mode:d(r.mode,`mode`,`text`)});o(await c(`Creating`,async()=>i.firewall.accessRules.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,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 g={command:`delete <rule-id>`,describe:`Deletes an existing IP Access rule defined at the account level. Note: This operation will affect all zones in the account.`,builder:h,handler:async r=>{if(r.dryRun){s({command:`cf firewall access-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/firewall/access_rules/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`This operation deletes the account-level IP Access Rule and affects every zone in the account.`})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.firewall.accessRules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`notes`,{type:`string`,description:`An informative summary of the rule, typically used as a reminder or explanation.`}).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:`Updates an IP Access rule defined at the account level. Note: This operation will affect all zones in the account.`,builder:_,handler:async r=>{if(r.dryRun){s({command:`cf firewall access-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/firewall/access_rules/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({configuration:{target:d(r[`configuration-target`],`configuration-target`,`text`),value:d(r[`configuration-value`],`configuration-value`,`text`)},mode:d(r.mode,`mode`,`text`),notes:d(r.notes,`notes`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.firewall.accessRules.edit({body:e,account_id:p,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}r.mode===void 0&&(r.mode=await f(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let m=u({configuration:{target:d(r[`configuration-target`],`configuration-target`,`text`),value:d(r[`configuration-value`],`configuration-value`,`text`)},mode:d(r.mode,`mode`,`text`),notes:d(r.notes,`notes`,`text`)});o(await c(`Updating`,async()=>i.firewall.accessRules.edit({body:m,account_id:p,rule_id:r[`rule-id`]})),{successLabel:`Updated`})}};function y(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <rule-id>`,describe:`Fetches the details of an IP Access rule defined at the account level.`,builder:y,handler:async r=>{if(r.dryRun){s({command:`cf firewall access-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/firewall/access_rules/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.firewall.accessRules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`configuration-target`,{type:`string`,description:`Defines the target to search in existing rules.`,choices:[`ip`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:"Defines the target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`.\nNotes: You can search for a single IPv4 address, an IP address range with a subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code."}).option(`notes`,{type:`string`,description:`Defines the string to search for in the notes of existing IP Access rules.
4
- Notes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.`}).option(`match`,{type:`string`,description:"Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Defines the requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Defines the maximum number of results requested.`}).option(`order`,{type:`string`,description:`Defines the field used to sort returned rules.`,choices:[`configuration.target`,`configuration.value`,`mode`]}).option(`direction`,{type:`string`,description:`Defines the direction used to sort returned rules.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Fetches IP Access rules of an account. These rules apply to all the zones in the account. You can filter the results using several optional parameters.`,builder:m(x),handler:async r=>{let i={mode:r.mode,"configuration.target":r[`configuration-target`],"configuration.value":r[`configuration-value`],notes:r.notes,match:r.match,page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){s({command:`cf firewall access-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/firewall/access_rules/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.firewall.accessRules.list({account_id:u,...i})),{successLabel:`Loaded`})}},C={command:`access-rules`,describe:`IP-based access rules that allow, block, challenge, or whitelist traffic globally or per-zone`,builder:e=>e.command(te).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`priority`,{type:`number`,description:`The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.`}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).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 T={command:`create`,describe:`Creates a new Zone Lockdown rule.`,builder:w,handler:async e=>{if(e.dryRun){s({command:`cf firewall lockdowns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({description:d(e.description,`description`,`text`),paused:e.paused,priority:e.priority,urls:e.urls}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.firewall.lockdowns.create({...r,zone_id:n})),{successLabel:`Created`});return}if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let i=u({description:d(e.description,`description`,`text`),paused:e.paused,priority:e.priority,urls:e.urls});o(await c(`Creating`,async()=>t.firewall.lockdowns.create({...i,zone_id:n})),{successLabel:`Created`})}};function E(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,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 D={command:`delete <lock-downs-id>`,describe:`Deletes an existing Zone Lockdown rule.`,builder:E,handler:async e=>{if(e.dryRun){s({command:`cf firewall lockdowns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation deletes the Zone Lockdown rule from the zone.`})){process.stderr.write(`Aborted.
5
- `);return}o(await c(`Deleting`,async()=>t.firewall.lockdowns.delete({zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <lock-downs-id>`,describe:`Fetches the details of a Zone Lockdown rule.`,builder:O,handler:async e=>{if(e.dryRun){s({command:`cf firewall lockdowns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.firewall.lockdowns.get({zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`description`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`modified-on`,{type:`string`,description:`The timestamp of when the rule was last modified.`}).option(`ip`,{type:`string`,description:`A single IP address to search for in existing rules.`}).option(`priority`,{type:`number`,description:`The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.`}).option(`uri-search`,{type:`string`,description:`A single URI to search for in the list of URLs of existing rules.`}).option(`ip-range-search`,{type:`string`,description:`A single IP address range to search for in existing rules.`}).option(`per-page`,{type:`number`,description:"The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`."}).option(`created-on`,{type:`string`,description:`The timestamp of when the rule was created.`}).option(`description-search`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`ip-search`,{type:`string`,description:`A single IP address to search for in existing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Fetches Zone Lockdown rules. You can filter the results using several optional parameters.`,builder:A,handler:async e=>{let t={page:e.page,description:e.description,modified_on:e[`modified-on`],ip:e.ip,priority:e.priority,uri_search:e[`uri-search`],ip_range_search:e[`ip-range-search`],per_page:e[`per-page`],created_on:e[`created-on`],description_search:e[`description-search`],ip_search:e[`ip-search`]};if(e.dryRun){s({command:`cf firewall lockdowns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.lockdowns.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function M(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <lock-downs-id>`,describe:`Updates an existing Zone Lockdown rule.`,builder:M,handler:async e=>{if(e.dryRun){s({command:`cf firewall lockdowns update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({urls:e.urls}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.lockdowns.update({...r,zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Updated`});return}if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let i=u({urls:e.urls});o(await c(`Updating`,async()=>t.firewall.lockdowns.update({...i,zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Updated`})}},P={command:`lockdowns`,describe:`Zone lockdown rules that restrict access to URLs by IP address or range`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).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 I={command:`bulk-delete`,describe:`Deletes existing firewall rules.`,builder:F,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
6
- `);return}if(e.body){let r=l(e.body);o(await c(`Deleting`,async()=>t.firewall.rules.bulkDelete({...r,zone_id:n})),{successLabel:`Deleted`});return}o(await c(`Deleting`,async()=>t.firewall.rules.bulkDelete({zone_id:n})),{successLabel:`Deleted`})}};function L(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 R={command:`bulk-edit`,describe:`Updates the priority of existing firewall rules.`,builder:L,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.rules.bulkEdit({body:r,zone_id:n})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i(t,`PATCH`,`/zones/${e.zoneId}/firewall/rules`)),{successLabel:`Updated`})}};function z(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 B={command:`bulk-update`,describe:`Updates one or more existing firewall rules.`,builder:z,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.rules.bulkUpdate({body:r,zone_id:n})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i(t,`PUT`,`/zones/${e.zoneId}/firewall/rules`)),{successLabel:`Updated`})}};function V(e){return e.option(`filter-description`,{type:`string`,description:`An informative summary of the filter.`}).option(`filter-expression`,{type:`string`,description:`The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).`}).option(`filter-paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`filter-ref`,{type:`string`,description:`A short reference tag. Allows you to select related filters.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`create`,describe:`Create one or more firewall rules.`,builder:V,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({filter:{description:d(e[`filter-description`],`filter-description`,`text`),expression:d(e[`filter-expression`],`filter-expression`,`text`),paused:e[`filter-paused`],ref:d(e[`filter-ref`],`filter-ref`,`text`)}}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.firewall.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let i=u({filter:{description:d(e[`filter-description`],`filter-description`,`text`),expression:d(e[`filter-expression`],`filter-expression`,`text`),paused:e[`filter-paused`],ref:d(e[`filter-ref`],`filter-ref`,`text`)}});o(await c(`Creating`,async()=>t.firewall.rules.create({...i,zone_id:n})),{successLabel:`Created`})}};function U(e){return e.positional(`rule-id`,{type:`string`,description:`The unique identifier of the firewall rule.`,demandOption:!0}).option(`delete-filter-if-unused`,{type:`boolean`,description:`When true, indicates that Cloudflare should also delete the associated filter if there are no other firewall rules referencing the filter.`}).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 W={command:`delete <rule-id>`,describe:`Deletes an existing firewall rule.`,builder:U,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({delete_filter_if_unused:e[`delete-filter-if-unused`]}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
7
- `);return}if(e.body){let r=l(e.body);o(await c(`Deleting`,async()=>t.firewall.rules.delete({...r,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Deleted`});return}let i=u({delete_filter_if_unused:e[`delete-filter-if-unused`]});o(await c(`Deleting`,async()=>t.firewall.rules.delete({...i,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Deleted`})}};function G(e){return e.positional(`rule-id`,{type:`string`,description:`The unique identifier of the firewall rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`edit <rule-id>`,describe:`Updates the priority of an existing firewall rule.`,builder:G,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.rules.edit({...r,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>t.firewall.rules.edit({zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Updated`})}};function q(e){return e.positional(`rule-id`,{type:`string`,description:`The unique identifier of the firewall rule.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique identifier of the firewall rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <rule-id>`,describe:`Fetches the details of a firewall rule.`,builder:q,handler:async e=>{let t={id:e.id};if(e.dryRun){s({command:`cf firewall rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.rules.get({zone_id:i,rule_id:e[`rule-id`],...t})),{successLabel:`Loaded`})}};function Y(e){return e.option(`description`,{type:`string`,description:`A case-insensitive string to find in the description.`}).option(`action`,{type:`string`,description:`The action to search for. Must be an exact match.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of firewall rules per page.`}).option(`id`,{type:`string`,description:`The unique identifier of the firewall rule.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the firewall rule is currently paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`Fetches firewall rules in a zone. You can filter the results using several optional parameters.`,builder:Y,handler:async e=>{let t={description:e.description,action:e.action,page:e.page,per_page:e[`per-page`],id:e.id,paused:e.paused};if(e.dryRun){s({command:`cf firewall rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.rules.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function Z(e){return e.positional(`rule-id`,{type:`string`,description:`The unique identifier of the firewall rule.`,demandOption:!0}).option(`filter-description`,{type:`string`,description:`An informative summary of the filter.`}).option(`filter-expression`,{type:`string`,description:`The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).`}).option(`filter-paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`filter-ref`,{type:`string`,description:`A short reference tag. Allows you to select related filters.`}).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 <rule-id>`,describe:`Updates an existing firewall rule.`,builder:Z,handler:async e=>{if(e.dryRun){s({command:`cf firewall rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({filter:{description:d(e[`filter-description`],`filter-description`,`text`),expression:d(e[`filter-expression`],`filter-expression`,`text`),paused:e[`filter-paused`],ref:d(e[`filter-ref`],`filter-ref`,`text`)}}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.rules.update({...r,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Updated`});return}let i=u({filter:{description:d(e[`filter-description`],`filter-description`,`text`),expression:d(e[`filter-expression`],`filter-expression`,`text`),paused:e[`filter-paused`],ref:d(e[`filter-ref`],`filter-ref`,`text`)}});o(await c(`Updating`,async()=>t.firewall.rules.update({...i,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Updated`})}},ne={command:`rules`,describe:`Legacy firewall rules with filter expressions — prefer Rulesets for new configurations`,builder:e=>e.command(I).command(R).command(B).command(H).command(W).command(K).command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ua` when specifying a user agent in the rule.",choices:[`ua`]}).option(`configuration-value`,{type:`string`,description:`the user agent to exactly match`}).option(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`create`,describe:`Creates a new User Agent Blocking rule in a zone.`,builder:re,handler:async e=>{if(e.dryRun){s({command:`cf firewall ua-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({configuration:{target:d(e[`configuration-target`],`configuration-target`,`text`),value:d(e[`configuration-value`],`configuration-value`,`text`)},description:d(e.description,`description`,`text`),mode:d(e.mode,`mode`,`text`),paused:e.paused}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.firewall.uaRules.create({...r,zone_id:n})),{successLabel:`Created`});return}e.mode===void 0&&(e.mode=await f(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let i=u({configuration:{target:d(e[`configuration-target`],`configuration-target`,`text`),value:d(e[`configuration-value`],`configuration-value`,`text`)},description:d(e.description,`description`,`text`),mode:d(e.mode,`mode`,`text`),paused:e.paused});o(await c(`Creating`,async()=>t.firewall.uaRules.create({...i,zone_id:n})),{successLabel:`Created`})}};function ae(e){return e.positional(`ua-rule-id`,{type:`string`,description:`The unique identifier of the User Agent Blocking rule.`,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 oe={command:`delete <ua-rule-id>`,describe:`Deletes an existing User Agent Blocking rule.`,builder:ae,handler:async e=>{if(e.dryRun){s({command:`cf firewall ua-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules/${e[`ua-rule-id`]==null?`<ua-rule-id>`:encodeURIComponent(String(e[`ua-rule-id`]))}`,pathParams:{"ua-rule-id":String(e[`ua-rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation deletes the User Agent Blocking rule from the zone.`})){process.stderr.write(`Aborted.
8
- `);return}o(await c(`Deleting`,async()=>t.firewall.uaRules.delete({zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Deleted`})}};function se(e){return e.positional(`ua-rule-id`,{type:`string`,description:`The unique identifier of the User Agent Blocking rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get <ua-rule-id>`,describe:`Fetches the details of a User Agent Blocking rule.`,builder:se,handler:async e=>{if(e.dryRun){s({command:`cf firewall ua-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules/${e[`ua-rule-id`]==null?`<ua-rule-id>`:encodeURIComponent(String(e[`ua-rule-id`]))}`,pathParams:{"ua-rule-id":String(e[`ua-rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.firewall.uaRules.get({zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Loaded`})}};function le(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`description`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`per-page`,{type:`number`,description:"The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`."}).option(`user-agent`,{type:`string`,description:`A string to search for in the user agent values of existing rules.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`list`,describe:`Fetches User Agent Blocking rules in a zone. You can filter the results using several optional parameters.`,builder:le,handler:async e=>{let t={page:e.page,description:e.description,per_page:e[`per-page`],user_agent:e[`user-agent`],paused:e.paused};if(e.dryRun){s({command:`cf firewall ua-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.uaRules.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function de(e){return e.positional(`ua-rule-id`,{type:`string`,description:`The unique identifier of the User Agent Blocking rule.`,demandOption:!0}).option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).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:`update <ua-rule-id>`,describe:`Updates an existing User Agent Blocking rule.`,builder:de,handler:async e=>{if(e.dryRun){s({command:`cf firewall ua-rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules/${e[`ua-rule-id`]==null?`<ua-rule-id>`:encodeURIComponent(String(e[`ua-rule-id`]))}`,pathParams:{"ua-rule-id":String(e[`ua-rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({configuration:{target:d(e[`configuration-target`],`configuration-target`,`text`),value:d(e[`configuration-value`],`configuration-value`,`text`)},description:d(e.description,`description`,`text`),mode:d(e.mode,`mode`,`text`),paused:e.paused}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.uaRules.update({...r,zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Updated`});return}e.mode===void 0&&(e.mode=await f(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let i=u({configuration:{target:d(e[`configuration-target`],`configuration-target`,`text`),value:d(e[`configuration-value`],`configuration-value`,`text`)},description:d(e.description,`description`,`text`),mode:d(e.mode,`mode`,`text`),paused:e.paused});o(await c(`Updating`,async()=>t.firewall.uaRules.update({...i,zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Updated`})}},pe={command:`ua-rules`,describe:`Block or challenge requests based on the User-Agent header string`,builder:e=>e.command(ie).command(oe).command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).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 he={command:`create`,describe:`**This endpoint has been deprecated and returns 410 Gone. Please use the [Rulesets API](https://developers.cloudflare.com/ruleset-engine/) instead.** Previously created a URI-based WAF override for a zone.`,builder:me,handler:async e=>{if(e.dryRun){s({command:`cf firewall waf overrides create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/overrides`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({urls:e.urls}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.firewall.waf.overrides.create({...r,zone_id:n})),{successLabel:`Created`});return}if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let i=u({urls:e.urls});o(await c(`Creating`,async()=>t.firewall.waf.overrides.create({...i,zone_id:n})),{successLabel:`Created`})}};function ge(e){return e.positional(`overrides-id`,{type:`string`,description:`The unique identifier of the WAF override.`,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 _e={command:`delete <overrides-id>`,describe:`**This endpoint has been deprecated and returns 410 Gone. Please use the [Rulesets API](https://developers.cloudflare.com/ruleset-engine/) instead.** Previously deleted an existing URI-based WAF override.`,builder:ge,handler:async e=>{if(e.dryRun){s({command:`cf firewall waf overrides delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/overrides/${e[`overrides-id`]==null?`<overrides-id>`:encodeURIComponent(String(e[`overrides-id`]))}`,pathParams:{"overrides-id":String(e[`overrides-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
9
- `);return}o(await c(`Deleting`,async()=>t.firewall.waf.overrides.delete({zone_id:n,overrides_id:e[`overrides-id`]})),{successLabel:`Deleted`})}};function ve(e){return e.positional(`overrides-id`,{type:`string`,description:`The unique identifier of the WAF override.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get <overrides-id>`,describe:`**This endpoint has been deprecated and returns 410 Gone. Please use the [Rulesets API](https://developers.cloudflare.com/ruleset-engine/) instead.** Previously fetched the details of a URI-based WAF override.`,builder:ve,handler:async e=>{if(e.dryRun){s({command:`cf firewall waf overrides get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/overrides/${e[`overrides-id`]==null?`<overrides-id>`:encodeURIComponent(String(e[`overrides-id`]))}`,pathParams:{"overrides-id":String(e[`overrides-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.firewall.waf.overrides.get({zone_id:n,overrides_id:e[`overrides-id`]})),{successLabel:`Loaded`})}};function be(e){return e.option(`page`,{type:`number`,description:`The page number of paginated results.`}).option(`per-page`,{type:`number`,description:`The number of WAF overrides per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`list`,describe:`**This endpoint has been deprecated and returns 410 Gone. Please use the [Rulesets API](https://developers.cloudflare.com/ruleset-engine/) instead.** Previously fetched the URI-based WAF overrides in a zone.`,builder:be,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){s({command:`cf firewall waf overrides list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/overrides`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.waf.overrides.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function Se(e){return e.positional(`overrides-id`,{type:`string`,description:`The unique identifier of the WAF override.`,demandOption:!0}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`update <overrides-id>`,describe:`**This endpoint has been deprecated and returns 410 Gone. Please use the [Rulesets API](https://developers.cloudflare.com/ruleset-engine/) instead.** Previously updated an existing URI-based WAF override.`,builder:Se,handler:async e=>{if(e.dryRun){s({command:`cf firewall waf overrides update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/overrides/${e[`overrides-id`]==null?`<overrides-id>`:encodeURIComponent(String(e[`overrides-id`]))}`,pathParams:{"overrides-id":String(e[`overrides-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({urls:e.urls}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.waf.overrides.update({...r,zone_id:n,overrides_id:e[`overrides-id`]})),{successLabel:`Updated`});return}if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let i=u({urls:e.urls});o(await c(`Updating`,async()=>t.firewall.waf.overrides.update({...i,zone_id:n,overrides_id:e[`overrides-id`]})),{successLabel:`Updated`})}},we={command:`overrides`,describe:`Operations for waf.overrides`,builder:e=>e.command(he).command(_e).command(ye).command(xe).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.positional(`package-id`,{type:`string`,description:`Defines a package identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <package-id>`,describe:`Fetches the details of a WAF package. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).`,builder:Te,handler:async e=>{if(e.dryRun){s({command:`cf firewall waf packages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/packages/${e[`package-id`]==null?`<package-id>`:encodeURIComponent(String(e[`package-id`]))}`,pathParams:{"package-id":String(e[`package-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.firewall.waf.packages.get({zone_id:n,package_id:e[`package-id`]})),{successLabel:`Loaded`})}};function De(e){return e.option(`page`,{type:`number`,description:`The page number of paginated results.`}).option(`per-page`,{type:`number`,description:`The number of packages per page.`}).option(`order`,{type:`string`,description:`The field used to sort returned packages.`,choices:[`name`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned packages.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:"When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`name`,{type:`string`,description:`The name of the WAF package.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Fetches WAF packages for a zone. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).`,builder:m(De),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,match:e.match,name:e.name};if(e.dryRun){s({command:`cf firewall waf packages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/packages`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.waf.packages.list({zone_id:i,...t})),{successLabel:`Loaded`})}},Oe={command:`packages`,describe:`Operations for waf.packages`,builder:e=>e.command(Ee).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`waf`,describe:`Legacy WAF managed rule packages, rule groups, individual rules, and override configurations`,builder:e=>e.command(we).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ae(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).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 je={command:`create`,describe:`Creates a new IP Access rule for a zone. Note: To create an IP Access rule that applies to multiple zones, refer to [IP Access rules for a user](#ip-access-rules-for-a-user) or [IP Access rules for an account](#ip-access-rules-for-an-account) as appropriate.`,builder:Ae,handler:async e=>{if(e.dryRun){s({command:`cf firewall zone-access-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/access_rules/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({configuration:{target:d(e[`configuration-target`],`configuration-target`,`text`),value:d(e[`configuration-value`],`configuration-value`,`text`)},mode:d(e.mode,`mode`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.firewall.zoneAccessRules.create({...r,zone_id:n})),{successLabel:`Created`});return}e.mode===void 0&&(e.mode=await f(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let i=u({configuration:{target:d(e[`configuration-target`],`configuration-target`,`text`),value:d(e[`configuration-value`],`configuration-value`,`text`)},mode:d(e.mode,`mode`,`text`)});o(await c(`Creating`,async()=>t.firewall.zoneAccessRules.create({...i,zone_id:n})),{successLabel:`Created`})}};function Me(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`cascade`,{type:`string`,description:"The level to attempt to delete similar rules defined for other zones with the same owner. The default value is `none`, which will only delete the current rule. Using `basic` will delete rules that match the same action (mode) and configuration, while using `aggressive` will delete rules that match the same configuration.",choices:[`none`,`basic`,`aggressive`],default:`none`}).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 Ne={command:`delete <rule-id>`,describe:"Deletes an IP Access rule defined at the zone level. Optionally, you can use the `cascade` property to specify that you wish to delete similar rules in other zones managed by the same zone owner.",builder:Me,handler:async e=>{if(e.dryRun){s({command:`cf firewall zone-access-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/access_rules/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({cascade:d(e.cascade,`cascade`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation deletes the zone-level IP Access Rule. If cascade is enabled, similar rules in other zones may also be deleted.`})){process.stderr.write(`Aborted.
10
- `);return}if(e.body){let r=l(e.body);o(await c(`Deleting`,async()=>t.firewall.zoneAccessRules.delete({...r,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Deleted`});return}let i=u({cascade:d(e.cascade,`cascade`,`text`)});o(await c(`Deleting`,async()=>t.firewall.zoneAccessRules.delete({...i,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Deleted`})}};function Pe(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`notes`,{type:`string`,description:`An informative summary of the rule, typically used as a reminder or explanation.`}).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:`edit <rule-id>`,describe:"Updates an IP Access rule defined at the zone level. You can only update the rule action (`mode` parameter) and notes.",builder:Pe,handler:async e=>{if(e.dryRun){s({command:`cf firewall zone-access-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/access_rules/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({mode:d(e.mode,`mode`,`text`),notes:d(e.notes,`notes`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.firewall.zoneAccessRules.edit({...r,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Updated`});return}let i=u({mode:d(e.mode,`mode`,`text`),notes:d(e.notes,`notes`,`text`)});o(await c(`Updating`,async()=>t.firewall.zoneAccessRules.edit({...i,zone_id:n,rule_id:e[`rule-id`]})),{successLabel:`Updated`})}};function Ie(e){return e.option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`configuration-target`,{type:`string`,description:`The target to search in existing rules.`,choices:[`ip`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:"The target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`.\nNotes: You can search for a single IPv4 address, an IP address range with a subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code."}).option(`notes`,{type:`string`,description:`The string to search for in the notes of existing IP Access rules.
11
- Notes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.`}).option(`match`,{type:`string`,description:"When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`order`,{type:`string`,description:`The field used to sort returned rules.`,choices:[`configuration.target`,`configuration.value`,`mode`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned rules.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`list`,describe:`Fetches IP Access rules of a zone. You can filter the results using several optional parameters.`,builder:m(Ie),handler:async e=>{let t={mode:e.mode,"configuration.target":e[`configuration-target`],"configuration.value":e[`configuration-value`],notes:e.notes,match:e.match,page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){s({command:`cf firewall zone-access-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/access_rules/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await a(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.firewall.zoneAccessRules.list({zone_id:i,...t})),{successLabel:`Loaded`})}},Re={command:`zone-access-rules`,describe:`Zone-scoped IP access rules for blocking or allowing traffic`,builder:e=>e.command(je).command(Ne).command(Fe).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ze={command:`firewall`,describe:`Legacy firewall rules, zone lockdowns, access rules, user-agent blocking, and WAF packages`,builder:e=>e.command(C).command(P).command(ne).command(pe).command(ke).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ze as default};