cf 0.0.6 → 0.1.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 (273) hide show
  1. package/README.md +2 -4
  2. package/bin/cf +11 -0
  3. package/dist/_meta/agent-context.json +7 -7
  4. package/dist/_meta/commands.json +9051 -1085
  5. package/dist/abuse-reports-ChV_yD7f.mjs +8 -0
  6. package/dist/accounts-BCYecXFh.mjs +21 -0
  7. package/dist/acm-DD8zSds2.mjs +3 -0
  8. package/dist/addressing-D4Eqw5Bi.mjs +13 -0
  9. package/dist/{agent-context-BBJnI_Q7.mjs → agent-context-D26woB9J.mjs} +1 -1
  10. package/dist/ai-DfXMOMx_.mjs +2 -0
  11. package/dist/ai-gateway-DdRFthMo.mjs +8 -0
  12. package/dist/ai-search-C_68CDj1.mjs +7 -0
  13. package/dist/alerting-DbhqhVCp.mjs +6 -0
  14. package/dist/analytics-BSBBc7ep.mjs +20 -0
  15. package/dist/api-gateway-CZ4swbkQ.mjs +33 -0
  16. package/dist/argo-tms9ZwHO.mjs +2 -0
  17. package/dist/audit-logs-24qyW8cl.mjs +2 -0
  18. package/dist/auth-BlSmtIKd.mjs +112 -0
  19. package/dist/auth-DQ8miey6.mjs +6 -0
  20. package/dist/autorag-kgNt06GD.mjs +2 -0
  21. package/dist/billing-lwBHNTXC.mjs +2 -0
  22. package/dist/body-parser-Br-BoYk-.mjs +2 -0
  23. package/dist/bot-management-LKf7BqUr.mjs +5 -0
  24. package/dist/botnet-feed-nQ-gErTS.mjs +3 -0
  25. package/dist/brand-protection-DOKv9GRr.mjs +3 -0
  26. package/dist/browser-rendering-CBExtgGt.mjs +4 -0
  27. package/dist/build-C_48VvoK.mjs +1056 -0
  28. package/dist/{builds-B5sC8Gh_.mjs → builds-C_ySULja.mjs} +1 -1
  29. package/dist/cache-BBiiNZHP.mjs +5 -0
  30. package/dist/calls-DA5Xzwev.mjs +4 -0
  31. package/dist/certificate-authorities-sXyR_yGp.mjs +2 -0
  32. package/dist/chunk-DH-VkVmc.mjs +2 -0
  33. package/dist/client-certificates-tV0aCLQJ.mjs +3 -0
  34. package/dist/cloud-connector-DZfHcSso.mjs +2 -0
  35. package/dist/cloudforce-one-y1PgQmI9.mjs +21 -0
  36. package/dist/{completions-BSRqbcrz.mjs → completions-BKrxcfhN.mjs} +1 -1
  37. package/dist/config-BIfdEY0E.mjs +2 -0
  38. package/dist/connectivity-8SOqaFDn.mjs +3 -0
  39. package/dist/content-scanning-B9y6K_G5.mjs +4 -0
  40. package/dist/context-DTIbtQn5.mjs +2 -0
  41. package/dist/custom-certificates-sWksR8Ys.mjs +5 -0
  42. package/dist/custom-hostnames-91QZkdqN.mjs +5 -0
  43. package/dist/custom-nameservers-DajZaZvE.mjs +3 -0
  44. package/dist/custom-pages-Cu7gmwzT.mjs +4 -0
  45. package/dist/d1-H_VRsVmF.mjs +3 -0
  46. package/dist/dcv-delegation-C-qhEYEZ.mjs +2 -0
  47. package/dist/delegate.mjs +2 -0
  48. package/dist/deploy--9wYOkHg.mjs +2 -0
  49. package/dist/dev-BfKYB-R_.mjs +6 -0
  50. package/dist/diagnostics-D2B2LPZZ.mjs +3 -0
  51. package/dist/dispatch-namespaces-CyrXBU_w.mjs +7 -0
  52. package/dist/dist-C_bu5HwZ.mjs +82 -0
  53. package/dist/dist-DvKjT2TT.mjs +303 -0
  54. package/dist/dns-Bn9Uz_Nj.mjs +29 -0
  55. package/dist/dns-firewall-BslP4p-j.mjs +57 -0
  56. package/dist/durable-objects-BN1ZnHhm.mjs +2 -0
  57. package/dist/email-routing-n2TnTaRR.mjs +10 -0
  58. package/dist/email-security-C9SEx0kh.mjs +60 -0
  59. package/dist/email-sending-DayZ7u3I.mjs +3 -0
  60. package/dist/filters-CI_XTgfQ.mjs +4 -0
  61. package/dist/firewall-CcaayGig.mjs +11 -0
  62. package/dist/fraud-Cr7aPCV8.mjs +8 -0
  63. package/dist/google-tag-gateway-B3GpYgQ4.mjs +2 -0
  64. package/dist/healthchecks-CVTsR_OC.mjs +4 -0
  65. package/dist/hostnames-Bd_Wa5l6.mjs +3 -0
  66. package/dist/hyperdrive-BBJhEDZd.mjs +18 -0
  67. package/dist/iam-D_FN0pDF.mjs +6 -0
  68. package/dist/images-CAP2hAlZ.mjs +5 -0
  69. package/dist/index.mjs +1 -1
  70. package/dist/input-validation-zEO81MWN.mjs +2 -0
  71. package/dist/intel-CkxfzqmJ.mjs +3 -0
  72. package/dist/ips-B0cK7D0_.mjs +2 -0
  73. package/dist/keyless-certificates-LcLmHZsX.mjs +3 -0
  74. package/dist/kv-_TkUQ6fs.mjs +5 -0
  75. package/dist/leaked-credential-checks-Dhvaen22.mjs +3 -0
  76. package/dist/lib-Eu1wXxuh.mjs +68 -0
  77. package/dist/load-balancers-Ckr0UIpk.mjs +6 -0
  78. package/dist/local-VJaJ3BZ1.mjs +2 -0
  79. package/dist/logpush-Cj946hxT.mjs +4 -0
  80. package/dist/logs-DgC9hjvJ.mjs +3 -0
  81. package/dist/magic-cloud-networking-WbDvPzuG.mjs +5 -0
  82. package/dist/magic-network-monitoring-BcHShvGQ.mjs +4 -0
  83. package/dist/magic-transit-B8sCOkt_.mjs +89 -0
  84. package/dist/managed-transforms-BpOr-8HY.mjs +3 -0
  85. package/dist/mtls-certificates-fOul8D5g.mjs +3 -0
  86. package/dist/network-interconnects-BSW65xlh.mjs +36 -0
  87. package/dist/organizations-T4vKGFAb.mjs +41 -0
  88. package/dist/origin-ca-certificates-ChM0lZ64.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-C7o26ARh.mjs +2 -0
  90. package/dist/origin-tls-client-auth-D32dpZk_.mjs +5 -0
  91. package/dist/{output-CqGQp2r6.mjs → output-D7_yAFVR.mjs} +1 -1
  92. package/dist/page-rules-RFoj8CjN.mjs +18 -0
  93. package/dist/page-shield-VTktzKDN.mjs +37 -0
  94. package/dist/pages-L1ITjXDZ.mjs +10 -0
  95. package/dist/pipelines-BPO0Lnil.mjs +6 -0
  96. package/dist/progress-DZfTxbrx.mjs +2 -0
  97. package/dist/queues-B0C06L9r.mjs +6 -0
  98. package/dist/r2-DP020Tmq.mjs +21 -0
  99. package/dist/r2-data-catalog-Dmipvz5F.mjs +14 -0
  100. package/dist/radar-DR3VMknH.mjs +2 -0
  101. package/dist/rate-limits-DnHPBPgU.mjs +5 -0
  102. package/dist/raw-fetch-DlXYwVA8.mjs +2 -0
  103. package/dist/realtime-kit-C430aq2d.mjs +6 -0
  104. package/dist/registrar-7Qy50zbW.mjs +46 -0
  105. package/dist/request-tracers-sv99NDIl.mjs +2 -0
  106. package/dist/resolve-BuJRWSk0.mjs +2 -0
  107. package/dist/resource-sharing-uEjC7lnQ.mjs +5 -0
  108. package/dist/resource-tagging-CiODdP3N.mjs +16 -0
  109. package/dist/rules-FXAyTrwk.mjs +4 -0
  110. package/dist/rulesets-B6aUsFFB.mjs +8 -0
  111. package/dist/rum-CyyGJhp5.mjs +4 -0
  112. package/dist/{schema-qJlCfmo8.mjs → schema-D0_cbcDt.mjs} +1 -1
  113. package/dist/schema-validation-ByU49h--.mjs +4 -0
  114. package/dist/scim-DdTS65_C.mjs +3 -0
  115. package/dist/{scm-C872x0C2.mjs → scm-CilfPOue.mjs} +1 -1
  116. package/dist/secrets-store-ClOUVhBJ.mjs +18 -0
  117. package/dist/security-center-4iSBqTrf.mjs +2 -0
  118. package/dist/security-txt-kGxdkDY6.mjs +3 -0
  119. package/dist/session-mW-s8ghP.mjs +2 -0
  120. package/dist/smart-shield-B-SQd2Qp.mjs +3 -0
  121. package/dist/snippets-Aq58ojqw.mjs +4 -0
  122. package/dist/spawn-D_cjG87Z.mjs +10 -0
  123. package/dist/spectrum-0gFvGI6y.mjs +59 -0
  124. package/dist/speed-DAZU8w3T.mjs +4 -0
  125. package/dist/src-C5qivNKH.mjs +108 -0
  126. package/dist/ssl-BRlXa-5w.mjs +15 -0
  127. package/dist/stream-BAxsVeBX.mjs +14 -0
  128. package/dist/tenants-Df6xDqoA.mjs +2 -0
  129. package/dist/{theme-BKCxTQTe.mjs → theme-BklJDrb2.mjs} +2 -2
  130. package/dist/token-validation-pO4dCjCy.mjs +4 -0
  131. package/dist/{tools-CawscCBu.mjs → tools-CtKbk6VS.mjs} +1 -1
  132. package/dist/turnstile-B1dmO8wE.mjs +23 -0
  133. package/dist/{ui-Dj3No2vN.mjs → ui-mP_arYIg.mjs} +1 -1
  134. package/dist/url-normalization-sUDVmrUt.mjs +3 -0
  135. package/dist/url-scanner-CwOKRkYo.mjs +2 -0
  136. package/dist/user-D_UrIdNq.mjs +10 -0
  137. package/dist/vectorize-BEbBn9G9.mjs +4 -0
  138. package/dist/{vuln-scanner-B1VwCIko.mjs → vuln-scanner-Br_2lQp1.mjs} +1 -1
  139. package/dist/waiting-rooms-BQC-urV4.mjs +11 -0
  140. package/dist/web3-CIH2iQeX.mjs +4 -0
  141. package/dist/workers-B9EvrpH3.mjs +16 -0
  142. package/dist/workers-builds-DzWSiRd2.mjs +7 -0
  143. package/dist/workflows-aD81gA4k.mjs +4 -0
  144. package/dist/zaraz-Cg1dsvrZ.mjs +2 -0
  145. package/dist/zero-trust-D-xQXWcy.mjs +119 -0
  146. package/dist/zones-DQzucJDd.mjs +28 -0
  147. package/package.json +13 -3
  148. package/dist/abuse-reports-DR0yMg-Q.mjs +0 -2
  149. package/dist/accounts-BjGtCB8T.mjs +0 -6
  150. package/dist/acm-h4YPDN7k.mjs +0 -3
  151. package/dist/addressing-BiEnQ1o1.mjs +0 -11
  152. package/dist/ai-BPln2Yka.mjs +0 -2
  153. package/dist/ai-gateway-DgD9nKyd.mjs +0 -8
  154. package/dist/ai-search-EjrONI5a.mjs +0 -7
  155. package/dist/alerting-CPWMKr-m.mjs +0 -6
  156. package/dist/analytics-3dX9-scQ.mjs +0 -2
  157. package/dist/api-gateway-7FKFHdI-.mjs +0 -9
  158. package/dist/argo-Dxz9P37E.mjs +0 -2
  159. package/dist/audit-logs-D_Xw5x8Y.mjs +0 -2
  160. package/dist/auth-BHD_B2p9.mjs +0 -277
  161. package/dist/auth-caVo2j1K.mjs +0 -6
  162. package/dist/autorag-D7nMweNF.mjs +0 -2
  163. package/dist/billing-yaIBp1Xq.mjs +0 -2
  164. package/dist/body-parser-iA3vRFmh.mjs +0 -2
  165. package/dist/bot-management-C0H6U0t4.mjs +0 -2
  166. package/dist/botnet-feed-BXV9GVwF.mjs +0 -3
  167. package/dist/brand-protection-CI0NQa_l.mjs +0 -3
  168. package/dist/browser-rendering-DnKNRJJe.mjs +0 -4
  169. package/dist/cache-B6M_pm_D.mjs +0 -5
  170. package/dist/calls-C5XCC0i1.mjs +0 -4
  171. package/dist/certificate-authorities-BQuHL4dm.mjs +0 -2
  172. package/dist/client-certificates-CwpzEnCT.mjs +0 -3
  173. package/dist/cloud-connector-CU3PLNLe.mjs +0 -2
  174. package/dist/cloudforce-one-DzrArr1o.mjs +0 -21
  175. package/dist/config-BmTd_qeU.mjs +0 -2
  176. package/dist/connectivity-C4tXPkW_.mjs +0 -3
  177. package/dist/content-scanning-CH_YXdlZ.mjs +0 -4
  178. package/dist/context-6lBIck1r.mjs +0 -2
  179. package/dist/custom-certificates-pllRyU2y.mjs +0 -3
  180. package/dist/custom-hostnames-GmF0DfYA.mjs +0 -5
  181. package/dist/custom-nameservers-DPVHUlUQ.mjs +0 -3
  182. package/dist/custom-pages-XWwfn7hV.mjs +0 -4
  183. package/dist/d1-c_zhZGWf.mjs +0 -3
  184. package/dist/dcv-delegation-pXpU48A8.mjs +0 -2
  185. package/dist/dev-Bu26u5Jm.mjs +0 -14
  186. package/dist/diagnostics-BU07Jnku.mjs +0 -3
  187. package/dist/dispatch-namespaces-D_Kq_2gX.mjs +0 -7
  188. package/dist/dns-CrvIxztB.mjs +0 -11
  189. package/dist/dns-firewall-CLtGAQ9x.mjs +0 -3
  190. package/dist/dry-run-FV0pZwdg.mjs +0 -2
  191. package/dist/durable-objects-Y5rLFSQX.mjs +0 -2
  192. package/dist/email-routing-CxU5JlXT.mjs +0 -10
  193. package/dist/email-security-CnpAHWpj.mjs +0 -8
  194. package/dist/email-sending-MeCKsktR.mjs +0 -3
  195. package/dist/filters-Sx2Po1UP.mjs +0 -4
  196. package/dist/firewall-B0_012XO.mjs +0 -9
  197. package/dist/fraud-CG0G_VG-.mjs +0 -2
  198. package/dist/google-tag-gateway-BLbj1y3h.mjs +0 -2
  199. package/dist/healthchecks-C0LgExxa.mjs +0 -4
  200. package/dist/hostnames-D4K6s9EX.mjs +0 -3
  201. package/dist/hyperdrive-D7XvTRys.mjs +0 -3
  202. package/dist/iam-4LhJianW.mjs +0 -6
  203. package/dist/images-BqXyIycX.mjs +0 -5
  204. package/dist/input-validation-BpVQi9rR.mjs +0 -2
  205. package/dist/intel-CiO3Sy4x.mjs +0 -3
  206. package/dist/ips-DLuGN7Mr.mjs +0 -2
  207. package/dist/keyless-certificates-x-87T5SM.mjs +0 -3
  208. package/dist/kv-CVYCrk7L.mjs +0 -5
  209. package/dist/leaked-credential-checks-FvhVCL23.mjs +0 -3
  210. package/dist/load-balancers-cxodJuI2.mjs +0 -6
  211. package/dist/local-OqhVQbv0.mjs +0 -2
  212. package/dist/logpush-BX7z2xWz.mjs +0 -4
  213. package/dist/logs-C7vxr6Kp.mjs +0 -3
  214. package/dist/magic-cloud-networking-C3grROf-.mjs +0 -5
  215. package/dist/magic-network-monitoring-DiZ5ZXxh.mjs +0 -4
  216. package/dist/magic-transit-troGMFb9.mjs +0 -30
  217. package/dist/managed-transforms-B5w_LlVN.mjs +0 -3
  218. package/dist/mtls-certificates-C1S9MciH.mjs +0 -3
  219. package/dist/network-interconnects-CVSiv1fF.mjs +0 -4
  220. package/dist/organizations-BtlEchi-.mjs +0 -4
  221. package/dist/origin-ca-certificates-0XCi4dO6.mjs +0 -3
  222. package/dist/origin-post-quantum-encryption-CTvkdYDG.mjs +0 -2
  223. package/dist/origin-tls-client-auth-qAvRD1BQ.mjs +0 -5
  224. package/dist/page-rules-CcMmrvY4.mjs +0 -3
  225. package/dist/page-shield-Dxh4bJ-w.mjs +0 -3
  226. package/dist/pages-F1vdzqgC.mjs +0 -6
  227. package/dist/pipelines-DsF1HHMY.mjs +0 -6
  228. package/dist/progress-5sHFvwez.mjs +0 -2
  229. package/dist/queues-BuvkxFPX.mjs +0 -6
  230. package/dist/r2-Du-fgHiT.mjs +0 -9
  231. package/dist/r2-data-catalog-BUiMNSwc.mjs +0 -3
  232. package/dist/radar-C0eqNmWR.mjs +0 -2
  233. package/dist/rate-limits-CUv2cxXV.mjs +0 -3
  234. package/dist/raw-fetch-CxFs4i0R.mjs +0 -2
  235. package/dist/realtime-kit-C-jix3I_.mjs +0 -6
  236. package/dist/registrar-B7V7i89n.mjs +0 -2
  237. package/dist/request-tracers-D2V7QUrC.mjs +0 -2
  238. package/dist/resolve-GtphSYWh.mjs +0 -2
  239. package/dist/resource-sharing-BgH0w9wm.mjs +0 -5
  240. package/dist/resource-tagging-BOknFugv.mjs +0 -4
  241. package/dist/rolldown-runtime-CR7SCCRW.mjs +0 -2
  242. package/dist/rules-DzJFHGW1.mjs +0 -4
  243. package/dist/rulesets-BzI1dUiq.mjs +0 -8
  244. package/dist/rum-CQ_rJ96u.mjs +0 -4
  245. package/dist/schema-validation-TmikfxS9.mjs +0 -4
  246. package/dist/scim-ByZ5kqXS.mjs +0 -3
  247. package/dist/secrets-store-D7HL4VXw.mjs +0 -8
  248. package/dist/security-center-OUrILUnx.mjs +0 -2
  249. package/dist/security-txt-Ca13oCJ8.mjs +0 -3
  250. package/dist/session-Dxi_LbAk.mjs +0 -2
  251. package/dist/smart-shield-foPT0J9L.mjs +0 -3
  252. package/dist/snippets-FDPiBMWc.mjs +0 -4
  253. package/dist/spectrum-DPoh_BPx.mjs +0 -3
  254. package/dist/speed-BuEappVX.mjs +0 -4
  255. package/dist/src-D8_cWUwt.mjs +0 -104
  256. package/dist/ssl-bJbzEoRv.mjs +0 -3
  257. package/dist/stream-DuYGiGk6.mjs +0 -13
  258. package/dist/tenants-BYqEutrr.mjs +0 -2
  259. package/dist/token-validation-DwmtbWUB.mjs +0 -4
  260. package/dist/turnstile-Dy91RVTn.mjs +0 -3
  261. package/dist/url-normalization-DoD9iHWH.mjs +0 -3
  262. package/dist/url-scanner-qwL64FIo.mjs +0 -2
  263. package/dist/user-Cduf3VRi.mjs +0 -7
  264. package/dist/vectorize-CMLobU9V.mjs +0 -4
  265. package/dist/waiting-rooms-B4-IAJeT.mjs +0 -5
  266. package/dist/web3-Bcx68Kq3.mjs +0 -4
  267. package/dist/workers-D5fOQsUA.mjs +0 -16
  268. package/dist/workers-builds-2kdzxjlN.mjs +0 -7
  269. package/dist/workflows-qFD80noW.mjs +0 -4
  270. package/dist/zaraz-C0iJimA4.mjs +0 -2
  271. package/dist/zero-trust-Btix6zOy.mjs +0 -73
  272. package/dist/zones-Nu3wMtds.mjs +0 -5
  273. /package/dist/{metadata-DhSO1vle.mjs → metadata-DGdCpUxn.mjs} +0 -0
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import{f as e,l as t,m as n,p as r,t as i}from"./auth-BlSmtIKd.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-DZfTxbrx.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`trigger`,describe:`Triggeres a new activation check for a PENDING Zone. This can be triggered every 5 min for paygo/ent customers, every hour for FREE Zones.`,builder:d,handler:async e=>{if(e.dryRun){c({command:`cf zones activation-check trigger`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/activation_check`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Updating`,async()=>n.zones.activationCheck.trigger(r)),{successLabel:`Updated`})}},te={command:`activation-check`,describe:`Operations for activation-check`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`edit`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf zones aegis edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/aegis`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{valueEnabled:e.valueEnabled,valuePoolId:e.valuePoolId,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/aegis`,{body:t})),{successLabel:`Updated`});return}let r={};e.valueEnabled!==void 0&&a(r,[`value`,`enabled`],e.valueEnabled),e.valuePoolId!==void 0&&a(r,[`value`,`pool_id`],u(e.valuePoolId,`valuePoolId`,`text`)),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/aegis`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:m,handler:async e=>{if(e.dryRun){c({command:`cf zones aegis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/aegis`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.aegis.get(r)),{successLabel:`Loaded`})}},g={command:`aegis`,describe:`Aegis operations`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`name`,{type:`string`,description:`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial zone is
3
+ typically a partner-hosted zone or a CNAME setup.
4
+ `,choices:[`full`,`partial`,`secondary`,`internal`],default:`full`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create Zone`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},bodyKind:`json`,body:{name:e.name,type:e.type,body:e.body}});return}let t=await i(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/zones`,{body:n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await n(`name`,`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`));let r={};e.name!==void 0&&a(r,[`name`],u(e.name,`name`,`text`)),e.type!==void 0&&a(r,[`type`],u(e.type,`type`,`text`)),s(await l(`Creating`,async()=>t.post(`/zones`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function y(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`delete`,describe:`Deletes an existing zone.`,builder:y,handler:async n=>{if(n.dryRun){c({command:`cf zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(n.zoneId??``)},bodyKind:`json`,body:{body:n.body}});return}let r=await i(n),a=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=a,!await e({force:!!n.force})){process.stderr.write(`Aborted.
5
+ `);return}if(n.body){let e=o(n.body);s(await l(`Deleting`,async()=>r.delete(`/zones/${n.zoneId}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>r.zones.delete(a)),{successLabel:`Deleted`})}};function x(e){return e.option(`paused`,{type:`boolean`,description:`Indicates whether the zone is only using Cloudflare DNS services. A
6
+ true value means the zone will not receive security or performance
7
+ benefits.
8
+ `,default:!1}).option(`plan-id`,{type:`string`,description:`Identifier`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial
9
+ zone is typically a partner-hosted zone or a CNAME setup. This
10
+ parameter is only available to Enterprise customers or if it has
11
+ been explicitly enabled on a zone.
12
+ `,choices:[`full`,`partial`,`secondary`,`internal`]}).option(`vanity-name-servers`,{type:`string`,array:!0,description:`An array of domains used for custom name servers. This is only
13
+ available for Business and Enterprise plans.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit`,describe:`Edits a zone. Only one zone property can be changed at a time.`,builder:x,handler:async e=>{if(e.dryRun){c({command:`cf zones edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{paused:e.paused,planId:e.planId,type:e.type,vanityNameServers:e.vanityNameServers,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}`,{body:t})),{successLabel:`Updated`});return}let r={};e.paused!==void 0&&a(r,[`paused`],e.paused),e.planId!==void 0&&a(r,[`plan`,`id`],u(e.planId,`planId`,`text`)),e.type!==void 0&&a(r,[`type`],u(e.type,`type`,`text`)),e.vanityNameServers!==void 0&&a(r,[`vanity_name_servers`],e.vanityNameServers),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create zone environments`,builder:C,handler:async e=>{if(e.dryRun){c({command:`cf zones environments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/environments`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/zones/${e.zoneId}/environments`,{body:t})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>n.zones.environments.create(r)),{successLabel:`Created`})}};function T(e){return e.positional(`environmentId`,{type:`string`,description:`Environment ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <environmentId>`,describe:`Delete zone environment`,builder:T,handler:async n=>{if(n.dryRun){c({command:`cf zones environments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}/environments/${n.environmentId??`<environmentId>`}`,pathParams:{zoneId:String(n.zoneId??``),environmentId:String(n.environmentId??``)},bodyKind:`none`});return}let r=await i(n),a=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=a,!await e({force:!!n.force})){process.stderr.write(`Aborted.
14
+ `);return}s(await l(`Deleting`,async()=>r.zones.environments.delete(a,n.environmentId)),{successLabel:`Deleted`})}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`edit`,describe:`Partially update zone environments`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf zones environments edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/environments`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/environments`,{body:t})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>n.zones.environments.edit(r)),{successLabel:`Updated`})}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List zone environments`,builder:k,handler:async e=>{if(e.dryRun){c({command:`cf zones environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/environments`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.environments.list(r)),{successLabel:`Loaded`})}};function j(e){return e.positional(`environmentId`,{type:`string`,description:`Environment ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`rollback <environmentId>`,describe:`Roll back zone environment`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf zones environments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/environments/${e.environmentId??`<environmentId>`}/rollback`,pathParams:{zoneId:String(e.zoneId??``),environmentId:String(e.environmentId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>n.zones.environments.rollback(r,e.environmentId)),{successLabel:`Created`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`update`,describe:`Upsert zone environments`,builder:N,handler:async e=>{if(e.dryRun){c({command:`cf zones environments update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/environments`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body}});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.put(`/zones/${e.zoneId}/environments`,{body:t})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>n.zones.environments.update(r)),{successLabel:`Updated`})}},F={command:`environments`,describe:`Operations for environments`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`],default:`off`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`edit`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf zones fonts edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/fonts`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{value:e.value,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/fonts`,{body:t})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await r(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let d={};e.value!==void 0&&a(d,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/fonts`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};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:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf zones fonts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/fonts`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.fonts.get(r)),{successLabel:`Loaded`})}},B={command:`fonts`,describe:`Fonts operations`,builder:e=>e.command(L).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:`get`,describe:`Zone Details`,builder:V,handler:async e=>{if(e.dryRun){c({command:`cf zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.get(r)),{successLabel:`Loaded`})}};function U(e){return e.option(`include-subdomains`,{type:`boolean`,description:`If provided, the zone hold will extend to block any subdomain of the given zone, as well
15
+ as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
16
+ 'example.com' and include_subdomains=true will block 'example.com',
17
+ 'staging.example.com', 'api.staging.example.com', etc.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`create`,describe:`Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname.`,builder:U,handler:async e=>{let n={include_subdomains:e.includeSubdomains};if(e.dryRun){c({command:`cf zones holds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/hold`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,s(await l(`Creating`,async()=>r.zones.holds.create(a,n)),{successLabel:`Created`})}};function G(e){return e.option(`hold-after`,{type:`string`,description:`If \`hold_after\` is provided, the hold will be temporarily disabled,
18
+ then automatically re-enabled by the system at the time specified
19
+ in this RFC3339-formatted timestamp. Otherwise, the hold will be
20
+ disabled indefinitely.`}).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`,describe:`Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname.`,builder:G,handler:async n=>{let r={hold_after:n.holdAfter};if(n.dryRun){c({command:`cf zones holds delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}/hold`,pathParams:{zoneId:String(n.zoneId??``)},query:r,bodyKind:`none`});return}let a=await i(n),o=await t({zone:n.zone},a,{quiet:n.quiet});if(n.zoneId=o,!await e({force:!!n.force})){process.stderr.write(`Aborted.
21
+ `);return}s(await l(`Deleting`,async()=>a.zones.holds.delete(o,r)),{successLabel:`Deleted`})}};function q(e){return e.option(`hold-after`,{type:`string`,description:`If \`hold_after\` is provided and future-dated, the hold will be temporarily disabled,
22
+ then automatically re-enabled by the system at the time specified
23
+ in this RFC3339-formatted timestamp. A past-dated \`hold_after\` value will have
24
+ no effect on an existing, enabled hold. Providing an empty string will set its value
25
+ to the current time.`}).option(`include-subdomains`,{type:`boolean`,description:`If \`true\`, the zone hold will extend to block any subdomain of the given zone, as well
26
+ as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
27
+ 'example.com' and include_subdomains=true will block 'example.com',
28
+ 'staging.example.com', 'api.staging.example.com', etc.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`edit`,describe:"Update the `hold_after` and/or `include_subdomains` values on an existing zone hold. The hold is enabled if the `hold_after` date-time value is in the past.",builder:q,handler:async e=>{if(e.dryRun){c({command:`cf zones holds edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/hold`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{holdAfter:e.holdAfter,includeSubdomains:e.includeSubdomains,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/hold`,{body:t})),{successLabel:`Updated`});return}let r={};e.holdAfter!==void 0&&a(r,[`hold_after`],u(e.holdAfter,`holdAfter`,`text`)),e.includeSubdomains!==void 0&&a(r,[`include_subdomains`],e.includeSubdomains),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/hold`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get`,describe:`Retrieve whether the zone is subject to a zone hold, and metadata about the hold.`,builder:Y,handler:async e=>{if(e.dryRun){c({command:`cf zones holds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/hold`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.holds.get(r)),{successLabel:`Loaded`})}},Z={command:`holds`,describe:`Operations for holds`,builder:e=>e.command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`name`,{type:`string`,description:"A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`status`,{type:`string`,description:`Specify a zone status to filter by.`,choices:[`initializing`,`pending`,`active`,`moved`]}).option(`account-id`,{type:`string`,description:`Filter by an account ID.`}).option(`account-name`,{type:`string`,description:"An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`order`,{type:`string`,description:`Field to order zones by.`,choices:[`name`,`status`,`account.id`,`account.name`,`plan.id`]}).option(`direction`,{type:`string`,description:`Direction to order zones.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`Lists, searches, sorts, and filters your zones. Listing zones across more than 500 accounts is currently not allowed.`,builder:Q,handler:async e=>{let t={name:e.name,status:e.status,"account.id":e.accountId,"account.name":e.accountName,page:e.page,per_page:e.perPage,order:e.order,direction:e.direction,match:e.match};if(e.dryRun){c({command:`cf zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.zones.list(t)),{successLabel:`Loaded`})}};function re(e){return e.option(`value`,{type:`number`,description:`Value of the Origin H2 Max Streams Setting.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`edit`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:re,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-h2-max-streams edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/origin_h2_max_streams`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{value:e.value,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/origin_h2_max_streams`,{body:t})),{successLabel:`Updated`});return}if(e.value===void 0)throw Error(`--value is required (or pass --body with this field set).`);let r={};e.value!==void 0&&a(r,[`value`],e.value),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/origin_h2_max_streams`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:ae,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-h2-max-streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/origin_h2_max_streams`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.originH2MaxStreams.get(r)),{successLabel:`Loaded`})}},se={command:`origin-h2-max-streams`,describe:`Origin H2 Max Streams operations`,builder:e=>e.command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Max HTTP Version Setting.`,choices:[`2`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`edit`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:ce,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-max-http-version edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/origin_max_http_version`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{value:e.value,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/origin_max_http_version`,{body:t})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await r(`value`,`Value of the Origin Max HTTP Version Setting.`,[`2`,`1`]));let d={};e.value!==void 0&&a(d,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/origin_max_http_version`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function ue(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:ue,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-max-http-version get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/origin_max_http_version`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.originMaxHTTPVersion.get(r)),{successLabel:`Loaded`})}},fe={command:`origin-max-http-version`,describe:`Origin Max Http Version operations`,builder:e=>e.command(le).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`planIdentifier`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <planIdentifier>`,describe:`Details of the available plan that the zone can subscribe to.`,builder:pe,handler:async e=>{if(e.dryRun){c({command:`cf zones plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/available_plans/${e.planIdentifier??`<planIdentifier>`}`,pathParams:{planIdentifier:String(e.planIdentifier??``),zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.plans.get(e.planIdentifier,r)),{successLabel:`Loaded`})}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Lists available plans the zone can subscribe to.`,builder:he,handler:async e=>{if(e.dryRun){c({command:`cf zones plans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/available_plans`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.plans.list(r)),{successLabel:`Loaded`})}},_e={command:`plans`,describe:`Operations for plans`,builder:e=>e.command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get`,describe:`Lists all rate plans the zone can subscribe to.`,builder:ve,handler:async e=>{if(e.dryRun){c({command:`cf zones rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/available_rate_plans`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.ratePlans.get(r)),{successLabel:`Loaded`})}},be={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`value`,{type:`string`,description:`Value can either be On or Off.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Se={command:`edit`,describe:`Toggles RUM on/off for an existing zone.`,builder:xe,handler:async e=>{if(e.dryRun){c({command:`cf zones rum edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/rum`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{value:e.value,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/rum`,{body:t})),{successLabel:`Updated`});return}let r={};e.value!==void 0&&a(r,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/rum`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function Ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get`,describe:`Retrieves RUM status for a zone.`,builder:Ce,handler:async e=>{if(e.dryRun){c({command:`cf zones rum get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/rum`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.rum.get(r)),{successLabel:`Loaded`})}},Te={command:`rum`,describe:`Rum operations`,builder:e=>e.command(Se).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.positional(`settingId`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`ssl-recommender enrollment setting.`,default:!1}).option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`value-cache-by-device-type`,{type:`boolean`,description:`Indicates whether or not [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) is enabled.`}).option(`value-cf`,{type:`boolean`,description:`Indicates whether or not Cloudflare proxy is enabled.`}).option(`value-hostnames`,{type:`string`,array:!0,description:`An array of hostnames where Automatic Platform Optimization for WordPress is activated.`}).option(`value-wordpress`,{type:`boolean`,description:`Indicates whether or not site is powered by WordPress.`}).option(`value-wp-plugin`,{type:`boolean`,description:`Indicates whether or not [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is installed.`}).option(`value-strict-transport-security-enabled`,{type:`boolean`,description:`Whether or not strict transport security is enabled.`}).option(`value-strict-transport-security-include-subdomains`,{type:`boolean`,description:`Include all subdomains for strict transport security.`}).option(`value-strict-transport-security-max-age`,{type:`number`,description:`Max age in seconds of the strict transport security.`}).option(`value-strict-transport-security-nosniff`,{type:`boolean`,description:`Whether or not to include 'X-Content-Type-Options: nosniff' header.`}).option(`value-strict-transport-security-preload`,{type:`boolean`,description:`Enable automatic preload of the HSTS configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`value-pool-id`,[`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).conflicts(`value-cache-by-device-type`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cache-by-device-type`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`]).conflicts(`value-cf`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cf`,[`value-strict-transport-security-enabled`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-hostnames`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-hostnames`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-cache-by-device-type`]).conflicts(`value-wordpress`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wordpress`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-wp-plugin`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wp-plugin`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-hostnames`,`value-cache-by-device-type`]).implies(`value-strict-transport-security-enabled`,[`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-strict-transport-security-include-subdomains`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-max-age`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-nosniff`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-preload`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`])}const De={command:`edit <settingId>`,describe:`Updates a single zone setting by the identifier`,builder:Ee,handler:async e=>{if(e.dryRun){c({command:`cf zones settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/${e.settingId??`<settingId>`}`,pathParams:{zoneId:String(e.zoneId??``),settingId:String(e.settingId??``)},bodyKind:`json`,body:{enabled:e.enabled,valueEnabled:e.valueEnabled,valuePoolId:e.valuePoolId,valueCacheByDeviceType:e.valueCacheByDeviceType,valueCf:e.valueCf,valueHostnames:e.valueHostnames,valueWordpress:e.valueWordpress,valueWpPlugin:e.valueWpPlugin,valueStrictTransportSecurityEnabled:e.valueStrictTransportSecurityEnabled,valueStrictTransportSecurityIncludeSubdomains:e.valueStrictTransportSecurityIncludeSubdomains,valueStrictTransportSecurityMaxAge:e.valueStrictTransportSecurityMaxAge,valueStrictTransportSecurityNosniff:e.valueStrictTransportSecurityNosniff,valueStrictTransportSecurityPreload:e.valueStrictTransportSecurityPreload,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/${e.settingId}`,{body:t})),{successLabel:`Updated`});return}let r={};e.enabled!==void 0&&a(r,[`enabled`],e.enabled),e.valueEnabled!==void 0&&a(r,[`value`,`enabled`],e.valueEnabled),e.valuePoolId!==void 0&&a(r,[`value`,`pool_id`],u(e.valuePoolId,`valuePoolId`,`text`)),e.valueCacheByDeviceType!==void 0&&a(r,[`value`,`cache_by_device_type`],e.valueCacheByDeviceType),e.valueCf!==void 0&&a(r,[`value`,`cf`],e.valueCf),e.valueHostnames!==void 0&&a(r,[`value`,`hostnames`],e.valueHostnames),e.valueWordpress!==void 0&&a(r,[`value`,`wordpress`],e.valueWordpress),e.valueWpPlugin!==void 0&&a(r,[`value`,`wp_plugin`],e.valueWpPlugin),e.valueStrictTransportSecurityEnabled!==void 0&&a(r,[`value`,`strict_transport_security`,`enabled`],e.valueStrictTransportSecurityEnabled),e.valueStrictTransportSecurityIncludeSubdomains!==void 0&&a(r,[`value`,`strict_transport_security`,`include_subdomains`],e.valueStrictTransportSecurityIncludeSubdomains),e.valueStrictTransportSecurityMaxAge!==void 0&&a(r,[`value`,`strict_transport_security`,`max_age`],e.valueStrictTransportSecurityMaxAge),e.valueStrictTransportSecurityNosniff!==void 0&&a(r,[`value`,`strict_transport_security`,`nosniff`],e.valueStrictTransportSecurityNosniff),e.valueStrictTransportSecurityPreload!==void 0&&a(r,[`value`,`strict_transport_security`,`preload`],e.valueStrictTransportSecurityPreload),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/${e.settingId}`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function Oe(e){return e.positional(`settingId`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get <settingId>`,describe:`Fetch a single zone setting by name`,builder:Oe,handler:async e=>{if(e.dryRun){c({command:`cf zones settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/${e.settingId??`<settingId>`}`,pathParams:{zoneId:String(e.zoneId??``),settingId:String(e.settingId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.settings.get(r,e.settingId)),{successLabel:`Loaded`})}},Ae={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(De).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Me={command:`edit`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:je,handler:async e=>{if(e.dryRun){c({command:`cf zones speed-brain edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/speed_brain`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{value:e.value,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/speed_brain`,{body:t})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await r(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let d={};e.value!==void 0&&a(d,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>n.patch(`/zones/${e.zoneId}/settings/speed_brain`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function Ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`get`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:Ne,handler:async e=>{if(e.dryRun){c({command:`cf zones speed-brain get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/settings/speed_brain`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.speedBrain.get(r)),{successLabel:`Loaded`})}},$={command:`speed-brain`,describe:`Speed Brain operations`,builder:e=>e.command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(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 Ie={command:`create`,describe:`Create a zone subscription, either plan or add-ons.`,builder:Fe,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/subscription`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{appInstallId:e.appInstallId,frequency:e.frequency,ratePlanCurrency:e.ratePlanCurrency,ratePlanExternallyManaged:e.ratePlanExternallyManaged,ratePlanId:e.ratePlanId,ratePlanIsContract:e.ratePlanIsContract,ratePlanPublicName:e.ratePlanPublicName,ratePlanScope:e.ratePlanScope,ratePlanSets:e.ratePlanSets,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/zones/${e.zoneId}/subscription`,{body:t})),{successLabel:`Created`});return}let r={};e.appInstallId!==void 0&&a(r,[`app`,`install_id`],u(e.appInstallId,`appInstallId`,`text`)),e.frequency!==void 0&&a(r,[`frequency`],u(e.frequency,`frequency`,`text`)),e.ratePlanCurrency!==void 0&&a(r,[`rate_plan`,`currency`],u(e.ratePlanCurrency,`ratePlanCurrency`,`text`)),e.ratePlanExternallyManaged!==void 0&&a(r,[`rate_plan`,`externally_managed`],e.ratePlanExternallyManaged),e.ratePlanId!==void 0&&a(r,[`rate_plan`,`id`],u(e.ratePlanId,`ratePlanId`,`text`)),e.ratePlanIsContract!==void 0&&a(r,[`rate_plan`,`is_contract`],e.ratePlanIsContract),e.ratePlanPublicName!==void 0&&a(r,[`rate_plan`,`public_name`],u(e.ratePlanPublicName,`ratePlanPublicName`,`text`)),e.ratePlanScope!==void 0&&a(r,[`rate_plan`,`scope`],u(e.ratePlanScope,`ratePlanScope`,`text`)),e.ratePlanSets!==void 0&&a(r,[`rate_plan`,`sets`],e.ratePlanSets),s(await l(`Creating`,async()=>n.post(`/zones/${e.zoneId}/subscription`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function Le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get`,describe:`Lists zone subscription details.`,builder:Le,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/subscription`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.zones.subscriptions.get(r)),{successLabel:`Loaded`})}};function ze(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 Be={command:`update`,describe:`Updates zone subscriptions, either plan or add-ons.`,builder:ze,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/subscription`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{appInstallId:e.appInstallId,frequency:e.frequency,ratePlanCurrency:e.ratePlanCurrency,ratePlanExternallyManaged:e.ratePlanExternallyManaged,ratePlanId:e.ratePlanId,ratePlanIsContract:e.ratePlanIsContract,ratePlanPublicName:e.ratePlanPublicName,ratePlanScope:e.ratePlanScope,ratePlanSets:e.ratePlanSets,body:e.body}});return}let n=await i(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=o(e.body);s(await l(`Updating`,async()=>n.put(`/zones/${e.zoneId}/subscription`,{body:t})),{successLabel:`Updated`});return}let r={};e.appInstallId!==void 0&&a(r,[`app`,`install_id`],u(e.appInstallId,`appInstallId`,`text`)),e.frequency!==void 0&&a(r,[`frequency`],u(e.frequency,`frequency`,`text`)),e.ratePlanCurrency!==void 0&&a(r,[`rate_plan`,`currency`],u(e.ratePlanCurrency,`ratePlanCurrency`,`text`)),e.ratePlanExternallyManaged!==void 0&&a(r,[`rate_plan`,`externally_managed`],e.ratePlanExternallyManaged),e.ratePlanId!==void 0&&a(r,[`rate_plan`,`id`],u(e.ratePlanId,`ratePlanId`,`text`)),e.ratePlanIsContract!==void 0&&a(r,[`rate_plan`,`is_contract`],e.ratePlanIsContract),e.ratePlanPublicName!==void 0&&a(r,[`rate_plan`,`public_name`],u(e.ratePlanPublicName,`ratePlanPublicName`,`text`)),e.ratePlanScope!==void 0&&a(r,[`rate_plan`,`scope`],u(e.ratePlanScope,`ratePlanScope`,`text`)),e.ratePlanSets!==void 0&&a(r,[`rate_plan`,`sets`],e.ratePlanSets),s(await l(`Updating`,async()=>n.put(`/zones/${e.zoneId}/subscription`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}},Ve={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Ie).command(Re).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`zones`,describe:`Zones are domains on Cloudflare — list, create, and configure domain settings`,builder:e=>e.command(v).command(b).command(S).command(H).command(ne).command(te).command(g).command(F).command(B).command(Z).command(se).command(fe).command(_e).command(be).command(Te).command(Ae).command($).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "The Cloudflare CLI",
5
5
  "keywords": [
6
6
  "ai",
@@ -31,24 +31,34 @@
31
31
  ],
32
32
  "type": "module",
33
33
  "main": "./dist/index.mjs",
34
+ "imports": {
35
+ "#lib/*": "./src/lib/*"
36
+ },
37
+ "dependencies": {
38
+ "blake3-wasm": "2.1.5"
39
+ },
34
40
  "devDependencies": {
35
41
  "@bomb.sh/tab": "0.0.15",
36
42
  "@clack/core": "1.2.0",
37
43
  "@clack/prompts": "^1.2.0",
38
44
  "@cloudflare/cli-shared-helpers": "^0.1.0",
45
+ "@cloudflare/deploy-helpers": "^0.2.2",
39
46
  "@cloudflare/forge": "file:../../vendor/cloudflare-forge-0.1.0.tgz",
40
47
  "@cloudflare/forge-sdk-ts": "file:../../vendor/cloudflare-forge-sdk-ts-0.1.0.tgz",
41
- "@cloudflare/workers-utils": "^0.18.0",
48
+ "@cloudflare/workers-auth": "file:../../vendor/cloudflare-workers-auth-0.1.1.tgz",
49
+ "@cloudflare/workers-utils": "^0.24.0",
42
50
  "@types/node": "25.3.5",
43
51
  "@types/yargs": "17.0.35",
44
52
  "am-i-vibing": "^0.1.1",
45
53
  "chalk": "5.6.2",
46
54
  "ci-info": "^4.4.0",
47
55
  "figures": "6.1.0",
56
+ "msw": "2.12.4",
48
57
  "tsdown": "^0.21.0",
49
58
  "tsx": "4.21.0",
50
59
  "vitest": "4.1.0",
51
- "yargs": "18.0.0"
60
+ "yargs": "18.0.0",
61
+ "zod": "4.4.3"
52
62
  },
53
63
  "engines": {
54
64
  "node": ">=22"
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e,h as t,m as n,o as r,t as i}from"./auth-BHD_B2p9.mjs";import{n as a,r as o}from"./input-validation-BpVQi9rR.mjs";import{n as s,t as c}from"./body-parser-iA3vRFmh.mjs";import{t as l}from"./output-CqGQp2r6.mjs";import{t as u}from"./dry-run-FV0pZwdg.mjs";import{t as d}from"./local-OqhVQbv0.mjs";import{t as f}from"./progress-5sHFvwez.mjs";const p={command:`create <reportParam>`,describe:`Submit the Abuse Report of a particular type`,builder:e=>e.positional(`reportParam`,{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/). `}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,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/). `}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,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. `}).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. `,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.`,default:!1}).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.`,default:!1}).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`,`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(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0}),handler:async p=>{if(o(p.reportParam,`reportParam`),p.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/abuse-reports/${p.reportParam??`<reportParam>`}`,pathParams:{reportParam:String(p.reportParam??``)},bodyKind:`json`,body:{comments:p.comments,company:p.company,email:p.email,email2:p.email2,name:p.name,reportedCountry:p.reportedCountry,reportedUserAgent:p.reportedUserAgent,tele:p.tele,title:p.title,urls:p.urls,address1:p.address1,agentName:p.agentName,agree:p.agree,city:p.city,country:p.country,hostNotification:p.hostNotification,originalWork:p.originalWork,ownerNotification:p.ownerNotification,signature:p.signature,state:p.state,justification:p.justification,trademarkNumber:p.trademarkNumber,trademarkOffice:p.trademarkOffice,trademarkSymbol:p.trademarkSymbol,destinationIps:p.destinationIps,portsProtocols:p.portsProtocols,sourceIps:p.sourceIps,ncmecNotification:p.ncmecNotification,regWhoRequestRegWhoAuthorizationStatement:p.regWhoRequestRegWhoAuthorizationStatement,regWhoRequestRegWhoGoodFaithAffirmation:p.regWhoRequestRegWhoGoodFaithAffirmation,regWhoRequestRegWhoLawfulProcessingAgreement:p.regWhoRequestRegWhoLawfulProcessingAgreement,regWhoRequestRegWhoLegalBasis:p.regWhoRequestRegWhoLegalBasis,regWhoRequestRegWhoRequestType:p.regWhoRequestRegWhoRequestType,regWhoRequestRegWhoRequestedDataElements:p.regWhoRequestRegWhoRequestedDataElements,regWhoRequestRegWhoRequestorType:p.regWhoRequestRegWhoRequestorType,ncseiSubjectRepresentation:p.ncseiSubjectRepresentation,body:p.body},validation:`passed`});return}let m=await i(p),h=p.local?d:await r(m);if(p.accountId=h,p.body){let e=c(p.body);l(await f(`Creating abuse report`,async()=>m.post(`/accounts/${h}/abuse-reports/${p.reportParam}`,{body:e})),{successLabel:`Created abuse report`});return}p.email===void 0&&(p.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/).`)),p.email2===void 0&&(p.email2=await t(`email2`,"Should match the value provided in `email`")),p.name===void 0&&(p.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/).`)),p.urls===void 0&&(p.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/).`)),p.ownerNotification===void 0&&(p.ownerNotification=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 g={};p.comments!==void 0&&s(g,[`comments`],a(p.comments,`comments`,`text`)),p.company!==void 0&&s(g,[`company`],a(p.company,`company`,`text`)),p.email!==void 0&&s(g,[`email`],a(p.email,`email`,`text`)),p.email2!==void 0&&s(g,[`email2`],a(p.email2,`email2`,`text`)),p.name!==void 0&&s(g,[`name`],a(p.name,`name`,`text`)),p.reportedCountry!==void 0&&s(g,[`reported_country`],a(p.reportedCountry,`reportedCountry`,`text`)),p.reportedUserAgent!==void 0&&s(g,[`reported_user_agent`],a(p.reportedUserAgent,`reportedUserAgent`,`text`)),p.tele!==void 0&&s(g,[`tele`],a(p.tele,`tele`,`text`)),p.title!==void 0&&s(g,[`title`],a(p.title,`title`,`text`)),p.urls!==void 0&&s(g,[`urls`],a(p.urls,`urls`,`text`)),p.address1!==void 0&&s(g,[`address1`],a(p.address1,`address1`,`text`)),p.agentName!==void 0&&s(g,[`agent_name`],a(p.agentName,`agentName`,`text`)),p.agree!==void 0&&s(g,[`agree`],p.agree),p.city!==void 0&&s(g,[`city`],a(p.city,`city`,`text`)),p.country!==void 0&&s(g,[`country`],a(p.country,`country`,`text`)),p.hostNotification!==void 0&&s(g,[`host_notification`],a(p.hostNotification,`hostNotification`,`text`)),p.originalWork!==void 0&&s(g,[`original_work`],a(p.originalWork,`originalWork`,`text`)),p.ownerNotification!==void 0&&s(g,[`owner_notification`],a(p.ownerNotification,`ownerNotification`,`text`)),p.signature!==void 0&&s(g,[`signature`],a(p.signature,`signature`,`text`)),p.state!==void 0&&s(g,[`state`],a(p.state,`state`,`text`)),p.justification!==void 0&&s(g,[`justification`],a(p.justification,`justification`,`text`)),p.trademarkNumber!==void 0&&s(g,[`trademark_number`],a(p.trademarkNumber,`trademarkNumber`,`text`)),p.trademarkOffice!==void 0&&s(g,[`trademark_office`],a(p.trademarkOffice,`trademarkOffice`,`text`)),p.trademarkSymbol!==void 0&&s(g,[`trademark_symbol`],a(p.trademarkSymbol,`trademarkSymbol`,`text`)),p.destinationIps!==void 0&&s(g,[`destination_ips`],a(p.destinationIps,`destinationIps`,`text`)),p.portsProtocols!==void 0&&s(g,[`ports_protocols`],a(p.portsProtocols,`portsProtocols`,`text`)),p.sourceIps!==void 0&&s(g,[`source_ips`],a(p.sourceIps,`sourceIps`,`text`)),p.ncmecNotification!==void 0&&s(g,[`ncmec_notification`],a(p.ncmecNotification,`ncmecNotification`,`text`)),p.regWhoRequestRegWhoAuthorizationStatement!==void 0&&s(g,[`reg_who_request`,`reg_who_authorization_statement`],a(p.regWhoRequestRegWhoAuthorizationStatement,`regWhoRequestRegWhoAuthorizationStatement`,`text`)),p.regWhoRequestRegWhoGoodFaithAffirmation!==void 0&&s(g,[`reg_who_request`,`reg_who_good_faith_affirmation`],p.regWhoRequestRegWhoGoodFaithAffirmation),p.regWhoRequestRegWhoLawfulProcessingAgreement!==void 0&&s(g,[`reg_who_request`,`reg_who_lawful_processing_agreement`],p.regWhoRequestRegWhoLawfulProcessingAgreement),p.regWhoRequestRegWhoLegalBasis!==void 0&&s(g,[`reg_who_request`,`reg_who_legal_basis`],a(p.regWhoRequestRegWhoLegalBasis,`regWhoRequestRegWhoLegalBasis`,`text`)),p.regWhoRequestRegWhoRequestType!==void 0&&s(g,[`reg_who_request`,`reg_who_request_type`],a(p.regWhoRequestRegWhoRequestType,`regWhoRequestRegWhoRequestType`,`text`)),p.regWhoRequestRegWhoRequestedDataElements!==void 0&&s(g,[`reg_who_request`,`reg_who_requested_data_elements`],p.regWhoRequestRegWhoRequestedDataElements),p.regWhoRequestRegWhoRequestorType!==void 0&&s(g,[`reg_who_request`,`reg_who_requestor_type`],a(p.regWhoRequestRegWhoRequestorType,`regWhoRequestRegWhoRequestorType`,`text`)),p.ncseiSubjectRepresentation!==void 0&&s(g,[`ncsei_subject_representation`],p.ncseiSubjectRepresentation),l(await f(`Creating abuse report`,async()=>m.post(`/accounts/${h}/abuse-reports/${p.reportParam}`,{body:Object.keys(g).length>0?g:void 0})),{successLabel:`Created abuse report`})}},m={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:e=>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)`}),handler:async e=>{let t={};e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage);let n=await i(e),a=e.local?d:await r(n);e.accountId=a,l(await f(`Loading emails`,async()=>n.abuseReports.emails.list(a,e.reportId,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded emails`})}},h={command:`emails`,describe:`Emails operations`,builder:e=>e.command(m).demandCommand(1),handler:()=>{}},g={command:`get <reportParam>`,describe:`Retrieve the details of an abuse report.`,builder:e=>e.positional(`reportParam`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}),handler:async e=>{o(e.reportParam,`reportParam`);let t=await i(e),n=e.local?d:await r(t);e.accountId=n,l(await f(`Loading abuse report`,async()=>t.abuseReports.get(n,e.reportParam)),{successLabel:`Loaded abuse report`})}},_={command:`list`,describe:`List the abuse reports for a given account`,builder:e=>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`]}),handler:async e=>{let t={};e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage),e.sort!==void 0&&(t.sort=e.sort),e.domain!==void 0&&(t.domain=e.domain),e.createdBefore!==void 0&&(t.created_before=e.createdBefore),e.createdAfter!==void 0&&(t.created_after=e.createdAfter),e.status!==void 0&&(t.status=e.status),e.type!==void 0&&(t.type=e.type),e.mitigationStatus!==void 0&&(t.mitigation_status=e.mitigationStatus);let n=await i(e),a=e.local?d:await r(n);e.accountId=a,l(await f(`Loading abuse reports`,async()=>n.abuseReports.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded abuse reports`})}},v={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:e=>e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set, e.g. ?type=rate_limit_cache&type=legal_block.`,choices:[`legal_block`,`misleading_interstitial`,`phishing_interstitial`,`network_block`,`rate_limit_cache`,`account_suspend`,`redirect_video_stream`]}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`]}),handler:async e=>{let t={};e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage),e.sort!==void 0&&(t.sort=e.sort),e.type!==void 0&&(t.type=e.type),e.effectiveBefore!==void 0&&(t.effective_before=e.effectiveBefore),e.effectiveAfter!==void 0&&(t.effective_after=e.effectiveAfter),e.status!==void 0&&(t.status=e.status),e.entityType!==void 0&&(t.entity_type=e.entityType);let n=await i(e),a=e.local?d:await r(n);e.accountId=a,l(await f(`Loading mitigations`,async()=>n.abuseReports.mitigations.list(a,e.reportId,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded mitigations`})}},y={command:`review <reportId>`,describe:`Request a review for mitigations on an account.`,builder:e=>e.positional(`reportId`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(o(t.reportId,`reportId`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/abuse-reports/${t.reportId??`<reportId>`}/mitigations/appeal`,pathParams:{reportId:String(t.reportId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let n=await i(t),a=t.local?d:await r(n);if(t.accountId=a,t.body){let e=c(t.body);l(await f(`Creating mitigation`,async()=>n.post(`/accounts/${a}/abuse-reports/${t.reportId}/mitigations/appeal`,{body:e})),{successLabel:`Created mitigation`});return}l(await f(`Creating mitigation`,async()=>n.abuseReports.mitigations.review(a,t.reportId)),{successLabel:`Created mitigation`})}},b={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(v).command(y).demandCommand(1),handler:()=>{}},x={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(p).command(g).command(_).command(h).command(b).demandCommand(1),handler:()=>{}};export{x as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e,h as t,o as n,p as r,t as i}from"./auth-BHD_B2p9.mjs";import{n as a,r as o}from"./input-validation-BpVQi9rR.mjs";import{n as s,t as c}from"./body-parser-iA3vRFmh.mjs";import{t as l}from"./output-CqGQp2r6.mjs";import{t as u}from"./dry-run-FV0pZwdg.mjs";import{t as d}from"./local-OqhVQbv0.mjs";import{t as f}from"./progress-5sHFvwez.mjs";const p={command:`create`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:e=>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.`}),handler:async r=>{if(r.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts account-organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:{destinationOrganizationId:r.destinationOrganizationId,body:r.body},validation:`passed`});return}let p=await i(r),m=r.local?d:await n(p);if(r.accountId=m,r.body){let e=c(r.body);l(await f(`Creating account organization`,async()=>p.post(`/accounts/${m}/move`,{body:e})),{successLabel:`Created account organization`});return}r.destinationOrganizationId===void 0&&(r.destinationOrganizationId=await t(`destination-organization-id`,``));let h={};r.destinationOrganizationId!==void 0&&s(h,[`destination_organization_id`],a(r.destinationOrganizationId,`destinationOrganizationId`,`text`)),l(await f(`Creating account organization`,async()=>p.post(`/accounts/${m}/move`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created account organization`})}},m={command:`account-organizations`,describe:`Move accounts between organizations`,builder:e=>e.command(p).demandCommand(1),handler:()=>{}},h={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:e=>e,handler:async e=>{let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading account profile`,async()=>t.accounts.accountProfile.get(r)),{successLabel:`Loaded account profile`})}},ee={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:e=>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)`}),handler:async r=>{if(r.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts account-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:{businessAddress:r.businessAddress,businessEmail:r.businessEmail,businessName:r.businessName,businessPhone:r.businessPhone,externalMetadata:r.externalMetadata,body:r.body},validation:`passed`});return}let p=await i(r),m=r.local?d:await n(p);if(r.accountId=m,r.body){let e=c(r.body);l(await f(`Updating account profile`,async()=>p.put(`/accounts/${m}/profile`,{body:e})),{successLabel:`Updated account profile`});return}r.businessAddress===void 0&&(r.businessAddress=await t(`business-address`,``)),r.businessEmail===void 0&&(r.businessEmail=await t(`business-email`,``)),r.businessName===void 0&&(r.businessName=await t(`business-name`,``)),r.businessPhone===void 0&&(r.businessPhone=await t(`business-phone`,``)),r.externalMetadata===void 0&&(r.externalMetadata=await t(`external-metadata`,``));let h={};r.businessAddress!==void 0&&s(h,[`business_address`],a(r.businessAddress,`businessAddress`,`text`)),r.businessEmail!==void 0&&s(h,[`business_email`],a(r.businessEmail,`businessEmail`,`text`)),r.businessName!==void 0&&s(h,[`business_name`],a(r.businessName,`businessName`,`text`)),r.businessPhone!==void 0&&s(h,[`business_phone`],a(r.businessPhone,`businessPhone`,`text`)),r.externalMetadata!==void 0&&s(h,[`external_metadata`],a(r.externalMetadata,`externalMetadata`,`text`)),l(await f(`Updating account profile`,async()=>p.put(`/accounts/${m}/profile`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated account profile`})}},g={command:`account-profile`,describe:`View and manage the profile for a Cloudflare account`,builder:e=>e.command(h).command(ee).demandCommand(1),handler:()=>{}},_={command:`applications`,describe:`List applications with different filters.`,builder:e=>e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys: - name: Filter by application name (e.g., name:HR) - id: Filter by application ID (e.g., id:0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0) - human_id: Filter by human-readable ID (e.g., human_id:HR) - hostname: Filter by hostname or support domain (e.g., hostname:portal.example.com) - source: Filter by application source name (e.g., source:cloudflare) - 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) - intel_id: Filter by Intel API ID (e.g., intel_id:498). .`}).option(`limit`,{type:`number`,description:`Limit of number of results to return (max 250).`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`order-by`,{type:`string`,description:`Order by result by field name and order (e.g., name:asc).`}),handler:async e=>{let t={};e.filter!==void 0&&(t.filter=e.filter),e.limit!==void 0&&(t.limit=e.limit),e.offset!==void 0&&(t.offset=e.offset),e.orderBy!==void 0&&(t.order_by=e.orderBy);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading get`,async()=>r.accounts.applications.get.applications(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded get`})}},v={command:`id <id>`,describe:`Get application by ID.`,builder:e=>e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}),handler:async e=>{o(e.id,`id`);let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading by`,async()=>t.accounts.applications.get.by.id(r,e.id)),{successLabel:`Loaded by`})}},y={command:`by`,describe:`Applications operations`,builder:e=>e.command(v).demandCommand(1),handler:()=>{}},b={command:`get`,describe:`Applications operations`,builder:e=>e.command(_).command(y).demandCommand(1),handler:()=>{}},x={command:`applications`,describe:`Operations for applications`,builder:e=>e.command(b).demandCommand(1),handler:()=>{}},S={command:`id <id>`,describe:`Get application category by ID.`,builder:e=>e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}),handler:async e=>{o(e.id,`id`);let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading by`,async()=>t.accounts.categories.get.by.id(r,e.id)),{successLabel:`Loaded by`})}},C={command:`by`,describe:`Categories operations`,builder:e=>e.command(S).demandCommand(1),handler:()=>{}},w={command:`categories`,describe:`List application categories.`,builder:e=>e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}),handler:async e=>{let t={};e.limit!==void 0&&(t.limit=e.limit),e.offset!==void 0&&(t.offset=e.offset);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading get`,async()=>r.accounts.categories.get.categories(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded get`})}},T={command:`get`,describe:`Categories operations`,builder:e=>e.command(w).command(C).demandCommand(1),handler:()=>{}},E={command:`categories`,describe:`Operations for categories`,builder:e=>e.command(T).demandCommand(1),handler:()=>{}},D={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:e=>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`}),handler:async e=>{if(e.dryRun){u({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:{name:e.name,unitId:e.unitId,body:e.body},validation:`passed`});return}let n=await i(e);if(e.body){let t=c(e.body);l(await f(`Creating account`,async()=>n.post(`/accounts`,{body:t})),{successLabel:`Created account`});return}e.name===void 0&&(e.name=await t(`name`,`Account name`));let r={};e.name!==void 0&&s(r,[`name`],a(e.name,`name`,`text`)),e.unitId!==void 0&&s(r,[`unit`,`id`],a(e.unitId,`unitId`,`text`)),l(await f(`Creating account`,async()=>n.post(`/accounts`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created account`})}},O={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:e=>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}),handler:async t=>{if(t.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}`,pathParams:{},bodyKind:`none`,validation:`passed`});return}let a=await i(t),s=t.local?d:await n(a);if(t.accountId=s,!await r(`account`,``,{force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}l(await f(`Deleting account`,async()=>a.accounts.delete(s)),{successLabel:`Deleted account`})}},k={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading account`,async()=>t.accounts.get(r)),{successLabel:`Loaded account`})}},A={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:e=>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`]}),handler:async e=>{let t={};e.name!==void 0&&(t.name=e.name),e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage),e.direction!==void 0&&(t.direction=e.direction);let n=await i(e);l(await f(`Loading accounts`,async()=>n.accounts.list(Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded accounts`})}},j={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:e=>e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}),handler:async e=>{let t={};e.accountName!==void 0&&(t.account_name=e.accountName),e.actionResult!==void 0&&(t.action_result=e.actionResult),e.actionType!==void 0&&(t.action_type=e.actionType),e.actorContext!==void 0&&(t.actor_context=e.actorContext),e.actorEmail!==void 0&&(t.actor_email=e.actorEmail),e.actorId!==void 0&&(t.actor_id=e.actorId),e.actorIpAddress!==void 0&&(t.actor_ip_address=e.actorIpAddress),e.actorTokenId!==void 0&&(t.actor_token_id=e.actorTokenId),e.actorTokenName!==void 0&&(t.actor_token_name=e.actorTokenName),e.actorType!==void 0&&(t.actor_type=e.actorType),e.auditLogId!==void 0&&(t.audit_log_id=e.auditLogId),e.id!==void 0&&(t.id=e.id),e.rawCfRayId!==void 0&&(t.raw_cf_ray_id=e.rawCfRayId),e.rawMethod!==void 0&&(t.raw_method=e.rawMethod),e.rawStatusCode!==void 0&&(t.raw_status_code=e.rawStatusCode),e.rawUri!==void 0&&(t.raw_uri=e.rawUri),e.resourceId!==void 0&&(t.resource_id=e.resourceId),e.resourceProduct!==void 0&&(t.resource_product=e.resourceProduct),e.resourceType!==void 0&&(t.resource_type=e.resourceType),e.resourceScope!==void 0&&(t.resource_scope=e.resourceScope),e.zoneId!==void 0&&(t.zone_id=e.zoneId),e.zoneName!==void 0&&(t.zone_name=e.zoneName),e.accountNameNot!==void 0&&(t.accountNameNot=e.accountNameNot),e.actionResultNot!==void 0&&(t.actionResultNot=e.actionResultNot),e.actionTypeNot!==void 0&&(t.actionTypeNot=e.actionTypeNot),e.actorContextNot!==void 0&&(t.actorContextNot=e.actorContextNot),e.actorEmailNot!==void 0&&(t.actorEmailNot=e.actorEmailNot),e.actorIdNot!==void 0&&(t.actorIdNot=e.actorIdNot),e.actorIpAddressNot!==void 0&&(t.actorIpAddressNot=e.actorIpAddressNot),e.actorTokenIdNot!==void 0&&(t.actorTokenIdNot=e.actorTokenIdNot),e.actorTokenNameNot!==void 0&&(t.actorTokenNameNot=e.actorTokenNameNot),e.actorTypeNot!==void 0&&(t.actorTypeNot=e.actorTypeNot),e.auditLogIdNot!==void 0&&(t.auditLogIdNot=e.auditLogIdNot),e.idNot!==void 0&&(t.idNot=e.idNot),e.rawCfRayIdNot!==void 0&&(t.rawCfRayIdNot=e.rawCfRayIdNot),e.rawMethodNot!==void 0&&(t.rawMethodNot=e.rawMethodNot),e.rawStatusCodeNot!==void 0&&(t.rawStatusCodeNot=e.rawStatusCodeNot),e.rawUriNot!==void 0&&(t.rawUriNot=e.rawUriNot),e.resourceIdNot!==void 0&&(t.resourceIdNot=e.resourceIdNot),e.resourceProductNot!==void 0&&(t.resourceProductNot=e.resourceProductNot),e.resourceTypeNot!==void 0&&(t.resourceTypeNot=e.resourceTypeNot),e.resourceScopeNot!==void 0&&(t.resourceScopeNot=e.resourceScopeNot),e.zoneIdNot!==void 0&&(t.zoneIdNot=e.zoneIdNot),e.zoneNameNot!==void 0&&(t.zoneNameNot=e.zoneNameNot),e.since!==void 0&&(t.since=e.since),e.before!==void 0&&(t.before=e.before),e.direction!==void 0&&(t.direction=e.direction),e.limit!==void 0&&(t.limit=e.limit),e.cursor!==void 0&&(t.cursor=e.cursor);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading audit`,async()=>r.accounts.logs.audit.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded audit`})}},M={command:`audit`,describe:`Retrieve audit log entries that record actions taken on the account`,builder:e=>e.command(j).demandCommand(1),handler:()=>{}},N={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(M).demandCommand(1),handler:()=>{}},P={command:`create`,describe:`Add a user to the list of members for this account.`,builder:e=>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'. Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform. `,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)`}),handler:async r=>{if(r.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:{email:r.email,roles:r.roles,status:r.status,body:r.body},validation:`passed`});return}let p=await i(r),m=r.local?d:await n(p);if(r.accountId=m,r.body){let e=c(r.body);l(await f(`Creating member`,async()=>p.post(`/accounts/${m}/members`,{body:e})),{successLabel:`Created member`});return}r.email===void 0&&(r.email=await t(`email`,`The contact email address of the user.`));let h={};r.email!==void 0&&s(h,[`email`],a(r.email,`email`,`text`)),r.roles!==void 0&&s(h,[`roles`],r.roles),r.status!==void 0&&s(h,[`status`],a(r.status,`status`,`text`)),l(await f(`Creating member`,async()=>p.post(`/accounts/${m}/members`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created member`})}},F={command:`delete <memberId>`,describe:`Remove a member from an account.`,builder:e=>e.positional(`memberId`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(o(t.memberId,`memberId`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/members/${t.memberId??`<memberId>`}`,pathParams:{memberId:String(t.memberId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),s=t.local?d:await n(a);if(t.accountId=s,!await r(`member`,String(t.memberId??``),{force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}if(t.body){let e=c(t.body);l(await f(`Deleting member`,async()=>a.delete(`/accounts/${s}/members/${t.memberId}`,{body:e})),{successLabel:`Deleted member`});return}l(await f(`Deleting member`,async()=>a.accounts.members.delete(t.memberId,s)),{successLabel:`Deleted member`})}},te={command:`get <memberId>`,describe:`Get information about a specific member of an account.`,builder:e=>e.positional(`memberId`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}),handler:async e=>{o(e.memberId,`memberId`);let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading member`,async()=>t.accounts.members.get(e.memberId,r)),{successLabel:`Loaded member`})}},I={command:`list`,describe:`List all members of an account.`,builder:e=>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`]}),handler:async e=>{let t={};e.order!==void 0&&(t.order=e.order),e.status!==void 0&&(t.status=e.status),e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage),e.direction!==void 0&&(t.direction=e.direction);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading members`,async()=>r.accounts.members.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded members`})}},L={command:`update <memberId>`,describe:`Modify an account member.`,builder:e=>e.positional(`memberId`,{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)`}),handler:async t=>{if(o(t.memberId,`memberId`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/members/${t.memberId??`<memberId>`}`,pathParams:{memberId:String(t.memberId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?d:await n(r);if(t.accountId=a,t.body){let e=c(t.body);l(await f(`Updating member`,async()=>r.put(`/accounts/${a}/members/${t.memberId}`,{body:e})),{successLabel:`Updated member`});return}l(await f(`Updating member`,async()=>r.accounts.members.update(t.memberId,a)),{successLabel:`Updated member`})}},R={command:`members`,describe:`Invite, inspect, update, and remove users who have access to this account`,builder:e=>e.command(P).command(F).command(te).command(I).command(L).demandCommand(1),handler:()=>{}},z={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:e=>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)`}),handler:async e=>{if(e.dryRun){u({command:`cf accounts move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:{accountIds:e.accountIds,destinationOrganizationId:e.destinationOrganizationId,body:e.body},validation:`passed`});return}let n=await i(e);if(e.body){let t=c(e.body);l(await f(`Creating account`,async()=>n.post(`/accounts/move`,{body:t})),{successLabel:`Created account`});return}if(e.accountIds===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e.destinationOrganizationId===void 0&&(e.destinationOrganizationId=await t(`destination-organization-id`,`Move accounts to this organization ID.`));let r={};e.accountIds!==void 0&&s(r,[`account_ids`],e.accountIds),e.destinationOrganizationId!==void 0&&s(r,[`destination_organization_id`],a(e.destinationOrganizationId,`destinationOrganizationId`,`text`)),l(await f(`Creating account`,async()=>n.post(`/accounts/move`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created account`})}},B={command:`get <roleId>`,describe:`Get information about a specific role for an account.`,builder:e=>e.positional(`roleId`,{type:`string`,description:`Role identifier tag.`,demandOption:!0}),handler:async e=>{o(e.roleId,`roleId`);let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading role`,async()=>t.accounts.roles.get(e.roleId,r)),{successLabel:`Loaded role`})}},V={command:`list`,describe:`Get all available roles for an account.`,builder:e=>e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of roles per page.`}),handler:async e=>{let t={};e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading roles`,async()=>r.accounts.roles.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded roles`})}},H={command:`roles`,describe:`View the roles available for assigning to account members, each defining a set of permissions`,builder:e=>e.command(B).command(V).demandCommand(1),handler:()=>{}},U={command:`create`,describe:`Creates an account subscription.`,builder:e=>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)`}),handler:async t=>{if(t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`json`,body:{appInstallId:t.appInstallId,frequency:t.frequency,ratePlanCurrency:t.ratePlanCurrency,ratePlanExternallyManaged:t.ratePlanExternallyManaged,ratePlanId:t.ratePlanId,ratePlanIsContract:t.ratePlanIsContract,ratePlanPublicName:t.ratePlanPublicName,ratePlanScope:t.ratePlanScope,ratePlanSets:t.ratePlanSets,body:t.body},validation:`passed`});return}let r=await i(t),p=t.local?d:await n(r);if(t.accountId=p,t.body){let e=c(t.body);l(await f(`Creating subscription`,async()=>r.post(`/accounts/${p}/subscriptions`,{body:e})),{successLabel:`Created subscription`});return}let m={};t.appInstallId!==void 0&&s(m,[`app`,`install_id`],a(t.appInstallId,`appInstallId`,`text`)),t.frequency!==void 0&&s(m,[`frequency`],a(t.frequency,`frequency`,`text`)),t.ratePlanCurrency!==void 0&&s(m,[`rate_plan`,`currency`],a(t.ratePlanCurrency,`ratePlanCurrency`,`text`)),t.ratePlanExternallyManaged!==void 0&&s(m,[`rate_plan`,`externally_managed`],t.ratePlanExternallyManaged),t.ratePlanId!==void 0&&s(m,[`rate_plan`,`id`],a(t.ratePlanId,`ratePlanId`,`text`)),t.ratePlanIsContract!==void 0&&s(m,[`rate_plan`,`is_contract`],t.ratePlanIsContract),t.ratePlanPublicName!==void 0&&s(m,[`rate_plan`,`public_name`],a(t.ratePlanPublicName,`ratePlanPublicName`,`text`)),t.ratePlanScope!==void 0&&s(m,[`rate_plan`,`scope`],a(t.ratePlanScope,`ratePlanScope`,`text`)),t.ratePlanSets!==void 0&&s(m,[`rate_plan`,`sets`],t.ratePlanSets),l(await f(`Creating subscription`,async()=>r.post(`/accounts/${p}/subscriptions`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created subscription`})}},W={command:`delete <subscriptionIdentifier>`,describe:`Deletes an account's subscription.`,builder:e=>e.positional(`subscriptionIdentifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(o(t.subscriptionIdentifier,`subscriptionIdentifier`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/subscriptions/${t.subscriptionIdentifier??`<subscriptionIdentifier>`}`,pathParams:{subscriptionIdentifier:String(t.subscriptionIdentifier??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),s=t.local?d:await n(a);if(t.accountId=s,!await r(`subscription`,String(t.subscriptionIdentifier??``),{force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}if(t.body){let e=c(t.body);l(await f(`Deleting subscription`,async()=>a.delete(`/accounts/${s}/subscriptions/${t.subscriptionIdentifier}`,{body:e})),{successLabel:`Deleted subscription`});return}l(await f(`Deleting subscription`,async()=>a.accounts.subscriptions.delete(t.subscriptionIdentifier,s)),{successLabel:`Deleted subscription`})}},G={command:`get`,describe:`Lists all of an account's subscriptions.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading subscription`,async()=>t.accounts.subscriptions.get(r)),{successLabel:`Loaded subscription`})}},K={command:`update <subscriptionIdentifier>`,describe:`Updates an account subscription.`,builder:e=>e.positional(`subscriptionIdentifier`,{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)`}),handler:async t=>{if(o(t.subscriptionIdentifier,`subscriptionIdentifier`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/subscriptions/${t.subscriptionIdentifier??`<subscriptionIdentifier>`}`,pathParams:{subscriptionIdentifier:String(t.subscriptionIdentifier??``)},bodyKind:`json`,body:{appInstallId:t.appInstallId,frequency:t.frequency,ratePlanCurrency:t.ratePlanCurrency,ratePlanExternallyManaged:t.ratePlanExternallyManaged,ratePlanId:t.ratePlanId,ratePlanIsContract:t.ratePlanIsContract,ratePlanPublicName:t.ratePlanPublicName,ratePlanScope:t.ratePlanScope,ratePlanSets:t.ratePlanSets,body:t.body},validation:`passed`});return}let r=await i(t),p=t.local?d:await n(r);if(t.accountId=p,t.body){let e=c(t.body);l(await f(`Updating subscription`,async()=>r.put(`/accounts/${p}/subscriptions/${t.subscriptionIdentifier}`,{body:e})),{successLabel:`Updated subscription`});return}let m={};t.appInstallId!==void 0&&s(m,[`app`,`install_id`],a(t.appInstallId,`appInstallId`,`text`)),t.frequency!==void 0&&s(m,[`frequency`],a(t.frequency,`frequency`,`text`)),t.ratePlanCurrency!==void 0&&s(m,[`rate_plan`,`currency`],a(t.ratePlanCurrency,`ratePlanCurrency`,`text`)),t.ratePlanExternallyManaged!==void 0&&s(m,[`rate_plan`,`externally_managed`],t.ratePlanExternallyManaged),t.ratePlanId!==void 0&&s(m,[`rate_plan`,`id`],a(t.ratePlanId,`ratePlanId`,`text`)),t.ratePlanIsContract!==void 0&&s(m,[`rate_plan`,`is_contract`],t.ratePlanIsContract),t.ratePlanPublicName!==void 0&&s(m,[`rate_plan`,`public_name`],a(t.ratePlanPublicName,`ratePlanPublicName`,`text`)),t.ratePlanScope!==void 0&&s(m,[`rate_plan`,`scope`],a(t.ratePlanScope,`ratePlanScope`,`text`)),t.ratePlanSets!==void 0&&s(m,[`rate_plan`,`sets`],t.ratePlanSets),l(await f(`Updating subscription`,async()=>r.put(`/accounts/${p}/subscriptions/${t.subscriptionIdentifier}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated subscription`})}},q={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(U).command(W).command(G).command(K).demandCommand(1),handler:()=>{}},J={command:`create`,describe:`Create a new Account Owned API token.`,builder:e=>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)`}),handler:async r=>{if(r.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:{conditionRequestIpIn:r.conditionRequestIpIn,conditionRequestIpNotIn:r.conditionRequestIpNotIn,expiresOn:r.expiresOn,name:r.name,notBefore:r.notBefore,body:r.body},validation:`passed`});return}let p=await i(r),m=r.local?d:await n(p);if(r.accountId=m,r.body){let e=c(r.body);l(await f(`Creating token`,async()=>p.post(`/accounts/${m}/tokens`,{body:e})),{successLabel:`Created token`});return}r.name===void 0&&(r.name=await t(`name`,`Token name.`));let h={};r.conditionRequestIpIn!==void 0&&s(h,[`condition`,`request_ip`,`in`],r.conditionRequestIpIn),r.conditionRequestIpNotIn!==void 0&&s(h,[`condition`,`request_ip`,`not_in`],r.conditionRequestIpNotIn),r.expiresOn!==void 0&&s(h,[`expires_on`],a(r.expiresOn,`expiresOn`,`text`)),r.name!==void 0&&s(h,[`name`],a(r.name,`name`,`text`)),r.notBefore!==void 0&&s(h,[`not_before`],a(r.notBefore,`notBefore`,`text`)),l(await f(`Creating token`,async()=>p.post(`/accounts/${m}/tokens`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created token`})}},Y={command:`delete <tokenId>`,describe:`Destroy an Account Owned API token.`,builder:e=>e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(o(t.tokenId,`tokenId`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/tokens/${t.tokenId??`<tokenId>`}`,pathParams:{tokenId:String(t.tokenId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),s=t.local?d:await n(a);if(t.accountId=s,!await r(`token`,String(t.tokenId??``),{force:!!t.force})){process.stderr.write(`Aborted.
6
- `);return}if(t.body){let e=c(t.body);l(await f(`Deleting token`,async()=>a.delete(`/accounts/${s}/tokens/${t.tokenId}`,{body:e})),{successLabel:`Deleted token`});return}l(await f(`Deleting token`,async()=>a.accounts.tokens.delete(s,t.tokenId)),{successLabel:`Deleted token`})}},X={command:`get <tokenId>`,describe:`Get information about a specific Account Owned API token.`,builder:e=>e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}),handler:async e=>{o(e.tokenId,`tokenId`);let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading token`,async()=>t.accounts.tokens.get(r,e.tokenId)),{successLabel:`Loaded token`})}},Z={command:`list`,describe:`List all Account Owned API tokens created for this account.`,builder:e=>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`]}),handler:async e=>{let t={};e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage),e.direction!==void 0&&(t.direction=e.direction);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading tokens`,async()=>r.accounts.tokens.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded tokens`})}},Q={command:`get`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:e=>e.option(`name`,{type:`string`,description:`Filter by the name of the permission group. The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group. The value must be URL-encoded.`}),handler:async e=>{let t={};e.name!==void 0&&(t.name=e.name),e.scope!==void 0&&(t.scope=e.scope);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading permission group`,async()=>r.accounts.tokens.permissionGroups.get(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded permission group`})}},ne={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:e=>e.option(`name`,{type:`string`,description:`Filter by the name of the permission group. The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group. The value must be URL-encoded.`}),handler:async e=>{let t={};e.name!==void 0&&(t.name=e.name),e.scope!==void 0&&(t.scope=e.scope);let r=await i(e),a=e.local?d:await n(r);e.accountId=a,l(await f(`Loading permission groups`,async()=>r.accounts.tokens.permissionGroups.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded permission groups`})}},re={command:`permission-groups`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(Q).command(ne).demandCommand(1),handler:()=>{}},ie={command:`update <tokenId>`,describe:`Update an existing token.`,builder:e=>e.positional(`tokenId`,{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)`}),handler:async r=>{if(o(r.tokenId,`tokenId`),r.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/tokens/${r.tokenId??`<tokenId>`}`,pathParams:{tokenId:String(r.tokenId??``)},bodyKind:`json`,body:{conditionRequestIpIn:r.conditionRequestIpIn,conditionRequestIpNotIn:r.conditionRequestIpNotIn,expiresOn:r.expiresOn,name:r.name,notBefore:r.notBefore,status:r.status,body:r.body},validation:`passed`});return}let p=await i(r),m=r.local?d:await n(p);if(r.accountId=m,r.body){let e=c(r.body);l(await f(`Updating token`,async()=>p.put(`/accounts/${m}/tokens/${r.tokenId}`,{body:e})),{successLabel:`Updated token`});return}r.name===void 0&&(r.name=await t(`name`,`Token name.`));let h={};r.conditionRequestIpIn!==void 0&&s(h,[`condition`,`request_ip`,`in`],r.conditionRequestIpIn),r.conditionRequestIpNotIn!==void 0&&s(h,[`condition`,`request_ip`,`not_in`],r.conditionRequestIpNotIn),r.expiresOn!==void 0&&s(h,[`expires_on`],a(r.expiresOn,`expiresOn`,`text`)),r.name!==void 0&&s(h,[`name`],a(r.name,`name`,`text`)),r.notBefore!==void 0&&s(h,[`not_before`],a(r.notBefore,`notBefore`,`text`)),r.status!==void 0&&s(h,[`status`],a(r.status,`status`,`text`)),l(await f(`Updating token`,async()=>p.put(`/accounts/${m}/tokens/${r.tokenId}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated token`})}},ae={command:`update <tokenId>`,describe:`Roll the Account Owned API token secret.`,builder:e=>e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(o(t.tokenId,`tokenId`),t.dryRun){let n=e();n&&o(n,`accountId`),u({command:`cf accounts tokens value update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/tokens/${t.tokenId??`<tokenId>`}/value`,pathParams:{tokenId:String(t.tokenId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?d:await n(r);if(t.accountId=a,t.body){let e=c(t.body);l(await f(`Updating value`,async()=>r.put(`/accounts/${a}/tokens/${t.tokenId}/value`,{body:e})),{successLabel:`Updated value`});return}l(await f(`Updating value`,async()=>r.accounts.tokens.value.update(a,t.tokenId)),{successLabel:`Updated value`})}},oe={command:`value`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ae).demandCommand(1),handler:()=>{}},$={command:`verify`,describe:`Test whether a token works.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?d:await n(t);e.accountId=r,l(await f(`Loading token`,async()=>t.accounts.tokens.verify(r)),{successLabel:`Loaded token`})}},se={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(J).command(Y).command(X).command(Z).command(ie).command($).command(re).command(oe).demandCommand(1),handler:()=>{}},ce={command:`update`,describe:`Update an existing account.`,builder:e=>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 Two-Factor Authentication is enabled`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:{id:r.id,name:r.name,settingsAbuseContactEmail:r.settingsAbuseContactEmail,settingsEnforceTwofactor:r.settingsEnforceTwofactor,body:r.body},validation:`passed`});return}let p=await i(r),m=r.local?d:await n(p);if(r.accountId=m,r.body){let e=c(r.body);l(await f(`Updating account`,async()=>p.put(`/accounts/${m}`,{body:e})),{successLabel:`Updated account`});return}r.id===void 0&&(r.id=await t(`id`,`Identifier`)),r.name===void 0&&(r.name=await t(`name`,`Account name`));let h={};r.id!==void 0&&s(h,[`id`],a(r.id,`id`,`text`)),r.name!==void 0&&s(h,[`name`],a(r.name,`name`,`text`)),r.settingsAbuseContactEmail!==void 0&&s(h,[`settings`,`abuse_contact_email`],a(r.settingsAbuseContactEmail,`settingsAbuseContactEmail`,`text`)),r.settingsEnforceTwofactor!==void 0&&s(h,[`settings`,`enforce_twofactor`],r.settingsEnforceTwofactor),l(await f(`Updating account`,async()=>p.put(`/accounts/${m}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated account`})}},le={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(D).command(O).command(k).command(A).command(z).command(ce).command(m).command(g).command(x).command(E).command(N).command(R).command(H).command(q).command(se).demandCommand(1),handler:()=>{}};export{le as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e,p as t,t as n,u as r}from"./auth-BHD_B2p9.mjs";import{n as i,r as a}from"./input-validation-BpVQi9rR.mjs";import{n as o,t as s}from"./body-parser-iA3vRFmh.mjs";import{t as c}from"./output-CqGQp2r6.mjs";import{t as l}from"./dry-run-FV0pZwdg.mjs";import{t as u}from"./progress-5sHFvwez.mjs";const d={command:`create`,describe:`Add Custom Origin Trust Store for a Zone.`,builder:e=>e.option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(t.dryRun){l({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zoneId??`<zoneId>`}/acm/custom_trust_store`,pathParams:{zoneId:String(t.zoneId??``)},bodyKind:`json`,body:{certificate:t.certificate,body:t.body},validation:`passed`});return}let a=await n(t);if(t.zoneId=await r({zone:t.zone},a,{quiet:t.quiet}),t.body){let e=s(t.body);c(await u(`Creating custom trust store`,async()=>a.post(`/zones/${t.zoneId}/acm/custom_trust_store`,{body:e})),{successLabel:`Created custom trust store`});return}t.certificate===void 0&&(t.certificate=await e(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let d={};t.certificate!==void 0&&o(d,[`certificate`],i(t.certificate,`certificate`,`text`)),c(await u(`Creating custom trust store`,async()=>a.post(`/zones/${t.zoneId}/acm/custom_trust_store`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created custom trust store`})}},f={command:`delete <customOriginTrustStoreId>`,describe:`Removes a CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:e=>e.positional(`customOriginTrustStoreId`,{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}),handler:async e=>{if(a(e.customOriginTrustStoreId,`customOriginTrustStoreId`),e.dryRun){l({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/custom_trust_store/${e.customOriginTrustStoreId??`<customOriginTrustStoreId>`}`,pathParams:{customOriginTrustStoreId:String(e.customOriginTrustStoreId??``),zoneId:String(e.zoneId??``)},bodyKind:`none`,validation:`passed`});return}let i=await n(e),o=await r({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=o,!await t(`custom trust store`,String(e.customOriginTrustStoreId??``),{force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting custom trust store`,async()=>i.acm.customTrustStore.delete(e.customOriginTrustStoreId,o)),{successLabel:`Deleted custom trust store`})}},p={command:`get <customOriginTrustStoreId>`,describe:`Retrieves details about a specific certificate in the custom origin trust store, including expiration and subject information.`,builder:e=>e.positional(`customOriginTrustStoreId`,{type:`string`,description:`Identifier.`,demandOption:!0}),handler:async e=>{a(e.customOriginTrustStoreId,`customOriginTrustStoreId`);let t=await n(e),i=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,c(await u(`Loading custom trust store`,async()=>t.acm.customTrustStore.get(e.customOriginTrustStoreId,i)),{successLabel:`Loaded custom trust store`})}},m={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:e=>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`}),handler:async e=>{let t={};e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage),e.limit!==void 0&&(t.limit=e.limit),e.offset!==void 0&&(t.offset=e.offset);let i=await n(e),a=await r({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading custom trust store`,async()=>i.acm.customTrustStore.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded custom trust store`})}},h={command:`custom-trust-store`,describe:`Upload CA certificates that Cloudflare trusts when connecting to your origin server`,builder:e=>e.command(d).command(f).command(p).command(m).demandCommand(1),handler:()=>{}},g={command:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:e=>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)`}),handler:async e=>{if(e.dryRun){l({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/total_tls`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{certificateAuthority:e.certificateAuthority,enabled:e.enabled,body:e.body},validation:`passed`});return}let t=await n(e);if(e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Creating total tl`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:n})),{successLabel:`Created total tl`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let a={};e.certificateAuthority!==void 0&&o(a,[`certificate_authority`],i(e.certificateAuthority,`certificateAuthority`,`text`)),e.enabled!==void 0&&o(a,[`enabled`],e.enabled),c(await u(`Creating total tl`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created total tl`})}},_={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:e=>e,handler:async e=>{let t=await n(e),i=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,c(await u(`Loading total tl`,async()=>t.acm.totalTLS.get(i)),{successLabel:`Loaded total tl`})}},v={command:`update`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:e=>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)`}),handler:async e=>{if(e.dryRun){l({command:`cf acm total-tls update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/total_tls`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{certificateAuthority:e.certificateAuthority,enabled:e.enabled,body:e.body},validation:`passed`});return}let t=await n(e);if(e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Creating total tl`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:n})),{successLabel:`Created total tl`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let a={};e.certificateAuthority!==void 0&&o(a,[`certificate_authority`],i(e.certificateAuthority,`certificateAuthority`,`text`)),e.enabled!==void 0&&o(a,[`enabled`],e.enabled),c(await u(`Creating total tl`,async()=>t.post(`/zones/${e.zoneId}/acm/total_tls`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created total tl`})}},y={command:`total-tls`,describe:`Automatically issue certificates for all hostnames and subdomains in your zone`,builder:e=>e.command(g).command(_).command(v).demandCommand(1),handler:()=>{}},b={command:`acm`,describe:`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,builder:e=>e.command(h).command(y).demandCommand(1),handler:()=>{}};export{b as default};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e,h as t,o as n,p as r,t as i,u as a}from"./auth-BHD_B2p9.mjs";import{n as o,r as s}from"./input-validation-BpVQi9rR.mjs";import{n as c,t as l}from"./body-parser-iA3vRFmh.mjs";import{t as u}from"./output-CqGQp2r6.mjs";import{t as d}from"./dry-run-FV0pZwdg.mjs";import{t as f}from"./local-OqhVQbv0.mjs";import{t as p}from"./progress-5sHFvwez.mjs";import{n as m,t as h}from"./raw-fetch-CxFs4i0R.mjs";const ee={command:`delete <addressMapId>`,describe:`Remove an account as a member of a particular address map.`,builder:e=>e.positional(`addressMapId`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.addressMapId,`addressMapId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/accounts/${n??`<account-id>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`account`,String(t.addressMapId??``),{force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting account`,async()=>a.delete(`/accounts/${o}/addressing/address_maps/${t.addressMapId}/accounts/${o}`,{body:e})),{successLabel:`Deleted account`});return}u(await p(`Deleting account`,async()=>a.addressing.addressMaps.accounts.delete(o,t.addressMapId)),{successLabel:`Deleted account`})}},g={command:`update <addressMapId>`,describe:`Add an account as a member of a particular address map.`,builder:e=>e.positional(`addressMapId`,{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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.addressMapId,`addressMapId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/accounts/${n??`<account-id>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating account`,async()=>r.put(`/accounts/${a}/addressing/address_maps/${t.addressMapId}/accounts/${a}`,{body:e})),{successLabel:`Updated account`});return}u(await p(`Updating account`,async()=>r.addressing.addressMaps.accounts.update(a,t.addressMapId)),{successLabel:`Updated account`})}},_={command:`accounts`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(ee).command(g).demandCommand(1),handler:()=>{}},v={command:`create`,describe:`Create a new address map under the account.`,builder:e=>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)`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({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:{description:t.description,enabled:t.enabled,ips:t.ips,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Creating address map`,async()=>r.post(`/accounts/${a}/addressing/address_maps`,{body:e})),{successLabel:`Created address map`});return}let m={};t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.enabled!==void 0&&c(m,[`enabled`],t.enabled),t.ips!==void 0&&c(m,[`ips`],t.ips),u(await p(`Creating address map`,async()=>r.post(`/accounts/${a}/addressing/address_maps`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created address map`})}},y={command:`delete <addressMapId>`,describe:`Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.`,builder:e=>e.positional(`addressMapId`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.addressMapId,`addressMapId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`address map`,String(t.addressMapId??``),{force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting address map`,async()=>a.delete(`/accounts/${o}/addressing/address_maps/${t.addressMapId}`,{body:e})),{successLabel:`Deleted address map`});return}u(await p(`Deleting address map`,async()=>a.addressing.addressMaps.delete(t.addressMapId,o)),{successLabel:`Deleted address map`})}},b={command:`edit <addressMapId>`,describe:`Modify properties of an address map owned by the account.`,builder:e=>e.positional(`addressMapId`,{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.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.addressMapId,`addressMapId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{defaultSni:t.defaultSni,description:t.description,enabled:t.enabled,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating address map`,async()=>r.patch(`/accounts/${a}/addressing/address_maps/${t.addressMapId}`,{body:e})),{successLabel:`Updated address map`});return}let m={};t.defaultSni!==void 0&&c(m,[`default_sni`],o(t.defaultSni,`defaultSni`,`text`)),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.enabled!==void 0&&c(m,[`enabled`],t.enabled),u(await p(`Updating address map`,async()=>r.patch(`/accounts/${a}/addressing/address_maps/${t.addressMapId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated address map`})}},x={command:`get <addressMapId>`,describe:`Show a particular address map owned by the account.`,builder:e=>e.positional(`addressMapId`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}),handler:async e=>{s(e.addressMapId,`addressMapId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading address map`,async()=>t.addressing.addressMaps.get(e.addressMapId,r)),{successLabel:`Loaded address map`})}},S={command:`delete <ipAddress>`,describe:`Remove an IP from a particular address map.`,builder:e=>e.positional(`ipAddress`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.ipAddress,`ipAddress`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps ips delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/ips/${t.ipAddress??`<ipAddress>`}`,pathParams:{ipAddress:String(t.ipAddress??``),addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`ip`,String(t.ipAddress??``),{force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting ip`,async()=>a.delete(`/accounts/${o}/addressing/address_maps/${t.addressMapId}/ips/${t.ipAddress}`,{body:e})),{successLabel:`Deleted ip`});return}u(await p(`Deleting ip`,async()=>a.addressing.addressMaps.ips.delete(t.ipAddress,t.addressMapId,o)),{successLabel:`Deleted ip`})}},C={command:`update <ipAddress>`,describe:`Add an IP from a prefix owned by the account to a particular address map.`,builder:e=>e.positional(`ipAddress`,{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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.ipAddress,`ipAddress`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps ips update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/ips/${t.ipAddress??`<ipAddress>`}`,pathParams:{ipAddress:String(t.ipAddress??``),addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating ip`,async()=>r.put(`/accounts/${a}/addressing/address_maps/${t.addressMapId}/ips/${t.ipAddress}`,{body:e})),{successLabel:`Updated ip`});return}u(await p(`Updating ip`,async()=>r.addressing.addressMaps.ips.update(t.ipAddress,t.addressMapId,a)),{successLabel:`Updated ip`})}},w={command:`ips`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(S).command(C).demandCommand(1),handler:()=>{}},T={command:`list`,describe:`List all address maps owned by the account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading address maps`,async()=>t.addressing.addressMaps.list(r)),{successLabel:`Loaded address maps`})}},E={command:`delete`,describe:`Remove a zone as a member of a particular address map.`,builder:e=>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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/zones/${t.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(t.zoneId??``),addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let o=await i(t),c=t.local?f:await n(o);t.accountId=c;let m=await a({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=m,!await r(`zone`,String(m??``),{force:!!t.force})){process.stderr.write(`Aborted.
6
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting zone`,async()=>o.delete(`/accounts/${c}/addressing/address_maps/${t.addressMapId}/zones/${t.zoneId}`,{body:e})),{successLabel:`Deleted zone`});return}u(await p(`Deleting zone`,async()=>o.addressing.addressMaps.zones.delete(m,t.addressMapId,c)),{successLabel:`Deleted zone`})}},D={command:`update`,describe:`Add a zone as a member of a particular address map.`,builder:e=>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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing address-maps zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/zones/${t.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(t.zoneId??``),addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let r=await i(t),o=t.local?f:await n(r);t.accountId=o;let c=await a({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=c,t.body){let e=l(t.body);u(await p(`Updating zone`,async()=>r.put(`/accounts/${o}/addressing/address_maps/${t.addressMapId}/zones/${t.zoneId}`,{body:e})),{successLabel:`Updated zone`});return}u(await p(`Updating zone`,async()=>r.addressing.addressMaps.zones.update(c,t.addressMapId,o)),{successLabel:`Updated zone`})}},O={command:`zones`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(E).command(D).demandCommand(1),handler:()=>{}},k={command:`address-maps`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(v).command(y).command(b).command(x).command(T).command(_).command(w).command(O).demandCommand(1),handler:()=>{}},A={command:`list`,describe:`List all leases owned by the account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading leases`,async()=>t.addressing.leases.list(r)),{successLabel:`Loaded leases`})}},j={command:`leases`,describe:`Leases operations`,builder:e=>e.command(A).demandCommand(1),handler:()=>{}},M={command:`create`,describe:`Submit LOA document (pdf format) under the account.`,builder:e=>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.`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({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:t.body,file:t.file,loaDocument:t.loaDocument},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.file!==void 0||t.body!==void 0||t.loaDocument!==void 0){let e=new FormData;if(t.file){let{readFileSync:n}=await import(`node:fs`),{resolve:r}=await import(`node:path`),i=n(r(t.file));e.append(`file`,new Blob([i]),t.file.split(`/`).pop())}else t.body!==void 0&&e.append(`file`,t.body);t.loaDocument!==void 0&&e.append(`loa_document`,String(o(t.loaDocument,`loaDocument`,`text`)??``)),u(await p(`Creating loa document`,async()=>r.post(`/accounts/${a}/addressing/loa_documents`,{body:e})),{successLabel:`Created loa document`});return}if(t.body){let e=o(t.body,`body`,`binary`);u(await p(`Creating loa document`,async()=>r.post(`/accounts/${a}/addressing/loa_documents`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created loa document`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},N={command:`get <loaDocumentId>`,describe:`Download specified LOA document under the account.`,builder:e=>e.positional(`loaDocumentId`,{type:`string`,description:`Identifier for the uploaded LOA document.`,demandOption:!0}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1}),handler:async e=>{s(e.loaDocumentId,`loaDocumentId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r;let a=await p(`Loading loa document`,async()=>h(`/accounts/${r}/addressing/loa_documents/${e.loaDocumentId}/download`,`GET`,e.local?e.localEndpoint:void 0));m(e.text===!0?a.toString(`utf-8`):a)}},P={command:`loa-documents`,describe:`Letter of Authorization documents required to verify IP prefix ownership`,builder:e=>e.command(M).command(N).demandCommand(1),handler:()=>{}},F={command:`edit <prefixId>`,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:e=>e.positional(`prefixId`,{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 `false`, the BGP route is withdrawn. "}).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)`}),handler:async t=>{if(s(t.prefixId,`prefixId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes advertisement-status edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/status`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{advertised:t.advertised,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating advertisement statu`,async()=>r.patch(`/accounts/${a}/addressing/prefixes/${t.prefixId}/bgp/status`,{body:e})),{successLabel:`Updated advertisement statu`});return}if(t.advertised===void 0)throw Error(`--advertised is required (or pass --body with this field set).`);let o={};t.advertised!==void 0&&c(o,[`advertised`],t.advertised),u(await p(`Updating advertisement statu`,async()=>r.patch(`/accounts/${a}/addressing/prefixes/${t.prefixId}/bgp/status`,{body:Object.keys(o).length>0?o:void 0})),{successLabel:`Updated advertisement statu`})}},I={command:`get <prefixId>`,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:e=>e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{s(e.prefixId,`prefixId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading advertisement statu`,async()=>t.addressing.prefixes.advertisementStatus.get(e.prefixId,r)),{successLabel:`Loaded advertisement statu`})}},L={command:`advertisement-status`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(F).command(I).demandCommand(1),handler:()=>{}},R={command:`create <prefixId>`,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:e=>e.positional(`prefixId`,{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)`}),handler:async r=>{if(s(r.prefixId,`prefixId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf addressing prefixes bgp-prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/prefixes/${r.prefixId??`<prefixId>`}/bgp/prefixes`,pathParams:{prefixId:String(r.prefixId??``)},bodyKind:`json`,body:{cidr:r.cidr,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating bgp prefixe`,async()=>a.post(`/accounts/${m}/addressing/prefixes/${r.prefixId}/bgp/prefixes`,{body:e})),{successLabel:`Created bgp prefixe`});return}r.cidr===void 0&&(r.cidr=await t(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let h={};r.cidr!==void 0&&c(h,[`cidr`],o(r.cidr,`cidr`,`text`)),u(await p(`Creating bgp prefixe`,async()=>a.post(`/accounts/${m}/addressing/prefixes/${r.prefixId}/bgp/prefixes`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created bgp prefixe`})}},z={command:`delete <bgpPrefixId>`,describe:`Delete a BGP Prefix associated with the specified IP Prefix. A BGP Prefix must be withdrawn before it can be deleted.`,builder:e=>e.positional(`bgpPrefixId`,{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}),handler:async t=>{if(s(t.bgpPrefixId,`bgpPrefixId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes bgp-prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/prefixes/${t.bgpPrefixId??`<bgpPrefixId>`}`,pathParams:{prefixId:String(t.prefixId??``),bgpPrefixId:String(t.bgpPrefixId??``)},bodyKind:`none`,validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`bgp prefixe`,String(t.bgpPrefixId??``),{force:!!t.force})){process.stderr.write(`Aborted.
7
- `);return}u(await p(`Deleting bgp prefixe`,async()=>a.addressing.prefixes.bgpPrefixes.delete(o,t.prefixId,t.bgpPrefixId)),{successLabel:`Deleted bgp prefixe`})}},B={command:`edit <bgpPrefixId>`,describe:`Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn).`,builder:e=>e.positional(`bgpPrefixId`,{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`,default:0}).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.`,default:!1}).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)`}),handler:async t=>{if(s(t.bgpPrefixId,`bgpPrefixId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes bgp-prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/prefixes/${t.bgpPrefixId??`<bgpPrefixId>`}`,pathParams:{prefixId:String(t.prefixId??``),bgpPrefixId:String(t.bgpPrefixId??``)},bodyKind:`json`,body:{asnPrependCount:t.asnPrependCount,autoAdvertiseWithdraw:t.autoAdvertiseWithdraw,onDemandAdvertised:t.onDemandAdvertised,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating bgp prefixe`,async()=>r.patch(`/accounts/${a}/addressing/prefixes/${t.prefixId}/bgp/prefixes/${t.bgpPrefixId}`,{body:e})),{successLabel:`Updated bgp prefixe`});return}let o={};t.asnPrependCount!==void 0&&c(o,[`asn_prepend_count`],t.asnPrependCount),t.autoAdvertiseWithdraw!==void 0&&c(o,[`auto_advertise_withdraw`],t.autoAdvertiseWithdraw),t.onDemandAdvertised!==void 0&&c(o,[`on_demand`,`advertised`],t.onDemandAdvertised),u(await p(`Updating bgp prefixe`,async()=>r.patch(`/accounts/${a}/addressing/prefixes/${t.prefixId}/bgp/prefixes/${t.bgpPrefixId}`,{body:Object.keys(o).length>0?o:void 0})),{successLabel:`Updated bgp prefixe`})}},V={command:`get <bgpPrefixId>`,describe:`Retrieve a single BGP Prefix according to its identifier`,builder:e=>e.positional(`bgpPrefixId`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{s(e.bgpPrefixId,`bgpPrefixId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading bgp prefixe`,async()=>t.addressing.prefixes.bgpPrefixes.get(r,e.prefixId,e.bgpPrefixId)),{successLabel:`Loaded bgp prefixe`})}},H={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:e=>e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading bgp prefixes`,async()=>t.addressing.prefixes.bgpPrefixes.list(r,e.prefixId)),{successLabel:`Loaded bgp prefixes`})}},U={command:`bgp-prefixes`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(R).command(z).command(B).command(V).command(H).demandCommand(1),handler:()=>{}},te={command:`create`,describe:`Add a new prefix under the account.`,builder:e=>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)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf addressing prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`json`,body:{asn:r.asn,cidr:r.cidr,delegateLoaCreation:r.delegateLoaCreation,description:r.description,loaDocumentId:r.loaDocumentId,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating prefixe`,async()=>a.post(`/accounts/${m}/addressing/prefixes`,{body:e})),{successLabel:`Created prefixe`});return}if(r.asn===void 0)throw Error(`--asn is required (or pass --body with this field set).`);r.cidr===void 0&&(r.cidr=await t(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let h={};r.asn!==void 0&&c(h,[`asn`],r.asn),r.cidr!==void 0&&c(h,[`cidr`],o(r.cidr,`cidr`,`text`)),r.delegateLoaCreation!==void 0&&c(h,[`delegate_loa_creation`],r.delegateLoaCreation),r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),r.loaDocumentId!==void 0&&c(h,[`loa_document_id`],o(r.loaDocumentId,`loaDocumentId`,`text`)),u(await p(`Creating prefixe`,async()=>a.post(`/accounts/${m}/addressing/prefixes`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created prefixe`})}},W={command:`create <prefixId>`,describe:`Create a new account delegation for a given IP prefix.`,builder:e=>e.positional(`prefixId`,{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)`}),handler:async r=>{if(s(r.prefixId,`prefixId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf addressing prefixes delegations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/prefixes/${r.prefixId??`<prefixId>`}/delegations`,pathParams:{prefixId:String(r.prefixId??``)},bodyKind:`json`,body:{cidr:r.cidr,delegatedAccountId:r.delegatedAccountId,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating delegation`,async()=>a.post(`/accounts/${m}/addressing/prefixes/${r.prefixId}/delegations`,{body:e})),{successLabel:`Created delegation`});return}r.cidr===void 0&&(r.cidr=await t(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),r.delegatedAccountId===void 0&&(r.delegatedAccountId=await t(`delegated-account-id`,`Account identifier for the account to which prefix is being delegated.`));let h={};r.cidr!==void 0&&c(h,[`cidr`],o(r.cidr,`cidr`,`text`)),r.delegatedAccountId!==void 0&&c(h,[`delegated_account_id`],o(r.delegatedAccountId,`delegatedAccountId`,`text`)),u(await p(`Creating delegation`,async()=>a.post(`/accounts/${m}/addressing/prefixes/${r.prefixId}/delegations`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created delegation`})}},G={command:`delete <delegationId>`,describe:`Delete an account delegation for a given IP prefix.`,builder:e=>e.positional(`delegationId`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.delegationId,`delegationId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes delegations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/delegations/${t.delegationId??`<delegationId>`}`,pathParams:{delegationId:String(t.delegationId??``),prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`delegation`,String(t.delegationId??``),{force:!!t.force})){process.stderr.write(`Aborted.
8
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting delegation`,async()=>a.delete(`/accounts/${o}/addressing/prefixes/${t.prefixId}/delegations/${t.delegationId}`,{body:e})),{successLabel:`Deleted delegation`});return}u(await p(`Deleting delegation`,async()=>a.addressing.prefixes.delegations.delete(t.delegationId,t.prefixId,o)),{successLabel:`Deleted delegation`})}},K={command:`list`,describe:`List all delegations for a given account IP prefix.`,builder:e=>e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading delegations`,async()=>t.addressing.prefixes.delegations.list(e.prefixId,r)),{successLabel:`Loaded delegations`})}},q={command:`delegations`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(W).command(G).command(K).demandCommand(1),handler:()=>{}},J={command:`delete <prefixId>`,describe:`Delete an unapproved prefix owned by the account.`,builder:e=>e.positional(`prefixId`,{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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.prefixId,`prefixId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`prefixe`,String(t.prefixId??``),{force:!!t.force})){process.stderr.write(`Aborted.
9
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting prefixe`,async()=>a.delete(`/accounts/${o}/addressing/prefixes/${t.prefixId}`,{body:e})),{successLabel:`Deleted prefixe`});return}u(await p(`Deleting prefixe`,async()=>a.addressing.prefixes.delete(t.prefixId,o)),{successLabel:`Deleted prefixe`})}},Y={command:`edit <prefixId>`,describe:`Modify the description for a prefix owned by the account.`,builder:e=>e.positional(`prefixId`,{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)`}),handler:async r=>{if(s(r.prefixId,`prefixId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf addressing prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/prefixes/${r.prefixId??`<prefixId>`}`,pathParams:{prefixId:String(r.prefixId??``)},bodyKind:`json`,body:{description:r.description,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Updating prefixe`,async()=>a.patch(`/accounts/${m}/addressing/prefixes/${r.prefixId}`,{body:e})),{successLabel:`Updated prefixe`});return}r.description===void 0&&(r.description=await t(`description`,`Description of the prefix.`));let h={};r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),u(await p(`Updating prefixe`,async()=>a.patch(`/accounts/${m}/addressing/prefixes/${r.prefixId}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated prefixe`})}},X={command:`get <prefixId>`,describe:`List a particular prefix owned by the account.`,builder:e=>e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{s(e.prefixId,`prefixId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading prefixe`,async()=>t.addressing.prefixes.get(e.prefixId,r)),{successLabel:`Loaded prefixe`})}},Z={command:`list`,describe:`List all prefixes owned by the account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading prefixes`,async()=>t.addressing.prefixes.list(r)),{successLabel:`Loaded prefixes`})}},Q={command:`create <prefixId>`,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:e=>e.positional(`prefixId`,{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 **List Services** endpoint. `}).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)`}),handler:async r=>{if(s(r.prefixId,`prefixId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf addressing prefixes service-bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/prefixes/${r.prefixId??`<prefixId>`}/bindings`,pathParams:{prefixId:String(r.prefixId??``)},bodyKind:`json`,body:{cidr:r.cidr,serviceId:r.serviceId,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating service binding`,async()=>a.post(`/accounts/${m}/addressing/prefixes/${r.prefixId}/bindings`,{body:e})),{successLabel:`Created service binding`});return}r.cidr===void 0&&(r.cidr=await t(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),r.serviceId===void 0&&(r.serviceId=await t(`service-id`,`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the **List Services** endpoint. `));let h={};r.cidr!==void 0&&c(h,[`cidr`],o(r.cidr,`cidr`,`text`)),r.serviceId!==void 0&&c(h,[`service_id`],o(r.serviceId,`serviceId`,`text`)),u(await p(`Creating service binding`,async()=>a.post(`/accounts/${m}/addressing/prefixes/${r.prefixId}/bindings`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created service binding`})}},ne={command:`delete <bindingId>`,describe:`Delete a Service Binding`,builder:e=>e.positional(`bindingId`,{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}),handler:async t=>{if(s(t.bindingId,`bindingId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes service-bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bindings/${t.bindingId??`<bindingId>`}`,pathParams:{prefixId:String(t.prefixId??``),bindingId:String(t.bindingId??``)},bodyKind:`none`,validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`service binding`,String(t.bindingId??``),{force:!!t.force})){process.stderr.write(`Aborted.
10
- `);return}u(await p(`Deleting service binding`,async()=>a.addressing.prefixes.serviceBindings.delete(o,t.prefixId,t.bindingId)),{successLabel:`Deleted service binding`})}},re={command:`get <bindingId>`,describe:`Fetch a single Service Binding`,builder:e=>e.positional(`bindingId`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{s(e.bindingId,`bindingId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading service binding`,async()=>t.addressing.prefixes.serviceBindings.get(r,e.prefixId,e.bindingId)),{successLabel:`Loaded service binding`})}},ie={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:e=>e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}),handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading service bindings`,async()=>t.addressing.prefixes.serviceBindings.list(r,e.prefixId)),{successLabel:`Loaded service bindings`})}},ae={command:`service-bindings`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(Q).command(ne).command(re).command(ie).demandCommand(1),handler:()=>{}},oe={command:`create <prefixId>`,describe:`Triggers a new prefix validation. The checks are run asynchronously and include IRR, RPKI, and prefix ownership.`,builder:e=>e.positional(`prefixId`,{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}),handler:async t=>{if(s(t.prefixId,`prefixId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf addressing prefixes validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/validate`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`,validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);t.accountId=a,u(await p(`Creating prefixe`,async()=>r.addressing.prefixes.validate.create(t.prefixId,a)),{successLabel:`Created prefixe`})}},se={command:`validate`,describe:`Additional IP prefix operations — BGP prefix deletion and prefix validation`,builder:e=>e.command(oe).demandCommand(1),handler:()=>{}},ce={command:`prefixes`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(te).command(J).command(Y).command(X).command(Z).command(L).command(U).command(q).command(ae).command(se).demandCommand(1),handler:()=>{}},le={command:`create`,describe:`Create a new Regional Hostname entry. Cloudflare will only use data centers that are physically located within the chosen region to decrypt and service HTTPS traffic. Learn more about [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/).`,builder:e=>e.option(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`"}).option(`region-key`,{type:`string`,description:`Identifying key for the region`}).option(`routing`,{type:`string`,description:`Configure which routing method to use for the regional hostname`,default:`dns`}).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)`}),handler:async e=>{if(e.dryRun){d({command:`cf addressing regional-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{hostname:e.hostname,regionKey:e.regionKey,routing:e.routing,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating regional hostname`,async()=>n.post(`/zones/${e.zoneId}/addressing/regional_hostnames`,{body:t})),{successLabel:`Created regional hostname`});return}e.hostname===void 0&&(e.hostname=await t(`hostname`,"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`")),e.regionKey===void 0&&(e.regionKey=await t(`region-key`,`Identifying key for the region`));let r={};e.hostname!==void 0&&c(r,[`hostname`],o(e.hostname,`hostname`,`text`)),e.regionKey!==void 0&&c(r,[`region_key`],o(e.regionKey,`regionKey`,`text`)),e.routing!==void 0&&c(r,[`routing`],o(e.routing,`routing`,`text`)),u(await p(`Creating regional hostname`,async()=>n.post(`/zones/${e.zoneId}/addressing/regional_hostnames`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created regional hostname`})}},ue={command:`delete <hostname>`,describe:`Delete the region configuration for a specific Regional Hostname.`,builder:e=>e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",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}),handler:async e=>{if(s(e.hostname,`hostname`),e.dryRun){d({command:`cf addressing regional-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames/${e.hostname??`<hostname>`}`,pathParams:{zoneId:String(e.zoneId??``),hostname:String(e.hostname??``)},bodyKind:`none`,validation:`passed`});return}let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await r(`regional hostname`,String(e.hostname??``),{force:!!e.force})){process.stderr.write(`Aborted.
11
- `);return}u(await p(`Deleting regional hostname`,async()=>t.addressing.regionalHostnames.delete(n,e.hostname)),{successLabel:`Deleted regional hostname`})}},de={command:`edit <hostname>`,describe:`Update the configuration for a specific Regional Hostname. Only the region_key of a hostname is mutable.`,builder:e=>e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",demandOption:!0}).option(`region-key`,{type:`string`,description:`Identifying key for the region`}).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)`}),handler:async e=>{if(s(e.hostname,`hostname`),e.dryRun){d({command:`cf addressing regional-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames/${e.hostname??`<hostname>`}`,pathParams:{zoneId:String(e.zoneId??``),hostname:String(e.hostname??``)},bodyKind:`json`,body:{regionKey:e.regionKey,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Updating regional hostname`,async()=>n.patch(`/zones/${e.zoneId}/addressing/regional_hostnames/${e.hostname}`,{body:t})),{successLabel:`Updated regional hostname`});return}e.regionKey===void 0&&(e.regionKey=await t(`region-key`,`Identifying key for the region`));let r={};e.regionKey!==void 0&&c(r,[`region_key`],o(e.regionKey,`regionKey`,`text`)),u(await p(`Updating regional hostname`,async()=>n.patch(`/zones/${e.zoneId}/addressing/regional_hostnames/${e.hostname}`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated regional hostname`})}},fe={command:`get <hostname>`,describe:`Fetch the configuration for a specific Regional Hostname, within a zone.`,builder:e=>e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",demandOption:!0}),handler:async e=>{s(e.hostname,`hostname`);let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading regional hostname`,async()=>t.addressing.regionalHostnames.get(n,e.hostname)),{successLabel:`Loaded regional hostname`})}},pe={command:`list`,describe:`List all Regional Hostnames within a zone.`,builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading regional hostnames`,async()=>t.addressing.regionalHostnames.list(n)),{successLabel:`Loaded regional hostnames`})}},$={command:`list`,describe:`List all Regional Services regions available for use by this account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading regions`,async()=>t.addressing.regionalHostnames.regions.list(r)),{successLabel:`Loaded regions`})}},me={command:`regions`,describe:`Pin hostnames to specific geographic regions for data locality compliance`,builder:e=>e.command($).demandCommand(1),handler:()=>{}},he={command:`regional-hostnames`,describe:`Pin hostnames to specific geographic regions for data locality compliance`,builder:e=>e.command(le).command(ue).command(de).command(fe).command(pe).command(me).demandCommand(1),handler:()=>{}},ge={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:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading services`,async()=>t.addressing.services.list(r)),{successLabel:`Loaded services`})}},_e={command:`services`,describe:`Cloudflare services (CDN, Spectrum, Magic Transit) that IP prefixes can be bound to`,builder:e=>e.command(ge).demandCommand(1),handler:()=>{}},ve={command:`addressing`,describe:`IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control`,builder:e=>e.command(k).command(j).command(P).command(ce).command(he).command(_e).demandCommand(1),handler:()=>{}};export{ve as default};