cf 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +7 -1
  2. package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
  3. package/dist/accounts-BIY8wNGA.mjs +22 -0
  4. package/dist/{acm-C2lYIWs1.mjs → acm-SqcV8o5o.mjs} +2 -2
  5. package/dist/addressing-CygRm0pN.mjs +12 -0
  6. package/dist/{agent-context-CgGCT0xU.mjs → agent-context-CKb6w43K.mjs} +1 -1
  7. package/dist/ai-BAmEAjN3.mjs +2 -0
  8. package/dist/ai-gateway-BENwPvvB.mjs +8 -0
  9. package/dist/ai-search-Bv_Whw3E.mjs +7 -0
  10. package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
  11. package/dist/alerting-D_qWrsoY.mjs +6 -0
  12. package/dist/{analytics-CkhhhZWZ.mjs → analytics-CwFrx-Dr.mjs} +1 -1
  13. package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
  14. package/dist/api-gateway-D9PMVVqL.mjs +33 -0
  15. package/dist/argo-DwYGbyld.mjs +2 -0
  16. package/dist/artifacts-DKAjY_n4.mjs +4 -0
  17. package/dist/audit-logs-BvQ9uwuy.mjs +2 -0
  18. package/dist/auth-DX9KnJ0P.mjs +9 -0
  19. package/dist/auth-TYwGydWg.mjs +5 -0
  20. package/dist/billing-CRTlRU88.mjs +2 -0
  21. package/dist/{bot-management-CJxD1pqi.mjs → bot-management-DgW--8wM.mjs} +2 -2
  22. package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
  23. package/dist/brand-protection-ZikBtl0y.mjs +3 -0
  24. package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
  25. package/dist/build-Bgw8TV1p.mjs +134 -0
  26. package/dist/{cache-B7pRbpTy.mjs → cache-CeN5t6_W.mjs} +4 -4
  27. package/dist/calls-Cv0ieVg4.mjs +4 -0
  28. package/dist/certificate-authorities-BzZnWCac.mjs +2 -0
  29. package/dist/client-certificates-BFuzeBrj.mjs +3 -0
  30. package/dist/cloud-connector-D5h8Dzzg.mjs +2 -0
  31. package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
  32. package/dist/{completions-D_9WsLG7.mjs → completions-Bvzav4Mj.mjs} +2 -2
  33. package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
  34. package/dist/connectivity-CjkXmEhO.mjs +3 -0
  35. package/dist/connector-interrupts-B7eSface.mjs +2 -0
  36. package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
  37. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
  38. package/dist/connectors-YYu_Vx3H.mjs +3 -0
  39. package/dist/content-scanning-BorfRGKT.mjs +4 -0
  40. package/dist/context-C-WbewL6.mjs +2 -0
  41. package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-CfRj7QZb.mjs} +4 -4
  42. package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
  43. package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
  44. package/dist/custom-pages-DamGVA75.mjs +4 -0
  45. package/dist/d1-sK0O5THv.mjs +4 -0
  46. package/dist/data-security-DsWpoWiS.mjs +6 -0
  47. package/dist/dcv-delegation-BYsNl3qc.mjs +2 -0
  48. package/dist/{deploy-KBRFIatG.mjs → deploy-BzlPv3ro.mjs} +1 -1
  49. package/dist/{dev-pPazzZvt.mjs → dev-IOg-_s5_.mjs} +1 -1
  50. package/dist/diagnostics-CH7T2WR3.mjs +3 -0
  51. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
  52. package/dist/dist-B7hsuvbF.mjs +57 -0
  53. package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
  54. package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
  55. package/dist/dns-o7hUPMCG.mjs +29 -0
  56. package/dist/durable-objects-DgrTbvoF.mjs +2 -0
  57. package/dist/email-routing-owCvAEpf.mjs +10 -0
  58. package/dist/email-security-Dng3DVuf.mjs +8 -0
  59. package/dist/email-sending-bExMH4lu.mjs +3 -0
  60. package/dist/filters-DKs-wEzt.mjs +4 -0
  61. package/dist/{firewall-C3DDwfwh.mjs → firewall-BLaTtX3r.mjs} +10 -10
  62. package/dist/{fraud-DY3YXFVf.mjs → fraud-D8WmLKyH.mjs} +1 -1
  63. package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
  64. package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-BBtW8vRh.mjs} +3 -3
  65. package/dist/{hostnames-BdAQo1Mr.mjs → hostnames-Bh2IFxIw.mjs} +2 -2
  66. package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
  67. package/dist/iam-apCCcy7R.mjs +6 -0
  68. package/dist/images-Cxe45OHm.mjs +7 -0
  69. package/dist/index.mjs +1 -1
  70. package/dist/intel-8V4h6H46.mjs +3 -0
  71. package/dist/{ips-B6JETVOY.mjs → ips-BE7JbAnc.mjs} +1 -1
  72. package/dist/{keyless-certificates-C4MZ4xnf.mjs → keyless-certificates-CfJmXccT.mjs} +2 -2
  73. package/dist/kv-Dz6then8.mjs +5 -0
  74. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
  75. package/dist/load-balancers-ilsGgudX.mjs +6 -0
  76. package/dist/logpush-BH14TtuA.mjs +4 -0
  77. package/dist/logs-B8-mkf_I.mjs +3 -0
  78. package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
  79. package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
  80. package/dist/magic-transit-B-kU5e3s.mjs +89 -0
  81. package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
  82. package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
  83. package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
  84. package/dist/oauth-B5k80sip.mjs +61 -0
  85. package/dist/observability-9APhqFHo.mjs +4 -0
  86. package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
  87. package/dist/{organizations-aRi1bhFC.mjs → organizations-Dy3kiV_z.mjs} +6 -6
  88. package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
  90. package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-B30_2_dO.mjs} +3 -3
  91. package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
  92. package/dist/{page-rules-CYqtPU1p.mjs → page-rules-zQJGmTCd.mjs} +5 -5
  93. package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CxQk5k9X.mjs} +5 -5
  94. package/dist/pages-5DKLs7CQ.mjs +11 -0
  95. package/dist/pipelines-DfGE44xo.mjs +6 -0
  96. package/dist/progress-CL8I-7YK.mjs +2 -0
  97. package/dist/prompt-q3B7sM2A.mjs +3 -0
  98. package/dist/queues-BoenUGIw.mjs +6 -0
  99. package/dist/r2-Cq_JCjK0.mjs +21 -0
  100. package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
  101. package/dist/{radar-CzGM92uM.mjs → radar-YNOCio6T.mjs} +1 -1
  102. package/dist/rate-limits-CcAF3tMl.mjs +5 -0
  103. package/dist/raw-fetch-bIXC9D1m.mjs +2 -0
  104. package/dist/realtime-kit-4bCGviO5.mjs +18 -0
  105. package/dist/{registrar-8IeA5DKd.mjs → registrar-CfHlaOOf.mjs} +6 -6
  106. package/dist/request-tracers-DlHawg5l.mjs +2 -0
  107. package/dist/resource-sharing-7FhuboJE.mjs +5 -0
  108. package/dist/resource-tagging-divcugVb.mjs +16 -0
  109. package/dist/rules-CAXkege8.mjs +4 -0
  110. package/dist/rulesets-CBsdc8IV.mjs +8 -0
  111. package/dist/rum-D0hHPNl9.mjs +4 -0
  112. package/dist/{schema-hefO-tzo.mjs → schema-D8o6HcCr.mjs} +1 -1
  113. package/dist/schema-validation-BWNDnnIT.mjs +24 -0
  114. package/dist/scim-CWLli4fi.mjs +3 -0
  115. package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
  116. package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
  117. package/dist/security-center-BQT21oiM.mjs +2 -0
  118. package/dist/security-txt-CVpmJo29.mjs +3 -0
  119. package/dist/session-B8r8LNQN.mjs +93 -0
  120. package/dist/{build-BE4o4imx.mjs → shared-DQI8NGja.mjs} +324 -388
  121. package/dist/{smart-shield-DblHIce0.mjs → smart-shield-BreBC1Ap.mjs} +2 -2
  122. package/dist/{snippets-DrpqSXYC.mjs → snippets-BAJoWMSJ.mjs} +3 -3
  123. package/dist/{spawn-DK7pott_.mjs → spawn-pmGERpdB.mjs} +1 -1
  124. package/dist/{spectrum-CnrG0jIC.mjs → spectrum-DnIRLY95.mjs} +6 -6
  125. package/dist/speed-UYEVue28.mjs +4 -0
  126. package/dist/src-BQ1dr9xR.mjs +108 -0
  127. package/dist/{ssl-Cp6tQkZH.mjs → ssl-D3Pixs8M.mjs} +3 -3
  128. package/dist/stream-BUsuOfQh.mjs +14 -0
  129. package/dist/{tenants-o_M62Y1n.mjs → tenants-BdWJTtcg.mjs} +1 -1
  130. package/dist/{token-validation-Ca5AGEns.mjs → token-validation-DUvtXWur.mjs} +5 -5
  131. package/dist/{tools-DtNNmO6l.mjs → tools-CQtA5-cr.mjs} +1 -1
  132. package/dist/turnstile-CAKVnS1L.mjs +23 -0
  133. package/dist/{ui-B97lRnOv.mjs → ui-BrNwNHX9.mjs} +1 -1
  134. package/dist/url-normalization-DA-RAxs4.mjs +3 -0
  135. package/dist/url-scanner-DmYu43f7.mjs +2 -0
  136. package/dist/user-Bah4wGGN.mjs +10 -0
  137. package/dist/vectorize-DhvVG2By.mjs +4 -0
  138. package/dist/{versions-B6E8WQyA.mjs → versions-NUXxCr0s.mjs} +1 -1
  139. package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
  140. package/dist/web3-n3GW50u-.mjs +4 -0
  141. package/dist/workers-D6IaQ_F0.mjs +18 -0
  142. package/dist/workers-builds-DYi0OMMU.mjs +7 -0
  143. package/dist/workflows-DrdXUQ2g.mjs +4 -0
  144. package/dist/{zaraz-CyzfYOEU.mjs → zaraz-9l7KuLqh.mjs} +1 -1
  145. package/dist/zero-trust-D6V9GH2W.mjs +118 -0
  146. package/dist/zero_trust-BzXKAX_x.mjs +3 -0
  147. package/dist/{zones-MSULnDwW.mjs → zones-0MTkuaFk.mjs} +8 -8
  148. package/package.json +3 -1
  149. package/dist/accounts-CjtZ8x1z.mjs +0 -22
  150. package/dist/addressing-CHFK6uxW.mjs +0 -12
  151. package/dist/ai-DS3i-I1a.mjs +0 -2
  152. package/dist/ai-gateway-RIsegO2x.mjs +0 -8
  153. package/dist/ai-search-Dcj4BauG.mjs +0 -7
  154. package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
  155. package/dist/alerting-Bk85NNf5.mjs +0 -6
  156. package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
  157. package/dist/api-gateway-CWdR4Ne7.mjs +0 -33
  158. package/dist/argo-DnJRVnGX.mjs +0 -2
  159. package/dist/artifacts-BVWKiJUl.mjs +0 -4
  160. package/dist/audit-logs-DjTstbzL.mjs +0 -2
  161. package/dist/auth-BqDOIrKX.mjs +0 -150
  162. package/dist/auth-DKkSwnxh.mjs +0 -5
  163. package/dist/billing-3rEqF83h.mjs +0 -2
  164. package/dist/botnet-feed-MG91D7BR.mjs +0 -3
  165. package/dist/brand-protection-CK7gJi06.mjs +0 -3
  166. package/dist/browser-rendering-Rae0AUt0.mjs +0 -4
  167. package/dist/calls-DXRWsZ8n.mjs +0 -4
  168. package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
  169. package/dist/client-certificates-B0ebLJdk.mjs +0 -3
  170. package/dist/cloud-connector-BOjaggJk.mjs +0 -2
  171. package/dist/cloudforce-one-B6HYfk5Z.mjs +0 -21
  172. package/dist/connectivity-welFvZ7X.mjs +0 -3
  173. package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
  174. package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
  175. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
  176. package/dist/connectors-3vjrdFLB.mjs +0 -3
  177. package/dist/content-scanning-CnW2A0pv.mjs +0 -4
  178. package/dist/context-CONbNKO-.mjs +0 -2
  179. package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
  180. package/dist/custom-pages-5fCSP8in.mjs +0 -4
  181. package/dist/d1-CyiRbZZn.mjs +0 -4
  182. package/dist/data-security-Casx4OS_.mjs +0 -6
  183. package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
  184. package/dist/diagnostics-BqYDoDfw.mjs +0 -3
  185. package/dist/dispatch-namespaces-Cz2rajnP.mjs +0 -7
  186. package/dist/dist-DA54ZQu0.mjs +0 -82
  187. package/dist/dns-62t95Xif.mjs +0 -29
  188. package/dist/dns-firewall-Coy8d47t.mjs +0 -57
  189. package/dist/durable-objects-BSuRERkw.mjs +0 -2
  190. package/dist/email-routing-BDUYYeV3.mjs +0 -10
  191. package/dist/email-security-ChHA6eqQ.mjs +0 -8
  192. package/dist/email-sending-CVrRqn6S.mjs +0 -3
  193. package/dist/filters-qJpU9uAS.mjs +0 -4
  194. package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
  195. package/dist/hyperdrive-99OJV9nl.mjs +0 -18
  196. package/dist/iam-BRbpg3lN.mjs +0 -6
  197. package/dist/images-D1jI3r3O.mjs +0 -7
  198. package/dist/intel-C3ajLpXd.mjs +0 -3
  199. package/dist/kv-CSWoD9ks.mjs +0 -5
  200. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
  201. package/dist/load-balancers-Du1tNuUt.mjs +0 -6
  202. package/dist/logpush-SuJyO-uX.mjs +0 -4
  203. package/dist/logs-DcDNRPRl.mjs +0 -3
  204. package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
  205. package/dist/magic-network-monitoring-CqtvOePQ.mjs +0 -4
  206. package/dist/magic-transit-BTbkhBtF.mjs +0 -89
  207. package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
  208. package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
  209. package/dist/network-interconnects-DsiNytOU.mjs +0 -36
  210. package/dist/observability-CLqZ7OSi.mjs +0 -4
  211. package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
  212. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
  213. package/dist/pages-ChurJ2H7.mjs +0 -11
  214. package/dist/pipelines-CeyujvRf.mjs +0 -6
  215. package/dist/progress-Cent9Lsg.mjs +0 -2
  216. package/dist/queues-Rf_n11Cx.mjs +0 -6
  217. package/dist/r2-BtuTO3vQ.mjs +0 -21
  218. package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
  219. package/dist/rate-limits-Bbk7HxP7.mjs +0 -5
  220. package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
  221. package/dist/realtime-kit-CivLpkpg.mjs +0 -18
  222. package/dist/request-tracers-D1aH4NmL.mjs +0 -2
  223. package/dist/resource-sharing-B-Pcto7-.mjs +0 -5
  224. package/dist/resource-tagging-Bpb6Qq1M.mjs +0 -16
  225. package/dist/rules-B10XWY10.mjs +0 -4
  226. package/dist/rulesets-lYczEcJp.mjs +0 -8
  227. package/dist/rum-B5GUKa4I.mjs +0 -4
  228. package/dist/schema-validation-DTq517Em.mjs +0 -24
  229. package/dist/scim-BiLfOQ89.mjs +0 -3
  230. package/dist/security-center-AVpTOBK3.mjs +0 -2
  231. package/dist/security-txt-DVlh8y9l.mjs +0 -3
  232. package/dist/shared-0bwWVDLo.mjs +0 -2
  233. package/dist/speed-BzRY3Xlh.mjs +0 -4
  234. package/dist/src-D9_Gq68b.mjs +0 -108
  235. package/dist/stream-CGTRN4ZN.mjs +0 -14
  236. package/dist/turnstile-l7mo9BWL.mjs +0 -23
  237. package/dist/url-normalization-D1CogSIG.mjs +0 -3
  238. package/dist/url-scanner-BnJHJqcz.mjs +0 -2
  239. package/dist/user-CiyYZ69X.mjs +0 -10
  240. package/dist/vectorize-D3LgMLOn.mjs +0 -4
  241. package/dist/web3-DlHE0CZc.mjs +0 -4
  242. package/dist/workers-DRAkU6YR.mjs +0 -18
  243. package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
  244. package/dist/workflows-z6oapEJs.mjs +0 -4
  245. package/dist/zero-trust-fyyIelWx.mjs +0 -118
  246. package/dist/zero_trust-BAhlNkjo.mjs +0 -3
  247. /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  248. /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
  249. /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-DGgEbf8K.mjs} +0 -0
  250. /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
  251. /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
  252. /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
  253. /package/dist/{metadata-jh2EIan8.mjs → metadata-MPDDi08e.mjs} +0 -0
  254. /package/dist/{resolve-D1mG0REg.mjs → resolve-DGD57PFH.mjs} +0 -0
  255. /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
