cf 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/_meta/agent-context.json +26 -21
  2. package/dist/_meta/commands.json +7696 -18100
  3. package/dist/_meta/schemas.json +6411 -13925
  4. package/dist/{abuse-reports-dMIfUJ8v.mjs → abuse-reports-Dy76QPNP.mjs} +1 -1
  5. package/dist/{accounts-Kx1epdA1.mjs → accounts-CjtZ8x1z.mjs} +2 -2
  6. package/dist/{acm-Utu252kC.mjs → acm-C2lYIWs1.mjs} +1 -1
  7. package/dist/{addressing-CBq7Z7Vq.mjs → addressing-CHFK6uxW.mjs} +1 -1
  8. package/dist/{agent-context-BGTU299M.mjs → agent-context-CgGCT0xU.mjs} +1 -1
  9. package/dist/{ai-DOOKLPkG.mjs → ai-DS3i-I1a.mjs} +1 -1
  10. package/dist/{ai-gateway-Cj1T3avF.mjs → ai-gateway-RIsegO2x.mjs} +1 -1
  11. package/dist/ai-search-Dcj4BauG.mjs +7 -0
  12. package/dist/{ai_gateway-C3fH22C0.mjs → ai_gateway-w7YwfcPE.mjs} +1 -1
  13. package/dist/{alerting-CqmEIaKn.mjs → alerting-Bk85NNf5.mjs} +1 -1
  14. package/dist/{analytics-Dv-X8x7D.mjs → analytics-CkhhhZWZ.mjs} +1 -1
  15. package/dist/{analytics_engine-DdXVR8z2.mjs → analytics_engine-B7qgDJCA.mjs} +1 -1
  16. package/dist/{api-gateway-CNv0IHTU.mjs → api-gateway-CWdR4Ne7.mjs} +1 -1
  17. package/dist/{argo-CX_A4kcn.mjs → argo-DnJRVnGX.mjs} +1 -1
  18. package/dist/artifacts-BVWKiJUl.mjs +4 -0
  19. package/dist/{audit-logs-BfBf3oo-.mjs → audit-logs-DjTstbzL.mjs} +1 -1
  20. package/dist/auth-BqDOIrKX.mjs +150 -0
  21. package/dist/auth-DKkSwnxh.mjs +5 -0
  22. package/dist/billing-3rEqF83h.mjs +2 -0
  23. package/dist/{bot-management-CFvtVx62.mjs → bot-management-CJxD1pqi.mjs} +1 -1
  24. package/dist/{botnet-feed-B-M4Yu0W.mjs → botnet-feed-MG91D7BR.mjs} +1 -1
  25. package/dist/{brand-protection-D05Eg-_6.mjs → brand-protection-CK7gJi06.mjs} +1 -1
  26. package/dist/browser-rendering-Rae0AUt0.mjs +4 -0
  27. package/dist/{build-DYkGW4dh.mjs → build-BE4o4imx.mjs} +131 -131
  28. package/dist/{cache-DsoW6Xwv.mjs → cache-B7pRbpTy.mjs} +1 -1
  29. package/dist/{calls-CZbO7TyR.mjs → calls-DXRWsZ8n.mjs} +3 -3
  30. package/dist/{certificate-authorities-D2yr7_3t.mjs → certificate-authorities-BR3gXBLs.mjs} +1 -1
  31. package/dist/chunk-6IEM75FG-U3L9fKgi.mjs +2 -0
  32. package/dist/{client-certificates-MJcDsTId.mjs → client-certificates-B0ebLJdk.mjs} +1 -1
  33. package/dist/{cloud-connector-DWOrN2eM.mjs → cloud-connector-BOjaggJk.mjs} +1 -1
  34. package/dist/{cloudforce-one-2Bhz8YdW.mjs → cloudforce-one-B6HYfk5Z.mjs} +1 -1
  35. package/dist/{completions-BwRpZQVn.mjs → completions-D_9WsLG7.mjs} +1 -1
  36. package/dist/config-7CBz8Xm0.mjs +2 -0
  37. package/dist/{connectivity-BX8C7tvK.mjs → connectivity-welFvZ7X.mjs} +1 -1
  38. package/dist/connector-interrupts-DTV3F-50.mjs +2 -0
  39. package/dist/connector-telemetry-events-kDqb_AGm.mjs +2 -0
  40. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +2 -0
  41. package/dist/connectors-3vjrdFLB.mjs +3 -0
  42. package/dist/content-scanning-CnW2A0pv.mjs +4 -0
  43. package/dist/{context-DGlHRGWM.mjs → context-CONbNKO-.mjs} +1 -1
  44. package/dist/{custom-certificates-aAiEguR7.mjs → custom-certificates-CnYh6Yi-.mjs} +1 -1
  45. package/dist/{custom-hostnames-AG5yBHIi.mjs → custom-hostnames-C2upqZso.mjs} +1 -1
  46. package/dist/{custom-nameservers-D1DtlRue.mjs → custom-nameservers-BGkAD_PZ.mjs} +1 -1
  47. package/dist/{custom-pages-DQCi2plU.mjs → custom-pages-5fCSP8in.mjs} +1 -1
  48. package/dist/{d1-DbnYhw45.mjs → d1-CyiRbZZn.mjs} +1 -1
  49. package/dist/data-security-Casx4OS_.mjs +6 -0
  50. package/dist/{dcv-delegation-CHspSzTI.mjs → dcv-delegation-DVYO10oA.mjs} +1 -1
  51. package/dist/{deploy-CQial3kN.mjs → deploy-KBRFIatG.mjs} +1 -1
  52. package/dist/{dev-B38LfCTl.mjs → dev-pPazzZvt.mjs} +1 -1
  53. package/dist/{diagnostics-BJQGjVJn.mjs → diagnostics-BqYDoDfw.mjs} +1 -1
  54. package/dist/{dispatch-namespaces-DmHvoBOg.mjs → dispatch-namespaces-Cz2rajnP.mjs} +1 -1
  55. package/dist/{dist-AIcZFk0U.mjs → dist-DA54ZQu0.mjs} +7 -7
  56. package/dist/dist-DpDjsWWn.mjs +306 -0
  57. package/dist/{dns-VMhQSr5n.mjs → dns-62t95Xif.mjs} +1 -1
  58. package/dist/{dns-firewall-B4DVXFBQ.mjs → dns-firewall-Coy8d47t.mjs} +1 -1
  59. package/dist/{durable-objects-CTboySEo.mjs → durable-objects-BSuRERkw.mjs} +1 -1
  60. package/dist/{email-routing-tIR2SFu-.mjs → email-routing-BDUYYeV3.mjs} +1 -1
  61. package/dist/{email-security-Ca1id3rZ.mjs → email-security-ChHA6eqQ.mjs} +1 -1
  62. package/dist/{email-sending-DwWKc5jC.mjs → email-sending-CVrRqn6S.mjs} +1 -1
  63. package/dist/{filters-A4dg_a68.mjs → filters-qJpU9uAS.mjs} +1 -1
  64. package/dist/{firewall-DWPQgYd9.mjs → firewall-C3DDwfwh.mjs} +1 -1
  65. package/dist/{fraud-BMkSsJGU.mjs → fraud-DY3YXFVf.mjs} +1 -1
  66. package/dist/{google-tag-gateway-BGD49nRC.mjs → google-tag-gateway-B00MHDfB.mjs} +1 -1
  67. package/dist/{healthchecks-CtIfrFql.mjs → healthchecks-Drvb79v0.mjs} +1 -1
  68. package/dist/{hostnames-BiomxukN.mjs → hostnames-BdAQo1Mr.mjs} +1 -1
  69. package/dist/{hyperdrive-Da104VaQ.mjs → hyperdrive-99OJV9nl.mjs} +1 -1
  70. package/dist/{iam-BIGKo0WW.mjs → iam-BRbpg3lN.mjs} +1 -1
  71. package/dist/images-D1jI3r3O.mjs +7 -0
  72. package/dist/index.mjs +1 -1
  73. package/dist/{intel-CY6_79v8.mjs → intel-C3ajLpXd.mjs} +1 -1
  74. package/dist/{ips-K4bzaGqd.mjs → ips-B6JETVOY.mjs} +1 -1
  75. package/dist/{keyless-certificates-CZC-L8gM.mjs → keyless-certificates-C4MZ4xnf.mjs} +1 -1
  76. package/dist/{kv-8o27w_pY.mjs → kv-CSWoD9ks.mjs} +1 -1
  77. package/dist/{leaked-credential-checks-qLzRyu85.mjs → leaked-credential-checks-Dgs2oKm9.mjs} +2 -2
  78. package/dist/{load-balancers-DtG8nj25.mjs → load-balancers-Du1tNuUt.mjs} +1 -1
  79. package/dist/{logpush-4L0njy1d.mjs → logpush-SuJyO-uX.mjs} +1 -1
  80. package/dist/{logs-B_Yp95hv.mjs → logs-DcDNRPRl.mjs} +1 -1
  81. package/dist/{magic-cloud-networking-CSOM3EM-.mjs → magic-cloud-networking-D-T0RCvi.mjs} +1 -1
  82. package/dist/{magic-network-monitoring-BnwvM4-I.mjs → magic-network-monitoring-CqtvOePQ.mjs} +1 -1
  83. package/dist/{magic-transit-CXDyvhxq.mjs → magic-transit-BTbkhBtF.mjs} +32 -33
  84. package/dist/{managed-transforms-D15yVbZx.mjs → managed-transforms-CfUBSz9p.mjs} +1 -1
  85. package/dist/{mtls-certificates-D8k0AXWK.mjs → mtls-certificates-Cf1O8c2E.mjs} +1 -1
  86. package/dist/{network-interconnects-rrr7red3.mjs → network-interconnects-DsiNytOU.mjs} +1 -1
  87. package/dist/{observability-DWvpqnQJ.mjs → observability-CLqZ7OSi.mjs} +1 -1
  88. package/dist/open-YWOUIZ5Y-BpqIuBsR.mjs +4 -0
  89. package/dist/{organizations-T77D50Sq.mjs → organizations-aRi1bhFC.mjs} +2 -2
  90. package/dist/{origin-ca-certificates-DXIvD8H5.mjs → origin-ca-certificates-BB4H89a_.mjs} +1 -1
  91. package/dist/{origin-post-quantum-encryption-C8oOczyV.mjs → origin-post-quantum-encryption-DurP3PXG.mjs} +1 -1
  92. package/dist/{origin-tls-client-auth-CaVW1Ztp.mjs → origin-tls-client-auth-CnQNy9-l.mjs} +1 -1
  93. package/dist/{output-BJFNwj7b.mjs → output-CUxZRM5A.mjs} +1 -1
  94. package/dist/{page-rules-CjZPTMQX.mjs → page-rules-CYqtPU1p.mjs} +1 -1
  95. package/dist/{page-shield-D5RRNJCY.mjs → page-shield-D8l9ZMUl.mjs} +1 -1
  96. package/dist/{pages-CWJtJnL0.mjs → pages-ChurJ2H7.mjs} +1 -1
  97. package/dist/{pipelines-B0L_7j9e.mjs → pipelines-CeyujvRf.mjs} +1 -1
  98. package/dist/{progress-CrCGTq7N.mjs → progress-Cent9Lsg.mjs} +1 -1
  99. package/dist/{queues-CN6DPhRR.mjs → queues-Rf_n11Cx.mjs} +1 -1
  100. package/dist/{r2-DQIcyRtA.mjs → r2-BtuTO3vQ.mjs} +1 -1
  101. package/dist/{r2-data-catalog-Bbo93TJx.mjs → r2-data-catalog-Debz38kv.mjs} +1 -1
  102. package/dist/radar-CzGM92uM.mjs +2 -0
  103. package/dist/{rate-limits-DcrQV6Ar.mjs → rate-limits-Bbk7HxP7.mjs} +1 -1
  104. package/dist/{raw-fetch-Dlccg0Tr.mjs → raw-fetch-DnbAMFBp.mjs} +1 -1
  105. package/dist/{realtime-kit-CaquuVOE.mjs → realtime-kit-CivLpkpg.mjs} +1 -1
  106. package/dist/{registrar-Ko-xZemf.mjs → registrar-8IeA5DKd.mjs} +1 -1
  107. package/dist/{request-tracers-DOW_reTJ.mjs → request-tracers-D1aH4NmL.mjs} +1 -1
  108. package/dist/{resource-sharing-D7TX0JV0.mjs → resource-sharing-B-Pcto7-.mjs} +3 -3
  109. package/dist/{resource-tagging-C3qtLzCz.mjs → resource-tagging-Bpb6Qq1M.mjs} +1 -1
  110. package/dist/{rules-BXRADHL5.mjs → rules-B10XWY10.mjs} +1 -1
  111. package/dist/{rulesets-CBgpeSvJ.mjs → rulesets-lYczEcJp.mjs} +1 -1
  112. package/dist/{rum-BjPptTUP.mjs → rum-B5GUKa4I.mjs} +3 -3
  113. package/dist/{schema-D16TgWBg.mjs → schema-hefO-tzo.mjs} +1 -1
  114. package/dist/{schema-validation-Dgv_opM3.mjs → schema-validation-DTq517Em.mjs} +1 -1
  115. package/dist/{scim-DdSEr4kZ.mjs → scim-BiLfOQ89.mjs} +1 -1
  116. package/dist/{secrets-store-7BfyvJLb.mjs → secrets-store-CBX0dvHL.mjs} +1 -1
  117. package/dist/{security-center-DAy6AKtT.mjs → security-center-AVpTOBK3.mjs} +1 -1
  118. package/dist/{security-txt-xAMb7K6Y.mjs → security-txt-DVlh8y9l.mjs} +1 -1
  119. package/dist/{session-COHHdS7A.mjs → session-CsvPYFj8.mjs} +2 -2
  120. package/dist/shared-0bwWVDLo.mjs +2 -0
  121. package/dist/{smart-shield-TeWZFnH2.mjs → smart-shield-DblHIce0.mjs} +1 -1
  122. package/dist/{snippets-CCSsCXVs.mjs → snippets-DrpqSXYC.mjs} +1 -1
  123. package/dist/{spawn-DcppKGI5.mjs → spawn-DK7pott_.mjs} +1 -1
  124. package/dist/{spectrum-CTTZID8u.mjs → spectrum-CnrG0jIC.mjs} +2 -2
  125. package/dist/speed-BzRY3Xlh.mjs +4 -0
  126. package/dist/{src-BW6vfAwE.mjs → src-D9_Gq68b.mjs} +10 -10
  127. package/dist/{ssl-BWA2LdwC.mjs → ssl-Cp6tQkZH.mjs} +1 -1
  128. package/dist/stream-CGTRN4ZN.mjs +14 -0
  129. package/dist/{tenants-Bd7NGQ_m.mjs → tenants-o_M62Y1n.mjs} +1 -1
  130. package/dist/{token-validation-DAgtFOvs.mjs → token-validation-Ca5AGEns.mjs} +1 -1
  131. package/dist/{tools-DXQmfFuE.mjs → tools-DtNNmO6l.mjs} +1 -1
  132. package/dist/{turnstile-cfdaO4ca.mjs → turnstile-l7mo9BWL.mjs} +2 -2
  133. package/dist/{ui-D4KtlMh9.mjs → ui-B97lRnOv.mjs} +1 -1
  134. package/dist/{url-normalization-B5RN4nLD.mjs → url-normalization-D1CogSIG.mjs} +1 -1
  135. package/dist/{url-scanner-BrZ1L9OC.mjs → url-scanner-BnJHJqcz.mjs} +1 -1
  136. package/dist/{user-CAo-yCJA.mjs → user-CiyYZ69X.mjs} +2 -2
  137. package/dist/{vectorize-C7_oQlaI.mjs → vectorize-D3LgMLOn.mjs} +1 -1
  138. package/dist/{versions-CUwWJWmy.mjs → versions-B6E8WQyA.mjs} +1 -1
  139. package/dist/{waiting-rooms-Dln5ICg5.mjs → waiting-rooms-Bhy_nuV3.mjs} +1 -1
  140. package/dist/{web3-HQJRm38W.mjs → web3-DlHE0CZc.mjs} +1 -1
  141. package/dist/{workers-Dg7ddG2Q.mjs → workers-DRAkU6YR.mjs} +1 -1
  142. package/dist/{workers-builds-AVfx8IyL.mjs → workers-builds-BmNjiHDZ.mjs} +1 -1
  143. package/dist/{workflows-VquuSh2J.mjs → workflows-z6oapEJs.mjs} +1 -1
  144. package/dist/{zaraz-xYSWIV4P.mjs → zaraz-CyzfYOEU.mjs} +1 -1
  145. package/dist/{zero-trust-CP96wnSh.mjs → zero-trust-fyyIelWx.mjs} +44 -44
  146. package/dist/zero_trust-BAhlNkjo.mjs +3 -0
  147. package/dist/{zones-BSgmZ9WC.mjs → zones-MSULnDwW.mjs} +4 -4
  148. package/package.json +4 -4
  149. package/dist/ai-search-CQF_Sn7d.mjs +0 -7
  150. package/dist/auth-SyWhMmPu.mjs +0 -6
  151. package/dist/auth-ffdf9yR0.mjs +0 -135
  152. package/dist/autorag-BuGhGTeZ.mjs +0 -2
  153. package/dist/billing-PoG81XaQ.mjs +0 -2
  154. package/dist/browser-rendering-xu8F_Rrv.mjs +0 -4
  155. package/dist/config-DYzlVxcB.mjs +0 -2
  156. package/dist/content-scanning-r6uzMO1r.mjs +0 -4
  157. package/dist/data-security-D_EtYBfo.mjs +0 -6
  158. package/dist/dist-DNBSHor6.mjs +0 -301
  159. package/dist/images-BO8FbDAa.mjs +0 -5
  160. package/dist/radar-Bxb0WX8V.mjs +0 -2
  161. package/dist/shared-AGtpXwwL.mjs +0 -2
  162. package/dist/speed-CuzTE0AL.mjs +0 -4
  163. package/dist/stream-GFsIZ-pP.mjs +0 -14
  164. /package/dist/{body-parser-DKa8Ipg1.mjs → body-parser-CBpeIUns.mjs} +0 -0
  165. /package/dist/{cli-types-CRIDdDw3.mjs → cli-types-CMNMD1V7.mjs} +0 -0
  166. /package/dist/{input-validation-zEO81MWN.mjs → input-validation-CTqtyiY9.mjs} +0 -0
  167. /package/dist/{lib-Eu1wXxuh.mjs → lib-B6xvCJjc.mjs} +0 -0
  168. /package/dist/{local-VJaJ3BZ1.mjs → local-D8bhHUMK.mjs} +0 -0
  169. /package/dist/{metadata-5VwHPW6C.mjs → metadata-jh2EIan8.mjs} +0 -0
  170. /package/dist/{resolve-4-OSeHlK.mjs → resolve-D1mG0REg.mjs} +0 -0
  171. /package/dist/{theme-BklJDrb2.mjs → theme-CFHr0Dh9.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,S as n,T as r,_ as i,i as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f,t as p}from"./input-validation-zEO81MWN.mjs";import{t as m}from"./local-VJaJ3BZ1.mjs";import{t as h}from"./cli-types-CRIDdDw3.mjs";import{n as ee,t as te}from"./raw-fetch-Dlccg0Tr.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 e=>{let t={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters,time_delta:e[`time-delta`]};if(e.dryRun){u({command:`cf dns analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_analytics/report/bytime`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.analytics.reports.bytimes.get({zone_id:i,...t})),{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 e=>{let t={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters};if(e.dryRun){u({command:`cf dns analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_analytics/report`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.analytics.reports.get({zone_id:i,...t})),{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 e=>{if(e.dryRun){u({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
