cf 1.0.0-beta.16 → 1.0.0-beta.18
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.
- package/dist/_meta/commands.json +6117 -4540
- package/dist/_meta/schemas.json +5016 -3257
- package/dist/{abuse-reports-17K-TRhO.mjs → abuse-reports-Ce-g5uZP.mjs} +6 -6
- package/dist/{access-BwB7sg1D.mjs → access-BtsMwesh.mjs} +1 -1
- package/dist/{accounts-BnIGu_ac.mjs → accounts-X5QVzEUW.mjs} +27 -21
- package/dist/{acm-CQRcu_zw.mjs → acm-C_NepMi6.mjs} +1 -1
- package/dist/{addressing-Qcm9jd3C.mjs → addressing-BkQY1hoA.mjs} +18 -18
- package/dist/{agent-memory-B3xN9I6-.mjs → agent-memory-1OPgC3lK.mjs} +6 -6
- package/dist/{ai-BRKOCckA.mjs → ai-Bb0_Zknm.mjs} +1 -1
- package/dist/{ai-audit-Cd9Rc2Fc.mjs → ai-audit-DuEjVdML.mjs} +1 -1
- package/dist/{ai-gateway-BWU5064V.mjs → ai-gateway-Cm2vWMSI.mjs} +42 -42
- package/dist/ai-search-DDRpxyOM.mjs +79 -0
- package/dist/{ai-security-Dn0Ee6QS.mjs → ai-security-A2STvE1b.mjs} +5 -5
- package/dist/{alerting-BXTiMfXo.mjs → alerting-CIwSk-Ks.mjs} +1 -1
- package/dist/{analytics-Jyd04TRW.mjs → analytics-H--uM3DA.mjs} +7 -7
- package/dist/{analytics-engine-CzrNfUeh.mjs → analytics-engine-Alu7cllT.mjs} +1 -1
- package/dist/{api-security-DRBHZaf_.mjs → api-security-D-pcnhUL.mjs} +26 -26
- package/dist/{argo-DiQt0pSb.mjs → argo-Lvmcx3am.mjs} +1 -1
- package/dist/{artifacts-eBZ4YN53.mjs → artifacts-xT5S-mVa.mjs} +1 -1
- package/dist/{audit-logs-Bb4HTZay.mjs → audit-logs-DEoRBLkU.mjs} +1 -1
- package/dist/{auth-C6My1gI6.mjs → auth-B73lQS2h.mjs} +1 -1
- package/dist/auth-DMzEmOhG.mjs +2 -0
- package/dist/{auth-eVI_UEt8.mjs → auth-Db1KT0vm.mjs} +1 -1
- package/dist/{auth-token-Cfj2yehs.mjs → auth-token-D9XIPlwf.mjs} +1 -1
- package/dist/{autoconfig-B0ESZ8DJ.mjs → autoconfig-9po_tqsS.mjs} +1 -1
- package/dist/{basin-catalog-Cwk1RSMX.mjs → basin-catalog-DFHt3cWi.mjs} +1 -1
- package/dist/{billing-CfV8oi6A.mjs → billing-Bm2JNSGa.mjs} +6 -6
- package/dist/body-parser-DnBfDdx3.mjs +2 -0
- package/dist/{bot-management-CH4_Kewx.mjs → bot-management-CSr38g-O.mjs} +4 -4
- package/dist/{botnet-feed-Cg_Wp8ei.mjs → botnet-feed-ebeWWSJj.mjs} +1 -1
- package/dist/{brand-protection-Cp2ckWou.mjs → brand-protection-BCn9Mv-d.mjs} +5 -5
- package/dist/browser-run-BcWxzhAn.mjs +42 -0
- package/dist/build-BRJnyeu8.mjs +2 -0
- package/dist/{build-sBpqm9ga.mjs → build-i8l2qGVZ.mjs} +1 -1
- package/dist/{builds-B2RBgVL9.mjs → builds-BMwDzi7G.mjs} +39 -39
- package/dist/{cache-yvrYPvRI.mjs → cache-_VaTLC5T.mjs} +1 -1
- package/dist/chunk-JP6R7L72-C0kFUelb.mjs +2 -0
- package/dist/cli-P3q5DG3W.mjs +6 -0
- package/dist/{client-side-security-D50iZjd_.mjs → client-side-security-CjSXrpa9.mjs} +1 -1
- package/dist/{cloud-connector-wvSGdxWT.mjs → cloud-connector-BPJBeP06.mjs} +1 -1
- package/dist/{cloudforce-one-j6vlmaMB.mjs → cloudforce-one-DXX31GMi.mjs} +189 -189
- package/dist/{command-CM_f48gs.mjs → command-BXiA79DP.mjs} +1 -1
- package/dist/{command-CmUtmu5j.mjs → command-BbsPxJBT.mjs} +1 -1
- package/dist/{command-BDpm-U8z.mjs → command-Bkc04OyY.mjs} +1 -1
- package/dist/{command-BSbhJRmu.mjs → command-BtTc28ql.mjs} +1 -1
- package/dist/{command-DFRsim8q.mjs → command-CBZhxmKD.mjs} +1 -1
- package/dist/{command-BbO3sBQ2.mjs → command-CL7LLXM7.mjs} +1 -1
- package/dist/{command-DQojhTEQ.mjs → command-CYyfigfC.mjs} +1 -1
- package/dist/{command-DiqRELHF.mjs → command-CxWLFv5Y.mjs} +1 -1
- package/dist/{command-74P4_CTx.mjs → command-DDcBC4px.mjs} +1 -1
- package/dist/{command-Dr4PEvB2.mjs → command-NoxvOARP.mjs} +1 -1
- package/dist/{completions-oD1EcuHk.mjs → completions-CrDmwKnK.mjs} +1 -1
- package/dist/{connector-interrupts-DP4rbOe8.mjs → connector-interrupts-V4HGULCM.mjs} +1 -1
- package/dist/{connector-telemetry-events-BQGBQwzR.mjs → connector-telemetry-events-D9mTcfbJ.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DBO0Mdcj.mjs → connector-telemetry-snapshots-COrPVKol.mjs} +1 -1
- package/dist/{connectors-BSVr3Kz1.mjs → connectors-DvVlxGDx.mjs} +1 -1
- package/dist/{containers-BTqAeVV2.mjs → containers-Bt2zFsFd.mjs} +8 -8
- package/dist/{containers-BOpKpipz.mjs → containers-BtcOgwm5.mjs} +2 -2
- package/dist/{content-scan-B9Keyxe-.mjs → content-scan-DldLmTjy.mjs} +1 -1
- package/dist/{context-B-vEsyrK.mjs → context-C_a8oSY9.mjs} +1 -1
- package/dist/cps-REo1OWP1.mjs +6 -0
- package/dist/csam-scanner-CIbbdoJK.mjs +10 -0
- package/dist/{custom-csrs-DM5X-K6H.mjs → custom-csrs-iGNc3rSZ.mjs} +1 -1
- package/dist/{custom-hostnames-BBjqaiFF.mjs → custom-hostnames-BNxYbTyu.mjs} +15 -15
- package/dist/{custom-nameservers-C0NDMLPJ.mjs → custom-nameservers-BMJoTSlQ.mjs} +1 -1
- package/dist/custom-pages-Qdemt1Fm.mjs +21 -0
- package/dist/{d1-hin5PmxW.mjs → d1-DvCiQibO.mjs} +8 -8
- package/dist/{deploy-Bo7FtE44.mjs → deploy-K664XPOb.mjs} +1 -1
- package/dist/{deploy-context-ClvBD87y.mjs → deploy-context-ClNVJYlR.mjs} +13 -13
- package/dist/{deploy-input-BqJ7GVZ-.mjs → deploy-input-KK6yyBN_.mjs} +1 -1
- package/dist/{dev-EtnMYA7K.mjs → dev-CnoMHxf4.mjs} +1 -1
- package/dist/{diagnostics-LZuMrGjK.mjs → diagnostics-Cw0mtcep.mjs} +2 -2
- package/dist/{dls-Bq8k3iy-.mjs → dls-DoqfqutH.mjs} +1 -1
- package/dist/{dns-ry5E2Bsa.mjs → dns-DC6WcO3m.mjs} +21 -21
- package/dist/{dns-firewall-zavP5Qxj.mjs → dns-firewall-DpQH9BCE.mjs} +9 -9
- package/dist/{docs-B08YtL0U.mjs → docs-CqNRBHab.mjs} +1 -1
- package/dist/{durable-objects-B9fo41B1.mjs → durable-objects-CJDDy3CC.mjs} +1 -1
- package/dist/{email-auth-D9LGjFlh.mjs → email-auth--NHg1TjG.mjs} +1 -1
- package/dist/{email-routing-6iDnNPhY.mjs → email-routing-COjENK55.mjs} +13 -13
- package/dist/{email-security-ty4ufRnJ.mjs → email-security-rdjH95T2.mjs} +38 -38
- package/dist/{email-sending-d7LO_Cz_.mjs → email-sending-26VJhR6Q.mjs} +18 -18
- package/dist/{field-extractors-DkgQ7PSw.mjs → field-extractors-DBOvGOwz.mjs} +2 -2
- package/dist/{firewall-Q88YyEwD.mjs → firewall-D8K93ffF.mjs} +20 -20
- package/dist/{flagship-CzI8zhd6.mjs → flagship-CHdmCmvQ.mjs} +11 -11
- package/dist/{fraud-CvFXTR0w.mjs → fraud-CY4TV5Vc.mjs} +1 -1
- package/dist/{google-tag-gateway-Y2zbyey8.mjs → google-tag-gateway-DzSt4wlz.mjs} +1 -1
- package/dist/healthchecks-B52Mf3uL.mjs +22 -0
- package/dist/{hostnames-B3k7fIUL.mjs → hostnames-BMITIM8P.mjs} +1 -1
- package/dist/{hyperdrive-BWGYz95H.mjs → hyperdrive-CHsW0r6Z.mjs} +1 -1
- package/dist/{iam-AXco_qmt.mjs → iam-o1n9eUXf.mjs} +9 -9
- package/dist/{images-BzYh8y0u.mjs → images-CJHAGxX6.mjs} +37 -37
- package/dist/index.mjs +1 -1
- package/dist/{init-DlenHBtS.mjs → init-CqQDL6i3.mjs} +1 -1
- package/dist/{intel-BBi3i_GU.mjs → intel-B3S1gxUg.mjs} +1 -1
- package/dist/{ips-CWG2b7AM.mjs → ips-q_UJMiy8.mjs} +1 -1
- package/dist/{k2-DXdMe3Cb.mjs → k2-BNqVZnDN.mjs} +2 -2
- package/dist/{kv-FUd7UdDu.mjs → kv-B0nXSOcW.mjs} +1 -1
- package/dist/{lazy-command-BC8rIlHu.mjs → lazy-command-4ccdBqrc.mjs} +1 -1
- package/dist/{leaked-credential-checks-BufVA9vL.mjs → leaked-credential-checks-BXwIjlTs.mjs} +1 -1
- package/dist/load-balancers-DJtMztJ0.mjs +76 -0
- package/dist/{login-DVbXZ_Tv.mjs → login-D-1FiBNv.mjs} +1 -1
- package/dist/{login-BJr2PBaJ.mjs → login-chQP8825.mjs} +1 -1
- package/dist/{logo-matches-BluaPvMa.mjs → logo-matches-qVYq8tWL.mjs} +1 -1
- package/dist/{logos-CXtmYWEJ.mjs → logos-tnIahhcu.mjs} +1 -1
- package/dist/{logpush-DCYgrqz0.mjs → logpush-D4s3pJRw.mjs} +24 -24
- package/dist/{logs-as60IP29.mjs → logs-cw7UL5V2.mjs} +3 -3
- package/dist/{magic-cloud-networking-0RsHugUF.mjs → magic-cloud-networking-CLEHztNY.mjs} +1 -1
- package/dist/{magic-network-monitoring-CPqvZdcb.mjs → magic-network-monitoring-DRwygeVq.mjs} +9 -9
- package/dist/{magic-transit-ClPyGzOE.mjs → magic-transit-BFopRdPs.mjs} +170 -170
- package/dist/{managed-defense-P4_QWSbK.mjs → managed-defense-D5kpmq0T.mjs} +9 -9
- package/dist/{managed-transforms-CUwQXMij.mjs → managed-transforms-CT4jjnzJ.mjs} +2 -2
- package/dist/{matches-BjckDBW1.mjs → matches-ClJ_24EY.mjs} +1 -1
- package/dist/{mcp-C2EG2c7L.mjs → mcp-50os3IRG.mjs} +10 -10
- package/dist/{mesh-CpMZA7Xt.mjs → mesh-jxtQP8sS.mjs} +2 -2
- package/dist/{migrate-6e5mJ79R.mjs → migrate-DerOyuv2.mjs} +1 -1
- package/dist/{monetization-DypuCZmU.mjs → monetization-D6cCDi-h.mjs} +4 -4
- package/dist/{network-DQ5Ridgy.mjs → network-dnWHB2uY.mjs} +27 -25
- package/dist/{network-interconnects-ifU4JhGE.mjs → network-interconnects-Cf8qSVdt.mjs} +1 -1
- package/dist/{o11y-CzssfRHt.mjs → o11y-oMSg1pG4.mjs} +49 -49
- package/dist/{oauth-BNTiErBG.mjs → oauth-BfBdHhPS.mjs} +1 -1
- package/dist/{oauth-BDdhqasa.mjs → oauth-DDOiiH7h.mjs} +1 -1
- package/dist/{oauth-clients-gknNcBdV.mjs → oauth-clients-XDmoe-b4.mjs} +1 -1
- package/dist/{oauth-scopes-BJeSanuF.mjs → oauth-scopes-D9VYGuTs.mjs} +1 -1
- package/dist/open-PCXX3ZDZ-5J5IU2MX-CKla-jDt.mjs +4 -0
- package/dist/organization-94lHeeOs.mjs +75 -0
- package/dist/{organizations-kfFFW4uO.mjs → organizations-BJf3UTFi.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-DfrnptJ1.mjs → origin-post-quantum-encryption-DMytVSUZ.mjs} +1 -1
- package/dist/{page-rules-ByrDMDBZ.mjs → page-rules-BUI-50oz.mjs} +4 -4
- package/dist/pages-CcdpCzHs.mjs +54 -0
- package/dist/pay-per-crawl-B1uHZn9j.mjs +38 -0
- package/dist/{pay-per-use-49EXt75f.mjs → pay-per-use-t066I5wm.mjs} +7 -7
- package/dist/{pipelines-Bvgh1BQZ.mjs → pipelines-Co6S044l.mjs} +8 -8
- package/dist/precursor-BftyvS86.mjs +4 -0
- package/dist/previews-BLhnhElx.mjs +7 -0
- package/dist/{progress-R-1tIuep.mjs → progress-Q5w9PNTT.mjs} +1 -1
- package/dist/{prompt-dgLm0iFJ.mjs → prompt-C0hKSr-R.mjs} +1 -1
- package/dist/{queries-EbIadtC5.mjs → queries-4MubO6Sz.mjs} +3 -3
- package/dist/{queues-C4GZ-O3f.mjs → queues-CteS5M92.mjs} +17 -17
- package/dist/{r2-DEuFfWBR.mjs → r2-2QpT_Gso.mjs} +24 -24
- package/dist/{radar-CDOERVcR.mjs → radar-ODKaK4FJ.mjs} +1 -1
- package/dist/{raw-fetch-BapeoreV.mjs → raw-fetch-CEOuoKl9.mjs} +1 -1
- package/dist/{realtime-D_A9Qgly.mjs → realtime-DkfU8uEX.mjs} +84 -84
- package/dist/registrar-DM6JTVPS.mjs +43 -0
- package/dist/{registrar-sandbox-BF3cYO3n.mjs → registrar-sandbox-BPNGf65G.mjs} +11 -9
- package/dist/{reporting-BWm9jIF8.mjs → reporting-5yFNXbJg.mjs} +1 -1
- package/dist/{request-headers-BRxv6NkA.mjs → request-headers-DXvswze2.mjs} +1 -1
- package/dist/request-tracers-BarLZY95.mjs +4 -0
- package/dist/{resource-sharing-C186jZv0.mjs → resource-sharing-BVEwBPs8.mjs} +19 -19
- package/dist/{rules-DYnGIU_0.mjs → rules-_C31X4Jz.mjs} +6 -6
- package/dist/{rulesets-BcNrbVcq.mjs → rulesets-8RwxoFhG.mjs} +6 -6
- package/dist/{rum-BDyRecfp.mjs → rum-CAUcpXpM.mjs} +6 -6
- package/dist/{run-BvDCuZ8q.mjs → run-DtFLvOHB.mjs} +1 -1
- package/dist/run-LcOb9rhI.mjs +2 -0
- package/dist/{schema-flags-DcKjAxI1.mjs → schema-flags-DibfxEF6.mjs} +1 -1
- package/dist/{scim-zn-CNCsc.mjs → scim-DX5XrQ4w.mjs} +1 -1
- package/dist/{secrets-store-CFhyQUV6.mjs → secrets-store-DSqqrr25.mjs} +1 -1
- package/dist/{security-insights-D8XgtCed.mjs → security-insights-FSktO04S.mjs} +1 -1
- package/dist/{security-txt-CCM-Vro0.mjs → security-txt-D2g3lQdg.mjs} +1 -1
- package/dist/{shared-ouAF7o4S.mjs → shared-eefMO8R4.mjs} +1 -1
- package/dist/smart-shield-IVb2sR0C.mjs +24 -0
- package/dist/{snippets-B2jBY0m_.mjs → snippets-cWwWficN.mjs} +2 -2
- package/dist/{spawn-DQttFH05.mjs → spawn-BW2bJmKO.mjs} +1 -1
- package/dist/{spectrum-Cf_4cGE8.mjs → spectrum-DYiIBYRB.mjs} +1 -1
- package/dist/{speed-DoXdyIYK.mjs → speed-C7uiW2Wf.mjs} +1 -1
- package/dist/{sql-Bze4h80q.mjs → sql-TGV8qQMj.mjs} +1 -1
- package/dist/{src-BguQDHjS.mjs → src-BUH-P_zd.mjs} +5 -5
- package/dist/ssl-xQP_HbWN.mjs +139 -0
- package/dist/{stream-BcReYIHJ.mjs → stream-CfWgj8Cr.mjs} +55 -55
- package/dist/{submit-ldFVNfNC.mjs → submit-DxGr1T40.mjs} +1 -1
- package/dist/tags-LEJ2VYhQ.mjs +23 -0
- package/dist/{telemetry-Cojgz4Sv.mjs → telemetry-BHne10Yy.mjs} +1 -1
- package/dist/telemetry-BavSU4ku.mjs +2 -0
- package/dist/{tenant-AZ0EAsmT.mjs → tenant-7d5vwc6K.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-aozjaasc.mjs → tenant-custom-nameservers-BkxlPr5O.mjs} +1 -1
- package/dist/{tunnels-CXez5LPB.mjs → tunnels-DlGODvwT.mjs} +4 -4
- package/dist/{turnstile-B2NQ8Nsk.mjs → turnstile-DhLkdhij.mjs} +5 -5
- package/dist/update-check-nLfkSfdz.mjs +2 -0
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{update-check-BlyKN8m0.mjs → update-check-wvjOsnGK.mjs} +1 -1
- package/dist/{url-info-D_UqGiWD.mjs → url-info-CeoV5dBc.mjs} +1 -1
- package/dist/{url-normalization-CF1YHpIN.mjs → url-normalization-9NoaoRNh.mjs} +1 -1
- package/dist/{url-scanner-ChF3GO2U.mjs → url-scanner-w_-Sumz-.mjs} +8 -8
- package/dist/{user-BfWRsdJh.mjs → user-D33B3alX.mjs} +59 -59
- package/dist/{vectorize-CRYbWKg5.mjs → vectorize-Wp9De13y.mjs} +17 -17
- package/dist/version-B2RUUqGT.mjs +2 -0
- package/dist/{waiting-rooms-Crp7MVd9.mjs → waiting-rooms-BE8FloRd.mjs} +13 -13
- package/dist/{web-assets-CgyrPnT-.mjs → web-assets-ew0iaP7c.mjs} +35 -35
- package/dist/{web3-Cd0Yd0eQ.mjs → web3-BUyXBaqq.mjs} +6 -6
- package/dist/{workers-builds-f2nVw7EZ.mjs → workers-builds-DzU9NGno.mjs} +7 -7
- package/dist/{workers-for-platforms-DjeKp2uy.mjs → workers-for-platforms-B4xzFNxJ.mjs} +25 -22
- package/dist/{workers-CTwJpTfJ.mjs → workers-pP5tsDbD.mjs} +25 -22
- package/dist/{workers-vpc-B_L3TEg2.mjs → workers-vpc-Bre_t9Al.mjs} +1 -1
- package/dist/{workflows-CBPGf65x.mjs → workflows-DXYGKtqq.mjs} +1 -1
- package/dist/wrangler-migration-R9TQ_4Qd.mjs +946 -0
- package/dist/zaraz-DoH4QD0u.mjs +22 -0
- package/dist/{zero-trust-B9xY8zcn.mjs → zero-trust-DKt20rzE.mjs} +461 -458
- package/dist/{zone-CmwVqTI2.mjs → zone-BXM3p0JR.mjs} +1 -1
- package/dist/{zones-Bf0VVpMf.mjs → zones-CJdtqEBx.mjs} +21 -21
- package/package.json +11 -11
- package/dist/account-tags-povXTDAu.mjs +0 -15
- package/dist/ai-search-CJ3b8eot.mjs +0 -79
- package/dist/auth-OFqV2M4q.mjs +0 -2
- package/dist/body-parser-DkHKPkJ7.mjs +0 -2
- package/dist/browser-run-CfQ30dB6.mjs +0 -42
- package/dist/build-Bm6kGyzo.mjs +0 -2
- package/dist/certificate-authorities-BdMRaOnD.mjs +0 -6
- package/dist/cli-CsnoQloF.mjs +0 -6
- package/dist/client-certificates-CuWGvZSr.mjs +0 -13
- package/dist/cps-VRP794c5.mjs +0 -6
- package/dist/csam-scanner-C1jOgXVu.mjs +0 -10
- package/dist/ct-alerting-Y9vfa6Fo.mjs +0 -5
- package/dist/custom-certificates-CojTEC0E.mjs +0 -17
- package/dist/custom-pages-M4RUxcn6.mjs +0 -21
- package/dist/dcv-delegation-KOO8syyQ.mjs +0 -4
- package/dist/healthchecks-4Hz-6xYi.mjs +0 -22
- package/dist/keyless-certificates-B4ta_OGS.mjs +0 -13
- package/dist/keys-B9zvFzrf.mjs +0 -4
- package/dist/load-balancers-CWd9mSWM.mjs +0 -76
- package/dist/mtls-certificates-B5AWTU6u.mjs +0 -13
- package/dist/organization-CXAM41sd.mjs +0 -71
- package/dist/origin-ca-certificates-DwhYV3m_.mjs +0 -11
- package/dist/origin-tls-client-auth-COSxTc2q.mjs +0 -30
- package/dist/pages-DuGcBC6k.mjs +0 -54
- package/dist/pay-per-crawl-B3_Gn9Cj.mjs +0 -38
- package/dist/precursor-VobQf--m.mjs +0 -4
- package/dist/previews-DkwFHNRx.mjs +0 -7
- package/dist/registrar-X1YLlnmg.mjs +0 -43
- package/dist/request-tracers-CHWpiejG.mjs +0 -4
- package/dist/resource-tagging-BTagOZli.mjs +0 -4
- package/dist/run-roYb_Odh.mjs +0 -2
- package/dist/smart-shield-DwW7N92r.mjs +0 -24
- package/dist/ssl-u_0gUhPA.mjs +0 -45
- package/dist/tags-D_Hc_A-r.mjs +0 -4
- package/dist/telemetry-Ct_2AaO4.mjs +0 -2
- package/dist/update-check-BnGDxswi.mjs +0 -2
- package/dist/values-CLfxkAUJ.mjs +0 -4
- package/dist/version-CVlh2Zaq.mjs +0 -2
- package/dist/wrangler-migration-DxTB5yPT.mjs +0 -2
- package/dist/zaraz-3VDxl0gF.mjs +0 -22
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-Db1KT0vm.mjs";import{a as r,t as i}from"./context-C_a8oSY9.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-Q5w9PNTT.mjs";import{t as c}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{i as l,n as u,t as d}from"./body-parser-DnBfDdx3.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-C0hKSr-R.mjs";var g={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies/batch`,body:`json`};function ee(e){return e.usage(`$0 email-security allow-policies batch
|
|
3
3
|
|
|
4
|
-
Executes multiple allow policy operations atomically: delete, partially update, replace, and create allow policies in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the allow policies to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the policy's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Allow policies to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the policy's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 te={command:`batch`,describe:`Batch allow policy operations`,builder:ee,handler:async e=>c({command:`email-security allow-policies batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:
|
|
5
|
-
`);return}if(e.body){let t=
|
|
4
|
+
Executes multiple allow policy operations atomically: delete, partially update, replace, and create allow policies in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the allow policies to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the policy's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Allow policies to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the policy's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 te={command:`batch`,describe:`Batch allow policy operations`,builder:ee,handler:async e=>c({command:`email-security allow-policies batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may delete the selected allow policies and restore normal security scanning and disposition actions for matching emails.`})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(g,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(g,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies`,body:`json`};function ne(e){return e.usage(`$0 email-security allow-policies create
|
|
6
6
|
|
|
7
|
-
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.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Exempts messages from this sender from Spam, Spoof and Bulk dispositions only; Malicious and Suspicious dispositions still apply.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Bypasses all detections for messages to this recipient.`}).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:`Bypasses all detections and link following for messages from this sender.`}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 re={command:`create`,describe:`Create email allow policy`,builder:ne,handler:async e=>c({command:`email-security allow-policies create`,classification:{safeFlags:[`is-acceptable-sender`,`is-exempt-recipient`,`is-recipient`,`is-regex`,`is-sender`,`is-spoof`,`is-trusted-sender`,`pattern-type`,`verify-sender`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}):
|
|
7
|
+
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.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Exempts messages from this sender from Spam, Spoof and Bulk dispositions only; Malicious and Suspicious dispositions still apply.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Bypasses all detections for messages to this recipient.`}).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:`Bypasses all detections and link following for messages from this sender.`}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 re={command:`create`,describe:`Create email allow policy`,builder:ne,handler:async e=>c({command:`email-security allow-policies create`,classification:{safeFlags:[`is-acceptable-sender`,`is-exempt-recipient`,`is-recipient`,`is-regex`,`is-sender`,`is-spoof`,`is-trusted-sender`,`pattern-type`,`verify-sender`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e[`is-acceptable-sender`]===void 0)throw Error(`--is-acceptable-sender is required (or pass --body with this field set).`);if(e[`is-exempt-recipient`]===void 0)throw Error(`--is-exempt-recipient is required (or pass --body with this field set).`);if(e[`is-regex`]===void 0)throw Error(`--is-regex is required (or pass --body with this field set).`);if(e[`is-trusted-sender`]===void 0)throw Error(`--is-trusted-sender is required (or pass --body with this field set).`);if(e.pattern===void 0&&(e.pattern=await p(`pattern`,"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.")),e[`pattern-type`]===void 0&&(e[`pattern-type`]=await m(`pattern-type`,"Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents. - UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries. ",[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`])),e[`verify-sender`]===void 0)throw Error(`--verify-sender is required (or pass --body with this field set).`);let h=d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}),g=await s(`Creating`,async()=>c.send(_,{body:h,account_id:l}));a(g,{successLabel:`Created`})})};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies/${t.policy_id}`};function ie(e){return e.usage(`$0 email-security allow-policies delete <policy-id>
|
|
8
8
|
|
|
9
9
|
Removes an allow policy. After deletion, emails matching this pattern will be subject to normal security scanning and disposition actions.`).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 ae={command:`delete <policy-id>`,describe:`Delete an email allow policy`,builder:ie,handler:async e=>c({command:`email-security allow-policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the allow policy and restores normal security scanning and disposition actions for matching emails.`})){process.stderr.write(`Aborted.
|
|
10
10
|
`);return}let u=await s(`Deleting`,async()=>c.send(v,{account_id:l,policy_id:e[`policy-id`]}));a(u,{successLabel:`Deleted`})})};var y={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies/${t.policy_id}`,body:`json`};function oe(e){return e.usage(`$0 email-security allow-policies edit <policy-id>
|
|
11
11
|
|
|
12
|
-
Updates an existing allow policy. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`).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:`Exempts messages from this sender from Spam, Spoof and Bulk dispositions only; Malicious and Suspicious dispositions still apply.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Bypasses all detections for messages to this recipient.`}).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:`Bypasses all detections and link following for messages from this sender.`}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 se={command:`edit <policy-id>`,describe:`Update an email allow policy`,builder:oe,handler:async e=>c({command:`email-security allow-policies edit`,classification:{safeFlags:[`is-acceptable-sender`,`is-exempt-recipient`,`is-recipient`,`is-regex`,`is-sender`,`is-spoof`,`is-trusted-sender`,`pattern-type`,`verify-sender`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}):
|
|
12
|
+
Updates an existing allow policy. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`).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:`Exempts messages from this sender from Spam, Spoof and Bulk dispositions only; Malicious and Suspicious dispositions still apply.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Bypasses all detections for messages to this recipient.`}).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:`Bypasses all detections and link following for messages from this sender.`}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 se={command:`edit <policy-id>`,describe:`Update an email allow policy`,builder:oe,handler:async e=>c({command:`email-security allow-policies edit`,classification:{safeFlags:[`is-acceptable-sender`,`is-exempt-recipient`,`is-recipient`,`is-regex`,`is-sender`,`is-spoof`,`is-trusted-sender`,`pattern-type`,`verify-sender`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(y,{body:t,account_id:l,policy_id:e[`policy-id`]}));a(n,{successLabel:`Updated`});return}let p=d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}),m=await s(`Updating`,async()=>c.send(y,{body:p,account_id:l,policy_id:e[`policy-id`]}));a(m,{successLabel:`Updated`})})};var ce={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies/${t.policy_id}`};function le(e){return e.usage(`$0 email-security allow-policies get <policy-id>
|
|
13
13
|
|
|
14
14
|
Retrieves details for a specific allow policy including its pattern, dispositions that are exempted, and whether it applies to all detections.`).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 ue={command:`get <policy-id>`,describe:`Get an email allow policy`,builder:le,handler:async e=>c({command:`email-security allow-policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(ce,{account_id:l,policy_id:e[`policy-id`]}));a(u,{successLabel:`Loaded`})})};var de={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies`,query:[`page`,`per_page`,`search`,`order`,`direction`,`is_exempt_recipient`,`is_trusted_sender`,`is_acceptable_sender`,`verify_sender`,`pattern_type`,`pattern`]};function fe(e){return e.usage(`$0 email-security allow-policies list
|
|
15
15
|
|
|
16
16
|
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.`).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:`Filter by pattern type.`,choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`pattern`,{type:`string`,description:`Filter by exact pattern value.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`List email allow policies`,builder:fe,handler:async e=>c({command:`email-security allow-policies list`,classification:{safeFlags:[`order`,`direction`,`is-exempt-recipient`,`is-trusted-sender`,`is-acceptable-sender`,`verify-sender`,`pattern-type`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,direction:e.direction,is_exempt_recipient:e[`is-exempt-recipient`],is_trusted_sender:e[`is-trusted-sender`],is_acceptable_sender:e[`is-acceptable-sender`],verify_sender:e[`verify-sender`],pattern_type:e[`pattern-type`],pattern:e.pattern};if(e.dryRun){let e=await r();o({command:`cf email-security allow-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(de,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var b={method:`PUT`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies/${t.policy_id}`,body:`json`};function me(e){return e.usage(`$0 email-security allow-policies update <policy-id>
|
|
17
17
|
|
|
18
|
-
Replaces an existing allow policy in full. Unlike PATCH, every field is taken from the request body, so optional fields that are omitted are reset rather than left untouched. Use this when managing policies declaratively.`).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:`Exempts messages from this sender from Spam, Spoof and Bulk dispositions only; Malicious and Suspicious dispositions still apply.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Bypasses all detections for messages to this recipient.`}).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:`Bypasses all detections and link following for messages from this sender.`}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 he={command:`update <policy-id>`,describe:`Replace an email allow policy`,builder:me,handler:async e=>c({command:`email-security allow-policies update`,classification:{safeFlags:[`is-acceptable-sender`,`is-exempt-recipient`,`is-recipient`,`is-regex`,`is-sender`,`is-spoof`,`is-trusted-sender`,`pattern-type`,`verify-sender`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}):
|
|
18
|
+
Replaces an existing allow policy in full. Unlike PATCH, every field is taken from the request body, so optional fields that are omitted are reset rather than left untouched. Use this when managing policies declaratively.`).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:`Exempts messages from this sender from Spam, Spoof and Bulk dispositions only; Malicious and Suspicious dispositions still apply.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Bypasses all detections for messages to this recipient.`}).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:`Bypasses all detections and link following for messages from this sender.`}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 he={command:`update <policy-id>`,describe:`Replace an email allow policy`,builder:me,handler:async e=>c({command:`email-security allow-policies update`,classification:{safeFlags:[`is-acceptable-sender`,`is-exempt-recipient`,`is-recipient`,`is-regex`,`is-sender`,`is-spoof`,`is-trusted-sender`,`pattern-type`,`verify-sender`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(b,{body:t,account_id:l,policy_id:e[`policy-id`]}));a(n,{successLabel:`Updated`});return}if(e[`is-acceptable-sender`]===void 0)throw Error(`--is-acceptable-sender is required (or pass --body with this field set).`);if(e[`is-exempt-recipient`]===void 0)throw Error(`--is-exempt-recipient is required (or pass --body with this field set).`);if(e[`is-regex`]===void 0)throw Error(`--is-regex is required (or pass --body with this field set).`);if(e[`is-trusted-sender`]===void 0)throw Error(`--is-trusted-sender is required (or pass --body with this field set).`);if(e.pattern===void 0&&(e.pattern=await p(`pattern`,"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.")),e[`pattern-type`]===void 0&&(e[`pattern-type`]=await m(`pattern-type`,"Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents. - UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries. ",[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`])),e[`verify-sender`]===void 0)throw Error(`--verify-sender is required (or pass --body with this field set).`);let h=d({comments:f(e.comments,`comments`,`text`),is_acceptable_sender:e[`is-acceptable-sender`],is_exempt_recipient:e[`is-exempt-recipient`],is_recipient:e[`is-recipient`],is_regex:e[`is-regex`],is_sender:e[`is-sender`],is_spoof:e[`is-spoof`],is_trusted_sender:e[`is-trusted-sender`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`],verify_sender:e[`verify-sender`]}),g=await s(`Updating`,async()=>c.send(b,{body:h,account_id:l,policy_id:e[`policy-id`]}));a(g,{successLabel:`Updated`})})},ge={command:`allow-policies`,describe:`Operations for allow-policies`,builder:e=>e.command(te).command(re).command(ae).command(se).command(ue).command(pe).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _e={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/analytics/monthly_report`};function ve(e){return e.usage(`$0 email-security analytics monthly-report get
|
|
19
19
|
|
|
20
20
|
Returns an aggregated monthly email security report including detections, dispositions, and policy activity for the trailing 12 months.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get`,describe:`Get monthly report`,builder:ve,handler:async e=>c({command:`email-security analytics monthly-report get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf email-security analytics monthly-report get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/analytics/monthly_report`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(_e,{account_id:l}));a(u,{successLabel:`Loaded`})})},be={command:`monthly-report`,describe:`Operations for analytics.monthly-report`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xe={command:`analytics`,describe:`Analytics and reporting — monthly report and per-day breakdowns of threat activity`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders/batch`,body:`json`};function Se(e){return e.usage(`$0 email-security block-senders batch
|
|
21
21
|
|
|
22
|
-
Executes multiple blocked sender operations atomically: delete, partially update, replace, and create blocked sender patterns in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the blocked sender patterns to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the pattern's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Blocked sender patterns to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the pattern's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`batch`,describe:`Batch blocked sender operations`,builder:Se,handler:async e=>c({command:`email-security block-senders batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:
|
|
23
|
-
`);return}if(e.body){let t=
|
|
22
|
+
Executes multiple blocked sender operations atomically: delete, partially update, replace, and create blocked sender patterns in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the blocked sender patterns to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the pattern's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Blocked sender patterns to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the pattern's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`batch`,describe:`Batch blocked sender operations`,builder:Se,handler:async e=>c({command:`email-security block-senders batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may delete the selected blocked sender patterns and stop automatically blocking matching emails based on those rules.`})){process.stderr.write(`Aborted.
|
|
23
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(x,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(x,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var S={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders`,body:`json`};function we(e){return e.usage(`$0 email-security block-senders create
|
|
24
24
|
|
|
25
|
-
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.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal value."}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 Te={command:`create`,describe:`Create blocked email sender`,builder:we,handler:async e=>c({command:`email-security block-senders create`,classification:{safeFlags:[`is-regex`,`pattern-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}):
|
|
25
|
+
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.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal value."}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 Te={command:`create`,describe:`Create blocked email sender`,builder:we,handler:async e=>c({command:`email-security block-senders create`,classification:{safeFlags:[`is-regex`,`pattern-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(S,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e[`is-regex`]===void 0)throw Error(`--is-regex is required (or pass --body with this field set).`);e.pattern===void 0&&(e.pattern=await p(`pattern`,"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.")),e[`pattern-type`]===void 0&&(e[`pattern-type`]=await m(`pattern-type`,"Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents. - UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries. ",[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]));let h=d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}),g=await s(`Creating`,async()=>c.send(S,{body:h,account_id:l}));a(g,{successLabel:`Created`})})};var C={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders/${t.pattern_id}`};function w(e){return e.usage(`$0 email-security block-senders delete <pattern-id>
|
|
26
26
|
|
|
27
27
|
Removes a blocked sender pattern. After deletion, emails from this sender will no longer be automatically blocked based on this rule.`).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 T={command:`delete <pattern-id>`,describe:`Delete a blocked email sender`,builder:w,handler:async e=>c({command:`email-security block-senders delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the blocked sender pattern and stops automatically blocking matching emails based on this rule.`})){process.stderr.write(`Aborted.
|
|
28
28
|
`);return}let u=await s(`Deleting`,async()=>c.send(C,{account_id:l,pattern_id:e[`pattern-id`]}));a(u,{successLabel:`Deleted`})})};var E={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders/${t.pattern_id}`,body:`json`};function D(e){return e.usage(`$0 email-security block-senders edit <pattern-id>
|
|
29
29
|
|
|
30
|
-
Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted.`).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:"Whether `pattern` is a regular expression instead of a literal value."}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 O={command:`edit <pattern-id>`,describe:`Update a blocked email sender`,builder:D,handler:async e=>c({command:`email-security block-senders edit`,classification:{safeFlags:[`is-regex`,`pattern-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}):
|
|
30
|
+
Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted.`).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:"Whether `pattern` is a regular expression instead of a literal value."}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 O={command:`edit <pattern-id>`,describe:`Update a blocked email sender`,builder:D,handler:async e=>c({command:`email-security block-senders edit`,classification:{safeFlags:[`is-regex`,`pattern-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(E,{body:t,account_id:l,pattern_id:e[`pattern-id`]}));a(n,{successLabel:`Updated`});return}let p=d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}),m=await s(`Updating`,async()=>c.send(E,{body:p,account_id:l,pattern_id:e[`pattern-id`]}));a(m,{successLabel:`Updated`})})};var Ee={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders/${t.pattern_id}`};function De(e){return e.usage(`$0 email-security block-senders get <pattern-id>
|
|
31
31
|
|
|
32
32
|
Retrieves details for a specific blocked sender pattern including its pattern type, value, and metadata.`).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 Oe={command:`get <pattern-id>`,describe:`Get a blocked email sender`,builder:De,handler:async e=>c({command:`email-security block-senders get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Ee,{account_id:l,pattern_id:e[`pattern-id`]}));a(u,{successLabel:`Loaded`})})};var ke={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders`,query:[`page`,`per_page`,`search`,`order`,`direction`,`pattern_type`,`pattern`]};function Ae(e){return e.usage(`$0 email-security block-senders list
|
|
33
33
|
|
|
34
34
|
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.`).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 je={command:`list`,describe:`List blocked email senders`,builder:Ae,handler:async e=>c({command:`email-security block-senders list`,classification:{safeFlags:[`order`,`direction`,`pattern-type`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,direction:e.direction,pattern_type:e[`pattern-type`],pattern:e.pattern};if(e.dryRun){let e=await r();o({command:`cf email-security block-senders list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(ke,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var k={method:`PUT`,path:t=>e`/accounts/${t.account_id}/email-security/settings/block_senders/${t.pattern_id}`,body:`json`};function Me(e){return e.usage(`$0 email-security block-senders update <pattern-id>
|
|
35
35
|
|
|
36
|
-
Replaces an existing blocked sender pattern in full. Unlike PATCH, every field is taken from the request body, so optional fields that are omitted are reset rather than left untouched. Use this when managing blocked senders declaratively.`).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:"Whether `pattern` is a regular expression instead of a literal value."}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 Ne={command:`update <pattern-id>`,describe:`Replace a blocked email sender`,builder:Me,handler:async e=>c({command:`email-security block-senders update`,classification:{safeFlags:[`is-regex`,`pattern-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}):
|
|
36
|
+
Replaces an existing blocked sender pattern in full. Unlike PATCH, every field is taken from the request body, so optional fields that are omitted are reset rather than left untouched. Use this when managing blocked senders declaratively.`).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:"Whether `pattern` is a regular expression instead of a literal value."}).option(`pattern`,{type:`string`,description:"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents."}).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 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.\n- UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).coerce(`pattern-type`,e=>f(e,`pattern-type`,`text`)).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 Ne={command:`update <pattern-id>`,describe:`Replace a blocked email sender`,builder:Me,handler:async e=>c({command:`email-security block-senders update`,classification:{safeFlags:[`is-regex`,`pattern-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security block-senders update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(k,{body:t,account_id:l,pattern_id:e[`pattern-id`]}));a(n,{successLabel:`Updated`});return}if(e[`is-regex`]===void 0)throw Error(`--is-regex is required (or pass --body with this field set).`);e.pattern===void 0&&(e.pattern=await p(`pattern`,"The pattern value to match. The format depends on `pattern_type`: a valid email address for EMAIL (e.g. `user@example.com`), a valid domain name for DOMAIN (e.g. `example.com`), or a plain IPv4 or IPv6 address or CIDR block for IP (e.g. `1.2.3.4`, `1.2.3.0/24`, `2606:4700:4700::1111`, or `2606:4700:4700::/48`); the API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents.")),e[`pattern-type`]===void 0&&(e[`pattern-type`]=await m(`pattern-type`,"Type of pattern matching. - EMAIL: matches a full email address (e.g. `user@example.com`) - DOMAIN: matches a domain name (e.g. `example.com`) - IP: matches a plain IPv4 or IPv6 address (e.g. `1.2.3.4` or `2606:4700:4700::1111`) or CIDR block (e.g. `1.2.3.0/24` or `2606:4700:4700::/48`). The API rejects private or unique-local, loopback, link-local, unspecified, and IPv4 broadcast addresses, including their IPv4-mapped IPv6 equivalents. - UNKNOWN: deprecated; you cannot use this when creating or updating policies, but it may appear on existing entries. ",[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]));let h=d({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:e[`pattern-type`]}),g=await s(`Updating`,async()=>c.send(k,{body:h,account_id:l,pattern_id:e[`pattern-id`]}));a(g,{successLabel:`Updated`})})},Pe={command:`block-senders`,describe:`Operations for block-senders`,builder:e=>e.command(Ce).command(Te).command(T).command(O).command(Oe).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Fe={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/bulk/${t.job_id}/cancel`};function Ie(e){return e.usage(`$0 email-security bulk-actions cancel <job-id>
|
|
37
37
|
|
|
38
38
|
Cancels the job, marking it as cancelled and stopping any pending message processing. The job record remains visible in list and detail endpoints.`).positional(`job-id`,{type:`string`,description:`Identifier of the bulk action job to cancel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`cancel <job-id>`,describe:`Cancel a bulk action job`,builder:Ie,handler:async e=>c({command:`email-security bulk-actions cancel`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security bulk-actions cancel`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/bulk/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/cancel`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(Fe,{account_id:l,job_id:e[`job-id`]}));a(u,{successLabel:`Created`})})};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/bulk`,body:`json`};function Re(e){return e.usage(`$0 email-security bulk-actions create
|
|
39
39
|
|
|
40
|
-
Creates a new bulk action job to move or release messages that match the provided search parameters. To move or release an explicit list of known messages instead of a search, use the move or release endpoints.`).option(`action`,{type:`string`,description:`The action the job performs on every message matching the search parameters.`,choices:[`MOVE`,`RELEASE`]}).coerce(`action`,e=>f(e,`action`,`text`)).option(`comment`,{type:`string`,description:`Optional note describing the job.`}).option(`destination`,{type:`string`,description:`Required when action is 'MOVE'.`,choices:[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]}).coerce(`destination`,e=>f(e,`destination`,`text`)).option(`expected-disposition`,{type:`string`,description:`Nonfunctional field. End of life: December 1, 2026.`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).coerce(`expected-disposition`,e=>f(e,`expected-disposition`,`text`)).option(`search-params-action-log`,{type:`boolean`,description:"Deprecated, use `GET /investigate/{investigate_id}/action_log` instead. End of life: November 1, 2026.",default:!1}).option(`search-params-alert-id`,{type:`string`,description:`Alert ID of the detection to filter by.`}).option(`search-params-delivery-status`,{type:`string`,description:`Delivery status to filter by.`,choices:[`delivered`,`moved`,`quarantined`,`rejected`,`deferred`,`bounced`,`queued`,`move_failed`]}).coerce(`search-params-delivery-status`,e=>f(e,`search-params-delivery-status`,`text`)).option(`search-params-detections-only`,{type:`boolean`,description:`Whether to include only detections in search results.`,default:!0}).option(`search-params-domain`,{type:`string`,description:`Match messages that mention this domain — sender domain, recipient domain, or a domain in a link.`}).option(`search-params-end`,{type:`string`,description:`End of search date range.`}).option(`search-params-exact-subject`,{type:`string`,description:`Match messages whose subject line equals this value exactly.`}).option(`search-params-final-disposition`,{type:`string`,description:`Dispositions to filter by.`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).coerce(`search-params-final-disposition`,e=>f(e,`search-params-final-disposition`,`text`)).option(`search-params-message-action`,{type:`string`,description:`Message actions to filter by.`,choices:[`PREVIEW`,`QUARANTINE_RELEASED`,`MOVED`]}).coerce(`search-params-message-action`,e=>f(e,`search-params-message-action`,`text`)).option(`search-params-message-id`,{type:`string`,description:`Message-ID header value to filter by.`}).option(`search-params-metric`,{type:`string`,description:`Metric name to filter the search by.`}).option(`search-params-query`,{type:`string`,description:`Space-delimited search term. Case-insensitive.`}).option(`search-params-recipient`,{type:`string`,description:`Match messages whose recipient is this email address or domain.`}).option(`search-params-sender`,{type:`string`,description:`Match messages whose sender is this email address or domain.`}).option(`search-params-smtp-helo-ip`,{type:`string`,description:`Matches messages whose SMTP HELO server IP address equals this value.`}).option(`search-params-start`,{type:`string`,description:`Beginning of search date range.`}).option(`search-params-subject`,{type:`string`,description:`Match messages whose subject contains these keywords, in any order.`}).option(`search-params-submissions`,{type:`boolean`,description:`Whether to search reclassification submissions instead of original messages.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ze={command:`create`,describe:`Create a bulk action job`,builder:Re,handler:async e=>c({command:`email-security bulk-actions create`,classification:{safeFlags:[`action`,`destination`,`expected-disposition`,`search-params-action-log`,`search-params-delivery-status`,`search-params-detections-only`,`search-params-final-disposition`,`search-params-message-action`,`search-params-submissions`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security bulk-actions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({action:e.action,comment:f(e.comment,`comment`,`text`),destination:e.destination,expected_disposition:e[`expected-disposition`],search_params:{action_log:e[`search-params-action-log`],alert_id:f(e[`search-params-alert-id`],`search-params-alert-id`,`text`),delivery_status:e[`search-params-delivery-status`],detections_only:e[`search-params-detections-only`],domain:f(e[`search-params-domain`],`search-params-domain`,`text`),end:f(e[`search-params-end`],`search-params-end`,`text`),exact_subject:f(e[`search-params-exact-subject`],`search-params-exact-subject`,`text`),final_disposition:e[`search-params-final-disposition`],message_action:e[`search-params-message-action`],message_id:f(e[`search-params-message-id`],`search-params-message-id`,`text`),metric:f(e[`search-params-metric`],`search-params-metric`,`text`),query:f(e[`search-params-query`],`search-params-query`,`text`),recipient:f(e[`search-params-recipient`],`search-params-recipient`,`text`),sender:f(e[`search-params-sender`],`search-params-sender`,`text`),smtp_helo_ip:f(e[`search-params-smtp-helo-ip`],`search-params-smtp-helo-ip`,`text`),start:f(e[`search-params-start`],`search-params-start`,`text`),subject:f(e[`search-params-subject`],`search-params-subject`,`text`),submissions:e[`search-params-submissions`]}}):
|
|
40
|
+
Creates a new bulk action job to move or release messages that match the provided search parameters. To move or release an explicit list of known messages instead of a search, use the move or release endpoints.`).option(`action`,{type:`string`,description:`The action the job performs on every message matching the search parameters.`,choices:[`MOVE`,`RELEASE`]}).coerce(`action`,e=>f(e,`action`,`text`)).option(`comment`,{type:`string`,description:`Optional note describing the job.`}).option(`destination`,{type:`string`,description:`Required when action is 'MOVE'.`,choices:[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]}).coerce(`destination`,e=>f(e,`destination`,`text`)).option(`expected-disposition`,{type:`string`,description:`Nonfunctional field. End of life: December 1, 2026.`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).coerce(`expected-disposition`,e=>f(e,`expected-disposition`,`text`)).option(`search-params-action-log`,{type:`boolean`,description:"Deprecated, use `GET /investigate/{investigate_id}/action_log` instead. End of life: November 1, 2026.",default:!1}).option(`search-params-alert-id`,{type:`string`,description:`Alert ID of the detection to filter by.`}).option(`search-params-delivery-status`,{type:`string`,description:`Delivery status to filter by.`,choices:[`delivered`,`moved`,`quarantined`,`rejected`,`deferred`,`bounced`,`queued`,`move_failed`]}).coerce(`search-params-delivery-status`,e=>f(e,`search-params-delivery-status`,`text`)).option(`search-params-detections-only`,{type:`boolean`,description:`Whether to include only detections in search results.`,default:!0}).option(`search-params-domain`,{type:`string`,description:`Match messages that mention this domain — sender domain, recipient domain, or a domain in a link.`}).option(`search-params-end`,{type:`string`,description:`End of search date range.`}).option(`search-params-exact-subject`,{type:`string`,description:`Match messages whose subject line equals this value exactly.`}).option(`search-params-final-disposition`,{type:`string`,description:`Dispositions to filter by.`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).coerce(`search-params-final-disposition`,e=>f(e,`search-params-final-disposition`,`text`)).option(`search-params-message-action`,{type:`string`,description:`Message actions to filter by.`,choices:[`PREVIEW`,`QUARANTINE_RELEASED`,`MOVED`]}).coerce(`search-params-message-action`,e=>f(e,`search-params-message-action`,`text`)).option(`search-params-message-id`,{type:`string`,description:`Message-ID header value to filter by.`}).option(`search-params-metric`,{type:`string`,description:`Metric name to filter the search by.`}).option(`search-params-query`,{type:`string`,description:`Space-delimited search term. Case-insensitive.`}).option(`search-params-recipient`,{type:`string`,description:`Match messages whose recipient is this email address or domain.`}).option(`search-params-sender`,{type:`string`,description:`Match messages whose sender is this email address or domain.`}).option(`search-params-smtp-helo-ip`,{type:`string`,description:`Matches messages whose SMTP HELO server IP address equals this value.`}).option(`search-params-start`,{type:`string`,description:`Beginning of search date range.`}).option(`search-params-subject`,{type:`string`,description:`Match messages whose subject contains these keywords, in any order.`}).option(`search-params-submissions`,{type:`boolean`,description:`Whether to search reclassification submissions instead of original messages.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ze={command:`create`,describe:`Create a bulk action job`,builder:Re,handler:async e=>c({command:`email-security bulk-actions create`,classification:{safeFlags:[`action`,`destination`,`expected-disposition`,`search-params-action-log`,`search-params-delivery-status`,`search-params-detections-only`,`search-params-final-disposition`,`search-params-message-action`,`search-params-submissions`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security bulk-actions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({action:e.action,comment:f(e.comment,`comment`,`text`),destination:e.destination,expected_disposition:e[`expected-disposition`],search_params:{action_log:e[`search-params-action-log`],alert_id:f(e[`search-params-alert-id`],`search-params-alert-id`,`text`),delivery_status:e[`search-params-delivery-status`],detections_only:e[`search-params-detections-only`],domain:f(e[`search-params-domain`],`search-params-domain`,`text`),end:f(e[`search-params-end`],`search-params-end`,`text`),exact_subject:f(e[`search-params-exact-subject`],`search-params-exact-subject`,`text`),final_disposition:e[`search-params-final-disposition`],message_action:e[`search-params-message-action`],message_id:f(e[`search-params-message-id`],`search-params-message-id`,`text`),metric:f(e[`search-params-metric`],`search-params-metric`,`text`),query:f(e[`search-params-query`],`search-params-query`,`text`),recipient:f(e[`search-params-recipient`],`search-params-recipient`,`text`),sender:f(e[`search-params-sender`],`search-params-sender`,`text`),smtp_helo_ip:f(e[`search-params-smtp-helo-ip`],`search-params-smtp-helo-ip`,`text`),start:f(e[`search-params-start`],`search-params-start`,`text`),subject:f(e[`search-params-subject`],`search-params-subject`,`text`),submissions:e[`search-params-submissions`]}}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(A,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.action===void 0&&(e.action=await m(`action`,`The action the job performs on every message matching the search parameters.`,[`MOVE`,`RELEASE`]));let p=d({action:e.action,comment:f(e.comment,`comment`,`text`),destination:e.destination,expected_disposition:e[`expected-disposition`],search_params:{action_log:e[`search-params-action-log`],alert_id:f(e[`search-params-alert-id`],`search-params-alert-id`,`text`),delivery_status:e[`search-params-delivery-status`],detections_only:e[`search-params-detections-only`],domain:f(e[`search-params-domain`],`search-params-domain`,`text`),end:f(e[`search-params-end`],`search-params-end`,`text`),exact_subject:f(e[`search-params-exact-subject`],`search-params-exact-subject`,`text`),final_disposition:e[`search-params-final-disposition`],message_action:e[`search-params-message-action`],message_id:f(e[`search-params-message-id`],`search-params-message-id`,`text`),metric:f(e[`search-params-metric`],`search-params-metric`,`text`),query:f(e[`search-params-query`],`search-params-query`,`text`),recipient:f(e[`search-params-recipient`],`search-params-recipient`,`text`),sender:f(e[`search-params-sender`],`search-params-sender`,`text`),smtp_helo_ip:f(e[`search-params-smtp-helo-ip`],`search-params-smtp-helo-ip`,`text`),start:f(e[`search-params-start`],`search-params-start`,`text`),subject:f(e[`search-params-subject`],`search-params-subject`,`text`),submissions:e[`search-params-submissions`]}}),h=await s(`Creating`,async()=>c.send(A,{body:p,account_id:l}));a(h,{successLabel:`Created`})})};var Be={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/bulk/${t.job_id}`};function Ve(e){return e.usage("$0 email-security bulk-actions delete <job-id>\n\nDeletes the job, removing it from all list and detail endpoints. Only jobs in a terminal state (`COMPLETED`, `CANCELLED`, or `FAILED`) can be deleted. To stop an in-progress job without removing it, use the cancel endpoint instead.").positional(`job-id`,{type:`string`,description:`Identifier of the bulk action job.`,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 He={command:`delete <job-id>`,describe:`Delete a bulk action job`,builder:Ve,handler:async e=>c({command:`email-security bulk-actions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security bulk-actions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/bulk/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation permanently deletes the completed, cancelled, or failed bulk action job from all list and detail endpoints.`})){process.stderr.write(`Aborted.
|
|
41
41
|
`);return}let u=await s(`Deleting`,async()=>c.send(Be,{account_id:l,job_id:e[`job-id`]}));a(u,{successLabel:`Deleted`})})};var Ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/bulk/${t.job_id}`};function We(e){return e.usage(`$0 email-security bulk-actions get <job-id>
|
|
42
42
|
|
|
43
43
|
Returns the status and details of a specific bulk action job.`).positional(`job-id`,{type:`string`,description:`Identifier of the bulk action job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`get <job-id>`,describe:`Get bulk action job details`,builder:We,handler:async e=>c({command:`email-security bulk-actions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security bulk-actions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/bulk/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Ue,{account_id:l,job_id:e[`job-id`]}));a(u,{successLabel:`Loaded`})})};var Ke={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/bulk`,query:[`page`,`per_page`,`action_type`,`status`]};function qe(e){return e.usage(`$0 email-security bulk-actions list
|
|
@@ -46,44 +46,44 @@ Returns a paginated list of bulk action jobs for the account.`).option(`page`,{t
|
|
|
46
46
|
|
|
47
47
|
Returns the individual messages associated with a bulk action job, including their processing status.`).option(`job-id`,{type:`string`,description:`Identifier of the bulk action job whose messages to list.`,demandOption:!0}).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(`status`,{type:`string`,description:`Filter the job's messages by their processing status.`,choices:[`PENDING`,`PROCESSING`,`COMPLETED`,`FAILED`,`CANCELLED`,`SKIPPED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`list`,describe:`List messages for a bulk action job`,builder:Xe,handler:async e=>c({command:`email-security bulk-actions messages list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){let t=await r();o({command:`cf email-security bulk-actions messages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/bulk/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/messages`,pathParams:{"job-id":String(e[`job-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(Ye,{account_id:u,job_id:e[`job-id`],...c}));a(d,{successLabel:`Loaded`})})},Qe={command:`messages`,describe:`Operations for bulk-actions.messages`,builder:e=>e.command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$e={command:`bulk-actions`,describe:`Asynchronous jobs that move or release every message matching a search — create, monitor, and manage bulk jobs`,builder:e=>e.command(Le).command(ze).command(He).command(Ge).command(Je).command(Qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var j={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/content_policies/batch`,body:`json`};function et(e){return e.usage(`$0 email-security content-policies batch
|
|
48
48
|
|
|
49
|
-
Executes multiple content policy operations atomically: delete, partially update, replace, and create content policies in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the content policies to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the policy's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Content policies to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the policy's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 tt={command:`batch`,describe:`Batch content policy operations`,builder:et,handler:async e=>c({command:`email-security content-policies batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:
|
|
50
|
-
`);return}if(e.body){let t=
|
|
49
|
+
Executes multiple content policy operations atomically: delete, partially update, replace, and create content policies in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the content policies to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the policy's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Content policies to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the policy's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 tt={command:`batch`,describe:`Batch content policy operations`,builder:et,handler:async e=>c({command:`email-security content-policies batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may delete the selected content policies and stop evaluating emails against their patterns.`})){process.stderr.write(`Aborted.
|
|
50
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(j,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(j,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var M={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/content_policies`,body:`json`};function nt(e){return e.usage(`$0 email-security content-policies create
|
|
51
51
|
|
|
52
|
-
Creates a new content policy. Emails whose subject or body matches the pattern will be subject to the configured action.`).option(`enabled`,{type:`boolean`,description:`Whether the policy is active.`}).option(`name`,{type:`string`,description:`Human-readable name of the policy.`}).option(`notes`,{type:`string`,description:`Optional note describing the purpose of the policy.`}).option(`pattern`,{type:`string`,description:`Regular expression the policy matches against.`}).option(`targets`,{type:`string`,array:!0,description:`Parts of the email the pattern is matched against.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a content policy.`})}const rt={command:`create`,describe:`Create a content policy`,builder:nt,handler:async e=>c({command:`email-security content-policies create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({enabled:e.enabled,name:f(e.name,`name`,`text`),notes:f(e.notes,`notes`,`text`),pattern:f(e.pattern,`pattern`,`text`),targets:e.targets}):
|
|
52
|
+
Creates a new content policy. Emails whose subject or body matches the pattern will be subject to the configured action.`).option(`enabled`,{type:`boolean`,description:`Whether the policy is active.`}).option(`name`,{type:`string`,description:`Human-readable name of the policy.`}).option(`notes`,{type:`string`,description:`Optional note describing the purpose of the policy.`}).option(`pattern`,{type:`string`,description:`Regular expression the policy matches against.`}).option(`targets`,{type:`string`,array:!0,description:`Parts of the email the pattern is matched against.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a content policy.`})}const rt={command:`create`,describe:`Create a content policy`,builder:nt,handler:async e=>c({command:`email-security content-policies create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({enabled:e.enabled,name:f(e.name,`name`,`text`),notes:f(e.notes,`notes`,`text`),pattern:f(e.pattern,`pattern`,`text`),targets:e.targets}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(M,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await p(`name`,`Human-readable name of the policy.`)),e.pattern===void 0&&(e.pattern=await p(`pattern`,`Regular expression the policy matches against.`)),e.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let m=d({enabled:e.enabled,name:f(e.name,`name`,`text`),notes:f(e.notes,`notes`,`text`),pattern:f(e.pattern,`pattern`,`text`),targets:e.targets}),h=await s(`Creating`,async()=>c.send(M,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var it={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/content_policies/${t.policy_id}`};function at(e){return e.usage(`$0 email-security content-policies delete <policy-id>
|
|
53
53
|
|
|
54
54
|
Removes a content policy. After deletion, emails will no longer be evaluated against this pattern.`).positional(`policy-id`,{type:`string`,description:`Content 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 ot={command:`delete <policy-id>`,describe:`Delete a content policy`,builder:at,handler:async e=>c({command:`email-security content-policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the content policy and stops evaluating emails against its pattern.`})){process.stderr.write(`Aborted.
|
|
55
55
|
`);return}let u=await s(`Deleting`,async()=>c.send(it,{account_id:l,policy_id:e[`policy-id`]}));a(u,{successLabel:`Deleted`})})};var N={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/content_policies/${t.policy_id}`,body:`json`};function st(e){return e.usage(`$0 email-security content-policies edit <policy-id>
|
|
56
56
|
|
|
57
|
-
Updates an existing content policy. Only provided fields will be modified.`).positional(`policy-id`,{type:`string`,description:`Content policy identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether the policy is active.`}).option(`name`,{type:`string`,description:`Human-readable name of the policy.`}).option(`notes`,{type:`string`,description:`Optional note describing the purpose of the policy.`}).option(`pattern`,{type:`string`,description:`Regular expression the policy matches against.`}).option(`targets`,{type:`string`,array:!0,description:`Parts of the email the pattern is matched against.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a content policy.`})}const ct={command:`edit <policy-id>`,describe:`Update a content policy`,builder:st,handler:async e=>c({command:`email-security content-policies edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({enabled:e.enabled,name:f(e.name,`name`,`text`),notes:f(e.notes,`notes`,`text`),pattern:f(e.pattern,`pattern`,`text`),targets:e.targets}):
|
|
57
|
+
Updates an existing content policy. Only provided fields will be modified.`).positional(`policy-id`,{type:`string`,description:`Content policy identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether the policy is active.`}).option(`name`,{type:`string`,description:`Human-readable name of the policy.`}).option(`notes`,{type:`string`,description:`Optional note describing the purpose of the policy.`}).option(`pattern`,{type:`string`,description:`Regular expression the policy matches against.`}).option(`targets`,{type:`string`,array:!0,description:`Parts of the email the pattern is matched against.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a content policy.`})}const ct={command:`edit <policy-id>`,describe:`Update a content policy`,builder:st,handler:async e=>c({command:`email-security content-policies edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({enabled:e.enabled,name:f(e.name,`name`,`text`),notes:f(e.notes,`notes`,`text`),pattern:f(e.pattern,`pattern`,`text`),targets:e.targets}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(N,{body:t,account_id:l,policy_id:e[`policy-id`]}));a(n,{successLabel:`Updated`});return}let p=d({enabled:e.enabled,name:f(e.name,`name`,`text`),notes:f(e.notes,`notes`,`text`),pattern:f(e.pattern,`pattern`,`text`),targets:e.targets}),m=await s(`Updating`,async()=>c.send(N,{body:p,account_id:l,policy_id:e[`policy-id`]}));a(m,{successLabel:`Updated`})})};var lt={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/content_policies/${t.policy_id}`};function ut(e){return e.usage(`$0 email-security content-policies get <policy-id>
|
|
58
58
|
|
|
59
59
|
Retrieves details for a specific content policy including its pattern, targets, and metadata.`).positional(`policy-id`,{type:`string`,description:`Content policy identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dt={command:`get <policy-id>`,describe:`Get a content policy`,builder:ut,handler:async e=>c({command:`email-security content-policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security content-policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/content_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(lt,{account_id:l,policy_id:e[`policy-id`]}));a(u,{successLabel:`Loaded`})})};var ft={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/content_policies`,query:[`page`,`per_page`,`search`,`order`,`direction`,`enabled`,`name`]};function pt(e){return e.usage(`$0 email-security content-policies list
|
|
60
60
|
|
|
61
61
|
Returns a paginated list of content policies. These policies match against the subject or body of emails using a pattern. Supports filtering by name or enabled status, and searching across name and pattern fields.`).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:[`name`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`enabled`,{type:`boolean`,description:`Filter by enabled status.`}).option(`name`,{type:`string`,description:`Filter by exact policy name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mt={command:`list`,describe:`List content policies`,builder:pt,handler:async e=>c({command:`email-security content-policies list`,classification:{safeFlags:[`order`,`direction`,`enabled`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,direction:e.direction,enabled:e.enabled,name:e.name};if(e.dryRun){let e=await r();o({command:`cf email-security content-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/settings/content_policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(ft,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},ht={command:`content-policies`,describe:`Operations for content-policies`,builder:e=>e.command(tt).command(rt).command(ot).command(ct).command(dt).command(mt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var P={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains/batch`,body:`json`};function gt(e){return e.usage(`$0 email-security domains batch
|
|
62
62
|
|
|
63
|
-
Executes multiple domain operations in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the domains to remove protection from. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the domain's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Domains to add protection for. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the domain's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 _t={command:`batch`,describe:`Batch domain operations`,builder:gt,handler:async e=>c({command:`email-security domains batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:
|
|
64
|
-
`);return}if(e.body){let t=
|
|
63
|
+
Executes multiple domain operations in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the domains to remove protection from. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the domain's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Domains to add protection for. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the domain's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 _t={command:`batch`,describe:`Batch domain operations`,builder:gt,handler:async e=>c({command:`email-security domains batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may permanently delete protection for the selected email domains. Emails for those domains will no longer be processed by Email Security.`})){process.stderr.write(`Aborted.
|
|
64
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(P,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(P,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var F={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains`,body:`json`};function vt(e){return e.usage(`$0 email-security domains create
|
|
65
65
|
|
|
66
|
-
Protects a new email domain by adding it to Email Security. Accepts a flat configuration object covering all delivery modes. Returns the newly created domain configuration.`).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`Delivery modes to onboard the domain through.`}).option(`domain`,{type:`string`,description:`The email domain to protect.`}).option(`drop-dispositions`,{type:`string`,array:!0,description:'Dispositions to drop instead of delivering, e.g. `["MALICIOUS", "SPAM"]`.'}).option(`folder`,{type:`string`,description:`The mailbox folder to scan, for API-scanning domains.`,choices:[`AllItems`,`Inbox`]}).coerce(`folder`,e=>f(e,`folder`,`text`)).option(`integration-id`,{type:`string`,description:`Identifier of the CASB integration that authorizes this domain. The integration also enables API scanning, post-delivery actions, and directory sync.`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`Source IP ranges mail is accepted from. Any other source is rejected.`}).option(`lookback-hops`,{type:`number`,description:`Number of hops to trace back through received headers when reconstructing the original message (1-20).`}).option(`regions`,{type:`string`,array:!0,description:'Regions that process messages for this domain, e.g. `["GLOBAL"]` or `["US"]`.'}).option(`require-tls-inbound`,{type:`boolean`,description:`Require TLS on inbound connections.`}).option(`require-tls-outbound`,{type:`boolean`,description:`Require TLS on outbound connections.`}).option(`transport`,{type:`string`,description:"The mail transport hostname for MX/Inline delivery — the MX record Cloudflare delivers email to (e.g. `mx.example.com`)."}).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 yt={command:`create`,describe:`Add a new email domain`,builder:vt,handler:async e=>c({command:`email-security domains create`,classification:{safeFlags:[`folder`,`require-tls-inbound`,`require-tls-outbound`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({allowed_delivery_modes:e[`allowed-delivery-modes`],domain:f(e.domain,`domain`,`text`),drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}):
|
|
66
|
+
Protects a new email domain by adding it to Email Security. Accepts a flat configuration object covering all delivery modes. Returns the newly created domain configuration.`).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`Delivery modes to onboard the domain through.`}).option(`domain`,{type:`string`,description:`The email domain to protect.`}).option(`drop-dispositions`,{type:`string`,array:!0,description:'Dispositions to drop instead of delivering, e.g. `["MALICIOUS", "SPAM"]`.'}).option(`folder`,{type:`string`,description:`The mailbox folder to scan, for API-scanning domains.`,choices:[`AllItems`,`Inbox`]}).coerce(`folder`,e=>f(e,`folder`,`text`)).option(`integration-id`,{type:`string`,description:`Identifier of the CASB integration that authorizes this domain. The integration also enables API scanning, post-delivery actions, and directory sync.`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`Source IP ranges mail is accepted from. Any other source is rejected.`}).option(`lookback-hops`,{type:`number`,description:`Number of hops to trace back through received headers when reconstructing the original message (1-20).`}).option(`regions`,{type:`string`,array:!0,description:'Regions that process messages for this domain, e.g. `["GLOBAL"]` or `["US"]`.'}).option(`require-tls-inbound`,{type:`boolean`,description:`Require TLS on inbound connections.`}).option(`require-tls-outbound`,{type:`boolean`,description:`Require TLS on outbound connections.`}).option(`transport`,{type:`string`,description:"The mail transport hostname for MX/Inline delivery — the MX record Cloudflare delivers email to (e.g. `mx.example.com`)."}).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 yt={command:`create`,describe:`Add a new email domain`,builder:vt,handler:async e=>c({command:`email-security domains create`,classification:{safeFlags:[`folder`,`require-tls-inbound`,`require-tls-outbound`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({allowed_delivery_modes:e[`allowed-delivery-modes`],domain:f(e.domain,`domain`,`text`),drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(F,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e[`allowed-delivery-modes`]===void 0)throw Error(`--allowed-delivery-modes is required (or pass --body with this field set).`);if(e.domain===void 0&&(e.domain=await p(`domain`,`The email domain to protect.`)),e[`drop-dispositions`]===void 0)throw Error(`--drop-dispositions is required (or pass --body with this field set).`);if(e[`ip-restrictions`]===void 0)throw Error(`--ip-restrictions is required (or pass --body with this field set).`);if(e.regions===void 0)throw Error(`--regions is required (or pass --body with this field set).`);let m=d({allowed_delivery_modes:e[`allowed-delivery-modes`],domain:f(e.domain,`domain`,`text`),drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}),h=await s(`Creating`,async()=>c.send(F,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var bt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains/${t.domain_id}`};function xt(e){return e.usage(`$0 email-security domains delete <domain-id>
|
|
67
67
|
|
|
68
68
|
Removes email security protection from a domain. After deletion, emails for this domain will no longer be processed by Email Security. This action cannot be undone.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const St={command:`delete <domain-id>`,describe:`Unprotect an email domain`,builder:xt,handler:async e=>c({command:`email-security domains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation permanently deletes protection for the email domain. Emails for this domain will no longer be processed by Email Security.`})){process.stderr.write(`Aborted.
|
|
69
69
|
`);return}let u=await s(`Deleting`,async()=>c.send(bt,{account_id:l,domain_id:e[`domain-id`]}));a(u,{successLabel:`Deleted`})})};var I={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains/${t.domain_id}`,body:`json`};function Ct(e){return e.usage(`$0 email-security domains edit <domain-id>
|
|
70
70
|
|
|
71
|
-
Updates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`Delivery modes to onboard the domain through.`}).option(`drop-dispositions`,{type:`string`,array:!0,description:'Dispositions to drop instead of delivering, e.g. `["MALICIOUS", "SPAM"]`.'}).option(`folder`,{type:`string`,description:`The mailbox folder to scan, for API-scanning domains.`,choices:[`AllItems`,`Inbox`]}).coerce(`folder`,e=>f(e,`folder`,`text`)).option(`integration-id`,{type:`string`,description:`Identifier of the CASB integration that authorizes this domain. The integration also enables API scanning, post-delivery actions, and directory sync.`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`Source IP ranges mail is accepted from. Any other source is rejected.`}).option(`lookback-hops`,{type:`number`,description:`Number of hops to trace back through received headers when reconstructing the original message (1-20).`}).option(`regions`,{type:`string`,array:!0,description:'Regions that process messages for this domain, e.g. `["GLOBAL"]` or `["US"]`.'}).option(`require-tls-inbound`,{type:`boolean`,description:`Require TLS on inbound connections.`}).option(`require-tls-outbound`,{type:`boolean`,description:`Require TLS on outbound connections.`}).option(`transport`,{type:`string`,description:"The mail transport hostname for MX/Inline delivery — the MX record Cloudflare delivers email to (e.g. `mx.example.com`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const wt={command:`edit <domain-id>`,describe:`Update an email domain`,builder:Ct,handler:async e=>c({command:`email-security domains edit`,classification:{safeFlags:[`folder`,`require-tls-inbound`,`require-tls-outbound`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({allowed_delivery_modes:e[`allowed-delivery-modes`],drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}):
|
|
71
|
+
Updates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`Delivery modes to onboard the domain through.`}).option(`drop-dispositions`,{type:`string`,array:!0,description:'Dispositions to drop instead of delivering, e.g. `["MALICIOUS", "SPAM"]`.'}).option(`folder`,{type:`string`,description:`The mailbox folder to scan, for API-scanning domains.`,choices:[`AllItems`,`Inbox`]}).coerce(`folder`,e=>f(e,`folder`,`text`)).option(`integration-id`,{type:`string`,description:`Identifier of the CASB integration that authorizes this domain. The integration also enables API scanning, post-delivery actions, and directory sync.`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`Source IP ranges mail is accepted from. Any other source is rejected.`}).option(`lookback-hops`,{type:`number`,description:`Number of hops to trace back through received headers when reconstructing the original message (1-20).`}).option(`regions`,{type:`string`,array:!0,description:'Regions that process messages for this domain, e.g. `["GLOBAL"]` or `["US"]`.'}).option(`require-tls-inbound`,{type:`boolean`,description:`Require TLS on inbound connections.`}).option(`require-tls-outbound`,{type:`boolean`,description:`Require TLS on outbound connections.`}).option(`transport`,{type:`string`,description:"The mail transport hostname for MX/Inline delivery — the MX record Cloudflare delivers email to (e.g. `mx.example.com`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const wt={command:`edit <domain-id>`,describe:`Update an email domain`,builder:Ct,handler:async e=>c({command:`email-security domains edit`,classification:{safeFlags:[`folder`,`require-tls-inbound`,`require-tls-outbound`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({allowed_delivery_modes:e[`allowed-delivery-modes`],drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(I,{body:t,account_id:l,domain_id:e[`domain-id`]}));a(n,{successLabel:`Updated`});return}let p=d({allowed_delivery_modes:e[`allowed-delivery-modes`],drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}),m=await s(`Updating`,async()=>c.send(I,{body:p,account_id:l,domain_id:e[`domain-id`]}));a(m,{successLabel:`Updated`})})};var Tt={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains/${t.domain_id}`};function Et(e){return e.usage(`$0 email-security domains get <domain-id>
|
|
72
72
|
|
|
73
73
|
Retrieves detailed information for a specific protected email domain including its delivery configuration, SPF/DMARC status, and authorization state.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dt={command:`get <domain-id>`,describe:`Get an email domain`,builder:Et,handler:async e=>c({command:`email-security domains get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Tt,{account_id:l,domain_id:e[`domain-id`]}));a(u,{successLabel:`Loaded`})})};var Ot={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains`,query:[`page`,`per_page`,`search`,`order`,`direction`,`allowed_delivery_mode`,`domain`,`active_delivery_mode`,`integration_id`,`status`]};function kt(e){return e.usage(`$0 email-security domains list
|
|
74
74
|
|
|
75
75
|
Returns a paginated list of email domains protected by Email Security. Includes domain configuration, delivery modes, and authorization status. Supports filtering by delivery mode and integration ID.`).option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`domain`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`allowed-delivery-mode`,{type:`string`,description:`Delivery mode to filter by.`,choices:[`DIRECT`,`BCC`,`JOURNAL`,`API`,`RETRO_SCAN`]}).option(`domain`,{type:`string`,description:`Domain names to filter by.`}).option(`active-delivery-mode`,{type:`string`,description:`Currently active delivery mode to filter by.`,choices:[`DIRECT`,`BCC`,`JOURNAL`,`API`,`RETRO_SCAN`]}).option(`integration-id`,{type:`string`,description:`Integration ID to filter by.`}).option(`status`,{type:`string`,description:`Filters response to domains with the provided status.`,choices:[`PENDING`,`ACTIVE`,`FAILED`,`TIMEOUT`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`list`,describe:`List protected email domains`,builder:kt,handler:async e=>c({command:`email-security domains list`,classification:{safeFlags:[`order`,`direction`,`allowed-delivery-mode`,`active-delivery-mode`,`status`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,direction:e.direction,allowed_delivery_mode:e[`allowed-delivery-mode`],domain:e.domain,active_delivery_mode:e[`active-delivery-mode`],integration_id:e[`integration-id`],status:e.status};if(e.dryRun){let e=await r();o({command:`cf email-security domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/settings/domains`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(Ot,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var L={method:`PUT`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains/${t.domain_id}`,body:`json`};function jt(e){return e.usage(`$0 email-security domains update <domain-id>
|
|
76
76
|
|
|
77
|
-
Replaces all mutable fields of a protected email domain in a single atomic operation. Unlike PATCH, all non-computed fields are required.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`Delivery modes to onboard the domain through.`}).option(`drop-dispositions`,{type:`string`,array:!0,description:'Dispositions to drop instead of delivering, e.g. `["MALICIOUS", "SPAM"]`.'}).option(`folder`,{type:`string`,description:`The mailbox folder to scan, for API-scanning domains.`,choices:[`AllItems`,`Inbox`]}).coerce(`folder`,e=>f(e,`folder`,`text`)).option(`integration-id`,{type:`string`,description:`Identifier of the CASB integration that authorizes this domain. The integration also enables API scanning, post-delivery actions, and directory sync.`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`Source IP ranges mail is accepted from. Any other source is rejected.`}).option(`lookback-hops`,{type:`number`,description:`Number of hops to trace back through received headers when reconstructing the original message (1-20).`}).option(`regions`,{type:`string`,array:!0,description:'Regions that process messages for this domain, e.g. `["GLOBAL"]` or `["US"]`.'}).option(`require-tls-inbound`,{type:`boolean`,description:`Require TLS on inbound connections.`}).option(`require-tls-outbound`,{type:`boolean`,description:`Require TLS on outbound connections.`}).option(`transport`,{type:`string`,description:"The mail transport hostname for MX/Inline delivery — the MX record Cloudflare delivers email to (e.g. `mx.example.com`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for replacing an email domain. The `domain` field is intentionally absent — the domain name is immutable after creation. "})}const Mt={command:`update <domain-id>`,describe:`Replace an email domain`,builder:jt,handler:async e=>c({command:`email-security domains update`,classification:{safeFlags:[`folder`,`require-tls-inbound`,`require-tls-outbound`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({allowed_delivery_modes:e[`allowed-delivery-modes`],drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}):
|
|
77
|
+
Replaces all mutable fields of a protected email domain in a single atomic operation. Unlike PATCH, all non-computed fields are required.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`Delivery modes to onboard the domain through.`}).option(`drop-dispositions`,{type:`string`,array:!0,description:'Dispositions to drop instead of delivering, e.g. `["MALICIOUS", "SPAM"]`.'}).option(`folder`,{type:`string`,description:`The mailbox folder to scan, for API-scanning domains.`,choices:[`AllItems`,`Inbox`]}).coerce(`folder`,e=>f(e,`folder`,`text`)).option(`integration-id`,{type:`string`,description:`Identifier of the CASB integration that authorizes this domain. The integration also enables API scanning, post-delivery actions, and directory sync.`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`Source IP ranges mail is accepted from. Any other source is rejected.`}).option(`lookback-hops`,{type:`number`,description:`Number of hops to trace back through received headers when reconstructing the original message (1-20).`}).option(`regions`,{type:`string`,array:!0,description:'Regions that process messages for this domain, e.g. `["GLOBAL"]` or `["US"]`.'}).option(`require-tls-inbound`,{type:`boolean`,description:`Require TLS on inbound connections.`}).option(`require-tls-outbound`,{type:`boolean`,description:`Require TLS on outbound connections.`}).option(`transport`,{type:`string`,description:"The mail transport hostname for MX/Inline delivery — the MX record Cloudflare delivers email to (e.g. `mx.example.com`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for replacing an email domain. The `domain` field is intentionally absent — the domain name is immutable after creation. "})}const Mt={command:`update <domain-id>`,describe:`Replace an email domain`,builder:jt,handler:async e=>c({command:`email-security domains update`,classification:{safeFlags:[`folder`,`require-tls-inbound`,`require-tls-outbound`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({allowed_delivery_modes:e[`allowed-delivery-modes`],drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(L,{body:t,account_id:l,domain_id:e[`domain-id`]}));a(n,{successLabel:`Updated`});return}if(e[`allowed-delivery-modes`]===void 0)throw Error(`--allowed-delivery-modes is required (or pass --body with this field set).`);if(e[`drop-dispositions`]===void 0)throw Error(`--drop-dispositions is required (or pass --body with this field set).`);if(e[`ip-restrictions`]===void 0)throw Error(`--ip-restrictions is required (or pass --body with this field set).`);if(e.regions===void 0)throw Error(`--regions is required (or pass --body with this field set).`);let p=d({allowed_delivery_modes:e[`allowed-delivery-modes`],drop_dispositions:e[`drop-dispositions`],folder:e.folder,integration_id:f(e[`integration-id`],`integration-id`,`text`),ip_restrictions:e[`ip-restrictions`],lookback_hops:e[`lookback-hops`],regions:e.regions,require_tls_inbound:e[`require-tls-inbound`],require_tls_outbound:e[`require-tls-outbound`],transport:f(e.transport,`transport`,`text`)}),m=await s(`Updating`,async()=>c.send(L,{body:p,account_id:l,domain_id:e[`domain-id`]}));a(m,{successLabel:`Updated`})})};var Nt={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/domains/${t.domain_id}/verification`};function Pt(e){return e.usage(`$0 email-security domains verification get <domain-id>
|
|
78
78
|
|
|
79
79
|
Returns the DNS TXT record information when the domain ownership isn't verified through Cloudflare zone ownership or CASB integration.`).positional(`domain-id`,{type:`string`,description:`Domain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ft={command:`get <domain-id>`,describe:`Get domain verification details`,builder:Pt,handler:async e=>c({command:`email-security domains verification get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security domains verification get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/domains/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/verification`,pathParams:{"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Nt,{account_id:l,domain_id:e[`domain-id`]}));a(u,{successLabel:`Loaded`})})},It={command:`verification`,describe:`Operations for domains.verification`,builder:e=>e.command(Ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Lt={command:`domains`,describe:`Operations for domains`,builder:e=>e.command(_t).command(yt).command(St).command(wt).command(Dt).command(At).command(Mt).command(It).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var R={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/impersonation_registry`,body:`json`};function Rt(e){return e.usage(`$0 email-security impersonation-registry create
|
|
80
80
|
|
|
81
|
-
Creates a new entry in the impersonation registry to protect against impersonation. Emails attempting to impersonate this identity will be flagged. Supports regex patterns for flexible email matching.`).option(`comments`,{type:`string`,description:`Optional note describing the entry.`}).option(`directory-id`,{type:`number`,description:`Identifier of the directory the entry was synced from, when directory-synced.`}).option(`directory-node-id`,{type:`number`,description:`Identifier of the directory node the entry was synced from, when directory-synced.`}).option(`email`,{type:`string`,description:`Email address (or pattern) of the protected identity.`}).option(`external-directory-node-id`,{type:`string`,description:`Deprecated. External identifier of the directory node.`}).option(`is-email-regex`,{type:`boolean`,description:"Whether `email` is a regular expression instead of a literal address."}).option(`name`,{type:`string`,description:`Display name of the protected identity.`}).option(`provenance`,{type:`string`,description:`Source the entry was created from.`,choices:[`A1S_INTERNAL`,`SNOOPY-CASB_OFFICE_365`,`SNOOPY-OFFICE_365`,`SNOOPY-GOOGLE_DIRECTORY`]}).coerce(`provenance`,e=>f(e,`provenance`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create an impersonation registry entry.`})}const zt={command:`create`,describe:`Create impersonation registry entry`,builder:Rt,handler:async e=>c({command:`email-security impersonation-registry create`,classification:{safeFlags:[`is-email-regex`,`provenance`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security impersonation-registry create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/impersonation_registry`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),directory_id:e[`directory-id`],directory_node_id:e[`directory-node-id`],email:f(e.email,`email`,`text`),external_directory_node_id:f(e[`external-directory-node-id`],`external-directory-node-id`,`text`),is_email_regex:e[`is-email-regex`],name:f(e.name,`name`,`text`),provenance:e.provenance}):
|
|
81
|
+
Creates a new entry in the impersonation registry to protect against impersonation. Emails attempting to impersonate this identity will be flagged. Supports regex patterns for flexible email matching.`).option(`comments`,{type:`string`,description:`Optional note describing the entry.`}).option(`directory-id`,{type:`number`,description:`Identifier of the directory the entry was synced from, when directory-synced.`}).option(`directory-node-id`,{type:`number`,description:`Identifier of the directory node the entry was synced from, when directory-synced.`}).option(`email`,{type:`string`,description:`Email address (or pattern) of the protected identity.`}).option(`external-directory-node-id`,{type:`string`,description:`Deprecated. External identifier of the directory node.`}).option(`is-email-regex`,{type:`boolean`,description:"Whether `email` is a regular expression instead of a literal address."}).option(`name`,{type:`string`,description:`Display name of the protected identity.`}).option(`provenance`,{type:`string`,description:`Source the entry was created from.`,choices:[`A1S_INTERNAL`,`SNOOPY-CASB_OFFICE_365`,`SNOOPY-OFFICE_365`,`SNOOPY-GOOGLE_DIRECTORY`]}).coerce(`provenance`,e=>f(e,`provenance`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create an impersonation registry entry.`})}const zt={command:`create`,describe:`Create impersonation registry entry`,builder:Rt,handler:async e=>c({command:`email-security impersonation-registry create`,classification:{safeFlags:[`is-email-regex`,`provenance`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security impersonation-registry create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/impersonation_registry`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),directory_id:e[`directory-id`],directory_node_id:e[`directory-node-id`],email:f(e.email,`email`,`text`),external_directory_node_id:f(e[`external-directory-node-id`],`external-directory-node-id`,`text`),is_email_regex:e[`is-email-regex`],name:f(e.name,`name`,`text`),provenance:e.provenance}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(R,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e.email===void 0&&(e.email=await p(`email`,`Email address (or pattern) of the protected identity.`)),e[`is-email-regex`]===void 0)throw Error(`--is-email-regex is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await p(`name`,`Display name of the protected identity.`));let m=d({comments:f(e.comments,`comments`,`text`),directory_id:e[`directory-id`],directory_node_id:e[`directory-node-id`],email:f(e.email,`email`,`text`),external_directory_node_id:f(e[`external-directory-node-id`],`external-directory-node-id`,`text`),is_email_regex:e[`is-email-regex`],name:f(e.name,`name`,`text`),provenance:e.provenance}),h=await s(`Creating`,async()=>c.send(R,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var Bt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/impersonation_registry/${t.impersonation_registry_id}`};function Vt(e){return e.usage(`$0 email-security impersonation-registry delete <impersonation-registry-id>
|
|
82
82
|
|
|
83
83
|
Removes an entry from the impersonation registry. After deletion, this identity will no longer be protected from impersonation.`).positional(`impersonation-registry-id`,{type:`string`,description:`Impersonation registry entry 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 Ht={command:`delete <impersonation-registry-id>`,describe:`Delete an impersonation registry entry`,builder:Vt,handler:async e=>c({command:`email-security impersonation-registry delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security impersonation-registry delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/impersonation_registry/${e[`impersonation-registry-id`]==null?`<impersonation-registry-id>`:encodeURIComponent(String(e[`impersonation-registry-id`]))}`,pathParams:{"impersonation-registry-id":String(e[`impersonation-registry-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the impersonation registry entry and stops protecting the identity from impersonation.`})){process.stderr.write(`Aborted.
|
|
84
84
|
`);return}let u=await s(`Deleting`,async()=>c.send(Bt,{account_id:l,impersonation_registry_id:e[`impersonation-registry-id`]}));a(u,{successLabel:`Deleted`})})};var z={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/impersonation_registry/${t.impersonation_registry_id}`,body:`json`};function Ut(e){return e.usage(`$0 email-security impersonation-registry edit <impersonation-registry-id>
|
|
85
85
|
|
|
86
|
-
Updates an existing impersonation registry entry. Only provided fields will be modified. Directory-synced entries can't be updated.`).positional(`impersonation-registry-id`,{type:`string`,description:`Impersonation registry entry identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`Optional note describing the entry.`}).option(`directory-id`,{type:`number`,description:`Identifier of the directory the entry was synced from, when directory-synced.`}).option(`directory-node-id`,{type:`number`,description:`Identifier of the directory node the entry was synced from, when directory-synced.`}).option(`email`,{type:`string`,description:`Email address (or pattern) of the protected identity.`}).option(`external-directory-node-id`,{type:`string`,description:`Deprecated. External identifier of the directory node.`}).option(`is-email-regex`,{type:`boolean`,description:"Whether `email` is a regular expression instead of a literal address."}).option(`name`,{type:`string`,description:`Display name of the protected identity.`}).option(`provenance`,{type:`string`,description:`Source the entry was created from.`,choices:[`A1S_INTERNAL`,`SNOOPY-CASB_OFFICE_365`,`SNOOPY-OFFICE_365`,`SNOOPY-GOOGLE_DIRECTORY`]}).coerce(`provenance`,e=>f(e,`provenance`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update an impersonation registry entry.`})}const Wt={command:`edit <impersonation-registry-id>`,describe:`Update an impersonation registry entry`,builder:Ut,handler:async e=>c({command:`email-security impersonation-registry edit`,classification:{safeFlags:[`is-email-regex`,`provenance`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security impersonation-registry edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/impersonation_registry/${e[`impersonation-registry-id`]==null?`<impersonation-registry-id>`:encodeURIComponent(String(e[`impersonation-registry-id`]))}`,pathParams:{"impersonation-registry-id":String(e[`impersonation-registry-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),directory_id:e[`directory-id`],directory_node_id:e[`directory-node-id`],email:f(e.email,`email`,`text`),external_directory_node_id:f(e[`external-directory-node-id`],`external-directory-node-id`,`text`),is_email_regex:e[`is-email-regex`],name:f(e.name,`name`,`text`),provenance:e.provenance}):
|
|
86
|
+
Updates an existing impersonation registry entry. Only provided fields will be modified. Directory-synced entries can't be updated.`).positional(`impersonation-registry-id`,{type:`string`,description:`Impersonation registry entry identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`Optional note describing the entry.`}).option(`directory-id`,{type:`number`,description:`Identifier of the directory the entry was synced from, when directory-synced.`}).option(`directory-node-id`,{type:`number`,description:`Identifier of the directory node the entry was synced from, when directory-synced.`}).option(`email`,{type:`string`,description:`Email address (or pattern) of the protected identity.`}).option(`external-directory-node-id`,{type:`string`,description:`Deprecated. External identifier of the directory node.`}).option(`is-email-regex`,{type:`boolean`,description:"Whether `email` is a regular expression instead of a literal address."}).option(`name`,{type:`string`,description:`Display name of the protected identity.`}).option(`provenance`,{type:`string`,description:`Source the entry was created from.`,choices:[`A1S_INTERNAL`,`SNOOPY-CASB_OFFICE_365`,`SNOOPY-OFFICE_365`,`SNOOPY-GOOGLE_DIRECTORY`]}).coerce(`provenance`,e=>f(e,`provenance`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update an impersonation registry entry.`})}const Wt={command:`edit <impersonation-registry-id>`,describe:`Update an impersonation registry entry`,builder:Ut,handler:async e=>c({command:`email-security impersonation-registry edit`,classification:{safeFlags:[`is-email-regex`,`provenance`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security impersonation-registry edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/impersonation_registry/${e[`impersonation-registry-id`]==null?`<impersonation-registry-id>`:encodeURIComponent(String(e[`impersonation-registry-id`]))}`,pathParams:{"impersonation-registry-id":String(e[`impersonation-registry-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),directory_id:e[`directory-id`],directory_node_id:e[`directory-node-id`],email:f(e.email,`email`,`text`),external_directory_node_id:f(e[`external-directory-node-id`],`external-directory-node-id`,`text`),is_email_regex:e[`is-email-regex`],name:f(e.name,`name`,`text`),provenance:e.provenance}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(z,{body:t,account_id:l,impersonation_registry_id:e[`impersonation-registry-id`]}));a(n,{successLabel:`Updated`});return}let p=d({comments:f(e.comments,`comments`,`text`),directory_id:e[`directory-id`],directory_node_id:e[`directory-node-id`],email:f(e.email,`email`,`text`),external_directory_node_id:f(e[`external-directory-node-id`],`external-directory-node-id`,`text`),is_email_regex:e[`is-email-regex`],name:f(e.name,`name`,`text`),provenance:e.provenance}),m=await s(`Updating`,async()=>c.send(z,{body:p,account_id:l,impersonation_registry_id:e[`impersonation-registry-id`]}));a(m,{successLabel:`Updated`})})};var Gt={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/impersonation_registry/${t.impersonation_registry_id}`};function Kt(e){return e.usage(`$0 email-security impersonation-registry get <impersonation-registry-id>
|
|
87
87
|
|
|
88
88
|
Retrieves details for a specific impersonation registry entry including the protected identity, email pattern, and synchronization source if directory-synced.`).positional(`impersonation-registry-id`,{type:`string`,description:`Impersonation registry entry identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qt={command:`get <impersonation-registry-id>`,describe:`Get an impersonation registry entry`,builder:Kt,handler:async e=>c({command:`email-security impersonation-registry get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security impersonation-registry get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/impersonation_registry/${e[`impersonation-registry-id`]==null?`<impersonation-registry-id>`:encodeURIComponent(String(e[`impersonation-registry-id`]))}`,pathParams:{"impersonation-registry-id":String(e[`impersonation-registry-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Gt,{account_id:l,impersonation_registry_id:e[`impersonation-registry-id`]}));a(u,{successLabel:`Loaded`})})};var Jt={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/impersonation_registry`,query:[`page`,`per_page`,`search`,`order`,`direction`,`provenance`]};function Yt(e){return e.usage(`$0 email-security impersonation-registry list
|
|
89
89
|
|
|
@@ -98,60 +98,60 @@ regular datastore only.`}).option(`dry-run`,{type:`boolean`,description:`Validat
|
|
|
98
98
|
|
|
99
99
|
Returns information for each email that matches the provided search parameters.`).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 term matched case-insensitively against message metadata — sender, recipient, subject, attachment names and hashes, and message ID.`}).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 to aggregate the results by.`}).option(`message-action`,{type:`string`,description:`Message actions to filter by.`,choices:[`PREVIEW`,`QUARANTINE_RELEASED`,`MOVED`]}).option(`recipient`,{type:`string`,description:`Filter by recipient. Matches an email address or a domain.`}).option(`sender`,{type:`string`,description:`Filter by sender. Matches an email address or a domain.`}).option(`smtp-helo-ip`,{type:`string`,description:`Matches messages whose SMTP HELO server IP address equals this value.`}).option(`alert-id`,{type:`string`,description:`Filter by alert ID.`}).option(`domain`,{type:`string`,description:`Filter by a domain found in the email — sender domain, recipient domain, or a domain in a link.`}).option(`message-id`,{type:`string`,description:`Filter by the RFC 5322 Message-ID header.`}).option(`subject`,{type:`string`,description:`Search for messages containing individual keywords in any order within the subject.`}).option(`delivery-status`,{type:`string`,description:`Delivery status to filter by.`,choices:[`delivered`,`moved`,`quarantined`,`rejected`,`deferred`,`bounced`,`queued`,`move_failed`]}).option(`cursor`,{type:`string`,description:"Pagination cursor from the previous response's `result_info`."}).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 fn={command:`list`,describe:`Search email messages`,builder:dn,handler:async e=>c({command:`email-security investigate list`,classification:{safeFlags:[`detections-only`,`final-disposition`,`message-action`,`delivery-status`,`dry-run`]}},e,async()=>{let c={start:e.start,end:e.end,query:e.query,detections_only:e[`detections-only`],final_disposition:e[`final-disposition`],metric:e.metric,message_action:e[`message-action`],recipient:e.recipient,sender:e.sender,smtp_helo_ip:e[`smtp-helo-ip`],alert_id:e[`alert-id`],domain:e.domain,message_id:e[`message-id`],subject:e.subject,delivery_status:e[`delivery-status`],cursor:e.cursor,per_page:e[`per-page`],page:e.page};if(e.dryRun){let e=await r();o({command:`cf email-security investigate list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/investigate`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(un,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var B={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/move`,body:`json`};function pn(e){return e.usage(`$0 email-security investigate move
|
|
100
100
|
|
|
101
|
-
Moves one or more messages to a specified mailbox folder (Inbox, JunkEmail, DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires active integration. Operates on an explicit list of messages; to move all messages matching a search, create a bulk action job instead.`).option(`destination`,{type:`string`,description:`The mailbox folder to move messages to.`,choices:[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]}).coerce(`destination`,e=>f(e,`destination`,`text`)).option(`expected-disposition`,{type:`string`,description:`Nonfunctional field. End of life: December 1, 2026.`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).coerce(`expected-disposition`,e=>f(e,`expected-disposition`,`text`)).option(`ids`,{type:`string`,array:!0,description:`List of message IDs to move.`}).option(`postfix-ids`,{type:`string`,array:!0,description:"Deprecated, use `ids` instead. End of life: November 1, 2026."}).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 mn={command:`move`,describe:`Move messages`,builder:pn,handler:async e=>c({command:`email-security investigate move`,classification:{safeFlags:[`destination`,`expected-disposition`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({destination:e.destination,expected_disposition:e[`expected-disposition`],ids:e.ids,postfix_ids:e[`postfix-ids`]}):
|
|
101
|
+
Moves one or more messages to a specified mailbox folder (Inbox, JunkEmail, DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires active integration. Operates on an explicit list of messages; to move all messages matching a search, create a bulk action job instead.`).option(`destination`,{type:`string`,description:`The mailbox folder to move messages to.`,choices:[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]}).coerce(`destination`,e=>f(e,`destination`,`text`)).option(`expected-disposition`,{type:`string`,description:`Nonfunctional field. End of life: December 1, 2026.`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).coerce(`expected-disposition`,e=>f(e,`expected-disposition`,`text`)).option(`ids`,{type:`string`,array:!0,description:`List of message IDs to move.`}).option(`postfix-ids`,{type:`string`,array:!0,description:"Deprecated, use `ids` instead. End of life: November 1, 2026."}).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 mn={command:`move`,describe:`Move messages`,builder:pn,handler:async e=>c({command:`email-security investigate move`,classification:{safeFlags:[`destination`,`expected-disposition`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({destination:e.destination,expected_disposition:e[`expected-disposition`],ids:e.ids,postfix_ids:e[`postfix-ids`]}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(B,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e.destination===void 0&&(e.destination=await m(`destination`,`The mailbox folder to move messages to.`,[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`])),e.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let f=d({destination:e.destination,expected_disposition:e[`expected-disposition`],ids:e.ids,postfix_ids:e[`postfix-ids`]}),p=await s(`Creating`,async()=>c.send(B,{body:f,account_id:l}));a(p,{successLabel:`Created`})})};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/preview`,body:`json`};function hn(e){return e.usage(`$0 email-security investigate preview generate
|
|
102
102
|
|
|
103
|
-
Generates a preview image for a message that was not flagged as a detection. The message is rendered from the copy in the recipient's mailbox, so this requires an active integration and only works while the message is still in the recipient's inbox. Returns a base64-encoded PNG screenshot of the email body. For messages with a detection, use the detection preview endpoint instead.`).option(`id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation.`}).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 gn={command:`generate`,describe:`Generate preview for a non-detection message`,builder:hn,handler:async e=>c({command:`email-security investigate preview generate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate preview generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/preview`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({id:f(e.id,`id`,`text`)}):
|
|
103
|
+
Generates a preview image for a message that was not flagged as a detection. The message is rendered from the copy in the recipient's mailbox, so this requires an active integration and only works while the message is still in the recipient's inbox. Returns a base64-encoded PNG screenshot of the email body. For messages with a detection, use the detection preview endpoint instead.`).option(`id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation.`}).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 gn={command:`generate`,describe:`Generate preview for a non-detection message`,builder:hn,handler:async e=>c({command:`email-security investigate preview generate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate preview generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/preview`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({id:f(e.id,`id`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(V,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.id===void 0&&(e.id=await p(`id`,`Unique identifier for a message retrieved from investigation.`));let m=d({id:f(e.id,`id`,`text`)}),h=await s(`Creating`,async()=>c.send(V,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var _n={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/${t.investigate_id}/preview`};function vn(e){return e.usage(`$0 email-security investigate preview get <investigate-id>
|
|
104
104
|
|
|
105
105
|
Returns a preview of the message body as a base64-encoded PNG image for any message with a detection. For messages without a detection, use the non-detection preview endpoint instead.`).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 yn={command:`get <investigate-id>`,describe:`Get preview for a detection`,builder:vn,handler:async e=>c({command:`email-security investigate preview get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate preview get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/${e[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(e[`investigate-id`]))}/preview`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(_n,{account_id:l,investigate_id:e[`investigate-id`]}));a(u,{successLabel:`Loaded`})})},bn={command:`preview`,describe:`Operations for investigate.preview`,builder:e=>e.command(gn).command(yn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var xn={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/${t.investigate_id}/raw`};function Sn(e){return e.usage(`$0 email-security investigate raw get <investigate-id>
|
|
106
106
|
|
|
107
107
|
Returns the raw EML content of any message with a detection.`).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 Cn={command:`get <investigate-id>`,describe:`Get raw email content`,builder:Sn,handler:async e=>c({command:`email-security investigate raw get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate raw get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/${e[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(e[`investigate-id`]))}/raw`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(xn,{account_id:l,investigate_id:e[`investigate-id`]}));a(u,{successLabel:`Loaded`})})},wn={command:`raw`,describe:`Operations for investigate.raw`,builder:e=>e.command(Cn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var H={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/release`,body:`json`};function Tn(e){return e.usage(`$0 email-security investigate release
|
|
108
108
|
|
|
109
|
-
Delivers one or more quarantined messages to their intended recipients, for cases where a message was incorrectly quarantined. Operates on an explicit list of messages; to release all messages matching a search, create a bulk action job instead. The response includes delivery status for each recipient.`).option(`ids`,{type:`string`,array:!0,description:`Investigate IDs of the messages to release.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The messages to release, identified by their investigate IDs.`})}const En={command:`release`,describe:`Release messages from quarantine`,builder:Tn,handler:async e=>c({command:`email-security investigate release`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate release`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/release`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({ids:e.ids}):
|
|
109
|
+
Delivers one or more quarantined messages to their intended recipients, for cases where a message was incorrectly quarantined. Operates on an explicit list of messages; to release all messages matching a search, create a bulk action job instead. The response includes delivery status for each recipient.`).option(`ids`,{type:`string`,array:!0,description:`Investigate IDs of the messages to release.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The messages to release, identified by their investigate IDs.`})}const En={command:`release`,describe:`Release messages from quarantine`,builder:Tn,handler:async e=>c({command:`email-security investigate release`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate release`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/release`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({ids:e.ids}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(H,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let f=d({ids:e.ids}),p=await s(`Creating`,async()=>c.send(H,{body:f,account_id:l}));a(p,{successLabel:`Created`})})};var Dn={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/investigate/${t.investigate_id}/trace`};function On(e){return e.usage(`$0 email-security investigate trace get <investigate-id>
|
|
110
110
|
|
|
111
111
|
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.`).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 kn={command:`get <investigate-id>`,describe:`Get email trace`,builder:On,handler:async e=>c({command:`email-security investigate trace get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security investigate trace get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/investigate/${e[`investigate-id`]==null?`<investigate-id>`:encodeURIComponent(String(e[`investigate-id`]))}/trace`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Dn,{account_id:l,investigate_id:e[`investigate-id`]}));a(u,{successLabel:`Loaded`})})},An={command:`trace`,describe:`Operations for investigate.trace`,builder:e=>e.command(kn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},jn={command:`investigate`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(ln).command(fn).command(mn).command(En).command(tn).command(on).command(bn).command(wn).command(An).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Mn={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/phishguard/reports`,query:[`start`,`end`,`from_date`,`to_date`,`page`,`per_page`]};function Nn(e){return e.usage(`$0 email-security phishguard reports list
|
|
112
112
|
|
|
113
113
|
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.`).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(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pn={command:`list`,describe:`List PhishGuard reports`,builder:Nn,handler:async e=>c({command:`email-security phishguard reports list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={start:e.start,end:e.end,from_date:e[`from-date`],to_date:e[`to-date`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({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:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(Mn,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},Fn={command:`reports`,describe:`Operations for phishguard.reports`,builder:e=>e.command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},In={command:`phishguard`,describe:`PhishGuard user-reported phishing reports — view detected threats for a date range`,builder:e=>e.command(Fn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/sending_domain_restrictions`,body:`json`};function Ln(e){return e.usage(`$0 email-security sending-domain-restrictions create
|
|
114
114
|
|
|
115
|
-
Creates a new sending domain restriction to enforce TLS requirements for a domain. Emails without TLS from this domain will be dropped unless the subdomain is in the exclude list.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`domain`,{type:`string`,description:`Domain that requires TLS enforcement.`}).option(`exclude`,{type:`string`,array:!0,description:`Subdomains to exempt from TLS requirements.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a sending domain restriction.`})}const Rn={command:`create`,describe:`Create a sending domain restriction`,builder:Ln,handler:async e=>c({command:`email-security sending-domain-restrictions create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security sending-domain-restrictions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/sending_domain_restrictions`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),domain:f(e.domain,`domain`,`text`),exclude:e.exclude}):
|
|
115
|
+
Creates a new sending domain restriction to enforce TLS requirements for a domain. Emails without TLS from this domain will be dropped unless the subdomain is in the exclude list.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`domain`,{type:`string`,description:`Domain that requires TLS enforcement.`}).option(`exclude`,{type:`string`,array:!0,description:`Subdomains to exempt from TLS requirements.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a sending domain restriction.`})}const Rn={command:`create`,describe:`Create a sending domain restriction`,builder:Ln,handler:async e=>c({command:`email-security sending-domain-restrictions create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security sending-domain-restrictions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/sending_domain_restrictions`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),domain:f(e.domain,`domain`,`text`),exclude:e.exclude}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(U,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e.domain===void 0&&(e.domain=await p(`domain`,`Domain that requires TLS enforcement.`)),e.exclude===void 0)throw Error(`--exclude is required (or pass --body with this field set).`);let m=d({comments:f(e.comments,`comments`,`text`),domain:f(e.domain,`domain`,`text`),exclude:e.exclude}),h=await s(`Creating`,async()=>c.send(U,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var zn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/sending_domain_restrictions/${t.sending_domain_restriction_id}`};function Bn(e){return e.usage(`$0 email-security sending-domain-restrictions delete <sending-domain-restriction-id>
|
|
116
116
|
|
|
117
117
|
Removes a sending domain restriction. After deletion, TLS will no longer be enforced for emails from this domain.`).positional(`sending-domain-restriction-id`,{type:`string`,description:`Sending domain restriction 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 Vn={command:`delete <sending-domain-restriction-id>`,describe:`Delete a sending domain restriction`,builder:Bn,handler:async e=>c({command:`email-security sending-domain-restrictions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security sending-domain-restrictions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/sending_domain_restrictions/${e[`sending-domain-restriction-id`]==null?`<sending-domain-restriction-id>`:encodeURIComponent(String(e[`sending-domain-restriction-id`]))}`,pathParams:{"sending-domain-restriction-id":String(e[`sending-domain-restriction-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the sending domain restriction and removes TLS enforcement for emails from this domain.`})){process.stderr.write(`Aborted.
|
|
118
118
|
`);return}let u=await s(`Deleting`,async()=>c.send(zn,{account_id:l,sending_domain_restriction_id:e[`sending-domain-restriction-id`]}));a(u,{successLabel:`Deleted`})})};var W={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/sending_domain_restrictions/${t.sending_domain_restriction_id}`,body:`json`};function Hn(e){return e.usage(`$0 email-security sending-domain-restrictions edit <sending-domain-restriction-id>
|
|
119
119
|
|
|
120
|
-
Updates an existing sending domain restriction. Only provided fields will be modified. Changes affect which domains require TLS and which subdomains are excluded.`).positional(`sending-domain-restriction-id`,{type:`string`,description:`Sending domain restriction identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`domain`,{type:`string`,description:`Domain that requires TLS enforcement.`}).option(`exclude`,{type:`string`,array:!0,description:`Subdomains to exempt from TLS requirements.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a sending domain restriction.`})}const Un={command:`edit <sending-domain-restriction-id>`,describe:`Update a sending domain restriction`,builder:Hn,handler:async e=>c({command:`email-security sending-domain-restrictions edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security sending-domain-restrictions edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/sending_domain_restrictions/${e[`sending-domain-restriction-id`]==null?`<sending-domain-restriction-id>`:encodeURIComponent(String(e[`sending-domain-restriction-id`]))}`,pathParams:{"sending-domain-restriction-id":String(e[`sending-domain-restriction-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),domain:f(e.domain,`domain`,`text`),exclude:e.exclude}):
|
|
120
|
+
Updates an existing sending domain restriction. Only provided fields will be modified. Changes affect which domains require TLS and which subdomains are excluded.`).positional(`sending-domain-restriction-id`,{type:`string`,description:`Sending domain restriction identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`domain`,{type:`string`,description:`Domain that requires TLS enforcement.`}).option(`exclude`,{type:`string`,array:!0,description:`Subdomains to exempt from TLS requirements.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a sending domain restriction.`})}const Un={command:`edit <sending-domain-restriction-id>`,describe:`Update a sending domain restriction`,builder:Hn,handler:async e=>c({command:`email-security sending-domain-restrictions edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security sending-domain-restrictions edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/sending_domain_restrictions/${e[`sending-domain-restriction-id`]==null?`<sending-domain-restriction-id>`:encodeURIComponent(String(e[`sending-domain-restriction-id`]))}`,pathParams:{"sending-domain-restriction-id":String(e[`sending-domain-restriction-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),domain:f(e.domain,`domain`,`text`),exclude:e.exclude}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(W,{body:t,account_id:l,sending_domain_restriction_id:e[`sending-domain-restriction-id`]}));a(n,{successLabel:`Updated`});return}let p=d({comments:f(e.comments,`comments`,`text`),domain:f(e.domain,`domain`,`text`),exclude:e.exclude}),m=await s(`Updating`,async()=>c.send(W,{body:p,account_id:l,sending_domain_restriction_id:e[`sending-domain-restriction-id`]}));a(m,{successLabel:`Updated`})})};var Wn={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/sending_domain_restrictions/${t.sending_domain_restriction_id}`};function Gn(e){return e.usage(`$0 email-security sending-domain-restrictions get <sending-domain-restriction-id>
|
|
121
121
|
|
|
122
122
|
Retrieves details for a specific sending domain restriction including the domain requiring TLS and any excluded subdomains exempt from the TLS requirement.`).positional(`sending-domain-restriction-id`,{type:`string`,description:`Sending domain restriction identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kn={command:`get <sending-domain-restriction-id>`,describe:`Get a sending domain restriction`,builder:Gn,handler:async e=>c({command:`email-security sending-domain-restrictions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security sending-domain-restrictions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/sending_domain_restrictions/${e[`sending-domain-restriction-id`]==null?`<sending-domain-restriction-id>`:encodeURIComponent(String(e[`sending-domain-restriction-id`]))}`,pathParams:{"sending-domain-restriction-id":String(e[`sending-domain-restriction-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Wn,{account_id:l,sending_domain_restriction_id:e[`sending-domain-restriction-id`]}));a(u,{successLabel:`Loaded`})})};var qn={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/sending_domain_restrictions`,query:[`page`,`per_page`,`search`,`order`,`direction`]};function Jn(e){return e.usage(`$0 email-security sending-domain-restrictions list
|
|
123
123
|
|
|
124
124
|
Returns a paginated list of sending domain restrictions. These restrictions enforce TLS requirements for emails from specific domains. Mail without TLS from restricted domains will be dropped unless the subdomain is in the exclude list. Supports sorting and searching.`).option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`domain`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yn={command:`list`,describe:`List sending domain restrictions`,builder:Jn,handler:async e=>c({command:`email-security sending-domain-restrictions list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,direction:e.direction};if(e.dryRun){let e=await r();o({command:`cf email-security sending-domain-restrictions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/settings/sending_domain_restrictions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(qn,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},Xn={command:`sending-domain-restrictions`,describe:`Operations for sending-domain-restrictions`,builder:e=>e.command(Rn).command(Vn).command(Un).command(Kn).command(Yn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/submissions`,body:`json`};function Zn(e){return e.usage(`$0 email-security submissions create
|
|
125
125
|
|
|
126
|
-
Submits messages for reclassification or to report missed detections.`).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`reclassification`,`missed_detection`]}).coerce(`type`,e=>f(e,`type`,`text`)).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 Qn={command:`create`,describe:`Create new submissions`,builder:Zn,handler:async e=>c({command:`email-security submissions create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security submissions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/submissions`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({messages:
|
|
126
|
+
Submits messages for reclassification or to report missed detections.`).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`reclassification`,`missed_detection`]}).coerce(`type`,e=>f(e,`type`,`text`)).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 Qn={command:`create`,describe:`Create new submissions`,builder:Zn,handler:async e=>c({command:`email-security submissions create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security submissions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/submissions`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({messages:l(e.messages,`messages`),type:e.type}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(G,{body:t,account_id:f}));a(n,{successLabel:`Created`});return}if(e.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);e.type===void 0&&(e.type=await m(`type`,`The type field`,[`reclassification`,`missed_detection`]));let p=d({messages:l(e.messages,`messages`),type:e.type}),h=await s(`Creating`,async()=>c.send(G,{body:p,account_id:f}));a(h,{successLabel:`Created`})})};var $n={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/submissions`,query:[`start`,`end`,`type`,`submission_id`,`original_disposition`,`requested_disposition`,`outcome_disposition`,`status`,`query`,`escalated_from_user`,`order`,`direction`,`page`,`per_page`]};function er(e){return e.usage(`$0 email-security submissions list
|
|
127
127
|
|
|
128
128
|
Returns information for submissions made to reclassify emails. Shows the status, outcome, and disposition changes for reclassification requests made by users or the security team. Useful for tracking false positive/negative reports.`).option(`start`,{type:`string`,description:"The beginning of the search date range. Defaults to `now - 30 days`."}).option(`end`,{type:`string`,description:"The end of the search date range. Defaults to `now`."}).option(`type`,{type:`string`,description:"Filter by who created the submission — `TEAM` for security team members or `USER` for end users.",choices:[`TEAM`,`USER`]}).option(`submission-id`,{type:`string`,description:`Filter by a specific submission ID.`}).option(`original-disposition`,{type:`string`,description:`The disposition a message is submitted to have.`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`requested-disposition`,{type:`string`,description:`The disposition a message is submitted to have.`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`outcome-disposition`,{type:`string`,description:`The disposition a message is submitted to have.`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`status`,{type:`string`,description:"Filter by review status — `escalated`, `reviewed`, or `unreviewed`."}).option(`query`,{type:`string`,description:`Search term for filtering submissions.`}).option(`escalated-from-user`,{type:`boolean`,description:`When true, return only submissions that were escalated by an end user (vs. by the security team). When false, return only submissions that were not escalated by an end user. When omitted, no filter is applied.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`submission_id`,`subject`,`original_disposition`,`requested_disposition`,`outcome_disposition`,`requested_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tr={command:`list`,describe:`List reclassify submissions`,builder:er,handler:async e=>c({command:`email-security submissions list`,classification:{safeFlags:[`type`,`original-disposition`,`requested-disposition`,`outcome-disposition`,`escalated-from-user`,`order`,`direction`,`dry-run`]}},e,async()=>{let c={start:e.start,end:e.end,type:e.type,submission_id:e[`submission-id`],original_disposition:e[`original-disposition`],requested_disposition:e[`requested-disposition`],outcome_disposition:e[`outcome-disposition`],status:e.status,query:e.query,escalated_from_user:e[`escalated-from-user`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf email-security submissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/submissions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send($n,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},nr={command:`submissions`,describe:`Reclassify submissions — track user and team reports of false positives and missed detections`,builder:e=>e.command(Qn).command(tr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var K={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains/batch`,body:`json`};function rr(e){return e.usage(`$0 email-security trusted-domains batch
|
|
129
129
|
|
|
130
|
-
Executes multiple trusted domain operations atomically: delete, partially update, replace, and create trusted domain patterns in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the trusted domain patterns to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the pattern's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Trusted domain patterns to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the pattern's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 ir={command:`batch`,describe:`Batch trusted domain operations`,builder:rr,handler:async e=>c({command:`email-security trusted-domains batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:
|
|
131
|
-
`);return}if(e.body){let t=
|
|
130
|
+
Executes multiple trusted domain operations atomically: delete, partially update, replace, and create trusted domain patterns in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the trusted domain patterns to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the pattern's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Trusted domain patterns to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the pattern's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 ir={command:`batch`,describe:`Batch trusted domain operations`,builder:rr,handler:async e=>c({command:`email-security trusted-domains batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may delete the selected trusted domain patterns and restore normal recent domain and similarity checks for matching emails.`})){process.stderr.write(`Aborted.
|
|
131
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(K,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(K,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains`,body:`json`};function ar(e){return e.usage(`$0 email-security trusted-domains create
|
|
132
132
|
|
|
133
|
-
Creates a new trusted domain pattern. Use for partner domains or approved senders that should bypass recent domain registration and similarity checks. Configure whether it prevents recent domain or spoof dispositions.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal domain."}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:"The domain pattern to trust, e.g. `example.com`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a trusted domain.`})}const or={command:`create`,describe:`Create trusted email domain`,builder:ar,handler:async e=>c({command:`email-security trusted-domains create`,classification:{safeFlags:[`is-recent`,`is-regex`,`is-similarity`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}):
|
|
133
|
+
Creates a new trusted domain pattern. Use for partner domains or approved senders that should bypass recent domain registration and similarity checks. Configure whether it prevents recent domain or spoof dispositions.`).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal domain."}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:"The domain pattern to trust, e.g. `example.com`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a trusted domain.`})}const or={command:`create`,describe:`Create trusted email domain`,builder:ar,handler:async e=>c({command:`email-security trusted-domains create`,classification:{safeFlags:[`is-recent`,`is-regex`,`is-similarity`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(q,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}if(e[`is-recent`]===void 0)throw Error(`--is-recent is required (or pass --body with this field set).`);if(e[`is-regex`]===void 0)throw Error(`--is-regex is required (or pass --body with this field set).`);if(e[`is-similarity`]===void 0)throw Error(`--is-similarity is required (or pass --body with this field set).`);e.pattern===void 0&&(e.pattern=await p(`pattern`,"The domain pattern to trust, e.g. `example.com`."));let m=d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}),h=await s(`Creating`,async()=>c.send(q,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var sr={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains/${t.trusted_domain_id}`};function cr(e){return e.usage(`$0 email-security trusted-domains delete <trusted-domain-id>
|
|
134
134
|
|
|
135
135
|
Removes a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks.`).positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const lr={command:`delete <trusted-domain-id>`,describe:`Delete a trusted email domain`,builder:cr,handler:async e=>c({command:`email-security trusted-domains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/${e[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(e[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(e[`trusted-domain-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the trusted domain pattern and restores normal recent domain and similarity checks for matching emails.`})){process.stderr.write(`Aborted.
|
|
136
136
|
`);return}let u=await s(`Deleting`,async()=>c.send(sr,{account_id:l,trusted_domain_id:e[`trusted-domain-id`]}));a(u,{successLabel:`Deleted`})})};var J={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains/${t.trusted_domain_id}`,body:`json`};function ur(e){return e.usage(`$0 email-security trusted-domains edit <trusted-domain-id>
|
|
137
137
|
|
|
138
|
-
Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`).positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal domain."}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:"The domain pattern to trust, e.g. `example.com`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a trusted domain.`})}const dr={command:`edit <trusted-domain-id>`,describe:`Update a trusted email domain`,builder:ur,handler:async e=>c({command:`email-security trusted-domains edit`,classification:{safeFlags:[`is-recent`,`is-regex`,`is-similarity`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/${e[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(e[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(e[`trusted-domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}):
|
|
138
|
+
Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`).positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal domain."}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:"The domain pattern to trust, e.g. `example.com`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a trusted domain.`})}const dr={command:`edit <trusted-domain-id>`,describe:`Update a trusted email domain`,builder:ur,handler:async e=>c({command:`email-security trusted-domains edit`,classification:{safeFlags:[`is-recent`,`is-regex`,`is-similarity`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/${e[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(e[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(e[`trusted-domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(J,{body:t,account_id:l,trusted_domain_id:e[`trusted-domain-id`]}));a(n,{successLabel:`Updated`});return}let p=d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}),m=await s(`Updating`,async()=>c.send(J,{body:p,account_id:l,trusted_domain_id:e[`trusted-domain-id`]}));a(m,{successLabel:`Updated`})})};var fr={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains/${t.trusted_domain_id}`};function pr(e){return e.usage(`$0 email-security trusted-domains get <trusted-domain-id>
|
|
139
139
|
|
|
140
140
|
Retrieves details for a specific trusted domain pattern including its pattern value, whether it uses regex matching, and which detection types it affects.`).positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mr={command:`get <trusted-domain-id>`,describe:`Get a trusted email domain`,builder:pr,handler:async e=>c({command:`email-security trusted-domains get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/${e[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(e[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(e[`trusted-domain-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(fr,{account_id:l,trusted_domain_id:e[`trusted-domain-id`]}));a(u,{successLabel:`Loaded`})})};var hr={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains`,query:[`page`,`per_page`,`search`,`order`,`direction`,`is_recent`,`is_similarity`,`pattern`]};function gr(e){return e.usage(`$0 email-security trusted-domains list
|
|
141
141
|
|
|
142
142
|
Returns a paginated list of trusted domain patterns. Trusted domains prevent false positives for recently registered domains and lookalike domain detections. Patterns can use regular expressions for flexible matching.`).option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`is-recent`,{type:`boolean`,description:`Filter to show only recently registered domains that are trusted to prevent triggering Suspicious or Malicious dispositions.`}).option(`is-similarity`,{type:`boolean`,description:`Filter to show only proximity domains (partner or approved domains with similar spelling to connected domains) that prevent Spoof dispositions.`}).option(`pattern`,{type:`string`,description:`Pattern`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _r={command:`list`,describe:`List trusted email domains`,builder:gr,handler:async e=>c({command:`email-security trusted-domains list`,classification:{safeFlags:[`order`,`direction`,`is-recent`,`is-similarity`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],search:e.search,order:e.order,direction:e.direction,is_recent:e[`is-recent`],is_similarity:e[`is-similarity`],pattern:e.pattern};if(e.dryRun){let e=await r();o({command:`cf email-security trusted-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(hr,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var Y={method:`PUT`,path:t=>e`/accounts/${t.account_id}/email-security/settings/trusted_domains/${t.trusted_domain_id}`,body:`json`};function X(e){return e.usage(`$0 email-security trusted-domains update <trusted-domain-id>
|
|
143
143
|
|
|
144
|
-
Replaces an existing trusted domain in full. Unlike PATCH, every field is taken from the request body, so optional fields that are omitted are reset rather than left untouched. Use this when managing trusted domains declaratively.`).positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal domain."}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:"The domain pattern to trust, e.g. `example.com`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a trusted domain.`})}const vr={command:`update <trusted-domain-id>`,describe:`Replace a trusted email domain`,builder:X,handler:async e=>c({command:`email-security trusted-domains update`,classification:{safeFlags:[`is-recent`,`is-regex`,`is-similarity`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/${e[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(e[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(e[`trusted-domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}):
|
|
144
|
+
Replaces an existing trusted domain in full. Unlike PATCH, every field is taken from the request body, so optional fields that are omitted are reset rather than left untouched. Use this when managing trusted domains declaratively.`).positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:"Whether `pattern` is a regular expression instead of a literal domain."}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:"The domain pattern to trust, e.g. `example.com`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a trusted domain.`})}const vr={command:`update <trusted-domain-id>`,describe:`Replace a trusted email domain`,builder:X,handler:async e=>c({command:`email-security trusted-domains update`,classification:{safeFlags:[`is-recent`,`is-regex`,`is-similarity`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security trusted-domains update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/trusted_domains/${e[`trusted-domain-id`]==null?`<trusted-domain-id>`:encodeURIComponent(String(e[`trusted-domain-id`]))}`,pathParams:{"trusted-domain-id":String(e[`trusted-domain-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(Y,{body:t,account_id:l,trusted_domain_id:e[`trusted-domain-id`]}));a(n,{successLabel:`Updated`});return}if(e[`is-recent`]===void 0)throw Error(`--is-recent is required (or pass --body with this field set).`);if(e[`is-regex`]===void 0)throw Error(`--is-regex is required (or pass --body with this field set).`);if(e[`is-similarity`]===void 0)throw Error(`--is-similarity is required (or pass --body with this field set).`);e.pattern===void 0&&(e.pattern=await p(`pattern`,"The domain pattern to trust, e.g. `example.com`."));let m=d({comments:f(e.comments,`comments`,`text`),is_recent:e[`is-recent`],is_regex:e[`is-regex`],is_similarity:e[`is-similarity`],pattern:f(e.pattern,`pattern`,`text`)}),h=await s(`Updating`,async()=>c.send(Y,{body:m,account_id:l,trusted_domain_id:e[`trusted-domain-id`]}));a(h,{successLabel:`Updated`})})},yr={command:`trusted-domains`,describe:`Operations for trusted-domains`,builder:e=>e.command(ir).command(or).command(lr).command(dr).command(mr).command(_r).command(vr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/url_ignore_patterns/batch`,body:`json`};function br(e){return e.usage(`$0 email-security url-ignore-patterns batch
|
|
145
145
|
|
|
146
|
-
Executes multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the URL ignore patterns to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the pattern's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`URL ignore patterns to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the pattern's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 xr={command:`batch`,describe:`Batch URL ignore pattern operations`,builder:br,handler:async e=>c({command:`email-security url-ignore-patterns batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:
|
|
147
|
-
`);return}if(e.body){let t=
|
|
146
|
+
Executes multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the URL ignore patterns to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the pattern's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`URL ignore patterns to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the pattern's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).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 xr={command:`batch`,describe:`Batch URL ignore pattern operations`,builder:br,handler:async e=>c({command:`email-security url-ignore-patterns batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may delete the selected URL rewrite ignore patterns and cause matching URLs to be rewritten again.`})){process.stderr.write(`Aborted.
|
|
147
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(Z,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(Z,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var Q={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/url_ignore_patterns`,body:`json`};function Sr(e){return e.usage(`$0 email-security url-ignore-patterns create
|
|
148
148
|
|
|
149
|
-
Creates a new URL rewrite ignore pattern. URLs matching this pattern will not be rewritten.`).option(`comments`,{type:`string`,description:`Optional note describing the reason for the ignore pattern.`}).option(`pattern`,{type:`string`,description:`Regular expression identifying URLs to exempt from rewriting.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Creates a URL ignore pattern that exempts matching URLs from rewriting.`})}const Cr={command:`create`,describe:`Create a URL ignore pattern`,builder:Sr,handler:async e=>c({command:`email-security url-ignore-patterns create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),pattern:f(e.pattern,`pattern`,`text`)}):
|
|
149
|
+
Creates a new URL rewrite ignore pattern. URLs matching this pattern will not be rewritten.`).option(`comments`,{type:`string`,description:`Optional note describing the reason for the ignore pattern.`}).option(`pattern`,{type:`string`,description:`Regular expression identifying URLs to exempt from rewriting.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Creates a URL ignore pattern that exempts matching URLs from rewriting.`})}const Cr={command:`create`,describe:`Create a URL ignore pattern`,builder:Sr,handler:async e=>c({command:`email-security url-ignore-patterns create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),pattern:f(e.pattern,`pattern`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(Q,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.pattern===void 0&&(e.pattern=await p(`pattern`,`Regular expression identifying URLs to exempt from rewriting.`));let m=d({comments:f(e.comments,`comments`,`text`),pattern:f(e.pattern,`pattern`,`text`)}),h=await s(`Creating`,async()=>c.send(Q,{body:m,account_id:l}));a(h,{successLabel:`Created`})})};var wr={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email-security/settings/url_ignore_patterns/${t.pattern_id}`};function Tr(e){return e.usage(`$0 email-security url-ignore-patterns delete <pattern-id>
|
|
150
150
|
|
|
151
151
|
Removes a URL rewrite ignore pattern. After deletion, URLs matching this pattern will be rewritten again.`).positional(`pattern-id`,{type:`string`,description:`URL ignore 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 Er={command:`delete <pattern-id>`,describe:`Delete a URL ignore pattern`,builder:Tr,handler:async e=>c({command:`email-security url-ignore-patterns delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the URL rewrite ignore pattern and causes matching URLs to be rewritten again.`})){process.stderr.write(`Aborted.
|
|
152
152
|
`);return}let u=await s(`Deleting`,async()=>c.send(wr,{account_id:l,pattern_id:e[`pattern-id`]}));a(u,{successLabel:`Deleted`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/email-security/settings/url_ignore_patterns/${t.pattern_id}`,body:`json`};function Dr(e){return e.usage(`$0 email-security url-ignore-patterns edit <pattern-id>
|
|
153
153
|
|
|
154
|
-
Updates an existing URL rewrite ignore pattern. Only provided fields will be modified.`).positional(`pattern-id`,{type:`string`,description:`URL ignore pattern identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`Optional note describing the reason for the ignore pattern.`}).option(`pattern`,{type:`string`,description:`Regular expression identifying URLs to exempt from rewriting.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates a URL rewrite ignore pattern; modifies only the provided fields.`})}const Or={command:`edit <pattern-id>`,describe:`Update a URL ignore pattern`,builder:Dr,handler:async e=>c({command:`email-security url-ignore-patterns edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),pattern:f(e.pattern,`pattern`,`text`)}):
|
|
154
|
+
Updates an existing URL rewrite ignore pattern. Only provided fields will be modified.`).positional(`pattern-id`,{type:`string`,description:`URL ignore pattern identifier.`,demandOption:!0}).option(`comments`,{type:`string`,description:`Optional note describing the reason for the ignore pattern.`}).option(`pattern`,{type:`string`,description:`Regular expression identifying URLs to exempt from rewriting.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates a URL rewrite ignore pattern; modifies only the provided fields.`})}const Or={command:`edit <pattern-id>`,describe:`Update a URL ignore pattern`,builder:Dr,handler:async e=>c({command:`email-security url-ignore-patterns edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({comments:f(e.comments,`comments`,`text`),pattern:f(e.pattern,`pattern`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send($,{body:t,account_id:l,pattern_id:e[`pattern-id`]}));a(n,{successLabel:`Updated`});return}let p=d({comments:f(e.comments,`comments`,`text`),pattern:f(e.pattern,`pattern`,`text`)}),m=await s(`Updating`,async()=>c.send($,{body:p,account_id:l,pattern_id:e[`pattern-id`]}));a(m,{successLabel:`Updated`})})};var kr={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/url_ignore_patterns/${t.pattern_id}`};function Ar(e){return e.usage(`$0 email-security url-ignore-patterns get <pattern-id>
|
|
155
155
|
|
|
156
156
|
Returns a single URL rewrite ignore pattern by its identifier.`).positional(`pattern-id`,{type:`string`,description:`URL ignore pattern identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jr={command:`get <pattern-id>`,describe:`Get a URL ignore pattern`,builder:Ar,handler:async e=>c({command:`email-security url-ignore-patterns get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security url-ignore-patterns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/url_ignore_patterns/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(kr,{account_id:l,pattern_id:e[`pattern-id`]}));a(u,{successLabel:`Loaded`})})};var Mr={method:`GET`,path:t=>e`/accounts/${t.account_id}/email-security/settings/url_ignore_patterns`,query:[`page`,`per_page`]};function Nr(e){return e.usage(`$0 email-security url-ignore-patterns list
|
|
157
157
|
|