package/README.md CHANGED
@@ -16,6 +16,8 @@ Requires Node.js 22 or newer.
16
16
 
17
17
  ```sh
18
18
  cf auth login # Authenticate with Cloudflare
19
+ cf auth create work # Create a named auth profile
20
+ cf auth activate work # Use it in the current directory
19
21
  cf --help # Browse all commands
20
22
  cf <command> --help # Per-command help
21
23
  cf complete bash >> ~/.bashrc # Install shell completions
@@ -26,7 +28,11 @@ cf complete bash >> ~/.bashrc # Install shell completions
26
28
  cf resolves credentials in this order:
27
29
 
28
30
  1. `CLOUDFLARE_API_TOKEN` environment variable
29
- 2. cf OAuth token (via `cf auth login`; refreshed automatically)
31
+ 2. The OAuth profile selected by `--profile`, the nearest directory binding,
32
+ or the default profile (refreshed automatically)
33
+
34
+ Use `cf auth create`, `delete`, `activate`, `deactivate`, and `list` to manage
35
+ named profiles. `cf auth login` and `cf auth logout` manage the default profile.
30
36
 
31
37
  ## Output
32
38
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,E as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";import{t as f}from"./cli-types-CMNMD1V7.mjs";function p(e){return e.positional(`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/).
2
+ import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./local-CYc9q7l2.mjs";import{n as u,r as d}from"./prompt-q3B7sM2A.mjs";import{t as f}from"./cli-types-DGgEbf8K.mjs";function p(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
3
  `}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
4
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
5
  `}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
