cf 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +7 -1
  2. package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
  3. package/dist/accounts-BIY8wNGA.mjs +22 -0
  4. package/dist/{acm-C2lYIWs1.mjs → acm-SqcV8o5o.mjs} +2 -2
  5. package/dist/addressing-CygRm0pN.mjs +12 -0
  6. package/dist/{agent-context-CgGCT0xU.mjs → agent-context-CKb6w43K.mjs} +1 -1
  7. package/dist/ai-BAmEAjN3.mjs +2 -0
  8. package/dist/ai-gateway-BENwPvvB.mjs +8 -0
  9. package/dist/ai-search-Bv_Whw3E.mjs +7 -0
  10. package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
  11. package/dist/alerting-D_qWrsoY.mjs +6 -0
  12. package/dist/{analytics-CkhhhZWZ.mjs → analytics-CwFrx-Dr.mjs} +1 -1
  13. package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
  14. package/dist/api-gateway-D9PMVVqL.mjs +33 -0
  15. package/dist/argo-DwYGbyld.mjs +2 -0
  16. package/dist/artifacts-DKAjY_n4.mjs +4 -0
  17. package/dist/audit-logs-BvQ9uwuy.mjs +2 -0
  18. package/dist/auth-DX9KnJ0P.mjs +9 -0
  19. package/dist/auth-TYwGydWg.mjs +5 -0
  20. package/dist/billing-CRTlRU88.mjs +2 -0
  21. package/dist/{bot-management-CJxD1pqi.mjs → bot-management-DgW--8wM.mjs} +2 -2
  22. package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
  23. package/dist/brand-protection-ZikBtl0y.mjs +3 -0
  24. package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
  25. package/dist/build-Bgw8TV1p.mjs +134 -0
  26. package/dist/{cache-B7pRbpTy.mjs → cache-CeN5t6_W.mjs} +4 -4
  27. package/dist/calls-Cv0ieVg4.mjs +4 -0
  28. package/dist/certificate-authorities-BzZnWCac.mjs +2 -0
  29. package/dist/client-certificates-BFuzeBrj.mjs +3 -0
  30. package/dist/cloud-connector-D5h8Dzzg.mjs +2 -0
  31. package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
  32. package/dist/{completions-D_9WsLG7.mjs → completions-Bvzav4Mj.mjs} +2 -2
  33. package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
  34. package/dist/connectivity-CjkXmEhO.mjs +3 -0
  35. package/dist/connector-interrupts-B7eSface.mjs +2 -0
  36. package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
  37. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
  38. package/dist/connectors-YYu_Vx3H.mjs +3 -0
  39. package/dist/content-scanning-BorfRGKT.mjs +4 -0
  40. package/dist/context-C-WbewL6.mjs +2 -0
  41. package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-CfRj7QZb.mjs} +4 -4
  42. package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
  43. package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
  44. package/dist/custom-pages-DamGVA75.mjs +4 -0
  45. package/dist/d1-sK0O5THv.mjs +4 -0
  46. package/dist/data-security-DsWpoWiS.mjs +6 -0
  47. package/dist/dcv-delegation-BYsNl3qc.mjs +2 -0
  48. package/dist/{deploy-KBRFIatG.mjs → deploy-BzlPv3ro.mjs} +1 -1
  49. package/dist/{dev-pPazzZvt.mjs → dev-IOg-_s5_.mjs} +1 -1
  50. package/dist/diagnostics-CH7T2WR3.mjs +3 -0
  51. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
  52. package/dist/dist-B7hsuvbF.mjs +57 -0
  53. package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
  54. package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
  55. package/dist/dns-o7hUPMCG.mjs +29 -0
  56. package/dist/durable-objects-DgrTbvoF.mjs +2 -0
  57. package/dist/email-routing-owCvAEpf.mjs +10 -0
  58. package/dist/email-security-Dng3DVuf.mjs +8 -0
  59. package/dist/email-sending-bExMH4lu.mjs +3 -0
  60. package/dist/filters-DKs-wEzt.mjs +4 -0
  61. package/dist/{firewall-C3DDwfwh.mjs → firewall-BLaTtX3r.mjs} +10 -10
  62. package/dist/{fraud-DY3YXFVf.mjs → fraud-D8WmLKyH.mjs} +1 -1
  63. package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
  64. package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-BBtW8vRh.mjs} +3 -3
  65. package/dist/{hostnames-BdAQo1Mr.mjs → hostnames-Bh2IFxIw.mjs} +2 -2
  66. package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
  67. package/dist/iam-apCCcy7R.mjs +6 -0
  68. package/dist/images-Cxe45OHm.mjs +7 -0
  69. package/dist/index.mjs +1 -1
  70. package/dist/intel-8V4h6H46.mjs +3 -0
  71. package/dist/{ips-B6JETVOY.mjs → ips-BE7JbAnc.mjs} +1 -1
  72. package/dist/{keyless-certificates-C4MZ4xnf.mjs → keyless-certificates-CfJmXccT.mjs} +2 -2
  73. package/dist/kv-Dz6then8.mjs +5 -0
  74. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
  75. package/dist/load-balancers-ilsGgudX.mjs +6 -0
  76. package/dist/logpush-BH14TtuA.mjs +4 -0
  77. package/dist/logs-B8-mkf_I.mjs +3 -0
  78. package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
  79. package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
  80. package/dist/magic-transit-B-kU5e3s.mjs +89 -0
  81. package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
  82. package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
  83. package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
  84. package/dist/oauth-B5k80sip.mjs +61 -0
  85. package/dist/observability-9APhqFHo.mjs +4 -0
  86. package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
  87. package/dist/{organizations-aRi1bhFC.mjs → organizations-Dy3kiV_z.mjs} +6 -6
  88. package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
  90. package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-B30_2_dO.mjs} +3 -3
  91. package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
  92. package/dist/{page-rules-CYqtPU1p.mjs → page-rules-zQJGmTCd.mjs} +5 -5
  93. package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CxQk5k9X.mjs} +5 -5
  94. package/dist/pages-5DKLs7CQ.mjs +11 -0
  95. package/dist/pipelines-DfGE44xo.mjs +6 -0
  96. package/dist/progress-CL8I-7YK.mjs +2 -0
  97. package/dist/prompt-q3B7sM2A.mjs +3 -0
  98. package/dist/queues-BoenUGIw.mjs +6 -0
  99. package/dist/r2-Cq_JCjK0.mjs +21 -0
  100. package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
  101. package/dist/{radar-CzGM92uM.mjs → radar-YNOCio6T.mjs} +1 -1
  102. package/dist/rate-limits-CcAF3tMl.mjs +5 -0
  103. package/dist/raw-fetch-bIXC9D1m.mjs +2 -0
  104. package/dist/realtime-kit-4bCGviO5.mjs +18 -0
  105. package/dist/{registrar-8IeA5DKd.mjs → registrar-CfHlaOOf.mjs} +6 -6
  106. package/dist/request-tracers-DlHawg5l.mjs +2 -0
  107. package/dist/resource-sharing-7FhuboJE.mjs +5 -0
  108. package/dist/resource-tagging-divcugVb.mjs +16 -0
  109. package/dist/rules-CAXkege8.mjs +4 -0
  110. package/dist/rulesets-CBsdc8IV.mjs +8 -0
  111. package/dist/rum-D0hHPNl9.mjs +4 -0
  112. package/dist/{schema-hefO-tzo.mjs → schema-D8o6HcCr.mjs} +1 -1
  113. package/dist/schema-validation-BWNDnnIT.mjs +24 -0
  114. package/dist/scim-CWLli4fi.mjs +3 -0
  115. package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
  116. package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
  117. package/dist/security-center-BQT21oiM.mjs +2 -0
  118. package/dist/security-txt-CVpmJo29.mjs +3 -0
  119. package/dist/session-B8r8LNQN.mjs +93 -0
  120. package/dist/{build-BE4o4imx.mjs → shared-DQI8NGja.mjs} +324 -388
  121. package/dist/{smart-shield-DblHIce0.mjs → smart-shield-BreBC1Ap.mjs} +2 -2
  122. package/dist/{snippets-DrpqSXYC.mjs → snippets-BAJoWMSJ.mjs} +3 -3
  123. package/dist/{spawn-DK7pott_.mjs → spawn-pmGERpdB.mjs} +1 -1
  124. package/dist/{spectrum-CnrG0jIC.mjs → spectrum-DnIRLY95.mjs} +6 -6
  125. package/dist/speed-UYEVue28.mjs +4 -0
  126. package/dist/src-BQ1dr9xR.mjs +108 -0
  127. package/dist/{ssl-Cp6tQkZH.mjs → ssl-D3Pixs8M.mjs} +3 -3
  128. package/dist/stream-BUsuOfQh.mjs +14 -0
  129. package/dist/{tenants-o_M62Y1n.mjs → tenants-BdWJTtcg.mjs} +1 -1
  130. package/dist/{token-validation-Ca5AGEns.mjs → token-validation-DUvtXWur.mjs} +5 -5
  131. package/dist/{tools-DtNNmO6l.mjs → tools-CQtA5-cr.mjs} +1 -1
  132. package/dist/turnstile-CAKVnS1L.mjs +23 -0
  133. package/dist/{ui-B97lRnOv.mjs → ui-BrNwNHX9.mjs} +1 -1
  134. package/dist/url-normalization-DA-RAxs4.mjs +3 -0
  135. package/dist/url-scanner-DmYu43f7.mjs +2 -0
  136. package/dist/user-Bah4wGGN.mjs +10 -0
  137. package/dist/vectorize-DhvVG2By.mjs +4 -0
  138. package/dist/{versions-B6E8WQyA.mjs → versions-NUXxCr0s.mjs} +1 -1
  139. package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
  140. package/dist/web3-n3GW50u-.mjs +4 -0
  141. package/dist/workers-D6IaQ_F0.mjs +18 -0
  142. package/dist/workers-builds-DYi0OMMU.mjs +7 -0
  143. package/dist/workflows-DrdXUQ2g.mjs +4 -0
  144. package/dist/{zaraz-CyzfYOEU.mjs → zaraz-9l7KuLqh.mjs} +1 -1
  145. package/dist/zero-trust-D6V9GH2W.mjs +118 -0
  146. package/dist/zero_trust-BzXKAX_x.mjs +3 -0
  147. package/dist/{zones-MSULnDwW.mjs → zones-0MTkuaFk.mjs} +8 -8
  148. package/package.json +3 -1
  149. package/dist/accounts-CjtZ8x1z.mjs +0 -22
  150. package/dist/addressing-CHFK6uxW.mjs +0 -12
  151. package/dist/ai-DS3i-I1a.mjs +0 -2
  152. package/dist/ai-gateway-RIsegO2x.mjs +0 -8
  153. package/dist/ai-search-Dcj4BauG.mjs +0 -7
  154. package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
  155. package/dist/alerting-Bk85NNf5.mjs +0 -6
  156. package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
  157. package/dist/api-gateway-CWdR4Ne7.mjs +0 -33
  158. package/dist/argo-DnJRVnGX.mjs +0 -2
  159. package/dist/artifacts-BVWKiJUl.mjs +0 -4
  160. package/dist/audit-logs-DjTstbzL.mjs +0 -2
  161. package/dist/auth-BqDOIrKX.mjs +0 -150
  162. package/dist/auth-DKkSwnxh.mjs +0 -5
  163. package/dist/billing-3rEqF83h.mjs +0 -2
  164. package/dist/botnet-feed-MG91D7BR.mjs +0 -3
  165. package/dist/brand-protection-CK7gJi06.mjs +0 -3
  166. package/dist/browser-rendering-Rae0AUt0.mjs +0 -4
  167. package/dist/calls-DXRWsZ8n.mjs +0 -4
  168. package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
  169. package/dist/client-certificates-B0ebLJdk.mjs +0 -3
  170. package/dist/cloud-connector-BOjaggJk.mjs +0 -2
  171. package/dist/cloudforce-one-B6HYfk5Z.mjs +0 -21
  172. package/dist/connectivity-welFvZ7X.mjs +0 -3
  173. package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
  174. package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
  175. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
  176. package/dist/connectors-3vjrdFLB.mjs +0 -3
  177. package/dist/content-scanning-CnW2A0pv.mjs +0 -4
  178. package/dist/context-CONbNKO-.mjs +0 -2
  179. package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
  180. package/dist/custom-pages-5fCSP8in.mjs +0 -4
  181. package/dist/d1-CyiRbZZn.mjs +0 -4
  182. package/dist/data-security-Casx4OS_.mjs +0 -6
  183. package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
  184. package/dist/diagnostics-BqYDoDfw.mjs +0 -3
  185. package/dist/dispatch-namespaces-Cz2rajnP.mjs +0 -7
  186. package/dist/dist-DA54ZQu0.mjs +0 -82
  187. package/dist/dns-62t95Xif.mjs +0 -29
  188. package/dist/dns-firewall-Coy8d47t.mjs +0 -57
  189. package/dist/durable-objects-BSuRERkw.mjs +0 -2
  190. package/dist/email-routing-BDUYYeV3.mjs +0 -10
  191. package/dist/email-security-ChHA6eqQ.mjs +0 -8
  192. package/dist/email-sending-CVrRqn6S.mjs +0 -3
  193. package/dist/filters-qJpU9uAS.mjs +0 -4
  194. package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
  195. package/dist/hyperdrive-99OJV9nl.mjs +0 -18
  196. package/dist/iam-BRbpg3lN.mjs +0 -6
  197. package/dist/images-D1jI3r3O.mjs +0 -7
  198. package/dist/intel-C3ajLpXd.mjs +0 -3
  199. package/dist/kv-CSWoD9ks.mjs +0 -5
  200. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
  201. package/dist/load-balancers-Du1tNuUt.mjs +0 -6
  202. package/dist/logpush-SuJyO-uX.mjs +0 -4
  203. package/dist/logs-DcDNRPRl.mjs +0 -3
  204. package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
  205. package/dist/magic-network-monitoring-CqtvOePQ.mjs +0 -4
  206. package/dist/magic-transit-BTbkhBtF.mjs +0 -89
  207. package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
  208. package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
  209. package/dist/network-interconnects-DsiNytOU.mjs +0 -36
  210. package/dist/observability-CLqZ7OSi.mjs +0 -4
  211. package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
  212. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
  213. package/dist/pages-ChurJ2H7.mjs +0 -11
  214. package/dist/pipelines-CeyujvRf.mjs +0 -6
  215. package/dist/progress-Cent9Lsg.mjs +0 -2
  216. package/dist/queues-Rf_n11Cx.mjs +0 -6
  217. package/dist/r2-BtuTO3vQ.mjs +0 -21
  218. package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
  219. package/dist/rate-limits-Bbk7HxP7.mjs +0 -5
  220. package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
  221. package/dist/realtime-kit-CivLpkpg.mjs +0 -18
  222. package/dist/request-tracers-D1aH4NmL.mjs +0 -2
  223. package/dist/resource-sharing-B-Pcto7-.mjs +0 -5
  224. package/dist/resource-tagging-Bpb6Qq1M.mjs +0 -16
  225. package/dist/rules-B10XWY10.mjs +0 -4
  226. package/dist/rulesets-lYczEcJp.mjs +0 -8
  227. package/dist/rum-B5GUKa4I.mjs +0 -4
  228. package/dist/schema-validation-DTq517Em.mjs +0 -24
  229. package/dist/scim-BiLfOQ89.mjs +0 -3
  230. package/dist/security-center-AVpTOBK3.mjs +0 -2
  231. package/dist/security-txt-DVlh8y9l.mjs +0 -3
  232. package/dist/shared-0bwWVDLo.mjs +0 -2
  233. package/dist/speed-BzRY3Xlh.mjs +0 -4
  234. package/dist/src-D9_Gq68b.mjs +0 -108
  235. package/dist/stream-CGTRN4ZN.mjs +0 -14
  236. package/dist/turnstile-l7mo9BWL.mjs +0 -23
  237. package/dist/url-normalization-D1CogSIG.mjs +0 -3
  238. package/dist/url-scanner-BnJHJqcz.mjs +0 -2
  239. package/dist/user-CiyYZ69X.mjs +0 -10
  240. package/dist/vectorize-D3LgMLOn.mjs +0 -4
  241. package/dist/web3-DlHE0CZc.mjs +0 -4
  242. package/dist/workers-DRAkU6YR.mjs +0 -18
  243. package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
  244. package/dist/workflows-z6oapEJs.mjs +0 -4
  245. package/dist/zero-trust-fyyIelWx.mjs +0 -118
  246. package/dist/zero_trust-BAhlNkjo.mjs +0 -3
  247. /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  248. /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
  249. /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-DGgEbf8K.mjs} +0 -0
  250. /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
  251. /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
  252. /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
  253. /package/dist/{metadata-jh2EIan8.mjs → metadata-MPDDi08e.mjs} +0 -0
  254. /package/dist/{resolve-D1mG0REg.mjs → resolve-DGD57PFH.mjs} +0 -0
  255. /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import{N as e,O as t,P as n}from"./oauth-B5k80sip.mjs";import{i as r,n as i}from"./auth-DX9KnJ0P.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-CL8I-7YK.mjs";import{n as u,t as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{r as p,t as m}from"./prompt-q3B7sM2A.mjs";import{t as h}from"./cli-types-DGgEbf8K.mjs";import{n as ee,t as te}from"./raw-fetch-bIXC9D1m.mjs";function g(e){return e.option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`time-delta`,{type:`string`,description:`Unit of time to group data by.`,choices:[`all`,`auto`,`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:h(g),handler:async t=>{let n={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters,time_delta:t[`time-delta`]};if(t.dryRun){c({command:`cf dns analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_analytics/report/bytime`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),a=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=a,s(await l(`Loading`,async()=>r.dns.analytics.reports.bytimes.get({zone_id:a,...n})),{successLabel:`Loaded`})}},v={command:`bytimes`,describe:`DNS analytics and reporting`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:y,handler:async t=>{let n={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters};if(t.dryRun){c({command:`cf dns analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_analytics/report`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),a=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=a,s(await l(`Loading`,async()=>r.dns.analytics.reports.get({zone_id:a,...n})),{successLabel:`Loaded`})}},x={command:`reports`,describe:`DNS analytics and reporting`,builder:e=>e.command(b).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete`,describe:`Delete DNSSEC.`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,!await m({force:!!t.force})){process.stderr.write(`Aborted.
3
+ `);return}s(await l(`Deleting`,async()=>n.dns.dnssec.delete({zone_id:r})),{successLabel:`Deleted`})}};function T(e){return e.option(`dnssec-multi-signer`,{type:`boolean`,description:`If true, multi-signer DNSSEC is enabled on the zone, allowing multiple
4
+ providers to serve a DNSSEC-signed zone at the same time.
5
+ This is required for DNSKEY records (except those automatically
6
+ generated by Cloudflare) to be added to the zone.
7
+
8
+ See [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/) for details.`}).option(`dnssec-presigned`,{type:`boolean`,description:`If true, allows Cloudflare to transfer in a DNSSEC-signed zone
9
+ including signatures from an external provider, without requiring
10
+ Cloudflare to sign any records on the fly.
11
+
12
+ Note that this feature has some limitations.
13
+ See [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec) for details.`}).option(`dnssec-use-nsec3`,{type:`boolean`,description:`If true, enables the use of NSEC3 together with DNSSEC on the zone.
14
+ Combined with setting dnssec_presigned to true, this enables the use of
15
+ NSEC3 records when transferring in from an external provider.
16
+ If dnssec_presigned is instead set to false (default), NSEC3 records will be
17
+ generated and signed at request time.
18
+
19
+ See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details.`}).option(`status`,{type:`string`,description:`Status of DNSSEC, based on user-desired state and presence of necessary records.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit`,describe:`Enable or disable DNSSEC.`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf dns dnssec edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({dnssec_multi_signer:t[`dnssec-multi-signer`],dnssec_presigned:t[`dnssec-presigned`],dnssec_use_nsec3:t[`dnssec-use-nsec3`],status:u(t.status,`status`,`text`)}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.dns.dnssec.edit({...e,zone_id:r})),{successLabel:`Updated`});return}let d=o({dnssec_multi_signer:t[`dnssec-multi-signer`],dnssec_presigned:t[`dnssec-presigned`],dnssec_use_nsec3:t[`dnssec-use-nsec3`],status:u(t.status,`status`,`text`)});s(await l(`Updating`,async()=>n.dns.dnssec.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Details about DNSSEC status and configuration.`,builder:D,handler:async t=>{if(t.dryRun){c({command:`cf dns dnssec get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.dnssec.get({zone_id:r})),{successLabel:`Loaded`})}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`zsks`,describe:`List the Zone Signing Keys (ZSKs) that DNSSEC uses for the zone.`,builder:k,handler:async t=>{if(t.dryRun){c({command:`cf dns dnssec list zsks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dnssec/zsk`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.dnssec.list.zsks({zone_id:r})),{successLabel:`Loaded`})}},j={command:`list`,describe:`Operations for dnssec.list`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`dnssec`,describe:`Operations for dnssec`,builder:e=>e.command(w).command(E).command(O).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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:`batch`,describe:`Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/batch-record-changes/ "Batch DNS records") for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts`,builder:N,handler:async t=>{let n={include_shadow_metadata:t[`include-shadow-metadata`]};if(t.dryRun){c({command:`cf dns records batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/batch`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let r=await i(t),o=await e({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=o,t.body){let e=a(t.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>r.dns.records.batch({...e,zone_id:o,...n})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>r.dns.records.batch({zone_id:o,...n})),{successLabel:`Created`})}};function F(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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 I={command:`create`,describe:`Create a new DNS record for a zone. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:F,handler:async t=>{let n={include_shadow_metadata:t[`include-shadow-metadata`]};if(t.dryRun){c({command:`cf dns records create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let r=await i(t),o=await e({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=o,t.body){let e=a(t.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>r.dns.records.create({body:e,zone_id:o,...n})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function L(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const R={command:`delete <dns-record-id>`,describe:`Permanently removes a DNS record from the zone.`,builder:L,handler:async t=>{if(t.dryRun){c({command:`cf dns records delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/${t[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(t[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(t[`dns-record-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,!await m({force:!!t.force})){process.stderr.write(`Aborted.
20
+ `);return}s(await l(`Deleting`,async()=>n.dns.records.delete({zone_id:r,dns_record_id:t[`dns-record-id`]})),{successLabel:`Deleted`})}};function z(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`edit <dns-record-id>`,describe:`Update an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:z,handler:async t=>{let n={include_shadow_metadata:t[`include-shadow-metadata`]};if(t.dryRun){c({command:`cf dns records edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/${t[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(t[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(t[`dns-record-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let r=await i(t),o=await e({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=o,t.body){let e=a(t.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Updating`,async()=>r.dns.records.edit({body:e,zone_id:o,dns_record_id:t[`dns-record-id`],...n})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`export`,describe:`You can export your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:V,handler:async t=>{if(t.dryRun){c({command:`cf dns records export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/export`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t);t.zoneId=await e({zone:t.zone},n,{quiet:t.quiet}),ee((await l(`Loading`,async()=>te(`/zones/${t.zoneId}/dns_records/export`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).toString(`utf-8`))}};function U(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <dns-record-id>`,describe:`Retrieves details for a specific DNS record in the zone.`,builder:U,handler:async t=>{let n={include_shadow_metadata:t[`include-shadow-metadata`]};if(t.dryRun){c({command:`cf dns records get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/${t[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(t[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(t[`dns-record-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),a=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=a,s(await l(`Loading`,async()=>r.dns.records.get({zone_id:a,dns_record_id:t[`dns-record-id`],...n})),{successLabel:`Loaded`})}};function G(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`proxied`,{type:`string`,description:"Whether or not proxiable records should receive the performance and security benefits of Cloudflare. The value should be either `true` or `false`."})}const K={command:`import`,describe:`You can upload your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:G,handler:async t=>{if(t.dryRun){c({command:`cf dns records import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/import`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file,proxied:t.proxied}});return}let n=await i(t);if(t.zoneId=await e({zone:t.zone},n,{quiet:t.quiet}),t.file!==void 0||t.body!==void 0||t.proxied!==void 0){let e=new FormData;if(t.file){let n=d(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);t.proxied!==void 0&&e.append(`proxied`,String(u(t.proxied,`proxied`,`text`)??``)),s(await l(`Creating`,async()=>r(n,`POST`,`/zones/${t.zoneId}/dns_records/import`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=u(t.body,`body`,`binary`);s(await l(`Creating`,async()=>r(n,`POST`,`/zones/${t.zoneId}/dns_records/import`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function q(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS record name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS record name. Name filters are case-insensitive.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS record name. Name filters are case-insensitive.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS record name. Name filters are case-insensitive.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS record name. Name filters are case-insensitive.`}).option(`type`,{type:`string`,description:`Record type.`,choices:[`A`,`AAAA`,`CAA`,`CERT`,`CNAME`,`DNSKEY`,`DS`,`HTTPS`,`LOC`,`MX`,`NAPTR`,`NS`,`OPENPGPKEY`,`PTR`,`SMIMEA`,`SRV`,`SSHFP`,`SVCB`,`TLSA`,`TXT`,`URI`]}).option(`content`,{type:`string`,description:"Exact value of the DNS record content. This is a convenience alias for `content.exact`."}).option(`content-exact`,{type:`string`,description:`Exact value of the DNS record content. Content filters are case-insensitive.`}).option(`content-contains`,{type:`string`,description:`Substring of the DNS record content. Content filters are case-insensitive.`}).option(`content-startswith`,{type:`string`,description:`Prefix of the DNS record content. Content filters are case-insensitive.`}).option(`content-endswith`,{type:`string`,description:`Suffix of the DNS record content. Content filters are case-insensitive.`}).option(`proxied`,{type:`boolean`,description:`Whether the record is receiving the performance and security benefits of Cloudflare.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.",choices:[`any`,`all`]}).option(`comment`,{type:`string`,description:"Exact value of the DNS record comment. This is a convenience alias for `comment.exact`."}).option(`comment-present`,{type:`string`,description:`If this parameter is present, only records *with* a comment are returned.`}).option(`comment-absent`,{type:`string`,description:`If this parameter is present, only records *without* a comment are returned.`}).option(`comment-exact`,{type:`string`,description:`Exact value of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-contains`,{type:`string`,description:`Substring of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-startswith`,{type:`string`,description:`Prefix of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-endswith`,{type:`string`,description:`Suffix of the DNS record comment. Comment filters are case-insensitive.`}).option(`tag`,{type:`string`,description:"Condition on the DNS record tag.\n\nParameter values can be of the form `<tag-name>:<tag-value>` to search for an exact `name:value` pair, or just `<tag-name>` to search for records with a specific tag name regardless of its value.\n\nThis is a convenience shorthand for the more powerful `tag.<predicate>` parameters.\nExamples:\n- `tag=important` is equivalent to `tag.present=important`\n- `tag=team:DNS` is equivalent to `tag.exact=team:DNS`"}).option(`tag-present`,{type:`string`,description:`Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-absent`,{type:`string`,description:`Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-exact`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value is `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-contains`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value contains `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-startswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value starts with `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-endswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value ends with `<tag-value>`. Tag filters are case-insensitive."}).option(`search`,{type:`string`,description:"Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters."}).option(`tag-match`,{type:`string`,description:"Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS records per page.`}).option(`order`,{type:`string`,description:`Field to order DNS records by.`,choices:[`type`,`name`,`content`,`ttl`,`proxied`]}).option(`direction`,{type:`string`,description:`Direction to order DNS records in.`,choices:[`asc`,`desc`]}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowed-by-name`,{type:`string`,description:"Filters to records at or below the given NS delegation name, excluding the NS records that form the delegation itself. The value must be a subdomain of the zone; the zone apex is not accepted. Requires `include_shadow_metadata=true`. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowing-name`,{type:`string`,description:`Returns NS records that shadow the given name, searching at the name itself and each of its ancestor names within the zone, excluding the zone apex. The value must be a subdomain of the zone; the zone apex is not accepted. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List, search, sort, and filter a zones' DNS records.`,builder:h(q),handler:async t=>{let n={name:t.name,"name.exact":t[`name-exact`],"name.contains":t[`name-contains`],"name.startswith":t[`name-startswith`],"name.endswith":t[`name-endswith`],type:t.type,content:t.content,"content.exact":t[`content-exact`],"content.contains":t[`content-contains`],"content.startswith":t[`content-startswith`],"content.endswith":t[`content-endswith`],proxied:t.proxied,match:t.match,comment:t.comment,"comment.present":t[`comment-present`],"comment.absent":t[`comment-absent`],"comment.exact":t[`comment-exact`],"comment.contains":t[`comment-contains`],"comment.startswith":t[`comment-startswith`],"comment.endswith":t[`comment-endswith`],tag:t.tag,"tag.present":t[`tag-present`],"tag.absent":t[`tag-absent`],"tag.exact":t[`tag-exact`],"tag.contains":t[`tag-contains`],"tag.startswith":t[`tag-startswith`],"tag.endswith":t[`tag-endswith`],search:t.search,tag_match:t[`tag-match`],page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction,include_shadow_metadata:t[`include-shadow-metadata`],shadowed_by_name:t[`shadowed-by-name`],shadowing_name:t[`shadowing-name`]};if(t.dryRun){c({command:`cf dns records list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),a=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=a,s(await l(`Loading`,async()=>r.dns.records.list({zone_id:a,...n})),{successLabel:`Loaded`})}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`scan-list`,describe:"Retrieves the list of DNS records discovered up to this point by the asynchronous scan. These records are temporary until explicitly accepted or rejected via `POST /scan/review`. Additional records may be discovered by the scan later.",builder:Y,handler:async t=>{if(t.dryRun){c({command:`cf dns records scan-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.records.scanList({zone_id:r})),{successLabel:`Loaded`})}};function Z(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 Q={command:`scan-review`,describe:`Accept or reject DNS records found by the DNS records scan. Accepted records will be permanently added to the zone, while rejected records will be permanently deleted.`,builder:Z,handler:async t=>{if(t.dryRun){c({command:`cf dns records scan-review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.dns.records.scanReview({...e,zone_id:r})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>n.dns.records.scanReview({zone_id:r})),{successLabel:`Created`})}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`scan-trigger`,describe:"Initiates an asynchronous scan for common DNS records on your domain. Note that this **does not** automatically add records to your zone. The scan runs in the background, and results can be reviewed later using the `/scan/review` endpoints. Useful if you haven't updated your nameservers yet.",builder:ne,handler:async t=>{if(t.dryRun){c({command:`cf dns records scan-trigger`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/scan/trigger`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Creating`,async()=>n.dns.records.scanTrigger({zone_id:r})),{successLabel:`Created`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`scan`,describe:`Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.`,builder:ie,handler:async t=>{if(t.dryRun){c({command:`cf dns records scan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/scan`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Creating`,async()=>n.dns.records.scan({zone_id:r})),{successLabel:`Created`})}};function oe(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).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:`update <dns-record-id>`,describe:`Overwrite an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:oe,handler:async t=>{let n={include_shadow_metadata:t[`include-shadow-metadata`]};if(t.dryRun){c({command:`cf dns records update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/${t[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(t[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(t[`dns-record-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`json`,body:t.body===void 0?void 0:a(t.body)});return}let r=await i(t),o=await e({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=o,t.body){let e=a(t.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Updating`,async()=>r.dns.records.update({body:e,zone_id:o,dns_record_id:t[`dns-record-id`],...n})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},ce={command:`records`,describe:`Operations for records`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).command(W).command(K).command(J).command(ae).command(X).command(Q).command(re).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`enforce-dns-only`,{type:`boolean`,description:`When enabled, forces all proxied DNS records in the account to behave as DNS-only at the edge, regardless of each record's individual proxy setting. Note that this account-level override does not modify the records themselves; it only affects how they are served at the edge. See more on [Enforce DNS-only](https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only).`}).option(`zone-defaults-flatten-all-cnames`,{type:`boolean`,description:`Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.`}).option(`zone-defaults-foundation-dns`,{type:`boolean`,description:`Whether to enable Foundation DNS Advanced Nameservers on the zone.`}).option(`zone-defaults-internal-dns-reference-zone-id`,{type:`string`,description:`The ID of the zone to fallback to.`}).option(`zone-defaults-multi-provider`,{type:`boolean`,description:`Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.`}).option(`zone-defaults-ns-ttl`,{type:`number`,description:`The time to live (TTL) of the zone's nameserver (NS) records.`}).option(`zone-defaults-secondary-overrides`,{type:`boolean`,description:`Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.`}).option(`zone-defaults-soa-expire`,{type:`number`,description:`Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.`}).option(`zone-defaults-soa-min-ttl`,{type:`number`,description:`The time to live (TTL) for negative caching of records within the zone.`}).option(`zone-defaults-soa-mname`,{type:`string`,description:`The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.`}).option(`zone-defaults-soa-refresh`,{type:`number`,description:`Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.`}).option(`zone-defaults-soa-retry`,{type:`number`,description:`Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.`}).option(`zone-defaults-soa-rname`,{type:`string`,description:`The email address of the zone administrator, with the first label representing the local part of the email address.`}).option(`zone-defaults-soa-ttl`,{type:`number`,description:`The time to live (TTL) of the SOA record itself.`}).option(`zone-defaults-zone-mode`,{type:`string`,description:`Whether the zone mode is a regular or CDN/DNS only zone.`,choices:[`standard`,`cdn_only`,`dns_only`]}).option(`zone-defaults-nameservers-type`,{type:`string`,description:`Nameserver type`,choices:[`cloudflare.standard`,`cloudflare.standard.random`,`custom.account`,`custom.tenant`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`edit`,describe:`Update DNS settings for an account`,builder:le,handler:async e=>{if(e.dryRun){c({command:`cf dns settings account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({enforce_dns_only:e[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:e[`zone-defaults-flatten-all-cnames`],foundation_dns:e[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:u(e[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:e[`zone-defaults-multi-provider`],ns_ttl:e[`zone-defaults-ns-ttl`],secondary_overrides:e[`zone-defaults-secondary-overrides`],soa:{expire:e[`zone-defaults-soa-expire`],min_ttl:e[`zone-defaults-soa-min-ttl`],mname:u(e[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:e[`zone-defaults-soa-refresh`],retry:e[`zone-defaults-soa-retry`],rname:u(e[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:e[`zone-defaults-soa-ttl`]},zone_mode:u(e[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:u(e[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.dns.settings.account.edit({...t,account_id:d})),{successLabel:`Updated`});return}let p=o({enforce_dns_only:e[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:e[`zone-defaults-flatten-all-cnames`],foundation_dns:e[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:u(e[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:e[`zone-defaults-multi-provider`],ns_ttl:e[`zone-defaults-ns-ttl`],secondary_overrides:e[`zone-defaults-secondary-overrides`],soa:{expire:e[`zone-defaults-soa-expire`],min_ttl:e[`zone-defaults-soa-min-ttl`],mname:u(e[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:e[`zone-defaults-soa-refresh`],retry:e[`zone-defaults-soa-retry`],rname:u(e[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:e[`zone-defaults-soa-ttl`]},zone_mode:u(e[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:u(e[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}});s(await l(`Updating`,async()=>r.dns.settings.account.edit({...p,account_id:d})),{successLabel:`Updated`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get`,describe:`Show DNS settings for an account`,builder:de,handler:async e=>{if(e.dryRun){c({command:`cf dns settings account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.settings.account.get({account_id:a})),{successLabel:`Loaded`})}};function pe(e){return e.option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`create`,describe:`Create Internal DNS View for an account`,builder:pe,handler:async e=>{if(e.dryRun){c({command:`cf dns settings account views create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings/views`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`),zones:e.zones}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.dns.settings.account.views.create({...t,account_id:d})),{successLabel:`Created`});return}let p=o({name:u(e.name,`name`,`text`),zones:e.zones});s(await l(`Creating`,async()=>r.dns.settings.account.views.create({...p,account_id:d})),{successLabel:`Created`})}};function he(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ge={command:`delete <view-id>`,describe:`Delete an existing Internal DNS View`,builder:he,handler:async e=>{if(e.dryRun){c({command:`cf dns settings account views delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings/views/${e[`view-id`]==null?`<view-id>`:encodeURIComponent(String(e[`view-id`]))}`,pathParams:{"view-id":String(e[`view-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
21
+ `);return}s(await l(`Deleting`,async()=>r.dns.settings.account.views.delete({account_id:a,view_id:e[`view-id`]})),{successLabel:`Deleted`})}};function _e(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`edit <view-id>`,describe:`Update an existing Internal DNS View`,builder:_e,handler:async e=>{if(e.dryRun){c({command:`cf dns settings account views edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings/views/${e[`view-id`]==null?`<view-id>`:encodeURIComponent(String(e[`view-id`]))}`,pathParams:{"view-id":String(e[`view-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`),zones:e.zones}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.dns.settings.account.views.edit({...t,account_id:d,view_id:e[`view-id`]})),{successLabel:`Updated`});return}let p=o({name:u(e.name,`name`,`text`),zones:e.zones});s(await l(`Updating`,async()=>r.dns.settings.account.views.edit({...p,account_id:d,view_id:e[`view-id`]})),{successLabel:`Updated`})}};function ye(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <view-id>`,describe:`Get DNS Internal View`,builder:ye,handler:async e=>{if(e.dryRun){c({command:`cf dns settings account views get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings/views/${e[`view-id`]==null?`<view-id>`:encodeURIComponent(String(e[`view-id`]))}`,pathParams:{"view-id":String(e[`view-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.settings.account.views.get({account_id:a,view_id:e[`view-id`]})),{successLabel:`Loaded`})}};function xe(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS view name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS view name.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS view name.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS view name.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS view name.`}).option(`zone-id`,{type:`string`,description:`A zone ID that exists in the zones list for the view.`}).option(`zone-name`,{type:`string`,description:`A zone name that exists in the zones list for the view.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS views per page.`}).option(`order`,{type:`string`,description:`Field to order DNS views by.`,choices:[`name`,`created_on`,`modified_on`]}).option(`direction`,{type:`string`,description:`Direction to order DNS views in.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List DNS Internal Views for an Account`,builder:h(xe),handler:async e=>{let r={name:e.name,"name.exact":e[`name-exact`],"name.contains":e[`name-contains`],"name.startswith":e[`name-startswith`],"name.endswith":e[`name-endswith`],zone_id:e[`zone-id`],zone_name:e[`zone-name`],match:e.match,page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){c({command:`cf dns settings account views list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_settings/views`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?f:await t();e.accountId=o,s(await l(`Loading`,async()=>a.dns.settings.account.views.list({account_id:o,...r})),{successLabel:`Loaded`})}},Ce={command:`views`,describe:`Operations for settings.account.views`,builder:e=>e.command(me).command(ge).command(ve).command(be).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`account`,describe:`Operations for settings.account`,builder:e=>e.command(ue).command(fe).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.option(`flatten-all-cnames`,{type:`boolean`,description:`Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.`}).option(`foundation-dns`,{type:`boolean`,description:`Whether to enable Foundation DNS Advanced Nameservers on the zone.`}).option(`internal-dns-reference-zone-id`,{type:`string`,description:`The ID of the zone to fallback to.`}).option(`multi-provider`,{type:`boolean`,description:`Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.`}).option(`ns-ttl`,{type:`number`,description:`The time to live (TTL) of the zone's nameserver (NS) records.`}).option(`secondary-overrides`,{type:`boolean`,description:`Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.`}).option(`soa-expire`,{type:`number`,description:`Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.`}).option(`soa-min-ttl`,{type:`number`,description:`The time to live (TTL) for negative caching of records within the zone.`}).option(`soa-mname`,{type:`string`,description:`The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.`}).option(`soa-refresh`,{type:`number`,description:`Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.`}).option(`soa-retry`,{type:`number`,description:`Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.`}).option(`soa-rname`,{type:`string`,description:`The email address of the zone administrator, with the first label representing the local part of the email address.`}).option(`soa-ttl`,{type:`number`,description:`The time to live (TTL) of the SOA record itself.`}).option(`zone-mode`,{type:`string`,description:`Whether the zone mode is a regular or CDN/DNS only zone.`,choices:[`standard`,`cdn_only`,`dns_only`]}).option(`nameservers-ns-set`,{type:`number`,description:`Configured nameserver set to be used for this zone`}).option(`nameservers-type`,{type:`string`,description:`Nameserver type`,choices:[`cloudflare.standard`,`custom.account`,`custom.tenant`,`custom.zone`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`edit`,describe:`Update DNS settings for a zone`,builder:Te,handler:async t=>{if(t.dryRun){c({command:`cf dns settings zone edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({flatten_all_cnames:t[`flatten-all-cnames`],foundation_dns:t[`foundation-dns`],internal_dns:{reference_zone_id:u(t[`internal-dns-reference-zone-id`],`internal-dns-reference-zone-id`,`text`)},multi_provider:t[`multi-provider`],ns_ttl:t[`ns-ttl`],secondary_overrides:t[`secondary-overrides`],soa:{expire:t[`soa-expire`],min_ttl:t[`soa-min-ttl`],mname:u(t[`soa-mname`],`soa-mname`,`text`),refresh:t[`soa-refresh`],retry:t[`soa-retry`],rname:u(t[`soa-rname`],`soa-rname`,`text`),ttl:t[`soa-ttl`]},zone_mode:u(t[`zone-mode`],`zone-mode`,`text`),nameservers:{ns_set:t[`nameservers-ns-set`],type:u(t[`nameservers-type`],`nameservers-type`,`text`)}}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.dns.settings.zone.edit({...e,zone_id:r})),{successLabel:`Updated`});return}let d=o({flatten_all_cnames:t[`flatten-all-cnames`],foundation_dns:t[`foundation-dns`],internal_dns:{reference_zone_id:u(t[`internal-dns-reference-zone-id`],`internal-dns-reference-zone-id`,`text`)},multi_provider:t[`multi-provider`],ns_ttl:t[`ns-ttl`],secondary_overrides:t[`secondary-overrides`],soa:{expire:t[`soa-expire`],min_ttl:t[`soa-min-ttl`],mname:u(t[`soa-mname`],`soa-mname`,`text`),refresh:t[`soa-refresh`],retry:t[`soa-retry`],rname:u(t[`soa-rname`],`soa-rname`,`text`),ttl:t[`soa-ttl`]},zone_mode:u(t[`zone-mode`],`zone-mode`,`text`),nameservers:{ns_set:t[`nameservers-ns-set`],type:u(t[`nameservers-type`],`nameservers-type`,`text`)}});s(await l(`Updating`,async()=>n.dns.settings.zone.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function De(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`get`,describe:`Show DNS settings for a zone`,builder:De,handler:async t=>{if(t.dryRun){c({command:`cf dns settings zone get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.settings.zone.get({zone_id:r})),{successLabel:`Loaded`})}},ke={command:`zone`,describe:`Operations for settings.zone`,builder:e=>e.command(Ee).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ae={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(we).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`get`,describe:`Get the current DNS record usage and quota for an account. May include internal DNS usage and quota.`,builder:je,handler:async e=>{if(e.dryRun){c({command:`cf dns usage account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/dns_records/usage`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.usage.account.get({account_id:a})),{successLabel:`Loaded`})}},Ne={command:`account`,describe:`Operations for usage.account`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`get`,describe:`Get the current DNS record usage for a zone, including the number of records and the quota limit.`,builder:Pe,handler:async t=>{if(t.dryRun){c({command:`cf dns usage zone get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/usage`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.usage.zone.get({zone_id:r})),{successLabel:`Loaded`})}},Ie={command:`zone`,describe:`Operations for usage.zone`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Le={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(Ne).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Re(e){return e.option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).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 ze={command:`create`,describe:`Create ACL.`,builder:Re,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({ip_range:u(e[`ip-range`],`ip-range`,`text`),name:u(e.name,`name`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.dns.zoneTransfers.acls.create({...t,account_id:d})),{successLabel:`Created`});return}e[`ip-range`]===void 0&&(e[`ip-range`]=await p(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),e.name===void 0&&(e.name=await p(`name`,`The name of the acl.`));let m=o({ip_range:u(e[`ip-range`],`ip-range`,`text`),name:u(e.name,`name`,`text`)});s(await l(`Creating`,async()=>r.dns.zoneTransfers.acls.create({...m,account_id:d})),{successLabel:`Created`})}};function Be(e){return e.positional(`acl-id`,{type:`string`,description:`Acl 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 Ve={command:`delete <acl-id>`,describe:`Delete ACL.`,builder:Be,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"acl-id":String(e[`acl-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
22
+ `);return}s(await l(`Deleting`,async()=>r.dns.zoneTransfers.acls.delete({account_id:a,acl_id:e[`acl-id`]})),{successLabel:`Deleted`})}};function He(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`get <acl-id>`,describe:`Get ACL.`,builder:He,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"acl-id":String(e[`acl-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.zoneTransfers.acls.get({account_id:a,acl_id:e[`acl-id`]})),{successLabel:`Loaded`})}};function We(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`list`,describe:`List ACLs.`,builder:We,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.zoneTransfers.acls.list({account_id:a})),{successLabel:`Loaded`})}};function Ke(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).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 qe={command:`update <acl-id>`,describe:`Modify ACL.`,builder:Ke,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"acl-id":String(e[`acl-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({ip_range:u(e[`ip-range`],`ip-range`,`text`),name:u(e.name,`name`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.dns.zoneTransfers.acls.update({body:t,account_id:d,acl_id:e[`acl-id`]})),{successLabel:`Updated`});return}e[`ip-range`]===void 0&&(e[`ip-range`]=await p(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),e.name===void 0&&(e.name=await p(`name`,`The name of the acl.`));let m=o({ip_range:u(e[`ip-range`],`ip-range`,`text`),name:u(e.name,`name`,`text`)});s(await l(`Updating`,async()=>r.dns.zoneTransfers.acls.update({body:m,account_id:d,acl_id:e[`acl-id`]})),{successLabel:`Updated`})}},Je={command:`acls`,describe:`Operations for zone-transfers.acls`,builder:e=>e.command(ze).command(Ve).command(Ue).command(Ge).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`create`,describe:`Sends AXFR zone transfer request to primary nameserver(s).`,builder:Ye,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers force-axfr create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/force_axfr`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Creating`,async()=>n.dns.zoneTransfers.forceAxfr.create({zone_id:r})),{successLabel:`Created`})}},Ze={command:`force-axfr`,describe:`Operations for zone-transfers.force-axfr`,builder:e=>e.command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
23
+ Not applicable for primary zones.`,default:86400}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $e={command:`create`,describe:`Create secondary zone configuration for incoming zone transfers.`,builder:Qe,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers incoming create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({auto_refresh_seconds:t[`auto-refresh-seconds`],name:u(t.name,`name`,`text`),peers:t.peers}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.dns.zoneTransfers.incoming.create({body:e,zone_id:r})),{successLabel:`Created`});return}if(t[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(t.name===void 0&&(t.name=await p(`name`,`Zone name.`)),t.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let d=o({auto_refresh_seconds:t[`auto-refresh-seconds`],name:u(t.name,`name`,`text`),peers:t.peers});s(await l(`Creating`,async()=>n.dns.zoneTransfers.incoming.create({body:d,zone_id:r})),{successLabel:`Created`})}};function et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tt={command:`delete`,describe:`Delete secondary zone configuration for incoming zone transfers.`,builder:et,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers incoming delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,!await m({force:!!t.force})){process.stderr.write(`Aborted.
24
+ `);return}s(await l(`Deleting`,async()=>n.dns.zoneTransfers.incoming.delete({zone_id:r})),{successLabel:`Deleted`})}};function nt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`get`,describe:`Get secondary zone configuration for incoming zone transfers.`,builder:nt,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers incoming get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.zoneTransfers.incoming.get({zone_id:r})),{successLabel:`Loaded`})}};function it(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
25
+ Not applicable for primary zones.`}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 at={command:`update`,describe:`Update secondary zone configuration for incoming zone transfers.`,builder:it,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers incoming update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({auto_refresh_seconds:t[`auto-refresh-seconds`],name:u(t.name,`name`,`text`),peers:t.peers}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.dns.zoneTransfers.incoming.update({body:e,zone_id:r})),{successLabel:`Updated`});return}if(t[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(t.name===void 0&&(t.name=await p(`name`,`Zone name.`)),t.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let d=o({auto_refresh_seconds:t[`auto-refresh-seconds`],name:u(t.name,`name`,`text`),peers:t.peers});s(await l(`Updating`,async()=>n.dns.zoneTransfers.incoming.update({body:d,zone_id:r})),{successLabel:`Updated`})}},ot={command:`incoming`,describe:`Operations for zone-transfers.incoming`,builder:e=>e.command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 ct={command:`create`,describe:`Create primary zone configuration for outgoing zone transfers.`,builder:st,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`),peers:t.peers}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.dns.zoneTransfers.outgoing.create({body:e,zone_id:r})),{successLabel:`Created`});return}if(t.name===void 0&&(t.name=await p(`name`,`Zone name.`)),t.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let d=o({name:u(t.name,`name`,`text`),peers:t.peers});s(await l(`Creating`,async()=>n.dns.zoneTransfers.outgoing.create({body:d,zone_id:r})),{successLabel:`Created`})}};function lt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ut={command:`delete`,describe:`Delete primary zone configuration for outgoing zone transfers.`,builder:lt,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,!await m({force:!!t.force})){process.stderr.write(`Aborted.
26
+ `);return}s(await l(`Deleting`,async()=>n.dns.zoneTransfers.outgoing.delete({zone_id:r})),{successLabel:`Deleted`})}};function dt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ft={command:`disable`,describe:`Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone.`,builder:dt,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing/disable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,!await m({force:!!t.force,message:`This operation turns off outgoing zone transfers for the primary zone, which means secondary zones will stop receiving updates.`})){process.stderr.write(`Aborted.
27
+ `);return}s(await l(`Deleting`,async()=>n.dns.zoneTransfers.outgoing.disable({zone_id:r})),{successLabel:`Deleted`})}};function pt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mt={command:`enable`,describe:`Enable outgoing zone transfers for primary zone.`,builder:pt,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing/enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Creating`,async()=>n.dns.zoneTransfers.outgoing.enable({zone_id:r})),{successLabel:`Created`})}};function ht(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gt={command:`force-notify`,describe:`Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.`,builder:ht,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing force-notify`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing/force_notify`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Creating`,async()=>n.dns.zoneTransfers.outgoing.forceNotify({zone_id:r})),{successLabel:`Created`})}};function _t(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`get`,describe:`Get primary zone configuration for outgoing zone transfers.`,builder:_t,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.zoneTransfers.outgoing.get({zone_id:r})),{successLabel:`Loaded`})}};function yt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bt={command:`get`,describe:`Get primary zone transfer status.`,builder:yt,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing/status`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.dns.zoneTransfers.outgoing.status.get({zone_id:r})),{successLabel:`Loaded`})}},xt={command:`status`,describe:`Operations for zone-transfers.outgoing.status`,builder:e=>e.command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function St(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).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 Ct={command:`update`,describe:`Update primary zone configuration for outgoing zone transfers.`,builder:St,handler:async t=>{if(t.dryRun){c({command:`cf dns zone-transfers outgoing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`),peers:t.peers}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.dns.zoneTransfers.outgoing.update({body:e,zone_id:r})),{successLabel:`Updated`});return}if(t.name===void 0&&(t.name=await p(`name`,`Zone name.`)),t.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let d=o({name:u(t.name,`name`,`text`),peers:t.peers});s(await l(`Updating`,async()=>n.dns.zoneTransfers.outgoing.update({body:d,zone_id:r})),{successLabel:`Updated`})}},wt={command:`outgoing`,describe:`Operations for zone-transfers.outgoing`,builder:e=>e.command(ct).command(ut).command(ft).command(mt).command(gt).command(vt).command(Ct).command(xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(e){return e.option(`name`,{type:`string`,description:`The name of the peer.`}).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 Et={command:`create`,describe:`Create Peer.`,builder:Tt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers peers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({name:u(e.name,`name`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.dns.zoneTransfers.peers.create({...t,account_id:d})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await p(`name`,`The name of the peer.`));let m=o({name:u(e.name,`name`,`text`)});s(await l(`Creating`,async()=>r.dns.zoneTransfers.peers.create({...m,account_id:d})),{successLabel:`Created`})}};function Dt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer 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 Ot={command:`delete <peer-id>`,describe:`Delete Peer.`,builder:Dt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers peers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/peers/${e[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(e[`peer-id`]))}`,pathParams:{"peer-id":String(e[`peer-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
28
+ `);return}s(await l(`Deleting`,async()=>r.dns.zoneTransfers.peers.delete({account_id:a,peer_id:e[`peer-id`]})),{successLabel:`Deleted`})}};function kt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`get <peer-id>`,describe:`Get Peer.`,builder:kt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers peers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/peers/${e[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(e[`peer-id`]))}`,pathParams:{"peer-id":String(e[`peer-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.zoneTransfers.peers.get({account_id:a,peer_id:e[`peer-id`]})),{successLabel:`Loaded`})}};function jt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`list`,describe:`List Peers.`,builder:jt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers peers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.zoneTransfers.peers.list({account_id:a})),{successLabel:`Loaded`})}};function Nt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`ip`,{type:`string`,description:`IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to.`}).option(`ixfr-enable`,{type:`boolean`,description:`Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones.`}).option(`name`,{type:`string`,description:`The name of the peer.`}).option(`port`,{type:`number`,description:`DNS port of primary or secondary nameserver, depending on what zone this peer is linked to.`}).option(`tsig-id`,{type:`string`,description:`TSIG authentication will be used for zone transfer if configured.`}).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 $={command:`update <peer-id>`,describe:`Modify Peer.`,builder:Nt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers peers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/peers/${e[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(e[`peer-id`]))}`,pathParams:{"peer-id":String(e[`peer-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({ip:u(e.ip,`ip`,`text`),ixfr_enable:e[`ixfr-enable`],name:u(e.name,`name`,`text`),port:e.port,tsig_id:u(e[`tsig-id`],`tsig-id`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.dns.zoneTransfers.peers.update({body:t,account_id:d,peer_id:e[`peer-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await p(`name`,`The name of the peer.`));let m=o({ip:u(e.ip,`ip`,`text`),ixfr_enable:e[`ixfr-enable`],name:u(e.name,`name`,`text`),port:e.port,tsig_id:u(e[`tsig-id`],`tsig-id`,`text`)});s(await l(`Updating`,async()=>r.dns.zoneTransfers.peers.update({body:m,account_id:d,peer_id:e[`peer-id`]})),{successLabel:`Updated`})}},Pt={command:`peers`,describe:`Operations for zone-transfers.peers`,builder:e=>e.command(Et).command(Ot).command(At).command(Mt).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ft(e){return e.option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const It={command:`create`,describe:`Create TSIG.`,builder:Ft,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers tsigs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({algo:u(e.algo,`algo`,`text`),name:u(e.name,`name`,`text`),secret:u(e.secret,`secret`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.dns.zoneTransfers.tsigs.create({body:t,account_id:d})),{successLabel:`Created`});return}e.algo===void 0&&(e.algo=await p(`algo`,`TSIG algorithm.`)),e.name===void 0&&(e.name=await p(`name`,`TSIG key name.`)),e.secret===void 0&&(e.secret=await p(`secret`,`TSIG secret.`,{kind:`secret`}));let m=o({algo:u(e.algo,`algo`,`text`),name:u(e.name,`name`,`text`),secret:u(e.secret,`secret`,`text`)});s(await l(`Creating`,async()=>r.dns.zoneTransfers.tsigs.create({body:m,account_id:d})),{successLabel:`Created`})}};function Lt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig 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 Rt={command:`delete <tsig-id>`,describe:`Delete TSIG.`,builder:Lt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers tsigs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/tsigs/${e[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(e[`tsig-id`]))}`,pathParams:{"tsig-id":String(e[`tsig-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
29
+ `);return}s(await l(`Deleting`,async()=>r.dns.zoneTransfers.tsigs.delete({account_id:a,tsig_id:e[`tsig-id`]})),{successLabel:`Deleted`})}};function zt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bt={command:`get <tsig-id>`,describe:`Get TSIG.`,builder:zt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers tsigs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/tsigs/${e[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(e[`tsig-id`]))}`,pathParams:{"tsig-id":String(e[`tsig-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.zoneTransfers.tsigs.get({account_id:a,tsig_id:e[`tsig-id`]})),{successLabel:`Loaded`})}};function Vt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ht={command:`list`,describe:`List TSIGs.`,builder:Vt,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers tsigs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.dns.zoneTransfers.tsigs.list({account_id:a})),{successLabel:`Loaded`})}};function Ut(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Wt={command:`update <tsig-id>`,describe:`Modify TSIG.`,builder:Ut,handler:async e=>{if(e.dryRun){c({command:`cf dns zone-transfers tsigs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/secondary_dns/tsigs/${e[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(e[`tsig-id`]))}`,pathParams:{"tsig-id":String(e[`tsig-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({algo:u(e.algo,`algo`,`text`),name:u(e.name,`name`,`text`),secret:u(e.secret,`secret`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.dns.zoneTransfers.tsigs.update({body:t,account_id:d,tsig_id:e[`tsig-id`]})),{successLabel:`Updated`});return}e.algo===void 0&&(e.algo=await p(`algo`,`TSIG algorithm.`)),e.name===void 0&&(e.name=await p(`name`,`TSIG key name.`)),e.secret===void 0&&(e.secret=await p(`secret`,`TSIG secret.`,{kind:`secret`}));let m=o({algo:u(e.algo,`algo`,`text`),name:u(e.name,`name`,`text`),secret:u(e.secret,`secret`,`text`)});s(await l(`Updating`,async()=>r.dns.zoneTransfers.tsigs.update({body:m,account_id:d,tsig_id:e[`tsig-id`]})),{successLabel:`Updated`})}},Gt={command:`tsigs`,describe:`Operations for zone-transfers.tsigs`,builder:e=>e.command(It).command(Rt).command(Bt).command(Ht).command(Wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Kt={command:`zone-transfers`,describe:`Operations for zone-transfers`,builder:e=>e.command(Je).command(Ze).command(ot).command(wt).command(Pt).command(Gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qt={command:`dns`,describe:`DNS management API for zones, records, DNSSEC, analytics, and zone transfers`,builder:e=>e.command(S).command(M).command(ce).command(Ae).command(Le).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{qt as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-CL8I-7YK.mjs";import{t as o}from"./local-CYc9q7l2.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of 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:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import{N as e,O as t,P as n}from"./oauth-B5k80sip.mjs";import{n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{n as d,r as f,t as p}from"./prompt-q3B7sM2A.mjs";import{t as m}from"./cli-types-DGgEbf8K.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).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 te={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async e=>{if(e.dryRun){s({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({email:l(e.email,`email`,`text`)}):i(e.body)});return}let d=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.emailRouting.addresses.create({...t,account_id:p})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await f(`email`,`The contact email address of the user.`));let m=a({email:l(e.email,`email`,`text`)});o(await c(`Creating`,async()=>d.emailRouting.addresses.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await p({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}o(await c(`Deleting`,async()=>i.emailRouting.addresses.delete({account_id:a,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:_,handler:async e=>{if(e.dryRun){s({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.emailRouting.addresses.get({account_id:a,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists existing destination addresses.`,builder:m(y),handler:async e=>{let i={page:e.page,per_page:e[`per-page`],direction:e.direction,verified:e.verified};if(e.dryRun){s({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.emailRouting.addresses.list({account_id:l,...i})),{successLabel:`Loaded`})}};function x(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?a({status:l(e.status,`status`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Updating`,async()=>f.emailRouting.addresses.update({...t,account_id:p,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Updated`});return}e.status===void 0&&(e.status=await d(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=a({status:l(e.status,`status`,`text`)});o(await c(`Updating`,async()=>f.emailRouting.addresses.update({...m,account_id:p,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Updated`})}},C={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(te).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:w,handler:async t=>{if(t.dryRun){s({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=i,!await p({force:!!t.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
4
+ `);return}o(await c(`Deleting`,async()=>n.emailRouting.disable({zone_id:i})),{successLabel:`Deleted`})}};function E(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:E,handler:async t=>{if(t.dryRun){s({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.emailRouting.dns.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>n.emailRouting.dns.create({body:d,zone_id:u})),{successLabel:`Created`})}};function O(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).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 k={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:O,handler:async t=>{if(t.dryRun){s({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,!await p({force:!!t.force})){process.stderr.write(`Aborted.
5
+ `);return}if(t.body){let e=i(t.body);o(await c(`Deleting`,async()=>n.emailRouting.dns.delete({body:e,zone_id:u})),{successLabel:`Deleted`});return}let d=a({name:l(t.name,`name`,`text`)});o(await c(`Deleting`,async()=>n.emailRouting.dns.delete({body:d,zone_id:u})),{successLabel:`Deleted`})}};function A(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:A,handler:async t=>{if(t.dryRun){s({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.emailRouting.dns.edit({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>n.emailRouting.dns.edit({body:d,zone_id:u})),{successLabel:`Updated`})}};function M(e){return e.option(`subdomain`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:M,handler:async t=>{let n={subdomain:t.subdomain};if(t.dryRun){s({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.emailRouting.dns.get({zone_id:a,...n})),{successLabel:`Loaded`})}},P={command:`dns`,describe:`Operations for dns`,builder:e=>e.command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).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 I={command:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:F,handler:async t=>{if(t.dryRun){s({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({enabled:t.enabled,skip_wizard:t[`skip-wizard`],support_subaddress:t[`support-subaddress`]}):i(t.body)});return}let n=await r(t),l=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.emailRouting.edit({...e,zone_id:l})),{successLabel:`Updated`});return}let u=a({enabled:t.enabled,skip_wizard:t[`skip-wizard`],support_subaddress:t[`support-subaddress`]});o(await c(`Updating`,async()=>n.emailRouting.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:L,handler:async t=>{if(t.dryRun){s({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Creating`,async()=>n.emailRouting.enable({zone_id:i})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:z,handler:async t=>{if(t.dryRun){s({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.emailRouting.get({zone_id:i})),{successLabel:`Loaded`})}};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:`Get information on the default catch-all routing rule.`,builder:V,handler:async t=>{if(t.dryRun){s({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.emailRouting.rules.catchAlls.get({zone_id:i})),{successLabel:`Loaded`})}};function U(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to specific destination address. Forward actions require all destination addresses to be verified.`,builder:U,handler:async t=>{if(t.dryRun){s({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({enabled:t.enabled,name:l(t.name,`name`,`text`),owner_worker_tag:l(t[`owner-worker-tag`],`owner-worker-tag`,`text`),source:l(t.source,`source`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.emailRouting.rules.catchAlls.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=a({enabled:t.enabled,name:l(t.name,`name`,`text`),owner_worker_tag:l(t[`owner-worker-tag`],`owner-worker-tag`,`text`),source:l(t.source,`source`,`text`)});o(await c(`Updating`,async()=>n.emailRouting.rules.catchAlls.update({...d,zone_id:u})),{successLabel:`Updated`})}},G={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require all destination addresses to be verified.`,builder:K,handler:async t=>{if(t.dryRun){s({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({enabled:t.enabled,name:l(t.name,`name`,`text`),owner_worker_tag:l(t[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:t.priority,source:l(t.source,`source`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.emailRouting.rules.create({...e,zone_id:u})),{successLabel:`Created`});return}let d=a({enabled:t.enabled,name:l(t.name,`name`,`text`),owner_worker_tag:l(t[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:t.priority,source:l(t.source,`source`,`text`)});o(await c(`Creating`,async()=>n.emailRouting.rules.create({...d,zone_id:u})),{successLabel:`Created`})}};function J(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:J,handler:async t=>{if(t.dryRun){s({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules/${t[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(t[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(t[`rule-identifier`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=i,!await p({force:!!t.force})){process.stderr.write(`Aborted.
6
+ `);return}o(await c(`Deleting`,async()=>n.emailRouting.rules.delete({zone_id:i,rule_identifier:t[`rule-identifier`]})),{successLabel:`Deleted`})}};function X(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <rule-identifier>`,describe:`Get information for a specific routing rule already created.`,builder:X,handler:async t=>{if(t.dryRun){s({command:`cf email-routing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules/${t[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(t[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(t[`rule-identifier`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.emailRouting.rules.get({zone_id:i,rule_identifier:t[`rule-identifier`]})),{successLabel:`Loaded`})}};function Q(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list-account`,describe:`Lists existing routing rules across all zones in the account.`,builder:m(Q),handler:async e=>{let i={page:e.page,per_page:e[`per-page`],enabled:e.enabled};if(e.dryRun){s({command:`cf email-routing rules list-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/rules`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.emailRouting.rules.listAccount({account_id:l,...i})),{successLabel:`Loaded`})}};function re(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Lists existing routing rules.`,builder:m(re),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],enabled:t.enabled};if(t.dryRun){s({command:`cf email-routing rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.emailRouting.rules.list({zone_id:a,...n})),{successLabel:`Loaded`})}};function ae(e){return e.option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`plan`,describe:`Computes the Email Routing rule changes that would be needed to reconcile a Wrangler-managed desired ruleset. This endpoint is read-only and does not create, update, or delete rules.`,builder:ae,handler:async e=>{if(e.dryRun){s({command:`cf email-routing rules plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/rules/plan`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({owner_worker_tag:l(e[`owner-worker-tag`],`owner-worker-tag`,`text`)}):i(e.body)});return}let d=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.emailRouting.rules.plan({...t,account_id:p})),{successLabel:`Created`});return}e[`owner-worker-tag`]===void 0&&(e[`owner-worker-tag`]=await f(`owner-worker-tag`,"Public tag (script_tag) of the Worker that owns this rule. Required when `source` is `wrangler`. "));let m=a({owner_worker_tag:l(e[`owner-worker-tag`],`owner-worker-tag`,`text`)});o(await c(`Creating`,async()=>d.emailRouting.rules.plan({...m,account_id:p})),{successLabel:`Created`})}};function se(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`update <rule-identifier>`,describe:`Update actions and matches, or enable/disable specific routing rules. Forward actions require all destination addresses to be verified.`,builder:se,handler:async t=>{if(t.dryRun){s({command:`cf email-routing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules/${t[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(t[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(t[`rule-identifier`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({enabled:t.enabled,name:l(t.name,`name`,`text`),owner_worker_tag:l(t[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:t.priority,source:l(t.source,`source`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.emailRouting.rules.update({...e,zone_id:u,rule_identifier:t[`rule-identifier`]})),{successLabel:`Updated`});return}let d=a({enabled:t.enabled,name:l(t.name,`name`,`text`),owner_worker_tag:l(t[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:t.priority,source:l(t.source,`source`,`text`)});o(await c(`Updating`,async()=>n.emailRouting.rules.update({...d,zone_id:u,rule_identifier:t[`rule-identifier`]})),{successLabel:`Updated`})}},le={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(q).command(Y).command(Z).command(ie).command(ne).command(oe).command(ce).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`create`,describe:`Creates a new email suppression for the specified account.`,builder:ue,handler:async e=>{if(e.dryRun){s({command:`cf email-routing suppression routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/suppression`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({email:l(e.email,`email`,`text`),expires_at:l(e[`expires-at`],`expires-at`,`text`)}):i(e.body)});return}let d=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.emailRouting.suppression.routing.create({...t,account_id:p})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await f(`email`,`The email field`));let m=a({email:l(e.email,`email`,`text`),expires_at:l(e[`expires-at`],`expires-at`,`text`)});o(await c(`Creating`,async()=>d.emailRouting.suppression.routing.create({...m,account_id:p})),{successLabel:`Created`})}};function fe(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression 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 pe={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified account.`,builder:fe,handler:async e=>{if(e.dryRun){s({command:`cf email-routing suppression routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await p({force:!!e.force})){process.stderr.write(`Aborted.
7
+ `);return}o(await c(`Deleting`,async()=>i.emailRouting.suppression.routing.delete({account_id:a,suppression_id:e[`suppression-id`]})),{successLabel:`Deleted`})}};function me(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified account.`,builder:me,handler:async e=>{if(e.dryRun){s({command:`cf email-routing suppression routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.emailRouting.suppression.routing.get({account_id:a,suppression_id:e[`suppression-id`]})),{successLabel:`Loaded`})}};function ge(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Lists email suppressions for the specified account.`,builder:m(ge),handler:async e=>{let i={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){s({command:`cf email-routing suppression routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/routing/suppression`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.emailRouting.suppression.routing.list({account_id:l,...i})),{successLabel:`Loaded`})}},ve={command:`routing`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(de).command(pe).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`create`,describe:`Creates a new email suppression for the specified account.`,builder:ye,handler:async e=>{if(e.dryRun){s({command:`cf email-routing suppression sending create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/sending/suppression`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({email:l(e.email,`email`,`text`),expires_at:l(e[`expires-at`],`expires-at`,`text`)}):i(e.body)});return}let d=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.emailRouting.suppression.sending.create({...t,account_id:p})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await f(`email`,`The email field`));let m=a({email:l(e.email,`email`,`text`),expires_at:l(e[`expires-at`],`expires-at`,`text`)});o(await c(`Creating`,async()=>d.emailRouting.suppression.sending.create({...m,account_id:p})),{successLabel:`Created`})}};function xe(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression 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 Se={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified account.`,builder:xe,handler:async e=>{if(e.dryRun){s({command:`cf email-routing suppression sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await p({force:!!e.force})){process.stderr.write(`Aborted.
8
+ `);return}o(await c(`Deleting`,async()=>i.emailRouting.suppression.sending.delete({account_id:a,suppression_id:e[`suppression-id`]})),{successLabel:`Deleted`})}};function Ce(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified account.`,builder:Ce,handler:async e=>{if(e.dryRun){s({command:`cf email-routing suppression sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.emailRouting.suppression.sending.get({account_id:a,suppression_id:e[`suppression-id`]})),{successLabel:`Loaded`})}};function Te(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`list`,describe:`Lists email suppressions for the specified account.`,builder:m(Te),handler:async e=>{let i={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){s({command:`cf email-routing suppression sending list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/email/sending/suppression`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.emailRouting.suppression.sending.list({account_id:l,...i})),{successLabel:`Loaded`})}},De={command:`sending`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(be).command(Se).command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ke={command:`create`,describe:`Creates a new email suppression for the specified zone.`,builder:Oe,handler:async t=>{if(t.dryRun){s({command:`cf email-routing suppression zone routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/suppression`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({email:l(t.email,`email`,`text`),expires_at:l(t[`expires-at`],`expires-at`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.emailRouting.suppression.zone.routing.create({...e,zone_id:u})),{successLabel:`Created`});return}t.email===void 0&&(t.email=await f(`email`,`The email field`));let d=a({email:l(t.email,`email`,`text`),expires_at:l(t[`expires-at`],`expires-at`,`text`)});o(await c(`Creating`,async()=>n.emailRouting.suppression.zone.routing.create({...d,zone_id:u})),{successLabel:`Created`})}};function Ae(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression 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 je={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified zone.`,builder:Ae,handler:async t=>{if(t.dryRun){s({command:`cf email-routing suppression zone routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=i,!await p({force:!!t.force})){process.stderr.write(`Aborted.
9
+ `);return}o(await c(`Deleting`,async()=>n.emailRouting.suppression.zone.routing.delete({zone_id:i,suppression_id:t[`suppression-id`]})),{successLabel:`Deleted`})}};function Me(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified zone.`,builder:Me,handler:async t=>{if(t.dryRun){s({command:`cf email-routing suppression zone routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.emailRouting.suppression.zone.routing.get({zone_id:i,suppression_id:t[`suppression-id`]})),{successLabel:`Loaded`})}};function Pe(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`list`,describe:`Lists email suppressions for the specified zone.`,builder:m(Pe),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){s({command:`cf email-routing suppression zone routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/suppression`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.emailRouting.suppression.zone.routing.list({zone_id:a,...n})),{successLabel:`Loaded`})}},Ie={command:`routing`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(ke).command(je).command(Ne).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Re={command:`create`,describe:`Creates a new email suppression for the specified zone.`,builder:Le,handler:async t=>{if(t.dryRun){s({command:`cf email-routing suppression zone sending create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/suppression`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({email:l(t.email,`email`,`text`),expires_at:l(t[`expires-at`],`expires-at`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.emailRouting.suppression.zone.sending.create({...e,zone_id:u})),{successLabel:`Created`});return}t.email===void 0&&(t.email=await f(`email`,`The email field`));let d=a({email:l(t.email,`email`,`text`),expires_at:l(t[`expires-at`],`expires-at`,`text`)});o(await c(`Creating`,async()=>n.emailRouting.suppression.zone.sending.create({...d,zone_id:u})),{successLabel:`Created`})}};function ze(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression 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 Be={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified zone.`,builder:ze,handler:async t=>{if(t.dryRun){s({command:`cf email-routing suppression zone sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=i,!await p({force:!!t.force})){process.stderr.write(`Aborted.
10
+ `);return}o(await c(`Deleting`,async()=>n.emailRouting.suppression.zone.sending.delete({zone_id:i,suppression_id:t[`suppression-id`]})),{successLabel:`Deleted`})}};function Ve(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified zone.`,builder:Ve,handler:async t=>{if(t.dryRun){s({command:`cf email-routing suppression zone sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.emailRouting.suppression.zone.sending.get({zone_id:i,suppression_id:t[`suppression-id`]})),{successLabel:`Loaded`})}};function He(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`list`,describe:`Lists email suppressions for the specified zone.`,builder:m(He),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){s({command:`cf email-routing suppression zone sending list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/suppression`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let i=await r(t),a=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=a,o(await c(`Loading`,async()=>i.emailRouting.suppression.zone.sending.list({zone_id:a,...n})),{successLabel:`Loaded`})}},We={command:`sending`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(Re).command(Be).command($).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ge={command:`zone`,describe:`Operations for suppression.zone`,builder:e=>e.command(Ie).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ke={command:`suppression`,describe:`Operations for suppression`,builder:e=>e.command(ve).command(De).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Je={command:`unlock`,describe:`Unlock MX records previously locked by Email Routing. Deprecated - use PATCH /zones/{zone_id}/email/routing/dns instead.`,builder:qe,handler:async t=>{if(t.dryRun){s({command:`cf email-routing unlock`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/unlock`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.emailRouting.unlock({body:e,zone_id:u})),{successLabel:`Created`});return}let d=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>n.emailRouting.unlock({body:d,zone_id:u})),{successLabel:`Created`})}};function Ye(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xe={command:`update`,describe:`Update the settings for your Email Routing zone.`,builder:Ye,handler:async t=>{if(t.dryRun){s({command:`cf email-routing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({enabled:t.enabled,skip_wizard:t[`skip-wizard`],support_subaddress:t[`support-subaddress`]}):i(t.body)});return}let n=await r(t),l=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.emailRouting.update({...e,zone_id:l})),{successLabel:`Updated`});return}let u=a({enabled:t.enabled,skip_wizard:t[`skip-wizard`],support_subaddress:t[`support-subaddress`]});o(await c(`Updating`,async()=>n.emailRouting.update({...u,zone_id:l})),{successLabel:`Updated`})}},Ze={command:`email-routing`,describe:`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,builder:e=>e.command(T).command(I).command(R).command(B).command(Je).command(Xe).command(C).command(P).command(le).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ze as default};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{i as n,n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{n as d,r as f,t as p}from"./prompt-q3B7sM2A.mjs";import{t as m}from"./cli-types-DGgEbf8K.mjs";function ee(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get <investigate-id>`,describe:`Returns detection details such as threat categories and sender information for non-benign messages.`,builder:ee,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/detections`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.investigate.detections.get({account_id:a,investigate_id:n[`investigate-id`]})),{successLabel:`Loaded`})}},h={command:`detections`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`log <investigate-id>`,describe:`Returns the list of post-delivery actions (moves, quarantine releases, previews, etc.) that have been applied to a specific email message.`,builder:g,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate get-action log`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/action_log`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.investigate.getAction.log({account_id:a,investigate_id:n[`investigate-id`]})),{successLabel:`Loaded`})}},v={command:`get-action`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`submission`,{type:`boolean`,description:`When true, search the submissions datastore only. When false or omitted, search the
3
+ regular datastore only.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <investigate-id>`,describe:`Retrieves comprehensive details for a specific email message including headers, recipients, sender information, and current quarantine status. Use the investigate_id from search results to fetch detailed information.`,builder:y,handler:async n=>{let i={submission:n.submission};if(n.dryRun){s({command:`cf email-security investigate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.investigate.get({account_id:l,investigate_id:n[`investigate-id`],...i})),{successLabel:`Loaded`})}};function x(e){return e.option(`start`,{type:`string`,description:"The beginning of the search date range. Defaults to `now - 30 days`. Must not be in the future."}).option(`end`,{type:`string`,description:"The end of the search date range. Defaults to `now`."}).option(`query`,{type:`string`,description:`Space-delimited search term. Case-insensitive.`}).option(`detections-only`,{type:`boolean`,description:`Whether to include only detections in search results.`}).option(`final-disposition`,{type:`string`,description:`Dispositions to filter by.`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`metric`,{type:`string`,description:`Metric`}).option(`message-action`,{type:`string`,description:`Message actions to filter by.`,choices:[`PREVIEW`,`QUARANTINE_RELEASED`,`MOVED`]}).option(`recipient`,{type:`string`,description:`Recipient`}).option(`sender`,{type:`string`,description:`Sender`}).option(`alert-id`,{type:`string`,description:`Alert ID`}).option(`domain`,{type:`string`,description:`Sender domains to filter by.`}).option(`message-id`,{type:`string`,description:`Message ID`}).option(`subject`,{type:`string`,description:`Subject`}).option(`delivery-status`,{type:`string`,description:`Delivery status to filter by.`,choices:[`delivered`,`moved`,`quarantined`,`rejected`,`deferred`,`bounced`,`queued`]}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`page`,{type:`number`,description:`Deprecated: Use cursor pagination instead. End of life: November 1, 2026.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Returns information for each email that matches the search parameter(s).`,builder:m(x),handler:async n=>{let i={start:n.start,end:n.end,query:n.query,detections_only:n[`detections-only`],final_disposition:n[`final-disposition`],metric:n.metric,message_action:n[`message-action`],recipient:n.recipient,sender:n.sender,alert_id:n[`alert-id`],domain:n.domain,message_id:n[`message-id`],subject:n.subject,delivery_status:n[`delivery-status`],cursor:n.cursor,per_page:n[`per-page`],page:n.page};if(n.dryRun){s({command:`cf email-security investigate list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.investigate.list({account_id:l,...i})),{successLabel:`Loaded`})}};function C(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`destination`,{type:`string`,description:`The destination field`,choices:[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]}).option(`expected-disposition`,{type:`string`,description:`The expected_disposition field`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).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 <investigate-id>`,describe:`Moves a single message to a specified mailbox folder (Inbox, JunkEmail, DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires active integration.`,builder:C,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate move create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/move`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({destination:l(n.destination,`destination`,`text`),expected_disposition:l(n[`expected-disposition`],`expected-disposition`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>f.emailSecurity.investigate.move.create({...e,account_id:p,investigate_id:n[`investigate-id`]})),{successLabel:`Created`});return}n.destination===void 0&&(n.destination=await d(`destination`,`The destination field`,[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]));let m=a({destination:l(n.destination,`destination`,`text`),expected_disposition:l(n[`expected-disposition`],`expected-disposition`,`text`)});o(await c(`Creating`,async()=>f.emailSecurity.investigate.move.create({...m,account_id:p,investigate_id:n[`investigate-id`]})),{successLabel:`Created`})}},T={command:`move`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`postfix-id`,{type:`string`,description:`The identifier of the message`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Generates a preview image for a message that was not flagged as a detection. Useful for investigating benign messages. Returns a base64-encoded PNG screenshot of the email body.`,builder:E,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate preview create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/preview`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({postfix_id:l(n[`postfix-id`],`postfix-id`,`text`)}):i(n.body)});return}let d=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.emailSecurity.investigate.preview.create({...e,account_id:p})),{successLabel:`Created`});return}n[`postfix-id`]===void 0&&(n[`postfix-id`]=await f(`postfix-id`,`The identifier of the message`));let m=a({postfix_id:l(n[`postfix-id`],`postfix-id`,`text`)});o(await c(`Creating`,async()=>d.emailSecurity.investigate.preview.create({...m,account_id:p})),{successLabel:`Created`})}};function O(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <investigate-id>`,describe:`Returns a preview of the message body as a base64 encoded PNG image for non-benign messages.`,builder:O,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate preview get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/preview`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.investigate.preview.get({account_id:a,investigate_id:n[`investigate-id`]})),{successLabel:`Loaded`})}},A={command:`preview`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <investigate-id>`,describe:`Returns the raw eml of any non-benign message.`,builder:j,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate raw get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/raw`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.investigate.raw.get({account_id:a,investigate_id:n[`investigate-id`]})),{successLabel:`Loaded`})}},N={command:`raw`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`eml-content`,{type:`string`,description:`Base64 encoded content of the EML file.`}).option(`escalated-submission-id`,{type:`string`,description:`The escalated_submission_id field`}).option(`expected-disposition`,{type:`string`,description:`The expected_disposition field`,choices:[`NONE`,`BULK`,`MALICIOUS`,`SPAM`,`SPOOF`,`SUSPICIOUS`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create <investigate-id>`,describe:`Submits a request to reclassify an email's disposition. Use for reporting false positives or false negatives. Optionally provide the raw EML content for reanalysis. The reclassification is processed asynchronously.`,builder:P,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate reclassify create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/reclassify`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({eml_content:l(n[`eml-content`],`eml-content`,`text`),escalated_submission_id:l(n[`escalated-submission-id`],`escalated-submission-id`,`text`),expected_disposition:l(n[`expected-disposition`],`expected-disposition`,`text`)}):i(n.body)});return}let f=await r(n),p=n.local?u:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>f.emailSecurity.investigate.reclassify.create({...e,account_id:p,investigate_id:n[`investigate-id`]})),{successLabel:`Created`});return}n[`expected-disposition`]===void 0&&(n[`expected-disposition`]=await d(`expected-disposition`,`The expected_disposition field`,[`NONE`,`BULK`,`MALICIOUS`,`SPAM`,`SPOOF`,`SUSPICIOUS`]));let m=a({eml_content:l(n[`eml-content`],`eml-content`,`text`),escalated_submission_id:l(n[`escalated-submission-id`],`escalated-submission-id`,`text`),expected_disposition:l(n[`expected-disposition`],`expected-disposition`,`text`)});o(await c(`Creating`,async()=>f.emailSecurity.investigate.reclassify.create({...m,account_id:p,investigate_id:n[`investigate-id`]})),{successLabel:`Created`})}},I={command:`reclassify`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A list of investigate IDs identifying the messages to release.`})}const R={command:`bulk`,describe:`Releases one or more quarantined messages, delivering them to the intended recipients. Use when a message was incorrectly quarantined. Returns delivery status for each recipient.`,builder:L,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate release bulk`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/release`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:i(n.body)});return}let a=await r(n),l=n.local?u:await e();if(n.accountId=l,n.body){let e=i(n.body);o(await c(`Creating`,async()=>a.emailSecurity.investigate.release.bulk({body:e,account_id:l})),{successLabel:`Created`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},z={command:`release`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <investigate-id>`,describe:`Retrieves delivery and processing trace information for an email message. Shows the delivery path, retraction history, and move operations performed on the message. Useful for debugging delivery issues.`,builder:B,handler:async n=>{if(n.dryRun){s({command:`cf email-security investigate trace get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/${n[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(n[`investigate-id`]))}/trace`,pathParams:{"investigate-id":String(n[`investigate-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.investigate.trace.get({account_id:a,investigate_id:n[`investigate-id`]})),{successLabel:`Loaded`})}},H={command:`trace`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`investigate`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(b).command(S).command(h).command(v).command(T).command(A).command(N).command(I).command(z).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`start`,{type:`string`,description:`Start of the time range (RFC3339). Takes precedence over from_date.`}).option(`end`,{type:`string`,description:`End of the time range (RFC3339). Takes precedence over to_date.`}).option(`from-date`,{type:`string`,description:"Deprecated, use `start` instead. Start date in YYYY-MM-DD format."}).option(`to-date`,{type:`string`,description:"Deprecated, use `end` instead. End date in YYYY-MM-DD format."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Retrieves PhishGuard security alert reports for a specified date range. Reports include detected threats, dispositions, and contextual information. Use for security monitoring and threat analysis.`,builder:W,handler:async n=>{let i={start:n.start,end:n.end,from_date:n[`from-date`],to_date:n[`to-date`]};if(n.dryRun){s({command:`cf email-security phishguard reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/phishguard/reports`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.phishguard.reports.list({account_id:l,...i})),{successLabel:`Loaded`})}},K={command:`reports`,describe:`PhishGuard user-reported phishing submissions and analysis reports`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`phishguard`,describe:`Operations for phishguard`,builder:e=>e.command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`comments`,{type:`string`,description:`The comments field`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note - This will not exempt messages with Malicious or Suspicious dispositions.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Messages to this recipient will bypass all detections`}).option(`is-recipient`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026."}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-sender`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026."}).option(`is-spoof`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026."}).option(`is-trusted-sender`,{type:`boolean`,description:`Messages from this sender will bypass all detections and link following`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`verify-sender`,{type:`boolean`,description:`Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create an allow policy`})}const Y={command:`create`,describe:`Creates a new allow policy that exempts matching emails from security detections. Use with caution as this bypasses email security scanning. Policies can match on sender patterns and apply to specific detections or all detections.`,builder:J,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings allow-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({comments:l(n.comments,`comments`,`text`),is_acceptable_sender:n[`is-acceptable-sender`],is_exempt_recipient:n[`is-exempt-recipient`],is_recipient:n[`is-recipient`],is_regex:n[`is-regex`],is_sender:n[`is-sender`],is_spoof:n[`is-spoof`],is_trusted_sender:n[`is-trusted-sender`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`),verify_sender:n[`verify-sender`]}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.emailSecurity.settings.allowPolicies.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({comments:l(n.comments,`comments`,`text`),is_acceptable_sender:n[`is-acceptable-sender`],is_exempt_recipient:n[`is-exempt-recipient`],is_recipient:n[`is-recipient`],is_regex:n[`is-regex`],is_sender:n[`is-sender`],is_spoof:n[`is-spoof`],is_trusted_sender:n[`is-trusted-sender`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`),verify_sender:n[`verify-sender`]});o(await c(`Creating`,async()=>d.emailSecurity.settings.allowPolicies.create({body:p,account_id:f})),{successLabel:`Created`})}};function X(e){return e.positional(`policy-id`,{type:`string`,description:`Allow policy identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Z={command:`delete <policy-id>`,describe:`Removes an allow policy. After deletion, emails matching this pattern will be subject to normal security scanning and disposition actions.`,builder:X,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings allow-policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}`,pathParams:{"policy-id":String(n[`policy-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
4
+ `);return}o(await c(`Deleting`,async()=>i.emailSecurity.settings.allowPolicies.delete({account_id:a,policy_id:n[`policy-id`]})),{successLabel:`Deleted`})}};function Q(e){return e.positional(`policy-id`,{type:`string`,description:`Allow policy identifier`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note - This will not exempt messages with Malicious or Suspicious dispositions.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Messages to this recipient will bypass all detections`}).option(`is-recipient`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026."}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-sender`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026."}).option(`is-spoof`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026."}).option(`is-trusted-sender`,{type:`boolean`,description:`Messages from this sender will bypass all detections and link following`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`verify-sender`,{type:`boolean`,description:`Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update an allow policy`})}const ne={command:`edit <policy-id>`,describe:`Updates an existing allow policy. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`,builder:Q,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings allow-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}`,pathParams:{"policy-id":String(n[`policy-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({comments:l(n.comments,`comments`,`text`),is_acceptable_sender:n[`is-acceptable-sender`],is_exempt_recipient:n[`is-exempt-recipient`],is_recipient:n[`is-recipient`],is_regex:n[`is-regex`],is_sender:n[`is-sender`],is_spoof:n[`is-spoof`],is_trusted_sender:n[`is-trusted-sender`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`),verify_sender:n[`verify-sender`]}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.emailSecurity.settings.allowPolicies.edit({body:e,account_id:f,policy_id:n[`policy-id`]})),{successLabel:`Updated`});return}let p=a({comments:l(n.comments,`comments`,`text`),is_acceptable_sender:n[`is-acceptable-sender`],is_exempt_recipient:n[`is-exempt-recipient`],is_recipient:n[`is-recipient`],is_regex:n[`is-regex`],is_sender:n[`is-sender`],is_spoof:n[`is-spoof`],is_trusted_sender:n[`is-trusted-sender`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`),verify_sender:n[`verify-sender`]});o(await c(`Updating`,async()=>d.emailSecurity.settings.allowPolicies.edit({body:p,account_id:f,policy_id:n[`policy-id`]})),{successLabel:`Updated`})}};function re(e){return e.positional(`policy-id`,{type:`string`,description:`Allow policy identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <policy-id>`,describe:`Retrieves details for a specific allow policy including its pattern, dispositions that are exempted, and whether it applies to all detections.`,builder:re,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings allow-policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}`,pathParams:{"policy-id":String(n[`policy-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.settings.allowPolicies.get({account_id:a,policy_id:n[`policy-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`is-exempt-recipient`,{type:`boolean`,description:`Filter to show only policies where messages to the recipient bypass all detections.`}).option(`is-trusted-sender`,{type:`boolean`,description:`Filter to show only policies where messages from the sender bypass all detections and link following.`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Filter to show only policies where messages from the sender are exempted from Spam, Spoof, and Bulk dispositions (not Malicious or Suspicious).`}).option(`verify-sender`,{type:`boolean`,description:`Filter to show only policies that enforce DMARC, SPF, or DKIM authentication.`}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`pattern`,{type:`string`,description:`Pattern`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Returns a paginated list of email allow policies. These policies exempt matching emails from security detection, allowing them to bypass disposition actions. Supports filtering by pattern type and policy attributes.`,builder:m(ae),handler:async n=>{let i={page:n.page,per_page:n[`per-page`],search:n.search,order:n.order,direction:n.direction,is_exempt_recipient:n[`is-exempt-recipient`],is_trusted_sender:n[`is-trusted-sender`],is_acceptable_sender:n[`is-acceptable-sender`],verify_sender:n[`verify-sender`],pattern_type:n[`pattern-type`],pattern:n.pattern};if(n.dryRun){s({command:`cf email-security settings allow-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.settings.allowPolicies.list({account_id:l,...i})),{successLabel:`Loaded`})}},se={command:`allow-policies`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command(Y).command(Z).command(ne).command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(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 le={command:`create`,describe:`Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`,builder:ce,handler:async a=>{if(a.dryRun){s({command:`cf email-security settings batch allow policies batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/batch`,pathParams:{},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let l=await r(a),d=a.local?u:await e();if(a.accountId=d,a.body){let e=i(a.body);o(await c(`Creating`,async()=>l.emailSecurity.settings.batch.allow.policies.batch.create({...e,account_id:d})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>n(l,`POST`,`/accounts/${d}/email-security/settings/allow_policies/batch`)),{successLabel:`Created`})}},ue={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`policies`,describe:`Operations for settings.batch.allow.policies`,builder:e=>e.command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`allow`,describe:`Operations for settings.batch.allow`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(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 me={command:`create`,describe:`Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`,builder:pe,handler:async a=>{if(a.dryRun){s({command:`cf email-security settings batch block senders batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/batch`,pathParams:{},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let l=await r(a),d=a.local?u:await e();if(a.accountId=d,a.body){let e=i(a.body);o(await c(`Creating`,async()=>l.emailSecurity.settings.batch.block.senders.batch.create({...e,account_id:d})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>n(l,`POST`,`/accounts/${d}/email-security/settings/block_senders/batch`)),{successLabel:`Created`})}},he={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`senders`,describe:`Operations for settings.batch.block.senders`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`block`,describe:`Operations for settings.batch.block`,builder:e=>e.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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ye={command:`create`,describe:`Executes multiple delete operations on sending domain restrictions atomically. All operations succeed or fail together as a transaction. Currently only supports batch deletion. Removes TLS enforcement requirements for the specified domains.`,builder:ve,handler:async a=>{if(a.dryRun){s({command:`cf email-security settings batch sending domain restrictions batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/sending_domain_restrictions/batch`,pathParams:{},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let l=await r(a),d=a.local?u:await e();if(a.accountId=d,a.body){let e=i(a.body);o(await c(`Creating`,async()=>l.emailSecurity.settings.batch.sending.domain.restrictions.batch.create({...e,account_id:d})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>n(l,`POST`,`/accounts/${d}/email-security/settings/sending_domain_restrictions/batch`)),{successLabel:`Created`})}},be={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xe={command:`restrictions`,describe:`Operations for settings.batch.sending.domain.restrictions`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`domain`,describe:`Operations for settings.batch.sending.domain`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ce={command:`sending`,describe:`Operations for settings.batch.sending`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(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 Te={command:`create`,describe:`Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`,builder:we,handler:async a=>{if(a.dryRun){s({command:`cf email-security settings batch trusted domains batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/batch`,pathParams:{},bodyKind:`json`,body:a.body===void 0?void 0:i(a.body)});return}let l=await r(a),d=a.local?u:await e();if(a.accountId=d,a.body){let e=i(a.body);o(await c(`Creating`,async()=>l.emailSecurity.settings.batch.trusted.domains.batch.create({...e,account_id:d})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>n(l,`POST`,`/accounts/${d}/email-security/settings/trusted_domains/batch`)),{successLabel:`Created`})}},Ee={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},De={command:`domains`,describe:`Operations for settings.batch.trusted.domains`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`trusted`,describe:`Operations for settings.batch.trusted`,builder:e=>e.command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`batch`,describe:`Operations for settings.batch`,builder:e=>e.command(fe).command(_e).command(Ce).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ae(e){return e.option(`comments`,{type:`string`,description:`The comments field`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a blocked sender pattern`})}const je={command:`create`,describe:`Creates a new blocked sender pattern. Emails matching this pattern will be blocked from delivery. Patterns can be email addresses, domains, or IP addresses, and support regular expressions.`,builder:Ae,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings block-senders create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({comments:l(n.comments,`comments`,`text`),is_regex:n[`is-regex`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.emailSecurity.settings.blockSenders.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({comments:l(n.comments,`comments`,`text`),is_regex:n[`is-regex`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`)});o(await c(`Creating`,async()=>d.emailSecurity.settings.blockSenders.create({body:p,account_id:f})),{successLabel:`Created`})}};function Me(e){return e.positional(`pattern-id`,{type:`string`,description:`Blocked sender pattern identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <pattern-id>`,describe:`Removes a blocked sender pattern. After deletion, emails from this sender will no longer be automatically blocked based on this rule.`,builder:Me,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings block-senders delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/${n[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(n[`pattern-id`]))}`,pathParams:{"pattern-id":String(n[`pattern-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
5
+ `);return}o(await c(`Deleting`,async()=>i.emailSecurity.settings.blockSenders.delete({account_id:a,pattern_id:n[`pattern-id`]})),{successLabel:`Deleted`})}};function Pe(e){return e.positional(`pattern-id`,{type:`string`,description:`Blocked sender pattern identifier`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a blocked sender pattern`})}const Fe={command:`edit <pattern-id>`,describe:`Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted.`,builder:Pe,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings block-senders edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/${n[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(n[`pattern-id`]))}`,pathParams:{"pattern-id":String(n[`pattern-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({comments:l(n.comments,`comments`,`text`),is_regex:n[`is-regex`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.emailSecurity.settings.blockSenders.edit({body:e,account_id:f,pattern_id:n[`pattern-id`]})),{successLabel:`Updated`});return}let p=a({comments:l(n.comments,`comments`,`text`),is_regex:n[`is-regex`],pattern:l(n.pattern,`pattern`,`text`),pattern_type:l(n[`pattern-type`],`pattern-type`,`text`)});o(await c(`Updating`,async()=>d.emailSecurity.settings.blockSenders.edit({body:p,account_id:f,pattern_id:n[`pattern-id`]})),{successLabel:`Updated`})}};function Ie(e){return e.positional(`pattern-id`,{type:`string`,description:`Blocked sender pattern identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <pattern-id>`,describe:`Retrieves details for a specific blocked sender pattern including its pattern type, value, and metadata.`,builder:Ie,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings block-senders get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/${n[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(n[`pattern-id`]))}`,pathParams:{"pattern-id":String(n[`pattern-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.settings.blockSenders.get({account_id:a,pattern_id:n[`pattern-id`]})),{successLabel:`Loaded`})}};function Re(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`pattern-type`,{type:`string`,description:`Filter by pattern type.`,choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`pattern`,{type:`string`,description:`Filter by pattern value.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ze={command:`list`,describe:`Returns a paginated list of blocked email sender patterns. These patterns prevent emails from matching senders from being delivered. Supports filtering by pattern type and searching across patterns.`,builder:m(Re),handler:async n=>{let i={page:n.page,per_page:n[`per-page`],search:n.search,order:n.order,direction:n.direction,pattern_type:n[`pattern-type`],pattern:n.pattern};if(n.dryRun){s({command:`cf email-security settings block-senders list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.settings.blockSenders.list({account_id:l,...i})),{successLabel:`Loaded`})}},Be={command:`block-senders`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command(je).command(Ne).command(Fe).command(Le).command(ze).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}).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 He={command:`bulk-delete`,describe:`Deprecated. Use the batch endpoint instead.`,builder:Ve,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings domains bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:i(n.body)});return}let a=await r(n),l=n.local?u:await e();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
6
+ `);return}if(n.body){let e=i(n.body);o(await c(`Deleting`,async()=>a.emailSecurity.settings.domains.bulkDelete({body:e,account_id:l})),{successLabel:`Deleted`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Ue(e){return e.positional(`domain-id`,{type:`string`,description:`Domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const We={command:`delete <domain-id>`,describe:`Removes email security protection from a domain. After deletion, emails for this domain will no longer be processed by Email Security. This action cannot be undone.`,builder:Ue,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains/${n[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(n[`domain-id`]))}`,pathParams:{"domain-id":String(n[`domain-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
7
+ `);return}o(await c(`Deleting`,async()=>i.emailSecurity.settings.domains.delete({account_id:a,domain_id:n[`domain-id`]})),{successLabel:`Deleted`})}};function Ge(e){return e.positional(`domain-id`,{type:`string`,description:`Domain identifier`,demandOption:!0}).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`The allowed_delivery_modes field`}).option(`domain`,{type:`string`,description:`The domain field`}).option(`drop-dispositions`,{type:`string`,array:!0,description:`The drop_dispositions field`}).option(`folder`,{type:`string`,description:`The folder field`,choices:[`AllItems`,`Inbox`]}).option(`integration-id`,{type:`string`,description:`The integration_id field`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`The ip_restrictions field`}).option(`lookback-hops`,{type:`number`,description:`The lookback_hops field`}).option(`regions`,{type:`string`,array:!0,description:`The regions field`}).option(`require-tls-inbound`,{type:`boolean`,description:`The require_tls_inbound field`}).option(`require-tls-outbound`,{type:`boolean`,description:`The require_tls_outbound field`}).option(`transport`,{type:`string`,description:`The transport field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ke={command:`edit <domain-id>`,describe:`Updates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing.`,builder:Ge,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains/${n[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(n[`domain-id`]))}`,pathParams:{"domain-id":String(n[`domain-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({allowed_delivery_modes:n[`allowed-delivery-modes`],domain:l(n.domain,`domain`,`text`),drop_dispositions:n[`drop-dispositions`],folder:l(n.folder,`folder`,`text`),integration_id:l(n[`integration-id`],`integration-id`,`text`),ip_restrictions:n[`ip-restrictions`],lookback_hops:n[`lookback-hops`],regions:n.regions,require_tls_inbound:n[`require-tls-inbound`],require_tls_outbound:n[`require-tls-outbound`],transport:l(n.transport,`transport`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.emailSecurity.settings.domains.edit({body:e,account_id:f,domain_id:n[`domain-id`]})),{successLabel:`Updated`});return}let p=a({allowed_delivery_modes:n[`allowed-delivery-modes`],domain:l(n.domain,`domain`,`text`),drop_dispositions:n[`drop-dispositions`],folder:l(n.folder,`folder`,`text`),integration_id:l(n[`integration-id`],`integration-id`,`text`),ip_restrictions:n[`ip-restrictions`],lookback_hops:n[`lookback-hops`],regions:n.regions,require_tls_inbound:n[`require-tls-inbound`],require_tls_outbound:n[`require-tls-outbound`],transport:l(n.transport,`transport`,`text`)});o(await c(`Updating`,async()=>d.emailSecurity.settings.domains.edit({body:p,account_id:f,domain_id:n[`domain-id`]})),{successLabel:`Updated`})}};function qe(e){return e.positional(`domain-id`,{type:`string`,description:`Domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`get <domain-id>`,describe:`Retrieves detailed information for a specific protected email domain including its delivery configuration, SPF/DMARC status, and authorization state.`,builder:qe,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains/${n[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(n[`domain-id`]))}`,pathParams:{"domain-id":String(n[`domain-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.settings.domains.get({account_id:a,domain_id:n[`domain-id`]})),{successLabel:`Loaded`})}};function Ye(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`domain`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`allowed-delivery-mode`,{type:`string`,description:`Delivery mode to filter by.`,choices:[`DIRECT`,`BCC`,`JOURNAL`,`API`,`RETRO_SCAN`]}).option(`domain`,{type:`string`,description:`Domain names to filter by.`}).option(`active-delivery-mode`,{type:`string`,description:`Currently active delivery mode to filter by.`,choices:[`DIRECT`,`BCC`,`JOURNAL`,`API`,`RETRO_SCAN`]}).option(`integration-id`,{type:`string`,description:`Integration ID to filter by.`}).option(`status`,{type:`string`,description:`Filters response to domains with the provided status.`,choices:[`pending`,`active`,`failed`,`timeout`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`list`,describe:`Returns a paginated list of email domains protected by Email Security. Includes domain configuration, delivery modes, and authorization status. Supports filtering by delivery mode and integration ID.`,builder:m(Ye),handler:async n=>{let i={page:n.page,per_page:n[`per-page`],search:n.search,order:n.order,direction:n.direction,allowed_delivery_mode:n[`allowed-delivery-mode`],domain:n.domain,active_delivery_mode:n[`active-delivery-mode`],integration_id:n[`integration-id`],status:n.status};if(n.dryRun){s({command:`cf email-security settings domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.settings.domains.list({account_id:l,...i})),{successLabel:`Loaded`})}},Ze={command:`domains`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command(He).command(We).command(Ke).command(Je).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(e){return e.option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:`The pattern field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a trusted domain`})}const $e={command:`create`,describe:`Creates a new trusted domain pattern. Use for partner domains or approved senders that should bypass recent domain registration and similarity checks. Configure whether it prevents recent domain or spoof dispositions.`,builder:Qe,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings trusted-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({comments:l(n.comments,`comments`,`text`),is_recent:n[`is-recent`],is_regex:n[`is-regex`],is_similarity:n[`is-similarity`],pattern:l(n.pattern,`pattern`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.emailSecurity.settings.trustedDomains.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({comments:l(n.comments,`comments`,`text`),is_recent:n[`is-recent`],is_regex:n[`is-regex`],is_similarity:n[`is-similarity`],pattern:l(n.pattern,`pattern`,`text`)});o(await c(`Creating`,async()=>d.emailSecurity.settings.trustedDomains.create({body:p,account_id:f})),{successLabel:`Created`})}};function et(e){return e.positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tt={command:`delete <trusted-domain-id>`,describe:`Removes a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks.`,builder:et,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings trusted-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/${n[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(n[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(n[`trusted-domain-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
8
+ `);return}o(await c(`Deleting`,async()=>i.emailSecurity.settings.trustedDomains.delete({account_id:a,trusted_domain_id:n[`trusted-domain-id`]})),{successLabel:`Deleted`})}};function $(e){return e.positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:`The pattern field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a trusted domain`})}const nt={command:`edit <trusted-domain-id>`,describe:`Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`,builder:$,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings trusted-domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/${n[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(n[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(n[`trusted-domain-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({comments:l(n.comments,`comments`,`text`),is_recent:n[`is-recent`],is_regex:n[`is-regex`],is_similarity:n[`is-similarity`],pattern:l(n.pattern,`pattern`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.emailSecurity.settings.trustedDomains.edit({body:e,account_id:f,trusted_domain_id:n[`trusted-domain-id`]})),{successLabel:`Updated`});return}let p=a({comments:l(n.comments,`comments`,`text`),is_recent:n[`is-recent`],is_regex:n[`is-regex`],is_similarity:n[`is-similarity`],pattern:l(n.pattern,`pattern`,`text`)});o(await c(`Updating`,async()=>d.emailSecurity.settings.trustedDomains.edit({body:p,account_id:f,trusted_domain_id:n[`trusted-domain-id`]})),{successLabel:`Updated`})}};function rt(e){return e.positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`get <trusted-domain-id>`,describe:`Retrieves details for a specific trusted domain pattern including its pattern value, whether it uses regex matching, and which detection types it affects.`,builder:rt,handler:async n=>{if(n.dryRun){s({command:`cf email-security settings trusted-domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/${n[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(n[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(n[`trusted-domain-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await e();n.accountId=a,o(await c(`Loading`,async()=>i.emailSecurity.settings.trustedDomains.get({account_id:a,trusted_domain_id:n[`trusted-domain-id`]})),{successLabel:`Loaded`})}};function at(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`is-recent`,{type:`boolean`,description:`Filter to show only recently registered domains that are trusted to prevent triggering Suspicious or Malicious dispositions.`}).option(`is-similarity`,{type:`boolean`,description:`Filter to show only proximity domains (partner or approved domains with similar spelling to connected domains) that prevent Spoof dispositions.`}).option(`pattern`,{type:`string`,description:`Pattern`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`list`,describe:`Returns a paginated list of trusted domain patterns. Trusted domains prevent false positives for recently registered domains and lookalike domain detections. Patterns can use regular expressions for flexible matching.`,builder:m(at),handler:async n=>{let i={page:n.page,per_page:n[`per-page`],search:n.search,order:n.order,direction:n.direction,is_recent:n[`is-recent`],is_similarity:n[`is-similarity`],pattern:n.pattern};if(n.dryRun){s({command:`cf email-security settings trusted-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.settings.trustedDomains.list({account_id:l,...i})),{successLabel:`Loaded`})}},st={command:`trusted-domains`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command($e).command(tt).command(nt).command(it).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ct={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(se).command(ke).command(Be).command(Ze).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lt(e){return e.option(`start`,{type:`string`,description:"The beginning of the search date range. Defaults to `now - 30 days`."}).option(`end`,{type:`string`,description:"The end of the search date range. Defaults to `now`."}).option(`type`,{type:`string`,description:`Type`,choices:[`TEAM`,`USER`]}).option(`submission-id`,{type:`string`,description:`Submission ID`}).option(`original-disposition`,{type:`string`,description:`Original disposition`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`requested-disposition`,{type:`string`,description:`Requested disposition`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`outcome-disposition`,{type:`string`,description:`Outcome disposition`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`status`,{type:`string`,description:`Status`}).option(`query`,{type:`string`,description:`Query`}).option(`escalated-from-user`,{type:`boolean`,description:`When true, return only submissions that were escalated by an end user (vs. by the security team). When false, return only submissions that were not escalated by an end user. When omitted, no filter is applied.`}).option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ut={command:`list`,describe:`Returns information for submissions made to reclassify emails. Shows the status, outcome, and disposition changes for reclassification requests made by users or the security team. Useful for tracking false positive/negative reports.`,builder:m(lt),handler:async n=>{let i={start:n.start,end:n.end,type:n.type,submission_id:n[`submission-id`],original_disposition:n[`original-disposition`],requested_disposition:n[`requested-disposition`],outcome_disposition:n[`outcome-disposition`],status:n.status,query:n.query,escalated_from_user:n[`escalated-from-user`],page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf email-security submissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/submissions`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await e();n.accountId=l,o(await c(`Loading`,async()=>a.emailSecurity.submissions.list({account_id:l,...i})),{successLabel:`Loaded`})}},dt={command:`submissions`,describe:`User and admin email submissions for classification review`,builder:e=>e.command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ft={command:`email-security`,describe:`Cloud email security (Area 1) — investigate threats, manage allow/block policies, and detect phishing`,builder:e=>e.command(U).command(q).command(ct).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ft as default};