cf 1.0.0-beta.5 → 1.0.0-beta.6

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 (261) hide show
  1. package/dist/_meta/commands.json +5047 -5068
  2. package/dist/_meta/hand-written-commands.json +1 -1
  3. package/dist/_meta/schemas.json +3026 -3123
  4. package/dist/abuse-reports-BtI6fvRl.mjs +24 -0
  5. package/dist/{access-DRlrq_cq.mjs → access-CqOyTHw4.mjs} +1 -1
  6. package/dist/{account-tags-DMCYk5rR.mjs → account-tags-7I77Dwsd.mjs} +1 -1
  7. package/dist/{accounts-BlVDzIWc.mjs → accounts-Cq-eOPzL.mjs} +32 -26
  8. package/dist/{acm-CCc33e4l.mjs → acm-CSXnlN6o.mjs} +1 -1
  9. package/dist/{addressing-BA-5A3jQ.mjs → addressing-C5XvjNhk.mjs} +1 -1
  10. package/dist/{agent-memory-Csgs8W5u.mjs → agent-memory-CSzr9gty.mjs} +1 -1
  11. package/dist/{ai-BN_pzw7p.mjs → ai-C0xWIvsG.mjs} +7 -9
  12. package/dist/{ai-audit-Dbln3Ai6.mjs → ai-audit-B43vm1KJ.mjs} +1 -1
  13. package/dist/{ai-gateway-BhASWwdp.mjs → ai-gateway-BK3MbIzT.mjs} +1 -1
  14. package/dist/{ai-search-DvA8g4xr.mjs → ai-search-TrFTxBbn.mjs} +1 -1
  15. package/dist/{ai-security-nualpneg.mjs → ai-security-JrYa27qd.mjs} +1 -1
  16. package/dist/{alerting-HUbVuQMl.mjs → alerting-B1-ZwfVT.mjs} +1 -1
  17. package/dist/{analytics-ClKN9YnQ.mjs → analytics-B-wlVtDV.mjs} +1 -1
  18. package/dist/{analytics_engine-DP_O5HIq.mjs → analytics_engine-DWzzQzOs.mjs} +1 -1
  19. package/dist/{api-security-Ce_9nFH9.mjs → api-security-BWFWWmXl.mjs} +1 -1
  20. package/dist/{argo-CLLBrtiV.mjs → argo-DHPGTvCT.mjs} +1 -1
  21. package/dist/{artifacts-CIxZX3VM.mjs → artifacts-mmBDk3wO.mjs} +1 -1
  22. package/dist/{audit-logs-DjzIj9T4.mjs → audit-logs-CCF5e500.mjs} +1 -1
  23. package/dist/{auth-CgPQplnD.mjs → auth-Dnp10uLy.mjs} +1 -1
  24. package/dist/{auth-B_Utev-x.mjs → auth-gOCL6Pm0.mjs} +2 -2
  25. package/dist/{autoconfig-BunaOShS.mjs → autoconfig-DqEPKpj0.mjs} +1 -1
  26. package/dist/basin-catalog-hRY01t_Z.mjs +44 -0
  27. package/dist/{billing-tHlHhEVf.mjs → billing-C_ev-9nh.mjs} +1 -1
  28. package/dist/{bot-management-ChV-gaXh.mjs → bot-management-CyYsXkZt.mjs} +1 -1
  29. package/dist/{botnet-feed-DQWBOEqC.mjs → botnet-feed-Dj5R5v2o.mjs} +1 -1
  30. package/dist/{brand-protection-B3afeuOj.mjs → brand-protection-CmQ6Iu0I.mjs} +1 -1
  31. package/dist/{browser-run-eQMomr1x.mjs → browser-run-sWHTsCSB.mjs} +1 -1
  32. package/dist/build-Dyt1M_Ib.mjs +2 -0
  33. package/dist/{build-VUz0URCV.mjs → build-_qqitpn0.mjs} +1 -1
  34. package/dist/{builds-wTOvlp0S.mjs → builds-c21rTfcg.mjs} +1 -1
  35. package/dist/{cache-s4HK0we7.mjs → cache-CuNjJl6m.mjs} +27 -27
  36. package/dist/{certificate-authorities-CaPUfYzA.mjs → certificate-authorities-DRUUzvI3.mjs} +1 -1
  37. package/dist/{cli-CT-QJu7q.mjs → cli-Caa776EB.mjs} +1 -1
  38. package/dist/{client-certificates-BfNDnT8H.mjs → client-certificates-BSi1CEGk.mjs} +1 -1
  39. package/dist/{client-side-security-BV7iORbb.mjs → client-side-security-BdxUX3Y8.mjs} +1 -1
  40. package/dist/{cloud-connector-CGT8ezvv.mjs → cloud-connector-B46ajuAj.mjs} +1 -1
  41. package/dist/{cloudforce-one-BDhbXtA_.mjs → cloudforce-one-adbVR2Ah.mjs} +47 -56
  42. package/dist/{command-DJF4wdrM.mjs → command-B47VlNBp.mjs} +1 -1
  43. package/dist/{command-ozwmaY7n.mjs → command-B5Itp2BM.mjs} +1 -1
  44. package/dist/{command-DjNcY4cf.mjs → command-BDCTd8Ra.mjs} +1 -1
  45. package/dist/{command-Cox9Wh1i.mjs → command-BmXnByw9.mjs} +1 -1
  46. package/dist/{command-C3Qhz4kU.mjs → command-Bw-M_qxb.mjs} +1 -1
  47. package/dist/{command-BgBsFEYv.mjs → command-C2bU5Etc.mjs} +1 -1
  48. package/dist/{command-DQcG8PK-.mjs → command-CHcCSvVz.mjs} +1 -1
  49. package/dist/{command-C8gLcKlB.mjs → command-CRgQ0dM3.mjs} +1 -1
  50. package/dist/{command-DH67hNLj.mjs → command-CVg0qT13.mjs} +1 -1
  51. package/dist/{command-DpEQ07Xe.mjs → command-CkJvjkfK.mjs} +1 -1
  52. package/dist/{command-C_l69o2b.mjs → command-DV196MKR.mjs} +1 -1
  53. package/dist/{command-lYaHS62l.mjs → command-Du3MiYA7.mjs} +1 -1
  54. package/dist/{command-SgtzgQrs.mjs → command-eBmGBTA7.mjs} +1 -1
  55. package/dist/{command-G_VL3Jf8.mjs → command-eqgT8zz4.mjs} +1 -1
  56. package/dist/{completions-VR53Fiec.mjs → completions-DbT6O2ol.mjs} +1 -1
  57. package/dist/{connector-interrupts-hfttjm-b.mjs → connector-interrupts-BhfMiPcq.mjs} +1 -1
  58. package/dist/{connector-telemetry-events-5nVvivYA.mjs → connector-telemetry-events-CxKECRgO.mjs} +1 -1
  59. package/dist/{connector-telemetry-snapshots-DKk_7VQa.mjs → connector-telemetry-snapshots-BHi-jHE5.mjs} +1 -1
  60. package/dist/{connectors-CvX4Z3cg.mjs → connectors-gkP2aNSN.mjs} +1 -1
  61. package/dist/{containers-BU9RquYh.mjs → containers-BY8pinEV.mjs} +1 -1
  62. package/dist/{containers-BQxj87na.mjs → containers-DUvBpnRo.mjs} +1 -1
  63. package/dist/{content-scan-hWh-aGbO.mjs → content-scan-BCPhAjMZ.mjs} +1 -1
  64. package/dist/{context-CPVzoKbN.mjs → context-CE7QFX-z.mjs} +1 -1
  65. package/dist/{cps-o8QQFfnF.mjs → cps-B35EPUAk.mjs} +1 -1
  66. package/dist/{csamScanner-DHod3Hak.mjs → csamScanner-DcTA9oLR.mjs} +1 -1
  67. package/dist/{ct-alerting-D-_YsE1x.mjs → ct-alerting-B3CS-CPk.mjs} +1 -1
  68. package/dist/{custom-certificates-UnaVRb3W.mjs → custom-certificates-IjJJhl7_.mjs} +1 -1
  69. package/dist/{custom-csrs-BCJ7LOUe.mjs → custom-csrs-ChYOaEQg.mjs} +1 -1
  70. package/dist/{custom-hostnames-DOluVIfa.mjs → custom-hostnames-Bai3cqAD.mjs} +1 -1
  71. package/dist/{custom-nameservers-CvIucaA2.mjs → custom-nameservers-DsukmLNZ.mjs} +1 -1
  72. package/dist/{custom-pages-DzrXSeCR.mjs → custom-pages-CiboX-9D.mjs} +1 -1
  73. package/dist/d1-s293SFAJ.mjs +41 -0
  74. package/dist/{dcv-delegation-9bMHPSoc.mjs → dcv-delegation-BfgvmpQT.mjs} +1 -1
  75. package/dist/{deploy-BT_EVz0K.mjs → deploy-CvxNMDbS.mjs} +1 -1
  76. package/dist/{deploy-input-YW632ysz.mjs → deploy-input-CNrImP7B.mjs} +1 -1
  77. package/dist/{dev-jRnP9IIJ.mjs → dev-Z6vYszaT.mjs} +1 -1
  78. package/dist/{diagnostics-BIe-XR-P.mjs → diagnostics-Ops0RjxG.mjs} +1 -1
  79. package/dist/discover-CcGReXr0.mjs +2 -0
  80. package/dist/{dist-COohnEBL.mjs → dist-Dgnf_i4w.mjs} +1 -1
  81. package/dist/{dls-BuKO5QWL.mjs → dls-uo7NYEqE.mjs} +1 -1
  82. package/dist/{dns-DzVN-WA4.mjs → dns-B-NwBOpQ.mjs} +52 -43
  83. package/dist/{dns-firewall-Dx_XvWKJ.mjs → dns-firewall-LTIP13nb.mjs} +1 -1
  84. package/dist/durable-objects-o7uB3YYg.mjs +6 -0
  85. package/dist/{email-auth-DqIyzEcR.mjs → email-auth-BUdBDCaE.mjs} +1 -1
  86. package/dist/{email-routing-8rhAmzOY.mjs → email-routing-BPRliM3z.mjs} +1 -1
  87. package/dist/{email-security-BRq5J31C.mjs → email-security-dbLE3I5c.mjs} +50 -50
  88. package/dist/{email-sending-Bsfk4Jia.mjs → email-sending-BLlGy5Mn.mjs} +1 -1
  89. package/dist/error-sanitization-CEf4JTNN.mjs +2 -0
  90. package/dist/{error-sanitization-Dc4bLj8k.mjs → error-sanitization-CcNUzN1f.mjs} +1 -1
  91. package/dist/{fieldExtractors-COaK02vB.mjs → fieldExtractors-M-KfLOGw.mjs} +1 -1
  92. package/dist/{firewall-Dar706zc.mjs → firewall-DzbLwqo3.mjs} +1 -1
  93. package/dist/flagship-DcXWEywy.mjs +28 -0
  94. package/dist/{fraud-H-mdJfRU.mjs → fraud-CGXRWANi.mjs} +1 -1
  95. package/dist/generate-t4dFfFRV.mjs +2 -0
  96. package/dist/{google-tag-gateway-zqXS_12f.mjs → google-tag-gateway-B3Z3Puwl.mjs} +1 -1
  97. package/dist/{healthchecks-x889sT8g.mjs → healthchecks-BIiV29q7.mjs} +1 -1
  98. package/dist/{hostnames-DqB5I-_U.mjs → hostnames-ueWsZFwv.mjs} +1 -1
  99. package/dist/{hyperdrive-sR7Mwif9.mjs → hyperdrive-Bxk9LZf5.mjs} +1 -1
  100. package/dist/{iam-CKt7U41p.mjs → iam-kA9gcv79.mjs} +1 -1
  101. package/dist/{images-CakdBcMc.mjs → images-CK4J5as7.mjs} +1 -1
  102. package/dist/index.mjs +1 -1
  103. package/dist/{init-CVyWV_Ow.mjs → init-COcG8sp5.mjs} +2 -2
  104. package/dist/{intel-Dcv1vMsK.mjs → intel-z7DkM9Xc.mjs} +1 -1
  105. package/dist/{ips-Ce9_k1Vh.mjs → ips-BXdBK4Co.mjs} +1 -1
  106. package/dist/{keyless-certificates-Cf_6sc7K.mjs → keyless-certificates-Dp9xTYtD.mjs} +1 -1
  107. package/dist/{keys-DW2A43fL.mjs → keys-DrVlj4VI.mjs} +1 -1
  108. package/dist/{kv-BKBWXf8s.mjs → kv-WX-dlUT1.mjs} +1 -1
  109. package/dist/{lazy-command-BOjQB_U7.mjs → lazy-command-g04RHlS2.mjs} +1 -1
  110. package/dist/{leaked-credential-checks-D-gwxxaF.mjs → leaked-credential-checks-BMQ0VhCd.mjs} +1 -1
  111. package/dist/{load-balancers-DHUVei95.mjs → load-balancers-BbkSL89c.mjs} +1 -1
  112. package/dist/local-BWhuu9TH.mjs +2 -0
  113. package/dist/{local-B3OyWKkW.mjs → local-Cyk8fPvL.mjs} +1 -1
  114. package/dist/{local-runtime-Co5vVDlI.mjs → local-runtime-CWWJJB2E.mjs} +1 -1
  115. package/dist/{login-CptngugC.mjs → login-CyU_ZTNI.mjs} +1 -1
  116. package/dist/{login-D37fy09s.mjs → login-DYQ8UgJQ.mjs} +1 -1
  117. package/dist/{logo-matches-D1aNSBnZ.mjs → logo-matches-HFmD2hK6.mjs} +1 -1
  118. package/dist/{logos-SyEjq15s.mjs → logos-Di2PABE_.mjs} +1 -1
  119. package/dist/{logpush-l9tVWnua.mjs → logpush-DEqdt0I0.mjs} +1 -1
  120. package/dist/logs-Ckfw-3Q_.mjs +37 -0
  121. package/dist/{magic-cloud-networking-CN2Qd2Lx.mjs → magic-cloud-networking-C0yBJKMb.mjs} +1 -1
  122. package/dist/{magic-network-monitoring-8jxG-tPc.mjs → magic-network-monitoring-CLvaiI7s.mjs} +1 -1
  123. package/dist/{magic-transit-DLhIQz2l.mjs → magic-transit-Bhb1kxYj.mjs} +108 -112
  124. package/dist/{managed-defense-CgKdTd9J.mjs → managed-defense-COL3aqXw.mjs} +1 -1
  125. package/dist/{managed-transforms-BASi4j_s.mjs → managed-transforms-cK0strTK.mjs} +1 -1
  126. package/dist/{matches-BCV6x948.mjs → matches-Df4WEz0x.mjs} +1 -1
  127. package/dist/{mcp-DQODvLQm.mjs → mcp-DK_5OUVl.mjs} +1 -1
  128. package/dist/{mesh-S_yYh-w3.mjs → mesh-CVXpTYED.mjs} +1 -1
  129. package/dist/{migrate-B4kBnkpV.mjs → migrate-CipwWhJE.mjs} +1 -1
  130. package/dist/monetization-BHk0S5BF.mjs +20 -0
  131. package/dist/{mtls-certificates-XJXK21J_.mjs → mtls-certificates-8pzdxzOX.mjs} +1 -1
  132. package/dist/{network-DA81Mcdh.mjs → network-ClNeXTvG.mjs} +1 -1
  133. package/dist/{network-interconnects-OttR92s7.mjs → network-interconnects-t3jSoV7o.mjs} +1 -1
  134. package/dist/{oauth-ChXrM0q9.mjs → oauth-CJamdfrC.mjs} +1 -1
  135. package/dist/{oauth-CKeW8CqE.mjs → oauth-CNSirGUu.mjs} +1 -1
  136. package/dist/{oauth-clients-Ba-YZsxB.mjs → oauth-clients-DBxdvlJC.mjs} +1 -1
  137. package/dist/{oauth-scopes-XqOk2zCQ.mjs → oauth-scopes-D39GYkt6.mjs} +1 -1
  138. package/dist/{observability-BdIbZ1D8.mjs → observability-ZV1yPflB.mjs} +1 -1
  139. package/dist/{organization-DnQ2_txo.mjs → organization-Bk-TkQlB.mjs} +7 -7
  140. package/dist/{organizations-BkI0IhEg.mjs → organizations-hXITNpPl.mjs} +1 -1
  141. package/dist/{origin-ca-certificates-Br91H1EG.mjs → origin-ca-certificates-DsLR_Z2e.mjs} +1 -1
  142. package/dist/{origin-post-quantum-encryption-BcpK8DaG.mjs → origin-post-quantum-encryption-C_egsVQu.mjs} +1 -1
  143. package/dist/{origin-tls-client-auth-CYK6YnzK.mjs → origin-tls-client-auth-DPG6A6kz.mjs} +1 -1
  144. package/dist/{page-rules-DpOcNsJr.mjs → page-rules-B8lrkiiF.mjs} +1 -1
  145. package/dist/pages-Cx4doLvQ.mjs +54 -0
  146. package/dist/{pay-per-crawl-BORpCGxC.mjs → pay-per-crawl-BUVHqPPA.mjs} +1 -1
  147. package/dist/{pay-per-use-CZw-KHEz.mjs → pay-per-use-CzYgryid.mjs} +1 -1
  148. package/dist/{pipelines-DDDyJ6Oe.mjs → pipelines-CGHmwc4a.mjs} +1 -1
  149. package/dist/{precursor-DrH1i64o.mjs → precursor--Jim5u4y.mjs} +1 -1
  150. package/dist/{previews-CiYBBKj8.mjs → previews-BKO1pZyG.mjs} +1 -1
  151. package/dist/{progress-DS2fwfNP.mjs → progress-CRjK46r1.mjs} +1 -1
  152. package/dist/{prompt-doX80PCd.mjs → prompt-C_90YsVE.mjs} +1 -1
  153. package/dist/{queries-CD6h6iEP.mjs → queries-z2pjzXlA.mjs} +1 -1
  154. package/dist/{queues-3TpjE349.mjs → queues-D0IXxSa7.mjs} +1 -1
  155. package/dist/{r2-CV_hSFkM.mjs → r2-DQ7w9dCM.mjs} +1 -1
  156. package/dist/r2-data-catalog-DpktRU5y.mjs +2 -0
  157. package/dist/{radar-6-4_LoQ1.mjs → radar-DyLO7Zg1.mjs} +1 -1
  158. package/dist/{raw-fetch-_Z55VEDY.mjs → raw-fetch-C8SdmQBp.mjs} +1 -1
  159. package/dist/{realtime-B5ce977I.mjs → realtime-mQzLbDxe.mjs} +1 -1
  160. package/dist/{registrar-CF-3h2dN.mjs → registrar-ClbtM5Dy.mjs} +2 -2
  161. package/dist/{registrar-sandbox-BDRZbyAV.mjs → registrar-sandbox-BIEHm_Jp.mjs} +2 -2
  162. package/dist/{reporting-CiS-RBNJ.mjs → reporting-CjkMzSsZ.mjs} +1 -1
  163. package/dist/{request-headers-DPbWytRv.mjs → request-headers-jr2VznA9.mjs} +1 -1
  164. package/dist/{request-tracers-Drcpv8ha.mjs → request-tracers-BoSXOTox.mjs} +1 -1
  165. package/dist/{resource-sharing-BI3CoOjl.mjs → resource-sharing-CFS39nJq.mjs} +1 -1
  166. package/dist/{resource-tagging-D4i_-E0W.mjs → resource-tagging-CZ5mvMhE.mjs} +1 -1
  167. package/dist/{rules-C4I4CLoq.mjs → rules-CfqumI45.mjs} +4 -4
  168. package/dist/{rulesets-c2efesdy.mjs → rulesets-o3jsPv4U.mjs} +20 -20
  169. package/dist/{rum-DT58nW8a.mjs → rum-BZ0rYlun.mjs} +1 -1
  170. package/dist/run-D0_7wBp2.mjs +2 -0
  171. package/dist/{run-CJ-6owN3.mjs → run-huwFFwXd.mjs} +1 -1
  172. package/dist/{schema-flags-DDW79Tda.mjs → schema-flags-nL7pHvaE.mjs} +1 -1
  173. package/dist/{scim-PfJWMuRu.mjs → scim-0-eR9pvC.mjs} +1 -1
  174. package/dist/{sdk-Bx29ZKK3.mjs → sdk-Bmz7t_CD.mjs} +1 -1
  175. package/dist/{secrets-store-7jrgww1J.mjs → secrets-store-Duc29Zs-.mjs} +1 -1
  176. package/dist/security-insights-5CuLC-Yo.mjs +40 -0
  177. package/dist/{security-txt-ButEG3qy.mjs → security-txt-qm2PqCPz.mjs} +1 -1
  178. package/dist/{shared-JNtE--kh.mjs → shared-BDIrEKWt.mjs} +1 -1
  179. package/dist/{smart-shield-DgbYuUFC.mjs → smart-shield-BXLH9OM0.mjs} +1 -1
  180. package/dist/{snippets-De-xVTIb.mjs → snippets-DZG6UWeH.mjs} +1 -1
  181. package/dist/{spawn-IM_tQldH.mjs → spawn-KZqyx6KK.mjs} +1 -1
  182. package/dist/{spectrum-DcknX0jS.mjs → spectrum-Be4ImAIY.mjs} +1 -1
  183. package/dist/{speed-Cn_p-ieT.mjs → speed-CNWujfIC.mjs} +1 -1
  184. package/dist/{src-BYjublVL.mjs → src-CW6py11z.mjs} +5 -5
  185. package/dist/{ssl-Bkn4ke9Q.mjs → ssl-BIlS4Qs8.mjs} +1 -1
  186. package/dist/{stream-Cx78uNm_.mjs → stream-C5RvTAKF.mjs} +1 -1
  187. package/dist/{submit-Gu34n1a6.mjs → submit-Bpru4P79.mjs} +1 -1
  188. package/dist/{tags-BQqO7TLX.mjs → tags-Rv7X1rU9.mjs} +1 -1
  189. package/dist/{telemetry-Qc-g_0fL.mjs → telemetry-0npQCuKc.mjs} +1 -1
  190. package/dist/telemetry-B4_YhD82.mjs +2 -0
  191. package/dist/tenant-CjYf6OPN.mjs +10 -0
  192. package/dist/{tenant-custom-nameservers-B5Nf5hLr.mjs → tenant-custom-nameservers-BbHaaEhv.mjs} +1 -1
  193. package/dist/{tunnels-ndJtol-f.mjs → tunnels-CLWPaIIF.mjs} +1 -1
  194. package/dist/{turnstile-Cd65N6jD.mjs → turnstile-C5ezKSoz.mjs} +1 -1
  195. package/dist/update-check-CebyUyqG.mjs +2 -0
  196. package/dist/{update-check-AraGlAQf.mjs → update-check-aOpHVlzB.mjs} +1 -1
  197. package/dist/update-check-worker.mjs +1 -1
  198. package/dist/{url-info-CQKJ5A-x.mjs → url-info-Gcf8-MyB.mjs} +1 -1
  199. package/dist/{url-normalization-BPXZwYu0.mjs → url-normalization-Dvg8mZRk.mjs} +1 -1
  200. package/dist/{url-scanner-Bq43LJ98.mjs → url-scanner-BZCsgh0O.mjs} +1 -1
  201. package/dist/{user-D4InwQxA.mjs → user-BnkvXmjc.mjs} +1 -1
  202. package/dist/{values-C3YLablc.mjs → values-yUGls__L.mjs} +1 -1
  203. package/dist/{vectorize-CYt0qXQ5.mjs → vectorize-BiXngTuI.mjs} +3 -3
  204. package/dist/version-C3q1GMTe.mjs +2 -0
  205. package/dist/{waiting-rooms-B3ksWao9.mjs → waiting-rooms-BoLWF74U.mjs} +1 -1
  206. package/dist/{web-assets-DNiElHgV.mjs → web-assets-CEJ9Zne1.mjs} +1 -1
  207. package/dist/{web3-DfMKMDix.mjs → web3-CIjm7EuJ.mjs} +1 -1
  208. package/dist/workers-DdtWb7Ws.mjs +38 -0
  209. package/dist/{workers-builds-DbEy311-.mjs → workers-builds-DT4tA-KT.mjs} +1 -1
  210. package/dist/workers-for-platforms-CaCr8ApU.mjs +42 -0
  211. package/dist/{workers-vpc-BEnB6e_3.mjs → workers-vpc-DRtjG39D.mjs} +1 -1
  212. package/dist/{workflows-CX3Zer8w.mjs → workflows-DRme6yrC.mjs} +2 -2
  213. package/dist/{wrangler-migration-BDkh1_IV.mjs → wrangler-migration-BDnS1puc.mjs} +1 -1
  214. package/dist/{zaraz-DR1KbYY-.mjs → zaraz-DmjDEnUJ.mjs} +1 -1
  215. package/dist/{zero-trust-CLoXVq1e.mjs → zero-trust-BRAHExxa.mjs} +427 -441
  216. package/dist/{zone-B9qejq6W.mjs → zone-CclLvb-g.mjs} +1 -1
  217. package/dist/{zones-BxU08wO0.mjs → zones-C6tc2OOV.mjs} +1 -1
  218. package/package.json +3 -2
  219. package/dist/abuse-reports-DoqL_52r.mjs +0 -26
  220. package/dist/account-DfC3gRTf.mjs +0 -12
  221. package/dist/build-DFa0ngeO.mjs +0 -2
  222. package/dist/d1-BCg7BhWi.mjs +0 -45
  223. package/dist/discover-DgHRf-qo.mjs +0 -2
  224. package/dist/durable-objects-DnU6OsEb.mjs +0 -8
  225. package/dist/error-sanitization-Cu-8OKRA.mjs +0 -2
  226. package/dist/flagship-CTchDpyw.mjs +0 -28
  227. package/dist/generate-qMU-2MgC.mjs +0 -2
  228. package/dist/local-qOpZjDed.mjs +0 -2
  229. package/dist/logs-EW0Pq-gf.mjs +0 -48
  230. package/dist/pages-Cw4DM-1N.mjs +0 -60
  231. package/dist/r2-data-catalog-D_YHTMFG.mjs +0 -44
  232. package/dist/run-D0esoYSn.mjs +0 -2
  233. package/dist/security-center-BhUM_Flh.mjs +0 -30
  234. package/dist/telemetry-D2UwfCd1.mjs +0 -2
  235. package/dist/tenant-Dr0hGlhU.mjs +0 -12
  236. package/dist/update-check-D5-zqJoN.mjs +0 -2
  237. package/dist/version-DyZwKU6l.mjs +0 -2
  238. package/dist/workers-C8uiRedD.mjs +0 -40
  239. package/dist/workers-for-platforms-BjvcY5A1.mjs +0 -25
  240. /package/dist/{alerts-DqZgVSCT.mjs → alerts-DY_7Nknx.mjs} +0 -0
  241. /package/dist/{autorag-Cq9k9Ye6.mjs → autorag-K396-M2S.mjs} +0 -0
  242. /package/dist/{cloudflared-91JvyShh.mjs → cloudflared-Ciq4L97v.mjs} +0 -0
  243. /package/dist/{command-C72KLHMc.mjs → command-D1Z5uf_S.mjs} +0 -0
  244. /package/dist/{discover-VRFBjse7.mjs → discover-B_3A4a_t.mjs} +0 -0
  245. /package/dist/{generate-iV6OVNin.mjs → generate-QUDsysBJ.mjs} +0 -0
  246. /package/dist/{rate-limit-analytics-Bw9qmxMx.mjs → rate-limit-analytics-YsGha5pH.mjs} +0 -0
  247. /package/dist/{rate-limits-CDm_xzKt.mjs → rate-limits-kH13NRdf.mjs} +0 -0
  248. /package/dist/{ready-BXGqY1Wi.mjs → ready-DYun4Fpn.mjs} +0 -0
  249. /package/dist/{recent-submissions-AhGZD3a3.mjs → recent-submissions-18NaOGOo.mjs} +0 -0
  250. /package/dist/{refute-D_w5Gw20.mjs → refute-BhMiJcE1.mjs} +0 -0
  251. /package/dist/{registry-DBMUTYqf.mjs → registry-CSv7HR1J.mjs} +0 -0
  252. /package/dist/{scan-logo-BZzFam-Q.mjs → scan-logo-7y0pqFMk.mjs} +0 -0
  253. /package/dist/{scan-page-BPA8nSPM.mjs → scan-page-B6jnK3QI.mjs} +0 -0
  254. /package/dist/{schema-CueLBLXC.mjs → schema-JVvksQ1J.mjs} +0 -0
  255. /package/dist/{search-De0UlXYN.mjs → search-Rn3Eefv8.mjs} +0 -0
  256. /package/dist/{signed-url-ziDz9frX.mjs → signed-url-Dzwy9Xiw.mjs} +0 -0
  257. /package/dist/{submission-info-83D2DCCG.mjs → submission-info-SNhkDRRZ.mjs} +0 -0
  258. /package/dist/{tools-BJbI_f35.mjs → tools-CFEubTr4.mjs} +0 -0
  259. /package/dist/{total-queries-Dhol31Kn.mjs → total-queries-B20xslrH.mjs} +0 -0
  260. /package/dist/{tracked-domains-DoOPs6Vd.mjs → tracked-domains-BCvIOZOK.mjs} +0 -0
  261. /package/dist/{verify-CxpGEnJb.mjs → verify-DOeBG4PL.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{a as r,r as i}from"./auth-B_Utev-x.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-DS2fwfNP.mjs";import{t as c}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{i as l,n as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f}from"./input-validation-Dk52b0me.mjs";import{a as p}from"./prompt-doX80PCd.mjs";import{t as m}from"./cli-types-DoVT5q_M.mjs";function h(e){return e.usage("$0 registrar-sandbox extensions get <extension>\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <extension>`,describe:`Get extension`,builder:h,handler:async r=>c({command:`registrar-sandbox extensions get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/registrar-sandbox/extensions/${r.extension==null?`<extension>`:encodeURIComponent(String(r.extension))}`,pathParams:{extension:String(r.extension??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:r.extension})),{successLabel:`Loaded`})})};function _(e){return e.usage("$0 registrar-sandbox extensions list\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{a as r,r as i}from"./auth-gOCL6Pm0.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-CRjK46r1.mjs";import{t as c}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{i as l,n as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f}from"./input-validation-Dk52b0me.mjs";import{a as p}from"./prompt-C_90YsVE.mjs";import{t as m}from"./cli-types-DoVT5q_M.mjs";function h(e){return e.usage("$0 registrar-sandbox extensions get <extension>\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <extension>`,describe:`Get extension`,builder:h,handler:async r=>c({command:`registrar-sandbox extensions get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/registrar-sandbox/extensions/${r.extension==null?`<extension>`:encodeURIComponent(String(r.extension))}`,pathParams:{extension:String(r.extension??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.registrarSandbox.extensions.get({account_id:l,extension:r.extension})),{successLabel:`Loaded`})})};function _(e){return e.usage("$0 registrar-sandbox extensions list\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
3
3
  Pass this value to fetch the next page of results. Omit (or
4
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List extensions`,builder:m(_),handler:async r=>c({command:`registrar-sandbox extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},r,async()=>{let c={name:r.name,cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.extensions.list({account_id:u,...c})),{successLabel:`Loaded`})})},y={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage("$0 registrar-sandbox registrations check <domains>\n\nPerforms real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.").positional(`domains`,{type:`string`,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const x={command:`check <domains>`,describe:`Check domain availability`,builder:b,handler:async r=>c({command:`registrar-sandbox registrations check`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...e,account_id:l})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function S(e){return e.usage("$0 registrar-sandbox registrations create\n\nStarts a domain registration workflow. ### Prerequisites - The account must not already be at the maximum supported domain limit. A single account may own up to 500 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.").option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
4
+ pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List extensions`,builder:m(_),handler:async r=>c({command:`registrar-sandbox extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},r,async()=>{let c={name:r.name,cursor:r.cursor,per_page:r[`per-page`],direction:r.direction,sort_by:r[`sort-by`]};if(r.dryRun){o({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.registrarSandbox.extensions.list({account_id:u,...c})),{successLabel:`Loaded`})})},y={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage("$0 registrar-sandbox registrations check <domains...>\n\nPerforms real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.").positional(`domains`,{type:`string`,array:!0,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const x={command:`check <domains...>`,describe:`Check domain availability`,builder:b,handler:async r=>c({command:`registrar-sandbox registrations check`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({domains:r.domains}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...e,account_id:l})),{successLabel:`Created`});return}let f=d({domains:r.domains});a(await s(`Creating`,async()=>c.registrarSandbox.registrations.check({...f,account_id:l})),{successLabel:`Created`})})};function S(e){return e.usage("$0 registrar-sandbox registrations create\n\nStarts a domain registration workflow. ### Prerequisites - The account must not already be at the maximum supported domain limit. A single account may own up to 500 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.").option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
5
5
  waiting for the operation to complete (RFC 7240).
6
6
 
7
7
  The header may be combined with other preferences using standard
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{r}from"./auth-B_Utev-x.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-DS2fwfNP.mjs";import{t as s}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{n as c}from"./body-parser-hh2avzkz.mjs";function l(e){return e.usage(`$0 reporting industry get
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c}from"./body-parser-hh2avzkz.mjs";function l(e){return e.usage(`$0 reporting industry get
3
3
 
4
4
  Gets the industry classification for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Get an account industry`,builder:l,handler:async c=>s({command:`reporting industry get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf reporting industry get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.reporting.industry.get({account_id:l})),{successLabel:`Loaded`})})};function d(e){return e.usage(`$0 reporting industry update
5
5
 
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./agent-context-GRiQ4zRU.mjs";import{t}from"./version-DyZwKU6l.mjs";import{i as n,t as r}from"./interactive-C-o16XQs.mjs";function i(){return r?`ci`:n()?`interactive`:`non-interactive`}function a(){let n=e(),r=n.isAgentic&&n.harness!==null?{"X-CF-CLI-Agent":n.harness.id}:{};return{"User-Agent":t,"X-CF-CLI-Mode":i(),...r}}export{a as n,i as t};
2
+ import{t as e}from"./agent-context-GRiQ4zRU.mjs";import{t}from"./version-C3q1GMTe.mjs";import{i as n,t as r}from"./interactive-C-o16XQs.mjs";function i(){return r?`ci`:n()?`interactive`:`non-interactive`}function a(){let n=e(),r=n.isAgentic&&n.harness!==null?{"X-CF-CLI-Agent":n.harness.id}:{};return{"User-Agent":t,"X-CF-CLI-Mode":i(),...r}}export{a as n,i as t};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{r}from"./auth-B_Utev-x.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-DS2fwfNP.mjs";import{t as s}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d}from"./prompt-doX80PCd.mjs";function f(e){return e.usage(`$0 request-tracers traces create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d}from"./prompt-C_90YsVE.mjs";function f(e){return e.usage(`$0 request-tracers traces create
3
3
 
4
4
  Traces a simulated HTTP request through Cloudflare's edge to analyze how rules, settings, and configurations would process the request. Useful for debugging firewall rules, page rules, and other request transformations without sending actual traffic. Supports custom headers, cookies, body content, and geolocation context.`).option(`body-base64`,{type:`string`,description:`Base64 encoded request body`}).option(`body-plain-text`,{type:`string`,description:`Request body as plain text`}).option(`context-bot-score`,{type:`number`,description:`Bot score used for evaluating tracing request processing`}).option(`context-geoloc-city`,{type:`string`,description:`The context.geoloc.city field`}).option(`context-geoloc-continent`,{type:`string`,description:`The context.geoloc.continent field`}).option(`context-geoloc-is-eu-country`,{type:`boolean`,description:`The context.geoloc.is_eu_country field`}).option(`context-geoloc-iso-code`,{type:`string`,description:`The context.geoloc.iso_code field`}).option(`context-geoloc-latitude`,{type:`number`,description:`The context.geoloc.latitude field`}).option(`context-geoloc-longitude`,{type:`number`,description:`The context.geoloc.longitude field`}).option(`context-geoloc-postal-code`,{type:`string`,description:`The context.geoloc.postal_code field`}).option(`context-geoloc-region-code`,{type:`string`,description:`The context.geoloc.region_code field`}).option(`context-geoloc-subdivision-2-iso-code`,{type:`string`,description:`The context.geoloc.subdivision_2_iso_code field`}).option(`context-geoloc-timezone`,{type:`string`,description:`The context.geoloc.timezone field`}).option(`context-skip-challenge`,{type:`boolean`,description:`Whether to skip any challenges for tracing request (e.g.: captcha)`}).option(`context-threat-score`,{type:`number`,description:`Threat score used for evaluating tracing request processing`}).option(`method`,{type:`string`,description:`HTTP Method of tracing request`}).option(`protocol`,{type:`string`,description:`HTTP Protocol of tracing request`}).option(`skip-response`,{type:`boolean`,description:`Skip sending the request to the Origin server after all rules evaluation`}).option(`url`,{type:`string`,description:`URL to which perform tracing request`}).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:`Request Trace`,builder:f,handler:async f=>s({command:`request-tracers traces create`,classification:{safeFlags:[`context-geoloc-is-eu-country`,`context-skip-challenge`,`skip-response`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({body:{base64:u(f[`body-base64`],`body-base64`,`text`),plain_text:u(f[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:f[`context-bot-score`],geoloc:{city:u(f[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:u(f[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:f[`context-geoloc-is-eu-country`],iso_code:u(f[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:f[`context-geoloc-latitude`],longitude:f[`context-geoloc-longitude`],postal_code:u(f[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:u(f[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:u(f[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:u(f[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:f[`context-skip-challenge`],threat_score:f[`context-threat-score`]},method:u(f.method,`method`,`text`),protocol:u(f.protocol,`protocol`,`text`),skip_response:f[`skip-response`],url:u(f.url,`url`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.requestTracers.traces.create({...e,account_id:p})),{successLabel:`Created`});return}f.method===void 0&&(f.method=await d(`method`,`HTTP Method of tracing request`)),f.url===void 0&&(f.url=await d(`url`,`URL to which perform tracing request`));let m=l({body:{base64:u(f[`body-base64`],`body-base64`,`text`),plain_text:u(f[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:f[`context-bot-score`],geoloc:{city:u(f[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:u(f[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:f[`context-geoloc-is-eu-country`],iso_code:u(f[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:f[`context-geoloc-latitude`],longitude:f[`context-geoloc-longitude`],postal_code:u(f[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:u(f[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:u(f[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:u(f[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:f[`context-skip-challenge`],threat_score:f[`context-threat-score`]},method:u(f.method,`method`,`text`),protocol:u(f.protocol,`protocol`,`text`),skip_response:f[`skip-response`],url:u(f.url,`url`,`text`)});i(await o(`Creating`,async()=>s.requestTracers.traces.create({...m,account_id:p})),{successLabel:`Created`})})},m={command:`traces`,describe:`Simulate request processing to debug rule matches, transforms, and routing decisions`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`request-tracers`,describe:`Trace how a request would be processed through Cloudflare's rules and configuration pipeline`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{r}from"./auth-B_Utev-x.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-DS2fwfNP.mjs";import{t as s}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{a as f,i as p,n as m}from"./prompt-doX80PCd.mjs";import{t as h}from"./cli-types-DoVT5q_M.mjs";function g(e){return e.usage(`$0 resource-sharing create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{a as f,i as p,n as m}from"./prompt-C_90YsVE.mjs";import{t as h}from"./cli-types-DoVT5q_M.mjs";function g(e){return e.usage(`$0 resource-sharing create
3
3
 
4
4
  Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Create a new share`,builder:g,handler:async p=>s({command:`resource-sharing create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({name:d(p.name,`name`,`text`),recipients:l(p.recipients,`recipients`),resources:l(p.resources,`resources`)}):c(p.body)});return}let s=await r(p),m=p.local?e:await n();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Creating`,async()=>s.resourceSharing.create({...e,account_id:m})),{successLabel:`Created`});return}if(p.name===void 0&&(p.name=await f(`name`,`The name of the share.`)),p.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);if(p.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let h=u({name:d(p.name,`name`,`text`),recipients:l(p.recipients,`recipients`),resources:l(p.resources,`resources`)});i(await o(`Creating`,async()=>s.resourceSharing.create({...h,account_id:m})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 resource-sharing delete <share-id>
5
5
 
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{r}from"./auth-B_Utev-x.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-DS2fwfNP.mjs";import{t as s}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";function c(e){return e.usage(`$0 resource-tagging summary get
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";function c(e){return e.usage(`$0 resource-tagging summary get
3
3
 
4
4
  Lists all distinct tag keys and their distinct values across resources in an account.`).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`List tag key summary`,builder:c,handler:async c=>s({command:`resource-tagging summary get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor};if(c.dryRun){a({command:`cf resource-tagging summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/tags/summary`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.resourceTagging.summary.get({account_id:u,...s})),{successLabel:`Loaded`})})},u={command:`summary`,describe:`Operations for summary`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`resource-tagging`,describe:`resource-tagging`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{r}from"./auth-B_Utev-x.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-DS2fwfNP.mjs";import{t as s}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{a as f,n as p}from"./prompt-doX80PCd.mjs";function m(e){return e.usage("$0 rules lists bulk-operations get <operation-id>\n\nGets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.").positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:m,handler:async c=>s({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/bulk_operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}`,pathParams:{"operation-id":String(c[`operation-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.bulkOperations.get({account_id:l,operation_id:c[`operation-id`]})),{successLabel:`Loaded`})})},g={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 rules lists create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{a as f,n as p}from"./prompt-C_90YsVE.mjs";function m(e){return e.usage("$0 rules lists bulk-operations get <operation-id>\n\nGets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.").positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:m,handler:async c=>s({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/bulk_operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}`,pathParams:{"operation-id":String(c[`operation-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.bulkOperations.get({account_id:l,operation_id:c[`operation-id`]})),{successLabel:`Loaded`})})},g={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 rules lists create
3
3
 
4
4
  Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create a list`,builder:_,handler:async l=>s({command:`rules lists create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({description:d(l.description,`description`,`text`),name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await n();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rules.lists.create({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let m=u({description:d(l.description,`description`,`text`),name:d(l.name,`name`,`text`)});i(await o(`Creating`,async()=>s.rules.lists.create({...m,account_id:p})),{successLabel:`Created`})})};function y(e){return e.usage(`$0 rules lists delete <list-id>
5
5
 
6
6
  Deletes a specific list and all its items.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <list-id>`,describe:`Delete a list`,builder:y,handler:async c=>s({command:`rules lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();if(c.accountId=l,!await p({force:!!c.force,message:`This operation deletes the custom list and every item it contains.`})){process.stderr.write(`Aborted.
7
7
  `);return}i(await o(`Deleting`,async()=>s.rules.lists.delete({account_id:l,list_id:c[`list-id`]})),{successLabel:`Deleted`})})};function x(e){return e.usage(`$0 rules lists get <list-id>
8
8
 
9
- Fetches the details of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <list-id>`,describe:`Get a list`,builder:x,handler:async c=>s({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.get({account_id:l,list_id:c[`list-id`]})),{successLabel:`Loaded`})})};function C(e){return e.usage("$0 rules lists items create <list-id>\n\nAppends new items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 w={command:`create <list-id>`,describe:`Create list items`,builder:C,handler:async l=>s({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}/items`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await n();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rules.lists.items.create({body:e,account_id:u,list_id:l[`list-id`]})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function T(e){return e.usage("$0 rules lists items delete <list-id>\n\nRemoves one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`items`,{type:`string`,description:`The items field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`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 E={command:`delete <list-id>`,describe:`Delete list items`,builder:T,handler:async d=>s({command:`rules lists items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{if(d.dryRun){a({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${d[`list-id`]==null?`<list-id>`:encodeURIComponent(String(d[`list-id`]))}/items`,pathParams:{"list-id":String(d[`list-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({items:l(d.items,`items`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await n();if(d.accountId=f,!await p({force:!!d.force,message:`This operation deletes the selected items from the custom list.`})){process.stderr.write(`Aborted.
9
+ Fetches the details of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <list-id>`,describe:`Get a list`,builder:x,handler:async c=>s({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}`,pathParams:{"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.get({account_id:l,list_id:c[`list-id`]})),{successLabel:`Loaded`})})};function C(e){return e.usage("$0 rules lists items create <list-id>\n\nAppends new items to the list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 w={command:`create <list-id>`,describe:`Create list items`,builder:C,handler:async l=>s({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}/items`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await n();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rules.lists.items.create({body:e,account_id:u,list_id:l[`list-id`]})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function T(e){return e.usage("$0 rules lists items delete <list-id>\n\nRemoves one or more items from a list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`items`,{type:`string`,description:`The list items to delete, identified by their unique IDs. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`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 E={command:`delete <list-id>`,describe:`Delete list items`,builder:T,handler:async d=>s({command:`rules lists items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{if(d.dryRun){a({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${d[`list-id`]==null?`<list-id>`:encodeURIComponent(String(d[`list-id`]))}/items`,pathParams:{"list-id":String(d[`list-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({items:l(d.items,`items`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await n();if(d.accountId=f,!await p({force:!!d.force,message:`This operation deletes the selected items from the custom list.`})){process.stderr.write(`Aborted.
10
10
  `);return}if(d.body){let e=c(d.body);i(await o(`Deleting`,async()=>s.rules.lists.items.delete({...e,account_id:f,list_id:d[`list-id`]})),{successLabel:`Deleted`});return}let m=u({items:l(d.items,`items`)});i(await o(`Deleting`,async()=>s.rules.lists.items.delete({...m,account_id:f,list_id:d[`list-id`]})),{successLabel:`Deleted`})})};function D(e){return e.usage(`$0 rules lists items get <item-id>
11
11
 
12
12
  Fetches a list item in the list.`).positional(`item-id`,{type:`string`,description:`Defines the unique ID of the item in the List.`,demandOption:!0}).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <item-id>`,describe:`Get a list item`,builder:D,handler:async c=>s({command:`rules lists items get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items/${c[`item-id`]==null?`<item-id>`:encodeURIComponent(String(c[`item-id`]))}`,pathParams:{"item-id":String(c[`item-id`]??``),"list-id":String(c[`list-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.items.get({account_id:l,list_id:c[`list-id`],item_id:c[`item-id`]})),{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 rules lists items list
13
13
 
14
- Fetches all the items in the list.`).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Get list items`,builder:k,handler:async c=>s({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor,per_page:c[`per-page`],search:c.search};if(c.dryRun){a({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.rules.lists.items.list({account_id:u,list_id:c[`list-id`],...s})),{successLabel:`Loaded`})})};function j(e){return e.usage("$0 rules lists items update <list-id>\n\nRemoves all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 M={command:`update <list-id>`,describe:`Update all list items`,builder:j,handler:async l=>s({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}/items`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await n();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rules.lists.items.update({body:e,account_id:u,list_id:l[`list-id`]})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},N={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.usage(`$0 rules lists list
14
+ Fetches all the items in the list.`).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Get list items`,builder:k,handler:async c=>s({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor,per_page:c[`per-page`],search:c.search};if(c.dryRun){a({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${c[`list-id`]==null?`<list-id>`:encodeURIComponent(String(c[`list-id`]))}/items`,pathParams:{"list-id":String(c[`list-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.rules.lists.items.list({account_id:u,list_id:c[`list-id`],...s})),{successLabel:`Loaded`})})};function j(e){return e.usage("$0 rules lists items update <list-id>\n\nRemoves all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 M={command:`update <list-id>`,describe:`Update all list items`,builder:j,handler:async l=>s({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}/items`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await n();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rules.lists.items.update({body:e,account_id:u,list_id:l[`list-id`]})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},N={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.usage(`$0 rules lists list
15
15
 
16
16
  Fetches all lists in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Get lists`,builder:P,handler:async c=>s({command:`rules lists list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.rules.lists.list({account_id:l})),{successLabel:`Loaded`})})};function I(e){return e.usage(`$0 rules lists update <list-id>
17
17
 
18
- Updates the description of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).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:`update <list-id>`,describe:`Update a list`,builder:I,handler:async l=>s({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({description:d(l.description,`description`,`text`)}):c(l.body)});return}let s=await r(l),f=l.local?e:await n();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rules.lists.update({...e,account_id:f,list_id:l[`list-id`]})),{successLabel:`Updated`});return}let p=u({description:d(l.description,`description`,`text`)});i(await o(`Updating`,async()=>s.rules.lists.update({...p,account_id:f,list_id:l[`list-id`]})),{successLabel:`Updated`})})},R={command:`lists`,describe:`Named lists of IPs, hostnames, ASNs, or redirects that can be referenced in rule expressions`,builder:e=>e.command(v).command(b).command(S).command(F).command(L).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`rules`,describe:`Account-level IP lists, hostname lists, and other reusable lists referenced by Rulesets rules`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
18
+ Updates the description of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).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:`update <list-id>`,describe:`Update a list`,builder:I,handler:async l=>s({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rules/lists/${l[`list-id`]==null?`<list-id>`:encodeURIComponent(String(l[`list-id`]))}`,pathParams:{"list-id":String(l[`list-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({description:d(l.description,`description`,`text`)}):c(l.body)});return}let s=await r(l),f=l.local?e:await n();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rules.lists.update({...e,account_id:f,list_id:l[`list-id`]})),{successLabel:`Updated`});return}let p=u({description:d(l.description,`description`,`text`)});i(await o(`Updating`,async()=>s.rules.lists.update({...p,account_id:f,list_id:l[`list-id`]})),{successLabel:`Updated`})})},R={command:`lists`,describe:`Custom account-level lists of IPs, hostnames, ASNs, or redirects used in rule expressions`,builder:e=>e.command(v).command(b).command(S).command(F).command(L).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`rules`,describe:`Resources used by Cloudflare rules and rulesets`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
@@ -1,37 +1,37 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,i as n,t as r}from"./context-CPVzoKbN.mjs";import{r as i}from"./auth-B_Utev-x.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-DS2fwfNP.mjs";import{t as c}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{n as l,r as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f}from"./input-validation-Dk52b0me.mjs";import{a as p,i as m,n as h}from"./prompt-doX80PCd.mjs";function g(e){return e.usage(`$0 rulesets account-rulesets create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,i as n,t as r}from"./context-CE7QFX-z.mjs";import{r as i}from"./auth-gOCL6Pm0.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-CRjK46r1.mjs";import{t as c}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as l,r as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f}from"./input-validation-Dk52b0me.mjs";import{n as p}from"./prompt-C_90YsVE.mjs";function m(e){return e.usage(`$0 rulesets account-rulesets create
3
3
 
4
- Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Create an account or zone ruleset`,builder:g,handler:async h=>c({command:`rulesets account-rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},h,async()=>{let c={dry_run:h[`validate-only`]};if(h.dryRun){let e=h.zone===void 0?await t():void 0,n=h.zone===void 0?`accounts`:`zones`,r=h.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:h.body===void 0?d({description:f(h.description,`description`,`text`),name:f(h.name,`name`,`text`),kind:f(h.kind,`kind`,`text`),phase:f(h.phase,`phase`,`text`),rules:u(h.rules,`rules`)}):l(h.body)});return}let g=await i(h),_=h.zone===void 0?`accounts`:`zones`,v=_===`zones`?await n({zone:h.zone},g,{quiet:h.quiet}):h.local?e:await r();if(_===`zones`?h.zoneId=v:h.accountId=v,h.body){let e=l(h.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>g.rulesets.accountRulesets.create({...e,account_or_zone:_,account_or_zone_id:v,...c})),{successLabel:`Created`});return}h.name===void 0&&(h.name=await p(`name`,`The human-readable name of the ruleset.`)),h.kind===void 0&&(h.kind=await m(`kind`,`The kind of the ruleset.`,[`managed`,`custom`,`root`,`zone`])),h.phase===void 0&&(h.phase=await m(`phase`,`The phase of the ruleset.`,[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]));let y=d({description:f(h.description,`description`,`text`),name:f(h.name,`name`,`text`),kind:f(h.kind,`kind`,`text`),phase:f(h.phase,`phase`,`text`),rules:u(h.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>g.rulesets.accountRulesets.create({...y,account_or_zone:_,account_or_zone_id:v,...c})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 rulesets account-rulesets delete <ruleset-id>
4
+ Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create an account or zone ruleset`,builder:m,handler:async p=>c({command:`rulesets account-rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await t():void 0,n=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await n({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await r();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>m.rulesets.accountRulesets.create({...e,account_or_zone:h,account_or_zone_id:g,...c})),{successLabel:`Created`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>m.rulesets.accountRulesets.create({..._,account_or_zone:h,account_or_zone_id:g,...c})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 rulesets account-rulesets delete <ruleset-id>
5
5
 
6
- Deletes all versions of an existing account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 <ruleset-id>`,describe:`Delete an account or zone ruleset`,builder:v,handler:async l=>c({command:`rulesets account-rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();if(d===`zones`?l.zoneId=f:l.accountId=f,!await h({force:!!l.force})){process.stderr.write(`Aborted.
7
- `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],...c})),{successLabel:`Deleted`})})};function b(e){return e.usage(`$0 rulesets account-rulesets get <ruleset-id>
6
+ Deletes all versions of an existing account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 <ruleset-id>`,describe:`Delete an account or zone ruleset`,builder:g,handler:async l=>c({command:`rulesets account-rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
7
+ `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],...c})),{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 rulesets account-rulesets get <ruleset-id>
8
8
 
9
- Fetches the latest version of an account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <ruleset-id>`,describe:`Get an account or zone ruleset`,builder:b,handler:async l=>c({command:`rulesets account-rulesets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 rulesets account-rulesets list
9
+ Fetches the latest version of an account or zone ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <ruleset-id>`,describe:`Get an account or zone ruleset`,builder:v,handler:async l=>c({command:`rulesets account-rulesets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})};function b(e){return e.usage(`$0 rulesets account-rulesets list
10
10
 
11
- Fetches all rulesets.`).option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List account or zone rulesets`,builder:S,handler:async l=>c({command:`rulesets account-rulesets list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={cursor:l.cursor,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.rulesets.accountRulesets.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 rulesets account-rulesets phases get <ruleset-phase>
11
+ Fetches all rulesets.`).option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List account or zone rulesets`,builder:b,handler:async l=>c({command:`rulesets account-rulesets list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={cursor:l.cursor,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.rulesets.accountRulesets.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 rulesets account-rulesets phases get <ruleset-phase>
12
12
 
13
- Fetches the latest version of the account or zone entry point ruleset for a given phase.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <ruleset-phase>`,describe:`Get an account or zone entry point ruleset`,builder:w,handler:async l=>c({command:`rulesets account-rulesets phases get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(n),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})};function E(e){return e.usage(`$0 rulesets account-rulesets phases update <ruleset-phase>
13
+ Fetches the latest version of the account or zone entry point ruleset for a given phase.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <ruleset-phase>`,describe:`Get an account or zone entry point ruleset`,builder:S,handler:async l=>c({command:`rulesets account-rulesets phases get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(n),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 rulesets account-rulesets phases update <ruleset-phase>
14
14
 
15
- Updates an account or zone entry point ruleset, creating a new version.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`update <ruleset-phase>`,describe:`Update an account or zone entry point ruleset`,builder:E,handler:async p=>c({command:`rulesets account-rulesets phases update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await t():void 0,n=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${p[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(p[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(n),"ruleset-phase":String(p[`ruleset-phase`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await n({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await r();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`})})};function O(e){return e.usage(`$0 rulesets account-rulesets phases versions get <ruleset-version>
15
+ Updates an account or zone entry point ruleset, creating a new version.`).positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`update <ruleset-phase>`,describe:`Update an account or zone entry point ruleset`,builder:w,handler:async p=>c({command:`rulesets account-rulesets phases update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await t():void 0,n=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${p[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(p[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(n),"ruleset-phase":String(p[`ruleset-phase`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await n({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await r();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`})})};function E(e){return e.usage(`$0 rulesets account-rulesets phases versions get <ruleset-version>
16
16
 
17
- Fetches a specific version of an account or zone entry point ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <ruleset-version>`,describe:`Get an account or zone entry point ruleset version`,builder:O,handler:async l=>c({command:`rulesets account-rulesets phases versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function A(e){return e.usage(`$0 rulesets account-rulesets phases versions list
17
+ Fetches a specific version of an account or zone entry point ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <ruleset-version>`,describe:`Get an account or zone entry point ruleset version`,builder:E,handler:async l=>c({command:`rulesets account-rulesets phases versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 rulesets account-rulesets phases versions list
18
18
 
19
- Fetches the versions of an account or zone entry point ruleset.`).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`List an account or zone entry point ruleset's versions`,builder:A,handler:async l=>c({command:`rulesets account-rulesets phases versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"account-or-zone":String(n),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})},M={command:`versions`,describe:`Operations for account-rulesets.phases.versions`,builder:e=>e.command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`phases`,describe:`Operations for account-rulesets.phases`,builder:e=>e.command(T).command(D).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.usage(`$0 rulesets account-rulesets rules create <ruleset-id>
19
+ Fetches the versions of an account or zone entry point ruleset.`).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List an account or zone entry point ruleset's versions`,builder:O,handler:async l=>c({command:`rulesets account-rulesets phases versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"account-or-zone":String(n),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})},A={command:`versions`,describe:`Operations for account-rulesets.phases.versions`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`phases`,describe:`Operations for account-rulesets.phases`,builder:e=>e.command(C).command(T).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 rulesets account-rulesets rules create <ruleset-id>
20
20
 
21
- Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const F={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:P,handler:async u=>c({command:`rulesets account-rulesets rules create`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await t():void 0,n=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await i(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await n({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await r();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`})})};function I(e){return e.usage(`$0 rulesets account-rulesets rules delete <rule-id>
21
+ Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const N={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:M,handler:async u=>c({command:`rulesets account-rulesets rules create`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await t():void 0,n=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await i(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await n({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await r();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`})})};function P(e){return e.usage(`$0 rulesets account-rulesets rules delete <rule-id>
22
22
 
23
- Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 ee={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:I,handler:async l=>c({command:`rulesets account-rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(n),"rule-id":String(l[`rule-id`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();if(d===`zones`?l.zoneId=f:l.accountId=f,!await h({force:!!l.force})){process.stderr.write(`Aborted.
24
- `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...c})),{successLabel:`Deleted`})})};function L(e){return e.usage(`$0 rulesets account-rulesets rules update <rule-id>
23
+ Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 F={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:P,handler:async l=>c({command:`rulesets account-rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(n),"rule-id":String(l[`rule-id`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
24
+ `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...c})),{successLabel:`Deleted`})})};function I(e){return e.usage(`$0 rulesets account-rulesets rules update <rule-id>
25
25
 
26
- Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const R={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:L,handler:async u=>c({command:`rulesets account-rulesets rules update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await t():void 0,n=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(n),"rule-id":String(u[`rule-id`]??``),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await i(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await n({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await r();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`})})},z={command:`rules`,describe:`Operations for account-rulesets.rules`,builder:e=>e.command(F).command(ee).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.usage(`$0 rulesets account-rulesets update <ruleset-id>
26
+ Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const L={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:I,handler:async u=>c({command:`rulesets account-rulesets rules update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await t():void 0,n=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(n),"rule-id":String(u[`rule-id`]??``),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await i(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await n({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await r();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`})})},R={command:`rules`,describe:`Operations for account-rulesets.rules`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 rulesets account-rulesets update <ruleset-id>
27
27
 
28
- Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:B,handler:async p=>c({command:`rulesets account-rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await t():void 0,n=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await n({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await r();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`})})};function H(e){return e.usage(`$0 rulesets account-rulesets versions by-tag list
28
+ Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:z,handler:async p=>c({command:`rulesets account-rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await t():void 0,n=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await n({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await r();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`})})};function V(e){return e.usage(`$0 rulesets account-rulesets versions by-tag list
29
29
 
30
- Fetches the rules of a managed account or zone ruleset version for a given tag.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`List an account or zone ruleset version's rules by tag`,builder:H,handler:async l=>c({command:`rulesets account-rulesets versions by-tag list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions by-tag list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}/by_tag/${l[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(l[`rule-tag`]))}`,pathParams:{"account-or-zone":String(n),"rule-tag":String(l[`rule-tag`]??``),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.byTag.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],rule_tag:l[`rule-tag`]})),{successLabel:`Loaded`})})},W={command:`by-tag`,describe:`Operations for account-rulesets.versions.by-tag`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.usage(`$0 rulesets account-rulesets versions delete <ruleset-version>
30
+ Fetches the rules of a managed account or zone ruleset version for a given tag.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List an account or zone ruleset version's rules by tag`,builder:V,handler:async l=>c({command:`rulesets account-rulesets versions by-tag list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions by-tag list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}/by_tag/${l[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(l[`rule-tag`]))}`,pathParams:{"account-or-zone":String(n),"rule-tag":String(l[`rule-tag`]??``),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.byTag.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],rule_tag:l[`rule-tag`]})),{successLabel:`Loaded`})})},U={command:`by-tag`,describe:`Operations for account-rulesets.versions.by-tag`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 rulesets account-rulesets versions delete <ruleset-version>
31
31
 
32
- Deletes an existing version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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:`delete <ruleset-version>`,describe:`Delete an account or zone ruleset version`,builder:G,handler:async l=>c({command:`rulesets account-rulesets versions delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();if(d===`zones`?l.zoneId=f:l.accountId=f,!await h({force:!!l.force})){process.stderr.write(`Aborted.
33
- `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],...c})),{successLabel:`Deleted`})})};function q(e){return e.usage(`$0 rulesets account-rulesets versions get <ruleset-version>
32
+ Deletes an existing version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 <ruleset-version>`,describe:`Delete an account or zone ruleset version`,builder:W,handler:async l=>c({command:`rulesets account-rulesets versions delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await r();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
33
+ `);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],...c})),{successLabel:`Deleted`})})};function K(e){return e.usage(`$0 rulesets account-rulesets versions get <ruleset-version>
34
34
 
35
- Fetches a specific version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <ruleset-version>`,describe:`Get an account or zone ruleset version`,builder:q,handler:async l=>c({command:`rulesets account-rulesets versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function Y(e){return e.usage(`$0 rulesets account-rulesets versions list
35
+ Fetches a specific version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <ruleset-version>`,describe:`Get an account or zone ruleset version`,builder:K,handler:async l=>c({command:`rulesets account-rulesets versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function J(e){return e.usage(`$0 rulesets account-rulesets versions list
36
36
 
37
- Fetches the versions of an account or zone ruleset.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`List an account or zone ruleset's versions`,builder:Y,handler:async l=>c({command:`rulesets account-rulesets versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})},Z={command:`versions`,describe:`Operations for account-rulesets.versions`,builder:e=>e.command(K).command(J).command(X).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`account-rulesets`,describe:`Operations for account-rulesets`,builder:e=>e.command(_).command(y).command(x).command(C).command(V).command(N).command(z).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
37
+ Fetches the versions of an account or zone ruleset.`).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List an account or zone ruleset's versions`,builder:J,handler:async l=>c({command:`rulesets account-rulesets versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await t():void 0,n=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions`,pathParams:{"account-or-zone":String(n),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await r();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})},X={command:`versions`,describe:`Operations for account-rulesets.versions`,builder:e=>e.command(G).command(q).command(Y).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`account-rulesets`,describe:`Operations for account-rulesets`,builder:e=>e.command(h).command(_).command(y).command(x).command(B).command(j).command(R).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-CPVzoKbN.mjs";import{r}from"./auth-B_Utev-x.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-DS2fwfNP.mjs";import{t as s}from"./run-CJ-6owN3.mjs";import"./telemetry-D2UwfCd1.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{n as f}from"./prompt-doX80PCd.mjs";import{t as p}from"./cli-types-DoVT5q_M.mjs";function m(e){return e.usage(`$0 rum rules bulk-create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{n as f}from"./prompt-C_90YsVE.mjs";import{t as p}from"./cli-types-DoVT5q_M.mjs";function m(e){return e.usage(`$0 rum rules bulk-create
3
3
 
4
4
  Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:m,handler:async d=>s({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/rum/v2/${d[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(d[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(d[`ruleset-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await n();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.rum.rules.bulkCreate({...e,account_id:f,ruleset_id:d[`ruleset-id`]})),{successLabel:`Created`});return}let p=u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)});i(await o(`Creating`,async()=>s.rum.rules.bulkCreate({...p,account_id:f,ruleset_id:d[`ruleset-id`]})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 rum rules create <ruleset-id>
5
5
 
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./run-huwFFwXd.mjs";export{e as runWithTelemetry};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./agent-context-GRiQ4zRU.mjs";import{t}from"./cli-exit-Dqoo6Jgb.mjs";import{Q as n}from"./dist-DfMipWKR.mjs";import{n as r}from"./version-DyZwKU6l.mjs";import{t as i}from"./delegate-B6LetRpZ.mjs";import{i as a,r as o}from"./lifecycle-C7tAC1Mn.mjs";import{i as s,t as c}from"./interactive-C-o16XQs.mjs";import{t as l}from"./request-headers-DPbWytRv.mjs";import{n as u,t as d}from"./state-DhHOAdTo.mjs";import{t as f}from"./error-sanitization-Dc4bLj8k.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:new Date().toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};process.env.DEBUG&&console.error(`Telemetry would send: ${JSON.stringify(n)}`)}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
2
+ import{t as e}from"./agent-context-GRiQ4zRU.mjs";import{t}from"./cli-exit-Dqoo6Jgb.mjs";import{Q as n}from"./dist-DfMipWKR.mjs";import{n as r}from"./version-C3q1GMTe.mjs";import{t as i}from"./delegate-B6LetRpZ.mjs";import{i as a,r as o}from"./lifecycle-C7tAC1Mn.mjs";import{i as s,t as c}from"./interactive-C-o16XQs.mjs";import{t as l}from"./request-headers-jr2VznA9.mjs";import{n as u,t as d}from"./state-DhHOAdTo.mjs";import{t as f}from"./error-sanitization-CcNUzN1f.mjs";import p from"node:os";import{createHash as m,randomUUID as h}from"node:crypto";const g=new Date(`2026-01-01T00:00:00.000Z`),_=`CF_SEND_TELEMETRY`,v=`WRANGLER_SEND_METRICS`,y=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function b(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function x(){let e=b(process.env[_]);if(e!==void 0)return{enabled:e,source:`env`};let t=b(process.env[v]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function S(){return x()?.enabled}function C(){let e=d();if(typeof e.deviceId==`string`&&y.test(e.deviceId))return e.deviceId;let t=h();return u({deviceId:t}),t}function w(){return d().deviceId===void 0}function T(){if(n())return{enabled:!1,source:`do-not-track`};let e=x();if(e!==void 0)return e;let t=d().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=g?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function E(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return _;case`wrangler-env`:return v;default:return}}function D(e){u({telemetry:{preference:{enabled:e,date:new Date().toISOString()}}})}function O(){return d().telemetry?.bannerLastShown}function k(e){u({telemetry:{bannerLastShown:e}})}function A(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function j(){return p.version()}function M(){return process.arch}function N(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function P(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function F(e,t,n){return m(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function I(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let L;function R(){if(L)return L;let[t,n,o]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),u=Date.now(),d=0,f=w(),{enabled:p}=T(),m=e(),h=m.harness?.id??null,g=m.matches.find(e=>e.sessionId);function _(){let e=I(),a=C();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:o??0,...e?{prereleaseLabel:e}:{},osPlatform:A(),osVersion:j(),arch:M(),nodeVersion:N(),packageManager:P(),deviceId:a,amplitude_session_id:u,amplitude_event_id:d++,...g?.sessionId?{agentSessionKey:F(a,g.harness.id,g.sessionId)}:{},isFirstUsage:f,isCI:c,isInteractive:s(),cliMode:l(),agent:h,delegated:!!process.env[i]}}function v(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};process.env.DEBUG&&console.error(`Telemetry would send: ${JSON.stringify(n)}`)}return L={enabled:p,sendCommandEvent(e,t){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(p)try{a(v(e,{..._(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},L}const z={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function B(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function V(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function H(e,t,n){let r=new Set([...n.safeFlags,`quiet`,`local`]),i={...z,...n.shortFlagAliases},a=new Set,o={};for(let n of V(t,i)){a.add(n);let t=e[n]??e[B(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}const U=new Set([`SIGINT`,`SIGTERM`]),W=1024;function G(e){if(e instanceof t)return e.cancelled||e.signal&&U.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function K(e,t,n){let r;try{r=R()}catch{return n()}if(o(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:H(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,W),...e.searchQuery.length>W?{searchQueryTruncated:!0}:{}},s=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-s}),e}catch(e){let t=G(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-s,...t===`error`?f(e):{}}),e}}function q(e,t){return{...e,handler:n=>K(t,n,()=>e.handler(n))}}export{_ as a,C as c,w as d,T as f,R as i,S as l,D as m,q as n,g as o,k as p,H as r,O as s,K as t,E as u};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-BIWQFmZ0.mjs";import{n as t}from"./version-DyZwKU6l.mjs";import{i as n}from"./cf-O3gEaXYZ.mjs";import{i as r}from"./body-parser-hh2avzkz.mjs";import{n as i}from"./input-validation-Dk52b0me.mjs";import{o as a}from"./prompt-doX80PCd.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
2
+ import{r as e}from"./theme-BIWQFmZ0.mjs";import{n as t}from"./version-C3q1GMTe.mjs";import{i as n}from"./cf-O3gEaXYZ.mjs";import{i as r}from"./body-parser-hh2avzkz.mjs";import{n as i}from"./input-validation-Dk52b0me.mjs";import{o as a}from"./prompt-C_90YsVE.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
3
3
  `)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=new Set(`$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>d(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>d(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0?!0:A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}continue}if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t);continue}return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(l!==`mode`)return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
4
4
  `)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[...new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:d(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=new Map,i=new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,l=s.then?O(s.then):void 0,u=l?.required;if(!c||!u?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>d(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(!(!_||g.length===0))for(let s of u){let c=[...t,s].join(`.`);if(n.has(c))continue;let u={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(l?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>d(e,u))&&(f.requiredIf=[...f.requiredIf??[],u])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(t,n){if(t.length===0)return`${e.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=t.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=t.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(a(n)),...s].join(`
5
5
  `)}const ve=`_ $0 -- body dry-run dryRun help h local m mode persist-to persistTo profile quiet q version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>d(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>d(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`?!0:t===`false`?!1:r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:l,maximum:u,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!d(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>d(t,e))){n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);return}if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(l!==void 0&&(f===!0?t<=l:t<l)&&n.push(f===!0?`--${r} must be greater than ${l}`:`--${r} must be at least ${l}`),u!==void 0&&(p===!0?t>=u:t>u)&&n.push(p===!0?`--${r} must be less than ${u}`:`--${r} must be at most ${u}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!d(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>d(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>d(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`))if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`))if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=new Set([...ve,...t]),r=new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};