cf 0.4.0 → 0.6.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 (255) hide show
  1. package/README.md +7 -1
  2. package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
  3. package/dist/accounts-BIY8wNGA.mjs +22 -0
  4. package/dist/{acm-C2lYIWs1.mjs → acm-SqcV8o5o.mjs} +2 -2
  5. package/dist/addressing-CygRm0pN.mjs +12 -0
  6. package/dist/{agent-context-CgGCT0xU.mjs → agent-context-CKb6w43K.mjs} +1 -1
  7. package/dist/ai-BAmEAjN3.mjs +2 -0
  8. package/dist/ai-gateway-BENwPvvB.mjs +8 -0
  9. package/dist/ai-search-Bv_Whw3E.mjs +7 -0
  10. package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
  11. package/dist/alerting-D_qWrsoY.mjs +6 -0
  12. package/dist/{analytics-CkhhhZWZ.mjs → analytics-CwFrx-Dr.mjs} +1 -1
  13. package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
  14. package/dist/api-gateway-D9PMVVqL.mjs +33 -0
  15. package/dist/argo-DwYGbyld.mjs +2 -0
  16. package/dist/artifacts-DKAjY_n4.mjs +4 -0
  17. package/dist/audit-logs-BvQ9uwuy.mjs +2 -0
  18. package/dist/auth-DX9KnJ0P.mjs +9 -0
  19. package/dist/auth-TYwGydWg.mjs +5 -0
  20. package/dist/billing-CRTlRU88.mjs +2 -0
  21. package/dist/{bot-management-CJxD1pqi.mjs → bot-management-DgW--8wM.mjs} +2 -2
  22. package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
  23. package/dist/brand-protection-ZikBtl0y.mjs +3 -0
  24. package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
  25. package/dist/build-Bgw8TV1p.mjs +134 -0
  26. package/dist/{cache-B7pRbpTy.mjs → cache-CeN5t6_W.mjs} +4 -4
  27. package/dist/calls-Cv0ieVg4.mjs +4 -0
  28. package/dist/certificate-authorities-BzZnWCac.mjs +2 -0
  29. package/dist/client-certificates-BFuzeBrj.mjs +3 -0
  30. package/dist/cloud-connector-D5h8Dzzg.mjs +2 -0
  31. package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
  32. package/dist/{completions-D_9WsLG7.mjs → completions-Bvzav4Mj.mjs} +2 -2
  33. package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
  34. package/dist/connectivity-CjkXmEhO.mjs +3 -0
  35. package/dist/connector-interrupts-B7eSface.mjs +2 -0
  36. package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
  37. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
  38. package/dist/connectors-YYu_Vx3H.mjs +3 -0
  39. package/dist/content-scanning-BorfRGKT.mjs +4 -0
  40. package/dist/context-C-WbewL6.mjs +2 -0
  41. package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-CfRj7QZb.mjs} +4 -4
  42. package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
  43. package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
  44. package/dist/custom-pages-DamGVA75.mjs +4 -0
  45. package/dist/d1-sK0O5THv.mjs +4 -0
  46. package/dist/data-security-DsWpoWiS.mjs +6 -0
  47. package/dist/dcv-delegation-BYsNl3qc.mjs +2 -0
  48. package/dist/{deploy-KBRFIatG.mjs → deploy-BzlPv3ro.mjs} +1 -1
  49. package/dist/{dev-pPazzZvt.mjs → dev-IOg-_s5_.mjs} +1 -1
  50. package/dist/diagnostics-CH7T2WR3.mjs +3 -0
  51. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
  52. package/dist/dist-B7hsuvbF.mjs +57 -0
  53. package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
  54. package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
  55. package/dist/dns-o7hUPMCG.mjs +29 -0
  56. package/dist/durable-objects-DgrTbvoF.mjs +2 -0
  57. package/dist/email-routing-owCvAEpf.mjs +10 -0
  58. package/dist/email-security-Dng3DVuf.mjs +8 -0
  59. package/dist/email-sending-bExMH4lu.mjs +3 -0
  60. package/dist/filters-DKs-wEzt.mjs +4 -0
  61. package/dist/{firewall-C3DDwfwh.mjs → firewall-BLaTtX3r.mjs} +10 -10
  62. package/dist/{fraud-DY3YXFVf.mjs → fraud-D8WmLKyH.mjs} +1 -1
  63. package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
  64. package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-BBtW8vRh.mjs} +3 -3
  65. package/dist/{hostnames-BdAQo1Mr.mjs → hostnames-Bh2IFxIw.mjs} +2 -2
  66. package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
  67. package/dist/iam-apCCcy7R.mjs +6 -0
  68. package/dist/images-Cxe45OHm.mjs +7 -0
  69. package/dist/index.mjs +1 -1
  70. package/dist/intel-8V4h6H46.mjs +3 -0
  71. package/dist/{ips-B6JETVOY.mjs → ips-BE7JbAnc.mjs} +1 -1
  72. package/dist/{keyless-certificates-C4MZ4xnf.mjs → keyless-certificates-CfJmXccT.mjs} +2 -2
  73. package/dist/kv-Dz6then8.mjs +5 -0
  74. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
  75. package/dist/load-balancers-ilsGgudX.mjs +6 -0
  76. package/dist/logpush-BH14TtuA.mjs +4 -0
  77. package/dist/logs-B8-mkf_I.mjs +3 -0
  78. package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
  79. package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
  80. package/dist/magic-transit-B-kU5e3s.mjs +89 -0
  81. package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
  82. package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
  83. package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
  84. package/dist/oauth-B5k80sip.mjs +61 -0
  85. package/dist/observability-9APhqFHo.mjs +4 -0
  86. package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
  87. package/dist/{organizations-aRi1bhFC.mjs → organizations-Dy3kiV_z.mjs} +6 -6
  88. package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
  90. package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-B30_2_dO.mjs} +3 -3
  91. package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
  92. package/dist/{page-rules-CYqtPU1p.mjs → page-rules-zQJGmTCd.mjs} +5 -5
  93. package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CxQk5k9X.mjs} +5 -5
  94. package/dist/pages-5DKLs7CQ.mjs +11 -0
  95. package/dist/pipelines-DfGE44xo.mjs +6 -0
  96. package/dist/progress-CL8I-7YK.mjs +2 -0
  97. package/dist/prompt-q3B7sM2A.mjs +3 -0
  98. package/dist/queues-BoenUGIw.mjs +6 -0
  99. package/dist/r2-Cq_JCjK0.mjs +21 -0
  100. package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
  101. package/dist/{radar-CzGM92uM.mjs → radar-YNOCio6T.mjs} +1 -1
  102. package/dist/rate-limits-CcAF3tMl.mjs +5 -0
  103. package/dist/raw-fetch-bIXC9D1m.mjs +2 -0
  104. package/dist/realtime-kit-4bCGviO5.mjs +18 -0
  105. package/dist/{registrar-8IeA5DKd.mjs → registrar-CfHlaOOf.mjs} +6 -6
  106. package/dist/request-tracers-DlHawg5l.mjs +2 -0
  107. package/dist/resource-sharing-7FhuboJE.mjs +5 -0
  108. package/dist/resource-tagging-divcugVb.mjs +16 -0
  109. package/dist/rules-CAXkege8.mjs +4 -0
  110. package/dist/rulesets-CBsdc8IV.mjs +8 -0
  111. package/dist/rum-D0hHPNl9.mjs +4 -0
  112. package/dist/{schema-hefO-tzo.mjs → schema-D8o6HcCr.mjs} +1 -1
  113. package/dist/schema-validation-BWNDnnIT.mjs +24 -0
  114. package/dist/scim-CWLli4fi.mjs +3 -0
  115. package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
  116. package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
  117. package/dist/security-center-BQT21oiM.mjs +2 -0
  118. package/dist/security-txt-CVpmJo29.mjs +3 -0
  119. package/dist/session-B8r8LNQN.mjs +93 -0
  120. package/dist/{build-BE4o4imx.mjs → shared-DQI8NGja.mjs} +324 -388
  121. package/dist/{smart-shield-DblHIce0.mjs → smart-shield-BreBC1Ap.mjs} +2 -2
  122. package/dist/{snippets-DrpqSXYC.mjs → snippets-BAJoWMSJ.mjs} +3 -3
  123. package/dist/{spawn-DK7pott_.mjs → spawn-pmGERpdB.mjs} +1 -1
  124. package/dist/{spectrum-CnrG0jIC.mjs → spectrum-DnIRLY95.mjs} +6 -6
  125. package/dist/speed-UYEVue28.mjs +4 -0
  126. package/dist/src-BQ1dr9xR.mjs +108 -0
  127. package/dist/{ssl-Cp6tQkZH.mjs → ssl-D3Pixs8M.mjs} +3 -3
  128. package/dist/stream-BUsuOfQh.mjs +14 -0
  129. package/dist/{tenants-o_M62Y1n.mjs → tenants-BdWJTtcg.mjs} +1 -1
  130. package/dist/{token-validation-Ca5AGEns.mjs → token-validation-DUvtXWur.mjs} +5 -5
  131. package/dist/{tools-DtNNmO6l.mjs → tools-CQtA5-cr.mjs} +1 -1
  132. package/dist/turnstile-CAKVnS1L.mjs +23 -0
  133. package/dist/{ui-B97lRnOv.mjs → ui-BrNwNHX9.mjs} +1 -1
  134. package/dist/url-normalization-DA-RAxs4.mjs +3 -0
  135. package/dist/url-scanner-DmYu43f7.mjs +2 -0
  136. package/dist/user-Bah4wGGN.mjs +10 -0
  137. package/dist/vectorize-DhvVG2By.mjs +4 -0
  138. package/dist/{versions-B6E8WQyA.mjs → versions-NUXxCr0s.mjs} +1 -1
  139. package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
  140. package/dist/web3-n3GW50u-.mjs +4 -0
  141. package/dist/workers-D6IaQ_F0.mjs +18 -0
  142. package/dist/workers-builds-DYi0OMMU.mjs +7 -0
  143. package/dist/workflows-DrdXUQ2g.mjs +4 -0
  144. package/dist/{zaraz-CyzfYOEU.mjs → zaraz-9l7KuLqh.mjs} +1 -1
  145. package/dist/zero-trust-D6V9GH2W.mjs +118 -0
  146. package/dist/zero_trust-BzXKAX_x.mjs +3 -0
  147. package/dist/{zones-MSULnDwW.mjs → zones-0MTkuaFk.mjs} +8 -8
  148. package/package.json +3 -1
  149. package/dist/accounts-CjtZ8x1z.mjs +0 -22
  150. package/dist/addressing-CHFK6uxW.mjs +0 -12
  151. package/dist/ai-DS3i-I1a.mjs +0 -2
  152. package/dist/ai-gateway-RIsegO2x.mjs +0 -8
  153. package/dist/ai-search-Dcj4BauG.mjs +0 -7
  154. package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
  155. package/dist/alerting-Bk85NNf5.mjs +0 -6
  156. package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
  157. package/dist/api-gateway-CWdR4Ne7.mjs +0 -33
  158. package/dist/argo-DnJRVnGX.mjs +0 -2
  159. package/dist/artifacts-BVWKiJUl.mjs +0 -4
  160. package/dist/audit-logs-DjTstbzL.mjs +0 -2
  161. package/dist/auth-BqDOIrKX.mjs +0 -150
  162. package/dist/auth-DKkSwnxh.mjs +0 -5
  163. package/dist/billing-3rEqF83h.mjs +0 -2
  164. package/dist/botnet-feed-MG91D7BR.mjs +0 -3
  165. package/dist/brand-protection-CK7gJi06.mjs +0 -3
  166. package/dist/browser-rendering-Rae0AUt0.mjs +0 -4
  167. package/dist/calls-DXRWsZ8n.mjs +0 -4
  168. package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
  169. package/dist/client-certificates-B0ebLJdk.mjs +0 -3
  170. package/dist/cloud-connector-BOjaggJk.mjs +0 -2
  171. package/dist/cloudforce-one-B6HYfk5Z.mjs +0 -21
  172. package/dist/connectivity-welFvZ7X.mjs +0 -3
  173. package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
  174. package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
  175. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
  176. package/dist/connectors-3vjrdFLB.mjs +0 -3
  177. package/dist/content-scanning-CnW2A0pv.mjs +0 -4
  178. package/dist/context-CONbNKO-.mjs +0 -2
  179. package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
  180. package/dist/custom-pages-5fCSP8in.mjs +0 -4
  181. package/dist/d1-CyiRbZZn.mjs +0 -4
  182. package/dist/data-security-Casx4OS_.mjs +0 -6
  183. package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
  184. package/dist/diagnostics-BqYDoDfw.mjs +0 -3
  185. package/dist/dispatch-namespaces-Cz2rajnP.mjs +0 -7
  186. package/dist/dist-DA54ZQu0.mjs +0 -82
  187. package/dist/dns-62t95Xif.mjs +0 -29
  188. package/dist/dns-firewall-Coy8d47t.mjs +0 -57
  189. package/dist/durable-objects-BSuRERkw.mjs +0 -2
  190. package/dist/email-routing-BDUYYeV3.mjs +0 -10
  191. package/dist/email-security-ChHA6eqQ.mjs +0 -8
  192. package/dist/email-sending-CVrRqn6S.mjs +0 -3
  193. package/dist/filters-qJpU9uAS.mjs +0 -4
  194. package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
  195. package/dist/hyperdrive-99OJV9nl.mjs +0 -18
  196. package/dist/iam-BRbpg3lN.mjs +0 -6
  197. package/dist/images-D1jI3r3O.mjs +0 -7
  198. package/dist/intel-C3ajLpXd.mjs +0 -3
  199. package/dist/kv-CSWoD9ks.mjs +0 -5
  200. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
  201. package/dist/load-balancers-Du1tNuUt.mjs +0 -6
  202. package/dist/logpush-SuJyO-uX.mjs +0 -4
  203. package/dist/logs-DcDNRPRl.mjs +0 -3
  204. package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
  205. package/dist/magic-network-monitoring-CqtvOePQ.mjs +0 -4
  206. package/dist/magic-transit-BTbkhBtF.mjs +0 -89
  207. package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
  208. package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
  209. package/dist/network-interconnects-DsiNytOU.mjs +0 -36
  210. package/dist/observability-CLqZ7OSi.mjs +0 -4
  211. package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
  212. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
  213. package/dist/pages-ChurJ2H7.mjs +0 -11
  214. package/dist/pipelines-CeyujvRf.mjs +0 -6
  215. package/dist/progress-Cent9Lsg.mjs +0 -2
  216. package/dist/queues-Rf_n11Cx.mjs +0 -6
  217. package/dist/r2-BtuTO3vQ.mjs +0 -21
  218. package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
  219. package/dist/rate-limits-Bbk7HxP7.mjs +0 -5
  220. package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
  221. package/dist/realtime-kit-CivLpkpg.mjs +0 -18
  222. package/dist/request-tracers-D1aH4NmL.mjs +0 -2
  223. package/dist/resource-sharing-B-Pcto7-.mjs +0 -5
  224. package/dist/resource-tagging-Bpb6Qq1M.mjs +0 -16
  225. package/dist/rules-B10XWY10.mjs +0 -4
  226. package/dist/rulesets-lYczEcJp.mjs +0 -8
  227. package/dist/rum-B5GUKa4I.mjs +0 -4
  228. package/dist/schema-validation-DTq517Em.mjs +0 -24
  229. package/dist/scim-BiLfOQ89.mjs +0 -3
  230. package/dist/security-center-AVpTOBK3.mjs +0 -2
  231. package/dist/security-txt-DVlh8y9l.mjs +0 -3
  232. package/dist/shared-0bwWVDLo.mjs +0 -2
  233. package/dist/speed-BzRY3Xlh.mjs +0 -4
  234. package/dist/src-D9_Gq68b.mjs +0 -108
  235. package/dist/stream-CGTRN4ZN.mjs +0 -14
  236. package/dist/turnstile-l7mo9BWL.mjs +0 -23
  237. package/dist/url-normalization-D1CogSIG.mjs +0 -3
  238. package/dist/url-scanner-BnJHJqcz.mjs +0 -2
  239. package/dist/user-CiyYZ69X.mjs +0 -10
  240. package/dist/vectorize-D3LgMLOn.mjs +0 -4
  241. package/dist/web3-DlHE0CZc.mjs +0 -4
  242. package/dist/workers-DRAkU6YR.mjs +0 -18
  243. package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
  244. package/dist/workflows-z6oapEJs.mjs +0 -4
  245. package/dist/zero-trust-fyyIelWx.mjs +0 -118
  246. package/dist/zero_trust-BAhlNkjo.mjs +0 -3
  247. /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  248. /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
  249. /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-DGgEbf8K.mjs} +0 -0
  250. /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
  251. /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
  252. /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
  253. /package/dist/{metadata-jh2EIan8.mjs → metadata-MPDDi08e.mjs} +0 -0
  254. /package/dist/{resolve-D1mG0REg.mjs → resolve-DGD57PFH.mjs} +0 -0
  255. /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
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.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:p,handler:async t=>{if(t.dryRun){c({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/permission_groups/${t[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(t[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(t[`permission-group-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.iam.permissionGroups.get({account_id:a,permission_group_id:t[`permission-group-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List all the permissions groups for an account.`,builder:h,handler:async t=>{let n={id:t.id,name:t.name,label:t.label,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/permission_groups`,pathParams:{},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.iam.permissionGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}},_={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:v,handler:async n=>{if(n.dryRun){c({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups`,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.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the resource group`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:b,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-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.
3
- `);return}s(await l(`Deleting`,async()=>a.iam.resourceGroups.delete({account_id:o,resource_group_id:t[`resource-group-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:S,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-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.iam.resourceGroups.get({account_id:a,resource_group_id:t[`resource-group-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List all the resource groups for an account.`,builder:w,handler:async t=>{let n={id:t.id,name:t.name};if(t.dryRun){c({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups`,pathParams:{},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.iam.resourceGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}};function E(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/resource_groups/${t[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(t[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(t[`resource-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`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.iam.resourceGroups.update({...e,account_id:f,resource_group_id:t[`resource-group-id`]})),{successLabel:`Updated`});return}let p=o({name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>n.iam.resourceGroups.update({...p,account_id:f,resource_group_id:t[`resource-group-id`]})),{successLabel:`Updated`})}},O={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:k,handler:async t=>{if(t.dryRun){c({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Creating`,async()=>n.iam.sso.beginVerification({account_id:a,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Created`})}};function j(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:j,handler:async n=>{if(n.dryRun){c({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({begin_verification:n[`begin-verification`],email_domain:u(n[`email-domain`],`email-domain`,`text`),use_fedramp_language:n[`use-fedramp-language`]}):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.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}n[`email-domain`]===void 0&&(n[`email-domain`]=await t(`email-domain`,`Email domain of the new SSO connector`));let m=o({begin_verification:n[`begin-verification`],email_domain:u(n[`email-domain`],`email-domain`,`text`),use_fedramp_language:n[`use-fedramp-language`]});s(await l(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:N,handler:async t=>{if(t.dryRun){c({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-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
- `);return}s(await l(`Deleting`,async()=>a.iam.sso.delete({account_id:o,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:F,handler:async t=>{if(t.dryRun){c({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-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.iam.sso.get({account_id:a,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:I,handler:async t=>{if(t.dryRun){c({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors`,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.iam.sso.list({account_id:a})),{successLabel:`Loaded`})}};function R(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:R,handler:async t=>{if(t.dryRun){c({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/sso_connectors/${t[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(t[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(t[`sso-connector-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({enabled:t.enabled,use_fedramp_language:t[`use-fedramp-language`]}):a(t.body)});return}let n=await i(t),u=t.local?d:await r(n);if(t.accountId=u,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.iam.sso.update({...e,account_id:u,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=o({enabled:t.enabled,use_fedramp_language:t[`use-fedramp-language`]});s(await l(`Updating`,async()=>n.iam.sso.update({...f,account_id:u,sso_connector_id:t[`sso-connector-id`]})),{successLabel:`Updated`})}},B={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(A).command(M).command(P).command(ee).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`create`,describe:`Create a new user group under the specified account.`,builder:V,handler:async n=>{if(n.dryRun){c({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups`,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.iam.userGroups.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`Name of the User group.`));let m=o({name:u(n.name,`name`,`text`)});s(await l(`Creating`,async()=>f.iam.userGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function U(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const W={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:U,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-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.
5
- `);return}s(await l(`Deleting`,async()=>a.iam.userGroups.delete({account_id:o,user_group_id:t[`user-group-id`]})),{successLabel:`Deleted`})}};function G(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:G,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-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.iam.userGroups.get({account_id:a,user_group_id:t[`user-group-id`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List all the user groups for an account.`,builder:f(q),handler:async t=>{let n={id:t.id,name:t.name,fuzzyName:t[`fuzzy-name`],page:t.page,per_page:t[`per-page`],direction:t.direction};if(t.dryRun){c({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups`,pathParams:{},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.iam.userGroups.list({account_id:o,...n})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier 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)`})}const X={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:Y,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-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.iam.userGroups.members.create({body:e,account_id:o,user_group_id:t[`user-group-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 Z(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Q={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:Z,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members/${t[`member-id`]==null?`<member-id>`:encodeURIComponent(String(t[`member-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``),"member-id":String(t[`member-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.
6
- `);return}s(await l(`Deleting`,async()=>a.iam.userGroups.members.delete({account_id:o,user_group_id:t[`user-group-id`],member_id:t[`member-id`]})),{successLabel:`Deleted`})}};function $(e){return e.option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`list`,describe:`List all the members attached to a user group.`,builder:f($),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],fuzzyEmail:t[`fuzzy-email`],direction:t.direction};if(t.dryRun){c({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-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.iam.userGroups.members.list({account_id:o,user_group_id:t[`user-group-id`],...n})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Set/Replace members to a user group.`})}const re={command:`update <user-group-id>`,describe:`Replace the set of members attached to a User Group.`,builder:ne,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(t[`user-group-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(`Updating`,async()=>n.iam.userGroups.members.update({body:e,account_id:o,user_group_id:t[`user-group-id`]})),{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.`)}},ie={command:`members`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(X).command(Q).command(te).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`update <user-group-id>`,describe:`Modify an existing user group.`,builder:ae,handler:async t=>{if(t.dryRun){c({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/iam/user_groups/${t[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(t[`user-group-id`]))}`,pathParams:{"user-group-id":String(t[`user-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`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.iam.userGroups.update({...e,account_id:f,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`});return}let p=o({name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>n.iam.userGroups.update({...p,account_id:f,user_group_id:t[`user-group-id`]})),{successLabel:`Updated`})}},se={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(H).command(W).command(K).command(J).command(oe).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(_).command(O).command(B).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ce as default};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f,t as p}from"./input-validation-CTqtyiY9.mjs";import{t as m}from"./local-D8bhHUMK.mjs";import{t as h}from"./cli-types-CMNMD1V7.mjs";import{n as ee,t as te}from"./raw-fetch-DnbAMFBp.mjs";function g(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`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const _={command:`create`,describe:`Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`,builder:g,handler:async t=>{if(t.dryRun){u({command:`cf images create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:t.body,file:t.file,creator:t.creator,id:t.id,metadata:t.metadata,"require-signed-urls":t[`require-signed-urls`],url:t.url}});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.file!==void 0||t.body!==void 0||t.creator!==void 0||t.id!==void 0||t.metadata!==void 0||t[`require-signed-urls`]!==void 0||t.url!==void 0){let e=new FormData;if(t.file){let n=p(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);if(t.creator!==void 0&&e.append(`creator`,String(f(t.creator,`creator`,`text`)??``)),t.id!==void 0&&e.append(`id`,String(f(t.id,`id`,`text`)??``)),t.metadata!==void 0){let n=typeof t.metadata==`string`?f(t.metadata,`metadata`,`text`):t.metadata;e.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}t[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(t[`require-signed-urls`])),t.url!==void 0&&e.append(`url`,String(f(t.url,`url`,`text`)??``)),l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v1`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`);l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>n.images.create({account_id:r})),{successLabel:`Created`})}};function v(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <image-id>`,describe:`Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.`,builder:v,handler:async t=>{if(t.dryRun){u({command:`cf images delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force,message:`This operation will delete this image.`})){process.stderr.write(`Aborted.
3
- `);return}l(await d(`Deleting`,async()=>n.images.delete({account_id:a,image_id:t[`image-id`]})),{successLabel:`Deleted`})}};function b(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`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const x={command:`direct-upload`,describe:"Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present.",builder:b,handler:async t=>{if(t.dryRun){u({command:`cf images direct-upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:t.body,file:t.file,creator:t.creator,expiry:t.expiry,id:t.id,metadata:t.metadata,"require-signed-urls":t[`require-signed-urls`]}});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.file!==void 0||t.body!==void 0||t.creator!==void 0||t.expiry!==void 0||t.id!==void 0||t.metadata!==void 0||t[`require-signed-urls`]!==void 0){let e=new FormData;if(t.file){let n=p(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);if(t.creator!==void 0&&e.append(`creator`,String(f(t.creator,`creator`,`text`)??``)),t.expiry!==void 0&&e.append(`expiry`,String(f(t.expiry,`expiry`,`text`)??``)),t.id!==void 0&&e.append(`id`,String(f(t.id,`id`,`text`)??``)),t.metadata!==void 0){let n=typeof t.metadata==`string`?f(t.metadata,`metadata`,`text`):t.metadata;e.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}t[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(t[`require-signed-urls`])),l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v2/direct_upload`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`);l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/images/v2/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>n.images.directUpload({account_id:r})),{successLabel:`Created`})}};function S(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).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:`edit <image-id>`,describe:`Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`,builder:S,handler:async t=>{if(t.dryRun){u({command:`cf images edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({creator:f(t.creator,`creator`,`text`),requireSignedURLs:t[`require-signed-urls`]}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.images.edit({...e,account_id:r,image_id:t[`image-id`]})),{successLabel:`Updated`});return}let a=c({creator:f(t.creator,`creator`,`text`),requireSignedURLs:t[`require-signed-urls`]});l(await d(`Updating`,async()=>n.images.edit({...a,account_id:r,image_id:t[`image-id`]})),{successLabel:`Updated`})}};function w(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const T={command:`get-blob <image-id>`,describe:`Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.`,builder:w,handler:async t=>{if(t.dryRun){u({command:`cf images get-blob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}/blob`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r;let a=await d(`Loading`,async()=>te(`/accounts/${r}/images/v1/${encodeURIComponent(String(t[`image-id`]))}/blob`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));ee(t.text===!0?a.toString(`utf-8`):a)}};function E(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <image-id>`,describe:`Fetch details for a CF Images image.`,builder:E,handler:async t=>{if(t.dryRun){u({command:`cf images get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/${t[`image-id`]==null?`<image-id>`:encodeURIComponent(String(t[`image-id`]))}`,pathParams:{"image-id":String(t[`image-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.get({account_id:r,image_id:t[`image-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`create <signing-key-name>`,describe:`Create a new CF Images signing key with specified name. Returns all keys available.`,builder:O,handler:async t=>{if(t.dryRun){u({command:`cf images keys create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/keys/${t[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(t[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(t[`signing-key-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Updating`,async()=>n.images.keys.create({account_id:r,signing_key_name:t[`signing-key-name`]})),{successLabel:`Updated`})}};function A(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const j={command:`delete <signing-key-name>`,describe:`Delete a CF Images signing key with specified name. Returns all keys available. When the last key is removed, a new default signing key will be generated.`,builder:A,handler:async t=>{if(t.dryRun){u({command:`cf images keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/keys/${t[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(t[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(t[`signing-key-name`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force,message:`This operation will delete this signing key. This will invalidate any URLs that are signed with this key.`})){process.stderr.write(`Aborted.
4
- `);return}l(await d(`Deleting`,async()=>n.images.keys.delete({account_id:a,signing_key_name:t[`signing-key-name`]})),{successLabel:`Deleted`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List your CF Images signing keys.`,builder:M,handler:async t=>{if(t.dryRun){u({command:`cf images keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/keys`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.keys.list({account_id:r})),{successLabel:`Loaded`})}},P={command:`keys`,describe:`Operations for keys`,builder:e=>e.command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`continuation-token`,{type:`string`,description:`Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint.`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:"List up to 10000 images from CF Images, with up to 1000 results per page. Use the optional parameters below to get a specific range of images. Pagination is supported via continuation_token. **Metadata Filtering (Optional):** You can optionally filter images by custom metadata fields using the `meta.<field>[<operator>]=<value>` syntax. **Supported Operators:** - `eq` / `eq:string` / `eq:number` / `eq:boolean` - Exact match - `gt` / `gt:number` - Greater than (number only) - `gte` / `gte:number` - Greater than or equal (number only) - `lt` / `lt:number` - Less than (number only) - `lte` / `lte:number` - Less than or equal (number only) - `in` / `in:string` / `in:number` - Match any value in list (pipe-separated) **Metadata Filter Constraints:** - Maximum 5 metadata filters per request - Maximum 5 levels of nesting (e.g., `meta.first.second.third.fourth.fifth`) - Maximum 10 elements for list operators (`in`) - Supports string, number, and boolean value types - Range operators (`gt`, `gte`, `lt`, `lte`) only accept numeric values **Filter Consistency:** Filters are combined with AND logic. The system does not validate whether filter combinations are logically consistent. For example, `meta.priority[eq:number]=5&meta.priority[lte:number]=3` will return zero results because no value can satisfy both conditions simultaneously. It is the caller's responsibility to ensure filter combinations make sense. **Examples:** ``` # List all images /images/v2 # Filter by metadata [eq] /images/v2?meta.status[eq:string]=active # Filter by metadata [in] /images/v2?meta.status[in]=pending|deleted|flagged # Filter by metadata [in:number] /images/v2?meta.ratings[in:number]=4|5 # Filter by metadata range [gte:number] /images/v2?meta.priority[gte:number]=1 # Filter by bounded range /images/v2?meta.priority[gte:number]=1&meta.priority[lte:number]=5 # Filter by nested metadata /images/v2?meta.region.name[eq]=eu-west # Combine metadata filters with creator /images/v2?meta.status[eq]=active&creator=user123 # Multiple metadata filters (AND logic) /images/v2?meta.status[eq]=active&meta.priority[eq:number]=5 ```",builder:h(F),handler:async t=>{let n={continuation_token:t[`continuation-token`],per_page:t[`per-page`],sort_order:t[`sort-order`],creator:t.creator};if(t.dryRun){u({command:`cf images list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.list({account_id:a,...n})),{successLabel:`Loaded`})}};function L(e){return e.option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`create`,describe:`Create a new migration from an existing source. The migration will import objects from the source bucket into Cloudflare Images.`,builder:L,handler:async n=>{if(n.dryRun){u({command:`cf images sourcing-kit migrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({conflictBehaviour:f(n[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:n[`excluded-content-types`],pathPrefix:f(n[`path-prefix`],`path-prefix`,`text`),rootDirectory:f(n[`root-directory`],`root-directory`,`text`),sourceId:f(n[`source-id`],`source-id`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.images.sourcingKit.migrations.create({...e,account_id:a})),{successLabel:`Created`});return}n[`source-id`]===void 0&&(n[`source-id`]=await t(`source-id`,`The identifier of the source to migrate from.`));let p=c({conflictBehaviour:f(n[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:n[`excluded-content-types`],pathPrefix:f(n[`path-prefix`],`path-prefix`,`text`),rootDirectory:f(n[`root-directory`],`root-directory`,`text`),sourceId:f(n[`source-id`],`source-id`,`text`)});l(await d(`Creating`,async()=>r.images.sourcingKit.migrations.create({...p,account_id:a})),{successLabel:`Created`})}};function z(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`delete <migration-id>`,describe:`Delete an existing migration. Only completed, errored, or aborted migrations can be deleted.`,builder:z,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit migrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations/${t[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(t[`migration-id`]))}`,pathParams:{"migration-id":String(t[`migration-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}l(await d(`Deleting`,async()=>n.images.sourcingKit.migrations.delete({account_id:a,migration_id:t[`migration-id`]})),{successLabel:`Deleted`})}};function V(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <migration-id>`,describe:`Fetch details for a single migration.`,builder:V,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit migrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations/${t[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(t[`migration-id`]))}`,pathParams:{"migration-id":String(t[`migration-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.sourcingKit.migrations.get({account_id:r,migration_id:t[`migration-id`]})),{successLabel:`Loaded`})}};function U(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`abort <migration-id>`,describe:`Abort a running migration. Objects already imported will not be removed.`,builder:U,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit migrations lifecycle abort`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations/${t[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(t[`migration-id`]))}/lifecycle/abort`,pathParams:{"migration-id":String(t[`migration-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Updating`,async()=>n.images.sourcingKit.migrations.lifecycle.abort({account_id:r,migration_id:t[`migration-id`]})),{successLabel:`Updated`})}};function G(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <migration-id>`,describe:`Get the current progress of a migration including counts of scanned, imported, skipped, and errored objects.`,builder:G,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit migrations lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations/${t[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(t[`migration-id`]))}/lifecycle`,pathParams:{"migration-id":String(t[`migration-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.sourcingKit.migrations.lifecycle.get({account_id:r,migration_id:t[`migration-id`]})),{successLabel:`Loaded`})}};function q(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`logs <migration-id>`,describe:`List log entries for a specific migration.`,builder:q,handler:async t=>{let n={offset:t.offset,limit:t.limit};if(t.dryRun){u({command:`cf images sourcing-kit migrations lifecycle logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations/${t[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(t[`migration-id`]))}/logs`,pathParams:{"migration-id":String(t[`migration-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.sourcingKit.migrations.lifecycle.logs({account_id:a,migration_id:t[`migration-id`],...n})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`start <migration-id>`,describe:`Start a pending migration. The migration will begin importing objects from the configured source.`,builder:Y,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit migrations lifecycle start`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations/${t[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(t[`migration-id`]))}/lifecycle/start`,pathParams:{"migration-id":String(t[`migration-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Updating`,async()=>n.images.sourcingKit.migrations.lifecycle.start({account_id:r,migration_id:t[`migration-id`]})),{successLabel:`Updated`})}},Z={command:`lifecycle`,describe:`Operations for sourcing-kit.migrations.lifecycle`,builder:e=>e.command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`List all migrations for the account.`,builder:Q,handler:async t=>{let n={offset:t.offset,limit:t.limit};if(t.dryRun){u({command:`cf images sourcing-kit migrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.sourcingKit.migrations.list({account_id:a,...n})),{successLabel:`Loaded`})}},re={command:`migrations`,describe:`Operations for sourcing-kit.migrations`,builder:e=>e.command(R).command(B).command(H).command(ne).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`connectivity <source-id>`,describe:`Check the current connectivity status of an existing migration source.`,builder:ie,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit sources connectivity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources/${t[`source-id`]==null?`<source-id>`:encodeURIComponent(String(t[`source-id`]))}/connectivity`,pathParams:{"source-id":String(t[`source-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.sourcingKit.sources.connectivity({account_id:r,source_id:t[`source-id`]})),{successLabel:`Loaded`})}};function oe(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`name`,{type:`string`,description:`A human-readable name for the source.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`create`,describe:`Create a new migration source by providing storage credentials. The service will verify connectivity to the bucket before accepting the source.`,builder:oe,handler:async r=>{if(r.dryRun){u({command:`cf images sourcing-kit sources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},bodyKind:`json`,body:r.body===void 0?c({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),name:f(r.name,`name`,`text`),vendor:f(r.vendor,`vendor`,`text`)}):s(r.body)});return}let a=await o(r),p=r.local?m:await i(a);if(r.accountId=p,r.body){let e=s(r.body);l(await d(`Creating`,async()=>a.images.sourcingKit.sources.create({...e,account_id:p})),{successLabel:`Created`});return}r.bucket===void 0&&(r.bucket=await t(`bucket`,`The name of the storage bucket.`)),r.name===void 0&&(r.name=await t(`name`,`A human-readable name for the source.`)),r.vendor===void 0&&(r.vendor=await n(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let h=c({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),name:f(r.name,`name`,`text`),vendor:f(r.vendor,`vendor`,`text`)});l(await d(`Creating`,async()=>a.images.sourcingKit.sources.create({...h,account_id:p})),{successLabel:`Created`})}};function ce(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource 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 le={command:`delete <source-id>`,describe:`Delete an existing migration source. Sources with active migrations cannot be deleted.`,builder:ce,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit sources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources/${t[`source-id`]==null?`<source-id>`:encodeURIComponent(String(t[`source-id`]))}`,pathParams:{"source-id":String(t[`source-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
6
- `);return}l(await d(`Deleting`,async()=>n.images.sourcingKit.sources.delete({account_id:a,source_id:t[`source-id`]})),{successLabel:`Deleted`})}};function ue(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <source-id>`,describe:`Fetch details for a single migration source.`,builder:ue,handler:async t=>{if(t.dryRun){u({command:`cf images sourcing-kit sources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources/${t[`source-id`]==null?`<source-id>`:encodeURIComponent(String(t[`source-id`]))}`,pathParams:{"source-id":String(t[`source-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.sourcingKit.sources.get({account_id:r,source_id:t[`source-id`]})),{successLabel:`Loaded`})}};function fe(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`name`,{type:`string`,description:`Filter sources by name (partial match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`List all configured migration sources for the account.`,builder:fe,handler:async t=>{let n={offset:t.offset,limit:t.limit,name:t.name};if(t.dryRun){u({command:`cf images sourcing-kit sources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.sourcingKit.sources.list({account_id:a,...n})),{successLabel:`Loaded`})}};function me(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`region`,{type:`string`,description:`The region hint for the bucket (S3 only).`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const he={command:`pre-check`,describe:`Verify connectivity to a storage bucket before creating a source. Returns connectivity status without persisting any state.`,builder:me,handler:async r=>{if(r.dryRun){u({command:`cf images sourcing-kit sources pre-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?c({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),region:f(r.region,`region`,`text`),vendor:f(r.vendor,`vendor`,`text`)}):s(r.body)});return}let a=await o(r),p=r.local?m:await i(a);if(r.accountId=p,r.body){let e=s(r.body);l(await d(`Creating`,async()=>a.images.sourcingKit.sources.preCheck({...e,account_id:p})),{successLabel:`Created`});return}r.bucket===void 0&&(r.bucket=await t(`bucket`,`The name of the storage bucket.`)),r.vendor===void 0&&(r.vendor=await n(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let h=c({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),region:f(r.region,`region`,`text`),vendor:f(r.vendor,`vendor`,`text`)});l(await d(`Creating`,async()=>a.images.sourcingKit.sources.preCheck({...h,account_id:p})),{successLabel:`Created`})}};function ge(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`Updated name for the source.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`update <source-id>`,describe:`Update the name of an existing migration source.`,builder:ge,handler:async n=>{if(n.dryRun){u({command:`cf images sourcing-kit sources update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v2/sourcingkit/sources/${n[`source-id`]==null?`<source-id>`:encodeURIComponent(String(n[`source-id`]))}`,pathParams:{"source-id":String(n[`source-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({name:f(n.name,`name`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Updating`,async()=>r.images.sourcingKit.sources.update({...e,account_id:a,source_id:n[`source-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await t(`name`,`Updated name for the source.`));let p=c({name:f(n.name,`name`,`text`)});l(await d(`Updating`,async()=>r.images.sourcingKit.sources.update({...p,account_id:a,source_id:n[`source-id`]})),{successLabel:`Updated`})}},ve={command:`sources`,describe:`Operations for sourcing-kit.sources`,builder:e=>e.command(ae).command(se).command(le).command(de).command(pe).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ye={command:`sourcing-kit`,describe:`Operations for sourcing-kit`,builder:e=>e.command(re).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`stats`,describe:`Fetch image statistics details for Cloudflare Images. The returned statistics detail storage usage, including the current image count vs this account's allowance.`,builder:be,handler:async t=>{if(t.dryRun){u({command:`cf images stats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/stats`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.stats({account_id:r})),{successLabel:`Loaded`})}};function Se(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`List up to 100 images with one request. Use the optional parameters below to get a specific range of images.`,builder:Se,handler:async t=>{let n={page:t.page,per_page:t[`per-page`],creator:t.creator};if(t.dryRun){u({command:`cf images v1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.images.v1.list({account_id:a,...n})),{successLabel:`Loaded`})}};function we(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get <variant-id>`,describe:`Fetch details for a single variant with properties at the top level of the result.`,builder:we,handler:async t=>{if(t.dryRun){u({command:`cf images v1 variants-flat get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}/flat`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.v1.variantsFlat.get({account_id:r,variant_id:t[`variant-id`]})),{successLabel:`Loaded`})}},Ee={command:`variants-flat`,describe:`Operations for v1.variants-flat`,builder:e=>e.command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},De={command:`v1`,describe:`Operations for v1`,builder:e=>e.command(Ce).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`id`,{type:`string`,description:`The id field`}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`,default:!1}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oe={command:`create`,describe:`Create a CF Images variant that allows you to resize images for different use cases.`,builder:$,handler:async r=>{if(r.dryRun){u({command:`cf images variants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`json`,body:r.body===void 0?c({id:f(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}}):s(r.body)});return}let a=await o(r),p=r.local?m:await i(a);if(r.accountId=p,r.body){let e=s(r.body);l(await d(`Creating`,async()=>a.images.variants.create({body:e,account_id:p})),{successLabel:`Created`});return}if(r.id===void 0&&(r.id=await t(`id`,`The id field`)),r[`options-fit`]===void 0&&(r[`options-fit`]=await n(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),r[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(r[`options-metadata`]===void 0&&(r[`options-metadata`]=await n(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),r[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let h=c({id:f(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}});l(await d(`Creating`,async()=>a.images.variants.create({body:h,account_id:p})),{successLabel:`Created`})}};function ke(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ae={command:`delete <variant-id>`,describe:`Delete a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:ke,handler:async t=>{if(t.dryRun){u({command:`cf images variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force,message:`This operation will delete this variant.`})){process.stderr.write(`Aborted.
7
- `);return}l(await d(`Deleting`,async()=>n.images.variants.delete({account_id:a,variant_id:t[`variant-id`]})),{successLabel:`Deleted`})}};function je(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).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 Me={command:`edit <variant-id>`,describe:`Update a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:je,handler:async t=>{if(t.dryRun){u({command:`cf images variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({neverRequireSignedURLs:t[`never-require-signed-urls`],options:{fit:f(t[`options-fit`],`options-fit`,`text`),height:t[`options-height`],metadata:f(t[`options-metadata`],`options-metadata`,`text`),width:t[`options-width`]}}):s(t.body)});return}let r=await o(t),a=t.local?m:await i(r);if(t.accountId=a,t.body){let e=s(t.body);l(await d(`Updating`,async()=>r.images.variants.edit({...e,account_id:a,variant_id:t[`variant-id`]})),{successLabel:`Updated`});return}if(t[`options-fit`]===void 0&&(t[`options-fit`]=await n(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),t[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(t[`options-metadata`]===void 0&&(t[`options-metadata`]=await n(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),t[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let p=c({neverRequireSignedURLs:t[`never-require-signed-urls`],options:{fit:f(t[`options-fit`],`options-fit`,`text`),height:t[`options-height`],metadata:f(t[`options-metadata`],`options-metadata`,`text`),width:t[`options-width`]}});l(await d(`Updating`,async()=>r.images.variants.edit({...p,account_id:a,variant_id:t[`variant-id`]})),{successLabel:`Updated`})}};function Ne(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`get <variant-id>`,describe:`Fetch details for a CF Images variant.`,builder:Ne,handler:async t=>{if(t.dryRun){u({command:`cf images variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants/${t[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(t[`variant-id`]))}`,pathParams:{"variant-id":String(t[`variant-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.variants.get({account_id:r,variant_id:t[`variant-id`]})),{successLabel:`Loaded`})}};function Fe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`list`,describe:`List existing CF Images variants.`,builder:Fe,handler:async t=>{if(t.dryRun){u({command:`cf images variants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.images.variants.list({account_id:r})),{successLabel:`Loaded`})}},Le={command:`variants`,describe:`Operations for variants`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Re={command:`images`,describe:`images`,builder:e=>e.command(_).command(y).command(x).command(C).command(D).command(T).command(I).command(xe).command(P).command(ye).command(De).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Re as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,i 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,t as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";import{n as m,t as ee}from"./raw-fetch-DnbAMFBp.mjs";function h(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:p(h),handler:async t=>{if(t.dryRun){c({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/asn/${t.asn==null?`<asn>`:encodeURIComponent(String(t.asn))}`,pathParams:{asn:String(t.asn??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.asn.get({account_id:a,asn:t.asn})),{successLabel:`Loaded`})}};function _(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:p(_),handler:async t=>{if(t.dryRun){c({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/asn/${t.asn==null?`<asn>`:encodeURIComponent(String(t.asn))}/subnets`,pathParams:{asn:String(t.asn??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.asn.subnets.get({account_id:a,asn:t.asn})),{successLabel:`Loaded`})}},y={command:`subnets`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(g).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:x,handler:async t=>{if(t.dryRun){c({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.attackSurfaceReport.issueTypes.get({account_id:a})),{successLabel:`Loaded`})}},C={command:`issue-types`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(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 T={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:p(w),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.class({account_id:o,...r})),{successLabel:`Loaded`})}};function E(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 D={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:E,handler:async t=>{if(t.dryRun){c({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/${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?o({dismiss:t.dismiss}):a(t.body)});return}let r=await i(t),u=t.local?f:await n(r);if(t.accountId=u,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.attackSurfaceReport.issues.dismiss({...e,account_id:u,issue_id:t[`issue-id`]})),{successLabel:`Updated`});return}let d=o({dismiss:t.dismiss});s(await l(`Updating`,async()=>r.intel.attackSurfaceReport.issues.dismiss({...d,account_id:u,issue_id:t[`issue-id`]})),{successLabel:`Updated`})}};function O(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 k={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:p(O),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.list({account_id:o,...r})),{successLabel:`Loaded`})}};function A(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 j={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:p(A),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.severity({account_id:o,...r})),{successLabel:`Loaded`})}};function M(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 N={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:p(M),handler:async t=>{let r={dismissed:t.dismissed,issue_class:t[`issue-class`],issue_type:t[`issue-type`],product:t.product,severity:t.severity,subject:t.subject};if(t.dryRun){c({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.attackSurfaceReport.issues.type({account_id:o,...r})),{successLabel:`Loaded`})}},P={command:`issues`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`attack-surface-report`,describe:`Operations for attack-surface-report`,builder:e=>e.command(C).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:p(I),handler:async t=>{let r={start_end_params:t[`start-end-params`],ipv4:t.ipv4,page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/dns`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.dns.list({account_id:o,...r})),{successLabel:`Loaded`})}},R={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:z,handler:async t=>{let r={domain:t.domain};if(t.dryRun){c({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain-history`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domainHistory.get({account_id:o,...r})),{successLabel:`Loaded`})}},V={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:H,handler:async t=>{let r={domain:t.domain,include_ranking:t[`include-ranking`],skip_ranking:t[`skip-ranking`]};if(t.dryRun){c({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domains.bulks.get({account_id:o,...r})),{successLabel:`Loaded`})}},W={command:`bulks`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:G,handler:async t=>{let r={domain:t.domain,skip_dns:t[`skip-dns`],skip_ranking:t[`skip-ranking`]};if(t.dryRun){c({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/domain`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.domains.get({account_id:o,...r})),{successLabel:`Loaded`})}},q={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(K).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:J,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.intel.indicatorFeeds.create({...e,account_id:d})),{successLabel:`Created`});return}let p=o({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`)});s(await l(`Creating`,async()=>r.intel.indicatorFeeds.create({...p,account_id:d})),{successLabel:`Created`})}};function X(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:X,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/data`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,m((await l(`Loading`,async()=>ee(`/accounts/${a}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/data`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).toString(`utf-8`))}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:p(Z),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/download`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.downloads.get({account_id:a,feed_id:t[`feed-id`]})),{successLabel:`Loaded`})}},ne={command:`downloads`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:p(re),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.get({account_id:a,feed_id:t[`feed-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:ae,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.list({account_id:a})),{successLabel:`Loaded`})}};function se(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:se,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({account_tag:u(t[`account-tag`],`account-tag`,`text`),feed_id:t[`feed-id`]}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.indicatorFeeds.permissions.create({body:e,account_id:d})),{successLabel:`Updated`});return}let p=o({account_tag:u(t[`account-tag`],`account-tag`,`text`),feed_id:t[`feed-id`]});s(await l(`Updating`,async()=>r.intel.indicatorFeeds.permissions.create({body:p,account_id:d})),{successLabel:`Updated`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:le,handler:async r=>{if(r.dryRun){c({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account_tag:u(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):a(r.body)});return}let d=await i(r),p=r.local?f:await n(d);if(r.accountId=p,!await t({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
3
- `);return}if(r.body){let e=a(r.body);s(await l(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:e,account_id:p})),{successLabel:`Deleted`});return}let m=o({account_tag:u(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});s(await l(`Deleting`,async()=>d.intel.indicatorFeeds.permissions.delete({body:m,account_id:p})),{successLabel:`Deleted`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Lists current access permissions for custom threat indicator feeds.`,builder:de,handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds permissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/permissions/view`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.indicatorFeeds.permissions.list({account_id:a})),{successLabel:`Loaded`})}},pe={command:`permissions`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`source`,{type:`string`,description:"The file to upload. Either a plain STIX2/CRDF body or a gzipped one (recognised by `0x1f 0x8b` magic bytes or a `.gz` filename suffix). "})}const he={command:`update <feed-id>`,describe:"Revises the raw data entries in a custom threat indicator feed. Accepts both plain and gzipped STIX2/CRDF bodies. Gzip is detected by RFC 1952 magic bytes (`0x1f 0x8b`) and/or a `.gz` filename suffix (case-insensitive) — either signal alone is sufficient to trigger the gzip path; if the body is not valid gzip, the upload fails fast. Customers are encouraged to gzip larger uploads — the api-gateway 500 MB body cap applies to the on-the-wire (compressed) size, so gzip lets a single upload carry several GiB of decompressed STIX.",builder:p(me),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds snapshots update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}/snapshot`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file,source:t.source}});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,t.file!==void 0||t.body!==void 0||t.source!==void 0){let e=new FormData;if(t.file){let n=d(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);t.source!==void 0&&e.append(`source`,String(u(t.source,`source`,`text`)??``)),s(await l(`Updating`,async()=>r(a,`PUT`,`/accounts/${o}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/snapshot`,{body:e})),{successLabel:`Updated`});return}if(t.body){let e=u(t.body,`body`,`binary`);s(await l(`Updating`,async()=>r(a,`PUT`,`/accounts/${o}/intel/indicator-feeds/${encodeURIComponent(String(t[`feed-id`]))}/snapshot`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>a.intel.indicatorFeeds.snapshots.update({account_id:o,feed_id:t[`feed-id`]})),{successLabel:`Updated`})}},ge={command:`snapshots`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The new description of the feed`}).option(`is-attributable`,{type:`boolean`,description:`The new is_attributable value of the feed`}).option(`is-downloadable`,{type:`boolean`,description:`The new is_downloadable value of the feed`}).option(`is-public`,{type:`boolean`,description:`The new is_public value of the feed`}).option(`name`,{type:`string`,description:`The new name of the feed`}).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 ve={command:`update <feed-id>`,describe:`Revises details for a specific custom threat indicator feed.`,builder:p(_e),handler:async t=>{if(t.dryRun){c({command:`cf intel indicator-feeds update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/indicator-feeds/${t[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(t[`feed-id`]))}`,pathParams:{"feed-id":String(t[`feed-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({description:u(t.description,`description`,`text`),is_attributable:t[`is-attributable`],is_downloadable:t[`is-downloadable`],is_public:t[`is-public`],name:u(t.name,`name`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Updating`,async()=>r.intel.indicatorFeeds.update({...e,account_id:d,feed_id:t[`feed-id`]})),{successLabel:`Updated`});return}let p=o({description:u(t.description,`description`,`text`),is_attributable:t[`is-attributable`],is_downloadable:t[`is-downloadable`],is_public:t[`is-public`],name:u(t.name,`name`,`text`)});s(await l(`Updating`,async()=>r.intel.indicatorFeeds.update({...p,account_id:d,feed_id:t[`feed-id`]})),{successLabel:`Updated`})}},ye={command:`indicator-feeds`,describe:`Threat indicator feeds — subscribe to and manage curated lists of malicious IPs, domains, and URLs`,builder:e=>e.command(Y).command(te).command(ie).command(oe).command(ve).command(ne).command(pe).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Returns a list of available IP list categories (e.g., anonymizer, botnetcc, malware, tor, vpn, open_proxies). This endpoint provides metadata about which IP lists are available in the system.`,builder:be,handler:async t=>{if(t.dryRun){c({command:`cf intel ip-lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/ip-lists`,pathParams:{},bodyKind:`none`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,s(await l(`Loading`,async()=>r.intel.ipLists.get({account_id:a})),{successLabel:`Loaded`})}},xe={command:`ip-lists`,describe:`Curated IP lists used for threat detection and policy enforcement`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`ipv6`,{type:`string`,description:`Ipv6`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get`,describe:"Gets the geolocation, ASN, infrastructure type of the ASN, and any security threat categories of an IP address. **Must provide ip query parameters.** For example, `/intel/ip?ipv4=1.1.1.1` or `/intel/ip?ipv6=2001:db8::1`.",builder:Se,handler:async t=>{let r={ipv4:t.ipv4,ipv6:t.ipv6};if(t.dryRun){c({command:`cf intel ips get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/ip`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.ips.get({account_id:o,...r})),{successLabel:`Loaded`})}},we={command:`ips`,describe:`IP address intelligence — geolocation, risk assessment, and hosting provider details`,builder:e=>e.command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.option(`content-adds`,{type:`string`,array:!0,description:`Content category IDs to add.`}).option(`content-removes`,{type:`string`,array:!0,description:`Content category IDs to remove.`}).option(`indicator-type`,{type:`string`,description:`The indicator_type field`,choices:[`domain`,`ipv4`,`ipv6`,`url`]}).option(`ip`,{type:`string`,description:"Provide only if indicator_type is `ipv4` or `ipv6`."}).option(`security-adds`,{type:`string`,array:!0,description:`Security category IDs to add.`}).option(`security-removes`,{type:`string`,array:!0,description:`Security category IDs to remove.`}).option(`url`,{type:`string`,description:"Provide only if indicator_type is `domain` or `url`. Example if indicator_type is `domain`: `example.com`. Example if indicator_type is `url`: `https://example.com/news/`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`create`,describe:"Allows you to submit requests to change a domain’s category. Requests that include category `169` (New Domains) or category `177` (Newly Seen) in any of `content_adds`, `content_removes`, `security_adds`, or `security_removes` will be rejected with a `400 Bad Request`. These categories are automatically managed and fall off 30 days after they are applied.",builder:Te,handler:async t=>{if(t.dryRun){c({command:`cf intel miscategorizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/miscategorization`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({content_adds:t[`content-adds`],content_removes:t[`content-removes`],indicator_type:u(t[`indicator-type`],`indicator-type`,`text`),ip:u(t.ip,`ip`,`text`),security_adds:t[`security-adds`],security_removes:t[`security-removes`],url:u(t.url,`url`,`text`)}):a(t.body)});return}let r=await i(t),d=t.local?f:await n(r);if(t.accountId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.intel.miscategorizations.create({...e,account_id:d})),{successLabel:`Created`});return}let p=o({content_adds:t[`content-adds`],content_removes:t[`content-removes`],indicator_type:u(t[`indicator-type`],`indicator-type`,`text`),ip:u(t.ip,`ip`,`text`),security_adds:t[`security-adds`],security_removes:t[`security-removes`],url:u(t.url,`url`,`text`)});s(await l(`Creating`,async()=>r.intel.miscategorizations.create({...p,account_id:d})),{successLabel:`Created`})}},De={command:`miscategorizations`,describe:`Report and track domain miscategorization corrections`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get`,describe:`Retrieves WHOIS registration data for a domain, including registrant and nameserver information.`,builder:Oe,handler:async t=>{let r={domain:t.domain};if(t.dryRun){c({command:`cf intel whois get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/intel/whois`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(t),o=t.local?f:await n(a);t.accountId=o,s(await l(`Loading`,async()=>a.intel.whois.get({account_id:o,...r})),{successLabel:`Loaded`})}},Ae={command:`whois`,describe:`WHOIS registration data for domains including registrant, registrar, and nameservers`,builder:e=>e.command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},je={command:`intel`,describe:`Threat intelligence lookups — IP reputation, domain info, ASN details, WHOIS, and indicator feeds`,builder:e=>e.command(b).command(F).command(R).command(V).command(q).command(ye).command(xe).command(we).command(De).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{je as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ 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,t as f}from"./input-validation-CTqtyiY9.mjs";import{t as p}from"./local-D8bhHUMK.mjs";import{t as m}from"./cli-types-CMNMD1V7.mjs";import{n as h,t as g}from"./raw-fetch-DnbAMFBp.mjs";function _(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete <namespace-id>`,describe:`Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let s=await a(t),d=t.local?p:await r(s);if(t.accountId=d,!await n({force:!!t.force,message:`This operation deletes the specified keys from the namespace.`})){process.stderr.write(`Aborted.
3
- `);return}if(t.body){let e=o(t.body);if(Array.isArray(e)&&e.length>1e4){let n=Math.ceil(e.length/1e4),r=null;for(let a=0;a<e.length;a+=1e4){let o=e.slice(a,a+1e4);r=await u(`Deleting: batch ${Math.floor(a/1e4)+1}/${n}`,async()=>i(s,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/bulk/delete`,{body:o}))}c(r,{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>i(s,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/bulk/delete`,{body:e})),{successLabel:`Deleted`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function y(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`keys`,{type:`string`,array:!0,description:`Array of keys to retrieve (maximum of 100).`}).option(`type`,{type:`string`,description:`Whether to parse JSON values in the response.`,choices:[`text`,`json`],default:`text`}).option(`with-metadata`,{type:`boolean`,description:`Whether to include metadata in the response.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`get <namespace-id>`,describe:"Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based values. JSON values can optionally be parsed instead of being returned as a string value. Metadata can be included if `withMetadata` is true.",builder:y,handler:async t=>{if(t.dryRun){l({command:`cf kv bulk get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/bulk/get`,pathParams:{"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({keys:t.keys,type:d(t.type,`type`,`text`),withMetadata:t[`with-metadata`]}):o(t.body)});return}let n=await a(t),i=t.local?p:await r(n);if(t.accountId=i,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.kv.bulk.get({...e,account_id:i,namespace_id:t[`namespace-id`]})),{successLabel:`Created`});return}if(t.keys===void 0)throw Error(`--keys is required (or pass --body with this field set).`);let f=s({keys:t.keys,type:d(t.type,`type`,`text`),withMetadata:t[`with-metadata`]});c(await u(`Creating`,async()=>n.kv.bulk.get({...f,account_id:i,namespace_id:t[`namespace-id`]})),{successLabel:`Created`})}};function x(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier 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)`})}const S={command:`update <namespace-id>`,describe:"Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. The entire request size must be 100 megabytes or less.",builder:x,handler:async t=>{if(t.dryRun){l({command:`cf kv bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/bulk`,pathParams:{"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),s=t.local?p:await r(n);if(t.accountId=s,t.body){let e=o(t.body);if(Array.isArray(e)&&e.length>1e4){let r=Math.ceil(e.length/1e4),a=null;for(let o=0;o<e.length;o+=1e4){let c=e.slice(o,o+1e4);a=await u(`Updating: batch ${Math.floor(o/1e4)+1}/${r}`,async()=>i(n,`PUT`,`/accounts/${s}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/bulk`,{body:c}))}c(a,{successLabel:`Updated`});return}c(await u(`Updating`,async()=>i(n,`PUT`,`/accounts/${s}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/bulk`,{body:e})),{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.`)}},C={command:`bulk`,describe:`Bulk read, write, and delete operations on multiple KV key-value pairs at once`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <key-name>`,describe:"Remove a KV pair from the namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:w,handler:async t=>{if(t.dryRun){l({command:`cf kv keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/values/${t[`key-name`]==null?`<key-name>`:encodeURIComponent(String(t[`key-name`]))}`,pathParams:{"key-name":String(t[`key-name`]??``),"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}c(await u(`Deleting`,async()=>i.kv.keys.delete({account_id:o,namespace_id:t[`namespace-id`],key_name:t[`key-name`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const D={command:`get <key-name>`,describe:"Returns the value associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. If the KV-pair is set to expire at some point, the expiration time as measured in seconds since the UNIX epoch will be returned in the `expiration` response header.",builder:E,handler:async t=>{if(t.dryRun){l({command:`cf kv keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/values/${t[`key-name`]==null?`<key-name>`:encodeURIComponent(String(t[`key-name`]))}`,pathParams:{"key-name":String(t[`key-name`]??``),"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?p:await r(n);t.accountId=i;let o=await u(`Loading`,async()=>g(`/accounts/${i}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/values/${encodeURIComponent(String(t[`key-name`]))}`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));h(t.text===!0?o.toString(`utf-8`):o)}};function O(e){return e.option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit.`}).option(`prefix`,{type:`string`,description:`Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned.`}).option(`cursor`,{type:`string`,description:"Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists a namespace's keys.`,builder:O,handler:async t=>{let n={limit:t.limit,prefix:t.prefix,cursor:t.cursor};if(t.dryRun){l({command:`cf kv keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/keys`,pathParams:{"namespace-id":String(t[`namespace-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);t.accountId=o,c(await u(`Loading`,async()=>i.kv.keys.list({account_id:o,namespace_id:t[`namespace-id`],...n})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`expiration`,{type:`number`,description:`Expires the key at a certain time, measured in number of seconds since the UNIX epoch.`}).option(`expiration-ttl`,{type:`number`,description:`Expires the key after a number of seconds. Must be at least 60.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A byte sequence to be stored, up to 25 MiB in length.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`The metadata`})}const j={command:`update <key-name>`,describe:"Write a value identified by a key. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. Body should be the value to be stored. If JSON metadata to be associated with the key/value pair is needed, use `multipart/form-data` content type for your PUT request (see dropdown below in `REQUEST BODY SCHEMA`). Existing values, expirations, and metadata will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.",builder:A,handler:async t=>{let n={expiration:t.expiration,expiration_ttl:t[`expiration-ttl`]};if(t.dryRun){l({command:`cf kv keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/values/${t[`key-name`]==null?`<key-name>`:encodeURIComponent(String(t[`key-name`]))}`,pathParams:{"key-name":String(t[`key-name`]??``),"namespace-id":String(t[`namespace-id`]??``)},query:n,bodyKind:t.metadata===void 0?`octet-stream`:`multipart`,body:t.metadata===void 0?t.body:{body:t.body,file:t.file,metadata:t.metadata}});return}let o=await a(t),s=t.local?p:await r(o);if(t.accountId=s,t.metadata!==void 0){let e=new FormData;if(t.file){let n=f(t.file);e.append(`value`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`value`,t.body);t.metadata!==void 0&&e.append(`metadata`,String(d(t.metadata,`metadata`,`text`)??``)),c(await u(`Updating`,async()=>i(o,`PUT`,`/accounts/${s}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/values/${encodeURIComponent(String(t[`key-name`]))}`,{body:e})),{successLabel:`Updated`});return}if(t.file){let e=f(t.file);c(await u(`Updating`,async()=>i(o,`PUT`,`/accounts/${s}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/values/${encodeURIComponent(String(t[`key-name`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(t.body){let e=d(t.body,`body`,`binary`),r=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();c(await u(`Updating`,async()=>i(o,`PUT`,`/accounts/${s}/storage/kv/namespaces/${encodeURIComponent(String(t[`namespace-id`]))}/values/${encodeURIComponent(String(t[`key-name`]))}${r?`?`+r:``}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{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.`)}},M={command:`keys`,describe:`Read, write, and delete individual key-value pairs in a KV namespace. Pass --namespace-id to scope.`,builder:e=>e.command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <key-name>`,describe:"Returns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:N,handler:async t=>{if(t.dryRun){l({command:`cf kv metadata get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}/metadata/${t[`key-name`]==null?`<key-name>`:encodeURIComponent(String(t[`key-name`]))}`,pathParams:{"key-name":String(t[`key-name`]??``),"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?p:await r(n);t.accountId=i,c(await u(`Loading`,async()=>n.kv.metadata.get({account_id:i,namespace_id:t[`namespace-id`],key_name:t[`key-name`]})),{successLabel:`Loaded`})}},F={command:`metadata`,describe:`Read the metadata associated with a KV key without fetching its value`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`create`,describe:"Creates a namespace under the given title. A `400` is returned if the account already owns a namespace with this title. A namespace must be explicitly deleted to be replaced.",builder:I,handler:async n=>{if(n.dryRun){l({command:`cf kv namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({title:d(n.title,`title`,`text`)}):o(n.body)});return}let i=await a(n),f=n.local?p:await r(i);if(n.accountId=f,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.kv.namespaces.create({body:e,account_id:f})),{successLabel:`Created`});return}n.title===void 0&&(n.title=await t(`title`,`A human-readable string name for a Namespace.`));let m=s({title:d(n.title,`title`,`text`)});c(await u(`Creating`,async()=>i.kv.namespaces.create({body:m,account_id:f})),{successLabel:`Created`})}};function R(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const z={command:`delete <namespace-id>`,describe:`Deletes the namespace corresponding to the given ID.`,builder:R,handler:async t=>{if(t.dryRun){l({command:`cf kv namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}`,pathParams:{"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}c(await u(`Deleting`,async()=>i.kv.namespaces.delete({account_id:o,namespace_id:t[`namespace-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <namespace-id>`,describe:`Get the namespace corresponding to the given ID.`,builder:B,handler:async t=>{if(t.dryRun){l({command:`cf kv namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${t[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(t[`namespace-id`]))}`,pathParams:{"namespace-id":String(t[`namespace-id`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?p:await r(n);t.accountId=i,c(await u(`Loading`,async()=>n.kv.namespaces.get({account_id:i,namespace_id:t[`namespace-id`]})),{successLabel:`Loaded`})}};function H(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`id`,`title`]}).option(`direction`,{type:`string`,description:`Direction to order namespaces.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Returns the namespaces owned by an account.`,builder:m(H),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){l({command:`cf kv namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(t),o=t.local?p:await r(i);t.accountId=o,c(await u(`Loading`,async()=>i.kv.namespaces.list({account_id:o,...n})),{successLabel:`Loaded`})}};function W(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).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:`update <namespace-id>`,describe:`Modifies a namespace's title.`,builder:W,handler:async n=>{if(n.dryRun){l({command:`cf kv namespaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/storage/kv/namespaces/${n[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(n[`namespace-id`]))}`,pathParams:{"namespace-id":String(n[`namespace-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({title:d(n.title,`title`,`text`)}):o(n.body)});return}let i=await a(n),f=n.local?p:await r(i);if(n.accountId=f,n.body){let e=o(n.body);c(await u(`Updating`,async()=>i.kv.namespaces.update({body:e,account_id:f,namespace_id:n[`namespace-id`]})),{successLabel:`Updated`});return}n.title===void 0&&(n.title=await t(`title`,`A human-readable string name for a Namespace.`));let m=s({title:d(n.title,`title`,`text`)});c(await u(`Updating`,async()=>i.kv.namespaces.update({body:m,account_id:f,namespace_id:n[`namespace-id`]})),{successLabel:`Updated`})}},K={command:`namespaces`,describe:`KV namespaces — create, read, rename, and delete the containers that hold your key-value pairs`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`kv`,describe:`Global, low-latency key-value storage for Workers — namespaces, keys, values, and bulk operations`,builder:e=>e.command(C).command(M).command(F).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
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(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines the overall status for Leaked Credential Checks.`})}const u={command:`create`,describe:`Updates the current status of Leaked Credential Checks.`,builder:l,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({enabled:t.enabled}):r(t.body)});return}let c=await n(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=r(t.body);a(await s(`Creating`,async()=>c.leakedCredentialChecks.create({body:e,zone_id:l})),{successLabel:`Created`});return}let u=i({enabled:t.enabled});a(await s(`Creating`,async()=>c.leakedCredentialChecks.create({body:u,zone_id:l})),{successLabel:`Created`})}};function d(e){return e.option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const f={command:`create`,describe:`Create user-defined detection pattern for Leaked Credential Checks.`,builder:d,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`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(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)});a(await s(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:d,zone_id:u})),{successLabel:`Created`})}};function p(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,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 m={command:`delete <detection-id>`,describe:`Remove user-defined detection pattern for Leaked Credential Checks.`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/leaked-credential-checks/detections/${r[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(r[`detection-id`]))}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"detection-id":String(r[`detection-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
- `);return}a(await s(`Deleting`,async()=>i.leakedCredentialChecks.detections.delete({zone_id:c,detection_id:r[`detection-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <detection-id>`,describe:`Get user-defined detection pattern for Leaked Credential Checks.`,builder:h,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections/${t[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(t[`detection-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"detection-id":String(t[`detection-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.leakedCredentialChecks.detections.get({zone_id:i,detection_id:t[`detection-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List user-defined detection patterns for Leaked Credential Checks.`,builder:_,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections`,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.leakedCredentialChecks.detections.list({zone_id:i})),{successLabel:`Loaded`})}};function y(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const b={command:`update <detection-id>`,describe:`Update user-defined detection pattern for Leaked Credential Checks.`,builder:y,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks/detections/${t[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(t[`detection-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"detection-id":String(t[`detection-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`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.leakedCredentialChecks.detections.update({body:e,zone_id:u,detection_id:t[`detection-id`]})),{successLabel:`Updated`});return}let d=i({password:c(t.password,`password`,`text`),username:c(t.username,`username`,`text`)});a(await s(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:d,zone_id:u,detection_id:t[`detection-id`]})),{successLabel:`Updated`})}},x={command:`detections`,describe:`Operations for detections`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Retrieves the current status of Leaked Credential Checks.`,builder:S,handler:async t=>{if(t.dryRun){o({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/leaked-credential-checks`,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.leakedCredentialChecks.get({zone_id:i})),{successLabel:`Loaded`})}},w={command:`leaked-credential-checks`,describe:`leaked-credential-checks`,builder:e=>e.command(u).command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};