cf 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/dist/_meta/agent-context.json +76 -70
  2. package/dist/_meta/commands.json +47761 -55490
  3. package/dist/_meta/schemas.json +31106 -34818
  4. package/dist/abuse-reports-Dy76QPNP.mjs +8 -0
  5. package/dist/accounts-CjtZ8x1z.mjs +22 -0
  6. package/dist/acm-C2lYIWs1.mjs +3 -0
  7. package/dist/addressing-CHFK6uxW.mjs +12 -0
  8. package/dist/{agent-context-D26woB9J.mjs → agent-context-CgGCT0xU.mjs} +1 -1
  9. package/dist/ai-DS3i-I1a.mjs +2 -0
  10. package/dist/ai-gateway-RIsegO2x.mjs +8 -0
  11. package/dist/ai-search-Dcj4BauG.mjs +7 -0
  12. package/dist/ai_gateway-w7YwfcPE.mjs +4 -0
  13. package/dist/alerting-Bk85NNf5.mjs +6 -0
  14. package/dist/analytics-CkhhhZWZ.mjs +20 -0
  15. package/dist/analytics_engine-B7qgDJCA.mjs +2 -0
  16. package/dist/api-gateway-CWdR4Ne7.mjs +33 -0
  17. package/dist/argo-DnJRVnGX.mjs +2 -0
  18. package/dist/artifacts-BVWKiJUl.mjs +4 -0
  19. package/dist/audit-logs-DjTstbzL.mjs +2 -0
  20. package/dist/auth-BqDOIrKX.mjs +150 -0
  21. package/dist/auth-DKkSwnxh.mjs +5 -0
  22. package/dist/billing-3rEqF83h.mjs +2 -0
  23. package/dist/body-parser-CBpeIUns.mjs +2 -0
  24. package/dist/bot-management-CJxD1pqi.mjs +5 -0
  25. package/dist/botnet-feed-MG91D7BR.mjs +3 -0
  26. package/dist/brand-protection-CK7gJi06.mjs +3 -0
  27. package/dist/browser-rendering-Rae0AUt0.mjs +4 -0
  28. package/dist/{build-5jmmOZhm.mjs → build-BE4o4imx.mjs} +131 -131
  29. package/dist/cache-B7pRbpTy.mjs +5 -0
  30. package/dist/calls-DXRWsZ8n.mjs +4 -0
  31. package/dist/certificate-authorities-BR3gXBLs.mjs +2 -0
  32. package/dist/chunk-6IEM75FG-U3L9fKgi.mjs +2 -0
  33. package/dist/cli-types-CMNMD1V7.mjs +2 -0
  34. package/dist/client-certificates-B0ebLJdk.mjs +3 -0
  35. package/dist/cloud-connector-BOjaggJk.mjs +2 -0
  36. package/dist/cloudforce-one-B6HYfk5Z.mjs +21 -0
  37. package/dist/{completions-BKrxcfhN.mjs → completions-D_9WsLG7.mjs} +1 -1
  38. package/dist/config-7CBz8Xm0.mjs +2 -0
  39. package/dist/connectivity-welFvZ7X.mjs +3 -0
  40. package/dist/connector-interrupts-DTV3F-50.mjs +2 -0
  41. package/dist/connector-telemetry-events-kDqb_AGm.mjs +2 -0
  42. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +2 -0
  43. package/dist/connectors-3vjrdFLB.mjs +3 -0
  44. package/dist/content-scanning-CnW2A0pv.mjs +4 -0
  45. package/dist/context-CONbNKO-.mjs +2 -0
  46. package/dist/custom-certificates-CnYh6Yi-.mjs +5 -0
  47. package/dist/custom-hostnames-C2upqZso.mjs +5 -0
  48. package/dist/custom-nameservers-BGkAD_PZ.mjs +3 -0
  49. package/dist/custom-pages-5fCSP8in.mjs +4 -0
  50. package/dist/d1-CyiRbZZn.mjs +4 -0
  51. package/dist/data-security-Casx4OS_.mjs +6 -0
  52. package/dist/dcv-delegation-DVYO10oA.mjs +2 -0
  53. package/dist/{deploy-DbkiIzUr.mjs → deploy-KBRFIatG.mjs} +1 -1
  54. package/dist/{dev-C6iSuQZm.mjs → dev-pPazzZvt.mjs} +1 -1
  55. package/dist/diagnostics-BqYDoDfw.mjs +3 -0
  56. package/dist/dispatch-namespaces-Cz2rajnP.mjs +7 -0
  57. package/dist/{dist-CnSubA1Z.mjs → dist-DA54ZQu0.mjs} +1 -1
  58. package/dist/dist-DpDjsWWn.mjs +306 -0
  59. package/dist/dns-62t95Xif.mjs +29 -0
  60. package/dist/dns-firewall-Coy8d47t.mjs +57 -0
  61. package/dist/durable-objects-BSuRERkw.mjs +2 -0
  62. package/dist/email-routing-BDUYYeV3.mjs +10 -0
  63. package/dist/email-security-ChHA6eqQ.mjs +8 -0
  64. package/dist/email-sending-CVrRqn6S.mjs +3 -0
  65. package/dist/filters-qJpU9uAS.mjs +4 -0
  66. package/dist/firewall-C3DDwfwh.mjs +11 -0
  67. package/dist/fraud-DY3YXFVf.mjs +20 -0
  68. package/dist/google-tag-gateway-B00MHDfB.mjs +2 -0
  69. package/dist/healthchecks-Drvb79v0.mjs +4 -0
  70. package/dist/hostnames-BdAQo1Mr.mjs +3 -0
  71. package/dist/hyperdrive-99OJV9nl.mjs +18 -0
  72. package/dist/iam-BRbpg3lN.mjs +6 -0
  73. package/dist/images-D1jI3r3O.mjs +7 -0
  74. package/dist/index.mjs +1 -1
  75. package/dist/intel-C3ajLpXd.mjs +3 -0
  76. package/dist/{ips-B8fwxKZD.mjs → ips-B6JETVOY.mjs} +1 -1
  77. package/dist/keyless-certificates-C4MZ4xnf.mjs +3 -0
  78. package/dist/kv-CSWoD9ks.mjs +5 -0
  79. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +3 -0
  80. package/dist/load-balancers-Du1tNuUt.mjs +6 -0
  81. package/dist/logpush-SuJyO-uX.mjs +4 -0
  82. package/dist/logs-DcDNRPRl.mjs +3 -0
  83. package/dist/magic-cloud-networking-D-T0RCvi.mjs +5 -0
  84. package/dist/magic-network-monitoring-CqtvOePQ.mjs +4 -0
  85. package/dist/magic-transit-BTbkhBtF.mjs +89 -0
  86. package/dist/managed-transforms-CfUBSz9p.mjs +3 -0
  87. package/dist/mtls-certificates-Cf1O8c2E.mjs +3 -0
  88. package/dist/network-interconnects-DsiNytOU.mjs +36 -0
  89. package/dist/observability-CLqZ7OSi.mjs +4 -0
  90. package/dist/open-YWOUIZ5Y-BpqIuBsR.mjs +4 -0
  91. package/dist/organizations-aRi1bhFC.mjs +41 -0
  92. package/dist/origin-ca-certificates-BB4H89a_.mjs +3 -0
  93. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +2 -0
  94. package/dist/origin-tls-client-auth-CnQNy9-l.mjs +4 -0
  95. package/dist/output-CUxZRM5A.mjs +2 -0
  96. package/dist/page-rules-CYqtPU1p.mjs +18 -0
  97. package/dist/page-shield-D8l9ZMUl.mjs +37 -0
  98. package/dist/pages-ChurJ2H7.mjs +11 -0
  99. package/dist/pipelines-CeyujvRf.mjs +6 -0
  100. package/dist/{progress-CjcQ6ato.mjs → progress-Cent9Lsg.mjs} +1 -1
  101. package/dist/queues-Rf_n11Cx.mjs +6 -0
  102. package/dist/r2-BtuTO3vQ.mjs +21 -0
  103. package/dist/r2-data-catalog-Debz38kv.mjs +14 -0
  104. package/dist/radar-CzGM92uM.mjs +2 -0
  105. package/dist/rate-limits-Bbk7HxP7.mjs +5 -0
  106. package/dist/raw-fetch-DnbAMFBp.mjs +2 -0
  107. package/dist/realtime-kit-CivLpkpg.mjs +18 -0
  108. package/dist/registrar-8IeA5DKd.mjs +46 -0
  109. package/dist/request-tracers-D1aH4NmL.mjs +2 -0
  110. package/dist/{resolve-BuJRWSk0.mjs → resolve-D1mG0REg.mjs} +1 -1
  111. package/dist/resource-sharing-B-Pcto7-.mjs +5 -0
  112. package/dist/resource-tagging-Bpb6Qq1M.mjs +16 -0
  113. package/dist/rules-B10XWY10.mjs +4 -0
  114. package/dist/rulesets-lYczEcJp.mjs +8 -0
  115. package/dist/rum-B5GUKa4I.mjs +4 -0
  116. package/dist/{schema-CHBfkARI.mjs → schema-hefO-tzo.mjs} +1 -1
  117. package/dist/schema-validation-DTq517Em.mjs +24 -0
  118. package/dist/scim-BiLfOQ89.mjs +3 -0
  119. package/dist/secrets-store-CBX0dvHL.mjs +25 -0
  120. package/dist/security-center-AVpTOBK3.mjs +2 -0
  121. package/dist/security-txt-DVlh8y9l.mjs +3 -0
  122. package/dist/session-CsvPYFj8.mjs +5 -0
  123. package/dist/shared-0bwWVDLo.mjs +2 -0
  124. package/dist/smart-shield-DblHIce0.mjs +3 -0
  125. package/dist/snippets-DrpqSXYC.mjs +4 -0
  126. package/dist/{spawn-13QQ0IwO.mjs → spawn-DK7pott_.mjs} +1 -1
  127. package/dist/spectrum-CnrG0jIC.mjs +63 -0
  128. package/dist/speed-BzRY3Xlh.mjs +4 -0
  129. package/dist/{src-B9cKsgsg.mjs → src-D9_Gq68b.mjs} +12 -12
  130. package/dist/ssl-Cp6tQkZH.mjs +15 -0
  131. package/dist/stream-CGTRN4ZN.mjs +14 -0
  132. package/dist/tenants-o_M62Y1n.mjs +2 -0
  133. package/dist/token-validation-Ca5AGEns.mjs +10 -0
  134. package/dist/{tools-B7QiNu-d.mjs → tools-DtNNmO6l.mjs} +1 -1
  135. package/dist/turnstile-l7mo9BWL.mjs +23 -0
  136. package/dist/{ui-BXjU1dX1.mjs → ui-B97lRnOv.mjs} +1 -1
  137. package/dist/url-normalization-D1CogSIG.mjs +3 -0
  138. package/dist/url-scanner-BnJHJqcz.mjs +2 -0
  139. package/dist/user-CiyYZ69X.mjs +10 -0
  140. package/dist/vectorize-D3LgMLOn.mjs +4 -0
  141. package/dist/{versions-DzyrlUAi.mjs → versions-B6E8WQyA.mjs} +1 -1
  142. package/dist/waiting-rooms-Bhy_nuV3.mjs +11 -0
  143. package/dist/web3-DlHE0CZc.mjs +4 -0
  144. package/dist/workers-DRAkU6YR.mjs +18 -0
  145. package/dist/workers-builds-BmNjiHDZ.mjs +7 -0
  146. package/dist/workflows-z6oapEJs.mjs +4 -0
  147. package/dist/zaraz-CyzfYOEU.mjs +2 -0
  148. package/dist/zero-trust-fyyIelWx.mjs +118 -0
  149. package/dist/zero_trust-BAhlNkjo.mjs +3 -0
  150. package/dist/zones-MSULnDwW.mjs +21 -0
  151. package/package.json +7 -6
  152. package/dist/abuse-reports-KtfZhi6j.mjs +0 -8
  153. package/dist/accounts-BopMfODC.mjs +0 -21
  154. package/dist/acm-BT4vlnEJ.mjs +0 -3
  155. package/dist/addressing-B3uFxHst.mjs +0 -13
  156. package/dist/ai-DWHqwMap.mjs +0 -2
  157. package/dist/ai-gateway-CbKEO-3o.mjs +0 -8
  158. package/dist/ai-search-VnOQ5n--.mjs +0 -7
  159. package/dist/alerting-BmmgIlIO.mjs +0 -6
  160. package/dist/analytics-isY03taL.mjs +0 -20
  161. package/dist/api-gateway-DXurEbA-.mjs +0 -33
  162. package/dist/argo-B02BL_hp.mjs +0 -2
  163. package/dist/audit-logs-DcgR9xUc.mjs +0 -2
  164. package/dist/auth-CQcAgnOy.mjs +0 -135
  165. package/dist/auth-DenWm_X0.mjs +0 -6
  166. package/dist/autorag-CmrwnGVj.mjs +0 -2
  167. package/dist/billing-CaW1ZAB1.mjs +0 -2
  168. package/dist/body-parser-Br-BoYk-.mjs +0 -2
  169. package/dist/bot-management-CeBsFx68.mjs +0 -5
  170. package/dist/botnet-feed-B396vQeQ.mjs +0 -3
  171. package/dist/brand-protection-D4V1v5Kl.mjs +0 -3
  172. package/dist/browser-rendering-GF7rNtKI.mjs +0 -4
  173. package/dist/builds-C_ySULja.mjs +0 -2
  174. package/dist/cache-DmXizSMi.mjs +0 -5
  175. package/dist/calls-x4KQpTB4.mjs +0 -4
  176. package/dist/certificate-authorities-hC0SG-Ga.mjs +0 -2
  177. package/dist/client-certificates-BGVsDyeJ.mjs +0 -3
  178. package/dist/cloud-connector-BClQpEzI.mjs +0 -2
  179. package/dist/cloudforce-one-BfhFrO6M.mjs +0 -21
  180. package/dist/config-DYzlVxcB.mjs +0 -2
  181. package/dist/connectivity-G0NP6LtW.mjs +0 -3
  182. package/dist/content-scanning-DEtPJ7aF.mjs +0 -4
  183. package/dist/context-CC0Rhkhy.mjs +0 -2
  184. package/dist/custom-certificates-rJXFpUWu.mjs +0 -5
  185. package/dist/custom-hostnames-Be5mgLeF.mjs +0 -5
  186. package/dist/custom-nameservers-CoFdy6hD.mjs +0 -3
  187. package/dist/custom-pages-D-oErw57.mjs +0 -4
  188. package/dist/d1-C95ckPKI.mjs +0 -3
  189. package/dist/dcv-delegation-CWSkbGuc.mjs +0 -2
  190. package/dist/diagnostics-DEEhPnXj.mjs +0 -3
  191. package/dist/dispatch-namespaces-BzXeV7PH.mjs +0 -7
  192. package/dist/dist-DNBSHor6.mjs +0 -301
  193. package/dist/dns-firewall-BQXD_NxG.mjs +0 -57
  194. package/dist/dns-qW-3TZOT.mjs +0 -29
  195. package/dist/durable-objects-CgWFYEJJ.mjs +0 -2
  196. package/dist/email-routing-tdNJaCpJ.mjs +0 -10
  197. package/dist/email-security-DTVHNr2h.mjs +0 -60
  198. package/dist/email-sending-DsFTvE31.mjs +0 -3
  199. package/dist/filters-DO1Is_tI.mjs +0 -4
  200. package/dist/firewall-DbUhVTCg.mjs +0 -11
  201. package/dist/fraud-Bzr4njYb.mjs +0 -8
  202. package/dist/google-tag-gateway-BQxkA90M.mjs +0 -2
  203. package/dist/healthchecks-BBAs-lS_.mjs +0 -4
  204. package/dist/hostnames-Dz9PEUKS.mjs +0 -3
  205. package/dist/hyperdrive-B1iUJddG.mjs +0 -18
  206. package/dist/iam-CJM8gHpG.mjs +0 -6
  207. package/dist/images-DEoBmtFS.mjs +0 -5
  208. package/dist/intel-BM6xkZ0C.mjs +0 -3
  209. package/dist/keyless-certificates-DffYnd4b.mjs +0 -3
  210. package/dist/kv-BTceLtWZ.mjs +0 -5
  211. package/dist/leaked-credential-checks-CALfvoCo.mjs +0 -3
  212. package/dist/load-balancers-C1Ho1gCF.mjs +0 -6
  213. package/dist/logpush-CSYhgevA.mjs +0 -4
  214. package/dist/logs-DlIwmMpt.mjs +0 -3
  215. package/dist/magic-cloud-networking-Czu0pZ0a.mjs +0 -5
  216. package/dist/magic-network-monitoring-d7GJE5Yt.mjs +0 -4
  217. package/dist/magic-transit-qQmA-981.mjs +0 -89
  218. package/dist/managed-transforms-Dd6AnbWE.mjs +0 -3
  219. package/dist/mtls-certificates-C0rlCRGs.mjs +0 -3
  220. package/dist/network-interconnects-CxG2deY0.mjs +0 -36
  221. package/dist/organizations-DyEAiGiR.mjs +0 -41
  222. package/dist/origin-ca-certificates-S8RcoMF6.mjs +0 -3
  223. package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +0 -2
  224. package/dist/origin-tls-client-auth-BlxMmQrE.mjs +0 -5
  225. package/dist/output-D7_yAFVR.mjs +0 -2
  226. package/dist/page-rules-DP-w6TAm.mjs +0 -18
  227. package/dist/page-shield-Bf7kFp8c.mjs +0 -37
  228. package/dist/pages-D0Y_XRqW.mjs +0 -10
  229. package/dist/pipelines-C-SPESAk.mjs +0 -6
  230. package/dist/queues-wv6CZsi8.mjs +0 -6
  231. package/dist/r2-DuXjp9n5.mjs +0 -21
  232. package/dist/r2-data-catalog-DQCMrmNO.mjs +0 -14
  233. package/dist/radar-BW_ZHP8X.mjs +0 -2
  234. package/dist/rate-limits-DLTkIvwr.mjs +0 -5
  235. package/dist/raw-fetch-hRv-6P3D.mjs +0 -2
  236. package/dist/realtime-kit-Ch7Vg3vj.mjs +0 -6
  237. package/dist/registrar-DIIv6fWd.mjs +0 -46
  238. package/dist/request-tracers-DMej0Drs.mjs +0 -2
  239. package/dist/resource-sharing-CYJ7cMWq.mjs +0 -5
  240. package/dist/resource-tagging-Dnz65MgH.mjs +0 -16
  241. package/dist/rules-DLJpOYbC.mjs +0 -4
  242. package/dist/rulesets-D9nqEJT5.mjs +0 -8
  243. package/dist/rum-DBVmdPkp.mjs +0 -4
  244. package/dist/schema-validation-MCd3xdtX.mjs +0 -4
  245. package/dist/scim-DZA3VXog.mjs +0 -3
  246. package/dist/scm-CilfPOue.mjs +0 -2
  247. package/dist/secrets-store-BrvcZSOM.mjs +0 -21
  248. package/dist/security-center-BU6f3Cm1.mjs +0 -2
  249. package/dist/security-txt-BPIbP3dG.mjs +0 -3
  250. package/dist/session-H7IV2BrM.mjs +0 -2
  251. package/dist/shared-DEzmTsEC.mjs +0 -2
  252. package/dist/smart-shield-e8XFBkiF.mjs +0 -3
  253. package/dist/snippets-B4M3MMb8.mjs +0 -4
  254. package/dist/spectrum-B0adfSRI.mjs +0 -59
  255. package/dist/speed-BVcUtkAz.mjs +0 -4
  256. package/dist/ssl-BAa91gsc.mjs +0 -15
  257. package/dist/stream-D53sxKb3.mjs +0 -14
  258. package/dist/tenants-bH5pt3dJ.mjs +0 -2
  259. package/dist/token-validation-M61Vx_Tw.mjs +0 -4
  260. package/dist/turnstile-wAU0Gc2Z.mjs +0 -23
  261. package/dist/url-normalization-DZrWDgB5.mjs +0 -3
  262. package/dist/url-scanner-Zo49edNp.mjs +0 -2
  263. package/dist/user-DbXlVReB.mjs +0 -10
  264. package/dist/vectorize-CUnTM0DT.mjs +0 -4
  265. package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
  266. package/dist/waiting-rooms-BZW0X69-.mjs +0 -11
  267. package/dist/web3-DueyOQtx.mjs +0 -4
  268. package/dist/workers-builds-BM_aoeUR.mjs +0 -7
  269. package/dist/workers-nV_vBCfV.mjs +0 -16
  270. package/dist/workflows-CQITmo-s.mjs +0 -4
  271. package/dist/zaraz-DIbpF5Op.mjs +0 -2
  272. package/dist/zero-trust-CKp8j512.mjs +0 -119
  273. package/dist/zones-BZ5tZDbH.mjs +0 -28
  274. /package/dist/{input-validation-zEO81MWN.mjs → input-validation-CTqtyiY9.mjs} +0 -0
  275. /package/dist/{lib-Eu1wXxuh.mjs → lib-B6xvCJjc.mjs} +0 -0
  276. /package/dist/{local-VJaJ3BZ1.mjs → local-D8bhHUMK.mjs} +0 -0
  277. /package/dist/{metadata-DGdCpUxn.mjs → metadata-jh2EIan8.mjs} +0 -0
  278. /package/dist/{theme-BklJDrb2.mjs → theme-CFHr0Dh9.mjs} +0 -0
