cf 0.3.0 → 0.4.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 (171) hide show
  1. package/dist/_meta/agent-context.json +26 -21
  2. package/dist/_meta/commands.json +7696 -18100
  3. package/dist/_meta/schemas.json +6411 -13925
  4. package/dist/{abuse-reports-dMIfUJ8v.mjs → abuse-reports-Dy76QPNP.mjs} +1 -1
  5. package/dist/{accounts-Kx1epdA1.mjs → accounts-CjtZ8x1z.mjs} +2 -2
  6. package/dist/{acm-Utu252kC.mjs → acm-C2lYIWs1.mjs} +1 -1
  7. package/dist/{addressing-CBq7Z7Vq.mjs → addressing-CHFK6uxW.mjs} +1 -1
  8. package/dist/{agent-context-BGTU299M.mjs → agent-context-CgGCT0xU.mjs} +1 -1
  9. package/dist/{ai-DOOKLPkG.mjs → ai-DS3i-I1a.mjs} +1 -1
  10. package/dist/{ai-gateway-Cj1T3avF.mjs → ai-gateway-RIsegO2x.mjs} +1 -1
  11. package/dist/ai-search-Dcj4BauG.mjs +7 -0
  12. package/dist/{ai_gateway-C3fH22C0.mjs → ai_gateway-w7YwfcPE.mjs} +1 -1
  13. package/dist/{alerting-CqmEIaKn.mjs → alerting-Bk85NNf5.mjs} +1 -1
  14. package/dist/{analytics-Dv-X8x7D.mjs → analytics-CkhhhZWZ.mjs} +1 -1
  15. package/dist/{analytics_engine-DdXVR8z2.mjs → analytics_engine-B7qgDJCA.mjs} +1 -1
  16. package/dist/{api-gateway-CNv0IHTU.mjs → api-gateway-CWdR4Ne7.mjs} +1 -1
  17. package/dist/{argo-CX_A4kcn.mjs → argo-DnJRVnGX.mjs} +1 -1
  18. package/dist/artifacts-BVWKiJUl.mjs +4 -0
  19. package/dist/{audit-logs-BfBf3oo-.mjs → audit-logs-DjTstbzL.mjs} +1 -1
  20. package/dist/auth-BqDOIrKX.mjs +150 -0
  21. package/dist/auth-DKkSwnxh.mjs +5 -0
  22. package/dist/billing-3rEqF83h.mjs +2 -0
  23. package/dist/{bot-management-CFvtVx62.mjs → bot-management-CJxD1pqi.mjs} +1 -1
  24. package/dist/{botnet-feed-B-M4Yu0W.mjs → botnet-feed-MG91D7BR.mjs} +1 -1
  25. package/dist/{brand-protection-D05Eg-_6.mjs → brand-protection-CK7gJi06.mjs} +1 -1
  26. package/dist/browser-rendering-Rae0AUt0.mjs +4 -0
  27. package/dist/{build-DYkGW4dh.mjs → build-BE4o4imx.mjs} +131 -131
  28. package/dist/{cache-DsoW6Xwv.mjs → cache-B7pRbpTy.mjs} +1 -1
  29. package/dist/{calls-CZbO7TyR.mjs → calls-DXRWsZ8n.mjs} +3 -3
  30. package/dist/{certificate-authorities-D2yr7_3t.mjs → certificate-authorities-BR3gXBLs.mjs} +1 -1
  31. package/dist/chunk-6IEM75FG-U3L9fKgi.mjs +2 -0
  32. package/dist/{client-certificates-MJcDsTId.mjs → client-certificates-B0ebLJdk.mjs} +1 -1
  33. package/dist/{cloud-connector-DWOrN2eM.mjs → cloud-connector-BOjaggJk.mjs} +1 -1
  34. package/dist/{cloudforce-one-2Bhz8YdW.mjs → cloudforce-one-B6HYfk5Z.mjs} +1 -1
  35. package/dist/{completions-BwRpZQVn.mjs → completions-D_9WsLG7.mjs} +1 -1
  36. package/dist/config-7CBz8Xm0.mjs +2 -0
  37. package/dist/{connectivity-BX8C7tvK.mjs → connectivity-welFvZ7X.mjs} +1 -1
  38. package/dist/connector-interrupts-DTV3F-50.mjs +2 -0
  39. package/dist/connector-telemetry-events-kDqb_AGm.mjs +2 -0
  40. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +2 -0
  41. package/dist/connectors-3vjrdFLB.mjs +3 -0
  42. package/dist/content-scanning-CnW2A0pv.mjs +4 -0
  43. package/dist/{context-DGlHRGWM.mjs → context-CONbNKO-.mjs} +1 -1
  44. package/dist/{custom-certificates-aAiEguR7.mjs → custom-certificates-CnYh6Yi-.mjs} +1 -1
  45. package/dist/{custom-hostnames-AG5yBHIi.mjs → custom-hostnames-C2upqZso.mjs} +1 -1
  46. package/dist/{custom-nameservers-D1DtlRue.mjs → custom-nameservers-BGkAD_PZ.mjs} +1 -1
  47. package/dist/{custom-pages-DQCi2plU.mjs → custom-pages-5fCSP8in.mjs} +1 -1
  48. package/dist/{d1-DbnYhw45.mjs → d1-CyiRbZZn.mjs} +1 -1
  49. package/dist/data-security-Casx4OS_.mjs +6 -0
  50. package/dist/{dcv-delegation-CHspSzTI.mjs → dcv-delegation-DVYO10oA.mjs} +1 -1
  51. package/dist/{deploy-CQial3kN.mjs → deploy-KBRFIatG.mjs} +1 -1
  52. package/dist/{dev-B38LfCTl.mjs → dev-pPazzZvt.mjs} +1 -1
  53. package/dist/{diagnostics-BJQGjVJn.mjs → diagnostics-BqYDoDfw.mjs} +1 -1
  54. package/dist/{dispatch-namespaces-DmHvoBOg.mjs → dispatch-namespaces-Cz2rajnP.mjs} +1 -1
  55. package/dist/{dist-AIcZFk0U.mjs → dist-DA54ZQu0.mjs} +7 -7
  56. package/dist/dist-DpDjsWWn.mjs +306 -0
  57. package/dist/{dns-VMhQSr5n.mjs → dns-62t95Xif.mjs} +1 -1
  58. package/dist/{dns-firewall-B4DVXFBQ.mjs → dns-firewall-Coy8d47t.mjs} +1 -1
  59. package/dist/{durable-objects-CTboySEo.mjs → durable-objects-BSuRERkw.mjs} +1 -1
  60. package/dist/{email-routing-tIR2SFu-.mjs → email-routing-BDUYYeV3.mjs} +1 -1
  61. package/dist/{email-security-Ca1id3rZ.mjs → email-security-ChHA6eqQ.mjs} +1 -1
  62. package/dist/{email-sending-DwWKc5jC.mjs → email-sending-CVrRqn6S.mjs} +1 -1
  63. package/dist/{filters-A4dg_a68.mjs → filters-qJpU9uAS.mjs} +1 -1
  64. package/dist/{firewall-DWPQgYd9.mjs → firewall-C3DDwfwh.mjs} +1 -1
  65. package/dist/{fraud-BMkSsJGU.mjs → fraud-DY3YXFVf.mjs} +1 -1
  66. package/dist/{google-tag-gateway-BGD49nRC.mjs → google-tag-gateway-B00MHDfB.mjs} +1 -1
  67. package/dist/{healthchecks-CtIfrFql.mjs → healthchecks-Drvb79v0.mjs} +1 -1
  68. package/dist/{hostnames-BiomxukN.mjs → hostnames-BdAQo1Mr.mjs} +1 -1
  69. package/dist/{hyperdrive-Da104VaQ.mjs → hyperdrive-99OJV9nl.mjs} +1 -1
  70. package/dist/{iam-BIGKo0WW.mjs → iam-BRbpg3lN.mjs} +1 -1
  71. package/dist/images-D1jI3r3O.mjs +7 -0
  72. package/dist/index.mjs +1 -1
  73. package/dist/{intel-CY6_79v8.mjs → intel-C3ajLpXd.mjs} +1 -1
  74. package/dist/{ips-K4bzaGqd.mjs → ips-B6JETVOY.mjs} +1 -1
  75. package/dist/{keyless-certificates-CZC-L8gM.mjs → keyless-certificates-C4MZ4xnf.mjs} +1 -1
  76. package/dist/{kv-8o27w_pY.mjs → kv-CSWoD9ks.mjs} +1 -1
  77. package/dist/{leaked-credential-checks-qLzRyu85.mjs → leaked-credential-checks-Dgs2oKm9.mjs} +2 -2
  78. package/dist/{load-balancers-DtG8nj25.mjs → load-balancers-Du1tNuUt.mjs} +1 -1
  79. package/dist/{logpush-4L0njy1d.mjs → logpush-SuJyO-uX.mjs} +1 -1
  80. package/dist/{logs-B_Yp95hv.mjs → logs-DcDNRPRl.mjs} +1 -1
  81. package/dist/{magic-cloud-networking-CSOM3EM-.mjs → magic-cloud-networking-D-T0RCvi.mjs} +1 -1
  82. package/dist/{magic-network-monitoring-BnwvM4-I.mjs → magic-network-monitoring-CqtvOePQ.mjs} +1 -1
  83. package/dist/{magic-transit-CXDyvhxq.mjs → magic-transit-BTbkhBtF.mjs} +32 -33
  84. package/dist/{managed-transforms-D15yVbZx.mjs → managed-transforms-CfUBSz9p.mjs} +1 -1
  85. package/dist/{mtls-certificates-D8k0AXWK.mjs → mtls-certificates-Cf1O8c2E.mjs} +1 -1
  86. package/dist/{network-interconnects-rrr7red3.mjs → network-interconnects-DsiNytOU.mjs} +1 -1
  87. package/dist/{observability-DWvpqnQJ.mjs → observability-CLqZ7OSi.mjs} +1 -1
  88. package/dist/open-YWOUIZ5Y-BpqIuBsR.mjs +4 -0
  89. package/dist/{organizations-T77D50Sq.mjs → organizations-aRi1bhFC.mjs} +2 -2
  90. package/dist/{origin-ca-certificates-DXIvD8H5.mjs → origin-ca-certificates-BB4H89a_.mjs} +1 -1
  91. package/dist/{origin-post-quantum-encryption-C8oOczyV.mjs → origin-post-quantum-encryption-DurP3PXG.mjs} +1 -1
  92. package/dist/{origin-tls-client-auth-CaVW1Ztp.mjs → origin-tls-client-auth-CnQNy9-l.mjs} +1 -1
  93. package/dist/{output-BJFNwj7b.mjs → output-CUxZRM5A.mjs} +1 -1
  94. package/dist/{page-rules-CjZPTMQX.mjs → page-rules-CYqtPU1p.mjs} +1 -1
  95. package/dist/{page-shield-D5RRNJCY.mjs → page-shield-D8l9ZMUl.mjs} +1 -1
  96. package/dist/{pages-CWJtJnL0.mjs → pages-ChurJ2H7.mjs} +1 -1
  97. package/dist/{pipelines-B0L_7j9e.mjs → pipelines-CeyujvRf.mjs} +1 -1
  98. package/dist/{progress-CrCGTq7N.mjs → progress-Cent9Lsg.mjs} +1 -1
  99. package/dist/{queues-CN6DPhRR.mjs → queues-Rf_n11Cx.mjs} +1 -1
  100. package/dist/{r2-DQIcyRtA.mjs → r2-BtuTO3vQ.mjs} +1 -1
  101. package/dist/{r2-data-catalog-Bbo93TJx.mjs → r2-data-catalog-Debz38kv.mjs} +1 -1
  102. package/dist/radar-CzGM92uM.mjs +2 -0
  103. package/dist/{rate-limits-DcrQV6Ar.mjs → rate-limits-Bbk7HxP7.mjs} +1 -1
  104. package/dist/{raw-fetch-Dlccg0Tr.mjs → raw-fetch-DnbAMFBp.mjs} +1 -1
  105. package/dist/{realtime-kit-CaquuVOE.mjs → realtime-kit-CivLpkpg.mjs} +1 -1
  106. package/dist/{registrar-Ko-xZemf.mjs → registrar-8IeA5DKd.mjs} +1 -1
  107. package/dist/{request-tracers-DOW_reTJ.mjs → request-tracers-D1aH4NmL.mjs} +1 -1
  108. package/dist/{resource-sharing-D7TX0JV0.mjs → resource-sharing-B-Pcto7-.mjs} +3 -3
  109. package/dist/{resource-tagging-C3qtLzCz.mjs → resource-tagging-Bpb6Qq1M.mjs} +1 -1
  110. package/dist/{rules-BXRADHL5.mjs → rules-B10XWY10.mjs} +1 -1
  111. package/dist/{rulesets-CBgpeSvJ.mjs → rulesets-lYczEcJp.mjs} +1 -1
  112. package/dist/{rum-BjPptTUP.mjs → rum-B5GUKa4I.mjs} +3 -3
  113. package/dist/{schema-D16TgWBg.mjs → schema-hefO-tzo.mjs} +1 -1
  114. package/dist/{schema-validation-Dgv_opM3.mjs → schema-validation-DTq517Em.mjs} +1 -1
  115. package/dist/{scim-DdSEr4kZ.mjs → scim-BiLfOQ89.mjs} +1 -1
  116. package/dist/{secrets-store-7BfyvJLb.mjs → secrets-store-CBX0dvHL.mjs} +1 -1
  117. package/dist/{security-center-DAy6AKtT.mjs → security-center-AVpTOBK3.mjs} +1 -1
  118. package/dist/{security-txt-xAMb7K6Y.mjs → security-txt-DVlh8y9l.mjs} +1 -1
  119. package/dist/{session-COHHdS7A.mjs → session-CsvPYFj8.mjs} +2 -2
  120. package/dist/shared-0bwWVDLo.mjs +2 -0
  121. package/dist/{smart-shield-TeWZFnH2.mjs → smart-shield-DblHIce0.mjs} +1 -1
  122. package/dist/{snippets-CCSsCXVs.mjs → snippets-DrpqSXYC.mjs} +1 -1
  123. package/dist/{spawn-DcppKGI5.mjs → spawn-DK7pott_.mjs} +1 -1
  124. package/dist/{spectrum-CTTZID8u.mjs → spectrum-CnrG0jIC.mjs} +2 -2
  125. package/dist/speed-BzRY3Xlh.mjs +4 -0
  126. package/dist/{src-BW6vfAwE.mjs → src-D9_Gq68b.mjs} +10 -10
  127. package/dist/{ssl-BWA2LdwC.mjs → ssl-Cp6tQkZH.mjs} +1 -1
  128. package/dist/stream-CGTRN4ZN.mjs +14 -0
  129. package/dist/{tenants-Bd7NGQ_m.mjs → tenants-o_M62Y1n.mjs} +1 -1
  130. package/dist/{token-validation-DAgtFOvs.mjs → token-validation-Ca5AGEns.mjs} +1 -1
  131. package/dist/{tools-DXQmfFuE.mjs → tools-DtNNmO6l.mjs} +1 -1
  132. package/dist/{turnstile-cfdaO4ca.mjs → turnstile-l7mo9BWL.mjs} +2 -2
  133. package/dist/{ui-D4KtlMh9.mjs → ui-B97lRnOv.mjs} +1 -1
  134. package/dist/{url-normalization-B5RN4nLD.mjs → url-normalization-D1CogSIG.mjs} +1 -1
  135. package/dist/{url-scanner-BrZ1L9OC.mjs → url-scanner-BnJHJqcz.mjs} +1 -1
  136. package/dist/{user-CAo-yCJA.mjs → user-CiyYZ69X.mjs} +2 -2
  137. package/dist/{vectorize-C7_oQlaI.mjs → vectorize-D3LgMLOn.mjs} +1 -1
  138. package/dist/{versions-CUwWJWmy.mjs → versions-B6E8WQyA.mjs} +1 -1
  139. package/dist/{waiting-rooms-Dln5ICg5.mjs → waiting-rooms-Bhy_nuV3.mjs} +1 -1
  140. package/dist/{web3-HQJRm38W.mjs → web3-DlHE0CZc.mjs} +1 -1
  141. package/dist/{workers-Dg7ddG2Q.mjs → workers-DRAkU6YR.mjs} +1 -1
  142. package/dist/{workers-builds-AVfx8IyL.mjs → workers-builds-BmNjiHDZ.mjs} +1 -1
  143. package/dist/{workflows-VquuSh2J.mjs → workflows-z6oapEJs.mjs} +1 -1
  144. package/dist/{zaraz-xYSWIV4P.mjs → zaraz-CyzfYOEU.mjs} +1 -1
  145. package/dist/{zero-trust-CP96wnSh.mjs → zero-trust-fyyIelWx.mjs} +44 -44
  146. package/dist/zero_trust-BAhlNkjo.mjs +3 -0
  147. package/dist/{zones-BSgmZ9WC.mjs → zones-MSULnDwW.mjs} +4 -4
  148. package/package.json +4 -4
  149. package/dist/ai-search-CQF_Sn7d.mjs +0 -7
  150. package/dist/auth-SyWhMmPu.mjs +0 -6
  151. package/dist/auth-ffdf9yR0.mjs +0 -135
  152. package/dist/autorag-BuGhGTeZ.mjs +0 -2
  153. package/dist/billing-PoG81XaQ.mjs +0 -2
  154. package/dist/browser-rendering-xu8F_Rrv.mjs +0 -4
  155. package/dist/config-DYzlVxcB.mjs +0 -2
  156. package/dist/content-scanning-r6uzMO1r.mjs +0 -4
  157. package/dist/data-security-D_EtYBfo.mjs +0 -6
  158. package/dist/dist-DNBSHor6.mjs +0 -301
  159. package/dist/images-BO8FbDAa.mjs +0 -5
  160. package/dist/radar-Bxb0WX8V.mjs +0 -2
  161. package/dist/shared-AGtpXwwL.mjs +0 -2
  162. package/dist/speed-CuzTE0AL.mjs +0 -4
  163. package/dist/stream-GFsIZ-pP.mjs +0 -14
  164. /package/dist/{body-parser-DKa8Ipg1.mjs → body-parser-CBpeIUns.mjs} +0 -0
  165. /package/dist/{cli-types-CRIDdDw3.mjs → cli-types-CMNMD1V7.mjs} +0 -0
  166. /package/dist/{input-validation-zEO81MWN.mjs → input-validation-CTqtyiY9.mjs} +0 -0
  167. /package/dist/{lib-Eu1wXxuh.mjs → lib-B6xvCJjc.mjs} +0 -0
  168. /package/dist/{local-VJaJ3BZ1.mjs → local-D8bhHUMK.mjs} +0 -0
  169. /package/dist/{metadata-5VwHPW6C.mjs → metadata-jh2EIan8.mjs} +0 -0
  170. /package/dist/{resolve-4-OSeHlK.mjs → resolve-D1mG0REg.mjs} +0 -0
  171. /package/dist/{theme-BklJDrb2.mjs → theme-CFHr0Dh9.mjs} +0 -0
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(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 p={command:`bulk-create`,describe:`Modifies one or more rules in a Web Analytics ruleset with a single request.`,builder:f,handler:async t=>{if(t.dryRun){s({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({delete_rules:t[`delete-rules`]}):i(t.body)});return}let l=await r(t),d=t.local?u:await n(l);if(t.accountId=d,t.body){let e=i(t.body);o(await c(`Creating`,async()=>l.rum.rules.bulkCreate({...e,account_id:d,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`});return}let f=a({delete_rules:t[`delete-rules`]});o(await c(`Creating`,async()=>l.rum.rules.bulkCreate({...f,account_id:d,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`})}};function m(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 h={command:`create <ruleset-id>`,describe:`Creates a new rule in a Web Analytics ruleset.`,builder:m,handler:async t=>{if(t.dryRun){s({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.rum.rules.create({body:e,account_id:f,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`});return}let p=a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths});o(await c(`Creating`,async()=>d.rum.rules.create({body:p,account_id:f,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`})}};function g(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 _={command:`delete <rule-id>`,describe:`Deletes an existing rule from a Web Analytics ruleset.`,builder:g,handler:async i=>{if(i.dryRun){s({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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 r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>a.rum.rules.delete({account_id:l,ruleset_id:i[`ruleset-id`],rule_id:i[`rule-id`]})),{successLabel:`Deleted`})}};function v(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 y={command:`list`,describe:`Lists all the rules in a Web Analytics ruleset.`,builder:v,handler:async t=>{if(t.dryRun){s({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.rum.rules.list({account_id:a,ruleset_id:t[`ruleset-id`]})),{successLabel:`Loaded`})}};function b(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 x={command:`update <rule-id>`,describe:`Updates a rule in a Web Analytics ruleset.`,builder:b,handler:async t=>{if(t.dryRun){s({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rule/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``),"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.rum.rules.update({body:e,account_id:f,ruleset_id:t[`ruleset-id`],rule_id:t[`rule-id`]})),{successLabel:`Updated`});return}let p=a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths});o(await c(`Updating`,async()=>d.rum.rules.update({body:p,account_id:f,ruleset_id:t[`ruleset-id`],rule_id:t[`rule-id`]})),{successLabel:`Updated`})}},S={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(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 w={command:`create`,describe:`Creates a new Web Analytics site.`,builder:C,handler:async t=>{if(t.dryRun){s({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({auto_install:t[`auto-install`],host:l(t.host,`host`,`text`),zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.rum.siteInfo.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({auto_install:t[`auto-install`],host:l(t.host,`host`,`text`),zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)});o(await c(`Creating`,async()=>d.rum.siteInfo.create({...p,account_id:f})),{successLabel:`Created`})}};function T(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 E={command:`delete <site-id>`,describe:`Deletes an existing Web Analytics site.`,builder:T,handler:async i=>{if(i.dryRun){s({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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 r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>a.rum.siteInfo.delete({account_id:l,site_id:i[`site-id`]})),{successLabel:`Deleted`})}};function D(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 O={command:`get <site-id>`,describe:`Retrieves a Web Analytics site.`,builder:D,handler:async t=>{if(t.dryRun){s({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.rum.siteInfo.get({account_id:a,site_id:t[`site-id`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all Web Analytics sites of an account.`,builder:d(k),handler:async t=>{let i={per_page:t[`per-page`],page:t.page,order_by:t[`order-by`]};if(t.dryRun){s({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.rum.siteInfo.list({account_id:l,...i})),{successLabel:`Loaded`})}};function j(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 M={command:`update <site-id>`,describe:`Updates an existing Web Analytics site.`,builder:j,handler:async t=>{if(t.dryRun){s({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({auto_install:t[`auto-install`],enabled:t.enabled,host:l(t.host,`host`,`text`),lite:t.lite,zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.rum.siteInfo.update({...e,account_id:f,site_id:t[`site-id`]})),{successLabel:`Updated`});return}let p=a({auto_install:t[`auto-install`],enabled:t.enabled,host:l(t.host,`host`,`text`),lite:t.lite,zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)});o(await c(`Updating`,async()=>d.rum.siteInfo.update({...p,account_id:f,site_id:t[`site-id`]})),{successLabel:`Updated`})}},N={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(S).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
2
+ import{C as e,T as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";import{t as d}from"./cli-types-CMNMD1V7.mjs";function f(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 p={command:`bulk-create`,describe:`Modifies one or more rules in a Web Analytics ruleset with a single request.`,builder:f,handler:async t=>{if(t.dryRun){s({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({delete_rules:t[`delete-rules`]}):i(t.body)});return}let l=await r(t),d=t.local?u:await n(l);if(t.accountId=d,t.body){let e=i(t.body);o(await c(`Creating`,async()=>l.rum.rules.bulkCreate({...e,account_id:d,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`});return}let f=a({delete_rules:t[`delete-rules`]});o(await c(`Creating`,async()=>l.rum.rules.bulkCreate({...f,account_id:d,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`})}};function m(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 h={command:`create <ruleset-id>`,describe:`Creates a new rule in a Web Analytics ruleset.`,builder:m,handler:async t=>{if(t.dryRun){s({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.rum.rules.create({body:e,account_id:f,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`});return}let p=a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths});o(await c(`Creating`,async()=>d.rum.rules.create({body:p,account_id:f,ruleset_id:t[`ruleset-id`]})),{successLabel:`Created`})}};function g(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 _={command:`delete <rule-id>`,describe:`Deletes an existing rule from a Web Analytics ruleset.`,builder:g,handler:async i=>{if(i.dryRun){s({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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 r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
3
+ `);return}o(await c(`Deleting`,async()=>a.rum.rules.delete({account_id:l,ruleset_id:i[`ruleset-id`],rule_id:i[`rule-id`]})),{successLabel:`Deleted`})}};function v(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 y={command:`list`,describe:`Lists all the rules in a Web Analytics ruleset.`,builder:v,handler:async t=>{if(t.dryRun){s({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.rum.rules.list({account_id:a,ruleset_id:t[`ruleset-id`]})),{successLabel:`Loaded`})}};function b(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 x={command:`update <rule-id>`,describe:`Updates a rule in a Web Analytics ruleset.`,builder:b,handler:async t=>{if(t.dryRun){s({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/v2/${t[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(t[`ruleset-id`]))}/rule/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"ruleset-id":String(t[`ruleset-id`]??``),"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.rum.rules.update({body:e,account_id:f,ruleset_id:t[`ruleset-id`],rule_id:t[`rule-id`]})),{successLabel:`Updated`});return}let p=a({host:l(t.host,`host`,`text`),inclusive:t.inclusive,is_paused:t[`is-paused`],paths:t.paths});o(await c(`Updating`,async()=>d.rum.rules.update({body:p,account_id:f,ruleset_id:t[`ruleset-id`],rule_id:t[`rule-id`]})),{successLabel:`Updated`})}},S={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(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 w={command:`create`,describe:`Creates a new Web Analytics site.`,builder:C,handler:async t=>{if(t.dryRun){s({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({auto_install:t[`auto-install`],host:l(t.host,`host`,`text`),zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.rum.siteInfo.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({auto_install:t[`auto-install`],host:l(t.host,`host`,`text`),zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)});o(await c(`Creating`,async()=>d.rum.siteInfo.create({...p,account_id:f})),{successLabel:`Created`})}};function T(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 E={command:`delete <site-id>`,describe:`Deletes an existing Web Analytics site.`,builder:T,handler:async i=>{if(i.dryRun){s({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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 r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
4
+ `);return}o(await c(`Deleting`,async()=>a.rum.siteInfo.delete({account_id:l,site_id:i[`site-id`]})),{successLabel:`Deleted`})}};function D(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 O={command:`get <site-id>`,describe:`Retrieves a Web Analytics site.`,builder:D,handler:async t=>{if(t.dryRun){s({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.rum.siteInfo.get({account_id:a,site_id:t[`site-id`]})),{successLabel:`Loaded`})}};function k(e){return e.option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all Web Analytics sites of an account.`,builder:d(k),handler:async t=>{let i={per_page:t[`per-page`],page:t.page,order_by:t[`order-by`]};if(t.dryRun){s({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.rum.siteInfo.list({account_id:l,...i})),{successLabel:`Loaded`})}};function j(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 M={command:`update <site-id>`,describe:`Updates an existing Web Analytics site.`,builder:j,handler:async t=>{if(t.dryRun){s({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/rum/site_info/${t[`site-id`]==null?`<site-id>`:encodeURIComponent(String(t[`site-id`]))}`,pathParams:{"site-id":String(t[`site-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({auto_install:t[`auto-install`],enabled:t.enabled,host:l(t.host,`host`,`text`),lite:t.lite,zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.rum.siteInfo.update({...e,account_id:f,site_id:t[`site-id`]})),{successLabel:`Updated`});return}let p=a({auto_install:t[`auto-install`],enabled:t.enabled,host:l(t.host,`host`,`text`),lite:t.lite,zone_tag:l(t[`zone-tag`],`zone-tag`,`text`)});o(await c(`Updating`,async()=>d.rum.siteInfo.update({...p,account_id:f,site_id:t[`site-id`]})),{successLabel:`Updated`})}},N={command:`site-info`,describe:`Operations for site-info`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`rum`,describe:`rum`,builder:e=>e.command(S).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./output-BJFNwj7b.mjs";import{n as t}from"./metadata-5VwHPW6C.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const r={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async r=>{let i=t(import.meta.url,`schemas.json`,n);if(i||(console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.entries(i.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId})));return}r.command.length===0&&(console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),process.exit(1));let a=r.command.join(` `),o=i.schemas[a];if(!o){let e=Object.keys(i.schemas).filter(e=>e.includes(a)||a.includes(e));if(e.length>0){console.error(`Schema not found for "${a}". Did you mean:`);for(let t of e)console.error(` cf schema ${t}`)}else console.error(`Schema not found for "${a}". Use --list to see available schemas.`);process.exit(1)}e(o)}};export{r as default};
2
+ import{t as e}from"./output-CUxZRM5A.mjs";import{n as t}from"./metadata-jh2EIan8.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const r={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async r=>{let i=t(import.meta.url,`schemas.json`,n);if(i||(console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.entries(i.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId})));return}r.command.length===0&&(console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),process.exit(1));let a=r.command.join(` `),o=i.schemas[a];if(!o){let e=Object.keys(i.schemas).filter(e=>e.includes(a)||a.includes(e));if(e.length>0){console.error(`Schema not found for "${a}". Did you mean:`);for(let t of e)console.error(` cf schema ${t}`)}else console.error(`Schema not found for "${a}". Use --list to see available schemas.`);process.exit(1)}e(o)}};export{r as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,E as t,S as n,T as r,i,n as a}from"./auth-ffdf9yR0.mjs";import{n as o,t as s}from"./body-parser-DKa8Ipg1.mjs";import{t as c}from"./output-BJFNwj7b.mjs";import{n as l,t as u}from"./progress-CrCGTq7N.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./cli-types-CRIDdDw3.mjs";function p(e){return e.option(`kind`,{type:`string`,description:`The kind of the schema`,choices:[`openapi_v3`]}).option(`name`,{type:`string`,description:`A human-readable name for the schema`}).option(`source`,{type:`string`,description:`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`}).option(`validation-enabled`,{type:`boolean`,description:`An indicator if this schema is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Uploads a new OpenAPI schema for API Shield schema validation. The schema defines expected request/response formats for API endpoints.`,builder:p,handler:async r=>{if(r.dryRun){l({command:`cf schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({kind:d(r.kind,`kind`,`text`),name:d(r.name,`name`,`text`),source:d(r.source,`source`,`text`),validation_enabled:r[`validation-enabled`]}):o(r.body)});return}let i=await a(r),f=await n({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=f,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.schemaValidation.schemas.create({...e,zone_id:f})),{successLabel:`Created`});return}if(r.kind===void 0&&(r.kind=await t(`kind`,`The kind of the schema`,[`openapi_v3`])),r.name===void 0&&(r.name=await e(`name`,`A human-readable name for the schema`)),r.source===void 0&&(r.source=await e(`source`,`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`)),r[`validation-enabled`]===void 0)throw Error(`--validation-enabled is required (or pass --body with this field set).`);let p=s({kind:d(r.kind,`kind`,`text`),name:d(r.name,`name`,`text`),source:d(r.source,`source`,`text`),validation_enabled:r[`validation-enabled`]});c(await u(`Creating`,async()=>i.schemaValidation.schemas.create({...p,zone_id:f})),{successLabel:`Created`})}};function h(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,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 <schema-id>`,describe:`Permanently removes an uploaded OpenAPI schema from API Shield. Operations using this schema will lose their validation rules.`,builder:h,handler:async e=>{if(e.dryRun){l({command:`cf schema-validation schemas delete`,method:`DELETE`,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:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
2
+ import{D as e,E as t,S as n,T as r,i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./cli-types-CMNMD1V7.mjs";function p(e){return e.option(`kind`,{type:`string`,description:`The kind of the schema`,choices:[`openapi_v3`]}).option(`name`,{type:`string`,description:`A human-readable name for the schema`}).option(`source`,{type:`string`,description:`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`}).option(`validation-enabled`,{type:`boolean`,description:`An indicator if this schema is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Uploads a new OpenAPI schema for API Shield schema validation. The schema defines expected request/response formats for API endpoints.`,builder:p,handler:async r=>{if(r.dryRun){l({command:`cf schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({kind:d(r.kind,`kind`,`text`),name:d(r.name,`name`,`text`),source:d(r.source,`source`,`text`),validation_enabled:r[`validation-enabled`]}):o(r.body)});return}let i=await a(r),f=await n({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=f,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.schemaValidation.schemas.create({...e,zone_id:f})),{successLabel:`Created`});return}if(r.kind===void 0&&(r.kind=await t(`kind`,`The kind of the schema`,[`openapi_v3`])),r.name===void 0&&(r.name=await e(`name`,`A human-readable name for the schema`)),r.source===void 0&&(r.source=await e(`source`,`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`)),r[`validation-enabled`]===void 0)throw Error(`--validation-enabled is required (or pass --body with this field set).`);let p=s({kind:d(r.kind,`kind`,`text`),name:d(r.name,`name`,`text`),source:d(r.source,`source`,`text`),validation_enabled:r[`validation-enabled`]});c(await u(`Creating`,async()=>i.schemaValidation.schemas.create({...p,zone_id:f})),{successLabel:`Created`})}};function h(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,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 <schema-id>`,describe:`Permanently removes an uploaded OpenAPI schema from API Shield. Operations using this schema will lose their validation rules.`,builder:h,handler:async e=>{if(e.dryRun){l({command:`cf schema-validation schemas delete`,method:`DELETE`,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:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}c(await u(`Deleting`,async()=>t.schemaValidation.schemas.delete({zone_id:i,schema_id:e[`schema-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,demandOption:!0}).option(`validation-enabled`,{type:`boolean`,description:`Flag whether schema is enabled for validation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <schema-id>`,describe:`Modifies an existing OpenAPI schema in API Shield, updating the validation rules for associated API operations.`,builder:_,handler:async e=>{if(e.dryRun){l({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:e.body===void 0?s({validation_enabled:e[`validation-enabled`]}):o(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=o(e.body);c(await u(`Updating`,async()=>t.schemaValidation.schemas.edit({...n,zone_id:r,schema_id:e[`schema-id`]})),{successLabel:`Updated`});return}let i=s({validation_enabled:e[`validation-enabled`]});c(await u(`Updating`,async()=>t.schemaValidation.schemas.edit({...i,zone_id:r,schema_id:e[`schema-id`]})),{successLabel:`Updated`})}};function y(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,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 b={command:`get <schema-id>`,describe:`Gets the contents and metadata of a specific OpenAPI schema uploaded to API Shield.`,builder:y,handler:async e=>{let t={omit_source:e[`omit-source`]};if(e.dryRun){l({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:t,bodyKind:`none`});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,c(await u(`Loading`,async()=>r.schemaValidation.schemas.get({zone_id:i,schema_id:e[`schema-id`],...t})),{successLabel:`Loaded`})}};function x(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 S={command:`list`,describe:`Lists all unique hosts found in uploaded OpenAPI schemas for the zone.`,builder:x,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({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:t,bodyKind:`none`});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,c(await u(`Loading`,async()=>r.schemaValidation.schemas.hosts.list({zone_id:i,...t})),{successLabel:`Loaded`})}},C={command:`hosts`,describe:`List schema hosts and extract operations from uploaded schemas`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(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 T={command:`list`,describe:`Lists all OpenAPI schemas uploaded to API Shield with pagination support.`,builder:w,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],omit_source:e[`omit-source`],validation_enabled:e[`validation-enabled`]};if(e.dryRun){l({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:t,bodyKind:`none`});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,c(await u(`Loading`,async()=>r.schemaValidation.schemas.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function E(e){return e.positional(`schema-id`,{type:`string`,description:`The unique identifier of the schema`,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 D={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:f(E),handler:async e=>{let t={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){l({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:t,bodyKind:`none`});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,c(await u(`Loading`,async()=>r.schemaValidation.schemas.operations.get({zone_id:i,schema_id:e[`schema-id`],...t})),{successLabel:`Loaded`})}},O={command:`operations`,describe:`List schema hosts and extract operations from uploaded schemas`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},k={command:`schemas`,describe:`Uploaded API schemas used to validate incoming requests against expected formats`,builder:e=>e.command(m).command(g).command(v).command(b).command(T).command(C).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`validation-default-mitigation-action`,{type:`string`,description:`The default mitigation action used
4
4
  Mitigation actions are as follows:
5
5
 
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,i as r,n as i}from"./auth-ffdf9yR0.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c,t as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={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:f,handler:async t=>{if(t.dryRun){o({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:t.body});return}let d=await i(t),f=t.local?u:await n(d);if(t.accountId=f,t.file){let e=l(t.file);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body){let e=c(t.body,`body`,`binary`);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function m(e){return e.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 h={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:m,handler:async r=>{if(r.dryRun){o({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?u:await n(c);if(r.accountId=l,!await t({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{C as e,T as t,_ as n,i as r,n as i}from"./auth-BqDOIrKX.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c,t as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";import{t as d}from"./cli-types-CMNMD1V7.mjs";function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={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:f,handler:async t=>{if(t.dryRun){o({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:t.body});return}let d=await i(t),f=t.local?u:await n(d);if(t.accountId=f,t.file){let e=l(t.file);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body){let e=c(t.body,`body`,`binary`);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function m(e){return e.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 h={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:m,handler:async r=>{if(r.dryRun){o({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?u:await n(c);if(r.accountId=l,!await t({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.scim.groups.delete({account_id:l,group_id:r[`group-id`]})),{successLabel:`Deleted`})}};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}).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 _={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:g,handler:async t=>{if(t.dryRun){o({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`octet-stream`,body:t.body});return}let d=await i(t),f=t.local?u:await n(d);if(t.accountId=f,t.file){let e=l(t.file);a(await s(`Updating`,async()=>r(d,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(t[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body){let e=c(t.body,`body`,`binary`);a(await s(`Updating`,async()=>r(d,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(t[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function v(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 y={command:`get <group-id>`,describe:`Retrieves a single SCIM Group resource by group ID.`,builder:v,handler:async t=>{if(t.dryRun){o({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.groups.get({account_id:c,group_id:t[`group-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 `displayName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={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:b,handler:async t=>{let r={startIndex:t[`start-index`],count:t.count,filter:t.filter};if(t.dryRun){o({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Groups`,pathParams:{},query:r,bodyKind:`none`});return}let c=await i(t),l=t.local?u:await n(c);t.accountId=l,a(await s(`Loading`,async()=>c.scim.groups.list({account_id:l,...r})),{successLabel:`Loaded`})}},S={command:`groups`,describe:`Groups operations`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(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 w={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:d(C),handler:async t=>{if(t.dryRun){o({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/ResourceTypes/${t[`resource-type-id`]==null?`<resource-type-id>`:encodeURIComponent(String(t[`resource-type-id`]))}`,pathParams:{"resource-type-id":String(t[`resource-type-id`]??``)},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.resourceTypes.get({account_id:c,resource_type_id:t[`resource-type-id`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={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:T,handler:async t=>{if(t.dryRun){o({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.resourceTypes.list({account_id:c})),{successLabel:`Loaded`})}},D={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(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 k={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:O,handler:async t=>{if(t.dryRun){o({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Schemas/${t[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(t[`schema-id`]))}`,pathParams:{"schema-id":String(t[`schema-id`]??``)},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.schemas.get({account_id:c,schema_id:t[`schema-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={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:A,handler:async t=>{if(t.dryRun){o({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.schemas.list({account_id:c})),{successLabel:`Loaded`})}},M={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={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:N,handler:async t=>{if(t.dryRun){o({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.serviceProviderConfig.get({account_id:c})),{successLabel:`Loaded`})}},F={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 L={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:I,handler:async t=>{if(t.dryRun){o({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:t.body});return}let d=await i(t),f=t.local?u:await n(d);if(t.accountId=f,t.file){let e=l(t.file);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.body){let e=c(t.body,`body`,`binary`);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(t.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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const z={command:`edit <user-id>`,describe:'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:R,handler:async t=>{if(t.dryRun){o({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`octet-stream`,body:t.body});return}let d=await i(t),f=t.local?u:await n(d);if(t.accountId=f,t.file){let e=l(t.file);a(await s(`Updating`,async()=>r(d,`PATCH`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(t[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body){let e=c(t.body,`body`,`binary`);a(await s(`Updating`,async()=>r(d,`PATCH`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(t[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function B(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 V={command:`get <user-id>`,describe:`Retrieves a single account member as a SCIM User resource by user tag.`,builder:B,handler:async t=>{if(t.dryRun){o({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let r=await i(t),c=t.local?u:await n(r);t.accountId=c,a(await s(`Loading`,async()=>r.scim.users.get({account_id:c,user_id:t[`user-id`]})),{successLabel:`Loaded`})}};function H(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 U={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:H,handler:async t=>{let r={startIndex:t[`start-index`],count:t.count,filter:t.filter};if(t.dryRun){o({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Users`,pathParams:{},query:r,bodyKind:`none`});return}let c=await i(t),l=t.local?u:await n(c);t.accountId=l,a(await s(`Loading`,async()=>c.scim.users.list({account_id:l,...r})),{successLabel:`Loaded`})}};function W(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 G={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:W,handler:async t=>{if(t.dryRun){o({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/scim/v2/Users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`octet-stream`,body:t.body});return}let d=await i(t),f=t.local?u:await n(d);if(t.accountId=f,t.file){let e=l(t.file);a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(t[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body){let e=c(t.body,`body`,`binary`);a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(t[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},K={command:`users`,describe:`Users operations`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(S).command(D).command(M).command(F).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";import{t as f}from"./cli-types-CRIDdDw3.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Lists the number of secrets used in the account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.secretsStore.quota.get({account_id:a})),{successLabel:`Loaded`})}},ee={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(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 g={command:`create <store-id>`,describe:`Creates a secret in the account`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),o=t.local?d:await r(n);if(t.accountId=o,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.secretsStore.secrets.bulk.create({body:e,account_id:o,store_id:t[`store-id`]})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function _(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 v={command:`delete <store-id>`,describe:`Deletes one or more secrets`,builder:_,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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:t.body===void 0?o({ids:t.ids}):a(t.body)});return}let u=await i(t),f=t.local?d:await r(u);if(t.accountId=f,!await n({force:!!t.force})){process.stderr.write(`Aborted.
2
+ import{C as e,D as t,T as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";import{t as f}from"./cli-types-CMNMD1V7.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Lists the number of secrets used in the account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.secretsStore.quota.get({account_id:a})),{successLabel:`Loaded`})}},ee={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(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 g={command:`create <store-id>`,describe:`Creates a secret in the account`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),o=t.local?d:await r(n);if(t.accountId=o,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.secretsStore.secrets.bulk.create({body:e,account_id:o,store_id:t[`store-id`]})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function _(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 v={command:`delete <store-id>`,describe:`Deletes one or more secrets`,builder:_,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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:t.body===void 0?o({ids:t.ids}):a(t.body)});return}let u=await i(t),f=t.local?d:await r(u);if(t.accountId=f,!await n({force:!!t.force})){process.stderr.write(`Aborted.
3
3
  `);return}if(t.body){let e=a(t.body);s(await l(`Deleting`,async()=>u.secretsStore.secrets.bulk.delete({body:e,account_id:f,store_id:t[`store-id`]})),{successLabel:`Deleted`});return}if(t.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let p=o({ids:t.ids});s(await l(`Deleting`,async()=>u.secretsStore.secrets.bulk.delete({body:p,account_id:f,store_id:t[`store-id`]})),{successLabel:`Deleted`})}},y={command:`bulk`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(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 x={command:`delete <secret-id>`,describe:`Deletes a single secret`,builder:b,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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 i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
4
4
  `);return}s(await l(`Deleting`,async()=>a.secretsStore.secrets.delete({account_id:o,store_id:t[`store-id`],secret_id:t[`secret-id`]})),{successLabel:`Deleted`})}};function S(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 C={command:`duplicate <secret-id>`,describe:`Duplicates the secret, keeping the value`,builder:S,handler:async n=>{if(n.dryRun){c({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secrets_store/stores/${n[`store-id`]==null?`<store-id>`:encodeURIComponent(String(n[`store-id`]))}/secrets/${n[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(n[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(n[`store-id`]??``),"secret-id":String(n[`secret-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({comment:u(n.comment,`comment`,`text`),name:u(n.name,`name`,`text`),scopes:n.scopes}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.secretsStore.secrets.duplicate({body:e,account_id:p,store_id:n[`store-id`],secret_id:n[`secret-id`]})),{successLabel:`Created`});return}if(n.name===void 0&&(n.name=await t(`name`,`The name of the secret`)),n.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let m=o({comment:u(n.comment,`comment`,`text`),name:u(n.name,`name`,`text`),scopes:n.scopes});s(await l(`Creating`,async()=>f.secretsStore.secrets.duplicate({body:m,account_id:p,store_id:n[`store-id`],secret_id:n[`secret-id`]})),{successLabel:`Created`})}};function w(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 T={command:`edit <secret-id>`,describe:`Updates a single secret`,builder:w,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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:`json`,body:t.body===void 0?o({comment:u(t.comment,`comment`,`text`),scopes:t.scopes,value:u(t.value,`value`,`text`)}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.secretsStore.secrets.edit({body:e,account_id:f,store_id:t[`store-id`],secret_id:t[`secret-id`]})),{successLabel:`Updated`});return}let p=o({comment:u(t.comment,`comment`,`text`),scopes:t.scopes,value:u(t.value,`value`,`text`)});s(await l(`Updating`,async()=>n.secretsStore.secrets.edit({body:p,account_id:f,store_id:t[`store-id`],secret_id:t[`secret-id`]})),{successLabel:`Updated`})}};function E(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 D={command:`get <secret-id>`,describe:`Returns details of a single secret`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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 n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.secretsStore.secrets.get({account_id:a,store_id:t[`store-id`],secret_id:t[`secret-id`]})),{successLabel:`Loaded`})}};function O(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 k={command:`list`,describe:`Lists all store secrets`,builder:f(O),handler:async t=>{let n={direction:t.direction,page:t.page,per_page:t[`per-page`],search:t.search,order:t.order,scopes:t.scopes};if(t.dryRun){c({command:`cf secrets-store secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secrets_store/stores/${t[`store-id`]==null?`<store-id>`:encodeURIComponent(String(t[`store-id`]))}/secrets`,pathParams:{"store-id":String(t[`store-id`]??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.secretsStore.secrets.list({account_id:o,store_id:t[`store-id`],...n})),{successLabel:`Loaded`})}},A={command:`secrets`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(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 M={command:`create`,describe:`Creates a store in the account`,builder:j,handler:async n=>{if(n.dryRun){c({command:`cf secrets-store stores create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secrets_store/stores`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({name:u(n.name,`name`,`text`)}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.secretsStore.stores.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`The name of the store`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.secretsStore.stores.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.positional(`store-id`,{type:`string`,description:`Store Identifier`,demandOption:!0}).option(`force`,{type:`boolean`,description:`When true, cascade-deletes all secrets in the store before deleting
5
5
  the store itself. Required when deleting a non-empty store. Without
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,S as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{t as l}from"./local-VJaJ3BZ1.mjs";import{t as u}from"./cli-types-CRIDdDw3.mjs";function d(e){return e.option(`dismissed`,{type:`boolean`,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 f={command:`get`,describe:`Retrieves Security Center insight counts aggregated by classification class.`,builder:u(d),handler:async t=>{let i={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 insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/class`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.class.get({account_id:u,...i})),{successLabel:`Loaded`})}},p={command:`class`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(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 h={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:m,handler:async t=>{if(t.dryRun){s({command:`cf security-center insights dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({dismiss:t.dismiss}):i(t.body)});return}let u=await r(t),d=t.local?l:await n(u);if(t.accountId=d,t.body){let e=i(t.body);o(await c(`Updating`,async()=>u.securityCenter.insights.dismiss({...e,account_id:d,issue_id:t[`issue-id`]})),{successLabel:`Updated`});return}let f=a({dismiss:t.dismiss});o(await c(`Updating`,async()=>u.securityCenter.insights.dismiss({...f,account_id:d,issue_id:t[`issue-id`]})),{successLabel:`Updated`})}};function g(e){return e.option(`dismissed`,{type:`boolean`,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:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Lists all Security Center insights for the account, showing security findings and recommendations.`,builder:u(g),handler:async t=>{let i={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 insights list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.list({account_id:u,...i})),{successLabel:`Loaded`})}};function v(e){return e.option(`dismissed`,{type:`boolean`,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 y={command:`get`,describe:`Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`,builder:u(v),handler:async t=>{let i={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 insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/severity`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.severity.get({account_id:u,...i})),{successLabel:`Loaded`})}},b={command:`severity`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dismissed`,{type:`boolean`,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 S={command:`get`,describe:`Retrieves Security Center insight counts aggregated by insight type.`,builder:u(x),handler:async t=>{let i={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 insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/type`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.type.get({account_id:u,...i})),{successLabel:`Loaded`})}},C={command:`type`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`insights`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(h).command(_).command(p).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dismissed`,{type:`boolean`,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 E={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by classification class.`,builder:u(T),handler:async e=>{let n={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 zone-insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/class`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.class.get({zone_id:a,...n})),{successLabel:`Loaded`})}},D={command:`class`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(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 k={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:O,handler:async t=>{if(t.dryRun){s({command:`cf security-center zone-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/context`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?l:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.context.get({account_id:a,issue_id:t[`issue-id`]})),{successLabel:`Loaded`})}},A={command:`context`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(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:`update <issue-id>`,describe:`Archives a zone-specific Security Center insight, removing it from the active zone insights while preserving historical data.`,builder:j,handler:async e=>{if(e.dryRun){s({command:`cf security-center zone-insights dismiss update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/dismiss`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({dismiss:e.dismiss}):i(e.body)});return}let n=await r(e),l=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.securityCenter.zoneInsights.dismiss.update({...t,zone_id:l,issue_id:e[`issue-id`]})),{successLabel:`Updated`});return}let u=a({dismiss:e.dismiss});o(await c(`Updating`,async()=>n.securityCenter.zoneInsights.dismiss.update({...u,zone_id:l,issue_id:e[`issue-id`]})),{successLabel:`Updated`})}},N={command:`dismiss`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dismissed`,{type:`boolean`,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:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Lists Security Center insights for a specific zone, showing zone-level security findings.`,builder:u(P),handler:async e=>{let n={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 zone-insights get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.get({zone_id:a,...n})),{successLabel:`Loaded`})}};function I(e){return e.option(`dismissed`,{type:`boolean`,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 L={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by severity level.`,builder:u(I),handler:async e=>{let n={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 zone-insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/severity`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.severity.get({zone_id:a,...n})),{successLabel:`Loaded`})}},R={command:`severity`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`dismissed`,{type:`boolean`,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 B={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by insight type.`,builder:u(z),handler:async e=>{let n={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 zone-insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/type`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.type.get({zone_id:a,...n})),{successLabel:`Loaded`})}},V={command:`type`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`zone-insights`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(F).command(D).command(A).command(N).command(R).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`security-center`,describe:`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,builder:e=>e.command(w).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
2
+ import{C as e,S as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{t as l}from"./local-D8bhHUMK.mjs";import{t as u}from"./cli-types-CMNMD1V7.mjs";function d(e){return e.option(`dismissed`,{type:`boolean`,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 f={command:`get`,describe:`Retrieves Security Center insight counts aggregated by classification class.`,builder:u(d),handler:async t=>{let i={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 insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/class`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.class.get({account_id:u,...i})),{successLabel:`Loaded`})}},p={command:`class`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(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 h={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:m,handler:async t=>{if(t.dryRun){s({command:`cf security-center insights dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({dismiss:t.dismiss}):i(t.body)});return}let u=await r(t),d=t.local?l:await n(u);if(t.accountId=d,t.body){let e=i(t.body);o(await c(`Updating`,async()=>u.securityCenter.insights.dismiss({...e,account_id:d,issue_id:t[`issue-id`]})),{successLabel:`Updated`});return}let f=a({dismiss:t.dismiss});o(await c(`Updating`,async()=>u.securityCenter.insights.dismiss({...f,account_id:d,issue_id:t[`issue-id`]})),{successLabel:`Updated`})}};function g(e){return e.option(`dismissed`,{type:`boolean`,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:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Lists all Security Center insights for the account, showing security findings and recommendations.`,builder:u(g),handler:async t=>{let i={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 insights list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.list({account_id:u,...i})),{successLabel:`Loaded`})}};function v(e){return e.option(`dismissed`,{type:`boolean`,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 y={command:`get`,describe:`Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`,builder:u(v),handler:async t=>{let i={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 insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/severity`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.severity.get({account_id:u,...i})),{successLabel:`Loaded`})}},b={command:`severity`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dismissed`,{type:`boolean`,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 S={command:`get`,describe:`Retrieves Security Center insight counts aggregated by insight type.`,builder:u(x),handler:async t=>{let i={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 insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/type`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),u=t.local?l:await n(a);t.accountId=u,o(await c(`Loading`,async()=>a.securityCenter.insights.type.get({account_id:u,...i})),{successLabel:`Loaded`})}},C={command:`type`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`insights`,describe:`Security findings and recommendations across your account — DNS, SSL, WAF misconfigurations, etc.`,builder:e=>e.command(h).command(_).command(p).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dismissed`,{type:`boolean`,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 E={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by classification class.`,builder:u(T),handler:async e=>{let n={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 zone-insights class get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/class`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.class.get({zone_id:a,...n})),{successLabel:`Loaded`})}},D={command:`class`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(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 k={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:O,handler:async t=>{if(t.dryRun){s({command:`cf security-center zone-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/security-center/insights/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}/context`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?l:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.context.get({account_id:a,issue_id:t[`issue-id`]})),{successLabel:`Loaded`})}},A={command:`context`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(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:`update <issue-id>`,describe:`Archives a zone-specific Security Center insight, removing it from the active zone insights while preserving historical data.`,builder:j,handler:async e=>{if(e.dryRun){s({command:`cf security-center zone-insights dismiss update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/dismiss`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({dismiss:e.dismiss}):i(e.body)});return}let n=await r(e),l=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.securityCenter.zoneInsights.dismiss.update({...t,zone_id:l,issue_id:e[`issue-id`]})),{successLabel:`Updated`});return}let u=a({dismiss:e.dismiss});o(await c(`Updating`,async()=>n.securityCenter.zoneInsights.dismiss.update({...u,zone_id:l,issue_id:e[`issue-id`]})),{successLabel:`Updated`})}},N={command:`dismiss`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dismissed`,{type:`boolean`,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:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Lists Security Center insights for a specific zone, showing zone-level security findings.`,builder:u(P),handler:async e=>{let n={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 zone-insights get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.get({zone_id:a,...n})),{successLabel:`Loaded`})}};function I(e){return e.option(`dismissed`,{type:`boolean`,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 L={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by severity level.`,builder:u(I),handler:async e=>{let n={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 zone-insights severity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/severity`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.severity.get({zone_id:a,...n})),{successLabel:`Loaded`})}},R={command:`severity`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`dismissed`,{type:`boolean`,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 B={command:`get`,describe:`Retrieves zone-specific Security Center insight counts aggregated by insight type.`,builder:u(z),handler:async e=>{let n={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 zone-insights type get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/insights/type`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.securityCenter.zoneInsights.type.get({zone_id:a,...n})),{successLabel:`Loaded`})}},V={command:`type`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`zone-insights`,describe:`Zone-scoped security insights — counts by class, severity, type, and dismissal`,builder:e=>e.command(F).command(D).command(A).command(N).command(R).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`security-center`,describe:`Security posture dashboard — view and manage security insights, misconfigurations, and vulnerabilities`,builder:e=>e.command(w).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{S as e,T as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.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 e({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await t({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{S as e,T as t,n}from"./auth-BqDOIrKX.mjs";import{n as r,t as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c}from"./input-validation-CTqtyiY9.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 e({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await t({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>i.securityTxt.delete({zone_id: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 t=>{if(t.dryRun){o({command:`cf security-txt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.securityTxt.get({zone_id: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 t=>{if(t.dryRun){o({command:`cf security-txt update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({acknowledgments:t.acknowledgments,canonical:t.canonical,contact:t.contact,enabled:t.enabled,encryption:t.encryption,expires:c(t.expires,`expires`,`text`),hiring:t.hiring,policy:t.policy,preferred_languages:c(t[`preferred-languages`],`preferred-languages`,`text`)}):r(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=r(t.body);a(await s(`Updating`,async()=>l.securityTxt.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=i({acknowledgments:t.acknowledgments,canonical:t.canonical,contact:t.contact,enabled:t.enabled,encryption:t.encryption,expires:c(t.expires,`expires`,`text`),hiring:t.hiring,policy:t.policy,preferred_languages:c(t[`preferred-languages`],`preferred-languages`,`text`)});a(await s(`Updating`,async()=>l.securityTxt.update({body:d,zone_id:u})),{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};