6
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
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 m={command:`create <report-param>`,describe:"Submit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Account > Abuse Reports > Edit` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below).",builder:p,handler:async f=>{if(f.dryRun){c({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<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:f.body===void 0?o({comments:u(f.comments,`comments`,`text`),company:u(f.company,`company`,`text`),email:u(f.email,`email`,`text`),email2:u(f.email2,`email2`,`text`),name:u(f.name,`name`,`text`),reported_country:u(f[`reported-country`],`reported-country`,`text`),reported_user_agent:u(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:u(f.tele,`tele`,`text`),title:u(f.title,`title`,`text`),urls:u(f.urls,`urls`,`text`),address1:u(f.address1,`address1`,`text`),agent_name:u(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:u(f.city,`city`,`text`),country:u(f.country,`country`,`text`),host_notification:u(f[`host-notification`],`host-notification`,`text`),original_work:u(f[`original-work`],`original-work`,`text`),owner_notification:u(f[`owner-notification`],`owner-notification`,`text`),signature:u(f.signature,`signature`,`text`),state:u(f.state,`state`,`text`),justification:u(f.justification,`justification`,`text`),trademark_number:u(f[`trademark-number`],`trademark-number`,`text`),trademark_office:u(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:u(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:u(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:u(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:u(f[`source-ips`],`source-ips`,`text`),ncmec_notification:u(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:u(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:u(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:u(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:u(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]}):a(f.body)});return}let p=await i(f),m=f.local?d:await r(p);if(f.accountId=m,f.body){let e=a(f.body);s(await l(`Creating`,async()=>p.abuseReports.create({body:e,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`});return}f.email===void 0&&(f.email=await t(`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 t(`email2`,"Should match the value provided in `email`")),f.name===void 0&&(f.name=await t(`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 t(`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 n(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`]));let h=o({comments:u(f.comments,`comments`,`text`),company:u(f.company,`company`,`text`),email:u(f.email,`email`,`text`),email2:u(f.email2,`email2`,`text`),name:u(f.name,`name`,`text`),reported_country:u(f[`reported-country`],`reported-country`,`text`),reported_user_agent:u(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:u(f.tele,`tele`,`text`),title:u(f.title,`title`,`text`),urls:u(f.urls,`urls`,`text`),address1:u(f.address1,`address1`,`text`),agent_name:u(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:u(f.city,`city`,`text`),country:u(f.country,`country`,`text`),host_notification:u(f[`host-notification`],`host-notification`,`text`),original_work:u(f[`original-work`],`original-work`,`text`),owner_notification:u(f[`owner-notification`],`owner-notification`,`text`),signature:u(f.signature,`signature`,`text`),state:u(f.state,`state`,`text`),justification:u(f.justification,`justification`,`text`),trademark_number:u(f[`trademark-number`],`trademark-number`,`text`),trademark_office:u(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:u(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:u(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:u(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:u(f[`source-ips`],`source-ips`,`text`),ncmec_notification:u(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:u(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:u(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:u(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:u(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]});s(await l(`Creating`,async()=>p.abuseReports.create({body:h,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`})}};function h(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 g={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:h,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){c({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/abuse-reports/${t[`report-id`]==null?`<report-id>`:encodeURIComponent(String(t[`report-id`]))}/emails`,pathParams:{"report-id":String(t[`report-id`]??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.emails.list({account_id:o,report_id:t[`report-id`],...n})),{successLabel:`Loaded`})}},_={command:`emails`,describe:`Operations for emails`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(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 y={command:`get <report-param>`,describe:`Retrieve the details of an abuse report.`,builder:v,handler:async t=>{if(t.dryRun){c({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/abuse-reports/${t[`report-param`]==null?`<report-param>`:encodeURIComponent(String(t[`report-param`]))}`,pathParams:{"report-param":String(t[`report-param`]??``)},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.abuseReports.get({account_id:a,report_param:t[`report-param`]})),{successLabel:`Loaded`})}};function b(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 x={command:`list`,describe:`List the abuse reports for a given account`,builder:f(b),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],sort:t.sort,domain:t.domain,created_before:t[`created-before`],created_after:t[`created-after`],status:t.status,type:t.type,mitigation_status:t[`mitigation-status`]};if(t.dryRun){c({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/abuse-reports`,pathParams:{},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.list({account_id:o,...n})),{successLabel:`Loaded`})}};function S(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:[`account_suspend`,`copyright_interstitial`,`geo_block`,`legal_block`,`malware_interstitial`,`misleading_interstitial`,`network_block`,`phishing_interstitial`,`playfairite_enforce`,`r2_takedown_account`,`r2_takedown_bucket`,`r2_takedown_object`,`rate_limit_cache`,`redirect_video_stream`,`zone_fint`,`registrar_freeze`,`registrar_parking`,`stream_block_account`,`user_suspend`,`workers_takedown_by_zone_id`]}).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 C={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:f(S),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],sort:t.sort,type:t.type,effective_before:t[`effective-before`],effective_after:t[`effective-after`],status:t.status,entity_type:t[`entity-type`]};if(t.dryRun){c({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/abuse-reports/${t[`report-id`]==null?`<report-id>`:encodeURIComponent(String(t[`report-id`]))}/mitigations`,pathParams:{"report-id":String(t[`report-id`]??``)},query:n,bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);t.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.mitigations.list({account_id:o,report_id:t[`report-id`],...n})),{successLabel:`Loaded`})}};function w(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`data-city`,{type:`string`,description:`The data.city field`}).option(`data-company`,{type:`string`,description:`The data.company field`}).option(`data-counter-notice-response`,{type:`string`,description:`The data.counter_notice_response field`}).option(`data-country`,{type:`string`,description:`The data.country field`}).option(`data-email`,{type:`string`,description:`The data.email field`}).option(`data-full-name`,{type:`string`,description:`The data.full_name field`}).option(`data-jurisdiction-consent`,{type:`boolean`,description:`The data.jurisdiction_consent field`}).option(`data-perjury-attestation`,{type:`boolean`,description:`The data.perjury_attestation field`}).option(`data-phone-number`,{type:`string`,description:`The data.phone_number field`}).option(`data-signature`,{type:`string`,description:`The data.signature field`}).option(`data-state`,{type:`string`,description:`The data.state field`}).option(`data-street-address`,{type:`string`,description:`The data.street_address field`}).option(`data-urls`,{type:`string`,array:!0,description:`The data.urls field`}).option(`data-zip-code`,{type:`string`,description:`The data.zip_code field`}).option(`type`,{type:`string`,description:`The type of appeal being submitted.`,choices:[`counter_notice`,`content_removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Submit an appeal for a report. Provide either a list of mitigations to appeal, or an appeal type with its supporting details, but not both. When type is "counter_notice", the counter-notice details are required.`}).check(e=>{if([`data-city`,`data-company`,`data-counter-notice-response`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].some(t=>e[t]!==void 0)){let t=[`data-city`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --data-* flag is set`)}return!0})}const T={command:`review <report-id>`,describe:`Request a review for mitigations on an account.`,builder:w,handler:async t=>{if(t.dryRun){c({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/abuse-reports/${t[`report-id`]==null?`<report-id>`:encodeURIComponent(String(t[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(t[`report-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({data:{city:u(t[`data-city`],`data-city`,`text`),company:u(t[`data-company`],`data-company`,`text`),counter_notice_response:u(t[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:u(t[`data-country`],`data-country`,`text`),email:u(t[`data-email`],`data-email`,`text`),full_name:u(t[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:t[`data-jurisdiction-consent`],perjury_attestation:t[`data-perjury-attestation`],phone_number:u(t[`data-phone-number`],`data-phone-number`,`text`),signature:u(t[`data-signature`],`data-signature`,`text`),state:u(t[`data-state`],`data-state`,`text`),street_address:u(t[`data-street-address`],`data-street-address`,`text`),urls:t[`data-urls`],zip_code:u(t[`data-zip-code`],`data-zip-code`,`text`)},type:u(t.type,`type`,`text`)}):a(t.body)});return}let n=await i(t),f=t.local?d:await r(n);if(t.accountId=f,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.abuseReports.mitigations.review({...e,account_id:f,report_id:t[`report-id`]})),{successLabel:`Created`});return}let p=o({data:{city:u(t[`data-city`],`data-city`,`text`),company:u(t[`data-company`],`data-company`,`text`),counter_notice_response:u(t[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:u(t[`data-country`],`data-country`,`text`),email:u(t[`data-email`],`data-email`,`text`),full_name:u(t[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:t[`data-jurisdiction-consent`],perjury_attestation:t[`data-perjury-attestation`],phone_number:u(t[`data-phone-number`],`data-phone-number`,`text`),signature:u(t[`data-signature`],`data-signature`,`text`),state:u(t[`data-state`],`data-state`,`text`),street_address:u(t[`data-street-address`],`data-street-address`,`text`),urls:t[`data-urls`],zip_code:u(t[`data-zip-code`],`data-zip-code`,`text`)},type:u(t.type,`type`,`text`)});s(await l(`Creating`,async()=>n.abuseReports.mitigations.review({...p,account_id:f,report_id:t[`report-id`]})),{successLabel:`Created`})}},E={command:`mitigations`,describe:`Operations for mitigations`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(m).command(y).command(x).command(_).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};
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 m={command:`create <report-param>`,describe:"Submit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Account > Abuse Reports > Edit` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below).",builder:p,handler:async f=>{if(f.dryRun){o({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<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:f.body===void 0?i({comments:c(f.comments,`comments`,`text`),company:c(f.company,`company`,`text`),email:c(f.email,`email`,`text`),email2:c(f.email2,`email2`,`text`),name:c(f.name,`name`,`text`),reported_country:c(f[`reported-country`],`reported-country`,`text`),reported_user_agent:c(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:c(f.tele,`tele`,`text`),title:c(f.title,`title`,`text`),urls:c(f.urls,`urls`,`text`),address1:c(f.address1,`address1`,`text`),agent_name:c(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:c(f.city,`city`,`text`),country:c(f.country,`country`,`text`),host_notification:c(f[`host-notification`],`host-notification`,`text`),original_work:c(f[`original-work`],`original-work`,`text`),owner_notification:c(f[`owner-notification`],`owner-notification`,`text`),signature:c(f.signature,`signature`,`text`),state:c(f.state,`state`,`text`),justification:c(f.justification,`justification`,`text`),trademark_number:c(f[`trademark-number`],`trademark-number`,`text`),trademark_office:c(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:c(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:c(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:c(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:c(f[`source-ips`],`source-ips`,`text`),ncmec_notification:c(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:c(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:c(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:c(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:c(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]}):r(f.body)});return}let p=await n(f),m=f.local?l:await e();if(f.accountId=m,f.body){let e=r(f.body);a(await s(`Creating`,async()=>p.abuseReports.create({body:e,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`});return}f.email===void 0&&(f.email=await d(`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 d(`email2`,"Should match the value provided in `email`")),f.name===void 0&&(f.name=await d(`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 d(`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 u(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`]));let h=i({comments:c(f.comments,`comments`,`text`),company:c(f.company,`company`,`text`),email:c(f.email,`email`,`text`),email2:c(f.email2,`email2`,`text`),name:c(f.name,`name`,`text`),reported_country:c(f[`reported-country`],`reported-country`,`text`),reported_user_agent:c(f[`reported-user-agent`],`reported-user-agent`,`text`),tele:c(f.tele,`tele`,`text`),title:c(f.title,`title`,`text`),urls:c(f.urls,`urls`,`text`),address1:c(f.address1,`address1`,`text`),agent_name:c(f[`agent-name`],`agent-name`,`text`),agree:f.agree,city:c(f.city,`city`,`text`),country:c(f.country,`country`,`text`),host_notification:c(f[`host-notification`],`host-notification`,`text`),original_work:c(f[`original-work`],`original-work`,`text`),owner_notification:c(f[`owner-notification`],`owner-notification`,`text`),signature:c(f.signature,`signature`,`text`),state:c(f.state,`state`,`text`),justification:c(f.justification,`justification`,`text`),trademark_number:c(f[`trademark-number`],`trademark-number`,`text`),trademark_office:c(f[`trademark-office`],`trademark-office`,`text`),trademark_symbol:c(f[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:c(f[`destination-ips`],`destination-ips`,`text`),ports_protocols:c(f[`ports-protocols`],`ports-protocols`,`text`),source_ips:c(f[`source-ips`],`source-ips`,`text`),ncmec_notification:c(f[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:c(f[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:f[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:f[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:c(f[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:c(f[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:f[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:c(f[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:f[`ncsei-subject-representation`]});a(await s(`Creating`,async()=>p.abuseReports.create({body:h,account_id:m,report_param:f[`report-param`]})),{successLabel:`Created`})}};function h(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 g={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:h,handler:async r=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/abuse-reports/${r[`report-id`]==null?`<report-id>`:encodeURIComponent(String(r[`report-id`]))}/emails`,pathParams:{"report-id":String(r[`report-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.abuseReports.emails.list({account_id:u,report_id:r[`report-id`],...i})),{successLabel:`Loaded`})}},_={command:`emails`,describe:`Operations for emails`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(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 y={command:`get <report-param>`,describe:`Retrieve the details of an abuse report.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/abuse-reports/${r[`report-param`]==null?`<report-param>`:encodeURIComponent(String(r[`report-param`]))}`,pathParams:{"report-param":String(r[`report-param`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.abuseReports.get({account_id:c,report_param:r[`report-param`]})),{successLabel:`Loaded`})}};function b(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 x={command:`list`,describe:`List the abuse reports for a given account`,builder:f(b),handler:async r=>{let i={page:r.page,per_page:r[`per-page`],sort:r.sort,domain:r.domain,created_before:r[`created-before`],created_after:r[`created-after`],status:r.status,type:r.type,mitigation_status:r[`mitigation-status`]};if(r.dryRun){o({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/abuse-reports`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.abuseReports.list({account_id:u,...i})),{successLabel:`Loaded`})}};function S(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:[`account_suspend`,`copyright_interstitial`,`geo_block`,`legal_block`,`malware_interstitial`,`misleading_interstitial`,`network_block`,`phishing_interstitial`,`playfairite_enforce`,`r2_takedown_account`,`r2_takedown_bucket`,`r2_takedown_object`,`rate_limit_cache`,`redirect_video_stream`,`zone_fint`,`registrar_freeze`,`registrar_parking`,`stream_block_account`,`user_suspend`,`workers_takedown_by_zone_id`]}).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 C={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:f(S),handler:async r=>{let i={page:r.page,per_page:r[`per-page`],sort:r.sort,type:r.type,effective_before:r[`effective-before`],effective_after:r[`effective-after`],status:r.status,entity_type:r[`entity-type`]};if(r.dryRun){o({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/abuse-reports/${r[`report-id`]==null?`<report-id>`:encodeURIComponent(String(r[`report-id`]))}/mitigations`,pathParams:{"report-id":String(r[`report-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.abuseReports.mitigations.list({account_id:u,report_id:r[`report-id`],...i})),{successLabel:`Loaded`})}};function w(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`data-city`,{type:`string`,description:`The data.city field`}).option(`data-company`,{type:`string`,description:`The data.company field`}).option(`data-counter-notice-response`,{type:`string`,description:`The data.counter_notice_response field`}).option(`data-country`,{type:`string`,description:`The data.country field`}).option(`data-email`,{type:`string`,description:`The data.email field`}).option(`data-full-name`,{type:`string`,description:`The data.full_name field`}).option(`data-jurisdiction-consent`,{type:`boolean`,description:`The data.jurisdiction_consent field`}).option(`data-perjury-attestation`,{type:`boolean`,description:`The data.perjury_attestation field`}).option(`data-phone-number`,{type:`string`,description:`The data.phone_number field`}).option(`data-signature`,{type:`string`,description:`The data.signature field`}).option(`data-state`,{type:`string`,description:`The data.state field`}).option(`data-street-address`,{type:`string`,description:`The data.street_address field`}).option(`data-urls`,{type:`string`,array:!0,description:`The data.urls field`}).option(`data-zip-code`,{type:`string`,description:`The data.zip_code field`}).option(`type`,{type:`string`,description:`The type of appeal being submitted.`,choices:[`counter_notice`,`content_removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Submit an appeal for a report. Provide either a list of mitigations to appeal, or an appeal type with its supporting details, but not both. When type is "counter_notice", the counter-notice details are required.`}).check(e=>{if([`data-city`,`data-company`,`data-counter-notice-response`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].some(t=>e[t]!==void 0)){let t=[`data-city`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --data-* flag is set`)}return!0})}const T={command:`review <report-id>`,describe:`Request a review for mitigations on an account.`,builder:w,handler:async u=>{if(u.dryRun){o({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/abuse-reports/${u[`report-id`]==null?`<report-id>`:encodeURIComponent(String(u[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(u[`report-id`]??``)},bodyKind:`json`,body:u.body===void 0?i({data:{city:c(u[`data-city`],`data-city`,`text`),company:c(u[`data-company`],`data-company`,`text`),counter_notice_response:c(u[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:c(u[`data-country`],`data-country`,`text`),email:c(u[`data-email`],`data-email`,`text`),full_name:c(u[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:u[`data-jurisdiction-consent`],perjury_attestation:u[`data-perjury-attestation`],phone_number:c(u[`data-phone-number`],`data-phone-number`,`text`),signature:c(u[`data-signature`],`data-signature`,`text`),state:c(u[`data-state`],`data-state`,`text`),street_address:c(u[`data-street-address`],`data-street-address`,`text`),urls:u[`data-urls`],zip_code:c(u[`data-zip-code`],`data-zip-code`,`text`)},type:c(u.type,`type`,`text`)}):r(u.body)});return}let d=await n(u),f=u.local?l:await e();if(u.accountId=f,u.body){let e=r(u.body);a(await s(`Creating`,async()=>d.abuseReports.mitigations.review({...e,account_id:f,report_id:u[`report-id`]})),{successLabel:`Created`});return}let p=i({data:{city:c(u[`data-city`],`data-city`,`text`),company:c(u[`data-company`],`data-company`,`text`),counter_notice_response:c(u[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:c(u[`data-country`],`data-country`,`text`),email:c(u[`data-email`],`data-email`,`text`),full_name:c(u[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:u[`data-jurisdiction-consent`],perjury_attestation:u[`data-perjury-attestation`],phone_number:c(u[`data-phone-number`],`data-phone-number`,`text`),signature:c(u[`data-signature`],`data-signature`,`text`),state:c(u[`data-state`],`data-state`,`text`),street_address:c(u[`data-street-address`],`data-street-address`,`text`),urls:u[`data-urls`],zip_code:c(u[`data-zip-code`],`data-zip-code`,`text`)},type:c(u.type,`type`,`text`)});a(await s(`Creating`,async()=>d.abuseReports.mitigations.review({...p,account_id:f,report_id:u[`report-id`]})),{successLabel:`Created`})}},E={command:`mitigations`,describe:`Operations for mitigations`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(m).command(y).command(x).command(_).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{i as n,n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{r as d,t as f}from"./prompt-q3B7sM2A.mjs";import{t as p}from"./cli-types-DGgEbf8K.mjs";function m(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 ee={command:`create`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:m,handler:async n=>{if(n.dryRun){s({command:`cf accounts account-organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({destination_organization_id:l(n[`destination-organization-id`],`destination-organization-id`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>f.accounts.accountOrganizations.create({...e,account_id:p})),{successLabel:`Created`});return}n[`destination-organization-id`]===void 0&&(n[`destination-organization-id`]=await d(`destination-organization-id`,`The destination_organization_id field`));let m=a({destination_organization_id:l(n[`destination-organization-id`],`destination-organization-id`,`text`)});o(await c(`Creating`,async()=>f.accounts.accountOrganizations.create({...m,account_id:p})),{successLabel:`Created`})}},te={command:`account-organizations`,describe:`Operations for account-organizations`,builder:e=>e.command(ee).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 g={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:h,handler:async n=>{if(n.dryRun){s({command:`cf accounts account-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.accountProfile.get({account_id:a})),{successLabel:`Loaded`})}};function _(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 v={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:_,handler:async n=>{if(n.dryRun){s({command:`cf accounts account-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({business_address:l(n[`business-address`],`business-address`,`text`),business_email:l(n[`business-email`],`business-email`,`text`),business_name:l(n[`business-name`],`business-name`,`text`),business_phone:l(n[`business-phone`],`business-phone`,`text`),external_metadata:l(n[`external-metadata`],`external-metadata`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Updating`,async()=>f.accounts.accountProfile.update({body:e,account_id:p})),{successLabel:`Updated`});return}n[`business-address`]===void 0&&(n[`business-address`]=await d(`business-address`,`The business_address field`)),n[`business-email`]===void 0&&(n[`business-email`]=await d(`business-email`,`The business_email field`)),n[`business-name`]===void 0&&(n[`business-name`]=await d(`business-name`,`The business_name field`)),n[`business-phone`]===void 0&&(n[`business-phone`]=await d(`business-phone`,`The business_phone field`)),n[`external-metadata`]===void 0&&(n[`external-metadata`]=await d(`external-metadata`,`The external_metadata field`));let m=a({business_address:l(n[`business-address`],`business-address`,`text`),business_email:l(n[`business-email`],`business-email`,`text`),business_name:l(n[`business-name`],`business-name`,`text`),business_phone:l(n[`business-phone`],`business-phone`,`text`),external_metadata:l(n[`external-metadata`],`external-metadata`,`text`)});o(await c(`Updating`,async()=>f.accounts.accountProfile.update({body:m,account_id:p})),{successLabel:`Updated`})}},y={command:`account-profile`,describe:`Operations for account-profile`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(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). also supports multiple values (e.g., intel_id:498,1001)
10
+ - category_id: Filter by category ID (e.g., category_id:37f8ec03-8766-49d4-9a15-369b044c842c).
11
+ - category_name: Filter by category name (e.g., category_name:HR).
12
+ - supported: Filter by supported Cloudflare product (e.g., supported:ACCESS). Values: GATEWAY, ACCESS, CASB.
13
+ .`}).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 results by field name and direction (e.g., name:asc). Ignored when search is provided; results are ranked by relevance instead.`}).option(`search`,{type:`string`,description:`Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`applications`,describe:`List applications with different filters.`,builder:b,handler:async n=>{let i={filter:n.filter,limit:n.limit,offset:n.offset,order_by:n[`order-by`],search:n.search};if(n.dryRun){s({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/resource-library/applications`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.applications.get.applications({account_id:l,...i})),{successLabel:`Loaded`})}};function S(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 C={command:`id <id>`,describe:`Get application by ID.`,builder:S,handler:async n=>{if(n.dryRun){s({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/resource-library/applications/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.applications.get.by.id({account_id:a,id:n.id})),{successLabel:`Loaded`})}},w={command:`by`,describe:`Applications operations`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`get`,describe:`Applications operations`,builder:e=>e.command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`applications`,describe:`Operations for applications`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(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 O={command:`id <id>`,describe:`Get application category by ID.`,builder:D,handler:async n=>{if(n.dryRun){s({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/resource-library/categories/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.categories.get.by.id({account_id:a,id:n.id})),{successLabel:`Loaded`})}},k={command:`by`,describe:`Categories operations`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(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 j={command:`categories`,describe:`List application categories.`,builder:A,handler:async n=>{let i={limit:n.limit,offset:n.offset};if(n.dryRun){s({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/resource-library/categories`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.categories.get.categories({account_id:l,...i})),{successLabel:`Loaded`})}},M={command:`get`,describe:`Categories operations`,builder:e=>e.command(j).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`categories`,describe:`Operations for categories`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(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 F={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:P,handler:async e=>{if(e.dryRun){s({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({name:l(e.name,`name`,`text`),unit:{id:l(e[`unit-id`],`unit-id`,`text`)}}):i(e.body)});return}let t=await r(e);if(e.body){let n=i(e.body);o(await c(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await d(`name`,`Account name`));let n=a({name:l(e.name,`name`,`text`),unit:{id:l(e[`unit-id`],`unit-id`,`text`)}});o(await c(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`})}};function I(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 L={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:I,handler:async n=>{if(n.dryRun){s({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await f({force:!!n.force})){process.stderr.write(`Aborted.
14
+ `);return}o(await c(`Deleting`,async()=>i.accounts.delete({account_id:a})),{successLabel:`Deleted`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:R,handler:async n=>{if(n.dryRun){s({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.get({account_id:a})),{successLabel:`Loaded`})}};function B(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 V={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:p(B),handler:async e=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){s({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);o(await c(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function H(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(`product-category`,{type:`string`,description:`Filters audit logs by one or more predefined product categories. Each product category expands into a curated set of resource_product values and is unioned with any explicit resource_product filter. Matched case-insensitively; unknown product categories return 400. Repeatable. Use the audit log product categories endpoint to discover the available values.`}).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 U={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:p(H),handler:async n=>{let i={account_name:n[`account-name`],action_result:n[`action-result`],action_type:n[`action-type`],actor_context:n[`actor-context`],actor_email:n[`actor-email`],actor_id:n[`actor-id`],actor_ip_address:n[`actor-ip-address`],actor_token_id:n[`actor-token-id`],actor_token_name:n[`actor-token-name`],actor_type:n[`actor-type`],audit_log_id:n[`audit-log-id`],id:n.id,raw_cf_ray_id:n[`raw-cf-ray-id`],raw_method:n[`raw-method`],raw_status_code:n[`raw-status-code`],raw_uri:n[`raw-uri`],resource_id:n[`resource-id`],resource_product:n[`resource-product`],resource_type:n[`resource-type`],resource_scope:n[`resource-scope`],product_category:n[`product-category`],zone_id:n[`zone-id`],zone_name:n[`zone-name`],"account_name.not":n[`account-name-not`],"action_result.not":n[`action-result-not`],"action_type.not":n[`action-type-not`],"actor_context.not":n[`actor-context-not`],"actor_email.not":n[`actor-email-not`],"actor_id.not":n[`actor-id-not`],"actor_ip_address.not":n[`actor-ip-address-not`],"actor_token_id.not":n[`actor-token-id-not`],"actor_token_name.not":n[`actor-token-name-not`],"actor_type.not":n[`actor-type-not`],"audit_log_id.not":n[`audit-log-id-not`],"id.not":n[`id-not`],"raw_cf_ray_id.not":n[`raw-cf-ray-id-not`],"raw_method.not":n[`raw-method-not`],"raw_status_code.not":n[`raw-status-code-not`],"raw_uri.not":n[`raw-uri-not`],"resource_id.not":n[`resource-id-not`],"resource_product.not":n[`resource-product-not`],"resource_type.not":n[`resource-type-not`],"resource_scope.not":n[`resource-scope-not`],"zone_id.not":n[`zone-id-not`],"zone_name.not":n[`zone-name-not`],since:n.since,before:n.before,direction:n.direction,limit:n.limit,cursor:n.cursor};if(n.dryRun){s({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/audit`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.logs.audit.list({account_id:l,...i})),{successLabel:`Loaded`})}},W={command:`audit`,describe:`Retrieve audit log entries that record actions taken on the account`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(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'.
15
+ Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
16
+ `,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 q={command:`create`,describe:`Add a user to the list of members for this account.`,builder:K,handler:async n=>{if(n.dryRun){s({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({email:l(n.email,`email`,`text`),roles:n.roles,status:l(n.status,`status`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>f.accounts.members.create({body:e,account_id:p})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await d(`email`,`The contact email address of the user.`));let m=a({email:l(n.email,`email`,`text`),roles:n.roles,status:l(n.status,`status`,`text`)});o(await c(`Creating`,async()=>f.accounts.members.create({body:m,account_id:p})),{successLabel:`Created`})}};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <member-id>`,describe:`Remove a member from an account.`,builder:J,handler:async n=>{if(n.dryRun){s({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/members/${n[`member-id`]==null?`<member-id>`:encodeURIComponent(String(n[`member-id`]))}`,pathParams:{"member-id":String(n[`member-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await f({force:!!n.force})){process.stderr.write(`Aborted.
17
+ `);return}o(await c(`Deleting`,async()=>i.accounts.members.delete({account_id:a,member_id:n[`member-id`]})),{successLabel:`Deleted`})}};function X(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 Z={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:X,handler:async n=>{if(n.dryRun){s({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/members/${n[`member-id`]==null?`<member-id>`:encodeURIComponent(String(n[`member-id`]))}`,pathParams:{"member-id":String(n[`member-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.members.get({account_id:a,member_id:n[`member-id`]})),{successLabel:`Loaded`})}};function Q(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 ne={command:`list`,describe:`List all members of an account.`,builder:p(Q),handler:async n=>{let i={order:n.order,status:n.status,page:n.page,per_page:n[`per-page`],direction:n.direction};if(n.dryRun){s({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/members`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.members.list({account_id:l,...i})),{successLabel:`Loaded`})}};function re(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 ie={command:`update <member-id>`,describe:`Modify an account member.`,builder:re,handler:async a=>{if(a.dryRun){s({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"member-id":String(a[`member-id`]??``)},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let l=await r(a),d=a.local?u:await e();if(a.accountId=d,a.body){let e=i(a.body);o(await c(`Updating`,async()=>l.accounts.members.update({body:e,account_id:d,member_id:a[`member-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${d}/members/${encodeURIComponent(String(a[`member-id`]))}`)),{successLabel:`Updated`})}},ae={command:`members`,describe:`Invite, inspect, update, and remove users who have access to this account`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(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 se={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:oe,handler:async e=>{if(e.dryRun){s({command:`cf accounts move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)}):i(e.body)});return}let t=await r(e);if(e.body){let n=i(e.body);o(await c(`Creating`,async()=>t.accounts.move({...n})),{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 d(`destination-organization-id`,`Move accounts to this organization ID.`));let n=a({account_ids:e[`account-ids`],destination_organization_id:l(e[`destination-organization-id`],`destination-organization-id`,`text`)});o(await c(`Creating`,async()=>t.accounts.move({...n})),{successLabel:`Created`})}};function ce(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 le={command:`get <role-id>`,describe:`Get information about a specific role for an account.`,builder:ce,handler:async n=>{if(n.dryRun){s({command:`cf accounts roles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/roles/${n[`role-id`]==null?`<role-id>`:encodeURIComponent(String(n[`role-id`]))}`,pathParams:{"role-id":String(n[`role-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.roles.get({account_id:a,role_id:n[`role-id`]})),{successLabel:`Loaded`})}};function ue(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 de={command:`list`,describe:`Get all available roles for an account.`,builder:ue,handler:async n=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf accounts roles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/roles`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.roles.list({account_id:l,...i})),{successLabel:`Loaded`})}},fe={command:`roles`,describe:`View the roles available for assigning to account members, each defining a set of permissions`,builder:e=>e.command(le).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(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 me={command:`create`,describe:`Creates an account subscription.`,builder:pe,handler:async n=>{if(n.dryRun){s({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({app:{install_id:l(n[`app-install-id`],`app-install-id`,`text`)},frequency:l(n.frequency,`frequency`,`text`),rate_plan:{currency:l(n[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:n[`rate-plan-externally-managed`],id:l(n[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:n[`rate-plan-is-contract`],public_name:l(n[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:l(n[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:n[`rate-plan-sets`]}}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.accounts.subscriptions.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({app:{install_id:l(n[`app-install-id`],`app-install-id`,`text`)},frequency:l(n.frequency,`frequency`,`text`),rate_plan:{currency:l(n[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:n[`rate-plan-externally-managed`],id:l(n[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:n[`rate-plan-is-contract`],public_name:l(n[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:l(n[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:n[`rate-plan-sets`]}});o(await c(`Creating`,async()=>d.accounts.subscriptions.create({body:p,account_id:f})),{successLabel:`Created`})}};function he(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})}const ge={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:he,handler:async n=>{if(n.dryRun){s({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/subscriptions/${n[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(n[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(n[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await f({force:!!n.force})){process.stderr.write(`Aborted.
18
+ `);return}o(await c(`Deleting`,async()=>i.accounts.subscriptions.delete({account_id:a,subscription_identifier:n[`subscription-identifier`]})),{successLabel:`Deleted`})}};function _e(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`get`,describe:`Lists all of an account's subscriptions.`,builder:_e,handler:async n=>{if(n.dryRun){s({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.subscriptions.get({account_id:a})),{successLabel:`Loaded`})}};function ye(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 be={command:`update <subscription-identifier>`,describe:`Updates an account subscription.`,builder:ye,handler:async n=>{if(n.dryRun){s({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/subscriptions/${n[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(n[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(n[`subscription-identifier`]??``)},bodyKind:`json`,body:n.body===void 0?a({app:{install_id:l(n[`app-install-id`],`app-install-id`,`text`)},frequency:l(n.frequency,`frequency`,`text`),rate_plan:{currency:l(n[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:n[`rate-plan-externally-managed`],id:l(n[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:n[`rate-plan-is-contract`],public_name:l(n[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:l(n[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:n[`rate-plan-sets`]}}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.accounts.subscriptions.update({body:e,account_id:f,subscription_identifier:n[`subscription-identifier`]})),{successLabel:`Updated`});return}let p=a({app:{install_id:l(n[`app-install-id`],`app-install-id`,`text`)},frequency:l(n.frequency,`frequency`,`text`),rate_plan:{currency:l(n[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:n[`rate-plan-externally-managed`],id:l(n[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:n[`rate-plan-is-contract`],public_name:l(n[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:l(n[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:n[`rate-plan-sets`]}});o(await c(`Updating`,async()=>d.accounts.subscriptions.update({body:p,account_id:f,subscription_identifier:n[`subscription-identifier`]})),{successLabel:`Updated`})}},xe={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(me).command(ge).command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(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 Ce={command:`create`,describe:`Create a new Account Owned API token.`,builder:Se,handler:async n=>{if(n.dryRun){s({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({condition:{request_ip:{in:n[`condition-request-ip-in`],not_in:n[`condition-request-ip-not-in`]}},expires_on:l(n[`expires-on`],`expires-on`,`text`),name:l(n.name,`name`,`text`),not_before:l(n[`not-before`],`not-before`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>f.accounts.tokens.create({body:e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await d(`name`,`Token name.`));let m=a({condition:{request_ip:{in:n[`condition-request-ip-in`],not_in:n[`condition-request-ip-not-in`]}},expires_on:l(n[`expires-on`],`expires-on`,`text`),name:l(n.name,`name`,`text`),not_before:l(n[`not-before`],`not-before`,`text`)});o(await c(`Creating`,async()=>f.accounts.tokens.create({body:m,account_id:p})),{successLabel:`Created`})}};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Te={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:we,handler:async n=>{if(n.dryRun){s({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens/${n[`token-id`]==null?`<token-id>`:encodeURIComponent(String(n[`token-id`]))}`,pathParams:{"token-id":String(n[`token-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await f({force:!!n.force})){process.stderr.write(`Aborted.
19
+ `);return}o(await c(`Deleting`,async()=>i.accounts.tokens.delete({account_id:a,token_id:n[`token-id`]})),{successLabel:`Deleted`})}};function Ee(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 De={command:`get <token-id>`,describe:`Get information about a specific Account Owned API token.`,builder:Ee,handler:async n=>{if(n.dryRun){s({command:`cf accounts tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens/${n[`token-id`]==null?`<token-id>`:encodeURIComponent(String(n[`token-id`]))}`,pathParams:{"token-id":String(n[`token-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.tokens.get({account_id:a,token_id:n[`token-id`]})),{successLabel:`Loaded`})}};function Oe(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(`include-expired`,{type:`boolean`,description:`When true, includes recently-expired tokens in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`List all Account Owned API tokens created for this account. Results include active, disabled, and recently-expired tokens when include_expired is set to true.`,builder:p(Oe),handler:async n=>{let i={page:n.page,per_page:n[`per-page`],direction:n.direction,include_expired:n[`include-expired`]};if(n.dryRun){s({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.tokens.list({account_id:l,...i})),{successLabel:`Loaded`})}};function Ae(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
20
+ The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
21
+ 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 n=>{let i={name:n.name,scope:n.scope};if(n.dryRun){s({command:`cf accounts tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.accounts.tokens.permissionGroups.list({account_id:l,...i})),{successLabel:`Loaded`})}},Me={command:`permission-groups`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.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 n=>{if(n.dryRun){s({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens/${n[`token-id`]==null?`<token-id>`:encodeURIComponent(String(n[`token-id`]))}`,pathParams:{"token-id":String(n[`token-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({condition:{request_ip:{in:n[`condition-request-ip-in`],not_in:n[`condition-request-ip-not-in`]}},expires_on:l(n[`expires-on`],`expires-on`,`text`),name:l(n.name,`name`,`text`),not_before:l(n[`not-before`],`not-before`,`text`),status:l(n.status,`status`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Updating`,async()=>f.accounts.tokens.update({body:e,account_id:p,token_id:n[`token-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await d(`name`,`Token name.`));let m=a({condition:{request_ip:{in:n[`condition-request-ip-in`],not_in:n[`condition-request-ip-not-in`]}},expires_on:l(n[`expires-on`],`expires-on`,`text`),name:l(n.name,`name`,`text`),not_before:l(n[`not-before`],`not-before`,`text`),status:l(n.status,`status`,`text`)});o(await c(`Updating`,async()=>f.accounts.tokens.update({body:m,account_id:p,token_id:n[`token-id`]})),{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})}const Fe={command:`update <token-id>`,describe:`Roll the Account Owned API token secret.`,builder:$,handler:async n=>{if(n.dryRun){s({command:`cf accounts tokens value update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens/${n[`token-id`]==null?`<token-id>`:encodeURIComponent(String(n[`token-id`]))}/value`,pathParams:{"token-id":String(n[`token-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Updating`,async()=>i.accounts.tokens.value.update({account_id:a,token_id:n[`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 n=>{if(n.dryRun){s({command:`cf accounts tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/tokens/verify`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.accounts.tokens.verify({account_id:a})),{successLabel:`Loaded`})}},ze={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(Ce).command(Te).command(De).command(ke).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
22
+ 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 n=>{if(n.dryRun){s({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({id:l(n.id,`id`,`text`),name:l(n.name,`name`,`text`),settings:{abuse_contact_email:l(n[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:n[`settings-enforce-twofactor`]}}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Updating`,async()=>f.accounts.update({body:e,account_id:p})),{successLabel:`Updated`});return}n.id===void 0&&(n.id=await d(`id`,`Identifier`)),n.name===void 0&&(n.name=await d(`name`,`Account name`));let m=a({id:l(n.id,`id`,`text`),name:l(n.name,`name`,`text`),settings:{abuse_contact_email:l(n[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:n[`settings-enforce-twofactor`]}});o(await c(`Updating`,async()=>f.accounts.update({body:m,account_id:p})),{successLabel:`Updated`})}},He={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(F).command(L).command(z).command(V).command(se).command(Ve).command(te).command(y).command(E).command(N).command(G).command(ae).command(fe).command(xe).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,S as t,T as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).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:`Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:u,handler:async n=>{if(n.dryRun){s({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({certificate:l(n.certificate,`certificate`,`text`)}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}n.certificate===void 0&&(n.certificate=await e(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=a({certificate:l(n.certificate,`certificate`,`text`)});o(await c(`Creating`,async()=>u.acm.customTrustStore.create({...f,zone_id:d})),{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 root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf acm custom-trust-store delete`,method:`DELETE`,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 i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.acm.customTrustStore.delete({zone_id:a,custom_origin_trust_store_id:e[`custom-origin-trust-store-id`]})),{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 root CA 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 n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.acm.customTrustStore.get({zone_id:i,custom_origin_trust_store_id:e[`custom-origin-trust-store-id`]})),{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 n={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:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.acm.customTrustStore.list({zone_id:a,...n})),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,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:e.body===void 0?a({certificate_authority:l(e[`certificate-authority`],`certificate-authority`,`text`),enabled:e.enabled}):i(e.body)});return}let n=await r(e),u=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=i(e.body);o(await c(`Creating`,async()=>n.acm.totalTls.edit({...t,zone_id:u})),{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=a({certificate_authority:l(e[`certificate-authority`],`certificate-authority`,`text`),enabled:e.enabled});o(await c(`Creating`,async()=>n.acm.totalTls.edit({...d,zone_id:u})),{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 n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.acm.totalTls.get({zone_id:i})),{successLabel:`Loaded`})}},C={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`acm`,describe:`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,builder:e=>e.command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
2
+ import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n,t as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s}from"./input-validation-_fMCApaH.mjs";import{r as c,t as l}from"./prompt-q3B7sM2A.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).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:`Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:u,handler:async l=>{if(l.dryRun){a({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({certificate:s(l.certificate,`certificate`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Creating`,async()=>u.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}l.certificate===void 0&&(l.certificate=await c(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=r({certificate:s(l.certificate,`certificate`,`text`)});i(await o(`Creating`,async()=>u.acm.customTrustStore.create({...f,zone_id:d})),{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 root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async n=>{if(n.dryRun){a({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/acm/custom_trust_store/${n[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(n[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(n[`custom-origin-trust-store-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=s,!await l({force:!!n.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>r.acm.customTrustStore.delete({zone_id:s,custom_origin_trust_store_id:n[`custom-origin-trust-store-id`]})),{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 root CA certificate in the custom origin trust store, including expiration and subject information.`,builder:m,handler:async n=>{if(n.dryRun){a({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/acm/custom_trust_store/${n[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(n[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(n[`custom-origin-trust-store-id`]??``),"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.acm.customTrustStore.get({zone_id:s,custom_origin_trust_store_id:n[`custom-origin-trust-store-id`]})),{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 n=>{let r={page:n.page,per_page:n[`per-page`],limit:n.limit,offset:n.offset};if(n.dryRun){a({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.acm.customTrustStore.list({zone_id:c,...r})),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,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 c=>{if(c.dryRun){a({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?r({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled}):n(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=n(c.body);i(await o(`Creating`,async()=>l.acm.totalTls.edit({...e,zone_id:u})),{successLabel:`Created`});return}if(c.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=r({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled});i(await o(`Creating`,async()=>l.acm.totalTls.edit({...d,zone_id:u})),{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 n=>{if(n.dryRun){a({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.acm.totalTls.get({zone_id:s})),{successLabel:`Loaded`})}},C={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`acm`,describe:`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,builder:e=>e.command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import{N as e,O as t,P as n}from"./oauth-B5k80sip.mjs";import{i as r,n as i}from"./auth-DX9KnJ0P.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-CL8I-7YK.mjs";import{n as u,t as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{r as p,t as m}from"./prompt-q3B7sM2A.mjs";import{n as ee,t as te}from"./raw-fetch-bIXC9D1m.mjs";function h(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <address-map-id>`,describe:`Remove an account as a member of a particular address map.`,builder:h,handler:async e=>{if(e.dryRun){let t=n();c({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/accounts/${t??`<account-id>`}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}s(await l(`Deleting`,async()=>r.addressing.addressMaps.accounts.delete({account_id:a,address_map_id:e[`address-map-id`],account_id_2:a})),{successLabel:`Deleted`})}};function _(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`update <address-map-id>`,describe:`Add an account as a member of a particular address map.`,builder:_,handler:async e=>{if(e.dryRun){let t=n();c({command:`cf addressing address-maps accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/accounts/${t??`<account-id>`}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Updating`,async()=>r.addressing.addressMaps.accounts.update({account_id:a,address_map_id:e[`address-map-id`],account_id_2:a})),{successLabel:`Updated`})}},y={command:`accounts`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`,default:!1}).option(`ips`,{type:`string`,array:!0,description:`The ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Create a new address map under the account.`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({description:u(e.description,`description`,`text`),enabled:e.enabled,ips:e.ips}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.addressing.addressMaps.create({...t,account_id:d})),{successLabel:`Created`});return}let p=o({description:u(e.description,`description`,`text`),enabled:e.enabled,ips:e.ips});s(await l(`Creating`,async()=>r.addressing.addressMaps.create({...p,account_id:d})),{successLabel:`Created`})}};function S(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 C={command:`delete <address-map-id>`,describe:`Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.`,builder:S,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
4
+ `);return}s(await l(`Deleting`,async()=>r.addressing.addressMaps.delete({account_id:a,address_map_id:e[`address-map-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`default-sni`,{type:`string`,description:`If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account.`}).option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map 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 T={command:`edit <address-map-id>`,describe:`Modify properties of an address map owned by the account.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({default_sni:u(e[`default-sni`],`default-sni`,`text`),description:u(e.description,`description`,`text`),enabled:e.enabled}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.addressing.addressMaps.edit({...t,account_id:d,address_map_id:e[`address-map-id`]})),{successLabel:`Updated`});return}let p=o({default_sni:u(e[`default-sni`],`default-sni`,`text`),description:u(e.description,`description`,`text`),enabled:e.enabled});s(await l(`Updating`,async()=>r.addressing.addressMaps.edit({...p,account_id:d,address_map_id:e[`address-map-id`]})),{successLabel:`Updated`})}};function E(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <address-map-id>`,describe:`Show a particular address map owned by the account.`,builder:E,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.addressMaps.get({account_id:a,address_map_id:e[`address-map-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 k={command:`delete <ip-address>`,describe:`Remove an IP from a particular address map.`,builder:O,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps ips delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/ips/${e[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(e[`ip-address`]))}`,pathParams:{"ip-address":String(e[`ip-address`]??``),"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
5
+ `);return}s(await l(`Deleting`,async()=>r.addressing.addressMaps.ips.delete({account_id:a,address_map_id:e[`address-map-id`],ip_address:e[`ip-address`]})),{successLabel:`Deleted`})}};function A(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`update <ip-address>`,describe:`Add an IP from a prefix owned by the account to a particular address map.`,builder:A,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps ips update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/ips/${e[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(e[`ip-address`]))}`,pathParams:{"ip-address":String(e[`ip-address`]??``),"address-map-id":String(e[`address-map-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Updating`,async()=>r.addressing.addressMaps.ips.update({account_id:a,address_map_id:e[`address-map-id`],ip_address:e[`ip-address`]})),{successLabel:`Updated`})}},M={command:`ips`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List all address maps owned by the account.`,builder:N,handler:async e=>{if(e.dryRun){c({command:`cf addressing address-maps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.addressMaps.list({account_id:a})),{successLabel:`Loaded`})}};function F(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 I={command:`delete`,describe:`Remove a zone as a member of a particular address map.`,builder:F,handler:async r=>{if(r.dryRun){c({command:`cf addressing address-maps zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/zones/${r.zone??r.zoneId??`<zone>`}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let a=await i(r),o=r.local?f:await t();r.accountId=o;let u=await e({zone:r.zone},a,{quiet:r.quiet});if(r.zoneId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
6
+ `);return}s(await l(`Deleting`,async()=>a.addressing.addressMaps.zones.delete({account_id:o,address_map_id:r[`address-map-id`],zone_id:u})),{successLabel:`Deleted`})}};function L(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`update`,describe:`Add a zone as a member of a particular address map.`,builder:L,handler:async r=>{if(r.dryRun){c({command:`cf addressing address-maps zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/zones/${r.zone??r.zoneId??`<zone>`}`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let a=await i(r),o=r.local?f:await t();r.accountId=o;let u=await e({zone:r.zone},a,{quiet:r.quiet});r.zoneId=u,s(await l(`Updating`,async()=>a.addressing.addressMaps.zones.update({account_id:o,address_map_id:r[`address-map-id`],zone_id:u})),{successLabel:`Updated`})}},z={command:`zones`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`address-maps`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(x).command(C).command(T).command(D).command(P).command(y).command(M).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`List all leases owned by the account.`,builder:V,handler:async e=>{if(e.dryRun){c({command:`cf addressing leases list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/leases`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.leases.list({account_id:a})),{successLabel:`Loaded`})}},U={command:`leases`,describe:`Leases operations`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`loa-document`,{type:`string`,description:`LOA document to upload.`})}const G={command:`create`,describe:`Submit LOA document (pdf format) under the account.`,builder:W,handler:async e=>{if(e.dryRun){c({command:`cf addressing loa-documents create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/loa_documents`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,"loa-document":e[`loa-document`]}});return}let a=await i(e),o=e.local?f:await t();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e[`loa-document`]!==void 0){let t=new FormData;if(e.file){let n=d(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);e[`loa-document`]!==void 0&&t.append(`loa_document`,String(u(e[`loa-document`],`loa-document`,`text`)??``)),s(await l(`Creating`,async()=>r(a,`POST`,`/accounts/${o}/addressing/loa_documents`,{body:t})),{successLabel:`Created`});return}if(e.body){let t=u(e.body,`body`,`binary`);s(await l(`Creating`,async()=>r(a,`POST`,`/accounts/${o}/addressing/loa_documents`,{body:t,headers:{"Content-Type":`multipart/form-data`}})),{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 K(e){return e.positional(`loa-document-id`,{type:`string`,description:`Identifier for the uploaded LOA document.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const q={command:`get <loa-document-id>`,describe:`Download specified LOA document under the account.`,builder:K,handler:async e=>{if(e.dryRun){c({command:`cf addressing loa-documents get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/loa_documents/${e[`loa-document-id`]==null?`<loa-document-id>`:encodeURIComponent(String(e[`loa-document-id`]))}/download`,pathParams:{"loa-document-id":String(e[`loa-document-id`]??``)},bodyKind:`none`});return}await i(e);let r=e.local?f:await t();e.accountId=r;let a=await l(`Loading`,async()=>te(`/accounts/${r}/addressing/loa_documents/${encodeURIComponent(String(e[`loa-document-id`]))}/download`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}));ee(e.text===!0?a.toString(`utf-8`):a)}},J={command:`loa-documents`,describe:`Letter of Authorization documents required to verify IP prefix ownership`,builder:e=>e.command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`advertised`,{type:`boolean`,description:"Advertisement status of the prefix. If `true`, the BGP route for the prefix is advertised to the Internet. If \n`false`, the BGP route is withdrawn.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`edit <prefix-id>`,describe:`Advertise or withdraw the BGP route for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.`,builder:Y,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes advertisement-status edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/status`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({advertised:e.advertised}):a(e.body)});return}let r=await i(e),u=e.local?f:await t();if(e.accountId=u,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.addressing.prefixes.advertisementStatus.edit({...t,account_id:u,prefix_id:e[`prefix-id`]})),{successLabel:`Updated`});return}if(e.advertised===void 0)throw Error(`--advertised is required (or pass --body with this field set).`);let d=o({advertised:e.advertised});s(await l(`Updating`,async()=>r.addressing.prefixes.advertisementStatus.edit({...d,account_id:u,prefix_id:e[`prefix-id`]})),{successLabel:`Updated`})}};function Z(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <prefix-id>`,describe:`View the current advertisement state for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.`,builder:Z,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes advertisement-status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/status`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.advertisementStatus.get({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Loaded`})}},ne={command:`advertisement-status`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).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 ie={command:`create <prefix-id>`,describe:`Create a BGP prefix, controlling the BGP advertisement status of a specific subnet. When created, BGP prefixes are initially withdrawn, and can be advertised with the Update BGP Prefix API.`,builder:re,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes bgp-prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/prefixes`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({cidr:u(e.cidr,`cidr`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.addressing.prefixes.bgpPrefixes.create({...t,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Created`});return}e.cidr===void 0&&(e.cidr=await p(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let m=o({cidr:u(e.cidr,`cidr`,`text`)});s(await l(`Creating`,async()=>r.addressing.prefixes.bgpPrefixes.create({...m,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Created`})}};function ae(e){return e.positional(`bgp-prefix-id`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 oe={command:`delete <bgp-prefix-id>`,describe:`Delete a BGP Prefix associated with the specified IP Prefix. A BGP Prefix must be withdrawn before it can be deleted.`,builder:ae,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes bgp-prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/prefixes/${e[`bgp-prefix-id`]==null?`<bgp-prefix-id>`:encodeURIComponent(String(e[`bgp-prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``),"bgp-prefix-id":String(e[`bgp-prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
7
+ `);return}s(await l(`Deleting`,async()=>r.addressing.prefixes.bgpPrefixes.delete({account_id:a,prefix_id:e[`prefix-id`],bgp_prefix_id:e[`bgp-prefix-id`]})),{successLabel:`Deleted`})}};function se(e){return e.positional(`bgp-prefix-id`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`asn-prepend-count`,{type:`number`,description:`Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute`}).option(`auto-advertise-withdraw`,{type:`boolean`,description:`Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no matching BGP prefix in the Magic routing table. When true, Cloudflare will automatically withdraw the BGP prefix when there are no matching BGP routes, and will resume advertising when there is at least one matching BGP route.`}).option(`on-demand-advertised`,{type:`boolean`,description:`The on_demand.advertised 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 ce={command:`edit <bgp-prefix-id>`,describe:`Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn).`,builder:se,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes bgp-prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/prefixes/${e[`bgp-prefix-id`]==null?`<bgp-prefix-id>`:encodeURIComponent(String(e[`bgp-prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``),"bgp-prefix-id":String(e[`bgp-prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({asn_prepend_count:e[`asn-prepend-count`],auto_advertise_withdraw:e[`auto-advertise-withdraw`],on_demand:{advertised:e[`on-demand-advertised`]}}):a(e.body)});return}let r=await i(e),u=e.local?f:await t();if(e.accountId=u,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.addressing.prefixes.bgpPrefixes.edit({...t,account_id:u,prefix_id:e[`prefix-id`],bgp_prefix_id:e[`bgp-prefix-id`]})),{successLabel:`Updated`});return}let d=o({asn_prepend_count:e[`asn-prepend-count`],auto_advertise_withdraw:e[`auto-advertise-withdraw`],on_demand:{advertised:e[`on-demand-advertised`]}});s(await l(`Updating`,async()=>r.addressing.prefixes.bgpPrefixes.edit({...d,account_id:u,prefix_id:e[`prefix-id`],bgp_prefix_id:e[`bgp-prefix-id`]})),{successLabel:`Updated`})}};function le(e){return e.positional(`bgp-prefix-id`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <bgp-prefix-id>`,describe:`Retrieve a single BGP Prefix according to its identifier`,builder:le,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes bgp-prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/prefixes/${e[`bgp-prefix-id`]==null?`<bgp-prefix-id>`:encodeURIComponent(String(e[`bgp-prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``),"bgp-prefix-id":String(e[`bgp-prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.bgpPrefixes.get({account_id:a,prefix_id:e[`prefix-id`],bgp_prefix_id:e[`bgp-prefix-id`]})),{successLabel:`Loaded`})}};function de(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to control which specific subnets are advertised to the Internet. It is possible to advertise subnets more specific than an IP Prefix by creating more specific BGP Prefixes.`,builder:de,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes bgp-prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bgp/prefixes`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.bgpPrefixes.list({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Loaded`})}},pe={command:`bgp-prefixes`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(ie).command(oe).command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.option(`asn`,{type:`number`,description:`Autonomous System Number (ASN) the prefix will be advertised under.`}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`delegate-loa-creation`,{type:`boolean`,description:`Whether Cloudflare is allowed to generate the LOA document on behalf of the prefix owner.`,default:!1}).option(`description`,{type:`string`,description:`Description of the prefix.`}).option(`loa-document-id`,{type:`string`,description:`Identifier for the uploaded LOA document.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const he={command:`create`,describe:`Add a new prefix under the account.`,builder:me,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({asn:e.asn,cidr:u(e.cidr,`cidr`,`text`),delegate_loa_creation:e[`delegate-loa-creation`],description:u(e.description,`description`,`text`),loa_document_id:u(e[`loa-document-id`],`loa-document-id`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.addressing.prefixes.create({...t,account_id:d})),{successLabel:`Created`});return}if(e.asn===void 0)throw Error(`--asn is required (or pass --body with this field set).`);e.cidr===void 0&&(e.cidr=await p(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let m=o({asn:e.asn,cidr:u(e.cidr,`cidr`,`text`),delegate_loa_creation:e[`delegate-loa-creation`],description:u(e.description,`description`,`text`),loa_document_id:u(e[`loa-document-id`],`loa-document-id`,`text`)});s(await l(`Creating`,async()=>r.addressing.prefixes.create({...m,account_id:d})),{successLabel:`Created`})}};function ge(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`delegated-account-id`,{type:`string`,description:`Account identifier for the account to which prefix is being delegated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`create <prefix-id>`,describe:`Create a new account delegation for a given IP prefix.`,builder:ge,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes delegations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/delegations`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({cidr:u(e.cidr,`cidr`,`text`),delegated_account_id:u(e[`delegated-account-id`],`delegated-account-id`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.addressing.prefixes.delegations.create({...t,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Created`});return}e.cidr===void 0&&(e.cidr=await p(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),e[`delegated-account-id`]===void 0&&(e[`delegated-account-id`]=await p(`delegated-account-id`,`Account identifier for the account to which prefix is being delegated.`));let m=o({cidr:u(e.cidr,`cidr`,`text`),delegated_account_id:u(e[`delegated-account-id`],`delegated-account-id`,`text`)});s(await l(`Creating`,async()=>r.addressing.prefixes.delegations.create({...m,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Created`})}};function ve(e){return e.positional(`delegation-id`,{type:`string`,description:`Identifier of a Delegation.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ye={command:`delete <delegation-id>`,describe:`Delete an account delegation for a given IP prefix.`,builder:ve,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes delegations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/delegations/${e[`delegation-id`]==null?`<delegation-id>`:encodeURIComponent(String(e[`delegation-id`]))}`,pathParams:{"delegation-id":String(e[`delegation-id`]??``),"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
8
+ `);return}s(await l(`Deleting`,async()=>r.addressing.prefixes.delegations.delete({account_id:a,prefix_id:e[`prefix-id`],delegation_id:e[`delegation-id`]})),{successLabel:`Deleted`})}};function be(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`list`,describe:`List all delegations for a given account IP prefix.`,builder:be,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes delegations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/delegations`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.delegations.list({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Loaded`})}},Se={command:`delegations`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(_e).command(ye).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 we={command:`delete <prefix-id>`,describe:`Delete an unapproved prefix owned by the account.`,builder:Ce,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
9
+ `);return}s(await l(`Deleting`,async()=>r.addressing.prefixes.delete({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Deleted`})}};function Te(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the prefix.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`edit <prefix-id>`,describe:`Modify the description for a prefix owned by the account.`,builder:Te,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({description:u(e.description,`description`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.addressing.prefixes.edit({...t,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await p(`description`,`Description of the prefix.`));let m=o({description:u(e.description,`description`,`text`)});s(await l(`Updating`,async()=>r.addressing.prefixes.edit({...m,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Updated`})}};function De(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`get <prefix-id>`,describe:`List a particular prefix owned by the account.`,builder:De,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.get({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Loaded`})}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`list`,describe:`List all prefixes owned by the account.`,builder:ke,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.list({account_id:a})),{successLabel:`Loaded`})}};function je(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`service-id`,{type:`string`,description:`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the
10
+ **List Services** endpoint.
11
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Me={command:`create <prefix-id>`,describe:`Creates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. **NOTE:** The first Service Binding created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent Service Bindings may be created with a more-specific CIDR. Refer to the [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) for compatibility details.`,builder:je,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes service-bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bindings`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({cidr:u(e.cidr,`cidr`,`text`),service_id:u(e[`service-id`],`service-id`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.addressing.prefixes.serviceBindings.create({...t,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Created`});return}e.cidr===void 0&&(e.cidr=await p(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),e[`service-id`]===void 0&&(e[`service-id`]=await p(`service-id`,`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the **List Services** endpoint. `));let m=o({cidr:u(e.cidr,`cidr`,`text`),service_id:u(e[`service-id`],`service-id`,`text`)});s(await l(`Creating`,async()=>r.addressing.prefixes.serviceBindings.create({...m,account_id:d,prefix_id:e[`prefix-id`]})),{successLabel:`Created`})}};function Ne(e){return e.positional(`binding-id`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 Pe={command:`delete <binding-id>`,describe:`Delete a Service Binding`,builder:Ne,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes service-bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bindings/${e[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(e[`binding-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``),"binding-id":String(e[`binding-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
12
+ `);return}s(await l(`Deleting`,async()=>r.addressing.prefixes.serviceBindings.delete({account_id:a,prefix_id:e[`prefix-id`],binding_id:e[`binding-id`]})),{successLabel:`Deleted`})}};function $(e){return e.positional(`binding-id`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`get <binding-id>`,describe:`Fetch a single Service Binding`,builder:$,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes service-bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bindings/${e[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(e[`binding-id`]))}`,pathParams:{"prefix-id":String(e[`prefix-id`]??``),"binding-id":String(e[`binding-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.serviceBindings.get({account_id:a,prefix_id:e[`prefix-id`],binding_id:e[`binding-id`]})),{successLabel:`Loaded`})}};function Ie(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`list`,describe:"List the Cloudflare services this prefix is currently bound to. Traffic sent to an address within an IP prefix will be routed to the Cloudflare service of the most-specific Service Binding matching the address. **Example:** binding `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other IPs in the prefix to Cloudflare Magic Transit.",builder:Ie,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes service-bindings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/bindings`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.prefixes.serviceBindings.list({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Loaded`})}},Re={command:`service-bindings`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(Me).command(Pe).command(Fe).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`create <prefix-id>`,describe:`Triggers a new prefix validation. The checks are run asynchronously and include IRR, RPKI, and prefix ownership.`,builder:ze,handler:async e=>{if(e.dryRun){c({command:`cf addressing prefixes validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/prefixes/${e[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(e[`prefix-id`]))}/validate`,pathParams:{"prefix-id":String(e[`prefix-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Creating`,async()=>r.addressing.prefixes.validate.create({account_id:a,prefix_id:e[`prefix-id`]})),{successLabel:`Created`})}},Ve={command:`validate`,describe:`Additional IP prefix operations — BGP prefix deletion and prefix validation`,builder:e=>e.command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`prefixes`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(he).command(we).command(Ee).command(Oe).command(Ae).command(ne).command(pe).command(Se).command(Re).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ue(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`list`,describe:`Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a service running on the Cloudflare network to enable a Cloudflare product on the IP addresses. This endpoint can be used as a reference of available services on the Cloudflare network, and their service IDs.`,builder:Ue,handler:async e=>{if(e.dryRun){c({command:`cf addressing services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/addressing/services`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.addressing.services.list({account_id:a})),{successLabel:`Loaded`})}},Ge={command:`services`,describe:`Cloudflare services (CDN, Spectrum, Magic Transit) that IP prefixes can be bound to`,builder:e=>e.command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ke={command:`addressing`,describe:`IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control`,builder:e=>e.command(B).command(U).command(J).command(He).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ke as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./output-CUxZRM5A.mjs";import{n as t}from"./metadata-jh2EIan8.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`products`in e&&`universal`in e&&typeof e.version==`string`&&typeof e.universal==`string`&&typeof e.products==`object`}const r={command:`agent-context [product]`,describe:`Output agent context and skill files`,builder:e=>e.positional(`product`,{describe:`Product name (e.g., d1, dns, zones)`,type:`string`}).option(`list`,{type:`boolean`,describe:`List available products`,default:!1}),handler:async r=>{let i=t(import.meta.url,`agent-context.json`,n);if(i||(console.error("Error: Could not load agent context. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.keys(i.products));return}if(r.product){let e=i.products[r.product];if(!e){let e=Object.keys(i.products).join(`, `);console.error(`Product "${r.product}" not found. Available: ${e}`),process.exit(1)}console.log(i.universal+`
2
+ import{t as e}from"./output-B6fBFRqe.mjs";import{n as t}from"./metadata-MPDDi08e.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`products`in e&&`universal`in e&&typeof e.version==`string`&&typeof e.universal==`string`&&typeof e.products==`object`}const r={command:`agent-context [product]`,describe:`Output agent context and skill files`,builder:e=>e.positional(`product`,{describe:`Product name (e.g., d1, dns, zones)`,type:`string`}).option(`list`,{type:`boolean`,describe:`List available products`,default:!1}),handler:async r=>{let i=t(import.meta.url,`agent-context.json`,n);if(i||(console.error("Error: Could not load agent context. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.keys(i.products));return}if(r.product){let e=i.products[r.product];if(!e){let e=Object.keys(i.products).join(`, `);console.error(`Product "${r.product}" not found. Available: ${e}`),process.exit(1)}console.log(i.universal+`
3
3
 
4
4
  `+e);return}console.log(i.universal+`
5
5