@@ -0,0 +1,3 @@
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,r as c,t as l}from"./body-parser-CBpeIUns.mjs";import{t as u}from"./output-CUxZRM5A.mjs";import{n as d,t as f}from"./progress-Cent9Lsg.mjs";import{n as p,t as m}from"./input-validation-CTqtyiY9.mjs";import{t as h}from"./local-D8bhHUMK.mjs";import{t as g}from"./cli-types-CMNMD1V7.mjs";function _(e){return e.option(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Returns available auth methods for the specified vendor, including credential schema, instructions, and example payloads. Use this to understand what credentials are required before calling POST /v2/integrations.`,builder:g(_),handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb applications auth_methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/applications/${t[`application-id`]==null?`<application-id>`:encodeURIComponent(String(t[`application-id`]))}/auth-methods`,pathParams:{"application-id":String(t[`application-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?h:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.zeroTrust.casb.applications.authMethods.list({account_id:r,application_id:t[`application-id`]})),{successLabel:`Loaded`})}},y={command:`auth_methods`,describe:`Operations for casb.applications.auth_methods`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.positional(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <application-id>`,describe:`Returns full application details including auth methods, use cases, and permissions.`,builder:g(b),handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/applications/${t[`application-id`]==null?`<application-id>`:encodeURIComponent(String(t[`application-id`]))}`,pathParams:{"application-id":String(t[`application-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?h:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.zeroTrust.casb.applications.get({account_id:r,application_id:t[`application-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`environment`,{type:`string`,description:`Filter by supported environment (standard, fedramp).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Returns a list of available applications with use cases and permissions.`,builder:S,handler:async t=>{let n={environment:t.environment};if(t.dryRun){d({command:`cf zero_trust casb applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/applications`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?h:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.zeroTrust.casb.applications.list({account_id:a,...n})),{successLabel:`Loaded`})}};function w(e){return e.option(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`auth-method`,{type:`string`,description:`Filter by auth method id. Get available ids from GET /v2/applications.`}).option(`environment`,{type:`string`,description:`Filter by environment.`,choices:[`fedramp`,`standard`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Returns all available setup flows for the application, one per auth method.`,builder:g(w),handler:async t=>{let n={auth_method:t[`auth-method`],environment:t.environment};if(t.dryRun){d({command:`cf zero_trust casb applications setup_flows list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/applications/${t[`application-id`]==null?`<application-id>`:encodeURIComponent(String(t[`application-id`]))}/setup-flows`,pathParams:{"application-id":String(t[`application-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?h:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.zeroTrust.casb.applications.setupFlows.list({account_id:a,application_id:t[`application-id`],...n})),{successLabel:`Loaded`})}},E={command:`setup_flows`,describe:`Operations for casb.applications.setup_flows`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`applications`,describe:`Operations for casb.applications`,builder:e=>e.command(x).command(C).command(y).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`application`,{type:`string`,description:"Vendor/application slug (e.g., GOOGLE_WORKSPACE).\n\n* `BITBUCKET` - BITBUCKET\n* `BOX` - BOX\n* `CONFLUENCE` - CONFLUENCE\n* `DROPBOX` - DROPBOX\n* `GITHUB` - GITHUB\n* `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE\n* `JIRA` - JIRA\n* `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL\n* `SALESFORCE` - SALESFORCE\n* `SLACK` - SLACK",choices:[`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`SALESFORCE`,`SLACK`]}).option(`auth-method`,{type:`string`,description:`Authentication method slug (uses default if omitted).`}).option(`dlp-profiles`,{type:`string`,array:!0,description:`List of DLP profile IDs to associate.`}).option(`name`,{type:`string`,description:`Name of the integration.`}).option(`permissions`,{type:`string`,array:!0,description:`List of permission scopes (uses policy defaults if empty).`}).option(`use-cases`,{type:`string`,array:!0,description:`List of use case or feature slugs to enroll (e.g., ['casb', 'ces', 'auto_remediation']).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Serializer for v2 integration create requests.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const k={command:`create`,describe:"Creates a new integration for the specified application. Integration creation with OAuth is not supported by API at the moment. For other auth methods, use `GET /v2/applications/{application_id}/credential-guide` to see the required credential structure and example payloads for each vendor.",builder:O,handler:async r=>{if(r.dryRun){d({command:`cf zero_trust casb integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({application:p(r.application,`application`,`text`),auth_method:p(r[`auth-method`],`auth-method`,`text`),dlp_profiles:r[`dlp-profiles`],name:p(r.name,`name`,`text`),permissions:r.permissions,use_cases:r[`use-cases`]}):s(r.body)});return}let g=await o(r),_=r.local?h:await i(g);if(r.accountId=_,r.file){let e=m(r.file);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/one/integrations`,{body:e,headers:{"Content-Type":``}})),{successLabel:`Created`});return}if(r.body){let e=s(r.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/one/integrations`,{body:e})),{successLabel:`Created`});return}r.application===void 0&&(r.application=await n(`application`,"Vendor/application slug (e.g., GOOGLE_WORKSPACE). * `BITBUCKET` - BITBUCKET * `BOX` - BOX * `CONFLUENCE` - CONFLUENCE * `DROPBOX` - DROPBOX * `GITHUB` - GITHUB * `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE * `JIRA` - JIRA * `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL * `SALESFORCE` - SALESFORCE * `SLACK` - SLACK",[`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`SALESFORCE`,`SLACK`])),r.name===void 0&&(r.name=await t(`name`,`Name of the integration.`));let v={};r.application!==void 0&&c(v,[`application`],p(r.application,`application`,`text`)),r[`auth-method`]!==void 0&&c(v,[`auth_method`],p(r[`auth-method`],`auth-method`,`text`)),r[`dlp-profiles`]!==void 0&&c(v,[`dlp_profiles`],r[`dlp-profiles`]),r.name!==void 0&&c(v,[`name`],p(r.name,`name`,`text`)),r.permissions!==void 0&&c(v,[`permissions`],r.permissions),r[`use-cases`]!==void 0&&c(v,[`use_cases`],r[`use-cases`]),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/one/integrations`,{body:Object.keys(v).length>0?v:void 0})),{successLabel:`Created`})}};function A(e){return e.positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const j={command:`delete <id>`,describe:`Delete an integration by soft-deleting it.`,builder:A,handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?h:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
+ `);return}u(await f(`Deleting`,async()=>n.zeroTrust.casb.integrations.delete({account_id:a,id:t.id})),{successLabel:`Deleted`})}};function M(e){return e.positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <id>`,describe:`Returns full integration details including use cases and permissions.`,builder:M,handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?h:await i(n);t.accountId=r,u(await f(`Loading`,async()=>n.zeroTrust.casb.integrations.get({account_id:r,id:t.id})),{successLabel:`Loaded`})}};function P(e){return e.option(`application`,{type:`string`,description:`Filter by application/vendor (e.g., GOOGLE_WORKSPACE, MICROSOFT_INTERNAL).`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-enabled`,{type:`boolean`,description:`Filter by DLP enabled status (true/false).`}).option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`application`,`created`,`name`,`status`]}).option(`page`,{type:`number`,description:`Page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Search integrations by name or application.`}).option(`status`,{type:`string`,description:`Filter by integration status.`,choices:[`Healthy`,`Initializing`,`Offline`,`Unhealthy`]}).option(`use-cases`,{type:`string`,description:`Filter by enabled use cases (e.g., casb, ces). Matches integrations enrolled in any of the specified values. Can be specified multiple times.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Returns a paginated list of integrations for the account.`,builder:g(P),handler:async t=>{let n={application:t.application,direction:t.direction,dlp_enabled:t[`dlp-enabled`],order:t.order,page:t.page,page_size:t[`page-size`],search:t.search,status:t.status,use_cases:t[`use-cases`]};if(t.dryRun){d({command:`cf zero_trust casb integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?h:await i(r);t.accountId=a,u(await f(`Loading`,async()=>r.zeroTrust.casb.integrations.list({account_id:a,...n})),{successLabel:`Loaded`})}};function I(e){return e.positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`pause <id>`,describe:`Pauses an integration, stopping all crawlers.`,builder:I,handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb integrations pause`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/pause`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?h:await i(n);t.accountId=r,u(await f(`Creating`,async()=>n.zeroTrust.casb.integrations.pause({account_id:r,id:t.id})),{successLabel:`Created`})}};function R(e){return e.positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`resume <id>`,describe:`Resumes a paused integration, restarting crawlers.`,builder:R,handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb integrations resume`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/resume`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?h:await i(n);t.accountId=r,u(await f(`Creating`,async()=>n.zeroTrust.casb.integrations.resume({account_id:r,id:t.id})),{successLabel:`Created`})}};function B(e){return e.positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dlp-profiles`,{type:`string`,array:!0,description:`List of DLP profile IDs to associate with the integration.`}).option(`name`,{type:`string`,description:`Name of the integration.`}).option(`permissions`,{type:`string`,array:!0,description:`List of permission scopes granted to the integration.`}).option(`use-cases`,{type:`string`,array:!0,description:`List of use case or feature slugs to enroll (e.g., ['casb', 'ces', 'auto_remediation']).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Serializer for v2 integration PATCH requests.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const V={command:`update <id>`,describe:`Updates an integration's name, permissions, DLP profiles, use cases, or credentials.`,builder:B,handler:async t=>{if(t.dryRun){d({command:`cf zero_trust casb integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`json`,body:t.body===void 0?l({dlp_profiles:t[`dlp-profiles`],name:p(t.name,`name`,`text`),permissions:t.permissions,use_cases:t[`use-cases`]}):s(t.body)});return}let n=await o(t),r=t.local?h:await i(n);if(t.accountId=r,t.file){let e=m(t.file);u(await f(`Updating`,async()=>a(n,`PATCH`,`/accounts/${r}/one/integrations/${encodeURIComponent(String(t.id))}`,{body:e,headers:{"Content-Type":``}})),{successLabel:`Updated`});return}if(t.body){let e=s(t.body);u(await f(`Updating`,async()=>a(n,`PATCH`,`/accounts/${r}/one/integrations/${encodeURIComponent(String(t.id))}`,{body:e})),{successLabel:`Updated`});return}let g={};t[`dlp-profiles`]!==void 0&&c(g,[`dlp_profiles`],t[`dlp-profiles`]),t.name!==void 0&&c(g,[`name`],p(t.name,`name`,`text`)),t.permissions!==void 0&&c(g,[`permissions`],t.permissions),t[`use-cases`]!==void 0&&c(g,[`use_cases`],t[`use-cases`]),u(await f(`Updating`,async()=>a(n,`PATCH`,`/accounts/${r}/one/integrations/${encodeURIComponent(String(t.id))}`,{body:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`})}},H={command:`integrations`,describe:`Operations for casb.integrations`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`casb`,describe:`Operations for casb`,builder:e=>e.command(D).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`zero_trust`,describe:`zero_trust`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import{D as e,E as t,S as n,T 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"./cli-types-CMNMD1V7.mjs";function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`trigger`,describe:`Triggeres a new activation check for a PENDING Zone. This can be triggered every 5 min for paygo/ent customers, every hour for FREE Zones.`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf zones activation-check trigger`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/activation_check`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Updating`,async()=>t.zones.activationCheck.trigger({zone_id:r})),{successLabel:`Updated`})}},te={command:`activation-check`,describe:`Operations for activation-check`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).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:`edit`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:p,handler:async e=>{if(e.dryRun){c({command:`cf zones aegis edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`)}}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.aegis.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`)}});s(await l(`Updating`,async()=>t.zones.aegis.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf zones aegis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.aegis.get({zone_id:r})),{successLabel:`Loaded`})}},_={command:`aegis`,describe:`Aegis operations`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`account-id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial zone is
3
+ typically a partner-hosted zone or a CNAME setup.
4
+ `,choices:[`full`,`partial`,`secondary`,`internal`],default:`full`}).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 zone (domain) in your Cloudflare account. The zone is created in a pending state and must be activated by updating your domain's nameservers to point to Cloudflare, or by completing the verification process for partial (CNAME) setups.`,builder:v,handler:async t=>{if(t.dryRun){c({command:`cf zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({account:{id:u(t[`account-id`],`account-id`,`text`)},name:u(t.name,`name`,`text`),type:u(t.type,`type`,`text`)}):a(t.body)});return}let n=await i(t);if(t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.zones.create({...e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await e(`name`,`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`));let r=o({account:{id:u(t[`account-id`],`account-id`,`text`)},name:u(t.name,`name`,`text`),type:u(t.type,`type`,`text`)});s(await l(`Creating`,async()=>n.zones.create({...r})),{successLabel:`Created`})}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete`,describe:`Deletes an existing zone.`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),a=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=a,!await r({force:!!e.force})){process.stderr.write(`Aborted.
5
+ `);return}s(await l(`Deleting`,async()=>t.zones.delete({zone_id:a})),{successLabel:`Deleted`})}};function S(e){return e.option(`paused`,{type:`boolean`,description:`Indicates whether the zone is only using Cloudflare DNS services. A
6
+ true value means the zone will not receive security or performance
7
+ benefits.
8
+ `}).option(`plan-id`,{type:`string`,description:`Identifier`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial
9
+ zone is typically a partner-hosted zone or a CNAME setup. This
10
+ parameter is only available to Enterprise customers or if it has
11
+ been explicitly enabled on a zone.
12
+ `,choices:[`full`,`partial`,`secondary`,`internal`]}).option(`vanity-name-servers`,{type:`string`,array:!0,description:`An array of domains used for custom name servers. This is only
13
+ available for Business and Enterprise plans.`}).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`,describe:`Edits a zone. Only one zone property can be changed at a time.`,builder:S,handler:async e=>{if(e.dryRun){c({command:`cf zones edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({paused:e.paused,plan:{id:u(e[`plan-id`],`plan-id`,`text`)},type:u(e.type,`type`,`text`),vanity_name_servers:e[`vanity-name-servers`]}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({paused:e.paused,plan:{id:u(e[`plan-id`],`plan-id`,`text`)},type:u(e.type,`type`,`text`),vanity_name_servers:e[`vanity-name-servers`]});s(await l(`Updating`,async()=>t.zones.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Creates environments for a zone.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf zones environments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Creating`,async()=>t.zones.environments.create({body:n,zone_id:r})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function E(e){return e.positional(`environment-id`,{type:`string`,description:`Reference identifier for the environment.`,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 D={command:`delete <environment-id>`,describe:`Deletes a zone environment by reference identifier.`,builder:E,handler:async e=>{if(e.dryRun){c({command:`cf zones environments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`none`});return}let t=await i(e),a=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=a,!await r({force:!!e.force})){process.stderr.write(`Aborted.
14
+ `);return}s(await l(`Deleting`,async()=>t.zones.environments.delete({zone_id:a,environment_id:e[`environment-id`]})),{successLabel:`Deleted`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`edit`,describe:`Applies partial updates to zone environments.`,builder:O,handler:async e=>{if(e.dryRun){c({command:`cf zones environments edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.environments.edit({body:n,zone_id:r})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Lists configured environments for a zone.`,builder:A,handler:async e=>{if(e.dryRun){c({command:`cf zones environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.environments.list({zone_id:r})),{successLabel:`Loaded`})}};function M(e){return e.positional(`environment-id`,{type:`string`,description:`Reference identifier for the environment.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`rollback <environment-id>`,describe:`Rolls a zone environment back to its previous version.`,builder:M,handler:async e=>{if(e.dryRun){c({command:`cf zones environments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/rollback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>t.zones.environments.rollback({zone_id:r,environment_id:e[`environment-id`]})),{successLabel:`Created`})}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update`,describe:`Replaces the full environment configuration for a zone.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf zones environments update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.environments.update({body:n,zone_id:r})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},I={command:`environments`,describe:`Operations for environments`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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:`edit`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:L,handler:async e=>{if(e.dryRun){c({command:`cf zones fonts edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/fonts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let r=await i(e),d=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.zones.fonts.edit({...t,zone_id:d})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await t(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>r.zones.fonts.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:z,handler:async e=>{if(e.dryRun){c({command:`cf zones fonts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/fonts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.fonts.get({zone_id:r})),{successLabel:`Loaded`})}},V={command:`fonts`,describe:`Fonts operations`,builder:e=>e.command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Retrieves detailed information about a specific zone identified by its zone ID. Returns zone configuration, status, nameservers, and associated metadata.`,builder:H,handler:async e=>{if(e.dryRun){c({command:`cf zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.get({zone_id:r})),{successLabel:`Loaded`})}};function W(e){return e.option(`include-subdomains`,{type:`boolean`,description:`If provided, the zone hold will extend to block any subdomain of the given zone, as well
15
+ as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
16
+ 'example.com' and include_subdomains=true will block 'example.com',
17
+ 'staging.example.com', 'api.staging.example.com', etc.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`create`,describe:`Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. Zone holds cannot be enabled on CDN-only zones.`,builder:W,handler:async e=>{let t={include_subdomains:e[`include-subdomains`]};if(e.dryRun){c({command:`cf zones holds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,s(await l(`Creating`,async()=>r.zones.holds.create({zone_id:a,...t})),{successLabel:`Created`})}};function K(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. Otherwise, the hold will be\ndisabled indefinitely. `hold_after` cannot be provided for CDN-only zones."}).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`,describe:"Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. Existing zone holds can be removed from CDN-only zones when `hold_after` is not provided. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:K,handler:async e=>{let t={hold_after:e[`hold-after`]};if(e.dryRun){c({command:`cf zones holds delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let a=await i(e),o=await n({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
18
+ `);return}s(await l(`Deleting`,async()=>a.zones.holds.delete({zone_id:o,...t})),{successLabel:`Deleted`})}};function J(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided and future-dated, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. A past-dated `hold_after` value will have\nno effect on an existing, enabled hold. Providing an empty string will set its value\nto the current time. Providing `null` will disable the hold indefinitely."}).option(`include-subdomains`,{type:`boolean`,description:`If \`true\`, the zone hold will extend to block any subdomain of the given zone, as well
19
+ as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
20
+ 'example.com' and include_subdomains=true will block 'example.com',
21
+ 'staging.example.com', 'api.staging.example.com', etc.`}).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:`edit`,describe:"Update the `hold_after` and/or `include_subdomains` values on an existing zone hold. The hold is enabled if the `hold_after` date-time value is in the past. Existing zone holds can be removed from CDN-only zones by setting `hold_after` to `null`. Other zone hold updates cannot be made on CDN-only zones. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:J,handler:async e=>{if(e.dryRun){c({command:`cf zones holds edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({hold_after:u(e[`hold-after`],`hold-after`,`text`),include_subdomains:e[`include-subdomains`]}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.holds.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({hold_after:u(e[`hold-after`],`hold-after`,`text`),include_subdomains:e[`include-subdomains`]});s(await l(`Updating`,async()=>t.zones.holds.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get`,describe:`Retrieve whether the zone is subject to a zone hold, and metadata about the hold.`,builder:X,handler:async e=>{if(e.dryRun){c({command:`cf zones holds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.holds.get({zone_id:r})),{successLabel:`Loaded`})}},Q={command:`holds`,describe:`Operations for holds`,builder:e=>e.command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`name`,{type:`string`,description:"A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`status`,{type:`string`,description:`Specify a zone status to filter by.`,choices:[`initializing`,`pending`,`active`,`moved`]}).option(`type`,{type:`string`,description:`Zone types to filter by. Multiple types can be specified as a comma-separated list (e.g., ?type=full,partial,secondary). When this parameter is not provided, zones with type "internal" are excluded from the results.`}).option(`account-id`,{type:`string`,description:`Filter by an account ID.`}).option(`account-name`,{type:`string`,description:"An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`order`,{type:`string`,description:`Field to order zones by.`,choices:[`name`,`status`,`account.id`,`account.name`,`plan.id`]}).option(`direction`,{type:`string`,description:`Direction to order zones.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`list`,describe:`Lists, searches, sorts, and filters your zones. Listing zones across more than 500 accounts is currently not allowed.`,builder:d(ne),handler:async e=>{let t={name:e.name,status:e.status,type:e.type,"account.id":e[`account-id`],"account.name":e[`account-name`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,match:e.match};if(e.dryRun){c({command:`cf zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.zones.list(t)),{successLabel:`Loaded`})}};function ie(e){return e.option(`value`,{type:`number`,description:`Value of the Origin H2 Max Streams Setting.`}).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 ae={command:`edit`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:ie,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-h2-max-streams edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_h2_max_streams`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:e.value}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.originH2MaxStreams.edit({...n,zone_id:r})),{successLabel:`Updated`});return}if(e.value===void 0)throw Error(`--value is required (or pass --body with this field set).`);let u=o({value:e.value});s(await l(`Updating`,async()=>t.zones.originH2MaxStreams.edit({...u,zone_id:r})),{successLabel:`Updated`})}};function oe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:oe,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-h2-max-streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_h2_max_streams`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.originH2MaxStreams.get({zone_id:r})),{successLabel:`Loaded`})}},ce={command:`origin-h2-max-streams`,describe:`Origin H2 Max Streams operations`,builder:e=>e.command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Max HTTP Version Setting.`,choices:[`2`,`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 ue={command:`edit`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:le,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-max-http-version edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_max_http_version`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let r=await i(e),d=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.zones.originMaxHttpVersion.edit({...t,zone_id:d})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await t(`value`,`Value of the Origin Max HTTP Version Setting.`,[`2`,`1`]));let f=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>r.zones.originMaxHttpVersion.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:de,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-max-http-version get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_max_http_version`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.originMaxHttpVersion.get({zone_id:r})),{successLabel:`Loaded`})}},pe={command:`origin-max-http-version`,describe:`Origin Max Http Version operations`,builder:e=>e.command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`plan-identifier`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <plan-identifier>`,describe:`Details of the available plan that the zone can subscribe to.`,builder:me,handler:async e=>{if(e.dryRun){c({command:`cf zones plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/available_plans/${e[`plan-identifier`]==null?`<plan-identifier>`:encodeURIComponent(String(e[`plan-identifier`]))}`,pathParams:{"plan-identifier":String(e[`plan-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.plans.get({zone_id:r,plan_identifier:e[`plan-identifier`]})),{successLabel:`Loaded`})}};function ge(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Lists available plans the zone can subscribe to.`,builder:ge,handler:async e=>{if(e.dryRun){c({command:`cf zones plans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/available_plans`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.plans.list({zone_id:r})),{successLabel:`Loaded`})}},ve={command:`plans`,describe:`Operations for plans`,builder:e=>e.command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get`,describe:`Lists all rate plans the zone can subscribe to.`,builder:ye,handler:async e=>{if(e.dryRun){c({command:`cf zones rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/available_rate_plans`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.ratePlans.get({zone_id:r})),{successLabel:`Loaded`})}},xe={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`value`,{type:`string`,description:`Value can either be On or Off.`}).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:`edit`,describe:`Toggles RUM on/off for an existing zone.`,builder:Se,handler:async e=>{if(e.dryRun){c({command:`cf zones rum edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/rum`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.rum.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>t.zones.rum.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function we(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get`,describe:`Retrieves RUM status for a zone.`,builder:we,handler:async e=>{if(e.dryRun){c({command:`cf zones rum get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/rum`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.rum.get({zone_id:r})),{successLabel:`Loaded`})}},Ee={command:`rum`,describe:`Operations for rum`,builder:e=>e.command(Ce).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`ssl-recommender enrollment setting.`}).option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`value-cache-by-device-type`,{type:`boolean`,description:`Indicates whether or not [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) is enabled.`}).option(`value-cf`,{type:`boolean`,description:`Indicates whether or not Cloudflare proxy is enabled.`}).option(`value-hostnames`,{type:`string`,array:!0,description:`An array of hostnames where Automatic Platform Optimization for WordPress is activated.`}).option(`value-wordpress`,{type:`boolean`,description:`Indicates whether or not site is powered by WordPress.`}).option(`value-wp-plugin`,{type:`boolean`,description:`Indicates whether or not [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is installed.`}).option(`value-strict-transport-security-enabled`,{type:`boolean`,description:`Whether or not strict transport security is enabled.`}).option(`value-strict-transport-security-include-subdomains`,{type:`boolean`,description:`Include all subdomains for strict transport security.`}).option(`value-strict-transport-security-max-age`,{type:`number`,description:`Max age in seconds of the strict transport security.`}).option(`value-strict-transport-security-nosniff`,{type:`boolean`,description:`Whether or not to include 'X-Content-Type-Options: nosniff' header.`}).option(`value-strict-transport-security-preload`,{type:`boolean`,description:`Enable automatic preload of the HSTS configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`value-pool-id`,[`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).conflicts(`value-cache-by-device-type`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cache-by-device-type`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`]).conflicts(`value-cf`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cf`,[`value-strict-transport-security-enabled`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-hostnames`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-hostnames`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-cache-by-device-type`]).conflicts(`value-wordpress`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wordpress`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-wp-plugin`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wp-plugin`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-hostnames`,`value-cache-by-device-type`]).implies(`value-strict-transport-security-enabled`,[`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-strict-transport-security-include-subdomains`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-max-age`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-nosniff`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-preload`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`])}const Oe={command:`edit <setting-id>`,describe:`Updates a single zone setting by the identifier`,builder:De,handler:async e=>{if(e.dryRun){c({command:`cf zones settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/${e[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(e[`setting-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"setting-id":String(e[`setting-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({enabled:e.enabled,value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:e[`value-cache-by-device-type`],cf:e[`value-cf`],hostnames:e[`value-hostnames`],wordpress:e[`value-wordpress`],wp_plugin:e[`value-wp-plugin`],strict_transport_security:{enabled:e[`value-strict-transport-security-enabled`],include_subdomains:e[`value-strict-transport-security-include-subdomains`],max_age:e[`value-strict-transport-security-max-age`],nosniff:e[`value-strict-transport-security-nosniff`],preload:e[`value-strict-transport-security-preload`]}}}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.settings.edit({body:n,zone_id:r,setting_id:e[`setting-id`]})),{successLabel:`Updated`});return}let d=o({enabled:e.enabled,value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:e[`value-cache-by-device-type`],cf:e[`value-cf`],hostnames:e[`value-hostnames`],wordpress:e[`value-wordpress`],wp_plugin:e[`value-wp-plugin`],strict_transport_security:{enabled:e[`value-strict-transport-security-enabled`],include_subdomains:e[`value-strict-transport-security-include-subdomains`],max_age:e[`value-strict-transport-security-max-age`],nosniff:e[`value-strict-transport-security-nosniff`],preload:e[`value-strict-transport-security-preload`]}}});s(await l(`Updating`,async()=>t.zones.settings.edit({body:d,zone_id:r,setting_id:e[`setting-id`]})),{successLabel:`Updated`})}};function ke(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <setting-id>`,describe:`Fetch a single zone setting by name`,builder:ke,handler:async e=>{if(e.dryRun){c({command:`cf zones settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/${e[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(e[`setting-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"setting-id":String(e[`setting-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.settings.get({zone_id:r,setting_id:e[`setting-id`]})),{successLabel:`Loaded`})}},je={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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 Ne={command:`edit`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:Me,handler:async e=>{if(e.dryRun){c({command:`cf zones speed-brain edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/speed_brain`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let r=await i(e),d=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.zones.speedBrain.edit({...t,zone_id:d})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await t(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>r.zones.speedBrain.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:Pe,handler:async e=>{if(e.dryRun){c({command:`cf zones speed-brain get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/speed_brain`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.speedBrain.get({zone_id:r})),{successLabel:`Loaded`})}},Fe={command:`speed-brain`,describe:`Speed Brain operations`,builder:e=>e.command(Ne).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Le={command:`create`,describe:`Create a zone subscription, either plan or add-ons.`,builder:Ie,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Creating`,async()=>t.zones.subscriptions.create({body:n,zone_id:r})),{successLabel:`Created`});return}let d=o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}});s(await l(`Creating`,async()=>t.zones.subscriptions.create({body:d,zone_id:r})),{successLabel:`Created`})}};function Re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ze={command:`get`,describe:`Lists zone subscription details.`,builder:Re,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.subscriptions.get({zone_id:r})),{successLabel:`Loaded`})}};function Be(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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`,describe:`Updates zone subscriptions, either plan or add-ons.`,builder:Be,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.zones.subscriptions.update({body:n,zone_id:r})),{successLabel:`Updated`});return}let d=o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}});s(await l(`Updating`,async()=>t.zones.subscriptions.update({body:d,zone_id:r})),{successLabel:`Updated`})}},He={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Le).command(ze).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ue={command:`zones`,describe:`Zones are domains on Cloudflare — list, create, and configure domain settings`,builder:e=>e.command(y).command(x).command(C).command(U).command(re).command(te).command(_).command(I).command(V).command(Q).command(ce).command(pe).command(ve).command(xe).command(Ee).command(je).command(Fe).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ue as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "The Cloudflare CLI",
5
5
  "keywords": [
6
6
  "ai",
@@ -32,7 +32,8 @@
32
32
  "type": "module",
33
33
  "main": "./dist/index.mjs",
34
34
  "imports": {
35
- "#lib/*": "./src/lib/*"
35
+ "#lib/*": "./src/lib/*",
36
+ "#sdk": "./src/sdk/sdk/index.ts"
36
37
  },
37
38
  "dependencies": {
38
39
  "blake3-wasm": "2.1.5"
@@ -42,11 +43,11 @@
42
43
  "@clack/core": "1.2.0",
43
44
  "@clack/prompts": "^1.2.0",
44
45
  "@cloudflare/cli-shared-helpers": "^0.1.0",
45
- "@cloudflare/deploy-helpers": "^0.4.0",
46
+ "@cloudflare/deploy-helpers": "file:../../vendor/cloudflare-deploy-helpers-0.4.0.tgz",
46
47
  "@cloudflare/forge": "file:../../vendor/cloudflare-forge-0.1.0.tgz",
47
- "@cloudflare/forge-sdk-ts": "file:../../vendor/cloudflare-forge-sdk-ts-0.1.0.tgz",
48
- "@cloudflare/workers-auth": "^0.4.2",
49
- "@cloudflare/workers-utils": "^0.26.0",
48
+ "@cloudflare/forge-transformer-sdk-ts": "file:../../vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz",
49
+ "@cloudflare/workers-auth": "file:../../vendor/cloudflare-workers-auth-0.4.2.tgz",
50
+ "@cloudflare/workers-utils": "file:../../vendor/cloudflare-workers-utils-0.26.0.tgz",
50
51
  "@types/node": "25.3.5",
51
52
  "@types/yargs": "17.0.35",
52
53
  "am-i-vibing": "^0.1.1",
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{T as e,h as t,t as n,w as r,x as i}from"./auth-CQcAgnOy.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-CjcQ6ato.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
3
- `}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
4
- `,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
5
- `}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
6
- `,choices:[`send`,`send-anon`,`none`]}).option(`signature`,{type:`string`,description:`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`}).option(`state`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`justification`,{type:`string`,description:`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters.
7
- `}).option(`trademark-number`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-office`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-symbol`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`destination-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ports-protocols`,{type:`string`,description:`A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual port/protocol should not exceed 100 characters. The list should not have more than 30 unique ports and protocols.`}).option(`source-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ncmec-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
8
- `,choices:[`send`,`send-anon`]}).option(`reg-who-request-reg-who-authorization-statement`,{type:`string`,description:`Optional authorization statement or power of attorney per RDP 10.2.1.3.`}).option(`reg-who-request-reg-who-good-faith-affirmation`,{type:`boolean`,description:`Affirmation that the request is made in good faith per RDP 10.2.4. Must be true.`}).option(`reg-who-request-reg-who-lawful-processing-agreement`,{type:`boolean`,description:`Agreement to process data lawfully per RDP 10.2.5. Must be true.`}).option(`reg-who-request-reg-who-legal-basis`,{type:`string`,description:`Legal rights and rationale for the request per RDP 10.2.3. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-request-type`,{type:`string`,description:`The type of WHOIS data request per RDP procedure.`,choices:[`disclosure`,`invalid_whois`]}).option(`reg-who-request-reg-who-requested-data-elements`,{type:`string`,array:!0,description:`The specific WHOIS data elements being requested per RDP 10.2.2. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-requestor-type`,{type:`string`,description:`The nature of the requestor per RDP 10.2.1.2.`,choices:[`government`,`corporation`,`individual`]}).option(`ncsei-subject-representation`,{type:`boolean`,description:`If the submitter is the target of NCSEI in the URLs of the abuse report.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`address1`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`address1`,[`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agent-name`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agent-name`,[`address1`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agree`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agree`,[`address1`,`agent-name`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`city`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`city`,[`address1`,`agent-name`,`agree`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`country`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`original-work`]).implies(`country`,[`address1`,`agent-name`,`agree`,`city`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`host-notification`,[`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).conflicts(`original-work`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`country`]).implies(`original-work`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`signature`,`state`]).conflicts(`signature`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`signature`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`state`]).conflicts(`state`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`state`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`]).conflicts(`justification`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`trademark-number`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-number`,[`host-notification`,`justification`,`trademark-office`,`trademark-symbol`]).conflicts(`trademark-office`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-office`,[`host-notification`,`justification`,`trademark-number`,`trademark-symbol`]).conflicts(`trademark-symbol`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-symbol`,[`host-notification`,`justification`,`trademark-number`,`trademark-office`]).conflicts(`destination-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ports-protocols`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`source-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ncmec-notification`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`ncmec-notification`,[`host-notification`,`justification`]).conflicts(`reg-who-request-reg-who-authorization-statement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-good-faith-affirmation`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-lawful-processing-agreement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-legal-basis`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-request-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requested-data-elements`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requestor-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`ncsei-subject-representation`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).implies(`ncsei-subject-representation`,[`host-notification`]).check(e=>{if([`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`].some(t=>e[t]!==void 0)){let t={"reg-who-request-reg-who-good-faith-affirmation":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-lawful-processing-agreement":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-legal-basis":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-request-type":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-requested-data-elements":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]},n=[`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0})}const p={command:`create <report-param>`,describe:`Submit the Abuse Report of a particular type`,builder:f,handler:async f=>{if(f.dryRun){c({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${f[`report-param`]==null?`<report-param>`:encodeURIComponent(String(f[`report-param`]))}`,pathParams:{"report-param":String(f[`report-param`]??``)},bodyKind:`json`,body:{comments:f.comments,company:f.company,email:f.email,email2:f.email2,name:f.name,"reported-country":f[`reported-country`],"reported-user-agent":f[`reported-user-agent`],tele:f.tele,title:f.title,urls:f.urls,address1:f.address1,"agent-name":f[`agent-name`],agree:f.agree,city:f.city,country:f.country,"host-notification":f[`host-notification`],"original-work":f[`original-work`],"owner-notification":f[`owner-notification`],signature:f.signature,state:f.state,justification:f.justification,"trademark-number":f[`trademark-number`],"trademark-office":f[`trademark-office`],"trademark-symbol":f[`trademark-symbol`],"destination-ips":f[`destination-ips`],"ports-protocols":f[`ports-protocols`],"source-ips":f[`source-ips`],"ncmec-notification":f[`ncmec-notification`],"reg-who-request-reg-who-authorization-statement":f[`reg-who-request-reg-who-authorization-statement`],"reg-who-request-reg-who-good-faith-affirmation":f[`reg-who-request-reg-who-good-faith-affirmation`],"reg-who-request-reg-who-lawful-processing-agreement":f[`reg-who-request-reg-who-lawful-processing-agreement`],"reg-who-request-reg-who-legal-basis":f[`reg-who-request-reg-who-legal-basis`],"reg-who-request-reg-who-request-type":f[`reg-who-request-reg-who-request-type`],"reg-who-request-reg-who-requested-data-elements":f[`reg-who-request-reg-who-requested-data-elements`],"reg-who-request-reg-who-requestor-type":f[`reg-who-request-reg-who-requestor-type`],"ncsei-subject-representation":f[`ncsei-subject-representation`],body:f.body}});return}let p=await n(f),m=f.local?d:await t(p);if(f.accountId=m,f.body){let e=o(f.body);s(await l(`Creating`,async()=>p.post(`/accounts/${m}/abuse-reports/${encodeURIComponent(String(f[`report-param`]))}`,{body:e})),{successLabel:`Created`});return}f.email===void 0&&(f.email=await e(`email`,`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.email2===void 0&&(f.email2=await e(`email2`,"Should match the value provided in `email`")),f.name===void 0&&(f.name=await e(`name`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.urls===void 0&&(f.urls=await e(`urls`,`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f[`owner-notification`]===void 0&&(f[`owner-notification`]=await r(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`]));let h={};f.comments!==void 0&&a(h,[`comments`],u(f.comments,`comments`,`text`)),f.company!==void 0&&a(h,[`company`],u(f.company,`company`,`text`)),f.email!==void 0&&a(h,[`email`],u(f.email,`email`,`text`)),f.email2!==void 0&&a(h,[`email2`],u(f.email2,`email2`,`text`)),f.name!==void 0&&a(h,[`name`],u(f.name,`name`,`text`)),f[`reported-country`]!==void 0&&a(h,[`reported_country`],u(f[`reported-country`],`reported-country`,`text`)),f[`reported-user-agent`]!==void 0&&a(h,[`reported_user_agent`],u(f[`reported-user-agent`],`reported-user-agent`,`text`)),f.tele!==void 0&&a(h,[`tele`],u(f.tele,`tele`,`text`)),f.title!==void 0&&a(h,[`title`],u(f.title,`title`,`text`)),f.urls!==void 0&&a(h,[`urls`],u(f.urls,`urls`,`text`)),f.address1!==void 0&&a(h,[`address1`],u(f.address1,`address1`,`text`)),f[`agent-name`]!==void 0&&a(h,[`agent_name`],u(f[`agent-name`],`agent-name`,`text`)),f.agree!==void 0&&a(h,[`agree`],f.agree),f.city!==void 0&&a(h,[`city`],u(f.city,`city`,`text`)),f.country!==void 0&&a(h,[`country`],u(f.country,`country`,`text`)),f[`host-notification`]!==void 0&&a(h,[`host_notification`],u(f[`host-notification`],`host-notification`,`text`)),f[`original-work`]!==void 0&&a(h,[`original_work`],u(f[`original-work`],`original-work`,`text`)),f[`owner-notification`]!==void 0&&a(h,[`owner_notification`],u(f[`owner-notification`],`owner-notification`,`text`)),f.signature!==void 0&&a(h,[`signature`],u(f.signature,`signature`,`text`)),f.state!==void 0&&a(h,[`state`],u(f.state,`state`,`text`)),f.justification!==void 0&&a(h,[`justification`],u(f.justification,`justification`,`text`)),f[`trademark-number`]!==void 0&&a(h,[`trademark_number`],u(f[`trademark-number`],`trademark-number`,`text`)),f[`trademark-office`]!==void 0&&a(h,[`trademark_office`],u(f[`trademark-office`],`trademark-office`,`text`)),f[`trademark-symbol`]!==void 0&&a(h,[`trademark_symbol`],u(f[`trademark-symbol`],`trademark-symbol`,`text`)),f[`destination-ips`]!==void 0&&a(h,[`destination_ips`],u(f[`destination-ips`],`destination-ips`,`text`)),f[`ports-protocols`]!==void 0&&a(h,[`ports_protocols`],u(f[`ports-protocols`],`ports-protocols`,`text`)),f[`source-ips`]!==void 0&&a(h,[`source_ips`],u(f[`source-ips`],`source-ips`,`text`)),f[`ncmec-notification`]!==void 0&&a(h,[`ncmec_notification`],u(f[`ncmec-notification`],`ncmec-notification`,`text`)),f[`reg-who-request-reg-who-authorization-statement`]!==void 0&&a(h,[`reg_who_request`,`reg_who_authorization_statement`],u(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`)),f[`reg-who-request-reg-who-good-faith-affirmation`]!==void 0&&a(h,[`reg_who_request`,`reg_who_good_faith_affirmation`],f[`reg-who-request-reg-who-good-faith-affirmation`]),f[`reg-who-request-reg-who-lawful-processing-agreement`]!==void 0&&a(h,[`reg_who_request`,`reg_who_lawful_processing_agreement`],f[`reg-who-request-reg-who-lawful-processing-agreement`]),f[`reg-who-request-reg-who-legal-basis`]!==void 0&&a(h,[`reg_who_request`,`reg_who_legal_basis`],u(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`)),f[`reg-who-request-reg-who-request-type`]!==void 0&&a(h,[`reg_who_request`,`reg_who_request_type`],u(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`)),f[`reg-who-request-reg-who-requested-data-elements`]!==void 0&&a(h,[`reg_who_request`,`reg_who_requested_data_elements`],f[`reg-who-request-reg-who-requested-data-elements`]),f[`reg-who-request-reg-who-requestor-type`]!==void 0&&a(h,[`reg_who_request`,`reg_who_requestor_type`],u(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)),f[`ncsei-subject-representation`]!==void 0&&a(h,[`ncsei_subject_representation`],f[`ncsei-subject-representation`]),s(await l(`Creating`,async()=>p.post(`/accounts/${m}/abuse-reports/${encodeURIComponent(String(f[`report-param`]))}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function m(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1)`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent to hosts or submitters.`,builder:m,handler:async e=>{let r={page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${e[`report-id`]==null?`<report-id>`:encodeURIComponent(String(e[`report-id`]))}/emails`,pathParams:{"report-id":String(e[`report-id`]??``)},query:r,bodyKind:`none`});return}let a=await n(e),o=e.local?d:await t(a);e.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.emails.list(o,e[`report-id`],r)),{successLabel:`Loaded`})}},g={command:`emails`,describe:`Emails operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`report-param`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <report-param>`,describe:`Retrieve the details of an abuse report.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${e[`report-param`]==null?`<report-param>`:encodeURIComponent(String(e[`report-param`]))}`,pathParams:{"report-param":String(e[`report-param`]??``)},bodyKind:`none`});return}let r=await n(e),a=e.local?d:await t(r);e.accountId=a,s(await l(`Loading`,async()=>r.abuseReports.get(a,e[`report-param`])),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order (id, cdate, domain, type, status)`}).option(`domain`,{type:`string`,description:`Filter by domain name related to the abuse report`}).option(`created-before`,{type:`string`,description:`Returns reports created before the specified date`}).option(`created-after`,{type:`string`,description:`Returns reports created after the specified date`}).option(`status`,{type:`string`,description:`Filter by the status of the report.`,choices:[`accepted`,`in_review`]}).option(`type`,{type:`string`,description:`Filter by the type of the report.`,choices:[`PHISH`,`GEN`,`THREAT`,`DMCA`,`EMER`,`TM`,`REG_WHO`,`NCSEI`,`NETWORK`]}).option(`mitigation-status`,{type:`string`,description:`Filter reports that have any mitigations in the given status.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List the abuse reports for a given account`,builder:y,handler:async e=>{let r={page:e.page,per_page:e[`per-page`],sort:e.sort,domain:e.domain,created_before:e[`created-before`],created_after:e[`created-after`],status:e.status,type:e.type,mitigation_status:e[`mitigation-status`]};if(e.dryRun){c({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports`,pathParams:{},query:r,bodyKind:`none`});return}let a=await n(e),o=e.local?d:await t(a);e.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.list(o,r)),{successLabel:`Loaded`})}};function x(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set, e.g. ?type=rate_limit_cache&type=legal_block.`,choices:[`legal_block`,`misleading_interstitial`,`phishing_interstitial`,`network_block`,`rate_limit_cache`,`account_suspend`,`redirect_video_stream`]}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:x,handler:async e=>{let r={page:e.page,per_page:e[`per-page`],sort:e.sort,type:e.type,effective_before:e[`effective-before`],effective_after:e[`effective-after`],status:e.status,entity_type:e[`entity-type`]};if(e.dryRun){c({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${e[`report-id`]==null?`<report-id>`:encodeURIComponent(String(e[`report-id`]))}/mitigations`,pathParams:{"report-id":String(e[`report-id`]??``)},query:r,bodyKind:`none`});return}let a=await n(e),o=e.local?d:await t(a);e.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.mitigations.list(o,e[`report-id`],r)),{successLabel:`Loaded`})}};function C(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`review <report-id>`,describe:`Request a review for mitigations on an account.`,builder:C,handler:async e=>{if(e.dryRun){c({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${e[`report-id`]==null?`<report-id>`:encodeURIComponent(String(e[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(e[`report-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let r=await n(e),a=e.local?d:await t(r);if(e.accountId=a,e.body){let t=o(e.body);s(await l(`Creating`,async()=>r.post(`/accounts/${a}/abuse-reports/${encodeURIComponent(String(e[`report-id`]))}/mitigations/appeal`,{body:t})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>r.abuseReports.mitigations.review(a,e[`report-id`])),{successLabel:`Created`})}},T={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(p).command(v).command(b).command(g).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,h as n,t as r,x as i}from"./auth-CQcAgnOy.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-CjcQ6ato.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const p={command:`create`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf accounts account-organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:{"destination-organization-id":e[`destination-organization-id`],body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/move`,{body:t})),{successLabel:`Created`});return}e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await t(`destination-organization-id`,`The destination_organization_id field`));let m={};e[`destination-organization-id`]!==void 0&&a(m,[`destination_organization_id`],u(e[`destination-organization-id`],`destination-organization-id`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/move`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}},m={command:`account-organizations`,describe:`Move accounts between organizations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:ee,handler:async e=>{if(e.dryRun){c({command:`cf accounts account-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.accountProfile.get(a)),{successLabel:`Loaded`})}};function h(e){return e.option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 g={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf accounts account-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:{"business-address":e[`business-address`],"business-email":e[`business-email`],"business-name":e[`business-name`],"business-phone":e[`business-phone`],"external-metadata":e[`external-metadata`],body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Updating`,async()=>f.put(`/accounts/${p}/profile`,{body:t})),{successLabel:`Updated`});return}e[`business-address`]===void 0&&(e[`business-address`]=await t(`business-address`,`The business_address field`)),e[`business-email`]===void 0&&(e[`business-email`]=await t(`business-email`,`The business_email field`)),e[`business-name`]===void 0&&(e[`business-name`]=await t(`business-name`,`The business_name field`)),e[`business-phone`]===void 0&&(e[`business-phone`]=await t(`business-phone`,`The business_phone field`)),e[`external-metadata`]===void 0&&(e[`external-metadata`]=await t(`external-metadata`,`The external_metadata field`));let m={};e[`business-address`]!==void 0&&a(m,[`business_address`],u(e[`business-address`],`business-address`,`text`)),e[`business-email`]!==void 0&&a(m,[`business_email`],u(e[`business-email`],`business-email`,`text`)),e[`business-name`]!==void 0&&a(m,[`business_name`],u(e[`business-name`],`business-name`,`text`)),e[`business-phone`]!==void 0&&a(m,[`business_phone`],u(e[`business-phone`],`business-phone`,`text`)),e[`external-metadata`]!==void 0&&a(m,[`external_metadata`],u(e[`external-metadata`],`external-metadata`,`text`)),s(await l(`Updating`,async()=>f.put(`/accounts/${p}/profile`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},_={command:`account-profile`,describe:`View and manage the profile for a Cloudflare account`,builder:e=>e.command(te).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
3
- - name: Filter by application name (e.g., name:HR)
4
- - id: Filter by application ID (e.g., id:0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0)
5
- - human_id: Filter by human-readable ID (e.g., human_id:HR)
6
- - hostname: Filter by hostname or support domain (e.g., hostname:portal.example.com)
7
- - source: Filter by application source name (e.g., source:cloudflare)
8
- - ip_subnet: Filter by IP subnet using CIDR containment — returns applications where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32 matches apps with 10.0.0.0/16)
9
- - intel_id: Filter by Intel API ID (e.g., intel_id:498).
10
- .`}).option(`limit`,{type:`number`,description:`Limit of number of results to return (max 250).`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`order-by`,{type:`string`,description:`Order by result by field name and order (e.g., name:asc).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`applications`,describe:`List applications with different filters.`,builder:v,handler:async e=>{let t={filter:e.filter,limit:e.limit,offset:e.offset,order_by:e[`order-by`]};if(e.dryRun){c({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/applications`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.applications.get.applications(o,t)),{successLabel:`Loaded`})}};function b(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`id <id>`,describe:`Get application by ID.`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/applications/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.applications.get.by.id(a,e.id)),{successLabel:`Loaded`})}},S={command:`by`,describe:`Applications operations`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`get`,describe:`Applications operations`,builder:e=>e.command(y).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`applications`,describe:`Operations for applications`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`id <id>`,describe:`Get application category by ID.`,builder:T,handler:async e=>{if(e.dryRun){c({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/categories/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.categories.get.by.id(a,e.id)),{successLabel:`Loaded`})}},D={command:`by`,describe:`Categories operations`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`categories`,describe:`List application categories.`,builder:O,handler:async e=>{let t={limit:e.limit,offset:e.offset};if(e.dryRun){c({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/categories`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.categories.get.categories(o,t)),{successLabel:`Loaded`})}},A={command:`get`,describe:`Categories operations`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`categories`,describe:`Operations for categories`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`name`,{type:`string`,description:`Account name`}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const N={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:M,handler:async e=>{if(e.dryRun){c({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:{name:e.name,"unit-id":e[`unit-id`],body:e.body}});return}let n=await r(e);if(e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/accounts`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`Account name`));let i={};e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),e[`unit-id`]!==void 0&&a(i,[`unit`,`id`],u(e[`unit-id`],`unit-id`,`text`)),s(await l(`Creating`,async()=>n.post(`/accounts`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:P,handler:async t=>{if(t.dryRun){c({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let a=await r(t),o=t.local?d:await n(a);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
11
- `);return}s(await l(`Deleting`,async()=>a.accounts.delete(o)),{successLabel:`Deleted`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.get(a)),{successLabel:`Loaded`})}};function R(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).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:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:R,handler:async e=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){c({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await r(e);s(await l(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function B(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:B,handler:async e=>{let t={account_name:e[`account-name`],action_result:e[`action-result`],action_type:e[`action-type`],actor_context:e[`actor-context`],actor_email:e[`actor-email`],actor_id:e[`actor-id`],actor_ip_address:e[`actor-ip-address`],actor_token_id:e[`actor-token-id`],actor_token_name:e[`actor-token-name`],actor_type:e[`actor-type`],audit_log_id:e[`audit-log-id`],id:e.id,raw_cf_ray_id:e[`raw-cf-ray-id`],raw_method:e[`raw-method`],raw_status_code:e[`raw-status-code`],raw_uri:e[`raw-uri`],resource_id:e[`resource-id`],resource_product:e[`resource-product`],resource_type:e[`resource-type`],resource_scope:e[`resource-scope`],zone_id:e[`zone-id`],zone_name:e[`zone-name`],"account_name.not":e[`account-name-not`],"action_result.not":e[`action-result-not`],"action_type.not":e[`action-type-not`],"actor_context.not":e[`actor-context-not`],"actor_email.not":e[`actor-email-not`],"actor_id.not":e[`actor-id-not`],"actor_ip_address.not":e[`actor-ip-address-not`],"actor_token_id.not":e[`actor-token-id-not`],"actor_token_name.not":e[`actor-token-name-not`],"actor_type.not":e[`actor-type-not`],"audit_log_id.not":e[`audit-log-id-not`],"id.not":e[`id-not`],"raw_cf_ray_id.not":e[`raw-cf-ray-id-not`],"raw_method.not":e[`raw-method-not`],"raw_status_code.not":e[`raw-status-code-not`],"raw_uri.not":e[`raw-uri-not`],"resource_id.not":e[`resource-id-not`],"resource_product.not":e[`resource-product-not`],"resource_type.not":e[`resource-type-not`],"resource_scope.not":e[`resource-scope-not`],"zone_id.not":e[`zone-id-not`],"zone_name.not":e[`zone-name-not`],since:e.since,before:e.before,direction:e.direction,limit:e.limit,cursor:e.cursor};if(e.dryRun){c({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/logs/audit`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.logs.audit.list(o,t)),{successLabel:`Loaded`})}},H={command:`audit`,describe:`Retrieve audit log entries that record actions taken on the account`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
12
- Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
13
- `,choices:[`accepted`,`pending`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`create`,describe:`Add a user to the list of members for this account.`,builder:W,handler:async e=>{if(e.dryRun){c({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:{email:e.email,roles:e.roles,status:e.status,body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/members`,{body:t})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The contact email address of the user.`));let m={};e.email!==void 0&&a(m,[`email`],u(e.email,`email`,`text`)),e.roles!==void 0&&a(m,[`roles`],e.roles),e.status!==void 0&&a(m,[`status`],u(e.status,`status`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/members`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function K(e){return e.positional(`member-id`,{type:`string`,description:`Membership 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 q={command:`delete <member-id>`,describe:`Remove a member from an account.`,builder:K,handler:async t=>{if(t.dryRun){c({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members/${t[`member-id`]==null?`<member-id>`:encodeURIComponent(String(t[`member-id`]))}`,pathParams:{"member-id":String(t[`member-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let a=await r(t),u=t.local?d:await n(a);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
14
- `);return}if(t.body){let e=o(t.body);s(await l(`Deleting`,async()=>a.delete(`/accounts/${u}/members/${encodeURIComponent(String(t[`member-id`]))}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>a.accounts.members.delete(t[`member-id`],u)),{successLabel:`Deleted`})}};function J(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:J,handler:async e=>{if(e.dryRun){c({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.members.get(e[`member-id`],a)),{successLabel:`Loaded`})}};function X(e){return e.option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`user.first_name`,`user.last_name`,`user.email`,`status`]}).option(`status`,{type:`string`,description:`A member's status in the account.`,choices:[`accepted`,`pending`,`rejected`]}).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:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`List all members of an account.`,builder:X,handler:async e=>{let t={order:e.order,status:e.status,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){c({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.members.list(o,t)),{successLabel:`Loaded`})}};function Q(e){return e.positional(`member-id`,{type:`string`,description:`Membership 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 ne={command:`update <member-id>`,describe:`Modify an account member.`,builder:Q,handler:async e=>{if(e.dryRun){c({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"member-id":String(e[`member-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),a=e.local?d:await n(t);if(e.accountId=a,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.put(`/accounts/${a}/members/${encodeURIComponent(String(e[`member-id`]))}`,{body:n})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>t.accounts.members.update(e[`member-id`],a)),{successLabel:`Updated`})}},re={command:`members`,describe:`Invite, inspect, update, and remove users who have access to this account`,builder:e=>e.command(G).command(q).command(Y).command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).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 ae={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:ie,handler:async e=>{if(e.dryRun){c({command:`cf accounts move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:{"account-ids":e[`account-ids`],"destination-organization-id":e[`destination-organization-id`],body:e.body}});return}let n=await r(e);if(e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/accounts/move`,{body:t})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await t(`destination-organization-id`,`Move accounts to this organization ID.`));let i={};e[`account-ids`]!==void 0&&a(i,[`account_ids`],e[`account-ids`]),e[`destination-organization-id`]!==void 0&&a(i,[`destination_organization_id`],u(e[`destination-organization-id`],`destination-organization-id`,`text`)),s(await l(`Creating`,async()=>n.post(`/accounts/move`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function oe(e){return e.positional(`role-id`,{type:`string`,description:`Role identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <role-id>`,describe:`Get information about a specific role for an account.`,builder:oe,handler:async e=>{if(e.dryRun){c({command:`cf accounts roles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/roles/${e[`role-id`]==null?`<role-id>`:encodeURIComponent(String(e[`role-id`]))}`,pathParams:{"role-id":String(e[`role-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.roles.get(e[`role-id`],a)),{successLabel:`Loaded`})}};function ce(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of roles per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`Get all available roles for an account.`,builder:ce,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf accounts roles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/roles`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.roles.list(o,t)),{successLabel:`Loaded`})}},ue={command:`roles`,describe:`View the roles available for assigning to account members, each defining a set of permissions`,builder:e=>e.command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 fe={command:`create`,describe:`Creates an account subscription.`,builder:de,handler:async e=>{if(e.dryRun){c({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`json`,body:{"app-install-id":e[`app-install-id`],frequency:e.frequency,"rate-plan-currency":e[`rate-plan-currency`],"rate-plan-externally-managed":e[`rate-plan-externally-managed`],"rate-plan-id":e[`rate-plan-id`],"rate-plan-is-contract":e[`rate-plan-is-contract`],"rate-plan-public-name":e[`rate-plan-public-name`],"rate-plan-scope":e[`rate-plan-scope`],"rate-plan-sets":e[`rate-plan-sets`],body:e.body}});return}let t=await r(e),f=e.local?d:await n(t);if(e.accountId=f,e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/accounts/${f}/subscriptions`,{body:n})),{successLabel:`Created`});return}let p={};e[`app-install-id`]!==void 0&&a(p,[`app`,`install_id`],u(e[`app-install-id`],`app-install-id`,`text`)),e.frequency!==void 0&&a(p,[`frequency`],u(e.frequency,`frequency`,`text`)),e[`rate-plan-currency`]!==void 0&&a(p,[`rate_plan`,`currency`],u(e[`rate-plan-currency`],`rate-plan-currency`,`text`)),e[`rate-plan-externally-managed`]!==void 0&&a(p,[`rate_plan`,`externally_managed`],e[`rate-plan-externally-managed`]),e[`rate-plan-id`]!==void 0&&a(p,[`rate_plan`,`id`],u(e[`rate-plan-id`],`rate-plan-id`,`text`)),e[`rate-plan-is-contract`]!==void 0&&a(p,[`rate_plan`,`is_contract`],e[`rate-plan-is-contract`]),e[`rate-plan-public-name`]!==void 0&&a(p,[`rate_plan`,`public_name`],u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`)),e[`rate-plan-scope`]!==void 0&&a(p,[`rate_plan`,`scope`],u(e[`rate-plan-scope`],`rate-plan-scope`,`text`)),e[`rate-plan-sets`]!==void 0&&a(p,[`rate_plan`,`sets`],e[`rate-plan-sets`]),s(await l(`Creating`,async()=>t.post(`/accounts/${f}/subscriptions`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function pe(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription 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 me={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:pe,handler:async t=>{if(t.dryRun){c({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions/${t[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(t[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(t[`subscription-identifier`]??``)},bodyKind:`json`,body:{body:t.body}});return}let a=await r(t),u=t.local?d:await n(a);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
15
- `);return}if(t.body){let e=o(t.body);s(await l(`Deleting`,async()=>a.delete(`/accounts/${u}/subscriptions/${encodeURIComponent(String(t[`subscription-identifier`]))}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>a.accounts.subscriptions.delete(t[`subscription-identifier`],u)),{successLabel:`Deleted`})}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`get`,describe:`Lists all of an account's subscriptions.`,builder:he,handler:async e=>{if(e.dryRun){c({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.subscriptions.get(a)),{successLabel:`Loaded`})}};function _e(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 <subscription-identifier>`,describe:`Updates an account subscription.`,builder:_e,handler:async e=>{if(e.dryRun){c({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions/${e[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(e[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(e[`subscription-identifier`]??``)},bodyKind:`json`,body:{"app-install-id":e[`app-install-id`],frequency:e.frequency,"rate-plan-currency":e[`rate-plan-currency`],"rate-plan-externally-managed":e[`rate-plan-externally-managed`],"rate-plan-id":e[`rate-plan-id`],"rate-plan-is-contract":e[`rate-plan-is-contract`],"rate-plan-public-name":e[`rate-plan-public-name`],"rate-plan-scope":e[`rate-plan-scope`],"rate-plan-sets":e[`rate-plan-sets`],body:e.body}});return}let t=await r(e),f=e.local?d:await n(t);if(e.accountId=f,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.put(`/accounts/${f}/subscriptions/${encodeURIComponent(String(e[`subscription-identifier`]))}`,{body:n})),{successLabel:`Updated`});return}let p={};e[`app-install-id`]!==void 0&&a(p,[`app`,`install_id`],u(e[`app-install-id`],`app-install-id`,`text`)),e.frequency!==void 0&&a(p,[`frequency`],u(e.frequency,`frequency`,`text`)),e[`rate-plan-currency`]!==void 0&&a(p,[`rate_plan`,`currency`],u(e[`rate-plan-currency`],`rate-plan-currency`,`text`)),e[`rate-plan-externally-managed`]!==void 0&&a(p,[`rate_plan`,`externally_managed`],e[`rate-plan-externally-managed`]),e[`rate-plan-id`]!==void 0&&a(p,[`rate_plan`,`id`],u(e[`rate-plan-id`],`rate-plan-id`,`text`)),e[`rate-plan-is-contract`]!==void 0&&a(p,[`rate_plan`,`is_contract`],e[`rate-plan-is-contract`]),e[`rate-plan-public-name`]!==void 0&&a(p,[`rate_plan`,`public_name`],u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`)),e[`rate-plan-scope`]!==void 0&&a(p,[`rate_plan`,`scope`],u(e[`rate-plan-scope`],`rate-plan-scope`,`text`)),e[`rate-plan-sets`]!==void 0&&a(p,[`rate_plan`,`sets`],e[`rate-plan-sets`]),s(await l(`Updating`,async()=>t.put(`/accounts/${f}/subscriptions/${encodeURIComponent(String(e[`subscription-identifier`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},ye={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(fe).command(me).command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).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 xe={command:`create`,describe:`Create a new Account Owned API token.`,builder:be,handler:async e=>{if(e.dryRun){c({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:{"condition-request-ip-in":e[`condition-request-ip-in`],"condition-request-ip-not-in":e[`condition-request-ip-not-in`],"expires-on":e[`expires-on`],name:e.name,"not-before":e[`not-before`],body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/tokens`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`Token name.`));let m={};e[`condition-request-ip-in`]!==void 0&&a(m,[`condition`,`request_ip`,`in`],e[`condition-request-ip-in`]),e[`condition-request-ip-not-in`]!==void 0&&a(m,[`condition`,`request_ip`,`not_in`],e[`condition-request-ip-not-in`]),e[`expires-on`]!==void 0&&a(m,[`expires_on`],u(e[`expires-on`],`expires-on`,`text`)),e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),e[`not-before`]!==void 0&&a(m,[`not_before`],u(e[`not-before`],`not-before`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/tokens`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function Se(e){return e.positional(`token-id`,{type:`string`,description:`Token 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 Ce={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:Se,handler:async t=>{if(t.dryRun){c({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${t[`token-id`]==null?`<token-id>`:encodeURIComponent(String(t[`token-id`]))}`,pathParams:{"token-id":String(t[`token-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let a=await r(t),u=t.local?d:await n(a);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
16
- `);return}if(t.body){let e=o(t.body);s(await l(`Deleting`,async()=>a.delete(`/accounts/${u}/tokens/${encodeURIComponent(String(t[`token-id`]))}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>a.accounts.tokens.delete(u,t[`token-id`])),{successLabel:`Deleted`})}};function we(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get <token-id>`,describe:`Get information about a specific Account Owned API token.`,builder:we,handler:async e=>{if(e.dryRun){c({command:`cf accounts tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.tokens.get(a,e[`token-id`])),{successLabel:`Loaded`})}};function Ee(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(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`list`,describe:`List all Account Owned API tokens created for this account.`,builder:Ee,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){c({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.tokens.list(o,t)),{successLabel:`Loaded`})}};function Oe(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
17
- The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
18
- The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:Oe,handler:async e=>{let t={name:e.name,scope:e.scope};if(e.dryRun){c({command:`cf accounts tokens permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.tokens.permissionGroups.get(o,t)),{successLabel:`Loaded`})}};function Ae(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
19
- The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
20
- The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:Ae,handler:async e=>{let t={name:e.name,scope:e.scope};if(e.dryRun){c({command:`cf accounts tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.accounts.tokens.permissionGroups.list(o,t)),{successLabel:`Loaded`})}},Me={command:`permission-groups`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`status`,{type:`string`,description:`Status of the token.`,choices:[`active`,`disabled`,`expired`]}).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 Pe={command:`update <token-id>`,describe:`Update an existing token.`,builder:Ne,handler:async e=>{if(e.dryRun){c({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`json`,body:{"condition-request-ip-in":e[`condition-request-ip-in`],"condition-request-ip-not-in":e[`condition-request-ip-not-in`],"expires-on":e[`expires-on`],name:e.name,"not-before":e[`not-before`],status:e.status,body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Updating`,async()=>f.put(`/accounts/${p}/tokens/${encodeURIComponent(String(e[`token-id`]))}`,{body:t})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await t(`name`,`Token name.`));let m={};e[`condition-request-ip-in`]!==void 0&&a(m,[`condition`,`request_ip`,`in`],e[`condition-request-ip-in`]),e[`condition-request-ip-not-in`]!==void 0&&a(m,[`condition`,`request_ip`,`not_in`],e[`condition-request-ip-not-in`]),e[`expires-on`]!==void 0&&a(m,[`expires_on`],u(e[`expires-on`],`expires-on`,`text`)),e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),e[`not-before`]!==void 0&&a(m,[`not_before`],u(e[`not-before`],`not-before`,`text`)),e.status!==void 0&&a(m,[`status`],u(e.status,`status`,`text`)),s(await l(`Updating`,async()=>f.put(`/accounts/${p}/tokens/${encodeURIComponent(String(e[`token-id`]))}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}};function $(e){return e.positional(`token-id`,{type:`string`,description:`Token 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 Fe={command:`update <token-id>`,describe:`Roll the Account Owned API token secret.`,builder:$,handler:async e=>{if(e.dryRun){c({command:`cf accounts tokens value update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}/value`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),a=e.local?d:await n(t);if(e.accountId=a,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.put(`/accounts/${a}/tokens/${encodeURIComponent(String(e[`token-id`]))}/value`,{body:n})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>t.accounts.tokens.value.update(a,e[`token-id`])),{successLabel:`Updated`})}},Ie={command:`value`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`verify`,describe:`Test whether a token works.`,builder:Le,handler:async e=>{if(e.dryRun){c({command:`cf accounts tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/verify`,pathParams:{},bodyKind:`none`});return}let t=await r(e),a=e.local?d:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.accounts.tokens.verify(a)),{successLabel:`Loaded`})}},ze={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(xe).command(Ce).command(Te).command(De).command(Pe).command(Re).command(Me).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Be(e){return e.option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
21
- Two-Factor Authentication is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ve={command:`update`,describe:`Update an existing account.`,builder:Be,handler:async e=>{if(e.dryRun){c({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:{id:e.id,name:e.name,"settings-abuse-contact-email":e[`settings-abuse-contact-email`],"settings-enforce-twofactor":e[`settings-enforce-twofactor`],body:e.body}});return}let f=await r(e),p=e.local?d:await n(f);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Updating`,async()=>f.put(`/accounts/${p}`,{body:t})),{successLabel:`Updated`});return}e.id===void 0&&(e.id=await t(`id`,`Identifier`)),e.name===void 0&&(e.name=await t(`name`,`Account name`));let m={};e.id!==void 0&&a(m,[`id`],u(e.id,`id`,`text`)),e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),e[`settings-abuse-contact-email`]!==void 0&&a(m,[`settings`,`abuse_contact_email`],u(e[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`)),e[`settings-enforce-twofactor`]!==void 0&&a(m,[`settings`,`enforce_twofactor`],e[`settings-enforce-twofactor`]),s(await l(`Updating`,async()=>f.put(`/accounts/${p}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},He={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(N).command(F).command(L).command(z).command(ae).command(Ve).command(m).command(_).command(w).command(j).command(U).command(re).command(ue).command(ye).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,b as n,t as r}from"./auth-CQcAgnOy.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-CjcQ6ato.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).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:`create`,describe:`Add Custom Origin Trust Store for a Zone.`,builder:u,handler:async e=>{if(e.dryRun){s({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{certificate:e.certificate,body:e.body}});return}let u=await r(e);if(e.zoneId=await n({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/acm/custom_trust_store`,{body:t})),{successLabel:`Created`});return}e.certificate===void 0&&(e.certificate=await t(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let d={};e.certificate!==void 0&&i(d,[`certificate`],l(e.certificate,`certificate`,`text`)),o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/acm/custom_trust_store`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function f(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <custom-origin-trust-store-id>`,describe:`Removes a CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async t=>{if(t.dryRun){s({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/acm/custom_trust_store/${t[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(t[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(t[`custom-origin-trust-store-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=await n({zone:t.zone},i,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.acm.customTrustStore.delete(t[`custom-origin-trust-store-id`],a)),{successLabel:`Deleted`})}};function m(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <custom-origin-trust-store-id>`,describe:`Retrieves details about a specific certificate in the custom origin trust store, including expiration and subject information.`,builder:m,handler:async e=>{if(e.dryRun){s({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/custom_trust_store/${e[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(e[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(e[`custom-origin-trust-store-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.acm.customTrustStore.get(e[`custom-origin-trust-store-id`],i)),{successLabel:`Loaded`})}};function g(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:g,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){s({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.acm.customTrustStore.list(a,t)),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Upload CA certificates that Cloudflare trusts when connecting to your origin server`,builder:e=>e.command(d).command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in your zone.`}).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:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:y,handler:async e=>{if(e.dryRun){s({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{"certificate-authority":e[`certificate-authority`],enabled:e.enabled,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=a(e.body);o(await c(`Creating`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:n})),{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u={};e[`certificate-authority`]!==void 0&&i(u,[`certificate_authority`],l(e[`certificate-authority`],`certificate-authority`,`text`)),e.enabled!==void 0&&i(u,[`enabled`],e.enabled),o(await c(`Creating`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}};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:`Get Total TLS Settings for a Zone.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.acm.totalTLS.get(i)),{successLabel:`Loaded`})}};function C(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`update`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:C,handler:async e=>{if(e.dryRun){s({command:`cf acm total-tls update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:{"certificate-authority":e[`certificate-authority`],enabled:e.enabled,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=a(e.body);o(await c(`Creating`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:n})),{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u={};e[`certificate-authority`]!==void 0&&i(u,[`certificate_authority`],l(e[`certificate-authority`],`certificate-authority`,`text`)),e.enabled!==void 0&&i(u,[`enabled`],e.enabled),o(await c(`Creating`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}},T={command:`total-tls`,describe:`Automatically issue certificates for all hostnames and subdomains in your zone`,builder:e=>e.command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`acm`,describe:`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,builder:e=>e.command(v).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};