cf 1.0.0-beta.27 → 1.0.0-beta.29

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 (370) hide show
  1. package/README.md +10 -3
  2. package/dist/_meta/commands.json +7966 -5034
  3. package/dist/_meta/hand-written-commands.json +40 -10
  4. package/dist/_meta/schemas.json +3153 -3736
  5. package/dist/{abuse-reports-RxXqfDEW.mjs → abuse-reports-DqXYX_6F.mjs} +10 -10
  6. package/dist/{access-BxEprr2f.mjs → access-Cte4yyIz.mjs} +1 -1
  7. package/dist/{accounts-DU2ZNYqP.mjs → accounts-G-x-_cEx.mjs} +58 -57
  8. package/dist/{acm-CBCIKBJ4.mjs → acm-Bg3HqMGG.mjs} +7 -7
  9. package/dist/{addressing-BKxiLRHk.mjs → addressing-BwEofGEm.mjs} +46 -46
  10. package/dist/{agent-memory-DkBpQYUL.mjs → agent-memory-DhwZ2KRw.mjs} +15 -15
  11. package/dist/ai-DWWRIQIt.mjs +30 -0
  12. package/dist/ai-audit-CMEBz6ZP.mjs +6 -0
  13. package/dist/ai-gateway-D2s0isU-.mjs +76 -0
  14. package/dist/ai-search-a0uqr9yJ.mjs +74 -0
  15. package/dist/{ai-security-CvZfP2JC.mjs → ai-security-H_RqjRoL.mjs} +4 -4
  16. package/dist/alerting-Bgp9rE4I.mjs +52 -0
  17. package/dist/analytics-CFYM82FD.mjs +17 -0
  18. package/dist/analytics-engine-BLiEaLxb.mjs +4 -0
  19. package/dist/api-Dnt6lRJG.mjs +3 -0
  20. package/dist/{api-security-BbcvDtff.mjs → api-security-B0YtHglt.mjs} +63 -63
  21. package/dist/argo-BPwbzHY7.mjs +14 -0
  22. package/dist/{artifacts-2R2sxIKO.mjs → artifacts-B6UwC2PH.mjs} +20 -20
  23. package/dist/{audit-logs-LoBB1OO_.mjs → audit-logs-kG97iEnI.mjs} +2 -2
  24. package/dist/auth-Czr8ChBB.mjs +2 -0
  25. package/dist/auth-DA1PHaHi.mjs +2 -0
  26. package/dist/auth-Dwfa4S3h.mjs +7 -0
  27. package/dist/{auth-token-BwpERbnG.mjs → auth-token-CE3Wa5-b.mjs} +1 -1
  28. package/dist/{autoconfig-B2w-woU0.mjs → autoconfig-B4tFR6ua.mjs} +118 -114
  29. package/dist/{basin-catalog-AgOHGiPI.mjs → basin-catalog-DzVEPupy.mjs} +17 -17
  30. package/dist/billing-TERxOuLR.mjs +22 -0
  31. package/dist/{blocks-C8vyXIAT.mjs → blocks-C3Im7AT0.mjs} +1 -1
  32. package/dist/body-parser-HN91kAf0.mjs +2 -0
  33. package/dist/{body-unions-CjpNjwSW.mjs → body-unions-D9OSaf4M.mjs} +1 -1
  34. package/dist/{bot-management-fwxKIbaB.mjs → bot-management-SZw9jTOC.mjs} +4 -4
  35. package/dist/{botnet-feed-DCYB5kYZ.mjs → botnet-feed-DjdAeUtb.mjs} +5 -5
  36. package/dist/brand-protection-BpA7Gmf1.mjs +18 -0
  37. package/dist/browser-run-BvjfMK3f.mjs +40 -0
  38. package/dist/build-CCwo_ydV.mjs +2 -0
  39. package/dist/build-yQOzZg6Z.mjs +2 -0
  40. package/dist/builds-tMa3sbQU.mjs +62 -0
  41. package/dist/cache-b_EPh6Is.mjs +36 -0
  42. package/dist/cf-DmvZ2L51.mjs +18 -0
  43. package/dist/{chunk-DSGVRFIS-DQwKND2c.mjs → chunk-DSGVRFIS-Cj7pO-YQ.mjs} +1 -1
  44. package/dist/chunk-Q5KVZMHK-WOCEMyET.mjs +363 -0
  45. package/dist/cli-Cc7ujzAy.mjs +4 -0
  46. package/dist/{client-side-security-VmZzMy-m.mjs → client-side-security-DVkeCzcC.mjs} +14 -14
  47. package/dist/{cloud-connector-bMlFnqP0.mjs → cloud-connector-MVf4acRR.mjs} +3 -3
  48. package/dist/{cloudflared-Ba4KWdTO.mjs → cloudflared-BOkMl8Gm.mjs} +1 -1
  49. package/dist/cloudforce-one-KrCfQbRx.mjs +318 -0
  50. package/dist/{command-BxZBNPxG.mjs → command-BQbZw4Kx.mjs} +1 -1
  51. package/dist/command-BVct0Dvr.mjs +2 -0
  52. package/dist/{command-BiIVclNA.mjs → command-C4_lMRkw.mjs} +1 -1
  53. package/dist/command-CJ3ldWrA.mjs +2 -0
  54. package/dist/command-CyOdBNur.mjs +2 -0
  55. package/dist/command-D2XkyO1e.mjs +2 -0
  56. package/dist/command-DHODgfFZ.mjs +2 -0
  57. package/dist/command-DIIaZx_f.mjs +2 -0
  58. package/dist/command-DONwHpqZ.mjs +2 -0
  59. package/dist/command-DdYnSf-8.mjs +2 -0
  60. package/dist/command-DqOU7Ql2.mjs +2 -0
  61. package/dist/{command-pMoNdd22.mjs → command-HW7k43qu.mjs} +1 -1
  62. package/dist/command-NqM0lo4a.mjs +2 -0
  63. package/dist/command-bwVDyMv4.mjs +2 -0
  64. package/dist/command-yzqs4m83.mjs +2 -0
  65. package/dist/{completions-DRzBiqpv.mjs → completions-0YKvIyBT.mjs} +2 -2
  66. package/dist/connector-interrupts-CsunbRsr.mjs +6 -0
  67. package/dist/{connector-telemetry-events-BbAOUt9h.mjs → connector-telemetry-events-DmQPD7xC.mjs} +3 -3
  68. package/dist/{connector-telemetry-snapshots-DcpBx7Qx.mjs → connector-telemetry-snapshots-C62iHjC9.mjs} +3 -3
  69. package/dist/{connectors-D1WFLJoE.mjs → connectors-Bg0MU6ZT.mjs} +7 -7
  70. package/dist/containers-BiA_bpPR.mjs +76 -0
  71. package/dist/{content-scan-D1GfPSL0.mjs → content-scan-4SA2nacB.mjs} +6 -6
  72. package/dist/{context-Dp4CXG22.mjs → context-BGm5_wTT.mjs} +1 -1
  73. package/dist/{cps-D4uhzg3k.mjs → cps-WDmD3V5I.mjs} +3 -3
  74. package/dist/create-DmLDMvrj.mjs +2 -0
  75. package/dist/csam-scanner-Rmy-hBEA.mjs +8 -0
  76. package/dist/custom-csrs-D-lvkyRV.mjs +18 -0
  77. package/dist/custom-hostnames-B5BQX5m6.mjs +24 -0
  78. package/dist/custom-nameservers-CZrRjcjx.mjs +12 -0
  79. package/dist/custom-pages-CWwjtfbj.mjs +38 -0
  80. package/dist/d1-N81q-FAr.mjs +50 -0
  81. package/dist/{delegate-B4bKqF7i.mjs → delegate-livNdiwK.mjs} +1 -1
  82. package/dist/delegate.mjs +1 -1
  83. package/dist/deploy-Ok4ncy06.mjs +2 -0
  84. package/dist/deploy-context-B_lLfxt7.mjs +55 -0
  85. package/dist/deploy-input-JZlEJwKB.mjs +2 -0
  86. package/dist/dev-DxbkJkzc.mjs +4 -0
  87. package/dist/{diagnostics-D1CUs2o9.mjs → diagnostics-DlJzpO8b.mjs} +7 -7
  88. package/dist/dialog-CD94-Kzw.mjs +2 -0
  89. package/dist/discover-D9FNaCDK.mjs +2 -0
  90. package/dist/discover-DGsMj9ZN.mjs +2 -0
  91. package/dist/{dist-D5qkmHhC.mjs → dist-BxhwE-W1.mjs} +202 -193
  92. package/dist/{dls-DWBiYzY1.mjs → dls-5OXuxLAB.mjs} +8 -8
  93. package/dist/dns-Burep9O7.mjs +142 -0
  94. package/dist/{dns-firewall-DH9xIT5H.mjs → dns-firewall-hUHaQ0DE.mjs} +8 -8
  95. package/dist/docs-BFVK88kB.mjs +3 -0
  96. package/dist/{dry-run-gy0Hl9xo.mjs → dry-run-qsnRlRk6.mjs} +1 -1
  97. package/dist/{durable-objects-DF0MYpnV.mjs → durable-objects-D6R8S2Dk.mjs} +3 -3
  98. package/dist/email-auth--2KCzZNA.mjs +6 -0
  99. package/dist/email-routing-DzaExfVf.mjs +44 -0
  100. package/dist/{email-security-CnNa1YON.mjs → email-security-DwQJszzy.mjs} +71 -71
  101. package/dist/{email-sending-CpDSw-Eb.mjs → email-sending-mQd2qB-o.mjs} +21 -21
  102. package/dist/{error-sanitization-DG8WSzHe.mjs → error-sanitization-BkgtZ0Vx.mjs} +1 -1
  103. package/dist/error-sanitization-D069tpKk.mjs +2 -0
  104. package/dist/errors-C_bGcR0X.mjs +11 -0
  105. package/dist/field-extractors-MVOizTlB.mjs +8 -0
  106. package/dist/{firewall-CY_oem-d.mjs → firewall-DtSIlkfL.mjs} +19 -19
  107. package/dist/flagship-9E5gwNki.mjs +24 -0
  108. package/dist/{fraud-CSUKLh8X.mjs → fraud-DjqhVJdf.mjs} +3 -3
  109. package/dist/generate-BzOnRBij.mjs +2 -0
  110. package/dist/generate-DfxZtpn9.mjs +2 -0
  111. package/dist/get-3XNn0upb.mjs +2 -0
  112. package/dist/{global-options-DiKj2cQy.mjs → global-options-4pyD17hd.mjs} +1 -1
  113. package/dist/{google-tag-gateway-C2skt6t-.mjs → google-tag-gateway-BM5GmCZa.mjs} +3 -3
  114. package/dist/gt-BV-jij5q.mjs +4 -0
  115. package/dist/healthchecks-CEZ5f3XJ.mjs +20 -0
  116. package/dist/{hyperdrive-FcBbpew4.mjs → hyperdrive-Da8hCcUw.mjs} +12 -12
  117. package/dist/{iam-8T74DNhH.mjs → iam-BK6N7NdQ.mjs} +31 -31
  118. package/dist/{images-C3JUaf6b.mjs → images-3bCWE6Ml.mjs} +33 -33
  119. package/dist/index.mjs +1 -1
  120. package/dist/init-BgCF9K8h.mjs +43 -0
  121. package/dist/intel-BQ58CJLt.mjs +62 -0
  122. package/dist/{interactive-CKHdGvkh.mjs → interactive-JBA3qOUa.mjs} +9 -9
  123. package/dist/{internal-CamuESs0.mjs → internal-CWPz0sBF.mjs} +2 -2
  124. package/dist/{ips-DinCNnWj.mjs → ips-3WYegiVW.mjs} +2 -2
  125. package/dist/k2-Bc_hjmiv.mjs +10 -0
  126. package/dist/kv-DbShBhhg.mjs +12 -0
  127. package/dist/{lazy-command-WB1FOuew.mjs → lazy-command-CbGyEqFK.mjs} +1 -1
  128. package/dist/leaked-credential-checks-DgPefxP9.mjs +16 -0
  129. package/dist/{live-B6AsI_E5.mjs → live-BTtMv1a6.mjs} +2 -2
  130. package/dist/load-balancers-C2hg52WA.mjs +84 -0
  131. package/dist/{local-CgBhtmON.mjs → local-B3zt9PXR.mjs} +1 -1
  132. package/dist/local-DRxctCh9.mjs +2 -0
  133. package/dist/local-runtime-BOnDiMDc.mjs +2 -0
  134. package/dist/{log-BWdaOGOW.mjs → log-Brx-wjJW.mjs} +3 -3
  135. package/dist/log-DBAHla_W.mjs +2 -0
  136. package/dist/login-CK3nn9a5.mjs +2 -0
  137. package/dist/{login-BJHaTERg.mjs → login-DiR-buzS.mjs} +3 -3
  138. package/dist/{logpush-qhlxsioM.mjs → logpush-CitvUX-J.mjs} +22 -22
  139. package/dist/{logs-bI54CJ0w.mjs → logs-CfWHu4Ir.mjs} +14 -16
  140. package/dist/magic-network-monitoring-gU6yzzML.mjs +34 -0
  141. package/dist/{magic-transit-BwDyySHJ.mjs → magic-transit-B3JY9u5o.mjs} +139 -139
  142. package/dist/{managed-defense-CsBBkfeQ.mjs → managed-defense-C_EQ-NYp.mjs} +9 -9
  143. package/dist/managed-transforms-DIGl6JkM.mjs +8 -0
  144. package/dist/{mcp-CyI0sDmL.mjs → mcp-DqhQJVaz.mjs} +15 -15
  145. package/dist/{mesh-Czr0UCP4.mjs → mesh-DXVZBNDC.mjs} +12 -12
  146. package/dist/{migrate-DKDWYrz2.mjs → migrate-CmXyk9vX.mjs} +1 -1
  147. package/dist/{monetization-NUgfDtSy.mjs → monetization-CWg-mySr.mjs} +9 -9
  148. package/dist/{network-interconnects-DuIBe8fK.mjs → network-interconnects-DhfKL5tG.mjs} +17 -19
  149. package/dist/{network-B42zrBic.mjs → network-jtgq5eb4.mjs} +24 -24
  150. package/dist/o11y-eYYs59X9.mjs +88 -0
  151. package/dist/oauth-BgDZMd72.mjs +5 -0
  152. package/dist/{oauth-BLQ1-y3R.mjs → oauth-V37G-PaV.mjs} +1 -1
  153. package/dist/{observability-BxhJQCgZ.mjs → observability-CB72eC4T.mjs} +2 -2
  154. package/dist/ohttp-gateway-K9ToEft8.mjs +8 -0
  155. package/dist/organizations-BllV7l_c.mjs +70 -0
  156. package/dist/output-hFMAotFl.mjs +2 -0
  157. package/dist/package-oNVeacC9.mjs +2 -0
  158. package/dist/page-rules-BVmi-ZFW.mjs +35 -0
  159. package/dist/pages-5spcBpX1.mjs +48 -0
  160. package/dist/pay-per-crawl-BgsdGcBi.mjs +36 -0
  161. package/dist/{pay-per-use-VatiU-Nt.mjs → pay-per-use-CzmI1kEA.mjs} +16 -16
  162. package/dist/pipelines-CbtmLRxt.mjs +40 -0
  163. package/dist/{precursor-D3VH2MXT.mjs → precursor-Dk8YOKf_.mjs} +2 -2
  164. package/dist/previews-Bv1HMMtO.mjs +6 -0
  165. package/dist/progress-DE_G09u2.mjs +2 -0
  166. package/dist/project-settings-D_S-UC8I.mjs +3 -0
  167. package/dist/prompt-D274Im1O.mjs +4 -0
  168. package/dist/queues-DGCYUr4g.mjs +52 -0
  169. package/dist/r2-DtCk-Nfi.mjs +112 -0
  170. package/dist/{radar-CvLtu-Vr.mjs → radar-1CwqOsMZ.mjs} +150 -150
  171. package/dist/raw-fetch-DhlyWQtk.mjs +2 -0
  172. package/dist/{ready-gsGEaWLL.mjs → ready-CcoEA7M7.mjs} +2 -2
  173. package/dist/{realtime-DiCEgFTC.mjs → realtime-DFUxwIG5.mjs} +80 -81
  174. package/dist/registrar-Cl1snz8z.mjs +43 -0
  175. package/dist/registrar-sandbox-Cne9BVCZ.mjs +58 -0
  176. package/dist/{reporting-BiHgnT8L.mjs → reporting-D9FC-Z-3.mjs} +7 -7
  177. package/dist/request-headers-Bopp5lH_.mjs +2 -0
  178. package/dist/request-tracers-CSSB9_aW.mjs +4 -0
  179. package/dist/resource-sharing-D8yuzJm7.mjs +36 -0
  180. package/dist/{rules-CRhe_ca9.mjs → rules-DzmOQ3MB.mjs} +8 -8
  181. package/dist/rulesets-DsTGcgbc.mjs +42 -0
  182. package/dist/{rum-BfnWHW_d.mjs → rum-DrJLI93T.mjs} +14 -14
  183. package/dist/run-C5yPsiO2.mjs +2 -0
  184. package/dist/run-CXWkMU3x.mjs +2 -0
  185. package/dist/schema-CfZOW8Zw.mjs +2 -0
  186. package/dist/{schema-cache-BIo0Gi2H.mjs → schema-cache-CtqAs0PP.mjs} +1 -1
  187. package/dist/schema-flags-DO3kLYBu.mjs +4 -0
  188. package/dist/scim-0OufLKru.mjs +16 -0
  189. package/dist/{secrets-store-DgtzZRze.mjs → secrets-store-BQeLzFxv.mjs} +11 -11
  190. package/dist/{security-insights-SlUGW3F_.mjs → security-insights-D2pj8-O-.mjs} +20 -20
  191. package/dist/{security-txt-C3YS0REz.mjs → security-txt-SKtgW4n-.mjs} +4 -4
  192. package/dist/session-COdP8BXD.mjs +2 -0
  193. package/dist/shared-D_2KLpP3.mjs +2 -0
  194. package/dist/{signed-url-ClLk45_J.mjs → signed-url-CcE2zQ4Y.mjs} +2 -2
  195. package/dist/smart-shield-Dod9Gs6T.mjs +22 -0
  196. package/dist/snippets-DrrdpLnS.mjs +18 -0
  197. package/dist/spawn-DNf-Ge8d.mjs +5 -0
  198. package/dist/{spectrum-Cj0BMtg2.mjs → spectrum-CHBGZbZF.mjs} +11 -11
  199. package/dist/{speed-BrVeZRyX.mjs → speed-vOlHyG3v.mjs} +11 -11
  200. package/dist/sql-BCuLxGSf.mjs +4 -0
  201. package/dist/src-ByCoEqOw.mjs +133 -0
  202. package/dist/{ssl-Bx4LCutF.mjs → ssl-BA_dcVwF.mjs} +60 -62
  203. package/dist/startup-profile-CyQk_f_L.mjs +2 -0
  204. package/dist/{startup-profile-DqaYNT0b.mjs → startup-profile-uh-F0HRS.mjs} +3 -3
  205. package/dist/state-B6r-b_-d.mjs +2 -0
  206. package/dist/{state-BmzOLELo.mjs → state-CTLznbVs.mjs} +1 -1
  207. package/dist/{containers-DINLx5_i.mjs → static-assets-DGDoaJf1.mjs} +216 -210
  208. package/dist/stream-CzlqY8hq.mjs +89 -0
  209. package/dist/{tags-xVzjZxdt.mjs → tags-BLeaslAb.mjs} +8 -8
  210. package/dist/telemetry-COlodX5Z.mjs +2 -0
  211. package/dist/{telemetry-CJ9URio3.mjs → telemetry-DF7A5Bpk.mjs} +1 -1
  212. package/dist/{tenant-custom-nameservers-M7Fxqh2W.mjs → tenant-custom-nameservers-C5rh6jPf.mjs} +4 -4
  213. package/dist/tenants-CRirmhxS.mjs +13 -0
  214. package/dist/{tools-C-vmgYSv.mjs → tools-BRjRgZnj.mjs} +1 -1
  215. package/dist/tunnels-nLfIWPYT.mjs +27 -0
  216. package/dist/{turnstile-B_Ugzgom.mjs → turnstile-CZjXtBCr.mjs} +10 -10
  217. package/dist/ui-dWsVmFCG.mjs +2 -0
  218. package/dist/{update-check-DRr0eRhB.mjs → update-check-CXMdVBhW.mjs} +1 -1
  219. package/dist/{update-check-DHUo4FOJ.mjs → update-check-D_Oky9-u.mjs} +1 -1
  220. package/dist/update-check-worker.mjs +1 -1
  221. package/dist/{url-normalization-CZRQH_pJ.mjs → url-normalization-DTKgJHE8.mjs} +4 -4
  222. package/dist/url-scanner-9XW3zLaU.mjs +16 -0
  223. package/dist/user-Bk1BIqZ5.mjs +103 -0
  224. package/dist/vectorize-CgOfmWYq.mjs +30 -0
  225. package/dist/verify-B9ILCohg.mjs +2 -0
  226. package/dist/verify-BCuWaO-L.mjs +2 -0
  227. package/dist/version-CcuBNjqg.mjs +2 -0
  228. package/dist/waiting-rooms-C3nTKfK9.mjs +52 -0
  229. package/dist/{web-assets-CgQXsp8m.mjs → web-assets-CWU3jrit.mjs} +29 -29
  230. package/dist/web3-CRpQ5sl4.mjs +26 -0
  231. package/dist/workers-BZMvamn0.mjs +39 -0
  232. package/dist/{workers-for-platforms-5RkV9MVp.mjs → workers-for-platforms-C7F2ev-5.mjs} +18 -18
  233. package/dist/{workers-vpc-Bt4OQbwM.mjs → workers-vpc-ztEKvWmq.mjs} +6 -6
  234. package/dist/workflows-Dd88_Nqc.mjs +48 -0
  235. package/dist/{wrangler-migration-BbmGOu8l.mjs → wrangler-migration-BzMTJPdI.mjs} +302 -293
  236. package/dist/zaraz-BFK0p28R.mjs +22 -0
  237. package/dist/zero-trust-Cdjfp0Ie.mjs +1008 -0
  238. package/dist/{zones-DTAcguf6.mjs → zones-DDn5jk6I.mjs} +51 -51
  239. package/package.json +20 -20
  240. package/dist/ai-DqEN_hhg.mjs +0 -30
  241. package/dist/ai-audit-BmzOgt6x.mjs +0 -6
  242. package/dist/ai-gateway-B0uiYVHq.mjs +0 -74
  243. package/dist/ai-search-DbZIxdio.mjs +0 -74
  244. package/dist/alerting-BjGwBxZT.mjs +0 -52
  245. package/dist/analytics-C7kT_H-W.mjs +0 -17
  246. package/dist/analytics-engine-BHpcNSdD.mjs +0 -4
  247. package/dist/api-X3wKppsT.mjs +0 -3
  248. package/dist/argo-D1VONzu-.mjs +0 -14
  249. package/dist/auth-CspwoBlp.mjs +0 -2
  250. package/dist/auth-D499YE2n.mjs +0 -7
  251. package/dist/auth-FK2eLQ02.mjs +0 -2
  252. package/dist/billing-DRNww0iC.mjs +0 -24
  253. package/dist/body-parser-BKcZS9iJ.mjs +0 -2
  254. package/dist/brand-protection-BVICLzBc.mjs +0 -26
  255. package/dist/browser-run-CEk-NIgP.mjs +0 -40
  256. package/dist/build-CRm2TQq8.mjs +0 -2
  257. package/dist/build-DO_GNhRl.mjs +0 -2
  258. package/dist/builds-CoazxuN-.mjs +0 -64
  259. package/dist/cache-jlLJLSu7.mjs +0 -36
  260. package/dist/cf-hP0SOgC6.mjs +0 -18
  261. package/dist/chunk-SOBRPAPT-BKzUiNx_.mjs +0 -363
  262. package/dist/cli-Nqf58-1c.mjs +0 -4
  263. package/dist/cloudforce-one-CCaIBOAo.mjs +0 -318
  264. package/dist/command-BASaTmJc.mjs +0 -2
  265. package/dist/command-Bih1HLr3.mjs +0 -2
  266. package/dist/command-ByYf12-8.mjs +0 -2
  267. package/dist/command-C0qCuw03.mjs +0 -2
  268. package/dist/command-C2FVMd1b.mjs +0 -2
  269. package/dist/command-C4OgtX_x.mjs +0 -2
  270. package/dist/command-C5Kqc5Km.mjs +0 -2
  271. package/dist/command-CFxyp8Uo.mjs +0 -2
  272. package/dist/command-CZAR85ba.mjs +0 -2
  273. package/dist/command-CelQVrZL.mjs +0 -2
  274. package/dist/command-CrAlzysj.mjs +0 -2
  275. package/dist/command-MxFFWqMg.mjs +0 -2
  276. package/dist/connector-interrupts-CrTeSyaM.mjs +0 -6
  277. package/dist/containers-BOBEs1Gk.mjs +0 -75
  278. package/dist/create-BtmuVqVL.mjs +0 -2
  279. package/dist/csam-scanner-DOOUBeBM.mjs +0 -8
  280. package/dist/custom-csrs-DtdFo5YZ.mjs +0 -18
  281. package/dist/custom-hostnames-ccdlELaD.mjs +0 -24
  282. package/dist/custom-nameservers-p3gDjfva.mjs +0 -12
  283. package/dist/custom-pages-DAkKVzgR.mjs +0 -38
  284. package/dist/d1-CDIyRdh4.mjs +0 -52
  285. package/dist/deploy-BaC5Ty7F.mjs +0 -2
  286. package/dist/deploy-context-DTTgNGro.mjs +0 -56
  287. package/dist/deploy-input-mAy06fAI.mjs +0 -2
  288. package/dist/dev-De-HszNT.mjs +0 -4
  289. package/dist/dialog-D5lus4M4.mjs +0 -2
  290. package/dist/discover-6kAmVMPp.mjs +0 -2
  291. package/dist/discover-C06Syc2B.mjs +0 -2
  292. package/dist/dns-wMjf1t6-.mjs +0 -152
  293. package/dist/docs-BA7qslb2.mjs +0 -3
  294. package/dist/email-auth-BShMFXn4.mjs +0 -6
  295. package/dist/email-domains-CDSbVclP.mjs +0 -14
  296. package/dist/email-routing-CBCkbg_F.mjs +0 -44
  297. package/dist/error-sanitization-B025CygB.mjs +0 -2
  298. package/dist/errors-DatLr-iR.mjs +0 -11
  299. package/dist/field-extractors-BwGdMnTr.mjs +0 -8
  300. package/dist/flagship-Bat5EZCk.mjs +0 -24
  301. package/dist/generate-CeeWW3eX.mjs +0 -3
  302. package/dist/generate-D6V4Q58z.mjs +0 -2
  303. package/dist/get-Be821dio.mjs +0 -2
  304. package/dist/gt-BQkaDQDq.mjs +0 -3
  305. package/dist/healthchecks-uC43QKQd.mjs +0 -20
  306. package/dist/init-BEVVz4_P.mjs +0 -43
  307. package/dist/intel-DRy4rHrt.mjs +0 -62
  308. package/dist/k2-wsanPL3y.mjs +0 -10
  309. package/dist/kv-BLSPcEnH.mjs +0 -12
  310. package/dist/leaked-credential-checks-CSZd9hBQ.mjs +0 -16
  311. package/dist/load-balancers-gap5u4b1.mjs +0 -84
  312. package/dist/local-CFsO9Tkg.mjs +0 -2
  313. package/dist/local-runtime-CmlJ20uJ.mjs +0 -2
  314. package/dist/log-DZfik9Jk.mjs +0 -2
  315. package/dist/login-BfuOf-Yi.mjs +0 -2
  316. package/dist/magic-network-monitoring-CX3TaMTu.mjs +0 -34
  317. package/dist/managed-transforms-CUC-uAbW.mjs +0 -8
  318. package/dist/o11y-oEUpMC3O.mjs +0 -86
  319. package/dist/oauth-BmSFLp_s.mjs +0 -4
  320. package/dist/organization-CEnlXwrl.mjs +0 -70
  321. package/dist/organizations-Dt86ToxE.mjs +0 -4
  322. package/dist/origin-post-quantum-encryption-lX-uaJSL.mjs +0 -6
  323. package/dist/output-BJEgbI0G.mjs +0 -2
  324. package/dist/package-CiRJBRHO.mjs +0 -2
  325. package/dist/page-rules-J6LhwR-s.mjs +0 -38
  326. package/dist/pages-BksdnChs.mjs +0 -48
  327. package/dist/pay-per-crawl-BLcbHRoR.mjs +0 -36
  328. package/dist/pipelines-B5AoB3f3.mjs +0 -40
  329. package/dist/previews-DzJ85fsr.mjs +0 -6
  330. package/dist/progress-DLri-rA7.mjs +0 -2
  331. package/dist/project-settings-nBMEx1f-.mjs +0 -3
  332. package/dist/prompt-D0dXwuME.mjs +0 -4
  333. package/dist/queues-BsAck4To.mjs +0 -52
  334. package/dist/r2-BYjdHDEZ.mjs +0 -112
  335. package/dist/raw-fetch-DQeDx1wT.mjs +0 -2
  336. package/dist/registrar-D4wdgWpo.mjs +0 -43
  337. package/dist/registrar-sandbox-B6yopzdG.mjs +0 -58
  338. package/dist/request-headers-CoxHUNcB.mjs +0 -2
  339. package/dist/request-tracers-817HTytF.mjs +0 -4
  340. package/dist/resource-sharing-CW9xxtq5.mjs +0 -36
  341. package/dist/rulesets-CKyc-Xlx.mjs +0 -42
  342. package/dist/run-Ciw_GIrC.mjs +0 -2
  343. package/dist/run-DD45EQTm.mjs +0 -2
  344. package/dist/schema-DuLIZRhA.mjs +0 -2
  345. package/dist/schema-flags-DrqvwQNw.mjs +0 -4
  346. package/dist/scim-C4iRWNYB.mjs +0 -16
  347. package/dist/session-D2yuwO4i.mjs +0 -2
  348. package/dist/shared--uVkAAd7.mjs +0 -2
  349. package/dist/smart-shield-Dn95hqUH.mjs +0 -22
  350. package/dist/snippets-BNUKOajz.mjs +0 -18
  351. package/dist/spawn-DuT4snxu.mjs +0 -5
  352. package/dist/sql-BX1pBqj3.mjs +0 -4
  353. package/dist/src-DPnUfK4c.mjs +0 -131
  354. package/dist/startup-profile-tZNb2HGz.mjs +0 -2
  355. package/dist/state-Uwfrmw5I.mjs +0 -2
  356. package/dist/stream-BRzr6yh0.mjs +0 -89
  357. package/dist/telemetry-Pt5GpCKD.mjs +0 -2
  358. package/dist/tunnels-DQVXKUKA.mjs +0 -27
  359. package/dist/ui-FYultowZ.mjs +0 -2
  360. package/dist/url-scanner-BH4PLy16.mjs +0 -16
  361. package/dist/user-Bn82Qw0Y.mjs +0 -103
  362. package/dist/vectorize-DoVVz_sh.mjs +0 -30
  363. package/dist/version-Zr2oF8mY.mjs +0 -2
  364. package/dist/waiting-rooms-QUW131o3.mjs +0 -52
  365. package/dist/web3-TY9s6Swn.mjs +0 -26
  366. package/dist/workers-B3uJqJKc.mjs +0 -39
  367. package/dist/workers-builds-BgGY0IGk.mjs +0 -14
  368. package/dist/workflows-6m85DdqF.mjs +0 -48
  369. package/dist/zaraz-8WSJ7l0L.mjs +0 -22
  370. package/dist/zero-trust-DK0cqDZv.mjs +0 -1022
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-D0dXwuME.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/bulk_operations/${t.operation_id}`};function _(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 v={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:_,handler:async e=>c({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/bulk_operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(g,{account_id:l,operation_id:e[`operation-id`]}));a(u,{successLabel:`Loaded`})})},y={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists`,body:`json`};function x(e){return e.usage(`$0 rules lists create
2
+ import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./dry-run-qsnRlRk6.mjs";import{a as r,t as i}from"./context-BGm5_wTT.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-hFMAotFl.mjs";import{t as s}from"./progress-DE_G09u2.mjs";import{t as c}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import{o as l,r as u,t as d}from"./body-parser-HN91kAf0.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-D274Im1O.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/bulk_operations/${t.operation_id}`};function _(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 v={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:_,handler:async e=>c({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/bulk_operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(g,{account_id:l,operation_id:e[`operation-id`]}));o(u,{successLabel:`Loaded`})})},y={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists`,body:`json`};function x(e){return e.usage(`$0 rules lists create
3
3
 
4
- Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`kind`,{type:`string`,description:`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,choices:[`ip`,`redirect`,`hostname`,`asn`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).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 S={command:`create`,describe:`Create a list`,builder:x,handler:async e=>c({command:`rules lists create`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(b,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.kind===void 0&&(e.kind=await m(`kind`,`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,[`ip`,`redirect`,`hostname`,`asn`])),e.name===void 0&&(e.name=await p(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let h=d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}),g=await s(`Creating`,async()=>c.send(b,{body:h,account_id:l}));a(g,{successLabel:`Created`})})};var C={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function w(e){return e.usage(`$0 rules lists delete <list-id>
4
+ Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`kind`,{type:`string`,description:`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,choices:[`ip`,`redirect`,`hostname`,`asn`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).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 S={command:`create`,describe:`Create a list`,builder:x,handler:async e=>c({command:`rules lists create`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await t(e),h=e.local?a:await i();if(e.accountId=h,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>l.send(b,{body:e,account_id:h}));o(t,{successLabel:`Created`});return}e.kind===void 0&&(e.kind=await m(`kind`,`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,[`ip`,`redirect`,`hostname`,`asn`])),e.name===void 0&&(e.name=await p(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let g=d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}),_=await s(`Creating`,async()=>l.send(b,{body:g,account_id:h}));o(_,{successLabel:`Created`})})};var C={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function w(e){return e.usage(`$0 rules lists delete <list-id>
5
5
 
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 T={command:`delete <list-id>`,describe:`Delete a list`,builder:w,handler:async e=>c({command:`rules lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the custom list and every item it contains.`}))return;let u=await s(`Deleting`,async()=>c.send(C,{account_id:l,list_id:e[`list-id`]}));a(u,{successLabel:`Deleted`})})};var E={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function D(e){return e.usage(`$0 rules lists get <list-id>
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 T={command:`delete <list-id>`,describe:`Delete a list`,builder:w,handler:async e=>c({command:`rules lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the custom list and every item it contains.`}))return;let u=await s(`Deleting`,async()=>c.send(C,{account_id:l,list_id:e[`list-id`]}));o(u,{successLabel:`Deleted`})})};var E={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function D(e){return e.usage(`$0 rules lists get <list-id>
7
7
 
8
- 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 O={command:`get <list-id>`,describe:`Get a list`,builder:D,handler:async e=>c({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(E,{account_id:l,list_id:e[`list-id`]}));a(u,{successLabel:`Loaded`})})};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function A(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 j={command:`create <list-id>`,describe:`Create list items`,builder:A,handler:async e=>c({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(k,{body:t,account_id:l,list_id:e[`list-id`]}));a(n,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var M={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function N(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 P={command:`delete <list-id>`,describe:`Delete list items`,builder:N,handler:async e=>c({command:`rules lists items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({items:l(e.items,`items`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation deletes the selected items from the custom list.`}))return;if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(M,{body:t,account_id:f,list_id:e[`list-id`]}));a(n,{successLabel:`Deleted`});return}let p=d({items:l(e.items,`items`)}),m=await s(`Deleting`,async()=>c.send(M,{body:p,account_id:f,list_id:e[`list-id`]}));a(m,{successLabel:`Deleted`})})};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items/${t.item_id}`};function I(e){return e.usage(`$0 rules lists items get <item-id>
8
+ 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 O={command:`get <list-id>`,describe:`Get a list`,builder:D,handler:async e=>c({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(E,{account_id:l,list_id:e[`list-id`]}));o(u,{successLabel:`Loaded`})})};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function A(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 j={command:`create <list-id>`,describe:`Create list items`,builder:A,handler:async e=>c({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body),l=await t(e),d=e.local?a:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>l.send(k,{body:t,account_id:d,list_id:e[`list-id`]}));o(n,{successLabel:`Created`})}})};var M={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function N(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. Shape: [{"id": string}].`}).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 P={command:`delete <list-id>`,describe:`Delete list items`,builder:N,handler:async e=>c({command:`rules lists items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({items:l(e.items,`items`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),f=await t(e),p=e.local?a:await i();if(e.accountId=p,!await h({force:!!e.force,message:`This operation deletes the selected items from the custom list.`}))return;if(e.body!==void 0){let t=c,n=await s(`Deleting`,async()=>f.send(M,{body:t,account_id:p,list_id:e[`list-id`]}));o(n,{successLabel:`Deleted`});return}let m=d({items:l(e.items,`items`)}),g=await s(`Deleting`,async()=>f.send(M,{body:m,account_id:p,list_id:e[`list-id`]}));o(g,{successLabel:`Deleted`})})};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items/${t.item_id}`};function I(e){return e.usage(`$0 rules lists items get <item-id>
9
9
 
10
- 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 L={command:`get <item-id>`,describe:`Get a list item`,builder:I,handler:async e=>c({command:`rules lists items get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``),"item-id":String(e[`item-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(F,{account_id:l,list_id:e[`list-id`],item_id:e[`item-id`]}));a(u,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,query:[`cursor`,`per_page`,`search`]};function z(e){return e.usage(`$0 rules lists items list
10
+ 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 L={command:`get <item-id>`,describe:`Get a list item`,builder:I,handler:async e=>c({command:`rules lists items get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``),"item-id":String(e[`item-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(F,{account_id:l,list_id:e[`list-id`],item_id:e[`item-id`]}));o(u,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,query:[`cursor`,`per_page`,`search`]};function z(e){return e.usage(`$0 rules lists items list
11
11
 
12
- 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 B={command:`list`,describe:`Get list items`,builder:z,handler:async e=>c({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={cursor:e.cursor,per_page:e[`per-page`],search:e.search};if(e.dryRun){let t=await r();o({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(R,{account_id:u,list_id:e[`list-id`],...c}));a(d,{successLabel:`Loaded`})})};var V={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function H(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 U={command:`update <list-id>`,describe:`Update all list items`,builder:H,handler:async e=>c({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(V,{body:t,account_id:l,list_id:e[`list-id`]}));a(n,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},W={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(j).command(P).command(L).command(B).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists`};function K(e){return e.usage(`$0 rules lists list
12
+ 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 B={command:`list`,describe:`Get list items`,builder:z,handler:async e=>c({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={cursor:e.cursor,per_page:e[`per-page`],search:e.search};if(e.dryRun){let t=await r();n({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(R,{account_id:u,list_id:e[`list-id`],...c}));o(d,{successLabel:`Loaded`})})};var V={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function H(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 U={command:`update <list-id>`,describe:`Update all list items`,builder:H,handler:async e=>c({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body),l=await t(e),d=e.local?a:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(V,{body:t,account_id:d,list_id:e[`list-id`]}));o(n,{successLabel:`Updated`})}})},W={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(j).command(P).command(L).command(B).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists`};function K(e){return e.usage(`$0 rules lists list
13
13
 
14
- Fetches all lists in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Get lists`,builder:K,handler:async e=>c({command:`rules lists list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(G,{account_id:l}));a(u,{successLabel:`Loaded`})})};var J={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`,body:`json`};function Y(e){return e.usage(`$0 rules lists update <list-id>
14
+ Fetches all lists in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Get lists`,builder:K,handler:async e=>c({command:`rules lists list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();n({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(G,{account_id:l}));o(u,{successLabel:`Loaded`})})};var J={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`,body:`json`};function Y(e){return e.usage(`$0 rules lists update <list-id>
15
15
 
16
- 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 X={command:`update <list-id>`,describe:`Update a list`,builder:Y,handler:async e=>c({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(J,{body:t,account_id:l,list_id:e[`list-id`]}));a(n,{successLabel:`Updated`});return}let p=d({description:f(e.description,`description`,`text`)}),m=await s(`Updating`,async()=>c.send(J,{body:p,account_id:l,list_id:e[`list-id`]}));a(m,{successLabel:`Updated`})})},Z={command:`lists`,describe:`Custom account-level lists of IPs, hostnames, ASNs, or redirects used in rule expressions`,builder:e=>e.command(S).command(T).command(O).command(q).command(X).command(y).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`rules`,describe:`Resources used by Cloudflare rules and rulesets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
16
+ 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 X={command:`update <list-id>`,describe:`Update a list`,builder:Y,handler:async e=>c({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await t(e),p=e.local?a:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(J,{body:t,account_id:p,list_id:e[`list-id`]}));o(n,{successLabel:`Updated`});return}let m=d({description:f(e.description,`description`,`text`)}),h=await s(`Updating`,async()=>l.send(J,{body:m,account_id:p,list_id:e[`list-id`]}));o(h,{successLabel:`Updated`})})},Z={command:`lists`,describe:`Custom account-level lists of IPs, hostnames, ASNs, or redirects used in rule expressions`,builder:e=>e.command(S).command(T).command(O).command(q).command(X).command(y).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`rules`,describe:`Resources used by Cloudflare rules and rulesets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-DA1PHaHi.mjs";import{c as r,o as i,r as a,t as o}from"./body-parser-HN91kAf0.mjs";import{a as s,i as c,t as l}from"./context-BGm5_wTT.mjs";import{t as u}from"./dry-run-qsnRlRk6.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{t as f}from"./local-B3zt9PXR.mjs";import{t as p}from"./run-CXWkMU3x.mjs";import{t as m}from"./output-hFMAotFl.mjs";import{t as h}from"./progress-DE_G09u2.mjs";import"./telemetry-COlodX5Z.mjs";import{n as g}from"./prompt-D274Im1O.mjs";var _={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`dry_run`],body:`json`};function v(e){return e.usage(`$0 rulesets create
3
+
4
+ Creates a ruleset.
5
+
6
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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`]}).coerce(`kind`,e=>d(e,`kind`,`text`)).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_custom`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>d(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json. Shape: [(({"action"?: string, "action_parameters"?: {...}, "description"?: string, "enabled"?: boolean, "exposed_credential_check"?: {...}, ...more} & {"action"?: "block", "action_parameters"?: {...}, "description"?: string}) | ...more)]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create an account or zone ruleset`,builder:v,handler:async e=>p({command:`rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},e,async()=>{let t={dry_run:e[`validate-only`]};if(e.dryRun){let n=e.zone===void 0?await s():void 0,r=e.zone===void 0?`accounts`:`zones`,c=e.zone??n??`<account-id>`;u({command:`cf rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${r}/${c}/rulesets`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(c)},query:t,bodyKind:`json`,body:e.body===void 0?o({description:d(e.description,`description`,`text`),name:d(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:i(e.rules,`rules`)}):a(e.body)});return}let r=e.body===void 0?void 0:a(e.body),p=await n(e),g=e.zone===void 0?`accounts`:`zones`,v=g===`zones`?await c({zone:e.zone},p,{quiet:e.quiet}):e.local?f:await l();if(g===`zones`?e.zoneId=v:e.accountId=v,e.body!==void 0){let e=r;new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let n=await h(`Creating`,async()=>p.send(_,{body:e,account_or_zone:g,account_or_zone_id:v,...t}));m(n,{successLabel:`Created`});return}let y=o({description:d(e.description,`description`,`text`),name:d(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:i(e.rules,`rules`)});new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let b=await h(`Creating`,async()=>p.send(_,{body:y,account_or_zone:g,account_or_zone_id:v,...t}));m(b,{successLabel:`Created`})})};function b(e){return e.usage(`$0 rulesets delete <id>
7
+
8
+ Deletes all versions of an existing account or zone ruleset.
9
+
10
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`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 x={command:`delete <id>`,describe:`Delete an account or zone ruleset`,builder:b,handler:async e=>p({command:`rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let r={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await s():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;u({command:`cf rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),id:String(e.id??``)},query:r,bodyKind:`none`});return}let i=await n(e),a=e.zone===void 0?`accounts`:`zones`,o=a===`zones`?await c({zone:e.zone},i,{quiet:e.quiet}):e.local?f:await l();if(a===`zones`?e.zoneId=o:e.accountId=o,!await g({force:!!e.force}))return;let d=await h(`Deleting`,async()=>t(i,`DELETE`,`/${a}/${o}/rulesets/${encodeURIComponent(String(e.id))}`,{query:r}));m(d,{successLabel:`Deleted`})})};function S(e){return e.usage(`$0 rulesets entrypoint get <phase>
11
+
12
+ Fetches the latest version of the account or zone entry point ruleset for a given phase.
13
+
14
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`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 <phase>`,describe:`Get an account or zone entry point ruleset`,builder:S,handler:async e=>p({command:`rulesets entrypoint get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await s():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;u({command:`cf rulesets entrypoint get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``)},bodyKind:`none`});return}let r=await n(e),i=e.zone===void 0?`accounts`:`zones`,a=i===`zones`?await c({zone:e.zone},r,{quiet:e.quiet}):e.local?f:await l();i===`zones`?e.zoneId=a:e.accountId=a;let o=await h(`Loading`,async()=>t(r,`GET`,`/${i}/${a}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint`));m(o,{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 rulesets entrypoint update <phase>
15
+
16
+ Updates an account or zone entry point ruleset, creating a new version.
17
+
18
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`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. Shape: [(({"action"?: string, "action_parameters"?: {...}, "description"?: string, "enabled"?: boolean, "exposed_credential_check"?: {...}, ...more} & {"action"?: "block", "action_parameters"?: {...}, "description"?: string}) | ...more)]. ? marks optional keys.`}).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 <phase>`,describe:`Update an account or zone entry point ruleset`,builder:w,handler:async e=>p({command:`rulesets entrypoint update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},e,async()=>{let p={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await s():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;u({command:`cf rulesets entrypoint update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``)},query:p,bodyKind:`json`,body:e.body===void 0?o({description:d(e.description,`description`,`text`),name:d(e.name,`name`,`text`),rules:i(e.rules,`rules`)}):a(e.body)});return}let g=e.body===void 0?void 0:a(e.body),_=await n(e),v=e.zone===void 0?`accounts`:`zones`,y=v===`zones`?await c({zone:e.zone},_,{quiet:e.quiet}):e.local?f:await l();if(v===`zones`?e.zoneId=y:e.accountId=y,e.body!==void 0){let n=g,r=new URLSearchParams(Object.entries(p).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await h(`Updating`,async()=>t(_,`PUT`,`/${v}/${y}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${r?`?`+r:``}`,{body:n}));m(i,{successLabel:`Updated`});return}let b={};e.description!==void 0&&r(b,[`description`],d(e.description,`description`,`text`)),e.name!==void 0&&r(b,[`name`],d(e.name,`name`,`text`)),e.rules!==void 0&&r(b,[`rules`],i(e.rules,`rules`));let x=new URLSearchParams(Object.entries(p).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),S=await h(`Updating`,async()=>t(_,`PUT`,`/${v}/${y}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${x?`?`+x:``}`,{body:b}));m(S,{successLabel:`Updated`})})},E={command:`entrypoint`,describe:`Operations for entrypoint`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.usage(`$0 rulesets get <id>
19
+
20
+ Fetches the latest version of an account or zone ruleset.
21
+
22
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).positional(`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 O={command:`get <id>`,describe:`Get an account or zone ruleset`,builder:D,handler:async e=>p({command:`rulesets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await s():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;u({command:`cf rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``)},bodyKind:`none`});return}let r=await n(e),i=e.zone===void 0?`accounts`:`zones`,a=i===`zones`?await c({zone:e.zone},r,{quiet:e.quiet}):e.local?f:await l();i===`zones`?e.zoneId=a:e.accountId=a;let o=await h(`Loading`,async()=>t(r,`GET`,`/${i}/${a}/rulesets/${encodeURIComponent(String(e.id))}`));m(o,{successLabel:`Loaded`})})};var k={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`cursor`,`per_page`]};function A(e){return e.usage(`$0 rulesets list
23
+
24
+ Fetches all rulesets.
25
+
26
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 j={command:`list`,describe:`List account or zone rulesets`,builder:A,handler:async e=>p({command:`rulesets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){let n=e.zone===void 0?await s():void 0,r=e.zone===void 0?`accounts`:`zones`,i=e.zone??n??`<account-id>`;u({command:`cf rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${i}/rulesets`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(i)},query:t,bodyKind:`none`});return}let r=await n(e),i=e.zone===void 0?`accounts`:`zones`,a=i===`zones`?await c({zone:e.zone},r,{quiet:e.quiet}):e.local?f:await l();i===`zones`?e.zoneId=a:e.accountId=a;let o=await h(`Loading`,async()=>r.send(k,{account_or_zone:i,account_or_zone_id:a,...t}));m(o,{successLabel:`Loaded`})})};var M={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules`,query:[`dry_run`],body:`json`};function N(e){return e.usage(`$0 rulesets rules create <ruleset-id>
27
+
28
+ 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.
29
+
30
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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)`})}const P={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:N,handler:async e=>p({command:`rulesets rules create`,classification:{safeFlags:[`validate-only`,`dry-run`]}},e,async()=>{let t={dry_run:e[`validate-only`]};if(e.dryRun){let n=e.zone===void 0?await s():void 0,r=e.zone===void 0?`accounts`:`zones`,i=e.zone??n??`<account-id>`;u({command:`cf rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${r}/${i}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(i),"ruleset-id":String(e[`ruleset-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?o({position:{before:d(e[`position-before`],`position-before`,`text`),after:d(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}}):a(e.body)});return}let r=e.body===void 0?void 0:a(e.body),i=await n(e),p=e.zone===void 0?`accounts`:`zones`,g=p===`zones`?await c({zone:e.zone},i,{quiet:e.quiet}):e.local?f:await l();if(p===`zones`?e.zoneId=g:e.accountId=g,e.body!==void 0){let n=r;new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let a=await h(`Creating`,async()=>i.send(M,{body:n,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],...t}));m(a,{successLabel:`Created`});return}let _=o({position:{before:d(e[`position-before`],`position-before`,`text`),after:d(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}});new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await h(`Creating`,async()=>i.send(M,{body:_,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],...t}));m(v,{successLabel:`Created`})})};var F={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules/${t.rule_id}`,query:[`dry_run`]};function I(e){return e.usage(`$0 rulesets rules delete <rule-id>
31
+
32
+ Deletes an existing rule from an account or zone ruleset.
33
+
34
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 L={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:I,handler:async e=>p({command:`rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={dry_run:e[`validate-only`]};if(e.dryRun){let n=e.zone===void 0?await s():void 0,r=e.zone===void 0?`accounts`:`zones`,i=e.zone??n??`<account-id>`;u({command:`cf rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${r}/${i}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(i),"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e),i=e.zone===void 0?`accounts`:`zones`,a=i===`zones`?await c({zone:e.zone},r,{quiet:e.quiet}):e.local?f:await l();if(i===`zones`?e.zoneId=a:e.accountId=a,!await g({force:!!e.force}))return;let o=await h(`Deleting`,async()=>r.send(F,{account_or_zone:i,account_or_zone_id:a,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...t}));m(o,{successLabel:`Deleted`})})};var R={method:`PATCH`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules/${t.rule_id}`,query:[`dry_run`],body:`json`};function z(e){return e.usage(`$0 rulesets rules update <rule-id>
35
+
36
+ Updates an existing rule in an account or zone ruleset.
37
+
38
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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)`})}const B={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:z,handler:async e=>p({command:`rulesets rules update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},e,async()=>{let t={dry_run:e[`validate-only`]};if(e.dryRun){let n=e.zone===void 0?await s():void 0,r=e.zone===void 0?`accounts`:`zones`,i=e.zone??n??`<account-id>`;u({command:`cf rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${r}/${i}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(i),"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?o({position:{before:d(e[`position-before`],`position-before`,`text`),after:d(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}}):a(e.body)});return}let r=e.body===void 0?void 0:a(e.body),i=await n(e),p=e.zone===void 0?`accounts`:`zones`,g=p===`zones`?await c({zone:e.zone},i,{quiet:e.quiet}):e.local?f:await l();if(p===`zones`?e.zoneId=g:e.accountId=g,e.body!==void 0){let n=r;new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let a=await h(`Updating`,async()=>i.send(R,{body:n,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...t}));m(a,{successLabel:`Updated`});return}let _=o({position:{before:d(e[`position-before`],`position-before`,`text`),after:d(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}});new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await h(`Updating`,async()=>i.send(R,{body:_,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...t}));m(v,{successLabel:`Updated`})})},V={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(P).command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}`,query:[`dry_run`],body:`json`};function U(e){return e.usage(`$0 rulesets update <ruleset-id>
39
+
40
+ Updates an account or zone ruleset, creating a new version.
41
+
42
+ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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`]}).coerce(`kind`,e=>d(e,`kind`,`text`)).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_custom`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>d(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json. Shape: [(({"action"?: string, "action_parameters"?: {...}, "description"?: string, "enabled"?: boolean, "exposed_credential_check"?: {...}, ...more} & {"action"?: "block", "action_parameters"?: {...}, "description"?: string}) | ...more)]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:U,handler:async e=>p({command:`rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},e,async()=>{let t={dry_run:e[`validate-only`]};if(e.dryRun){let n=e.zone===void 0?await s():void 0,r=e.zone===void 0?`accounts`:`zones`,c=e.zone??n??`<account-id>`;u({command:`cf rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${r}/${c}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(c),"ruleset-id":String(e[`ruleset-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?o({description:d(e.description,`description`,`text`),name:d(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:i(e.rules,`rules`)}):a(e.body)});return}let r=e.body===void 0?void 0:a(e.body),p=await n(e),g=e.zone===void 0?`accounts`:`zones`,_=g===`zones`?await c({zone:e.zone},p,{quiet:e.quiet}):e.local?f:await l();if(g===`zones`?e.zoneId=_:e.accountId=_,e.body!==void 0){let n=r;new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let i=await h(`Updating`,async()=>p.send(H,{body:n,account_or_zone:g,account_or_zone_id:_,ruleset_id:e[`ruleset-id`],...t}));m(i,{successLabel:`Updated`});return}let v=o({description:d(e.description,`description`,`text`),name:d(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:i(e.rules,`rules`)});new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let y=await h(`Updating`,async()=>p.send(H,{body:v,account_or_zone:g,account_or_zone_id:_,ruleset_id:e[`ruleset-id`],...t}));m(y,{successLabel:`Updated`})})},G={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(y).command(x).command(O).command(j).command(W).command(E).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
@@ -1,28 +1,28 @@
1
1
  #!/usr/bin/env node
2
- import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-D0dXwuME.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
2
+ import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{o as n,r,t as i}from"./body-parser-HN91kAf0.mjs";import{a,t as o}from"./context-BGm5_wTT.mjs";import{t as s}from"./dry-run-qsnRlRk6.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./output-hFMAotFl.mjs";import{t as u}from"./run-CXWkMU3x.mjs";import{t as d}from"./progress-DE_G09u2.mjs";import"./telemetry-COlodX5Z.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-D274Im1O.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
3
3
 
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 g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>c({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:f,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}),h=await s(`Creating`,async()=>c.send(m,{body:p,account_id:f,ruleset_id:e[`ruleset-id`]}));a(h,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
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. Shape: [{"host"?: string, "id"?: string, "inclusive"?: boolean, "is_paused"?: boolean, "paths"?: [string]}]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>u({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({delete_rules:e[`delete-rules`],rules:n(e.rules,`rules`)}):r(e.body)});return}let u=e.body===void 0?void 0:r(e.body),f=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=u,n=await d(`Creating`,async()=>f.send(m,{body:t,account_id:p,ruleset_id:e[`ruleset-id`]}));l(n,{successLabel:`Created`});return}let h=i({delete_rules:e[`delete-rules`],rules:n(e.rules,`rules`)}),g=await d(`Creating`,async()=>f.send(m,{body:h,account_id:p,ruleset_id:e[`ruleset-id`]}));l(g,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
5
5
 
6
- Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>c({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:l,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),m=await s(`Creating`,async()=>c.send(_,{body:p,account_id:l,ruleset_id:e[`ruleset-id`]}));a(m,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`};function x(e){return e.usage(`$0 rum rules delete <rule-id>
6
+ Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>u({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await d(`Creating`,async()=>u.send(_,{body:t,account_id:p,ruleset_id:e[`ruleset-id`]}));l(r,{successLabel:`Created`});return}let m=i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),h=await d(`Creating`,async()=>u.send(_,{body:m,account_id:p,ruleset_id:e[`ruleset-id`]}));l(h,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`};function x(e){return e.usage(`$0 rum rules delete <rule-id>
7
7
 
8
- Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:x,handler:async e=>c({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(b,{account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(u,{successLabel:`Deleted`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`};function w(e){return e.usage(`$0 rum rules list
8
+ Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:x,handler:async e=>u({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();if(e.accountId=r,!await p({force:!!e.force}))return;let i=await d(`Deleting`,async()=>n.send(b,{account_id:r,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));l(i,{successLabel:`Deleted`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`};function w(e){return e.usage(`$0 rum rules list
9
9
 
10
- Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:w,handler:async e=>c({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(C,{account_id:l,ruleset_id:e[`ruleset-id`]}));a(u,{successLabel:`Loaded`})})};var E={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`,body:`json`};function D(e){return e.usage(`$0 rum rules update <rule-id>
10
+ Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:w,handler:async e=>u({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(C,{account_id:r,ruleset_id:e[`ruleset-id`]}));l(i,{successLabel:`Loaded`})})};var E={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`,body:`json`};function D(e){return e.usage(`$0 rum rules update <rule-id>
11
11
 
12
- Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>c({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(E,{body:t,account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(n,{successLabel:`Updated`});return}let p=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),m=await s(`Updating`,async()=>c.send(E,{body:p,account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(m,{successLabel:`Updated`})})},k={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/site_info`,body:`json`};function j(e){return e.usage(`$0 rum site-info create
12
+ Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>u({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await d(`Updating`,async()=>u.send(E,{body:t,account_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));l(r,{successLabel:`Updated`});return}let m=i({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),h=await d(`Updating`,async()=>u.send(E,{body:m,account_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));l(h,{successLabel:`Updated`})})},k={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/site_info`,body:`json`};function j(e){return e.usage(`$0 rum site-info create
13
13
 
14
- Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>c({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(A,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}let p=d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),m=await s(`Creating`,async()=>c.send(A,{body:p,account_id:l}));a(m,{successLabel:`Created`})})};var N={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function P(e){return e.usage(`$0 rum site-info delete <site-id>
14
+ Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>u({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let e=n,t=await d(`Creating`,async()=>u.send(A,{body:e,account_id:p}));l(t,{successLabel:`Created`});return}let m=i({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),h=await d(`Creating`,async()=>u.send(A,{body:m,account_id:p}));l(h,{successLabel:`Created`})})};var N={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function P(e){return e.usage(`$0 rum site-info delete <site-id>
15
15
 
16
- Deletes an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>c({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(N,{account_id:l,site_id:e[`site-id`]}));a(u,{successLabel:`Deleted`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function ee(e){return e.usage(`$0 rum site-info get <site-id>
16
+ Deletes an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>u({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();if(e.accountId=r,!await p({force:!!e.force}))return;let i=await d(`Deleting`,async()=>n.send(N,{account_id:r,site_id:e[`site-id`]}));l(i,{successLabel:`Deleted`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function L(e){return e.usage(`$0 rum site-info get <site-id>
17
17
 
18
- Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:ee,handler:async e=>c({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(I,{account_id:l,site_id:e[`site-id`]}));a(u,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/site_tag/list`,query:[`all`]};function z(e){return e.usage(`$0 rum site-info list-site-tags
18
+ Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:L,handler:async e=>u({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(I,{account_id:r,site_id:e[`site-id`]}));l(i,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/site_tag/list`,query:[`all`]};function z(e){return e.usage(`$0 rum site-info list-site-tags
19
19
 
20
- Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:z,handler:async e=>c({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},e,async()=>{let c={all:e.all};if(e.dryRun){let e=await r();o({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(R,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var V={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/zone_tag/list`};function H(e){return e.usage(`$0 rum site-info list-zone-tags
20
+ Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:z,handler:async e=>u({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},e,async()=>{let n={all:e.all};if(e.dryRun){let e=await a();s({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e),i=e.local?c:await o();e.accountId=i;let u=await d(`Loading`,async()=>r.send(R,{account_id:i,...n}));l(u,{successLabel:`Loaded`})})};var V={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/zone_tag/list`};function H(e){return e.usage(`$0 rum site-info list-zone-tags
21
21
 
22
- Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:H,handler:async e=>c({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(V,{account_id:l}));a(u,{successLabel:`Loaded`})})};var W={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/list`,query:[`per_page`,`page`,`order_by`]};function G(e){return e.usage(`$0 rum site-info list
22
+ Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:H,handler:async e=>u({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await a();s({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(V,{account_id:r}));l(i,{successLabel:`Loaded`})})};var W={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/list`,query:[`per_page`,`page`,`order_by`]};function G(e){return e.usage(`$0 rum site-info list
23
23
 
24
- Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List Web Analytics sites`,builder:G,handler:async e=>c({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let c={per_page:e[`per-page`],page:e.page,order_by:e[`order-by`]};if(e.dryRun){let e=await r();o({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/list`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(W,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`,body:`json`};function J(e){return e.usage(`$0 rum site-info update <site-id>
24
+ Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List Web Analytics sites`,builder:G,handler:async e=>u({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let n={per_page:e[`per-page`],page:e.page,order_by:e[`order-by`]};if(e.dryRun){let e=await a();s({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/list`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e),i=e.local?c:await o();e.accountId=i;let u=await d(`Loading`,async()=>r.send(W,{account_id:i,...n}));l(u,{successLabel:`Loaded`})})};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`,body:`json`};function J(e){return e.usage(`$0 rum site-info update <site-id>
25
25
 
26
- Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>c({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(q,{body:t,account_id:l,site_id:e[`site-id`]}));a(n,{successLabel:`Updated`});return}let p=d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),m=await s(`Updating`,async()=>c.send(q,{body:p,account_id:l,site_id:e[`site-id`]}));a(m,{successLabel:`Updated`})})};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/validate/${t.hostname}`};function Z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
26
+ Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>u({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?c:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await d(`Updating`,async()=>u.send(q,{body:t,account_id:p,site_id:e[`site-id`]}));l(r,{successLabel:`Updated`});return}let m=i({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),h=await d(`Updating`,async()=>u.send(q,{body:m,account_id:p,site_id:e[`site-id`]}));l(h,{successLabel:`Updated`})})};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/validate/${t.hostname}`};function Z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
27
27
 
28
- Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>c({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/validate/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(X,{account_id:l,hostname:e.hostname}));a(u,{successLabel:`Loaded`})})},$={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(M).command(F).command(L).command(K).command(B).command(U).command(Y).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(k).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
28
+ Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>u({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/validate/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?c:await o();e.accountId=r;let i=await d(`Loading`,async()=>n.send(X,{account_id:r,hostname:e.hostname}));l(i,{successLabel:`Loaded`})})},$={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(M).command(F).command(ee).command(K).command(B).command(U).command(Y).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(k).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{t as runWithTelemetry}from"./run-CXWkMU3x.mjs";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./interactive-JBA3qOUa.mjs";import{n}from"./version-CcuBNjqg.mjs";import{t as r}from"./agent-context-Dtyy4aKL.mjs";import{t as i}from"./interactive-wQM7Blhm.mjs";import{t as a}from"./request-headers-Bopp5lH_.mjs";import{tt as o}from"./dist-BxhwE-W1.mjs";import{n as s,t as c}from"./state-CTLznbVs.mjs";import{n as l,t as u}from"./delegate-livNdiwK.mjs";import{i as d,r as f}from"./lifecycle-oud60haK.mjs";import{t as p}from"./error-sanitization-BkgtZ0Vx.mjs";import{r as m}from"./sanitization-DkVWMHkc.mjs";import h from"node:os";import{createHash as g,randomUUID as _}from"node:crypto";const v=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),y=`CF_SEND_TELEMETRY`,b=`WRANGLER_SEND_METRICS`,x=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function S(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 C(){let e=S(process.env[y]);if(e!==void 0)return{enabled:e,source:`env`};let t=S(process.env[b]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function w(){return C()?.enabled}function T(){let e=c();if(typeof e.deviceId==`string`&&x.test(e.deviceId))return e.deviceId;let t=_();return s({deviceId:t}),t}function E(){return c().deviceId===void 0}function D(){if(o())return{enabled:!1,source:`do-not-track`};let e=C();if(e!==void 0)return e;let t=c().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=v?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function O(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return y;case`wrangler-env`:return b;default:return}}function k(e){s({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function A(){return c().telemetry?.bannerLastShown}function j(e){s({telemetry:{bannerLastShown:e}})}const M=/^\d{1,5}\.\d{1,5}\.\d{1,5}(?:-[0-9A-Za-z.-]{1,40})?(?:\+[0-9A-Za-z.-]{1,40})?$/;function N(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function P(){return h.version()}function F(){return process.arch}function I(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function L(){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 R(e=process.env,t=process.ppid){if(!e.CF_DELEGATION)return!1;let n=e[u];return n===void 0||n===String(t)}function z(e=process.env,t=process.ppid){if(!e.CF_DELEGATION_PID||!R(e,t))return;let n=e[l];if(!(typeof n!=`string`||n.length>64||!M.test(n)))return n}function B(e,t,n){return g(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function V(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let H;function U(){if(H)return H;let[e,o,s]=n.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),c=Date.now(),l=0,u=E(),{enabled:f}=D(),p=r(),m=p.harness?.id??null,h=p.matches.find(e=>e.sessionId),g=R(),_=z();function v(){let r=V(),d=T();return{product:`cf`,cliVersion:n,cliMajor:e??0,cliMinor:o??0,cliPatch:s??0,...r?{prereleaseLabel:r}:{},osPlatform:N(),osVersion:P(),arch:F(),nodeVersion:I(),packageManager:L(),deviceId:d,amplitude_session_id:c,amplitude_event_id:l++,...h?.sessionId?{agentSessionKey:B(d,h.harness.id,h.sessionId)}:{},isFirstUsage:u,isCI:i,isInteractive:t(),cliMode:a(),agent:m,delegated:g,..._?{globalCliVersion:_}:{}}}function y(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${f?`sending`:`would send`}: ${JSON.stringify(n)}`),f)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return H={enabled:f,sendCommandEvent(e,t){if(f)try{d(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(f)try{d(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},H}const W=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),G=1024;function K(t){if(t instanceof e)return t.cancelled||t.signal&&W.has(t.signal)?`cancelled`:t.code===0?`success`:`error`}async function q(e,t,n){let r;try{r=U()}catch{return n()}if(f(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:m(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,G),...e.searchQuery.length>G?{searchQueryTruncated:!0}:{}},o=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-o}),e}catch(e){let t=K(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-o,...t===`error`?p(e):{}}),e}}function J(e,t){return{...e,handler:n=>q(t,n,()=>e.handler(n))}}export{v as a,w as c,D as d,j as f,y as i,O as l,J as n,A as o,k as p,U as r,T as s,q as t,E as u};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t}from"./metadata-Df5kCWJv.mjs";import{t as n}from"./output-hFMAotFl.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const i={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async i=>{let a=t(import.meta.url,`schemas.json`,r);if(!a)throw console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),new e(1);if(i.list){let e=Object.entries(a.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId}));n(e);return}if(i.command.length===0)throw console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),new e(1);let o=i.command.join(` `),s=a.schemas[o];if(!s){let t=Object.keys(a.schemas).filter(e=>e.includes(o)||o.includes(e));if(t.length>0){console.error(`Schema not found for "${o}". Did you mean:`);for(let e of t)console.error(` cf schema ${e}`)}else console.error(`Schema not found for "${o}". Use --list to see available schemas.`);throw new e(1)}n(s)}};export{i as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./version-Zr2oF8mY.mjs";import{a as t}from"./cf-hP0SOgC6.mjs";import{mkdirSync as n,readFileSync as r,writeFileSync as i}from"node:fs";import{dirname as a,join as o}from"node:path";import{createHash as s}from"node:crypto";function c(n,r){let i=s(`sha256`).update([e,...r].join(` `)).digest(`hex`).slice(0,32);return o(t(),`cache`,n,`${i}.json`)}function l(e,t,n,i){try{let a=JSON.parse(r(c(e,t),`utf-8`));return typeof a?.fetchedAt==`number`&&Date.now()-a.fetchedAt<=n?i(a.value):void 0}catch{return}}function u(e,t,r){try{let o=c(e,t);n(a(o),{recursive:!0}),i(o,JSON.stringify({fetchedAt:Date.now(),value:r}),`utf-8`)}catch{}}const d=5e3;function f(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ 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=>f(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>f(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>f(e,t)))||n.if!==void 0&&!f(n.if,t)||n.then!==void 0&&!f(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!f(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=>f(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>f(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 p(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!f(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function m(e,t){return l(e,t,36e5,e=>f(e)?e:void 0)}function h(e,t,n){u(e,t,n)}function g(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{a as e}from"./cf-DmvZ2L51.mjs";import{n as t}from"./version-CcuBNjqg.mjs";import{mkdirSync as n,readFileSync as r,writeFileSync as i}from"node:fs";import{dirname as a,join as o}from"node:path";import{createHash as s}from"node:crypto";function c(n,r){let i=s(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return o(e(),`cache`,n,`${i}.json`)}function l(e,t,n,i){try{let a=JSON.parse(r(c(e,t),`utf-8`));return typeof a?.fetchedAt==`number`&&Date.now()-a.fetchedAt<=n?i(a.value):void 0}catch{return}}function u(e,t,r){try{let o=c(e,t);n(a(o),{recursive:!0}),i(o,JSON.stringify({fetchedAt:Date.now(),value:r}),`utf-8`)}catch{}}const d=5e3;function f(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ 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=>f(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>f(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>f(e,t)))||n.if!==void 0&&!f(n.if,t)||n.then!==void 0&&!f(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!f(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=>f(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>f(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 p(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!f(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function m(e,t){return l(e,t,36e5,e=>f(e)?e:void 0)}function h(e,t,n){u(e,t,n)}function g(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}export{h as a,m as i,g as n,l as o,p as r,u as s,d as t};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{c as e}from"./body-parser-HN91kAf0.mjs";import{i as t,r as n}from"./global-options-4pyD17hd.mjs";import{n as r}from"./input-validation-D7z60HJH.mjs";import{o as i}from"./prompt-D274Im1O.mjs";import{r as a}from"./theme-BGHWSKCw.mjs";import{isDeepStrictEqual as o}from"node:util";function s(e,t=/* @__PURE__ */ new WeakSet){return e===void 0||t.has(e)?!1:(t.add(e),e.readOnly===!0||e.allOf?.some(e=>s(e,t))===!0)}const c=/* @__PURE__ */ new Set(/* @__PURE__ */ `$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 l(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 u(e,t=/* @__PURE__ */ new WeakSet){return!t.has(e)&&(t.add(e),e.readOnly===!0||l(e).some(e=>u(e,t)))}function d(e,t,n=/* @__PURE__ */ new Set){if(u(e))return!0;let r=E(t),i=E(e);for(let e of/* @__PURE__ */ new Set([...i.required??[],...Object.keys(i.properties??{})])){let t=y(r.properties,e);if(n.has(e)||s(t))return!0;let a=y(i.properties,e);if(t&&a&&d(a,t))return!0}let a=e=>e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return k(e).some(e=>e.some(e=>d(e,t,n)))||a(i).some(e=>a(r).some(t=>d(e,t)))}function f(e,t){if(s(e))return!0;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=>c.has(e)||e.startsWith(`x-`))&&l(e).every(e=>f(e,t))}function p(e){return f(e,/* @__PURE__ */ new WeakSet)}function m(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 h(e){let t=e.path.at(-1)??e.name,n=i(e.schema.title?.trim()||m(t)),r=e.description?i(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function g(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const _=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function v(e){return e.every(e=>!_.has(e))}function y(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function b(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function x(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 ee(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 S(e){let t=te(e);if(t.length>1){let e=new Set(t.map(S));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 S(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(ee));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&x(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 te(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function ne(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 C(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>o(e,t)))}function w(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>T(e,t))]),r=n[0];return n.length>0&&n.every(e=>o(e,r))?r:void 0}function T(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>T(e,t))]}function re(e,t){return{type:ne(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:C(e.enum,t.enum),const:w(`const`,[e,t]),default:w(`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 E(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=E(s);r=ne(r,e.type),i??=e.title,a??=e.description,o=C(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:re(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:w(`const`,[e]),default:w(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function D(e){return{...e,oneOf:void 0,anyOf:void 0}}function O(e){return(e.allOf??[]).flatMap(e=>[e,...O(e)])}function k(e){return[e,...O(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function ie(e){return Object.keys(E(D(e)).properties??{}).length>0||k(e).some(e=>e.some(ie))}function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j(e){let t=E(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=>A(e))||k(e).some(e=>e.every(j))?!0:e.allOf?.some(j)??!1:A(t.const)}function M(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?i(e.title):void 0})}return n}function ae(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})):M(e)}function N(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=W(r),a=e.title?i(e.title):void 0;n.push(a?`${t} (${a})`:t)}else if(e.pattern&&S(e)===`string`){let t=i(e.pattern),r=e.title?i(e.title):void 0;n.push(r?`${t} (${r})`:t)}else return}return n.length>0?n:void 0}function P(e,t,n,r,i){if(!v(e)||s(t))return;let a=i??S(t);if(a===void 0)return;let o=a===`json`?void 0:ae(t),c=o?.map(({value:e})=>String(e)),l=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t]));return{name:e.map(g).join(`-`),path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
3
+ `)[0]??t.title,choices:c?.length?c:void 0,choiceLabels:Object.keys(l).length>0?l:void 0,schema:t}}function oe(e,t){return e===t?e:[.../* @__PURE__ */ new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function se(e,t){let n=oe(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:F(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:o(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ce(e,t){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=(e,t,n)=>{let a=r.get(e);n?i.has(e)||r.set(e,a===void 0?t:se(a,t)):(i.add(e),r.set(e,t))},c=(e,t,c)=>{for(let l of[e,...O(e)]){let u=l.if,f=l.then?E(l.then):void 0,p=f?.required;if(!u||!p?.length)continue;let m=Object.keys(u),h=u.type===void 0?void 0:Array.isArray(u.type)?u.type:[u.type];if(m.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||h!==void 0&&!h.includes(`object`)||d(u,e))continue;let g=new Set(u.required??[]),_=u.properties??{};if(Object.keys(_).some(e=>!g.has(e)))continue;let b=[],x=!0;for(let e of g){if(!v([...t,e])){x=!1;break}let n=y(_,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){x=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>o(e,n.const))),n.type!==void 0){if(r===void 0){x=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>J(e,t)))}}b.push({path:[...t,e],values:r})}if(x&&b.length!==0)for(let l of p){let u=[...t,l].join(`.`);if(n.has(u)||s(y(e.properties,l))||s(y(f?.properties,l)))continue;let d={predicates:b},p=r.get(u),m=c&&y(e.properties,l)===void 0&&!i.has(u);if(!p||m){let e=y(f?.properties,l),n=e===void 0?void 0:P([...t,l],E(e),!1);n&&(a(u,n,c),p=r.get(u))}!c&&p&&!p.requiredIf?.some(e=>o(e,d))&&(p.requiredIf=[...p.requiredIf??[],d])}}},l=(e,t,i,o=!1)=>{if(s(e))return;let u=E(D(e));if(u.properties){let e=new Set(u.required??[]);for(let[c,d]of Object.entries(u.properties)){let u=[...t,c],f=u.join(`.`);if(!v(u)||n.has(f))continue;let p=E(d);if(s(p))continue;let m=ie(d),h=m&&j(d),g=!o&&e.has(c),_=g&&i===void 0,y=g&&i!==void 0?i:void 0;if(h){l(d,u,g?i:u,o);let e=[...r.values()].some(e=>e.required===_&&F(e.requiredWhen,y)&&e.path.length>u.length&&u.every((t,n)=>e.path[n]===t));if(g&&!e){let e=P(u,d,_,y);e&&a(f,{...e,requiredContainer:!0},o)}continue}let b=P(u,p,_,y,m?`json`:void 0);b&&a(f,b,o)}}for(let n of k(e))for(let e of n)l(e,t,i,!0);for(let n of[e,...O(e)])n.if&&n.then&&!d(n.if,e)&&l(n.then,t,i,!0);c(u,t,o)};return l(e,[]),le([...r.values()],t.commandFlags).sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function le(e,n){let r=t(n),i=new Set(e.map(e=>e.name));return e.flatMap(e=>{if(r(e.name)===void 0)return[e];let t=`input-${e.name}`;return r(t)!==void 0||i.has(t)?[]:(i.add(t),[{...e,name:t}])})}function F(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function ue(e,t){if(e.length===0)return`${a.brand(i(t))}\n (no input fields)`;let n=process.stdout.columns??80,r=e.map(e=>`--${i(e.name)}`),o=Math.min(Math.max(...r.map(e=>e.length))+2,42),s=e.map((e,t)=>{let a=[`[${e.type}]`];e.required?a.push(`[required]`):e.requiredWhen&&a.push(`[required with --${i(e.requiredWhen.map(g).join(`-`))}-*]`),e.requiredIf&&a.push(`[conditionally required]`),e.choices&&a.push(`[choices: ${e.choices.map(t=>{let n=i(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${i(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&a.push(`[must be: ${i(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&a.push(`[default: ${i(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=a.join(` `),c=Math.max(n-o-4,20)-s.length-1,l=e.description===void 0?void 0:i(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=r[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[a.brand(i(t)),...s].join(`
4
+ `)}const de=[`_`,`$0`,`--`,...n.flatMap(e=>[e,b(e)])];function I(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=b(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function fe(e,t,n){return e.filter(r=>{let i=n!==void 0&&R(n,r.path).found;return z(r,e,t,n)&&I(r,t)===void 0&&!i&&!B(r.path,e,t)&&!(r.requiredContainer&&V(r,e,t))})}function L(e,t){let n=e=>R(t,e);return e.filter(e=>pe(e,n)&&!n(e.path).found)}function R(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 pe(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=>o(r.value,e)))}))??!1)}function z(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(B(e.requiredWhen,t,n)||r!==void 0&&R(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=me(e,t,n),s=a.found||r===void 0?a:R(r,e),c=!a.found||a.descriptor===void 0||!F(a.descriptor.path,e)?s.value:G(a.descriptor,s.value,[]);return s.found&&(i===void 0||i.some(e=>o(c,e)))}))??!1)}function me(e,t,n){for(let r of t){let t=I(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 B(e,t,n){return t.some(t=>{let r=I(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 V(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&I(t,n)!==void 0)}function H(e){return e.flatMap(e=>[e.name,b(e.name)])}function U(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function W(e){return i(U(e))}function G(e,t,n){let a=r=>{n.push(`--${i(e.name)} expects ${r} (got '${W(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(U(t)),r=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?r.includes(`integer`)&&!r.includes(`number`)&&!Number.isInteger(n)?a(`an integer`):n:a(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&a(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return a(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:a(`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:a(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return r(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:a(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return r(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?a(`a string`):typeof n==`string`?r(n,e.name,`text`):U(n)}}}function K(e){return Array.from(e).length}function q(e,t,n){let r=i(e.name),{const:a,pattern:s,minLength:c,maxLength:l,minimum:u,maximum:d,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(a!==void 0&&!o(t,a)){n.push(`--${r} must be ${i(JSON.stringify(a)??`undefined`)}`);return}let m=e.schema.enum??M(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>o(t,e)))n.push(`--${r} must be one of: ${m.map(W).join(`, `)}`);else{if(typeof t==`string`){let e=K(t);s!==void 0&&!new RegExp(s).test(t)&&n.push(`--${r} does not match the required format (${i(s)})`),c!==void 0&&e<c&&n.push(`--${r} must be at least ${c} characters`),l!==void 0&&e>l&&n.push(`--${r} must be at most ${l} characters`)}typeof t==`number`&&(u!==void 0&&(f===!0?t<=u:t<u)&&n.push(f===!0?`--${r} must be greater than ${u}`:`--${r} must be at least ${u}`),d!==void 0&&(p===!0?t>=d:t>d)&&n.push(p===!0?`--${r} must be less than ${d}`:`--${r} must be at most ${d}`),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 he(e,t){let n=[],r=G(e,t,n);if(r===void 0||(q(e,r,n),n.length>0))return n[0];let a=Z(e.schema,r);return a.length>0?`--${i(e.name)} ${a[0]?.replace(/^the request body /,``)}`:void 0}function J(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 ge(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=>i(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n,r=[]){if(s(e))return[];let a=[...r,e],c=/* @__PURE__ */ new Set;for(let e of a)for(let[t,n]of Object.entries(E(e).properties??{}))s(n)&&c.add(t);let l=[],u=Y(n),f=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(f.length>0&&!f.some(e=>J(e,t)))return[`${u} must be ${ge(f)}`];if(e.const!==void 0&&!o(t,e.const))return[`${u} must be ${i(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>o(t,e)))return[`${u} must be one of: ${e.enum.map(W).join(`, `)}`];if(e.oneOf?.length){let r=e.oneOf.filter(e=>X(e,t,n,a).length===0).length,i=e.oneOf.some(e=>a.some(t=>d(e,t,c)));if(r===0||r!==1&&!i){let t=N(e);return[t?`${u} must be one of: ${t.join(`, `)}`:`${u} must match exactly one allowed shape`]}}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n,a).length===0)){let t=N(e);return[t?`${u} must be one of: ${t.join(`, `)}`:`${u} must match an allowed shape`]}for(let r of e.allOf??[])l.push(...X(r,t,n,a));if(e.if&&!a.some(t=>d(e.if??{},t,c))&&X(e.if,t,n,a).length===0&&e.then&&l.push(...X(e.then,t,n,a)),typeof t==`string`){let n=K(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&l.push(`${u} does not match the required format (${i(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&l.push(`${u} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&l.push(`${u} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&l.push(e.exclusiveMinimum===!0?`${u} must be greater than ${e.minimum}`:`${u} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&l.push(e.exclusiveMaximum===!0?`${u} must be less than ${e.maximum}`:`${u} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&l.push(`${u} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&l.push(`${u} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&l.push(`${u} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)&&(e.minItems!==void 0&&t.length<e.minItems&&l.push(`${u} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&l.push(`${u} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>o(e,t)))&&l.push(`${u} must contain unique items`),e.items))for(let[r,i]of t.entries()){let t=Array.isArray(e.items)?e.items[r]:e.items;if(t===void 0)continue;let o=a.flatMap(e=>[e,...O(e)].flatMap(e=>{let t=Array.isArray(e.items)?e.items[r]:e.items;return t===void 0?[]:[t]}));l.push(...X(t,i,[...n,String(r)],o))}if(typeof t==`object`&&t&&!Array.isArray(t)){let r=t,i=e.properties??{};for(let t of e.required??[])!c.has(t)&&!Object.hasOwn(r,t)&&l.push(`${Y([...n,t])} is required`);for(let[t,o]of Object.entries(r)){if(c.has(t))continue;let r=Object.hasOwn(i,t)?i[t]:void 0;if(r){let e=a.flatMap(e=>{let n=y(E(e).properties,t);return n===void 0?[]:[n]});l.push(...X(r,o,[...n,t],e))}else e.additionalProperties===!1?l.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&l.push(...X(e.additionalProperties,o,[...n,t]))}let o=Object.keys(r).filter(e=>!c.has(e)).length;e.minProperties!==void 0&&o<e.minProperties&&l.push(`${u} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&o>e.maxProperties&&l.push(`${u} must contain at most ${e.maxProperties} properties`)}return l}function Z(e,t){return[...new Set(X(e,t,[]))]}const _e=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){if(s(e))return{schema:{readOnly:!0},exact:!0};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=>c.has(e)||e.startsWith(`x-`));for(let t of _e){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 ve(e,t){return Z(Q(e).schema,t)}function ye(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=/* @__PURE__ */ new Set([...de,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(g(t))&&r.set(g(t),t);return[...r.values()].sort()}function be(t,n,r={}){let a=[],o=r.baseBody!==void 0,s=r.baseBody===void 0?{}:structuredClone(r.baseBody),c=t.filter(({path:e})=>v(e)),l=[...r.reserved??[],...H(c)];for(let t of c){let r=I(t,n);if(r===void 0){!o&&z(t,c,n)&&!B(t.path,c,n)&&!(t.requiredContainer&&V(t,c,n))&&a.push(`--${i(t.name)} is required`);continue}let l=G(t,r,a);l!==void 0&&(q(t,l,a),o?ye(s,t.path,l):e(s,t.path,l))}if(o)for(let e of L(c,s))I(e,n)===void 0&&a.push(`--${i(e.name)} is required`);for(let e of $(n,l))a.push(`Unknown flag --${i(e)}`);return{body:s,errors:a}}export{L as a,h as c,he as d,Z as f,fe as i,ce as l,H as n,d as o,ve as p,p as r,ue as s,be as t,$ as u};
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import{i as e,n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./path-DRw6Y-nd.mjs";import{t as r}from"./dry-run-qsnRlRk6.mjs";import{n as i,t as a}from"./input-validation-D7z60HJH.mjs";import{a as o,t as s}from"./context-BGm5_wTT.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./output-hFMAotFl.mjs";import{t as u}from"./progress-DE_G09u2.mjs";import{t as d}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import"./api-Dnt6lRJG.mjs";import{n as f}from"./prompt-D274Im1O.mjs";function p(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const ee={command:`create`,describe:`Create SCIM Group`,builder:p,handler:async n=>d({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Created`})}else if(n.body!==void 0){let t=d,n=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(n,{successLabel:`Created`})}})};var m={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/scim/v2/Groups/${e.group_id}`,response:!1};function h(e){return e.usage(`$0 scim groups delete <group-id>
3
+
4
+ Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async e=>d({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();if(e.accountId=i,!await f({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let a=await u(`Deleting`,async()=>n.send(m,{account_id:i,group_id:e[`group-id`]}));l(a,{successLabel:`Deleted`})})};function _(e){return e.usage("$0 scim groups edit <group-id>\n\nPartially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:`Patch SCIM Group`,builder:_,handler:async n=>d({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})};var y={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Groups/${e.group_id}`};function b(e){return e.usage(`$0 scim groups get <group-id>
5
+
6
+ Retrieves a single SCIM Group resource by group ID.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <group-id>`,describe:`Get SCIM Group`,builder:b,handler:async e=>d({command:`scim groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(y,{account_id:i,group_id:e[`group-id`]}));l(a,{successLabel:`Loaded`})})};var S={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Groups`,query:[`startIndex`,`count`,`filter`]};function C(e){return e.usage("$0 scim groups list\n\nLists SCIM Group resources for the account. Returns both system groups (backed by Cloudflare permission groups, prefixed `cloudflare-v1-`) and custom user groups. Supports filtering by `displayName` using SCIM filter syntax.").option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `displayName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`List SCIM Groups`,builder:C,handler:async e=>d({command:`scim groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={startIndex:e[`start-index`],count:e.count,filter:e.filter};if(e.dryRun){let e=await o();r({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(S,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};function T(e){return e.usage("$0 scim groups update <group-id>\n\nReplaces the mutable attributes of a SCIM Group (RFC 7644 Section 3.5.1), including its complete member set. Omitting `externalId` clears it, and omitting `members` replaces the member set with an empty list. For system groups (prefixed `cloudflare-v1-`), only the member set is replaced.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const E={command:`update <group-id>`,describe:`Replace SCIM Group`,builder:T,handler:async n=>d({command:`scim groups update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${n[`group-id`]==null?`<group-id>`:encodeURIComponent(String(n[`group-id`]))}`,pathParams:{"group-id":String(n[`group-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Groups/${encodeURIComponent(String(n[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})},D={command:`groups`,describe:`Groups operations`,builder:e=>e.command(ee).command(g).command(v).command(x).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var O={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/ResourceTypes/${e.resource_type_id}`};function k(e){return e.usage("$0 scim resource-types get <resource-type-id>\n\nReturns a single SCIM resource type by ID (RFC 7643 Section 6). Valid IDs are `User` and `Group`.").positional(`resource-type-id`,{type:`string`,description:`The resource type identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <resource-type-id>`,describe:`Get SCIM Resource Type`,builder:k,handler:async e=>d({command:`scim resource-types get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/ResourceTypes/${e[`resource-type-id`]==null?`<resource-type-id>`:encodeURIComponent(String(e[`resource-type-id`]))}`,pathParams:{"resource-type-id":String(e[`resource-type-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(O,{account_id:i,resource_type_id:e[`resource-type-id`]}));l(a,{successLabel:`Loaded`})})};var j={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/ResourceTypes`};function M(e){return e.usage(`$0 scim resource-types list
7
+
8
+ Returns the list of SCIM resource types supported by the Cloudflare SCIM service (RFC 7643 Section 6, RFC 7644 Section 4). Clients use this to discover available resource categories (e.g. Users, Groups) and their associated schemas. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List SCIM Resource Types`,builder:M,handler:async e=>d({command:`scim resource-types list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(j,{account_id:i}));l(a,{successLabel:`Loaded`})})},P={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(A).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Schemas/${e.schema_id}`};function I(e){return e.usage("$0 scim schemas get <schema-id>\n\nReturns a single SCIM schema definition by schema URI ID (RFC 7643 Section 7). Valid IDs are `urn:ietf:params:scim:schemas:core:2.0:User` and `urn:ietf:params:scim:schemas:core:2.0:Group`.").positional(`schema-id`,{type:`string`,description:`The schema URI identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <schema-id>`,describe:`Get SCIM Schema`,builder:I,handler:async e=>d({command:`scim schemas get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"schema-id":String(e[`schema-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(F,{account_id:i,schema_id:e[`schema-id`]}));l(a,{successLabel:`Loaded`})})};var te={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Schemas`};function R(e){return e.usage(`$0 scim schemas list
9
+
10
+ Returns the list of SCIM schemas supported by the Cloudflare SCIM service (RFC 7643 Section 7, RFC 7644 Section 4). Clients use this to introspect the attributes of each resource type. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List SCIM Schemas`,builder:R,handler:async e=>d({command:`scim schemas list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(te,{account_id:i}));l(a,{successLabel:`Loaded`})})},B={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var V={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/ServiceProviderConfig`};function H(e){return e.usage(`$0 scim service-provider-config get
11
+
12
+ Returns the SCIM 2.0 Service Provider configuration (RFC 7643 Section 5). IdPs use this endpoint to auto-configure their SCIM integration with Cloudflare, discovering which optional features (patch, bulk, filter, etc.) are supported.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Get SCIM Service Provider Config`,builder:H,handler:async e=>d({command:`scim service-provider-config get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await o();r({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(V,{account_id:i}));l(a,{successLabel:`Loaded`})})},W={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.usage("$0 scim users create\n\nProvisions a new account member via SCIM. The `userName` field must be a valid email address and must match the primary email in `emails`. The account must be an Enterprise account with SCIM entitlements enabled.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const K={command:`create`,describe:`Create SCIM User`,builder:G,handler:async n=>d({command:`scim users create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Users`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Created`})}else if(n.body!==void 0){let t=d,n=await u(`Creating`,async()=>e(f,`POST`,`/accounts/${p}/scim/v2/Users`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(n,{successLabel:`Created`})}})};var q={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/scim/v2/Users/${e.user_id}`,response:!1};function J(e){return e.usage(`$0 scim users delete <user-id>
13
+
14
+ Deprovisions a SCIM User by removing their membership from this account (RFC 7644 Section 3.6). This does not delete the global Cloudflare user.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <user-id>`,describe:`Delete SCIM User`,builder:J,handler:async e=>d({command:`scim users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();if(e.accountId=i,!await f({force:!!e.force,message:`Are you sure you want to remove this user from the account?`}))return;let a=await u(`Deleting`,async()=>n.send(q,{account_id:i,user_id:e[`user-id`]}));l(a,{successLabel:`Deleted`})})};function X(e){return e.usage('$0 scim users edit <user-id>\n\nPartially updates a SCIM User via PATCH operations (RFC 7644 Section 3.5.2). Supports updating `userName`, `name.givenName`, `name.familyName`, and `active`. Setting `active: false` deprovisions the user (removes them from the account). For IdP compatibility, `emails[type eq "work"].value` is also accepted as an alias for `userName`.').positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Z={command:`edit <user-id>`,describe:`Patch SCIM User`,builder:X,handler:async n=>d({command:`scim users edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PATCH`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})};var Q={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Users/${e.user_id}`};function ne(e){return e.usage(`$0 scim users get <user-id>
15
+
16
+ Retrieves a single account member as a SCIM User resource by user tag.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <user-id>`,describe:`Get SCIM User`,builder:ne,handler:async e=>d({command:`scim users get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await o();r({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await t(e),i=e.local?c:await s();e.accountId=i;let a=await u(`Loading`,async()=>n.send(Q,{account_id:i,user_id:e[`user-id`]}));l(a,{successLabel:`Loaded`})})};var ie={method:`GET`,path:e=>n`/accounts/${e.account_id}/scim/v2/Users`,query:[`startIndex`,`count`,`filter`]};function ae(e){return e.usage('$0 scim users list\n\nLists account members as SCIM User resources. Supports optional filtering by `userName` (email) using the SCIM filter syntax (e.g. `userName eq "user@example.com"`). Pagination is controlled via `startIndex` and `count` query parameters per RFC 7644 Section 3.4.2.4.').option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `userName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List SCIM Users`,builder:ae,handler:async e=>d({command:`scim users list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={startIndex:e[`start-index`],count:e.count,filter:e.filter};if(e.dryRun){let e=await o();r({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users`,pathParams:{},query:n,bodyKind:`none`});return}let i=await t(e),a=e.local?c:await s();e.accountId=a;let d=await u(`Loading`,async()=>i.send(ie,{account_id:a,...n}));l(d,{successLabel:`Loaded`})})};function $(e){return e.usage("$0 scim users update <user-id>\n\nReplaces a SCIM User resource (RFC 7644 Section 3.5.1). Fully replaces the mutable attributes of the user. Supports updating `userName`, `name`, `emails`, and `active`.").positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const se={command:`update <user-id>`,describe:`Replace SCIM User`,builder:$,handler:async n=>d({command:`scim users update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){let e=await o();r({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let d=n.file===void 0?i(n.body,`body`,`binary`):void 0,f=await t(n),p=n.local?c:await s();if(n.accountId=p,n.file!==void 0){let t=a(n.file),r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=d,r=await u(`Updating`,async()=>e(f,`PUT`,`/accounts/${p}/scim/v2/Users/${encodeURIComponent(String(n[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));l(r,{successLabel:`Updated`})}})},ce={command:`users`,describe:`Users operations`,builder:e=>e.command(K).command(Y).command(Z).command(re).command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(D).command(P).command(B).command(W).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};