cf 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/dist/_meta/agent-context.json +63 -62
  2. package/dist/_meta/commands.json +12365 -9690
  3. package/dist/_meta/schemas.json +19206 -15404
  4. package/dist/abuse-reports-dMIfUJ8v.mjs +8 -0
  5. package/dist/accounts-Kx1epdA1.mjs +22 -0
  6. package/dist/acm-Utu252kC.mjs +3 -0
  7. package/dist/addressing-CBq7Z7Vq.mjs +12 -0
  8. package/dist/{agent-context-D26woB9J.mjs → agent-context-BGTU299M.mjs} +1 -1
  9. package/dist/ai-DOOKLPkG.mjs +2 -0
  10. package/dist/ai-gateway-Cj1T3avF.mjs +8 -0
  11. package/dist/ai-search-CQF_Sn7d.mjs +7 -0
  12. package/dist/ai_gateway-C3fH22C0.mjs +4 -0
  13. package/dist/alerting-CqmEIaKn.mjs +6 -0
  14. package/dist/analytics-Dv-X8x7D.mjs +20 -0
  15. package/dist/analytics_engine-DdXVR8z2.mjs +2 -0
  16. package/dist/api-gateway-CNv0IHTU.mjs +33 -0
  17. package/dist/argo-CX_A4kcn.mjs +2 -0
  18. package/dist/audit-logs-BfBf3oo-.mjs +2 -0
  19. package/dist/auth-SyWhMmPu.mjs +6 -0
  20. package/dist/auth-ffdf9yR0.mjs +135 -0
  21. package/dist/autorag-BuGhGTeZ.mjs +2 -0
  22. package/dist/billing-PoG81XaQ.mjs +2 -0
  23. package/dist/body-parser-DKa8Ipg1.mjs +2 -0
  24. package/dist/bot-management-CFvtVx62.mjs +5 -0
  25. package/dist/botnet-feed-B-M4Yu0W.mjs +3 -0
  26. package/dist/brand-protection-D05Eg-_6.mjs +3 -0
  27. package/dist/browser-rendering-xu8F_Rrv.mjs +4 -0
  28. package/dist/{build-5jmmOZhm.mjs → build-DYkGW4dh.mjs} +1 -1
  29. package/dist/cache-DsoW6Xwv.mjs +5 -0
  30. package/dist/calls-CZbO7TyR.mjs +4 -0
  31. package/dist/certificate-authorities-D2yr7_3t.mjs +2 -0
  32. package/dist/cli-types-CRIDdDw3.mjs +2 -0
  33. package/dist/client-certificates-MJcDsTId.mjs +3 -0
  34. package/dist/cloud-connector-DWOrN2eM.mjs +2 -0
  35. package/dist/cloudforce-one-2Bhz8YdW.mjs +21 -0
  36. package/dist/{completions-BKrxcfhN.mjs → completions-BwRpZQVn.mjs} +1 -1
  37. package/dist/connectivity-BX8C7tvK.mjs +3 -0
  38. package/dist/content-scanning-r6uzMO1r.mjs +4 -0
  39. package/dist/context-DGlHRGWM.mjs +2 -0
  40. package/dist/custom-certificates-aAiEguR7.mjs +5 -0
  41. package/dist/custom-hostnames-AG5yBHIi.mjs +5 -0
  42. package/dist/custom-nameservers-D1DtlRue.mjs +3 -0
  43. package/dist/custom-pages-DQCi2plU.mjs +4 -0
  44. package/dist/d1-DbnYhw45.mjs +4 -0
  45. package/dist/data-security-D_EtYBfo.mjs +6 -0
  46. package/dist/dcv-delegation-CHspSzTI.mjs +2 -0
  47. package/dist/{deploy-DbkiIzUr.mjs → deploy-CQial3kN.mjs} +1 -1
  48. package/dist/{dev-C6iSuQZm.mjs → dev-B38LfCTl.mjs} +1 -1
  49. package/dist/diagnostics-BJQGjVJn.mjs +3 -0
  50. package/dist/dispatch-namespaces-DmHvoBOg.mjs +7 -0
  51. package/dist/{dist-CnSubA1Z.mjs → dist-AIcZFk0U.mjs} +7 -7
  52. package/dist/dns-VMhQSr5n.mjs +29 -0
  53. package/dist/dns-firewall-B4DVXFBQ.mjs +57 -0
  54. package/dist/durable-objects-CTboySEo.mjs +2 -0
  55. package/dist/email-routing-tIR2SFu-.mjs +10 -0
  56. package/dist/email-security-Ca1id3rZ.mjs +8 -0
  57. package/dist/email-sending-DwWKc5jC.mjs +3 -0
  58. package/dist/filters-A4dg_a68.mjs +4 -0
  59. package/dist/firewall-DWPQgYd9.mjs +11 -0
  60. package/dist/fraud-BMkSsJGU.mjs +20 -0
  61. package/dist/google-tag-gateway-BGD49nRC.mjs +2 -0
  62. package/dist/healthchecks-CtIfrFql.mjs +4 -0
  63. package/dist/hostnames-BiomxukN.mjs +3 -0
  64. package/dist/hyperdrive-Da104VaQ.mjs +18 -0
  65. package/dist/iam-BIGKo0WW.mjs +6 -0
  66. package/dist/images-BO8FbDAa.mjs +5 -0
  67. package/dist/index.mjs +1 -1
  68. package/dist/intel-CY6_79v8.mjs +3 -0
  69. package/dist/{ips-B8fwxKZD.mjs → ips-K4bzaGqd.mjs} +1 -1
  70. package/dist/keyless-certificates-CZC-L8gM.mjs +3 -0
  71. package/dist/kv-8o27w_pY.mjs +5 -0
  72. package/dist/leaked-credential-checks-qLzRyu85.mjs +3 -0
  73. package/dist/load-balancers-DtG8nj25.mjs +6 -0
  74. package/dist/logpush-4L0njy1d.mjs +4 -0
  75. package/dist/logs-B_Yp95hv.mjs +3 -0
  76. package/dist/magic-cloud-networking-CSOM3EM-.mjs +5 -0
  77. package/dist/magic-network-monitoring-BnwvM4-I.mjs +4 -0
  78. package/dist/magic-transit-CXDyvhxq.mjs +90 -0
  79. package/dist/managed-transforms-D15yVbZx.mjs +3 -0
  80. package/dist/mtls-certificates-D8k0AXWK.mjs +3 -0
  81. package/dist/network-interconnects-rrr7red3.mjs +36 -0
  82. package/dist/observability-DWvpqnQJ.mjs +4 -0
  83. package/dist/organizations-T77D50Sq.mjs +41 -0
  84. package/dist/origin-ca-certificates-DXIvD8H5.mjs +3 -0
  85. package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +2 -0
  86. package/dist/origin-tls-client-auth-CaVW1Ztp.mjs +4 -0
  87. package/dist/output-BJFNwj7b.mjs +2 -0
  88. package/dist/page-rules-CjZPTMQX.mjs +18 -0
  89. package/dist/page-shield-D5RRNJCY.mjs +37 -0
  90. package/dist/pages-CWJtJnL0.mjs +11 -0
  91. package/dist/pipelines-B0L_7j9e.mjs +6 -0
  92. package/dist/{progress-CjcQ6ato.mjs → progress-CrCGTq7N.mjs} +1 -1
  93. package/dist/queues-CN6DPhRR.mjs +6 -0
  94. package/dist/r2-DQIcyRtA.mjs +21 -0
  95. package/dist/r2-data-catalog-Bbo93TJx.mjs +14 -0
  96. package/dist/radar-Bxb0WX8V.mjs +2 -0
  97. package/dist/rate-limits-DcrQV6Ar.mjs +5 -0
  98. package/dist/raw-fetch-Dlccg0Tr.mjs +2 -0
  99. package/dist/realtime-kit-CaquuVOE.mjs +18 -0
  100. package/dist/registrar-Ko-xZemf.mjs +46 -0
  101. package/dist/request-tracers-DOW_reTJ.mjs +2 -0
  102. package/dist/{resolve-BuJRWSk0.mjs → resolve-4-OSeHlK.mjs} +1 -1
  103. package/dist/resource-sharing-D7TX0JV0.mjs +5 -0
  104. package/dist/resource-tagging-C3qtLzCz.mjs +16 -0
  105. package/dist/rules-BXRADHL5.mjs +4 -0
  106. package/dist/rulesets-CBgpeSvJ.mjs +8 -0
  107. package/dist/rum-BjPptTUP.mjs +4 -0
  108. package/dist/{schema-CHBfkARI.mjs → schema-D16TgWBg.mjs} +1 -1
  109. package/dist/schema-validation-Dgv_opM3.mjs +24 -0
  110. package/dist/scim-DdSEr4kZ.mjs +3 -0
  111. package/dist/secrets-store-7BfyvJLb.mjs +25 -0
  112. package/dist/security-center-DAy6AKtT.mjs +2 -0
  113. package/dist/security-txt-xAMb7K6Y.mjs +3 -0
  114. package/dist/session-COHHdS7A.mjs +5 -0
  115. package/dist/{shared-DEzmTsEC.mjs → shared-AGtpXwwL.mjs} +1 -1
  116. package/dist/smart-shield-TeWZFnH2.mjs +3 -0
  117. package/dist/snippets-CCSsCXVs.mjs +4 -0
  118. package/dist/{spawn-13QQ0IwO.mjs → spawn-DcppKGI5.mjs} +1 -1
  119. package/dist/spectrum-CTTZID8u.mjs +63 -0
  120. package/dist/speed-CuzTE0AL.mjs +4 -0
  121. package/dist/{src-B9cKsgsg.mjs → src-BW6vfAwE.mjs} +10 -10
  122. package/dist/ssl-BWA2LdwC.mjs +15 -0
  123. package/dist/stream-GFsIZ-pP.mjs +14 -0
  124. package/dist/tenants-Bd7NGQ_m.mjs +2 -0
  125. package/dist/token-validation-DAgtFOvs.mjs +10 -0
  126. package/dist/{tools-B7QiNu-d.mjs → tools-DXQmfFuE.mjs} +1 -1
  127. package/dist/turnstile-cfdaO4ca.mjs +23 -0
  128. package/dist/{ui-BXjU1dX1.mjs → ui-D4KtlMh9.mjs} +1 -1
  129. package/dist/url-normalization-B5RN4nLD.mjs +3 -0
  130. package/dist/url-scanner-BrZ1L9OC.mjs +2 -0
  131. package/dist/user-CAo-yCJA.mjs +10 -0
  132. package/dist/vectorize-C7_oQlaI.mjs +4 -0
  133. package/dist/{versions-DzyrlUAi.mjs → versions-CUwWJWmy.mjs} +1 -1
  134. package/dist/waiting-rooms-Dln5ICg5.mjs +11 -0
  135. package/dist/web3-HQJRm38W.mjs +4 -0
  136. package/dist/workers-Dg7ddG2Q.mjs +18 -0
  137. package/dist/workers-builds-AVfx8IyL.mjs +7 -0
  138. package/dist/workflows-VquuSh2J.mjs +4 -0
  139. package/dist/zaraz-xYSWIV4P.mjs +2 -0
  140. package/dist/zero-trust-CP96wnSh.mjs +118 -0
  141. package/dist/zones-BSgmZ9WC.mjs +21 -0
  142. package/package.json +4 -3
  143. package/dist/abuse-reports-KtfZhi6j.mjs +0 -8
  144. package/dist/accounts-BopMfODC.mjs +0 -21
  145. package/dist/acm-BT4vlnEJ.mjs +0 -3
  146. package/dist/addressing-B3uFxHst.mjs +0 -13
  147. package/dist/ai-DWHqwMap.mjs +0 -2
  148. package/dist/ai-gateway-CbKEO-3o.mjs +0 -8
  149. package/dist/ai-search-VnOQ5n--.mjs +0 -7
  150. package/dist/alerting-BmmgIlIO.mjs +0 -6
  151. package/dist/analytics-isY03taL.mjs +0 -20
  152. package/dist/api-gateway-DXurEbA-.mjs +0 -33
  153. package/dist/argo-B02BL_hp.mjs +0 -2
  154. package/dist/audit-logs-DcgR9xUc.mjs +0 -2
  155. package/dist/auth-CQcAgnOy.mjs +0 -135
  156. package/dist/auth-DenWm_X0.mjs +0 -6
  157. package/dist/autorag-CmrwnGVj.mjs +0 -2
  158. package/dist/billing-CaW1ZAB1.mjs +0 -2
  159. package/dist/body-parser-Br-BoYk-.mjs +0 -2
  160. package/dist/bot-management-CeBsFx68.mjs +0 -5
  161. package/dist/botnet-feed-B396vQeQ.mjs +0 -3
  162. package/dist/brand-protection-D4V1v5Kl.mjs +0 -3
  163. package/dist/browser-rendering-GF7rNtKI.mjs +0 -4
  164. package/dist/builds-C_ySULja.mjs +0 -2
  165. package/dist/cache-DmXizSMi.mjs +0 -5
  166. package/dist/calls-x4KQpTB4.mjs +0 -4
  167. package/dist/certificate-authorities-hC0SG-Ga.mjs +0 -2
  168. package/dist/client-certificates-BGVsDyeJ.mjs +0 -3
  169. package/dist/cloud-connector-BClQpEzI.mjs +0 -2
  170. package/dist/cloudforce-one-BfhFrO6M.mjs +0 -21
  171. package/dist/connectivity-G0NP6LtW.mjs +0 -3
  172. package/dist/content-scanning-DEtPJ7aF.mjs +0 -4
  173. package/dist/context-CC0Rhkhy.mjs +0 -2
  174. package/dist/custom-certificates-rJXFpUWu.mjs +0 -5
  175. package/dist/custom-hostnames-Be5mgLeF.mjs +0 -5
  176. package/dist/custom-nameservers-CoFdy6hD.mjs +0 -3
  177. package/dist/custom-pages-D-oErw57.mjs +0 -4
  178. package/dist/d1-C95ckPKI.mjs +0 -3
  179. package/dist/dcv-delegation-CWSkbGuc.mjs +0 -2
  180. package/dist/diagnostics-DEEhPnXj.mjs +0 -3
  181. package/dist/dispatch-namespaces-BzXeV7PH.mjs +0 -7
  182. package/dist/dns-firewall-BQXD_NxG.mjs +0 -57
  183. package/dist/dns-qW-3TZOT.mjs +0 -29
  184. package/dist/durable-objects-CgWFYEJJ.mjs +0 -2
  185. package/dist/email-routing-tdNJaCpJ.mjs +0 -10
  186. package/dist/email-security-DTVHNr2h.mjs +0 -60
  187. package/dist/email-sending-DsFTvE31.mjs +0 -3
  188. package/dist/filters-DO1Is_tI.mjs +0 -4
  189. package/dist/firewall-DbUhVTCg.mjs +0 -11
  190. package/dist/fraud-Bzr4njYb.mjs +0 -8
  191. package/dist/google-tag-gateway-BQxkA90M.mjs +0 -2
  192. package/dist/healthchecks-BBAs-lS_.mjs +0 -4
  193. package/dist/hostnames-Dz9PEUKS.mjs +0 -3
  194. package/dist/hyperdrive-B1iUJddG.mjs +0 -18
  195. package/dist/iam-CJM8gHpG.mjs +0 -6
  196. package/dist/images-DEoBmtFS.mjs +0 -5
  197. package/dist/intel-BM6xkZ0C.mjs +0 -3
  198. package/dist/keyless-certificates-DffYnd4b.mjs +0 -3
  199. package/dist/kv-BTceLtWZ.mjs +0 -5
  200. package/dist/leaked-credential-checks-CALfvoCo.mjs +0 -3
  201. package/dist/load-balancers-C1Ho1gCF.mjs +0 -6
  202. package/dist/logpush-CSYhgevA.mjs +0 -4
  203. package/dist/logs-DlIwmMpt.mjs +0 -3
  204. package/dist/magic-cloud-networking-Czu0pZ0a.mjs +0 -5
  205. package/dist/magic-network-monitoring-d7GJE5Yt.mjs +0 -4
  206. package/dist/magic-transit-qQmA-981.mjs +0 -89
  207. package/dist/managed-transforms-Dd6AnbWE.mjs +0 -3
  208. package/dist/mtls-certificates-C0rlCRGs.mjs +0 -3
  209. package/dist/network-interconnects-CxG2deY0.mjs +0 -36
  210. package/dist/organizations-DyEAiGiR.mjs +0 -41
  211. package/dist/origin-ca-certificates-S8RcoMF6.mjs +0 -3
  212. package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +0 -2
  213. package/dist/origin-tls-client-auth-BlxMmQrE.mjs +0 -5
  214. package/dist/output-D7_yAFVR.mjs +0 -2
  215. package/dist/page-rules-DP-w6TAm.mjs +0 -18
  216. package/dist/page-shield-Bf7kFp8c.mjs +0 -37
  217. package/dist/pages-D0Y_XRqW.mjs +0 -10
  218. package/dist/pipelines-C-SPESAk.mjs +0 -6
  219. package/dist/queues-wv6CZsi8.mjs +0 -6
  220. package/dist/r2-DuXjp9n5.mjs +0 -21
  221. package/dist/r2-data-catalog-DQCMrmNO.mjs +0 -14
  222. package/dist/radar-BW_ZHP8X.mjs +0 -2
  223. package/dist/rate-limits-DLTkIvwr.mjs +0 -5
  224. package/dist/raw-fetch-hRv-6P3D.mjs +0 -2
  225. package/dist/realtime-kit-Ch7Vg3vj.mjs +0 -6
  226. package/dist/registrar-DIIv6fWd.mjs +0 -46
  227. package/dist/request-tracers-DMej0Drs.mjs +0 -2
  228. package/dist/resource-sharing-CYJ7cMWq.mjs +0 -5
  229. package/dist/resource-tagging-Dnz65MgH.mjs +0 -16
  230. package/dist/rules-DLJpOYbC.mjs +0 -4
  231. package/dist/rulesets-D9nqEJT5.mjs +0 -8
  232. package/dist/rum-DBVmdPkp.mjs +0 -4
  233. package/dist/schema-validation-MCd3xdtX.mjs +0 -4
  234. package/dist/scim-DZA3VXog.mjs +0 -3
  235. package/dist/scm-CilfPOue.mjs +0 -2
  236. package/dist/secrets-store-BrvcZSOM.mjs +0 -21
  237. package/dist/security-center-BU6f3Cm1.mjs +0 -2
  238. package/dist/security-txt-BPIbP3dG.mjs +0 -3
  239. package/dist/session-H7IV2BrM.mjs +0 -2
  240. package/dist/smart-shield-e8XFBkiF.mjs +0 -3
  241. package/dist/snippets-B4M3MMb8.mjs +0 -4
  242. package/dist/spectrum-B0adfSRI.mjs +0 -59
  243. package/dist/speed-BVcUtkAz.mjs +0 -4
  244. package/dist/ssl-BAa91gsc.mjs +0 -15
  245. package/dist/stream-D53sxKb3.mjs +0 -14
  246. package/dist/tenants-bH5pt3dJ.mjs +0 -2
  247. package/dist/token-validation-M61Vx_Tw.mjs +0 -4
  248. package/dist/turnstile-wAU0Gc2Z.mjs +0 -23
  249. package/dist/url-normalization-DZrWDgB5.mjs +0 -3
  250. package/dist/url-scanner-Zo49edNp.mjs +0 -2
  251. package/dist/user-DbXlVReB.mjs +0 -10
  252. package/dist/vectorize-CUnTM0DT.mjs +0 -4
  253. package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
  254. package/dist/waiting-rooms-BZW0X69-.mjs +0 -11
  255. package/dist/web3-DueyOQtx.mjs +0 -4
  256. package/dist/workers-builds-BM_aoeUR.mjs +0 -7
  257. package/dist/workers-nV_vBCfV.mjs +0 -16
  258. package/dist/workflows-CQITmo-s.mjs +0 -4
  259. package/dist/zaraz-DIbpF5Op.mjs +0 -2
  260. package/dist/zero-trust-CKp8j512.mjs +0 -119
  261. package/dist/zones-BZ5tZDbH.mjs +0 -28
  262. /package/dist/{metadata-DGdCpUxn.mjs → metadata-5VwHPW6C.mjs} +0 -0
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,b as t,h as n,t as r,x as i}from"./auth-CQcAgnOy.mjs";import{t as a}from"./output-D7_yAFVR.mjs";import{n as o,t as s}from"./progress-CjcQ6ato.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Creates a ruleset at the account level.`,builder:u,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets`,pathParams:{},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),u=e.local?l:await n(t);if(e.accountId=u,e.body){let n=c(e.body,`body`,`binary`);a(await s(`Creating`,async()=>t.post(`/accounts/${u}/rulesets`,{body:n,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>t.rulesets.accountRulesets.create(u)),{successLabel:`Created`})}};function d(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <ruleset-id>`,describe:`Deletes all versions of an existing account ruleset.`,builder:d,handler:async t=>{if(t.dryRun){o({command:`cf rulesets account-rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`none`});return}let c=await r(t),u=t.local?l:await n(c);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>c.rulesets.accountRulesets.delete(t[`ruleset-id`],u)),{successLabel:`Deleted`})}};function p(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <ruleset-id>`,describe:`Fetches the latest version of an account ruleset.`,builder:p,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.get(e[`ruleset-id`],c)),{successLabel:`Loaded`})}};function h(e){return e.option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`string`,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 g={command:`list`,describe:`Fetches all rulesets at the account level.`,builder:h,handler:async e=>{let t={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf rulesets account-rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets`,pathParams:{},query:t,bodyKind:`none`});return}let c=await r(e),u=e.local?l:await n(c);e.accountId=u,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.list(u,t)),{successLabel:`Loaded`})}};function _(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <ruleset-phase>`,describe:`Fetches the latest version of the account entry point ruleset for a given phase.`,builder:_,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint`,pathParams:{"ruleset-phase":String(e[`ruleset-phase`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.phases.get(e[`ruleset-phase`],c)),{successLabel:`Loaded`})}};function y(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update <ruleset-phase>`,describe:`Updates an account entry point ruleset, creating a new version.`,builder:y,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint`,pathParams:{"ruleset-phase":String(e[`ruleset-phase`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),u=e.local?l:await n(t);if(e.accountId=u,e.body){let n=c(e.body,`body`,`binary`);a(await s(`Updating`,async()=>t.put(`/accounts/${u}/rulesets/phases/${encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint`,{body:n,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>t.rulesets.accountRulesets.phases.update(e[`ruleset-phase`],u)),{successLabel:`Updated`})}};function x(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <ruleset-version>`,describe:`Fetches a specific version of an account entry point ruleset.`,builder:x,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"ruleset-version":String(e[`ruleset-version`]??``),"ruleset-phase":String(e[`ruleset-phase`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.phases.versions.get(e[`ruleset-version`],e[`ruleset-phase`],c)),{successLabel:`Loaded`})}};function C(e){return e.option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Fetches the versions of an account entry point ruleset.`,builder:C,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"ruleset-phase":String(e[`ruleset-phase`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.phases.versions.list(e[`ruleset-phase`],c)),{successLabel:`Loaded`})}},T={command:`versions`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`phases`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(v).command(b).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create <ruleset-id>`,describe:`Adds a new rule to an account ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`,builder:D,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),u=e.local?l:await n(t);if(e.accountId=u,e.body){let n=c(e.body,`body`,`binary`);a(await s(`Creating`,async()=>t.post(`/accounts/${u}/rulesets/${encodeURIComponent(String(e[`ruleset-id`]))}/rules`,{body:n,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>t.rulesets.accountRulesets.rules.create(e[`ruleset-id`],u)),{successLabel:`Created`})}};function k(e){return e.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(`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 A={command:`delete <rule-id>`,describe:`Deletes an existing rule from an account ruleset.`,builder:k,handler:async t=>{if(t.dryRun){o({command:`cf rulesets account-rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``),"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`none`});return}let c=await r(t),u=t.local?l:await n(c);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>c.rulesets.accountRulesets.rules.delete(t[`rule-id`],t[`ruleset-id`],u)),{successLabel:`Deleted`})}};function j(e){return e.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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update <rule-id>`,describe:`Updates an existing rule in an account ruleset.`,builder:j,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/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:{"rule-id":String(e[`rule-id`]??``),"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),u=e.local?l:await n(t);if(e.accountId=u,e.body){let n=c(e.body,`body`,`binary`);a(await s(`Updating`,async()=>t.patch(`/accounts/${u}/rulesets/${encodeURIComponent(String(e[`ruleset-id`]))}/rules/${encodeURIComponent(String(e[`rule-id`]))}`,{body:n,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>t.rulesets.accountRulesets.rules.update(e[`rule-id`],e[`ruleset-id`],u)),{successLabel:`Updated`})}},N={command:`rules`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update <ruleset-id>`,describe:`Updates an account ruleset, creating a new version.`,builder:P,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),u=e.local?l:await n(t);if(e.accountId=u,e.body){let n=c(e.body,`body`,`binary`);a(await s(`Updating`,async()=>t.put(`/accounts/${u}/rulesets/${encodeURIComponent(String(e[`ruleset-id`]))}`,{body:n,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>t.rulesets.accountRulesets.update(e[`ruleset-id`],u)),{successLabel:`Updated`})}};function I(e){return e.positional(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`tag <rule-tag>`,describe:`Fetches the rules of a managed account ruleset version for a given tag.`,builder:I,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets versions by-tag tag`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}/by_tag/${e[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(e[`rule-tag`]))}`,pathParams:{"rule-tag":String(e[`rule-tag`]??``),"ruleset-version":String(e[`ruleset-version`]??``),"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.versions.byTag.tag(e[`rule-tag`],e[`ruleset-version`],e[`ruleset-id`],c)),{successLabel:`Loaded`})}},R={command:`by-tag`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`delete <ruleset-version>`,describe:`Deletes an existing version of an account ruleset.`,builder:z,handler:async t=>{if(t.dryRun){o({command:`cf rulesets account-rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/versions/${t[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(t[`ruleset-version`]))}`,pathParams:{"ruleset-version":String(t[`ruleset-version`]??``),"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`none`});return}let c=await r(t),u=t.local?l:await n(c);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}a(await s(`Deleting`,async()=>c.rulesets.accountRulesets.versions.delete(t[`ruleset-version`],t[`ruleset-id`],u)),{successLabel:`Deleted`})}};function V(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <ruleset-version>`,describe:`Fetches a specific version of an account ruleset.`,builder:V,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"ruleset-version":String(e[`ruleset-version`]??``),"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.versions.get(e[`ruleset-version`],e[`ruleset-id`],c)),{successLabel:`Loaded`})}};function U(e){return e.option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Fetches the versions of an account ruleset.`,builder:U,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/versions`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`none`});return}let t=await r(e),c=e.local?l:await n(t);e.accountId=c,a(await s(`Loading`,async()=>t.rulesets.accountRulesets.versions.list(e[`ruleset-id`],c)),{successLabel:`Loaded`})}};function G(e){return e.positional(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`tag <rule-tag>`,describe:`Fetches the rules of a managed zone ruleset version for a given tag.`,builder:G,handler:async e=>{if(e.dryRun){o({command:`cf rulesets account-rulesets versions zone-by-tag tag`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}/by_tag/${e[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(e[`rule-tag`]))}`,pathParams:{"rule-tag":String(e[`rule-tag`]??``),"ruleset-version":String(e[`ruleset-version`]??``),"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.accountRulesets.versions.zoneByTag.tag(e[`rule-tag`],e[`ruleset-version`],e[`ruleset-id`],i)),{successLabel:`Loaded`})}},q={command:`zone-by-tag`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`versions`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(B).command(H).command(W).command(R).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Y={command:`account-rulesets`,describe:`Account-scoped rulesets — same operations as zone-level but scoped to the account`,builder:e=>e.command(ee).command(f).command(m).command(g).command(F).command(E).command(N).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Creates a ruleset at the zone level.`,builder:X,handler:async e=>{if(e.dryRun){o({command:`cf rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=c(e.body,`body`,`binary`);a(await s(`Creating`,async()=>n.post(`/zones/${e.zoneId}/rulesets`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n.rulesets.create(i)),{successLabel:`Created`})}};function Z(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Q={command:`delete <ruleset-id>`,describe:`Deletes all versions of an existing zone ruleset.`,builder:Z,handler:async n=>{if(n.dryRun){o({command:`cf rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/rulesets/${n[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(n[`ruleset-id`]))}`,pathParams:{"ruleset-id":String(n[`ruleset-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(n),c=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=c,!await e({force:!!n.force})){process.stderr.write(`Aborted.
6
- `);return}a(await s(`Deleting`,async()=>i.rulesets.delete(n[`ruleset-id`],c)),{successLabel:`Deleted`})}};function ne(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <ruleset-id>`,describe:`Fetches the latest version of a zone ruleset.`,builder:ne,handler:async e=>{if(e.dryRun){o({command:`cf rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.get(e[`ruleset-id`],i)),{successLabel:`Loaded`})}};function ie(e){return e.option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`string`,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 ae={command:`list`,describe:`Fetches all rulesets at the zone level.`,builder:ie,handler:async e=>{let n={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),c=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>i.rulesets.list(c,n)),{successLabel:`Loaded`})}};function oe(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <ruleset-phase>`,describe:`Fetches the latest version of the zone entry point ruleset for a given phase.`,builder:oe,handler:async e=>{if(e.dryRun){o({command:`cf rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint`,pathParams:{"ruleset-phase":String(e[`ruleset-phase`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.phases.get(e[`ruleset-phase`],i)),{successLabel:`Loaded`})}};function ce(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`update <ruleset-phase>`,describe:`Updates a zone entry point ruleset, creating a new version.`,builder:ce,handler:async e=>{if(e.dryRun){o({command:`cf rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint`,pathParams:{"ruleset-phase":String(e[`ruleset-phase`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=c(e.body,`body`,`binary`);a(await s(`Updating`,async()=>n.put(`/zones/${e.zoneId}/rulesets/phases/${encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>n.rulesets.phases.update(e[`ruleset-phase`],i)),{successLabel:`Updated`})}};function ue(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <ruleset-version>`,describe:`Fetches a specific version of a zone entry point ruleset.`,builder:ue,handler:async e=>{if(e.dryRun){o({command:`cf rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"ruleset-version":String(e[`ruleset-version`]??``),"ruleset-phase":String(e[`ruleset-phase`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.phases.versions.get(e[`ruleset-version`],e[`ruleset-phase`],i)),{successLabel:`Loaded`})}};function fe(e){return e.option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Fetches the versions of a zone entry point ruleset.`,builder:fe,handler:async e=>{if(e.dryRun){o({command:`cf rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/phases/${e[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(e[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"ruleset-phase":String(e[`ruleset-phase`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.phases.versions.list(e[`ruleset-phase`],i)),{successLabel:`Loaded`})}},me={command:`versions`,describe:`Execution phases that determine when rulesets run in the request lifecycle (e.g. http_request_firewall_custom)`,builder:e=>e.command(de).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`phases`,describe:`Execution phases that determine when rulesets run in the request lifecycle (e.g. http_request_firewall_custom)`,builder:e=>e.command(se).command(le).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`create <ruleset-id>`,describe:`Adds a new rule to a zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`,builder:ge,handler:async e=>{if(e.dryRun){o({command:`cf rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=c(e.body,`body`,`binary`);a(await s(`Creating`,async()=>n.post(`/zones/${e.zoneId}/rulesets/${encodeURIComponent(String(e[`ruleset-id`]))}/rules`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n.rulesets.rules.create(e[`ruleset-id`],i)),{successLabel:`Created`})}};function ve(e){return e.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(`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 ye={command:`delete <rule-id>`,describe:`Deletes an existing rule from a zone ruleset.`,builder:ve,handler:async n=>{if(n.dryRun){o({command:`cf rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/rulesets/${n[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(n[`ruleset-id`]))}/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``),"ruleset-id":String(n[`ruleset-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(n),c=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=c,!await e({force:!!n.force})){process.stderr.write(`Aborted.
7
- `);return}a(await s(`Deleting`,async()=>i.rulesets.rules.delete(n[`rule-id`],n[`ruleset-id`],c)),{successLabel:`Deleted`})}};function be(e){return e.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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $={command:`edit <rule-id>`,describe:`Updates an existing rule in a zone ruleset.`,builder:be,handler:async e=>{if(e.dryRun){o({command:`cf rulesets rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/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:{"rule-id":String(e[`rule-id`]??``),"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=c(e.body,`body`,`binary`);a(await s(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/rulesets/${encodeURIComponent(String(e[`ruleset-id`]))}/rules/${encodeURIComponent(String(e[`rule-id`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>n.rulesets.rules.edit(e[`rule-id`],e[`ruleset-id`],i)),{successLabel:`Updated`})}},xe={command:`rules`,describe:`Individual rules within a ruleset — each with an expression, action, and priority`,builder:e=>e.command(_e).command(ye).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`update <ruleset-id>`,describe:`Updates a zone ruleset, creating a new version.`,builder:Se,handler:async e=>{if(e.dryRun){o({command:`cf rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=c(e.body,`body`,`binary`);a(await s(`Updating`,async()=>n.put(`/zones/${e.zoneId}/rulesets/${encodeURIComponent(String(e[`ruleset-id`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>n.rulesets.update(e[`ruleset-id`],i)),{successLabel:`Updated`})}};function we(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Te={command:`delete <ruleset-version>`,describe:`Deletes an existing version of a zone ruleset.`,builder:we,handler:async n=>{if(n.dryRun){o({command:`cf rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/rulesets/${n[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(n[`ruleset-id`]))}/versions/${n[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(n[`ruleset-version`]))}`,pathParams:{"ruleset-version":String(n[`ruleset-version`]??``),"ruleset-id":String(n[`ruleset-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(n),c=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=c,!await e({force:!!n.force})){process.stderr.write(`Aborted.
8
- `);return}a(await s(`Deleting`,async()=>i.rulesets.versions.delete(n[`ruleset-version`],n[`ruleset-id`],c)),{successLabel:`Deleted`})}};function Ee(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`get <ruleset-version>`,describe:`Fetches a specific version of a zone ruleset.`,builder:Ee,handler:async e=>{if(e.dryRun){o({command:`cf rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"ruleset-version":String(e[`ruleset-version`]??``),"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.versions.get(e[`ruleset-version`],e[`ruleset-id`],i)),{successLabel:`Loaded`})}};function Oe(e){return e.option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`Fetches the versions of a zone ruleset.`,builder:Oe,handler:async e=>{if(e.dryRun){o({command:`cf rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/versions`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>n.rulesets.versions.list(e[`ruleset-id`],i)),{successLabel:`Loaded`})}},Ae={command:`versions`,describe:`Immutable snapshots of a ruleset, allowing rollback and audit of rule changes`,builder:e=>e.command(Te).command(De).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},je={command:`rulesets`,describe:`Versioned collections of rules that control how Cloudflare processes traffic — WAF, transform, redirect, and more`,builder:e=>e.command(te).command(Q).command(re).command(ae).command(Ce).command(Y).command(he).command(xe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{je as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,h as t,t as n,x as r}from"./auth-CQcAgnOy.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-CjcQ6ato.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";function d(e){return e.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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`bulk-create`,describe:`Modifies one or more rules in a Web Analytics ruleset with a single request.`,builder:d,handler:async e=>{if(e.dryRun){s({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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:{"delete-rules":e[`delete-rules`],body:e.body}});return}let l=await n(e),d=e.local?u:await t(l);if(e.accountId=d,e.body){let t=a(e.body);o(await c(`Creating`,async()=>l.post(`/accounts/${d}/rum/v2/${encodeURIComponent(String(e[`ruleset-id`]))}/rules`,{body:t})),{successLabel:`Created`});return}let f={};e[`delete-rules`]!==void 0&&i(f,[`delete_rules`],e[`delete-rules`]),o(await c(`Creating`,async()=>l.post(`/accounts/${d}/rum/v2/${encodeURIComponent(String(e[`ruleset-id`]))}/rules`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Created`})}};function p(e){return e.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 m={command:`create <ruleset-id>`,describe:`Creates a new rule in a Web Analytics ruleset.`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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:{host:e.host,inclusive:e.inclusive,"is-paused":e[`is-paused`],paths:e.paths,body:e.body}});return}let d=await n(e),f=e.local?u:await t(d);if(e.accountId=f,e.body){let t=a(e.body);o(await c(`Creating`,async()=>d.post(`/accounts/${f}/rum/v2/${encodeURIComponent(String(e[`ruleset-id`]))}/rule`,{body:t})),{successLabel:`Created`});return}let p={};e.host!==void 0&&i(p,[`host`],l(e.host,`host`,`text`)),e.inclusive!==void 0&&i(p,[`inclusive`],e.inclusive),e[`is-paused`]!==void 0&&i(p,[`is_paused`],e[`is-paused`]),e.paths!==void 0&&i(p,[`paths`],e.paths),o(await c(`Creating`,async()=>d.post(`/accounts/${f}/rum/v2/${encodeURIComponent(String(e[`ruleset-id`]))}/rule`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function h(e){return e.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 g={command:`delete <rule-id>`,describe:`Deletes an existing rule from a Web Analytics ruleset.`,builder:h,handler:async i=>{if(i.dryRun){s({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/rum/v2/${i[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(i[`ruleset-id`]))}/rule/${i[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(i[`rule-id`]))}`,pathParams:{"ruleset-id":String(i[`ruleset-id`]??``),"rule-id":String(i[`rule-id`]??``)},bodyKind:`none`});return}let a=await n(i),l=i.local?u:await t(a);if(i.accountId=l,!await e({force:!!i.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>a.rum.rules.delete(l,i[`ruleset-id`],i[`rule-id`])),{successLabel:`Deleted`})}};function _(e){return e.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 v={command:`list`,describe:`Lists all the rules in a Web Analytics ruleset.`,builder:_,handler:async e=>{if(e.dryRun){s({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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 i=await n(e),a=e.local?u:await t(i);e.accountId=a,o(await c(`Loading`,async()=>i.rum.rules.list(a,e[`ruleset-id`])),{successLabel:`Loaded`})}};function y(e){return e.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 b={command:`update <rule-id>`,describe:`Updates a rule in a Web Analytics ruleset.`,builder:y,handler:async e=>{if(e.dryRun){s({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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:{host:e.host,inclusive:e.inclusive,"is-paused":e[`is-paused`],paths:e.paths,body:e.body}});return}let d=await n(e),f=e.local?u:await t(d);if(e.accountId=f,e.body){let t=a(e.body);o(await c(`Updating`,async()=>d.put(`/accounts/${f}/rum/v2/${encodeURIComponent(String(e[`ruleset-id`]))}/rule/${encodeURIComponent(String(e[`rule-id`]))}`,{body:t})),{successLabel:`Updated`});return}let p={};e.host!==void 0&&i(p,[`host`],l(e.host,`host`,`text`)),e.inclusive!==void 0&&i(p,[`inclusive`],e.inclusive),e[`is-paused`]!==void 0&&i(p,[`is_paused`],e[`is-paused`]),e.paths!==void 0&&i(p,[`paths`],e.paths),o(await c(`Updating`,async()=>d.put(`/accounts/${f}/rum/v2/${encodeURIComponent(String(e[`ruleset-id`]))}/rule/${encodeURIComponent(String(e[`rule-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},x={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.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 C={command:`create`,describe:`Creates a new Web Analytics site.`,builder:S,handler:async e=>{if(e.dryRun){s({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:{"auto-install":e[`auto-install`],host:e.host,"zone-tag":e[`zone-tag`],body:e.body}});return}let d=await n(e),f=e.local?u:await t(d);if(e.accountId=f,e.body){let t=a(e.body);o(await c(`Creating`,async()=>d.post(`/accounts/${f}/rum/site_info`,{body:t})),{successLabel:`Created`});return}let p={};e[`auto-install`]!==void 0&&i(p,[`auto_install`],e[`auto-install`]),e.host!==void 0&&i(p,[`host`],l(e.host,`host`,`text`)),e[`zone-tag`]!==void 0&&i(p,[`zone_tag`],l(e[`zone-tag`],`zone-tag`,`text`)),o(await c(`Creating`,async()=>d.post(`/accounts/${f}/rum/site_info`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function w(e){return e.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 T={command:`delete <site-id>`,describe:`Deletes an existing Web Analytics site.`,builder:w,handler:async i=>{if(i.dryRun){s({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/rum/site_info/${i[`site-id`]==null?`<site-id>`:encodeURIComponent(String(i[`site-id`]))}`,pathParams:{"site-id":String(i[`site-id`]??``)},bodyKind:`none`});return}let a=await n(i),l=i.local?u:await t(a);if(i.accountId=l,!await e({force:!!i.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>a.rum.siteInfo.delete(l,i[`site-id`])),{successLabel:`Deleted`})}};function E(e){return e.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 D={command:`get <site-id>`,describe:`Retrieves a Web Analytics site.`,builder:E,handler:async e=>{if(e.dryRun){s({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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 i=await n(e),a=e.local?u:await t(i);e.accountId=a,o(await c(`Loading`,async()=>i.rum.siteInfo.get(a,e[`site-id`])),{successLabel:`Loaded`})}};function O(e){return e.option(`per-page`,{type:`string`,description:`Number of items to return per page of results.`}).option(`page`,{type:`string`,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:`Lists all Web Analytics sites of an account.`,builder:O,handler:async e=>{let i={per_page:e[`per-page`],page:e.page,order_by:e[`order-by`]};if(e.dryRun){s({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(e),l=e.local?u:await t(a);e.accountId=l,o(await c(`Loading`,async()=>a.rum.siteInfo.list(l,i)),{successLabel:`Loaded`})}};function A(e){return e.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 j={command:`update <site-id>`,describe:`Updates an existing Web Analytics site.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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:{"auto-install":e[`auto-install`],enabled:e.enabled,host:e.host,lite:e.lite,"zone-tag":e[`zone-tag`],body:e.body}});return}let d=await n(e),f=e.local?u:await t(d);if(e.accountId=f,e.body){let t=a(e.body);o(await c(`Updating`,async()=>d.put(`/accounts/${f}/rum/site_info/${encodeURIComponent(String(e[`site-id`]))}`,{body:t})),{successLabel:`Updated`});return}let p={};e[`auto-install`]!==void 0&&i(p,[`auto_install`],e[`auto-install`]),e.enabled!==void 0&&i(p,[`enabled`],e.enabled),e.host!==void 0&&i(p,[`host`],l(e.host,`host`,`text`)),e.lite!==void 0&&i(p,[`lite`],e.lite),e[`zone-tag`]!==void 0&&i(p,[`zone_tag`],l(e[`zone-tag`],`zone-tag`,`text`)),o(await c(`Updating`,async()=>d.put(`/accounts/${f}/rum/site_info/${encodeURIComponent(String(e[`site-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},M={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(x).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,b as t,t as n}from"./auth-CQcAgnOy.mjs";import{t as r}from"./output-D7_yAFVR.mjs";import{n as i,t as a}from"./progress-CjcQ6ato.mjs";import{n as o}from"./input-validation-zEO81MWN.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const c={command:`create`,describe:`Uploads a new OpenAPI schema for API Shield schema validation. The schema defines expected request/response formats for API endpoints.`,builder:s,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Creating`,async()=>s.post(`/zones/${e.zoneId}/schema_validation/schemas`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>s.schemaValidation.schemas.create(c)),{successLabel:`Created`})}};function l(e){return e.positional(`schema-id`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const u={command:`delete <schema-id>`,describe:`Permanently removes an uploaded OpenAPI schema from API Shield. Operations using this schema will lose their validation rules.`,builder:l,handler:async o=>{if(o.dryRun){i({command:`cf schema-validation schemas delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/schema_validation/schemas/${o[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(o[`schema-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"schema-id":String(o[`schema-id`]??``)},bodyKind:`none`});return}let s=await n(o),c=await t({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,!await e({force:!!o.force})){process.stderr.write(`Aborted.
3
- `);return}r(await a(`Deleting`,async()=>s.schemaValidation.schemas.delete(c,o[`schema-id`])),{successLabel:`Deleted`})}};function d(e){return e.positional(`schema-id`,{type:`string`,description:`Schema ID`,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 f={command:`edit <schema-id>`,describe:`Modifies an existing OpenAPI schema in API Shield, updating the validation rules for associated API operations.`,builder:d,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation schemas edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.patch(`/zones/${e.zoneId}/schema_validation/schemas/${encodeURIComponent(String(e[`schema-id`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.schemas.edit(c,e[`schema-id`])),{successLabel:`Updated`})}};function p(e){return e.positional(`schema-id`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <schema-id>`,describe:`Gets the contents and metadata of a specific OpenAPI schema uploaded to API Shield.`,builder:p,handler:async e=>{let o={omit_source:e[`omit-source`]};if(e.dryRun){i({command:`cf schema-validation schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.get(c,e[`schema-id`],o)),{successLabel:`Loaded`})}};function h(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists all unique hosts found in uploaded OpenAPI schemas for the zone.`,builder:h,handler:async e=>{let o={page:e.page,per_page:e[`per-page`]};if(e.dryRun){i({command:`cf schema-validation schemas hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/hosts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.hosts.list(c,o)),{successLabel:`Loaded`})}},_={command:`hosts`,describe:`List schema hosts and extract operations from uploaded schemas`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`omit-source`,{type:`boolean`,description:`Omit the source-files of schemas and only retrieve their meta-data.`}).option(`validation-enabled`,{type:`boolean`,description:`Filter for enabled schemas`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Lists all OpenAPI schemas uploaded to API Shield with pagination support.`,builder:v,handler:async e=>{let o={page:e.page,per_page:e[`per-page`],omit_source:e[`omit-source`],validation_enabled:e[`validation-enabled`]};if(e.dryRun){i({command:`cf schema-validation schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.list(c,o)),{successLabel:`Loaded`})}};function b(e){return e.positional(`schema-id`,{type:`string`,description:`Schema ID`,demandOption:!0}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`host`,{type:`string`,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`operation-status`,{type:`string`,description:"Filter results by whether operations exist in Web Asset Management or not. `new` will just return operations from the schema that do not exist otherwise. `existing` will just return operations from the schema that already exist.",choices:[`new`,`existing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <schema-id>`,describe:`Retrieves all operations from the schema. Operations that already exist in API Shield Endpoint Management will be returned as full operations.`,builder:b,handler:async e=>{let o={feature:e.feature,host:e.host,method:e.method,endpoint:e.endpoint,page:e.page,per_page:e[`per-page`],operation_status:e[`operation-status`]};if(e.dryRun){i({command:`cf schema-validation schemas operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas/${e[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(e[`schema-id`]))}/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"schema-id":String(e[`schema-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.schemas.operations.get(c,e[`schema-id`],o)),{successLabel:`Loaded`})}},S={command:`operations`,describe:`List schema hosts and extract operations from uploaded schemas`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`schemas`,describe:`Uploaded API schemas used to validate incoming requests against expected formats`,builder:e=>e.command(c).command(u).command(f).command(m).command(y).command(_).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`edit`,describe:`Partially updates global schema validation settings for a zone using PATCH semantics.`,builder:w,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.patch(`/zones/${e.zoneId}/schema_validation/settings`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.edit(c)),{successLabel:`Updated`})}};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`Retrieves the current global schema validation settings for a zone.`,builder:E,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(e),s=await t({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s,r(await a(`Loading`,async()=>o.schemaValidation.settings.get(s)),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`bulk-edit`,describe:`Updates schema validation settings for multiple API operations in a single request. Efficient for applying consistent validation rules across endpoints.`,builder:O,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings operations bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.patch(`/zones/${e.zoneId}/schema_validation/settings/operations`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.operations.bulkEdit(c)),{successLabel:`Updated`})}};function A(e){return e.positional(`operation-id`,{type:`string`,description:`Operation ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const j={command:`delete <operation-id>`,describe:`Removes custom schema validation settings for a specific API operation, reverting to zone-level defaults.`,builder:A,handler:async o=>{if(o.dryRun){i({command:`cf schema-validation settings operations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/schema_validation/settings/operations/${o[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(o[`operation-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"operation-id":String(o[`operation-id`]??``)},bodyKind:`none`});return}let s=await n(o),c=await t({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,!await e({force:!!o.force})){process.stderr.write(`Aborted.
4
- `);return}r(await a(`Deleting`,async()=>s.schemaValidation.settings.operations.delete(c,o[`operation-id`])),{successLabel:`Deleted`})}};function M(e){return e.positional(`operation-id`,{type:`string`,description:`Operation ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <operation-id>`,describe:`Retrieves the schema validation settings configured for a specific API operation.`,builder:M,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings/operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let o=await n(e),s=await t({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s,r(await a(`Loading`,async()=>o.schemaValidation.settings.operations.get(s,e[`operation-id`])),{successLabel:`Loaded`})}};function P(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists all per-operation schema validation settings configured for the zone.`,builder:P,handler:async e=>{let o={page:e.page,per_page:e[`per-page`]};if(e.dryRun){i({command:`cf schema-validation settings operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c,r(await a(`Loading`,async()=>s.schemaValidation.settings.operations.list(c,o)),{successLabel:`Loaded`})}};function I(e){return e.positional(`operation-id`,{type:`string`,description:`Operation ID`,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 L={command:`update <operation-id>`,describe:`Fully updates schema validation settings for a specific API operation.`,builder:I,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings operations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings/operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"operation-id":String(e[`operation-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.put(`/zones/${e.zoneId}/schema_validation/settings/operations/${encodeURIComponent(String(e[`operation-id`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.operations.update(c,e[`operation-id`])),{successLabel:`Updated`})}},R={command:`operations`,describe:`Zone-level schema validation settings including default actions for unmatched requests`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update`,describe:`Fully updates global schema validation settings for a zone, replacing existing configuration.`,builder:z,handler:async e=>{if(e.dryRun){i({command:`cf schema-validation settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=o(e.body,`body`,`binary`);r(await a(`Updating`,async()=>s.put(`/zones/${e.zoneId}/schema_validation/settings`,{body:t,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>s.schemaValidation.settings.update(c)),{successLabel:`Updated`})}},V={command:`settings`,describe:`Zone-level schema validation settings including default actions for unmatched requests`,builder:e=>e.command(T).command(D).command(B).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`schema-validation`,describe:`API schema validation settings — enforce request/response schemas and configure validation behavior`,builder:e=>e.command(C).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,h as t,t as n,x as r}from"./auth-CQcAgnOy.mjs";import{t as i}from"./output-D7_yAFVR.mjs";import{n as a,t as o}from"./progress-CjcQ6ato.mjs";import{n as s,t as c}from"./input-validation-zEO81MWN.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const d={command:`create`,describe:"Creates 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).",builder:u,handler:async e=>{if(e.dryRun){a({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:{body:e.body,file:e.file}});return}let u=await n(e),d=e.local?l:await t(u);if(e.accountId=d,e.file){let t=c(e.file);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(e.body){let t=s(e.body,`body`,`binary`);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function f(e){return e.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 p={command:`delete <group-id>`,describe:`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.`,builder:f,handler:async s=>{if(s.dryRun){a({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups/${s[`group-id`]==null?`<group-id>`:encodeURIComponent(String(s[`group-id`]))}`,pathParams:{"group-id":String(s[`group-id`]??``)},bodyKind:`none`});return}let c=await n(s),u=s.local?l:await t(c);if(s.accountId=u,!await e({force:!!s.force})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.scim.groups.delete(u,s[`group-id`])),{successLabel:`Deleted`})}};function m(e){return e.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 h={command:`edit <group-id>`,describe:"Partially 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.",builder:m,handler:async e=>{if(e.dryRun){a({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`octet-stream`,body:{body:e.body,file:e.file}});return}let u=await n(e),d=e.local?l:await t(u);if(e.accountId=d,e.file){let t=c(e.file);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(e.body){let t=s(e.body,`body`,`binary`);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`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 _={command:`get <group-id>`,describe:`Retrieves a single SCIM Group resource by group ID.`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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 s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.groups.get(c,e[`group-id`])),{successLabel:`Loaded`})}};function v(e){return e.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 y={command:`list`,describe:"Lists 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.",builder:v,handler:async e=>{let s={startIndex:e[`start-index`],count:e.count,filter:e.filter};if(e.dryRun){a({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Groups`,pathParams:{},query:s,bodyKind:`none`});return}let c=await n(e),u=e.local?l:await t(c);e.accountId=u,i(await o(`Loading`,async()=>c.scim.groups.list(u,s)),{successLabel:`Loaded`})}},b={command:`groups`,describe:`Groups operations`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.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 S={command:`get <resource-type-id>`,describe:"Returns a single SCIM resource type by ID (RFC 7643 Section 6). Valid IDs are `User` and `Group`.",builder:x,handler:async e=>{if(e.dryRun){a({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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 s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.resourceTypes.get(c,e[`resource-type-id`])),{successLabel:`Loaded`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`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.`,builder:C,handler:async e=>{if(e.dryRun){a({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.resourceTypes.list(c)),{successLabel:`Loaded`})}},T={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.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 D={command:`get <schema-id>`,describe:"Returns 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`.",builder:E,handler:async e=>{if(e.dryRun){a({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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 s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.schemas.get(c,e[`schema-id`])),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`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.`,builder:O,handler:async e=>{if(e.dryRun){a({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.schemas.list(c)),{successLabel:`Loaded`})}},A={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`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.`,builder:j,handler:async e=>{if(e.dryRun){a({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.serviceProviderConfig.get(c)),{successLabel:`Loaded`})}},N={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const F={command:`create`,describe:"Provisions 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.",builder:P,handler:async e=>{if(e.dryRun){a({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:{body:e.body,file:e.file}});return}let u=await n(e),d=e.local?l:await t(u);if(e.accountId=d,e.file){let t=c(e.file);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Users`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(e.body){let t=s(e.body,`body`,`binary`);i(await o(`Creating`,async()=>u.post(`/accounts/${d}/scim/v2/Users`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function I(e){return e.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 L={command:`edit <user-id>`,describe:'Partially 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`.',builder:I,handler:async e=>{if(e.dryRun){a({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`octet-stream`,body:{body:e.body,file:e.file}});return}let u=await n(e),d=e.local?l:await t(u);if(e.accountId=d,e.file){let t=c(e.file);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Users/${encodeURIComponent(String(e[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(e.body){let t=s(e.body,`body`,`binary`);i(await o(`Updating`,async()=>u.patch(`/accounts/${d}/scim/v2/Users/${encodeURIComponent(String(e[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function R(e){return e.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 z={command:`get <user-id>`,describe:`Retrieves a single account member as a SCIM User resource by user tag.`,builder:R,handler:async e=>{if(e.dryRun){a({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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 s=await n(e),c=e.local?l:await t(s);e.accountId=c,i(await o(`Loading`,async()=>s.scim.users.get(c,e[`user-id`])),{successLabel:`Loaded`})}};function B(e){return e.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 V={command:`list`,describe:'Lists 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.',builder:B,handler:async e=>{let s={startIndex:e[`start-index`],count:e.count,filter:e.filter};if(e.dryRun){a({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users`,pathParams:{},query:s,bodyKind:`none`});return}let c=await n(e),u=e.local?l:await t(c);e.accountId=u,i(await o(`Loading`,async()=>c.scim.users.list(u,s)),{successLabel:`Loaded`})}};function H(e){return e.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 U={command:`update <user-id>`,describe:"Replaces 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`.",builder:H,handler:async e=>{if(e.dryRun){a({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/scim/v2/Users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`octet-stream`,body:{body:e.body,file:e.file}});return}let u=await n(e),d=e.local?l:await t(u);if(e.accountId=d,e.file){let t=c(e.file);i(await o(`Updating`,async()=>u.put(`/accounts/${d}/scim/v2/Users/${encodeURIComponent(String(e[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(e.body){let t=s(e.body,`body`,`binary`);i(await o(`Updating`,async()=>u.put(`/accounts/${d}/scim/v2/Users/${encodeURIComponent(String(e[`user-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},W={command:`users`,describe:`Users operations`,builder:e=>e.command(F).command(L).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(b).command(T).command(A).command(N).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- const e={command:`scm`,describe:`Source code management connections — link Git providers, browse repos, create pull requests, and manage grants`,builder:e=>e.demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{e as default};
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,h as n,t as r,x as i}from"./auth-CQcAgnOy.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-CjcQ6ato.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Lists the number of secrets used in the account.`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.secretsStore.quota.get(a)),{successLabel:`Loaded`})}},m={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,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 h={command:`create <store-id>`,describe:`Creates a secret in the account`,builder:ee,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store secrets bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"store-id":String(e[`store-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),a=e.local?d:await n(t);if(e.accountId=a,e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/accounts/${a}/secrets_store/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets`,{body:n})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).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:`Request body for bulk deleting secrets`})}const _={command:`delete <store-id>`,describe:`Deletes one or more secrets`,builder:g,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}/secrets`,pathParams:{"store-id":String(t[`store-id`]??``)},bodyKind:`json`,body:{ids:t.ids,body:t.body}});return}let u=await r(t),f=t.local?d:await n(u);if(t.accountId=f,!await e({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}if(t.body){let e=o(t.body);s(await l(`Deleting`,async()=>u.delete(`/accounts/${f}/secrets_store/stores/${encodeURIComponent(String(t[`store-id`]))}/secrets`,{body:e})),{successLabel:`Deleted`});return}if(t.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let p={};t.ids!==void 0&&a(p,[`ids`],t.ids),s(await l(`Deleting`,async()=>u.delete(`/accounts/${f}/secrets_store/stores/${encodeURIComponent(String(t[`store-id`]))}/secrets`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Deleted`})}},v={command:`bulk`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store 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 b={command:`delete <secret-id>`,describe:`Deletes a single secret`,builder:y,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}/secrets/${t[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(t[`secret-id`]))}`,pathParams:{"store-id":String(t[`store-id`]??``),"secret-id":String(t[`secret-id`]??``)},bodyKind:`none`});return}let a=await r(t),o=t.local?d:await n(a);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}s(await l(`Deleting`,async()=>a.secretsStore.secrets.delete(o,t[`store-id`],t[`secret-id`])),{successLabel:`Deleted`})}};function x(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`name`,{type:`string`,description:`The name of the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).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:`duplicate <secret-id>`,describe:`Duplicates the secret, keeping the value`,builder:x,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:{comment:e.comment,name:e.name,scopes:e.scopes,body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}/duplicate`,{body:t})),{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await t(`name`,`The name of the secret`)),e.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let m={};e.comment!==void 0&&a(m,[`comment`],u(e.comment,`comment`,`text`)),e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),e.scopes!==void 0&&a(m,[`scopes`],e.scopes),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}/duplicate`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function C(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response will provide this value, it is only used to create/modify secrets.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <secret-id>`,describe:`Updates a single secret`,builder:C,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:{comment:e.comment,scopes:e.scopes,value:e.value,body:e.body}});return}let t=await r(e),f=e.local?d:await n(t);if(e.accountId=f,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/accounts/${f}/secrets_store/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}`,{body:n})),{successLabel:`Updated`});return}let p={};e.comment!==void 0&&a(p,[`comment`],u(e.comment,`comment`,`text`)),e.scopes!==void 0&&a(p,[`scopes`],e.scopes),e.value!==void 0&&a(p,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/accounts/${f}/secrets_store/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function T(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <secret-id>`,describe:`Returns details of a single secret`,builder:T,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.secretsStore.secrets.get(a,e[`store-id`],e[`secret-id`])),{successLabel:`Loaded`})}};function D(e){return e.option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,description:`Only secrets with the given scopes will be returned`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists all store secrets`,builder:D,handler:async e=>{let t={direction:e.direction,page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,scopes:e.scopes};if(e.dryRun){c({command:`cf secrets-store secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"store-id":String(e[`store-id`]??``)},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.secretsStore.secrets.list(o,e[`store-id`],t)),{successLabel:`Loaded`})}},k={command:`secrets`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`name`,{type:`string`,description:`The name of the store`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create`,describe:`Creates a store in the account`,builder:A,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store stores create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores`,pathParams:{},bodyKind:`json`,body:{name:e.name,body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The name of the store`));let m={};e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/secrets_store/stores`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function M(e){return e.positional(`store-id`,{type:`string`,description:`Store 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 N={command:`delete <store-id>`,describe:`Deletes a single store`,builder:M,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store stores delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}`,pathParams:{"store-id":String(t[`store-id`]??``)},bodyKind:`none`});return}let a=await r(t),o=t.local?d:await n(a);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}s(await l(`Deleting`,async()=>a.secretsStore.stores.delete(o,t[`store-id`])),{successLabel:`Deleted`})}};function P(e){return e.option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists all the stores in an account`,builder:P,handler:async e=>{let t={direction:e.direction,page:e.page,per_page:e[`per-page`],order:e.order};if(e.dryRun){c({command:`cf secrets-store stores list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.secretsStore.stores.list(o,t)),{successLabel:`Loaded`})}},I={command:`stores`,describe:`Secret stores that hold encrypted key-value secrets accessible by Workers and services`,builder:e=>e.command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.positional(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31'). This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`account-id`,{type:`number`,description:`Account internal ID (numeric). Required for system API routes.
6
- This value must remain consistent for all stores within an account
7
- managed by the same service.
8
- `}).option(`name`,{type:`string`,description:`The name of the store`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a store via system API routes`})}const R={command:`create <account-tag>`,describe:`Creates a store in the account on behalf of the calling service. The store will be marked as managed by the authenticated service. Requires account_id in the request body.`,builder:L,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores`,pathParams:{"account-tag":String(e[`account-tag`]??``)},bodyKind:`json`,body:{"account-id":e[`account-id`],name:e.name,body:e.body}});return}let n=await r(e);if(e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores`,{body:t})),{successLabel:`Created`});return}if(e[`account-id`]===void 0)throw Error(`--account-id is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await t(`name`,`The name of the store`));let i={};e[`account-id`]!==void 0&&a(i,[`account_id`],e[`account-id`]),e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),s(await l(`Creating`,async()=>n.post(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
9
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const z={command:`delete <store-id>`,describe:`Deletes a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:te,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store system-stores delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/system/accounts/${t[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(t[`account-tag`]))}/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}`,pathParams:{"account-tag":String(t[`account-tag`]??``),"store-id":String(t[`store-id`]??``)},bodyKind:`none`});return}let n=await r(t);if(!await e({force:!!t.force})){process.stderr.write(`Aborted.
10
- `);return}s(await l(`Deleting`,async()=>n.secretsStore.systemStores.delete(t[`account-tag`],t[`store-id`])),{successLabel:`Deleted`})}};function B(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`id <store-id>`,describe:`Returns details of a single store`,builder:B,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.secretsStore.systemStores.get.by.id(a,e[`store-id`])),{successLabel:`Loaded`})}},H={command:`by`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
11
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`v2 <store-id>`,describe:`Returns details of a single store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:U,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}`,pathParams:{"account-tag":String(e[`account-tag`]??``),"store-id":String(e[`store-id`]??``)},bodyKind:`none`});return}let t=await r(e);s(await l(`Loading`,async()=>t.secretsStore.systemStores.get.v2(e[`account-tag`],e[`store-id`])),{successLabel:`Loaded`})}},G={command:`get`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(W).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
12
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Lists all stores in an account that are managed by the calling service. Only returns stores where managed_by matches the authenticated service.`,builder:K,handler:async e=>{let t={direction:e.direction,page:e.page,per_page:e[`per-page`],order:e.order};if(e.dryRun){c({command:`cf secrets-store system-stores list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores`,pathParams:{"account-tag":String(e[`account-tag`]??``)},query:t,bodyKind:`none`});return}let n=await r(e);s(await l(`Loading`,async()=>n.secretsStore.systemStores.list(e[`account-tag`],t)),{successLabel:`Loaded`})}};function J(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
13
- This is the account's external tag identifier, not the numeric account ID.`,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 Y={command:`create <store-id>`,describe:`Creates one or more secrets in a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:J,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"account-tag":String(e[`account-tag`]??``),"store-id":String(e[`store-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets`,{body:n})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function X(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
14
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store 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 Z={command:`id <secret-id>`,describe:`Deletes a single secret from a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:X,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store system-stores secrets delete by id`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/system/accounts/${t[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(t[`account-tag`]))}/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}/secrets/${t[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(t[`secret-id`]))}`,pathParams:{"account-tag":String(t[`account-tag`]??``),"store-id":String(t[`store-id`]??``),"secret-id":String(t[`secret-id`]??``)},bodyKind:`none`});return}let n=await r(t);if(!await e({force:!!t.force})){process.stderr.write(`Aborted.
15
- `);return}s(await l(`Deleting`,async()=>n.secretsStore.systemStores.secrets.delete.by.id(t[`account-tag`],t[`store-id`],t[`secret-id`])),{successLabel:`Deleted`})}},Q={command:`by`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
16
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).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:`Request body for bulk deleting secrets`})}const re={command:`bulk`,describe:`Deletes one or more secrets from a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:ne,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store system-stores secrets delete system bulk`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/system/accounts/${t[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(t[`account-tag`]))}/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}/secrets`,pathParams:{"account-tag":String(t[`account-tag`]??``),"store-id":String(t[`store-id`]??``)},bodyKind:`json`,body:{ids:t.ids,body:t.body}});return}let n=await r(t);if(!await e({force:!!t.force})){process.stderr.write(`Aborted.
17
- `);return}if(t.body){let e=o(t.body);s(await l(`Deleting`,async()=>n.delete(`/system/accounts/${encodeURIComponent(String(t[`account-tag`]))}/stores/${encodeURIComponent(String(t[`store-id`]))}/secrets`,{body:e})),{successLabel:`Deleted`});return}if(t.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let i={};t.ids!==void 0&&a(i,[`ids`],t.ids),s(await l(`Deleting`,async()=>n.delete(`/system/accounts/${encodeURIComponent(String(t[`account-tag`]))}/stores/${encodeURIComponent(String(t[`store-id`]))}/secrets`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Deleted`})}},ie={command:`system`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ae={command:`delete`,describe:`Operations for system-stores.secrets.delete`,builder:e=>e.command(Q).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
18
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`name`,{type:`string`,description:`The name of the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $={command:`create <secret-id>`,describe:`Duplicates a secret in a store managed by the calling service, keeping the value. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:oe,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets duplicate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}/duplicate`,pathParams:{"account-tag":String(e[`account-tag`]??``),"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:{comment:e.comment,name:e.name,scopes:e.scopes,body:e.body}});return}let n=await r(e);if(e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}/duplicate`,{body:t})),{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await t(`name`,`The name of the secret`)),e.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let i={};e.comment!==void 0&&a(i,[`comment`],u(e.comment,`comment`,`text`)),e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),e.scopes!==void 0&&a(i,[`scopes`],e.scopes),s(await l(`Creating`,async()=>n.post(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}/duplicate`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}},se={command:`duplicate`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
19
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response will provide this value, it is only used to create/modify secrets.`}).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 le={command:`edit <secret-id>`,describe:`Updates a single secret in a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:ce,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"account-tag":String(e[`account-tag`]??``),"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:{comment:e.comment,scopes:e.scopes,value:e.value,body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}`,{body:n})),{successLabel:`Updated`});return}let n={};e.comment!==void 0&&a(n,[`comment`],u(e.comment,`comment`,`text`)),e.scopes!==void 0&&a(n,[`scopes`],e.scopes),e.value!==void 0&&a(n,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/system/accounts/${encodeURIComponent(String(e[`account-tag`]))}/stores/${encodeURIComponent(String(e[`store-id`]))}/secrets/${encodeURIComponent(String(e[`secret-id`]))}`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`})}};function ue(e){return e.positional(`secret-id`,{type:`string`,description:`Secret identifier tag.`,demandOption:!0}).option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
20
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <secret-id>`,describe:`Returns details of a single secret from a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:ue,handler:async e=>{if(e.dryRun){c({command:`cf secrets-store system-stores secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"account-tag":String(e[`account-tag`]??``),"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let t=await r(e);s(await l(`Loading`,async()=>t.secretsStore.systemStores.secrets.get(e[`account-tag`],e[`store-id`],e[`secret-id`])),{successLabel:`Loaded`})}};function fe(e){return e.option(`account-tag`,{type:`string`,description:`Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31').
21
- This is the account's external tag identifier, not the numeric account ID.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,description:`Only secrets with the given scopes will be returned`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Lists all secrets in a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.`,builder:fe,handler:async e=>{let t={direction:e.direction,page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,scopes:e.scopes};if(e.dryRun){c({command:`cf secrets-store system-stores secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/system/accounts/${e[`account-tag`]==null?`<account-tag>`:encodeURIComponent(String(e[`account-tag`]))}/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets`,pathParams:{"account-tag":String(e[`account-tag`]??``),"store-id":String(e[`store-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e);s(await l(`Loading`,async()=>n.secretsStore.systemStores.secrets.list(e[`account-tag`],e[`store-id`],t)),{successLabel:`Loaded`})}},me={command:`secrets`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(Y).command(le).command(de).command(pe).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`system-stores`,describe:`System-level secret store management — CRUD for stores and their secrets`,builder:e=>e.command(R).command(z).command(q).command(G).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`secrets-store`,describe:`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,builder:e=>e.command(m).command(k).command(I).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ge as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as e,h as t,t as n,x as r}from"./auth-CQcAgnOy.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-CjcQ6ato.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";function u(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Retrieves Security Center insight counts aggregated by classification class.`,builder:u,handler:async e=>{let i={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,severity:e.severity,subject:e.subject};if(e.dryRun){s({command:`cf security-center insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/class`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(e),u=e.local?l:await t(a);e.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.class.get(u,i)),{successLabel:`Loaded`})}},f={command:`class`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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 m={command:`dismiss <issue-id>`,describe:`Archives a Security Center insight for an account, removing it from the active insights list while preserving historical data.`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf security-center insights dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:{dismiss:e.dismiss,body:e.body}});return}let u=await n(e),d=e.local?l:await t(u);if(e.accountId=d,e.body){let t=a(e.body);o(await c(`Updating`,async()=>u.put(`/accounts/${d}/security-center/insights/${encodeURIComponent(String(e[`issue-id`]))}/dismiss`,{body:t})),{successLabel:`Updated`});return}let f={};e.dismiss!==void 0&&i(f,[`dismiss`],e.dismiss),o(await c(`Updating`,async()=>u.put(`/accounts/${d}/security-center/insights/${encodeURIComponent(String(e[`issue-id`]))}/dismiss`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}};function h(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`string`,description:`Page`}).option(`per-page`,{type:`string`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists all Security Center insights for the account, showing security findings and recommendations.`,builder:h,handler:async e=>{let i={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,severity:e.severity,subject:e.subject,page:e.page,per_page:e[`per-page`]};if(e.dryRun){s({command:`cf security-center insights list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(e),u=e.local?l:await t(a);e.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.list(u,i)),{successLabel:`Loaded`})}};function _(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`,builder:_,handler:async e=>{let i={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,severity:e.severity,subject:e.subject};if(e.dryRun){s({command:`cf security-center insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/severity`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(e),u=e.local?l:await t(a);e.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.severity.get(u,i)),{successLabel:`Loaded`})}},y={command:`severity`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Retrieves Security Center insight counts aggregated by insight type.`,builder:b,handler:async e=>{let i={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,severity:e.severity,subject:e.subject};if(e.dryRun){s({command:`cf security-center insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/type`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(e),u=e.local?l:await t(a);e.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.type.get(u,i)),{successLabel:`Loaded`})}},S={command:`type`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`insights`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(m).command(g).command(f).command(y).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by classification class.`,builder:w,handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){s({command:`cf security-center zone-insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/insights/class`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.class.get(a,r)),{successLabel:`Loaded`})}},E={command:`class`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <issue-id>`,describe:`Returns the full context payload for an insight. This endpoint is used for insights with large payloads that are not included inline in the list response.`,builder:D,handler:async e=>{if(e.dryRun){s({command:`cf security-center zone-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/context`,pathParams:{"issue-id":String(e[`issue-id`]??``)},bodyKind:`none`});return}let i=await n(e),a=e.local?l:await t(i);e.accountId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.context.get(a,e[`issue-id`])),{successLabel:`Loaded`})}},k={command:`context`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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 j={command:`update <issue-id>`,describe:`Archives a zone-specific Security Center insight, removing it from the active zone insights while preserving historical data.`,builder:A,handler:async t=>{if(t.dryRun){s({command:`cf security-center zone-insights dismiss update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/insights/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/dismiss`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:{dismiss:t.dismiss,body:t.body}});return}let r=await n(t);if(t.zoneId=await e({zone:t.zone},r,{quiet:t.quiet}),t.body){let e=a(t.body);o(await c(`Updating`,async()=>r.put(`/zones/${t.zoneId}/security-center/insights/${encodeURIComponent(String(t[`issue-id`]))}/dismiss`,{body:e})),{successLabel:`Updated`});return}let l={};t.dismiss!==void 0&&i(l,[`dismiss`],t.dismiss),o(await c(`Updating`,async()=>r.put(`/zones/${t.zoneId}/security-center/insights/${encodeURIComponent(String(t[`issue-id`]))}/dismiss`,{body:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}},M={command:`dismiss`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`string`,description:`Page`}).option(`per-page`,{type:`string`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Lists Security Center insights for a specific zone, showing zone-level security findings.`,builder:N,handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject,page:t.page,per_page:t[`per-page`]};if(t.dryRun){s({command:`cf security-center zone-insights get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/insights`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.get(a,r)),{successLabel:`Loaded`})}};function F(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by severity level.`,builder:F,handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){s({command:`cf security-center zone-insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/insights/severity`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.severity.get(a,r)),{successLabel:`Loaded`})}},L={command:`severity`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`dismissed`,{type:`string`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by insight type.`,builder:R,handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){s({command:`cf security-center zone-insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/insights/type`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.type.get(a,r)),{successLabel:`Loaded`})}},B={command:`type`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`zone-insights`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(P).command(E).command(k).command(M).command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`security-center`,describe:`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,builder:e=>e.command(C).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,b as t,t as n}from"./auth-CQcAgnOy.mjs";import{n as r,t as i}from"./body-parser-Br-BoYk-.mjs";import{t as a}from"./output-D7_yAFVR.mjs";import{n as o,t as s}from"./progress-CjcQ6ato.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const u={command:`delete`,describe:`Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`,builder:l,handler:async r=>{if(r.dryRun){o({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=await t({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await e({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>i.securityTxt.delete(c)),{successLabel:`Deleted`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Retrieves the current security.txt file configuration for a zone, used for security vulnerability reporting.`,builder:d,handler:async e=>{if(e.dryRun){o({command:`cf security-txt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.securityTxt.get(i)),{successLabel:`Loaded`})}};function p(e){return e.option(`acknowledgments`,{type:`string`,array:!0,description:`The acknowledgments field`}).option(`canonical`,{type:`string`,array:!0,description:`The canonical field`}).option(`contact`,{type:`string`,array:!0,description:`The contact field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`encryption`,{type:`string`,array:!0,description:`The encryption field`}).option(`expires`,{type:`string`,description:`The expires field`}).option(`hiring`,{type:`string`,array:!0,description:`The hiring field`}).option(`policy`,{type:`string`,array:!0,description:`The policy field`}).option(`preferred-languages`,{type:`string`,description:`The preferred_languages 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 m={command:`update`,describe:`Updates the security.txt file configuration for a zone, which provides security researchers with vulnerability reporting information.`,builder:p,handler:async e=>{if(e.dryRun){o({command:`cf security-txt update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{acknowledgments:e.acknowledgments,canonical:e.canonical,contact:e.contact,enabled:e.enabled,encryption:e.encryption,expires:e.expires,hiring:e.hiring,policy:e.policy,"preferred-languages":e[`preferred-languages`],body:e.body}});return}let l=await n(e);if(e.zoneId=await t({zone:e.zone},l,{quiet:e.quiet}),e.body){let t=i(e.body);a(await s(`Updating`,async()=>l.put(`/zones/${e.zoneId}/security-center/securitytxt`,{body:t})),{successLabel:`Updated`});return}let u={};e.acknowledgments!==void 0&&r(u,[`acknowledgments`],e.acknowledgments),e.canonical!==void 0&&r(u,[`canonical`],e.canonical),e.contact!==void 0&&r(u,[`contact`],e.contact),e.enabled!==void 0&&r(u,[`enabled`],e.enabled),e.encryption!==void 0&&r(u,[`encryption`],e.encryption),e.expires!==void 0&&r(u,[`expires`],c(e.expires,`expires`,`text`)),e.hiring!==void 0&&r(u,[`hiring`],e.hiring),e.policy!==void 0&&r(u,[`policy`],e.policy),e[`preferred-languages`]!==void 0&&r(u,[`preferred_languages`],c(e[`preferred-languages`],`preferred-languages`,`text`)),a(await s(`Updating`,async()=>l.put(`/zones/${e.zoneId}/security-center/securitytxt`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},h={command:`security-txt`,describe:`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,builder:e=>e.command(u).command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};