2
+ import{C as e,D as t,S as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f,t as p}from"./input-validation-CTqtyiY9.mjs";import{t as m}from"./local-D8bhHUMK.mjs";import{t as h}from"./cli-types-CMNMD1V7.mjs";import{n as ee,t as te}from"./raw-fetch-DnbAMFBp.mjs";function g(e){return e.option(`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 e=>{let t={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters,time_delta:e[`time-delta`]};if(e.dryRun){u({command:`cf dns analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_analytics/report/bytime`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.analytics.reports.bytimes.get({zone_id:i,...t})),{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 e=>{let t={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters};if(e.dryRun){u({command:`cf dns analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_analytics/report`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.analytics.reports.get({zone_id:i,...t})),{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 e=>{if(e.dryRun){u({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}l(await d(`Deleting`,async()=>t.dns.dnssec.delete({zone_id:i})),{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
4
  providers to serve a DNSSEC-signed zone at the same time.
5
5
  This is required for DNSKEY records (except those automatically
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 p={command:`get <dns-firewall-id>`,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:d(f),handler:async t=>{let i={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){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},m={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 g={command:`get <dns-firewall-id>`,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:h,handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters};if(t.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},_={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(g).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
2
+ import{C as e,T as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";import{t as d}from"./cli-types-CMNMD1V7.mjs";function f(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 p={command:`get <dns-firewall-id>`,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:d(f),handler:async t=>{let i={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){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},m={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 g={command:`get <dns-firewall-id>`,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:h,handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters};if(t.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},_={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(g).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
3
3
  indicated by the TTL received from upstream nameservers. This setting
4
4
  sets an upper bound on this duration. For caching purposes, higher TTLs
5
5
  will be decreased to the maximum value defined by this setting.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,_ as t,n}from"./auth-ffdf9yR0.mjs";import{t as r}from"./output-BJFNwj7b.mjs";import{n as i,t as a}from"./progress-CrCGTq7N.mjs";import{t as o}from"./local-VJaJ3BZ1.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/${e()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);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/${e()??`<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 t(l);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};
2
+ import{C as e,_ as t,n}from"./auth-BqDOIrKX.mjs";import{t as r}from"./output-CUxZRM5A.mjs";import{n as i,t as a}from"./progress-Cent9Lsg.mjs";import{t as o}from"./local-D8bhHUMK.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/${e()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);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/${e()??`<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 t(l);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};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,E as n,S as r,T as i,_ as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f}from"./input-validation-zEO81MWN.mjs";import{t as p}from"./local-VJaJ3BZ1.mjs";import{t as m}from"./cli-types-CRIDdDw3.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 n=>{if(n.dryRun){u({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({email:f(n.email,`email`,`text`)}):s(n.body)});return}let r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailRouting.addresses.create({...e,account_id:i})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await t(`email`,`The contact email address of the user.`));let m=c({email:f(n.email,`email`,`text`)});l(await d(`Creating`,async()=>r.emailRouting.addresses.create({...m,account_id:i})),{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 t=>{if(t.dryRun){u({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);if(t.accountId=r,!await i({force:!!t.force})){process.stderr.write(`Aborted.
2
+ import{C as e,D as t,E as n,S as r,T as i,_ as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f}from"./input-validation-CTqtyiY9.mjs";import{t as p}from"./local-D8bhHUMK.mjs";import{t as m}from"./cli-types-CMNMD1V7.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 n=>{if(n.dryRun){u({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({email:f(n.email,`email`,`text`)}):s(n.body)});return}let r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailRouting.addresses.create({...e,account_id:i})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await t(`email`,`The contact email address of the user.`));let m=c({email:f(n.email,`email`,`text`)});l(await d(`Creating`,async()=>r.emailRouting.addresses.create({...m,account_id:i})),{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 t=>{if(t.dryRun){u({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);if(t.accountId=r,!await i({force:!!t.force})){process.stderr.write(`Aborted.
3
3
  `);return}l(await d(`Deleting`,async()=>n.emailRouting.addresses.delete({account_id:r,destination_address_identifier:t[`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 t=>{if(t.dryRun){u({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailRouting.addresses.get({account_id:r,destination_address_identifier:t[`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 t=>{let n={page:t.page,per_page:t[`per-page`],direction:t.direction,verified:t.verified};if(t.dryRun){u({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),i=t.local?p:await a(r);t.accountId=i,l(await d(`Loading`,async()=>r.emailRouting.addresses.list({account_id:i,...n})),{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 t=>{if(t.dryRun){u({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({status:f(t.status,`status`,`text`)}):s(t.body)});return}let r=await o(t),i=t.local?p:await a(r);if(t.accountId=i,t.body){let e=s(t.body);l(await d(`Updating`,async()=>r.emailRouting.addresses.update({...e,account_id:i,destination_address_identifier:t[`destination-address-identifier`]})),{successLabel:`Updated`});return}t.status===void 0&&(t.status=await n(`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=c({status:f(t.status,`status`,`text`)});l(await d(`Updating`,async()=>r.emailRouting.addresses.update({...m,account_id:i,destination_address_identifier:t[`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 e=>{if(e.dryRun){u({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
4
4
  `);return}l(await d(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let i=c({name:f(e.name,`name`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.dns.create({body:i,zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
5
5
  `);return}if(e.body){let r=s(e.body);l(await d(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let a=c({name:f(e.name,`name`,`text`)});l(await d(`Deleting`,async()=>t.emailRouting.dns.delete({body:a,zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let i=c({name:f(e.name,`name`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.dns.edit({body:i,zone_id:n})),{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 e=>{let t={subdomain:e.subdomain};if(e.dryRun){u({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>n.emailRouting.dns.get({zone_id:i,...t})),{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 e=>{if(e.dryRun){u({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let i=c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});l(await d(`Updating`,async()=>t.emailRouting.edit({...i,zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}let i=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:f(e.source,`source`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...i,zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let i=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.rules.create({...i,zone_id:n})),{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 e=>{if(e.dryRun){u({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f}from"./input-validation-zEO81MWN.mjs";import{t as p}from"./local-VJaJ3BZ1.mjs";import{t as m}from"./cli-types-CRIDdDw3.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 t=>{if(t.dryRun){u({command:`cf email-security investigate detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/detections`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.detections.get({account_id:r,investigate_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security investigate get-action log`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/action_log`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.getAction.log({account_id:r,investigate_id:t[`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
2
+ import{C as e,D as t,E as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f}from"./input-validation-CTqtyiY9.mjs";import{t as p}from"./local-D8bhHUMK.mjs";import{t as m}from"./cli-types-CMNMD1V7.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 t=>{if(t.dryRun){u({command:`cf email-security investigate detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/detections`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.detections.get({account_id:r,investigate_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security investigate get-action log`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/action_log`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.getAction.log({account_id:r,investigate_id:t[`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
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 t=>{let n={submission:t.submission};if(t.dryRun){u({command:`cf email-security investigate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?p:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.emailSecurity.investigate.get({account_id:a,investigate_id:t[`investigate-id`],...n})),{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 t=>{let n={start:t.start,end:t.end,query:t.query,detections_only:t[`detections-only`],final_disposition:t[`final-disposition`],metric:t.metric,message_action:t[`message-action`],recipient:t.recipient,sender:t.sender,alert_id:t[`alert-id`],domain:t.domain,message_id:t[`message-id`],subject:t.subject,delivery_status:t[`delivery-status`],cursor:t.cursor,per_page:t[`per-page`],page:t.page};if(t.dryRun){u({command:`cf email-security investigate list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?p:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.emailSecurity.investigate.list({account_id:a,...n})),{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 t=>{if(t.dryRun){u({command:`cf email-security investigate move create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/move`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({destination:f(t.destination,`destination`,`text`),expected_disposition:f(t[`expected-disposition`],`expected-disposition`,`text`)}):s(t.body)});return}let r=await o(t),a=t.local?p:await i(r);if(t.accountId=a,t.body){let e=s(t.body);l(await d(`Creating`,async()=>r.emailSecurity.investigate.move.create({...e,account_id:a,investigate_id:t[`investigate-id`]})),{successLabel:`Created`});return}t.destination===void 0&&(t.destination=await n(`destination`,`The destination field`,[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]));let m=c({destination:f(t.destination,`destination`,`text`),expected_disposition:f(t[`expected-disposition`],`expected-disposition`,`text`)});l(await d(`Creating`,async()=>r.emailSecurity.investigate.move.create({...m,account_id:a,investigate_id:t[`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){u({command:`cf email-security investigate preview create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/preview`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({postfix_id:f(n[`postfix-id`],`postfix-id`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?p:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailSecurity.investigate.preview.create({...e,account_id:a})),{successLabel:`Created`});return}n[`postfix-id`]===void 0&&(n[`postfix-id`]=await t(`postfix-id`,`The identifier of the message`));let m=c({postfix_id:f(n[`postfix-id`],`postfix-id`,`text`)});l(await d(`Creating`,async()=>r.emailSecurity.investigate.preview.create({...m,account_id:a})),{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 t=>{if(t.dryRun){u({command:`cf email-security investigate preview get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/preview`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.preview.get({account_id:r,investigate_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security investigate raw get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/raw`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.raw.get({account_id:r,investigate_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security investigate reclassify create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/reclassify`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({eml_content:f(t[`eml-content`],`eml-content`,`text`),escalated_submission_id:f(t[`escalated-submission-id`],`escalated-submission-id`,`text`),expected_disposition:f(t[`expected-disposition`],`expected-disposition`,`text`)}):s(t.body)});return}let r=await o(t),a=t.local?p:await i(r);if(t.accountId=a,t.body){let e=s(t.body);l(await d(`Creating`,async()=>r.emailSecurity.investigate.reclassify.create({...e,account_id:a,investigate_id:t[`investigate-id`]})),{successLabel:`Created`});return}t[`expected-disposition`]===void 0&&(t[`expected-disposition`]=await n(`expected-disposition`,`The expected_disposition field`,[`NONE`,`BULK`,`MALICIOUS`,`SPAM`,`SPOOF`,`SUSPICIOUS`]));let m=c({eml_content:f(t[`eml-content`],`eml-content`,`text`),escalated_submission_id:f(t[`escalated-submission-id`],`escalated-submission-id`,`text`),expected_disposition:f(t[`expected-disposition`],`expected-disposition`,`text`)});l(await d(`Creating`,async()=>r.emailSecurity.investigate.reclassify.create({...m,account_id:a,investigate_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security investigate release bulk`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/release`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.investigate.release.bulk({body:e,account_id:r})),{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.`)}},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 t=>{if(t.dryRun){u({command:`cf email-security investigate trace get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/investigate/${t[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(t[`investigate-id`]))}/trace`,pathParams:{"investigate-id":String(t[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.investigate.trace.get({account_id:r,investigate_id:t[`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 t=>{let n={start:t.start,end:t.end,from_date:t[`from-date`],to_date:t[`to-date`]};if(t.dryRun){u({command:`cf email-security phishguard reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/phishguard/reports`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?p:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.emailSecurity.phishguard.reports.list({account_id:a,...n})),{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 t=>{if(t.dryRun){u({command:`cf email-security settings allow-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},bodyKind:`json`,body:t.body===void 0?c({comments:f(t.comments,`comments`,`text`),is_acceptable_sender:t[`is-acceptable-sender`],is_exempt_recipient:t[`is-exempt-recipient`],is_recipient:t[`is-recipient`],is_regex:t[`is-regex`],is_sender:t[`is-sender`],is_spoof:t[`is-spoof`],is_trusted_sender:t[`is-trusted-sender`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`),verify_sender:t[`verify-sender`]}):s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.allowPolicies.create({body:e,account_id:r})),{successLabel:`Created`});return}let a=c({comments:f(t.comments,`comments`,`text`),is_acceptable_sender:t[`is-acceptable-sender`],is_exempt_recipient:t[`is-exempt-recipient`],is_recipient:t[`is-recipient`],is_regex:t[`is-regex`],is_sender:t[`is-sender`],is_spoof:t[`is-spoof`],is_trusted_sender:t[`is-trusted-sender`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`),verify_sender:t[`verify-sender`]});l(await d(`Creating`,async()=>n.emailSecurity.settings.allowPolicies.create({body:a,account_id:r})),{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 t=>{if(t.dryRun){u({command:`cf email-security settings allow-policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/allow_policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?p:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
4
4
  `);return}l(await d(`Deleting`,async()=>n.emailSecurity.settings.allowPolicies.delete({account_id:a,policy_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security settings allow-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/allow_policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({comments:f(t.comments,`comments`,`text`),is_acceptable_sender:t[`is-acceptable-sender`],is_exempt_recipient:t[`is-exempt-recipient`],is_recipient:t[`is-recipient`],is_regex:t[`is-regex`],is_sender:t[`is-sender`],is_spoof:t[`is-spoof`],is_trusted_sender:t[`is-trusted-sender`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`),verify_sender:t[`verify-sender`]}):s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.emailSecurity.settings.allowPolicies.edit({body:e,account_id:r,policy_id:t[`policy-id`]})),{successLabel:`Updated`});return}let a=c({comments:f(t.comments,`comments`,`text`),is_acceptable_sender:t[`is-acceptable-sender`],is_exempt_recipient:t[`is-exempt-recipient`],is_recipient:t[`is-recipient`],is_regex:t[`is-regex`],is_sender:t[`is-sender`],is_spoof:t[`is-spoof`],is_trusted_sender:t[`is-trusted-sender`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`),verify_sender:t[`verify-sender`]});l(await d(`Updating`,async()=>n.emailSecurity.settings.allowPolicies.edit({body:a,account_id:r,policy_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security settings allow-policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/allow_policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.settings.allowPolicies.get({account_id:r,policy_id:t[`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 t=>{let n={page:t.page,per_page:t[`per-page`],search:t.search,order:t.order,direction:t.direction,is_exempt_recipient:t[`is-exempt-recipient`],is_trusted_sender:t[`is-trusted-sender`],is_acceptable_sender:t[`is-acceptable-sender`],verify_sender:t[`verify-sender`],pattern_type:t[`pattern-type`],pattern:t.pattern};if(t.dryRun){u({command:`cf email-security settings allow-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?p:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.emailSecurity.settings.allowPolicies.list({account_id:a,...n})),{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 t=>{if(t.dryRun){u({command:`cf email-security settings batch allow policies batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/allow_policies/batch`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.allow.policies.batch.create({...e,account_id:r})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/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 t=>{if(t.dryRun){u({command:`cf email-security settings batch block senders batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/block_senders/batch`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.block.senders.batch.create({...e,account_id:r})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/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 t=>{if(t.dryRun){u({command:`cf email-security settings batch sending domain restrictions batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/sending_domain_restrictions/batch`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.sending.domain.restrictions.batch.create({...e,account_id:r})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/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 t=>{if(t.dryRun){u({command:`cf email-security settings batch trusted domains batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/trusted_domains/batch`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.trusted.domains.batch.create({...e,account_id:r})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/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 t=>{if(t.dryRun){u({command:`cf email-security settings block-senders create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},bodyKind:`json`,body:t.body===void 0?c({comments:f(t.comments,`comments`,`text`),is_regex:t[`is-regex`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.blockSenders.create({body:e,account_id:r})),{successLabel:`Created`});return}let a=c({comments:f(t.comments,`comments`,`text`),is_regex:t[`is-regex`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`)});l(await d(`Creating`,async()=>n.emailSecurity.settings.blockSenders.create({body:a,account_id:r})),{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 t=>{if(t.dryRun){u({command:`cf email-security settings block-senders delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/block_senders/${t[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(t[`pattern-id`]))}`,pathParams:{"pattern-id":String(t[`pattern-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?p:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
5
5
  `);return}l(await d(`Deleting`,async()=>n.emailSecurity.settings.blockSenders.delete({account_id:a,pattern_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security settings block-senders edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/block_senders/${t[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(t[`pattern-id`]))}`,pathParams:{"pattern-id":String(t[`pattern-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({comments:f(t.comments,`comments`,`text`),is_regex:t[`is-regex`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?p:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.emailSecurity.settings.blockSenders.edit({body:e,account_id:r,pattern_id:t[`pattern-id`]})),{successLabel:`Updated`});return}let a=c({comments:f(t.comments,`comments`,`text`),is_regex:t[`is-regex`],pattern:f(t.pattern,`pattern`,`text`),pattern_type:f(t[`pattern-type`],`pattern-type`,`text`)});l(await d(`Updating`,async()=>n.emailSecurity.settings.blockSenders.edit({body:a,account_id:r,pattern_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-security settings block-senders get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/block_senders/${t[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(t[`pattern-id`]))}`,pathParams:{"pattern-id":String(t[`pattern-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailSecurity.settings.blockSenders.get({account_id:r,pattern_id:t[`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 t=>{let n={page:t.page,per_page:t[`per-page`],search:t.search,order:t.order,direction:t.direction,pattern_type:t[`pattern-type`],pattern:t.pattern};if(t.dryRun){u({command:`cf email-security settings block-senders list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?p:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.emailSecurity.settings.blockSenders.list({account_id:a,...n})),{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 t=>{if(t.dryRun){u({command:`cf email-security settings domains bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email-security/settings/domains`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:s(t.body)});return}let n=await o(t),a=t.local?p:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,S as n,T as r,_ as i,n as a}from"./auth-ffdf9yR0.mjs";import{n as o,t as s}from"./body-parser-DKa8Ipg1.mjs";import{t as c}from"./output-BJFNwj7b.mjs";import{n as l,t as u}from"./progress-CrCGTq7N.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Returns the current daily sending quota for the account and, when a quota is resolved, the account's current usage against it. Quota is null when not yet available; usage is null when there is no resolved quota or usage is temporarily unavailable.`,builder:p,handler:async t=>{if(t.dryRun){l({command:`cf email-sending limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/limits`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.emailSending.limits.get({account_id:r})),{successLabel:`Loaded`})}},h={command:`limits`,describe:`Operations for limits`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).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:`send-raw`,describe:`Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`,builder:g,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.sendRaw({...e,account_id:p})),{successLabel:`Created`});return}if(n.from===void 0&&(n.from=await t(`from`,`Sender email address.`)),n[`mime-message`]===void 0&&(n[`mime-message`]=await t(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),n.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let m=s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients});c(await u(`Creating`,async()=>r.emailSending.sendRaw({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`send`,describe:`Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`,builder:v,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.send({...e,account_id:p})),{successLabel:`Created`});return}n.subject===void 0&&(n.subject=await t(`subject`,`Email subject line.`));let m=s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}});c(await u(`Creating`,async()=>r.emailSending.send({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the 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 x={command:`create`,describe:`Creates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present.`,builder:b,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...t,zone_id:i})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...f,zone_id:i})),{successLabel:`Created`})}};function S(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain 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 C={command:`delete <subdomain-id>`,describe:`Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
2
+ import{C as e,D as t,S as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Returns the current daily sending quota for the account and, when a quota is resolved, the account's current usage against it. Quota is null when not yet available; usage is null when there is no resolved quota or usage is temporarily unavailable.`,builder:p,handler:async t=>{if(t.dryRun){l({command:`cf email-sending limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/limits`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.emailSending.limits.get({account_id:r})),{successLabel:`Loaded`})}},h={command:`limits`,describe:`Operations for limits`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).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:`send-raw`,describe:`Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`,builder:g,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.sendRaw({...e,account_id:p})),{successLabel:`Created`});return}if(n.from===void 0&&(n.from=await t(`from`,`Sender email address.`)),n[`mime-message`]===void 0&&(n[`mime-message`]=await t(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),n.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let m=s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients});c(await u(`Creating`,async()=>r.emailSending.sendRaw({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`send`,describe:`Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`,builder:v,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.send({...e,account_id:p})),{successLabel:`Created`});return}n.subject===void 0&&(n.subject=await t(`subject`,`Email subject line.`));let m=s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}});c(await u(`Creating`,async()=>r.emailSending.send({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the 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 x={command:`create`,describe:`Creates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present.`,builder:b,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...t,zone_id:i})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...f,zone_id:i})),{successLabel:`Created`})}};function S(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain 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 C={command:`delete <subdomain-id>`,describe:`Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}c(await u(`Deleting`,async()=>t.emailSending.subdomains.delete({zone_id:i,subdomain_id:e[`subdomain-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`fix <subdomain-id>`,describe:`Idempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns fix`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Creating`,async()=>t.emailSending.subdomains.dns.fix({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Created`})}};function E(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get-status <subdomain-id>`,describe:`Returns the desired DNS records for a sending subdomain along with a live diff against actual DNS state. Use this to detect missing, unlocked, foreign, or multi-record conflicts before deciding whether to call the fix endpoint.`,builder:E,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns/status`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.getStatus({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <subdomain-id>`,describe:`Returns the expected DNS records for a sending subdomain.`,builder:O,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.get({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}},A={command:`dns`,describe:`Operations for subdomains.dns`,builder:e=>e.command(T).command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <subdomain-id>`,describe:`Gets information for a specific sending subdomain.`,builder:j,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.get({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Lists all sending-enabled subdomains for the zone.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.list({zone_id:r})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the 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 I={command:`preview`,describe:`Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status.`,builder:F,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Loading`,async()=>r.emailSending.subdomains.preview({...t,zone_id:i})),{successLabel:`Loaded`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Loading`,async()=>r.emailSending.subdomains.preview({...f,zone_id:i})),{successLabel:`Loaded`})}};function L(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`preview-enabled`,{type:`boolean`,description:`Whether sent messages from this subdomain can be previewed in the activity log.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <subdomain-id>`,describe:`Updates the activity-log preview preference for a sending subdomain.`,builder:L,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({preview_enabled:e[`preview-enabled`]}):o(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=o(e.body);c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...n,zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`});return}if(e[`preview-enabled`]===void 0)throw Error(`--preview-enabled is required (or pass --body with this field set).`);let i=s({preview_enabled:e[`preview-enabled`]});c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...i,zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`})}},z={command:`subdomains`,describe:`Operations for subdomains`,builder:e=>e.command(x).command(C).command(M).command(P).command(I).command(R).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`email-sending`,describe:`Send emails and manage sending subdomains`,builder:e=>e.command(y).command(_).command(h).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{B as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{S as e,T as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";import{t as l}from"./cli-types-CRIDdDw3.mjs";function u(e){return e.option(`id`,{type:`string`,description:`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 d={command:`bulk-delete`,describe:`Deletes one or more existing filters.`,builder:u,handler:async r=>{let i={id:r.id};if(r.dryRun){o({command:`cf filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),l=await e({zone:r.zone},c,{quiet:r.quiet});if(r.zoneId=l,!await t({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{S as e,T as t,n}from"./auth-BqDOIrKX.mjs";import{n as r,t as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c}from"./input-validation-CTqtyiY9.mjs";import{t as l}from"./cli-types-CMNMD1V7.mjs";function u(e){return e.option(`id`,{type:`string`,description:`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 d={command:`bulk-delete`,describe:`Deletes one or more existing filters.`,builder:u,handler:async r=>{let i={id:r.id};if(r.dryRun){o({command:`cf filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),l=await e({zone:r.zone},c,{quiet:r.quiet});if(r.zoneId=l,!await t({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.filters.bulkDelete({zone_id:l,...i})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`bulk-update`,describe:`Updates one or more existing filters.`,builder:f,handler:async t=>{if(t.dryRun){o({command:`cf filters bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:r(t.body)});return}let i=await n(t),c=await e({zone:t.zone},i,{quiet:t.quiet});if(t.zoneId=c,t.body){let e=r(t.body);a(await s(`Updating`,async()=>i.filters.bulkUpdate({body:e,zone_id:c})),{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 m(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 h={command:`create`,describe:`Creates one or more filters.`,builder:m,handler:async t=>{if(t.dryRun){o({command:`cf filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:r(t.body)});return}let i=await n(t),c=await e({zone:t.zone},i,{quiet:t.quiet});if(t.zoneId=c,t.body){let e=r(t.body);a(await s(`Creating`,async()=>i.filters.create({body:e,zone_id:c})),{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 g(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,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 _={command:`delete <filter-id>`,describe:`Deletes an existing filter.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf filters delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``),"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=await e({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await t({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>i.filters.delete({zone_id:c,filter_id:r[`filter-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <filter-id>`,describe:`Fetches the details of a filter.`,builder:v,handler:async t=>{if(t.dryRun){o({command:`cf filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(t),i=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>r.filters.get({zone_id:i,filter_id:t[`filter-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`expression`,{type:`string`,description:`A case-insensitive string to find in the expression.`}).option(`description`,{type:`string`,description:`A case-insensitive string to find in the description.`}).option(`ref`,{type:`string`,description:`The filter ref (a short reference tag) to search for. Must be an exact match.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of filters per page.`}).option(`id`,{type:`string`,description:`The unique identifier of the filter.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Fetches filters in a zone. You can filter the results using several optional parameters.`,builder:l(b),handler:async t=>{let r={paused:t.paused,expression:t.expression,description:t.description,ref:t.ref,page:t.page,per_page:t[`per-page`],id:t.id};if(t.dryRun){o({command:`cf filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(t),c=await e({zone:t.zone},i,{quiet:t.quiet});t.zoneId=c,a(await s(`Loading`,async()=>i.filters.list({zone_id:c,...r})),{successLabel:`Loaded`})}};function S(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the filter.`}).option(`expression`,{type:`string`,description:`The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`ref`,{type:`string`,description:`A short reference tag. Allows you to select related filters.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <filter-id>`,describe:`Updates an existing filter.`,builder:S,handler:async t=>{if(t.dryRun){o({command:`cf filters update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/filters/${t[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(t[`filter-id`]))}`,pathParams:{"filter-id":String(t[`filter-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?i({description:c(t.description,`description`,`text`),expression:c(t.expression,`expression`,`text`),paused:t.paused,ref:c(t.ref,`ref`,`text`)}):r(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=r(t.body);a(await s(`Updating`,async()=>l.filters.update({body:e,zone_id:u,filter_id:t[`filter-id`]})),{successLabel:`Updated`});return}let d=i({description:c(t.description,`description`,`text`),expression:c(t.expression,`expression`,`text`),paused:t.paused,ref:c(t.ref,`ref`,`text`)});a(await s(`Updating`,async()=>l.filters.update({body:d,zone_id:u,filter_id:t[`filter-id`]})),{successLabel:`Updated`})}},w={command:`filters`,describe:`Filter expressions used by legacy firewall rules to match requests — prefer Rulesets for new configurations`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,E as t,S as n,T as r,_ as i,i as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f}from"./input-validation-zEO81MWN.mjs";import{t as p}from"./local-VJaJ3BZ1.mjs";import{t as m}from"./cli-types-CRIDdDw3.mjs";function ee(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).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:`Creates a new IP Access rule for an account. The rule will apply to all zones in the account. Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.`,builder:ee,handler:async n=>{if(n.dryRun){u({command:`cf firewall access-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({configuration:{target:f(n[`configuration-target`],`configuration-target`,`text`),value:f(n[`configuration-value`],`configuration-value`,`text`)},mode:f(n.mode,`mode`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?p:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.firewall.accessRules.create({...e,account_id:a})),{successLabel:`Created`});return}n.mode===void 0&&(n.mode=await t(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let m=c({configuration:{target:f(n[`configuration-target`],`configuration-target`,`text`),value:f(n[`configuration-value`],`configuration-value`,`text`)},mode:f(n.mode,`mode`,`text`)});l(await d(`Creating`,async()=>r.firewall.accessRules.create({...m,account_id:a})),{successLabel:`Created`})}};function h(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,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 <rule-id>`,describe:`Deletes an existing IP Access rule defined at the account level. Note: This operation will affect all zones in the account.`,builder:h,handler:async t=>{if(t.dryRun){u({command:`cf firewall access-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?p:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
2
+ import{C as e,E as t,S as n,T as r,_ as i,i as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f}from"./input-validation-CTqtyiY9.mjs";import{t as p}from"./local-D8bhHUMK.mjs";import{t as m}from"./cli-types-CMNMD1V7.mjs";function ee(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).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:`Creates a new IP Access rule for an account. The rule will apply to all zones in the account. Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.`,builder:ee,handler:async n=>{if(n.dryRun){u({command:`cf firewall access-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({configuration:{target:f(n[`configuration-target`],`configuration-target`,`text`),value:f(n[`configuration-value`],`configuration-value`,`text`)},mode:f(n.mode,`mode`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?p:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.firewall.accessRules.create({...e,account_id:a})),{successLabel:`Created`});return}n.mode===void 0&&(n.mode=await t(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let m=c({configuration:{target:f(n[`configuration-target`],`configuration-target`,`text`),value:f(n[`configuration-value`],`configuration-value`,`text`)},mode:f(n.mode,`mode`,`text`)});l(await d(`Creating`,async()=>r.firewall.accessRules.create({...m,account_id:a})),{successLabel:`Created`})}};function h(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,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 <rule-id>`,describe:`Deletes an existing IP Access rule defined at the account level. Note: This operation will affect all zones in the account.`,builder:h,handler:async t=>{if(t.dryRun){u({command:`cf firewall access-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?p:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
3
  `);return}l(await d(`Deleting`,async()=>n.firewall.accessRules.delete({account_id:a,rule_id:t[`rule-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`notes`,{type:`string`,description:`An informative summary of the rule, typically used as a reminder or explanation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <rule-id>`,describe:`Updates an IP Access rule defined at the account level. Note: This operation will affect all zones in the account.`,builder:_,handler:async n=>{if(n.dryRun){u({command:`cf firewall access-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({configuration:{target:f(n[`configuration-target`],`configuration-target`,`text`),value:f(n[`configuration-value`],`configuration-value`,`text`)},mode:f(n.mode,`mode`,`text`),notes:f(n.notes,`notes`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?p:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Updating`,async()=>r.firewall.accessRules.edit({body:e,account_id:a,rule_id:n[`rule-id`]})),{successLabel:`Updated`});return}n.mode===void 0&&(n.mode=await t(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let m=c({configuration:{target:f(n[`configuration-target`],`configuration-target`,`text`),value:f(n[`configuration-value`],`configuration-value`,`text`)},mode:f(n.mode,`mode`,`text`),notes:f(n.notes,`notes`,`text`)});l(await d(`Updating`,async()=>r.firewall.accessRules.edit({body:m,account_id:a,rule_id:n[`rule-id`]})),{successLabel:`Updated`})}};function y(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <rule-id>`,describe:`Fetches the details of an IP Access rule defined at the account level.`,builder:y,handler:async t=>{if(t.dryRun){u({command:`cf firewall access-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.firewall.accessRules.get({account_id:r,rule_id:t[`rule-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`configuration-target`,{type:`string`,description:`Defines the target to search in existing rules.`,choices:[`ip`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:"Defines the target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`.\nNotes: You can search for a single IPv4 address, an IP address range with a subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code."}).option(`notes`,{type:`string`,description:`Defines the string to search for in the notes of existing IP Access rules.
4
4
  Notes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.`}).option(`match`,{type:`string`,description:"Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Defines the requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Defines the maximum number of results requested.`}).option(`order`,{type:`string`,description:`Defines the field used to sort returned rules.`,choices:[`configuration.target`,`configuration.value`,`mode`]}).option(`direction`,{type:`string`,description:`Defines the direction used to sort returned rules.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Fetches IP Access rules of an account. These rules apply to all the zones in the account. You can filter the results using several optional parameters.`,builder:m(x),handler:async t=>{let n={mode:t.mode,"configuration.target":t[`configuration-target`],"configuration.value":t[`configuration-value`],notes:t.notes,match:t.match,page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){u({command:`cf firewall access-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/firewall/access_rules/rules`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?p:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.firewall.accessRules.list({account_id:a,...n})),{successLabel:`Loaded`})}},C={command:`access-rules`,describe:`IP-based access rules that allow, block, challenge, or whitelist traffic globally or per-zone`,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(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`priority`,{type:`number`,description:`The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.`}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Creates a new Zone Lockdown rule.`,builder:w,handler:async e=>{if(e.dryRun){u({command:`cf firewall lockdowns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({description:f(e.description,`description`,`text`),paused:e.paused,priority:e.priority,urls:e.urls}):s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Creating`,async()=>t.firewall.lockdowns.create({...n,zone_id:r})),{successLabel:`Created`});return}if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let i=c({description:f(e.description,`description`,`text`),paused:e.paused,priority:e.priority,urls:e.urls});l(await d(`Creating`,async()=>t.firewall.lockdowns.create({...i,zone_id:r})),{successLabel:`Created`})}};function E(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <lock-downs-id>`,describe:`Deletes an existing Zone Lockdown rule.`,builder:E,handler:async e=>{if(e.dryRun){u({command:`cf firewall lockdowns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
5
5
  `);return}l(await d(`Deleting`,async()=>t.firewall.lockdowns.delete({zone_id:i,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <lock-downs-id>`,describe:`Fetches the details of a Zone Lockdown rule.`,builder:O,handler:async e=>{if(e.dryRun){u({command:`cf firewall lockdowns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.firewall.lockdowns.get({zone_id:r,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`description`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`modified-on`,{type:`string`,description:`The timestamp of when the rule was last modified.`}).option(`ip`,{type:`string`,description:`A single IP address to search for in existing rules.`}).option(`priority`,{type:`number`,description:`The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.`}).option(`uri-search`,{type:`string`,description:`A single URI to search for in the list of URLs of existing rules.`}).option(`ip-range-search`,{type:`string`,description:`A single IP address range to search for in existing rules.`}).option(`per-page`,{type:`number`,description:"The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`."}).option(`created-on`,{type:`string`,description:`The timestamp of when the rule was created.`}).option(`description-search`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`ip-search`,{type:`string`,description:`A single IP address to search for in existing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Fetches Zone Lockdown rules. You can filter the results using several optional parameters.`,builder:A,handler:async e=>{let t={page:e.page,description:e.description,modified_on:e[`modified-on`],ip:e.ip,priority:e.priority,uri_search:e[`uri-search`],ip_range_search:e[`ip-range-search`],per_page:e[`per-page`],created_on:e[`created-on`],description_search:e[`description-search`],ip_search:e[`ip-search`]};if(e.dryRun){u({command:`cf firewall lockdowns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.firewall.lockdowns.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function M(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).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 N={command:`update <lock-downs-id>`,describe:`Updates an existing Zone Lockdown rule.`,builder:M,handler:async e=>{if(e.dryRun){u({command:`cf firewall lockdowns update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({urls:e.urls}):s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Updating`,async()=>t.firewall.lockdowns.update({...n,zone_id:r,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Updated`});return}if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let i=c({urls:e.urls});l(await d(`Updating`,async()=>t.firewall.lockdowns.update({...i,zone_id:r,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Updated`})}},P={command:`lockdowns`,describe:`Zone lockdown rules that restrict access to URLs by IP address or range`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(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 I={command:`bulk-delete`,describe:`Deletes existing firewall rules.`,builder:F,handler:async e=>{if(e.dryRun){u({command:`cf firewall rules bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{S as e,n as t}from"./auth-ffdf9yR0.mjs";import{n,t as r}from"./body-parser-DKa8Ipg1.mjs";import{t as i}from"./output-BJFNwj7b.mjs";import{n as a,t as o}from"./progress-CrCGTq7N.mjs";import{n as s}from"./input-validation-zEO81MWN.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Retrieve Fraud Detection settings for a zone.`,builder:c,handler:async n=>{if(n.dryRun){a({command:`cf fraud get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/fraud_detection/settings`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.fraud.get({zone_id:s})),{successLabel:`Loaded`})}};function u(e){return e.option(`authentication-settings-failure-criteria-kind`,{type:`string`,description:"The type of criterion. Currently only `status_code` is supported.",choices:[`status_code`]}).option(`authentication-settings-failure-criteria-status-codes`,{type:`string`,array:!0,description:`HTTP status codes to match against the origin response.
2
+ import{S as e,n as t}from"./auth-BqDOIrKX.mjs";import{n,t as r}from"./body-parser-CBpeIUns.mjs";import{t as i}from"./output-CUxZRM5A.mjs";import{n as a,t as o}from"./progress-Cent9Lsg.mjs";import{n as s}from"./input-validation-CTqtyiY9.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Retrieve Fraud Detection settings for a zone.`,builder:c,handler:async n=>{if(n.dryRun){a({command:`cf fraud get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/fraud_detection/settings`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.fraud.get({zone_id:s})),{successLabel:`Loaded`})}};function u(e){return e.option(`authentication-settings-failure-criteria-kind`,{type:`string`,description:"The type of criterion. Currently only `status_code` is supported.",choices:[`status_code`]}).option(`authentication-settings-failure-criteria-status-codes`,{type:`string`,array:!0,description:`HTTP status codes to match against the origin response.
3
3
  - Maximum of 10 codes per criterion.
4
4
  - Each code must be a valid HTTP status code (100-599).
5
5
  - Codes are deduplicated and sorted on save.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{D as e,S as t,n}from"./auth-ffdf9yR0.mjs";import{n as r,t as i}from"./body-parser-DKa8Ipg1.mjs";import{t as a}from"./output-BJFNwj7b.mjs";import{n as o,t as s}from"./progress-CrCGTq7N.mjs";import{n as c}from"./input-validation-zEO81MWN.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Gets the Google Tag Gateway configuration for a zone.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf google-tag-gateway config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.googleTagGateway.config.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`enabled`,{type:`boolean`,description:`Enables or disables Google Tag Gateway for this zone.`}).option(`endpoint`,{type:`string`,description:`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`}).option(`hide-original-ip`,{type:`boolean`,description:`Hides the original client IP address from Google when enabled.`}).option(`measurement-id`,{type:`string`,description:`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`}).option(`set-up-tag`,{type:`boolean`,description:`Set up the associated Google Tag on the zone automatically when enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Google Tag Gateway configuration for a zone.`})}const f={command:`update`,describe:`Updates the Google Tag Gateway configuration for a zone.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf google-tag-gateway config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:e,zone_id:d})),{successLabel:`Updated`});return}if(l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(l.endpoint===void 0&&(l.endpoint=await e(`endpoint`,`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`)),l[`hide-original-ip`]===void 0)throw Error(`--hide-original-ip is required (or pass --body with this field set).`);l[`measurement-id`]===void 0&&(l[`measurement-id`]=await e(`measurement-id`,`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`));let f=i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]});a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:f,zone_id:d})),{successLabel:`Updated`})}},p={command:`config`,describe:`Operations for config`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`google-tag-gateway`,describe:`Google Tag Gateway operations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
2
+ import{D as e,S as t,n}from"./auth-BqDOIrKX.mjs";import{n as r,t as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c}from"./input-validation-CTqtyiY9.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Gets the Google Tag Gateway configuration for a zone.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf google-tag-gateway config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.googleTagGateway.config.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`enabled`,{type:`boolean`,description:`Enables or disables Google Tag Gateway for this zone.`}).option(`endpoint`,{type:`string`,description:`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`}).option(`hide-original-ip`,{type:`boolean`,description:`Hides the original client IP address from Google when enabled.`}).option(`measurement-id`,{type:`string`,description:`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`}).option(`set-up-tag`,{type:`boolean`,description:`Set up the associated Google Tag on the zone automatically when enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Google Tag Gateway configuration for a zone.`})}const f={command:`update`,describe:`Updates the Google Tag Gateway configuration for a zone.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf google-tag-gateway config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:e,zone_id:d})),{successLabel:`Updated`});return}if(l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(l.endpoint===void 0&&(l.endpoint=await e(`endpoint`,`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`)),l[`hide-original-ip`]===void 0)throw Error(`--hide-original-ip is required (or pass --body with this field set).`);l[`measurement-id`]===void 0&&(l[`measurement-id`]=await e(`measurement-id`,`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`));let f=i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]});a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:f,zone_id:d})),{successLabel:`Updated`})}},p={command:`config`,describe:`Operations for config`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`google-tag-gateway`,describe:`Google Tag Gateway operations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};