cf 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +78 -41
- package/dist/_meta/commands.json +19888 -21071
- package/dist/_meta/schemas.json +14305 -15328
- package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
- package/dist/account-D8mYiWxQ.mjs +2 -0
- package/dist/accounts-CJci1Oez.mjs +23 -0
- package/dist/acm-CmCd985Q.mjs +3 -0
- package/dist/addressing-R7p6TRBe.mjs +12 -0
- package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
- package/dist/ai-BzJg0RIX.mjs +3 -0
- package/dist/ai-audit-B0vJNOZG.mjs +2 -0
- package/dist/ai-gateway-D3vJR3My.mjs +10 -0
- package/dist/ai-search-CNg7W7U4.mjs +7 -0
- package/dist/alerting-_sdM0B0S.mjs +6 -0
- package/dist/alerts-dpT6Qsdu.mjs +2 -0
- package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
- package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
- package/dist/api-gateway-D4AIEtUq.mjs +33 -0
- package/dist/argo-Bjk6nFfs.mjs +2 -0
- package/dist/artifacts-Ba4b3iOa.mjs +4 -0
- package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
- package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
- package/dist/auth-D_zyQbDR.mjs +5 -0
- package/dist/autorag-Cnpp8PAG.mjs +2 -0
- package/dist/billing-Dz6Zj8Eq.mjs +2 -0
- package/dist/bot-management-pFwIbFi-.mjs +5 -0
- package/dist/botnet-feed-BY9uGChY.mjs +3 -0
- package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
- package/dist/brands-CGpk9nZB.mjs +2 -0
- package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
- package/dist/browser-run-DhHtz4y3.mjs +4 -0
- package/dist/build-CWuStmDi.mjs +2 -0
- package/dist/cache-DVhkiIGK.mjs +5 -0
- package/dist/calls-95zjvIcO.mjs +4 -0
- package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
- package/dist/cf-BLT7uKJF.mjs +18 -0
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
- package/dist/clear-DXx8WBAN.mjs +2 -0
- package/dist/client-certificates-D6mE4vJu.mjs +3 -0
- package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
- package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
- package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
- package/dist/connectivity-DJkE3crz.mjs +3 -0
- package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
- package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
- package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
- package/dist/connectors-zWaZTi2A.mjs +3 -0
- package/dist/content-scanning-CGvGf04y.mjs +4 -0
- package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
- package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
- package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
- package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
- package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
- package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
- package/dist/d1-78Ym1P6D.mjs +4 -0
- package/dist/data-security-zmFoMwRU.mjs +6 -0
- package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
- package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
- package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
- package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
- package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
- package/dist/dist-B7hsuvbF.mjs +57 -0
- package/dist/dist-BH-4NQOV.mjs +134 -0
- package/dist/dns-D7VAaCyO.mjs +29 -0
- package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
- package/dist/domain-info-CRvKc2Lg.mjs +2 -0
- package/dist/durable-objects-BIpvyu9m.mjs +2 -0
- package/dist/email-auth-Cx--s8W4.mjs +2 -0
- package/dist/email-routing-CiDbivcN.mjs +10 -0
- package/dist/email-security-BYeAuSc6.mjs +12 -0
- package/dist/email-sending-Dg2rSmHH.mjs +4 -0
- package/dist/filters-DZ8YnQ90.mjs +4 -0
- package/dist/firewall-DEd1hs_I.mjs +11 -0
- package/dist/flagship-DVw7xGoP.mjs +4 -0
- package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
- package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
- package/dist/healthchecks-Da9N3ix4.mjs +4 -0
- package/dist/hostnames-mimZu2tB.mjs +3 -0
- package/dist/hyperdrive-BNdvxOos.mjs +21 -0
- package/dist/iam-DGQ-OgRl.mjs +6 -0
- package/dist/images-CI6Iy9ho.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BDB-aRtU.mjs +3 -0
- package/dist/internal-Czlp5Ekb.mjs +2 -0
- package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
- package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
- package/dist/kv-BHerx4dZ.mjs +5 -0
- package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
- package/dist/live-Ce7dZW7p.mjs +2 -0
- package/dist/load-balancers-DSjS5WKw.mjs +6 -0
- package/dist/logexplorer-DBIfTlRP.mjs +24 -0
- package/dist/logo-matches-C00iGpzW.mjs +2 -0
- package/dist/logos-CJLhx1go.mjs +3 -0
- package/dist/logpush-Cr1U-eK-.mjs +5 -0
- package/dist/logs-DMvtchc6.mjs +3 -0
- package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
- package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
- package/dist/magic-transit-DiKiPUax.mjs +110 -0
- package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
- package/dist/matches-B0yHbQ2I.mjs +2 -0
- package/dist/moq-UgBawOXe.mjs +13 -0
- package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
- package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
- package/dist/oauth-DBJ5GSFk.mjs +40 -0
- package/dist/observability-B-1y36QS.mjs +4 -0
- package/dist/organization-Dq3PClZ7.mjs +41 -0
- package/dist/organizations-AhsQkHyX.mjs +2 -0
- package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
- package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
- package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
- package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
- package/dist/pages-BsXF11Kv.mjs +11 -0
- package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
- package/dist/pipelines-D_QhSnGW.mjs +6 -0
- package/dist/progress-O88q63Bk.mjs +2 -0
- package/dist/prompt-DTAWiEm2.mjs +3 -0
- package/dist/queries-CAE95-OH.mjs +3 -0
- package/dist/queues-BBz35Mqd.mjs +6 -0
- package/dist/r2-Zp99S5xF.mjs +21 -0
- package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
- package/dist/radar-Cij-XVQJ.mjs +2 -0
- package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
- package/dist/rate-limits-DSdToIWv.mjs +5 -0
- package/dist/raw-fetch-DgezeshQ.mjs +2 -0
- package/dist/ready-DMpJvyaz.mjs +2 -0
- package/dist/realtime-kit-9rJcapfM.mjs +18 -0
- package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
- package/dist/refute-BGTpr5sy.mjs +2 -0
- package/dist/registrar-CXViZlah.mjs +83 -0
- package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
- package/dist/request-tracers-DATfBnE9.mjs +2 -0
- package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
- package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
- package/dist/resource-tagging-BTn05AOj.mjs +16 -0
- package/dist/rules-ens3OHme.mjs +4 -0
- package/dist/rulesets-bkreZRao.mjs +8 -0
- package/dist/rum-CpgXFcwl.mjs +4 -0
- package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
- package/dist/scan-page-BqoQTk3R.mjs +2 -0
- package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
- package/dist/schema-validation-Ca6o94ts.mjs +24 -0
- package/dist/scim-C4oT8TMc.mjs +4 -0
- package/dist/sdk-pQ5kaGUX.mjs +3 -0
- package/dist/search-C4T5riPh.mjs +2 -0
- package/dist/secrets-store-CWEuiDNo.mjs +7 -0
- package/dist/security-center-BOvm7xy6.mjs +2 -0
- package/dist/security-txt-BCAUBctN.mjs +3 -0
- package/dist/session-B1ARgLG7.mjs +2 -0
- package/dist/share-DhmVspmL.mjs +5 -0
- package/dist/shared-Bod3-Exx.mjs +990 -0
- package/dist/signed-url-DA509wgp.mjs +2 -0
- package/dist/smart-shield-DZm4fn6z.mjs +3 -0
- package/dist/snippets-oQ0u26-z.mjs +4 -0
- package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
- package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
- package/dist/speed-DqNnvLBD.mjs +4 -0
- package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
- package/dist/ssl-tS3CYZsZ.mjs +15 -0
- package/dist/state-OsdDJvdj.mjs +2 -0
- package/dist/stream-Bud9Os5V.mjs +14 -0
- package/dist/submission-info-DfIXmu-M.mjs +2 -0
- package/dist/submit-BtP8she2.mjs +2 -0
- package/dist/tenant-CMwHa-tU.mjs +2 -0
- package/dist/token-validation-BYC7HTok.mjs +10 -0
- package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
- package/dist/total-queries-DdLBNJzd.mjs +2 -0
- package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
- package/dist/turnstile-CP4nScaL.mjs +23 -0
- package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
- package/dist/url-info-Chs9h7Y-.mjs +2 -0
- package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
- package/dist/url-scanner-D4pYNlO-.mjs +2 -0
- package/dist/user-DtefniLc.mjs +11 -0
- package/dist/vectorize-BeAY2g-7.mjs +4 -0
- package/dist/verify-D7J3F_NZ.mjs +2 -0
- package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
- package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
- package/dist/web3-Dhw79l4S.mjs +4 -0
- package/dist/workers-builds-CuOAB3u4.mjs +7 -0
- package/dist/workers-l3zMNOU6.mjs +20 -0
- package/dist/workflows-rb7RYBKP.mjs +6 -0
- package/dist/zaraz-CHecMYuo.mjs +2 -0
- package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
- package/dist/zone-BnnqJwW-.mjs +2 -0
- package/dist/zones-DpI2YikF.mjs +21 -0
- package/package.json +3 -1
- package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
- package/dist/accounts-B_joQcMi.mjs +0 -22
- package/dist/acm-_kIHqYME.mjs +0 -3
- package/dist/addressing-CaFlw8y1.mjs +0 -12
- package/dist/ai-CqnhNb_c.mjs +0 -2
- package/dist/ai-gateway-pgYGI519.mjs +0 -8
- package/dist/ai-search-eqQMPQol.mjs +0 -7
- package/dist/ai_gateway--vuVLnOm.mjs +0 -4
- package/dist/alerting-CPxHiYHb.mjs +0 -6
- package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
- package/dist/api-gateway-BXXGFCVR.mjs +0 -33
- package/dist/argo-aC6A3JyX.mjs +0 -2
- package/dist/artifacts-HD4V2xpK.mjs +0 -4
- package/dist/auth-D5hNsOFq.mjs +0 -5
- package/dist/billing-COaghyxl.mjs +0 -2
- package/dist/bot-management-DmEzeV1Y.mjs +0 -5
- package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
- package/dist/brand-protection-dPrGe8sL.mjs +0 -3
- package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
- package/dist/build-HuS9-R0V.mjs +0 -1054
- package/dist/cache-CY-7Lt71.mjs +0 -5
- package/dist/calls-wOQGDWPl.mjs +0 -4
- package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
- package/dist/client-certificates-CRf41xLe.mjs +0 -3
- package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
- package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
- package/dist/config-B5k-XbwS.mjs +0 -2
- package/dist/connectivity-Bx3MgTHX.mjs +0 -3
- package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
- package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
- package/dist/connectors-DRt4e6d_.mjs +0 -3
- package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
- package/dist/context-jpewmual.mjs +0 -2
- package/dist/custom-certificates-DYE-9epx.mjs +0 -5
- package/dist/custom-hostnames-CtuTdFcX.mjs +0 -5
- package/dist/custom-nameservers-CWqA51in.mjs +0 -3
- package/dist/custom-pages-DeUKEFGe.mjs +0 -4
- package/dist/d1-DvWY9Gp4.mjs +0 -4
- package/dist/data-security-BPo6dIWu.mjs +0 -6
- package/dist/diagnostics-6nKPmVgz.mjs +0 -3
- package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
- package/dist/dist-C6zxsVdY.mjs +0 -306
- package/dist/dist-t_YrL25p.mjs +0 -82
- package/dist/dns-ClciFGxx.mjs +0 -29
- package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
- package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
- package/dist/email-routing-CGXhFqF5.mjs +0 -10
- package/dist/email-security-D5viPq8S.mjs +0 -8
- package/dist/email-sending-C2jpc3gh.mjs +0 -3
- package/dist/filters-bzsFcWt0.mjs +0 -4
- package/dist/firewall-DYZcTtIC.mjs +0 -11
- package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
- package/dist/healthchecks-DRoAlWgr.mjs +0 -4
- package/dist/hostnames-CFgIVI3s.mjs +0 -3
- package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
- package/dist/iam-DqVPzGrb.mjs +0 -6
- package/dist/images-BYfl4YgR.mjs +0 -7
- package/dist/intel-duTEPIHc.mjs +0 -3
- package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
- package/dist/kv-CZoV4tiv.mjs +0 -5
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
- package/dist/load-balancers--OMg0HNt.mjs +0 -6
- package/dist/logpush-C0_lZTyY.mjs +0 -4
- package/dist/logs-BtpWZQfV.mjs +0 -3
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
- package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
- package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
- package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
- package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
- package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
- package/dist/oauth-Bk-F-tIO.mjs +0 -52
- package/dist/observability-BynRbTF4.mjs +0 -4
- package/dist/organizations-BqJHyvMK.mjs +0 -41
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
- package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
- package/dist/pages-D4aYteKk.mjs +0 -11
- package/dist/pipelines-G8Iusxq-.mjs +0 -6
- package/dist/progress-DrDErV9w.mjs +0 -2
- package/dist/queues-DEkbKqZX.mjs +0 -6
- package/dist/r2-CV0IkCAW.mjs +0 -21
- package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
- package/dist/radar-D986zPJr.mjs +0 -2
- package/dist/rate-limits-B2wRsUX1.mjs +0 -5
- package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
- package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
- package/dist/registrar-CDIwTz3G.mjs +0 -46
- package/dist/request-tracers-D7SFMDik.mjs +0 -2
- package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
- package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
- package/dist/rules-DHjLP5Kx.mjs +0 -4
- package/dist/rulesets-q4QABpKs.mjs +0 -8
- package/dist/rum-SmT4HZmM.mjs +0 -4
- package/dist/schema-validation-vVetgC_P.mjs +0 -24
- package/dist/scim-ChOkZpNx.mjs +0 -3
- package/dist/sdk-DhIhH6GB.mjs +0 -5
- package/dist/secrets-store-BAK9G12O.mjs +0 -25
- package/dist/security-center-eScuYDKP.mjs +0 -2
- package/dist/security-txt-x7R4gmQu.mjs +0 -3
- package/dist/session-DHYCE-PM.mjs +0 -93
- package/dist/shared-BAjo72Lz.mjs +0 -2
- package/dist/smart-shield-CWlSsNi8.mjs +0 -3
- package/dist/snippets-DrlgYJYp.mjs +0 -4
- package/dist/speed-ZFrMWDgd.mjs +0 -4
- package/dist/ssl-9JY05sYt.mjs +0 -15
- package/dist/stream-tRU39b8K.mjs +0 -14
- package/dist/tenants-HLGUazms.mjs +0 -2
- package/dist/token-validation-_VdamKpz.mjs +0 -10
- package/dist/turnstile-BRzXd28B.mjs +0 -23
- package/dist/url-normalization-D-NxuLtN.mjs +0 -3
- package/dist/url-scanner-BzzR6iDx.mjs +0 -2
- package/dist/user-C4omq__w.mjs +0 -10
- package/dist/vectorize-By6EqcNR.mjs +0 -4
- package/dist/waiting-rooms-u6KwrzWd.mjs +0 -11
- package/dist/web3-DQ5dmE9W.mjs +0 -4
- package/dist/workers-D8Be7_as.mjs +0 -18
- package/dist/workers-builds-BE3W3qNk.mjs +0 -7
- package/dist/workflows-BWWufqFA.mjs +0 -4
- package/dist/zaraz-Bsa9AvVL.mjs +0 -2
- package/dist/zero-trust-UNVZFnKu.mjs +0 -118
- package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
- package/dist/zones-BXtdwt6E.mjs +0 -21
- /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
- /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
- /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
- /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
- /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
- /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
- /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{S as e,g as t,w as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{t as d}from"./cli-types-BeyOc81z.mjs";function f(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`time-delta`,{type:`string`,description:`Unit of time to group data by.`,choices:[`all`,`auto`,`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <dns-firewall-id>`,describe:`Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:d(f),handler:async n=>{let i={metrics:n.metrics,dimensions:n.dimensions,since:n.since,until:n.until,limit:n.limit,sort:n.sort,filters:n.filters,time_delta:n[`time-delta`]};if(n.dryRun){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${n[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(n[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(n[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await t(a);n.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get({account_id:l,dns_firewall_id:n[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},m={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <dns-firewall-id>`,describe:`Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:h,handler:async n=>{let i={metrics:n.metrics,dimensions:n.dimensions,since:n.since,until:n.until,limit:n.limit,sort:n.sort,filters:n.filters};if(n.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${n[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(n[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(n[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await t(a);n.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get({account_id:l,dns_firewall_id:n[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},_={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(g).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
|
|
3
|
-
indicated by the TTL received from upstream nameservers. This setting
|
|
4
|
-
sets an upper bound on this duration. For caching purposes, higher TTLs
|
|
5
|
-
will be decreased to the maximum value defined by this setting.
|
|
6
|
-
|
|
7
|
-
This setting does not affect the TTL value in the DNS response
|
|
8
|
-
Cloudflare returns to clients. Cloudflare will always forward the TTL
|
|
9
|
-
value received from upstream nameservers.
|
|
10
|
-
`,default:900}).option(`minimum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
|
|
11
|
-
indicated by the TTL received from upstream nameservers. This setting
|
|
12
|
-
sets a lower bound on this duration. For caching purposes, lower TTLs
|
|
13
|
-
will be increased to the minimum value defined by this setting.
|
|
14
|
-
|
|
15
|
-
This setting does not affect the TTL value in the DNS response
|
|
16
|
-
Cloudflare returns to clients. Cloudflare will always forward the TTL
|
|
17
|
-
value received from upstream nameservers.
|
|
18
|
-
|
|
19
|
-
Note that, even with this setting, there is no guarantee that a
|
|
20
|
-
response will be cached for at least the specified duration. Cached
|
|
21
|
-
responses may be removed earlier for capacity or other operational
|
|
22
|
-
reasons.
|
|
23
|
-
`,default:60}).option(`name`,{type:`string`,description:`DNS Firewall cluster name`}).option(`negative-cache-ttl`,{type:`number`,description:`This setting controls how long DNS Firewall should cache negative
|
|
24
|
-
responses (e.g., NXDOMAIN) from the upstream servers.
|
|
25
|
-
|
|
26
|
-
This setting does not affect the TTL value in the DNS response
|
|
27
|
-
Cloudflare returns to clients. Cloudflare will always forward the TTL
|
|
28
|
-
value received from upstream nameservers.
|
|
29
|
-
`}).option(`ratelimit`,{type:`number`,description:`Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.`}).option(`retries`,{type:`number`,description:`Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)`,default:2}).option(`upstream-ips`,{type:`string`,array:!0,description:`The upstream_ips field`}).option(`dns-firewall-ip-count`,{type:`number`,description:`Number of IPv4 addresses to assign to the DNS Firewall cluster. Only used during cluster creation and cannot be changed later.`,default:2}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Create a DNS Firewall cluster`,builder:y,handler:async n=>{if(n.dryRun){s({command:`cf dns-firewall create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({attack_mitigation:{enabled:n[`attack-mitigation-enabled`],only_when_upstream_unhealthy:n[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:n[`deprecate-any-requests`],ecs_fallback:n[`ecs-fallback`],maximum_cache_ttl:n[`maximum-cache-ttl`],minimum_cache_ttl:n[`minimum-cache-ttl`],name:l(n.name,`name`,`text`),negative_cache_ttl:n[`negative-cache-ttl`],ratelimit:n.ratelimit,retries:n.retries,upstream_ips:n[`upstream-ips`],dns_firewall_ip_count:n[`dns-firewall-ip-count`]}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.dnsFirewall.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({attack_mitigation:{enabled:n[`attack-mitigation-enabled`],only_when_upstream_unhealthy:n[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:n[`deprecate-any-requests`],ecs_fallback:n[`ecs-fallback`],maximum_cache_ttl:n[`maximum-cache-ttl`],minimum_cache_ttl:n[`minimum-cache-ttl`],name:l(n.name,`name`,`text`),negative_cache_ttl:n[`negative-cache-ttl`],ratelimit:n.ratelimit,retries:n.retries,upstream_ips:n[`upstream-ips`],dns_firewall_ip_count:n[`dns-firewall-ip-count`]});o(await c(`Creating`,async()=>d.dnsFirewall.create({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <dns-firewall-id>`,describe:`Delete a DNS Firewall cluster`,builder:x,handler:async i=>{if(i.dryRun){s({command:`cf dns-firewall delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${i[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(i[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(i[`dns-firewall-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await t(a);if(i.accountId=l,!await n({force:!!i.force})){process.stderr.write(`Aborted.
|
|
30
|
-
`);return}o(await c(`Deleting`,async()=>a.dnsFirewall.delete({account_id:l,dns_firewall_id:i[`dns-firewall-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
|
|
31
|
-
indicated by the TTL received from upstream nameservers. This setting
|
|
32
|
-
sets an upper bound on this duration. For caching purposes, higher TTLs
|
|
33
|
-
will be decreased to the maximum value defined by this setting.
|
|
34
|
-
|
|
35
|
-
This setting does not affect the TTL value in the DNS response
|
|
36
|
-
Cloudflare returns to clients. Cloudflare will always forward the TTL
|
|
37
|
-
value received from upstream nameservers.
|
|
38
|
-
`}).option(`minimum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
|
|
39
|
-
indicated by the TTL received from upstream nameservers. This setting
|
|
40
|
-
sets a lower bound on this duration. For caching purposes, lower TTLs
|
|
41
|
-
will be increased to the minimum value defined by this setting.
|
|
42
|
-
|
|
43
|
-
This setting does not affect the TTL value in the DNS response
|
|
44
|
-
Cloudflare returns to clients. Cloudflare will always forward the TTL
|
|
45
|
-
value received from upstream nameservers.
|
|
46
|
-
|
|
47
|
-
Note that, even with this setting, there is no guarantee that a
|
|
48
|
-
response will be cached for at least the specified duration. Cached
|
|
49
|
-
responses may be removed earlier for capacity or other operational
|
|
50
|
-
reasons.
|
|
51
|
-
`}).option(`name`,{type:`string`,description:`DNS Firewall cluster name`}).option(`negative-cache-ttl`,{type:`number`,description:`This setting controls how long DNS Firewall should cache negative
|
|
52
|
-
responses (e.g., NXDOMAIN) from the upstream servers.
|
|
53
|
-
|
|
54
|
-
This setting does not affect the TTL value in the DNS response
|
|
55
|
-
Cloudflare returns to clients. Cloudflare will always forward the TTL
|
|
56
|
-
value received from upstream nameservers.
|
|
57
|
-
`}).option(`ratelimit`,{type:`number`,description:`Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.`}).option(`retries`,{type:`number`,description:`Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)`}).option(`upstream-ips`,{type:`string`,array:!0,description:`The upstream_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <dns-firewall-id>`,describe:`Modify the configuration of a DNS Firewall cluster`,builder:C,handler:async n=>{if(n.dryRun){s({command:`cf dns-firewall edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${n[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(n[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(n[`dns-firewall-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({attack_mitigation:{enabled:n[`attack-mitigation-enabled`],only_when_upstream_unhealthy:n[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:n[`deprecate-any-requests`],ecs_fallback:n[`ecs-fallback`],maximum_cache_ttl:n[`maximum-cache-ttl`],minimum_cache_ttl:n[`minimum-cache-ttl`],name:l(n.name,`name`,`text`),negative_cache_ttl:n[`negative-cache-ttl`],ratelimit:n.ratelimit,retries:n.retries,upstream_ips:n[`upstream-ips`]}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.dnsFirewall.edit({...e,account_id:f,dns_firewall_id:n[`dns-firewall-id`]})),{successLabel:`Updated`});return}let p=a({attack_mitigation:{enabled:n[`attack-mitigation-enabled`],only_when_upstream_unhealthy:n[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:n[`deprecate-any-requests`],ecs_fallback:n[`ecs-fallback`],maximum_cache_ttl:n[`maximum-cache-ttl`],minimum_cache_ttl:n[`minimum-cache-ttl`],name:l(n.name,`name`,`text`),negative_cache_ttl:n[`negative-cache-ttl`],ratelimit:n.ratelimit,retries:n.retries,upstream_ips:n[`upstream-ips`]});o(await c(`Updating`,async()=>d.dnsFirewall.edit({...p,account_id:f,dns_firewall_id:n[`dns-firewall-id`]})),{successLabel:`Updated`})}};function T(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <dns-firewall-id>`,describe:`Show a single DNS Firewall cluster for an account`,builder:T,handler:async n=>{if(n.dryRun){s({command:`cf dns-firewall get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${n[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(n[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(n[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.get({account_id:a,dns_firewall_id:n[`dns-firewall-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results`}).option(`per-page`,{type:`number`,description:`Number of clusters per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List DNS Firewall clusters for an account`,builder:D,handler:async n=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf dns-firewall list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?u:await t(a);n.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.list({account_id:l,...i})),{successLabel:`Loaded`})}};function k(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <dns-firewall-id>`,describe:`Update reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:k,handler:async n=>{if(n.dryRun){s({command:`cf dns-firewall reverse-dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${n[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(n[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(n[`dns-firewall-id`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:i(n.body)});return}let a=await r(n),l=n.local?u:await t(a);if(n.accountId=l,n.body){let e=i(n.body);o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({...e,account_id:l,dns_firewall_id:n[`dns-firewall-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({account_id:l,dns_firewall_id:n[`dns-firewall-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <dns-firewall-id>`,describe:`Show reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:j,handler:async n=>{if(n.dryRun){s({command:`cf dns-firewall reverse-dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${n[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(n[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(n[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.reverseDns.get({account_id:a,dns_firewall_id:n[`dns-firewall-id`]})),{successLabel:`Loaded`})}},N={command:`reverse-dns`,describe:`Operations for reverse-dns`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`dns-firewall`,describe:`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(v).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{S as e,g as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-DrDErV9w.mjs";import{t as o}from"./local-CYc9q7l2.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,g as r,w as i,x as a}from"./oauth-Bk-F-tIO.mjs";import{n as o}from"./auth-CSC4yhEJ.mjs";import{n as s,t as c}from"./body-parser-DWSy7uZ8.mjs";import{t as l}from"./output-B6fBFRqe.mjs";import{n as u,t as d}from"./progress-DrDErV9w.mjs";import{n as f}from"./input-validation-_fMCApaH.mjs";import{t as p}from"./local-CYc9q7l2.mjs";import{t as m}from"./cli-types-BeyOc81z.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async n=>{if(n.dryRun){u({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({email:f(n.email,`email`,`text`)}):s(n.body)});return}let i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>i.emailRouting.addresses.create({...e,account_id:a})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await e(`email`,`The contact email address of the user.`));let m=c({email:f(n.email,`email`,`text`)});l(await d(`Creating`,async()=>i.emailRouting.addresses.create({...m,account_id:a})),{successLabel:`Created`})}};function h(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:h,handler:async e=>{if(e.dryRun){u({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}l(await d(`Deleting`,async()=>n.emailRouting.addresses.delete({account_id:a,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:_,handler:async e=>{if(e.dryRun){u({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailRouting.addresses.get({account_id:i,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists existing destination addresses.`,builder:m(y),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],direction:e.direction,verified:e.verified};if(e.dryRun){u({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailRouting.addresses.list({account_id:a,...n})),{successLabel:`Loaded`})}};function x(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:x,handler:async e=>{if(e.dryRun){u({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({status:f(e.status,`status`,`text`)}):s(e.body)});return}let i=await o(e),a=e.local?p:await r(i);if(e.accountId=a,e.body){let t=s(e.body);l(await d(`Updating`,async()=>i.emailRouting.addresses.update({...t,account_id:a,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Updated`});return}e.status===void 0&&(e.status=await n(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=c({status:f(e.status,`status`,`text`)});l(await d(`Updating`,async()=>i.emailRouting.addresses.update({...m,account_id:a,destination_address_identifier:e[`destination-address-identifier`]})),{successLabel:`Updated`})}},C={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(te).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:w,handler:async e=>{if(e.dryRun){u({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}l(await d(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{successLabel:`Deleted`})}};function E(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:E,handler:async e=>{if(e.dryRun){u({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let r=c({name:f(e.name,`name`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`})}};function O(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:O,handler:async e=>{if(e.dryRun){u({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(e.body){let r=s(e.body);l(await d(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let r=c({name:f(e.name,`name`,`text`)});l(await d(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`})}};function A(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:A,handler:async e=>{if(e.dryRun){u({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let r=c({name:f(e.name,`name`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`})}};function M(e){return e.option(`subdomain`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:M,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){u({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),r=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.emailRouting.dns.get({zone_id:r,...t})),{successLabel:`Loaded`})}},P={command:`dns`,describe:`Operations for dns`,builder:e=>e.command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:F,handler:async e=>{if(e.dryRun){u({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let r=c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});l(await d(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:L,handler:async e=>{if(e.dryRun){u({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:z,handler:async e=>{if(e.dryRun){u({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:V,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{successLabel:`Loaded`})}};function U(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to specific destination address. Forward actions require all destination addresses to be verified.`,builder:U,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}let r=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:f(e.source,`source`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`})}},G={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require all destination addresses to be verified.`,builder:K,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let r=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`})}};function J(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:J,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}l(await d(`Deleting`,async()=>t.emailRouting.rules.delete({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Deleted`})}};function X(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <rule-identifier>`,describe:`Get information for a specific routing rule already created.`,builder:X,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.rules.get({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Loaded`})}};function Q(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list-account`,describe:`Lists existing routing rules across all zones in the account.`,builder:m(Q),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],enabled:e.enabled};if(e.dryRun){u({command:`cf email-routing rules list-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/rules`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailRouting.rules.listAccount({account_id:a,...n})),{successLabel:`Loaded`})}};function re(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Lists existing routing rules.`,builder:m(re),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],enabled:e.enabled};if(e.dryRun){u({command:`cf email-routing rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),r=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.emailRouting.rules.list({zone_id:r,...t})),{successLabel:`Loaded`})}};function ae(e){return e.option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`plan`,describe:`Computes the Email Routing rule changes that would be needed to reconcile a Wrangler-managed desired ruleset. This endpoint is read-only and does not create, update, or delete rules.`,builder:ae,handler:async n=>{if(n.dryRun){u({command:`cf email-routing rules plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/rules/plan`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({owner_worker_tag:f(n[`owner-worker-tag`],`owner-worker-tag`,`text`)}):s(n.body)});return}let i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>i.emailRouting.rules.plan({...e,account_id:a})),{successLabel:`Created`});return}n[`owner-worker-tag`]===void 0&&(n[`owner-worker-tag`]=await e(`owner-worker-tag`,"Public tag (script_tag) of the Worker that owns this rule. Required when `source` is `wrangler`. "));let m=c({owner_worker_tag:f(n[`owner-worker-tag`],`owner-worker-tag`,`text`)});l(await d(`Creating`,async()=>i.emailRouting.rules.plan({...m,account_id:a})),{successLabel:`Created`})}};function se(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`update <rule-identifier>`,describe:`Update actions and matches, or enable/disable specific routing rules. Forward actions require all destination addresses to be verified.`,builder:se,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.rules.update({...r,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`});return}let r=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.rules.update({...r,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`})}},le={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(q).command(Y).command(Z).command(ie).command(ne).command(oe).command(ce).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`create`,describe:`Creates a new email suppression for the specified account.`,builder:ue,handler:async n=>{if(n.dryRun){u({command:`cf email-routing suppression routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/suppression`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({email:f(n.email,`email`,`text`),expires_at:f(n[`expires-at`],`expires-at`,`text`)}):s(n.body)});return}let i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>i.emailRouting.suppression.routing.create({...e,account_id:a})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await e(`email`,`The email field`));let m=c({email:f(n.email,`email`,`text`),expires_at:f(n[`expires-at`],`expires-at`,`text`)});l(await d(`Creating`,async()=>i.emailRouting.suppression.routing.create({...m,account_id:a})),{successLabel:`Created`})}};function fe(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const pe={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified account.`,builder:fe,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}l(await d(`Deleting`,async()=>n.emailRouting.suppression.routing.delete({account_id:a,suppression_id:e[`suppression-id`]})),{successLabel:`Deleted`})}};function me(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified account.`,builder:me,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailRouting.suppression.routing.get({account_id:i,suppression_id:e[`suppression-id`]})),{successLabel:`Loaded`})}};function ge(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Lists email suppressions for the specified account.`,builder:m(ge),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){u({command:`cf email-routing suppression routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/routing/suppression`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailRouting.suppression.routing.list({account_id:a,...n})),{successLabel:`Loaded`})}},ve={command:`routing`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(de).command(pe).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`create`,describe:`Creates a new email suppression for the specified account.`,builder:ye,handler:async n=>{if(n.dryRun){u({command:`cf email-routing suppression sending create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/suppression`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({email:f(n.email,`email`,`text`),expires_at:f(n[`expires-at`],`expires-at`,`text`)}):s(n.body)});return}let i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>i.emailRouting.suppression.sending.create({...e,account_id:a})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await e(`email`,`The email field`));let m=c({email:f(n.email,`email`,`text`),expires_at:f(n[`expires-at`],`expires-at`,`text`)});l(await d(`Creating`,async()=>i.emailRouting.suppression.sending.create({...m,account_id:a})),{successLabel:`Created`})}};function xe(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Se={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified account.`,builder:xe,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}l(await d(`Deleting`,async()=>n.emailRouting.suppression.sending.delete({account_id:a,suppression_id:e[`suppression-id`]})),{successLabel:`Deleted`})}};function Ce(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified account.`,builder:Ce,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailRouting.suppression.sending.get({account_id:i,suppression_id:e[`suppression-id`]})),{successLabel:`Loaded`})}};function Te(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`list`,describe:`Lists email suppressions for the specified account.`,builder:m(Te),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){u({command:`cf email-routing suppression sending list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/suppression`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailRouting.suppression.sending.list({account_id:a,...n})),{successLabel:`Loaded`})}},De={command:`sending`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(be).command(Se).command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ke={command:`create`,describe:`Creates a new email suppression for the specified zone.`,builder:Oe,handler:async t=>{if(t.dryRun){u({command:`cf email-routing suppression zone routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/suppression`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({email:f(t.email,`email`,`text`),expires_at:f(t[`expires-at`],`expires-at`,`text`)}):s(t.body)});return}let n=await o(t),r=await a({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.routing.create({...e,zone_id:r})),{successLabel:`Created`});return}t.email===void 0&&(t.email=await e(`email`,`The email field`));let i=c({email:f(t.email,`email`,`text`),expires_at:f(t[`expires-at`],`expires-at`,`text`)});l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.routing.create({...i,zone_id:r})),{successLabel:`Created`})}};function Ae(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const je={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified zone.`,builder:Ae,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression zone routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}l(await d(`Deleting`,async()=>t.emailRouting.suppression.zone.routing.delete({zone_id:n,suppression_id:e[`suppression-id`]})),{successLabel:`Deleted`})}};function Me(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified zone.`,builder:Me,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression zone routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.suppression.zone.routing.get({zone_id:n,suppression_id:e[`suppression-id`]})),{successLabel:`Loaded`})}};function Pe(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`list`,describe:`Lists email suppressions for the specified zone.`,builder:m(Pe),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){u({command:`cf email-routing suppression zone routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/suppression`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),r=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.emailRouting.suppression.zone.routing.list({zone_id:r,...t})),{successLabel:`Loaded`})}},Ie={command:`routing`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(ke).command(je).command(Ne).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`email`,{type:`string`,description:`The email field`}).option(`expires-at`,{type:`string`,description:`The expires_at field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Re={command:`create`,describe:`Creates a new email suppression for the specified zone.`,builder:Le,handler:async t=>{if(t.dryRun){u({command:`cf email-routing suppression zone sending create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/suppression`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({email:f(t.email,`email`,`text`),expires_at:f(t[`expires-at`],`expires-at`,`text`)}):s(t.body)});return}let n=await o(t),r=await a({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.sending.create({...e,zone_id:r})),{successLabel:`Created`});return}t.email===void 0&&(t.email=await e(`email`,`The email field`));let i=c({email:f(t.email,`email`,`text`),expires_at:f(t[`expires-at`],`expires-at`,`text`)});l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.sending.create({...i,zone_id:r})),{successLabel:`Created`})}};function ze(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Be={command:`delete <suppression-id>`,describe:`Deletes an email suppression for the specified zone.`,builder:ze,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression zone sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
10
|
-
`);return}l(await d(`Deleting`,async()=>t.emailRouting.suppression.zone.sending.delete({zone_id:n,suppression_id:e[`suppression-id`]})),{successLabel:`Deleted`})}};function Ve(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified zone.`,builder:Ve,handler:async e=>{if(e.dryRun){u({command:`cf email-routing suppression zone sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.suppression.zone.sending.get({zone_id:n,suppression_id:e[`suppression-id`]})),{successLabel:`Loaded`})}};function He(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order`,{type:`string`,description:`Order`,choices:[`email`,`expires_at`,`created_at`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`list`,describe:`Lists email suppressions for the specified zone.`,builder:m(He),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){u({command:`cf email-routing suppression zone sending list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/suppression`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),r=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.emailRouting.suppression.zone.sending.list({zone_id:r,...t})),{successLabel:`Loaded`})}},We={command:`sending`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(Re).command(Be).command($).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ge={command:`zone`,describe:`Operations for suppression.zone`,builder:e=>e.command(Ie).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ke={command:`suppression`,describe:`Operations for suppression`,builder:e=>e.command(ve).command(De).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Je={command:`unlock`,describe:`Unlock MX records previously locked by Email Routing. Deprecated - use PATCH /zones/{zone_id}/email/routing/dns instead.`,builder:qe,handler:async e=>{if(e.dryRun){u({command:`cf email-routing unlock`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/unlock`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.unlock({body:r,zone_id:n})),{successLabel:`Created`});return}let r=c({name:f(e.name,`name`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.unlock({body:r,zone_id:n})),{successLabel:`Created`})}};function Ye(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xe={command:`update`,describe:`Update the settings for your Email Routing zone.`,builder:Ye,handler:async e=>{if(e.dryRun){u({command:`cf email-routing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):s(e.body)});return}let t=await o(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.update({...r,zone_id:n})),{successLabel:`Updated`});return}let r=c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});l(await d(`Updating`,async()=>t.emailRouting.update({...r,zone_id:n})),{successLabel:`Updated`})}},Ze={command:`email-routing`,describe:`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,builder:e=>e.command(T).command(I).command(R).command(B).command(Je).command(Xe).command(C).command(P).command(le).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ze as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{i as a,n as o}from"./auth-CSC4yhEJ.mjs";import{n as s,t as c}from"./body-parser-DWSy7uZ8.mjs";import{t as l}from"./output-B6fBFRqe.mjs";import{n as u,t as d}from"./progress-DrDErV9w.mjs";import{n as f}from"./input-validation-_fMCApaH.mjs";import{t as p}from"./local-CYc9q7l2.mjs";import{t as m}from"./cli-types-BeyOc81z.mjs";function ee(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get <investigate-id>`,describe:`Returns detection details such as threat categories and sender information for non-benign messages.`,builder:ee,handler:async e=>{if(e.dryRun){u({command:`cf email-security investigate detections 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`]))}/detections`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.investigate.detections.get({account_id:i,investigate_id:e[`investigate-id`]})),{successLabel:`Loaded`})}},h={command:`detections`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`log <investigate-id>`,describe:`Returns the list of post-delivery actions (moves, quarantine releases, previews, etc.) that have been applied to a specific email message.`,builder:g,handler:async e=>{if(e.dryRun){u({command:`cf email-security investigate get-action log`,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`]))}/action_log`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.investigate.getAction.log({account_id:i,investigate_id:e[`investigate-id`]})),{successLabel:`Loaded`})}},v={command:`get-action`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`submission`,{type:`boolean`,description:`When true, search the submissions datastore only. When false or omitted, search the
|
|
3
|
-
regular datastore only.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <investigate-id>`,describe:`Retrieves comprehensive details for a specific email message including headers, recipients, sender information, and current quarantine status. Use the investigate_id from search results to fetch detailed information.`,builder:y,handler:async e=>{let n={submission:e.submission};if(e.dryRun){u({command:`cf email-security investigate 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`]))}`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.investigate.get({account_id:a,investigate_id:e[`investigate-id`],...n})),{successLabel:`Loaded`})}};function x(e){return e.option(`start`,{type:`string`,description:"The beginning of the search date range. Defaults to `now - 30 days`. Must not be in the future."}).option(`end`,{type:`string`,description:"The end of the search date range. Defaults to `now`."}).option(`query`,{type:`string`,description:`Space-delimited search term. Case-insensitive.`}).option(`detections-only`,{type:`boolean`,description:`Whether to include only detections in search results.`}).option(`final-disposition`,{type:`string`,description:`Dispositions to filter by.`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`metric`,{type:`string`,description:`Metric`}).option(`message-action`,{type:`string`,description:`Message actions to filter by.`,choices:[`PREVIEW`,`QUARANTINE_RELEASED`,`MOVED`]}).option(`recipient`,{type:`string`,description:`Recipient`}).option(`sender`,{type:`string`,description:`Sender`}).option(`alert-id`,{type:`string`,description:`Alert ID`}).option(`domain`,{type:`string`,description:`Sender domains to filter by.`}).option(`message-id`,{type:`string`,description:`Message ID`}).option(`subject`,{type:`string`,description:`Subject`}).option(`delivery-status`,{type:`string`,description:`Delivery status to filter by.`,choices:[`delivered`,`moved`,`quarantined`,`rejected`,`deferred`,`bounced`,`queued`]}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`page`,{type:`number`,description:`Deprecated: Use cursor pagination instead. End of life: November 1, 2026.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Returns information for each email that matches the search parameter(s).`,builder:m(x),handler:async e=>{let n={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,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){u({command:`cf email-security investigate list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.investigate.list({account_id:a,...n})),{successLabel:`Loaded`})}};function C(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`destination`,{type:`string`,description:`The destination field`,choices:[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]}).option(`expected-disposition`,{type:`string`,description:`The expected_disposition field`,choices:[`MALICIOUS`,`MALICIOUS-BEC`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`ENCRYPTED`,`EXTERNAL`,`UNKNOWN`,`NONE`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create <investigate-id>`,describe:`Moves a single message to a specified mailbox folder (Inbox, JunkEmail, DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires active integration.`,builder:C,handler:async e=>{if(e.dryRun){u({command:`cf email-security investigate move create`,method:`POST`,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`]))}/move`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({destination:f(e.destination,`destination`,`text`),expected_disposition:f(e[`expected-disposition`],`expected-disposition`,`text`)}):s(e.body)});return}let i=await o(e),a=e.local?p:await r(i);if(e.accountId=a,e.body){let t=s(e.body);l(await d(`Creating`,async()=>i.emailSecurity.investigate.move.create({...t,account_id:a,investigate_id:e[`investigate-id`]})),{successLabel:`Created`});return}e.destination===void 0&&(e.destination=await n(`destination`,`The destination field`,[`Inbox`,`JunkEmail`,`DeletedItems`,`RecoverableItemsDeletions`,`RecoverableItemsPurges`]));let m=c({destination:f(e.destination,`destination`,`text`),expected_disposition:f(e[`expected-disposition`],`expected-disposition`,`text`)});l(await d(`Creating`,async()=>i.emailSecurity.investigate.move.create({...m,account_id:a,investigate_id:e[`investigate-id`]})),{successLabel:`Created`})}},T={command:`move`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`postfix-id`,{type:`string`,description:`The identifier of the message`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Generates a preview image for a message that was not flagged as a detection. Useful for investigating benign messages. Returns a base64-encoded PNG screenshot of the email body.`,builder:E,handler:async n=>{if(n.dryRun){u({command:`cf email-security investigate preview create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/preview`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({postfix_id:f(n[`postfix-id`],`postfix-id`,`text`)}):s(n.body)});return}let i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>i.emailSecurity.investigate.preview.create({...e,account_id:a})),{successLabel:`Created`});return}n[`postfix-id`]===void 0&&(n[`postfix-id`]=await e(`postfix-id`,`The identifier of the message`));let m=c({postfix_id:f(n[`postfix-id`],`postfix-id`,`text`)});l(await d(`Creating`,async()=>i.emailSecurity.investigate.preview.create({...m,account_id:a})),{successLabel:`Created`})}};function O(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <investigate-id>`,describe:`Returns a preview of the message body as a base64 encoded PNG image for non-benign messages.`,builder:O,handler:async e=>{if(e.dryRun){u({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 n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.investigate.preview.get({account_id:i,investigate_id:e[`investigate-id`]})),{successLabel:`Loaded`})}},A={command:`preview`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <investigate-id>`,describe:`Returns the raw eml of any non-benign message.`,builder:j,handler:async e=>{if(e.dryRun){u({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 n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.investigate.raw.get({account_id:i,investigate_id:e[`investigate-id`]})),{successLabel:`Loaded`})}},N={command:`raw`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`eml-content`,{type:`string`,description:`Base64 encoded content of the EML file.`}).option(`escalated-submission-id`,{type:`string`,description:`The escalated_submission_id field`}).option(`expected-disposition`,{type:`string`,description:`The expected_disposition field`,choices:[`NONE`,`BULK`,`MALICIOUS`,`SPAM`,`SPOOF`,`SUSPICIOUS`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create <investigate-id>`,describe:`Submits a request to reclassify an email's disposition. Use for reporting false positives or false negatives. Optionally provide the raw EML content for reanalysis. The reclassification is processed asynchronously.`,builder:P,handler:async e=>{if(e.dryRun){u({command:`cf email-security investigate reclassify create`,method:`POST`,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`]))}/reclassify`,pathParams:{"investigate-id":String(e[`investigate-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({eml_content:f(e[`eml-content`],`eml-content`,`text`),escalated_submission_id:f(e[`escalated-submission-id`],`escalated-submission-id`,`text`),expected_disposition:f(e[`expected-disposition`],`expected-disposition`,`text`)}):s(e.body)});return}let i=await o(e),a=e.local?p:await r(i);if(e.accountId=a,e.body){let t=s(e.body);l(await d(`Creating`,async()=>i.emailSecurity.investigate.reclassify.create({...t,account_id:a,investigate_id:e[`investigate-id`]})),{successLabel:`Created`});return}e[`expected-disposition`]===void 0&&(e[`expected-disposition`]=await n(`expected-disposition`,`The expected_disposition field`,[`NONE`,`BULK`,`MALICIOUS`,`SPAM`,`SPOOF`,`SUSPICIOUS`]));let m=c({eml_content:f(e[`eml-content`],`eml-content`,`text`),escalated_submission_id:f(e[`escalated-submission-id`],`escalated-submission-id`,`text`),expected_disposition:f(e[`expected-disposition`],`expected-disposition`,`text`)});l(await d(`Creating`,async()=>i.emailSecurity.investigate.reclassify.create({...m,account_id:a,investigate_id:e[`investigate-id`]})),{successLabel:`Created`})}},I={command:`reclassify`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A list of investigate IDs identifying the messages to release.`})}const R={command:`bulk`,describe:`Releases one or more quarantined messages, delivering them to the intended recipients. Use when a message was incorrectly quarantined. Returns delivery status for each recipient.`,builder:L,handler:async e=>{if(e.dryRun){u({command:`cf email-security investigate release bulk`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/investigate/release`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.investigate.release.bulk({body:t,account_id:i})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},z={command:`release`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`investigate-id`,{type:`string`,description:`Unique identifier for a message retrieved from investigation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <investigate-id>`,describe:`Retrieves delivery and processing trace information for an email message. Shows the delivery path, retraction history, and move operations performed on the message. Useful for debugging delivery issues.`,builder:B,handler:async e=>{if(e.dryRun){u({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 n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.investigate.trace.get({account_id:i,investigate_id:e[`investigate-id`]})),{successLabel:`Loaded`})}},H={command:`trace`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`investigate`,describe:`Search and investigate email messages — view detections, traces, raw content, and take remediation actions`,builder:e=>e.command(b).command(S).command(h).command(v).command(T).command(A).command(N).command(I).command(z).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`start`,{type:`string`,description:`Start of the time range (RFC3339). Takes precedence over from_date.`}).option(`end`,{type:`string`,description:`End of the time range (RFC3339). Takes precedence over to_date.`}).option(`from-date`,{type:`string`,description:"Deprecated, use `start` instead. Start date in YYYY-MM-DD format."}).option(`to-date`,{type:`string`,description:"Deprecated, use `end` instead. End date in YYYY-MM-DD format."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Retrieves PhishGuard security alert reports for a specified date range. Reports include detected threats, dispositions, and contextual information. Use for security monitoring and threat analysis.`,builder:W,handler:async e=>{let n={start:e.start,end:e.end,from_date:e[`from-date`],to_date:e[`to-date`]};if(e.dryRun){u({command:`cf email-security phishguard reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/phishguard/reports`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.phishguard.reports.list({account_id:a,...n})),{successLabel:`Loaded`})}},K={command:`reports`,describe:`PhishGuard user-reported phishing submissions and analysis reports`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`phishguard`,describe:`Operations for phishguard`,builder:e=>e.command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`comments`,{type:`string`,description:`The comments field`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note - This will not exempt messages with Malicious or Suspicious dispositions.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Messages to this recipient will bypass all detections`}).option(`is-recipient`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026."}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-sender`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026."}).option(`is-spoof`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026."}).option(`is-trusted-sender`,{type:`boolean`,description:`Messages from this sender will bypass all detections and link following`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`verify-sender`,{type:`boolean`,description:`Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create an allow policy`})}const Y={command:`create`,describe:`Creates a new allow policy that exempts matching emails from security detections. Use with caution as this bypasses email security scanning. Policies can match on sender patterns and apply to specific detections or all detections.`,builder:J,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings allow-policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({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:f(e[`pattern-type`],`pattern-type`,`text`),verify_sender:e[`verify-sender`]}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.allowPolicies.create({body:t,account_id:i})),{successLabel:`Created`});return}let a=c({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:f(e[`pattern-type`],`pattern-type`,`text`),verify_sender:e[`verify-sender`]});l(await d(`Creating`,async()=>n.emailSecurity.settings.allowPolicies.create({body:a,account_id:i})),{successLabel:`Created`})}};function X(e){return e.positional(`policy-id`,{type:`string`,description:`Allow policy identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Z={command:`delete <policy-id>`,describe:`Removes an allow policy. After deletion, emails matching this pattern will be subject to normal security scanning and disposition actions.`,builder:X,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings allow-policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}l(await d(`Deleting`,async()=>n.emailSecurity.settings.allowPolicies.delete({account_id:a,policy_id:e[`policy-id`]})),{successLabel:`Deleted`})}};function Q(e){return e.positional(`policy-id`,{type:`string`,description:`Allow policy identifier`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Messages from this sender will be exempted from Spam, Spoof and Bulk dispositions. Note - This will not exempt messages with Malicious or Suspicious dispositions.`}).option(`is-exempt-recipient`,{type:`boolean`,description:`Messages to this recipient will bypass all detections`}).option(`is-recipient`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life: July 1, 2026."}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-sender`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life: July 1, 2026."}).option(`is-spoof`,{type:`boolean`,description:"Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life: July 1, 2026."}).option(`is-trusted-sender`,{type:`boolean`,description:`Messages from this sender will bypass all detections and link following`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`verify-sender`,{type:`boolean`,description:`Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors policies that pass authentication.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update an allow policy`})}const ne={command:`edit <policy-id>`,describe:`Updates an existing allow policy. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`,builder:Q,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings allow-policies edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/${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?c({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:f(e[`pattern-type`],`pattern-type`,`text`),verify_sender:e[`verify-sender`]}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.emailSecurity.settings.allowPolicies.edit({body:t,account_id:i,policy_id:e[`policy-id`]})),{successLabel:`Updated`});return}let a=c({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:f(e[`pattern-type`],`pattern-type`,`text`),verify_sender:e[`verify-sender`]});l(await d(`Updating`,async()=>n.emailSecurity.settings.allowPolicies.edit({body:a,account_id:i,policy_id:e[`policy-id`]})),{successLabel:`Updated`})}};function re(e){return e.positional(`policy-id`,{type:`string`,description:`Allow policy identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <policy-id>`,describe:`Retrieves details for a specific allow policy including its pattern, dispositions that are exempted, and whether it applies to all detections.`,builder:re,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings allow-policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.settings.allowPolicies.get({account_id:i,policy_id:e[`policy-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`is-exempt-recipient`,{type:`boolean`,description:`Filter to show only policies where messages to the recipient bypass all detections.`}).option(`is-trusted-sender`,{type:`boolean`,description:`Filter to show only policies where messages from the sender bypass all detections and link following.`}).option(`is-acceptable-sender`,{type:`boolean`,description:`Filter to show only policies where messages from the sender are exempted from Spam, Spoof, and Bulk dispositions (not Malicious or Suspicious).`}).option(`verify-sender`,{type:`boolean`,description:`Filter to show only policies that enforce DMARC, SPF, or DKIM authentication.`}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`pattern`,{type:`string`,description:`Pattern`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Returns a paginated list of email allow policies. These policies exempt matching emails from security detection, allowing them to bypass disposition actions. Supports filtering by pattern type and policy attributes.`,builder:m(ae),handler:async e=>{let n={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){u({command:`cf email-security settings allow-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.settings.allowPolicies.list({account_id:a,...n})),{successLabel:`Loaded`})}},se={command:`allow-policies`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command(Y).command(Z).command(ne).command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`create`,describe:`Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`,builder:ce,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings batch allow policies batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/allow_policies/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.allow.policies.batch.create({...t,account_id:i})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/email-security/settings/allow_policies/batch`)),{successLabel:`Created`})}},ue={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`policies`,describe:`Operations for settings.batch.allow.policies`,builder:e=>e.command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`allow`,describe:`Operations for settings.batch.allow`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`create`,describe:`Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`,builder:pe,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings batch block senders batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.block.senders.batch.create({...t,account_id:i})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/email-security/settings/block_senders/batch`)),{successLabel:`Created`})}},he={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`senders`,describe:`Operations for settings.batch.block.senders`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`block`,describe:`Operations for settings.batch.block`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ye={command:`create`,describe:`Executes multiple delete operations on sending domain restrictions atomically. All operations succeed or fail together as a transaction. Currently only supports batch deletion. Removes TLS enforcement requirements for the specified domains.`,builder:ve,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings batch sending domain restrictions batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/sending_domain_restrictions/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.sending.domain.restrictions.batch.create({...t,account_id:i})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/email-security/settings/sending_domain_restrictions/batch`)),{successLabel:`Created`})}},be={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xe={command:`restrictions`,describe:`Operations for settings.batch.sending.domain.restrictions`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`domain`,describe:`Operations for settings.batch.sending.domain`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ce={command:`sending`,describe:`Operations for settings.batch.sending`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Te={command:`create`,describe:`Execute multiple operations atomically. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`,builder:we,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings batch trusted domains batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.batch.trusted.domains.batch.create({...t,account_id:i})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/email-security/settings/trusted_domains/batch`)),{successLabel:`Created`})}},Ee={command:`batch`,describe:`Batch operations for email security settings — allow policies, blocked senders, domain restrictions, trusted domains`,builder:e=>e.command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},De={command:`domains`,describe:`Operations for settings.batch.trusted.domains`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`trusted`,describe:`Operations for settings.batch.trusted`,builder:e=>e.command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`batch`,describe:`Operations for settings.batch`,builder:e=>e.command(fe).command(_e).command(Ce).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ae(e){return e.option(`comments`,{type:`string`,description:`The comments field`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a blocked sender pattern`})}const je={command:`create`,describe:`Creates a new blocked sender pattern. Emails matching this pattern will be blocked from delivery. Patterns can be email addresses, domains, or IP addresses, and support regular expressions.`,builder:Ae,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings block-senders create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:f(e[`pattern-type`],`pattern-type`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.blockSenders.create({body:t,account_id:i})),{successLabel:`Created`});return}let a=c({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:f(e[`pattern-type`],`pattern-type`,`text`)});l(await d(`Creating`,async()=>n.emailSecurity.settings.blockSenders.create({body:a,account_id:i})),{successLabel:`Created`})}};function Me(e){return e.positional(`pattern-id`,{type:`string`,description:`Blocked sender pattern identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <pattern-id>`,describe:`Removes a blocked sender pattern. After deletion, emails from this sender will no longer be automatically blocked based on this rule.`,builder:Me,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings block-senders delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}l(await d(`Deleting`,async()=>n.emailSecurity.settings.blockSenders.delete({account_id:a,pattern_id:e[`pattern-id`]})),{successLabel:`Deleted`})}};function Pe(e){return e.positional(`pattern-id`,{type:`string`,description:`Blocked sender pattern identifier`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`pattern`,{type:`string`,description:"The pattern value to match against. Format depends on `pattern_type`:\n- EMAIL: a valid email address, e.g. `user@example.com`\n- DOMAIN: a valid domain name, e.g. `example.com`\n- IP: a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted; private, loopback, link-local, and unspecified addresses are rejected.\n"}).option(`pattern-type`,{type:`string`,description:"Type of pattern matching.\n- EMAIL: matches a full email address (e.g. `user@example.com`)\n- DOMAIN: matches a domain name (e.g. `example.com`)\n- IP: matches a plain IPv4 address (e.g. `1.2.3.4`) or an IPv4 CIDR block (e.g. `1.2.3.0/24`). Only globally reachable addresses are accepted.\n- UNKNOWN: deprecated, cannot be used when creating or updating policies, but may be returned for existing entries.\n",choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a blocked sender pattern`})}const Fe={command:`edit <pattern-id>`,describe:`Updates an existing blocked sender pattern. Only provided fields will be modified. The pattern will continue blocking emails until deleted.`,builder:Pe,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings block-senders edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/${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?c({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:f(e[`pattern-type`],`pattern-type`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.emailSecurity.settings.blockSenders.edit({body:t,account_id:i,pattern_id:e[`pattern-id`]})),{successLabel:`Updated`});return}let a=c({comments:f(e.comments,`comments`,`text`),is_regex:e[`is-regex`],pattern:f(e.pattern,`pattern`,`text`),pattern_type:f(e[`pattern-type`],`pattern-type`,`text`)});l(await d(`Updating`,async()=>n.emailSecurity.settings.blockSenders.edit({body:a,account_id:i,pattern_id:e[`pattern-id`]})),{successLabel:`Updated`})}};function Ie(e){return e.positional(`pattern-id`,{type:`string`,description:`Blocked sender pattern identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <pattern-id>`,describe:`Retrieves details for a specific blocked sender pattern including its pattern type, value, and metadata.`,builder:Ie,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings block-senders get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders/${e[`pattern-id`]==null?`<pattern-id>`:encodeURIComponent(String(e[`pattern-id`]))}`,pathParams:{"pattern-id":String(e[`pattern-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.settings.blockSenders.get({account_id:i,pattern_id:e[`pattern-id`]})),{successLabel:`Loaded`})}};function Re(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`pattern-type`,{type:`string`,description:`Filter by pattern type.`,choices:[`EMAIL`,`DOMAIN`,`IP`,`UNKNOWN`]}).option(`pattern`,{type:`string`,description:`Filter by pattern value.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ze={command:`list`,describe:`Returns a paginated list of blocked email sender patterns. These patterns prevent emails from matching senders from being delivered. Supports filtering by pattern type and searching across patterns.`,builder:m(Re),handler:async e=>{let n={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){u({command:`cf email-security settings block-senders list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/block_senders`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.settings.blockSenders.list({account_id:a,...n})),{successLabel:`Loaded`})}},Be={command:`block-senders`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command(je).command(Ne).command(Fe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const He={command:`bulk-delete`,describe:`Deprecated. Use the batch endpoint instead.`,builder:Ve,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings domains bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}if(e.body){let t=s(e.body);l(await d(`Deleting`,async()=>n.emailSecurity.settings.domains.bulkDelete({body:t,account_id:a})),{successLabel:`Deleted`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Ue(e){return e.positional(`domain-id`,{type:`string`,description:`Domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const We={command:`delete <domain-id>`,describe:`Removes email security protection from a domain. After deletion, emails for this domain will no longer be processed by Email Security. This action cannot be undone.`,builder:Ue,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings 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 n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}l(await d(`Deleting`,async()=>n.emailSecurity.settings.domains.delete({account_id:a,domain_id:e[`domain-id`]})),{successLabel:`Deleted`})}};function Ge(e){return e.positional(`domain-id`,{type:`string`,description:`Domain identifier`,demandOption:!0}).option(`allowed-delivery-modes`,{type:`string`,array:!0,description:`The allowed_delivery_modes field`}).option(`domain`,{type:`string`,description:`The domain field`}).option(`drop-dispositions`,{type:`string`,array:!0,description:`The drop_dispositions field`}).option(`folder`,{type:`string`,description:`The folder field`,choices:[`AllItems`,`Inbox`]}).option(`integration-id`,{type:`string`,description:`The integration_id field`}).option(`ip-restrictions`,{type:`string`,array:!0,description:`The ip_restrictions field`}).option(`lookback-hops`,{type:`number`,description:`The lookback_hops field`}).option(`regions`,{type:`string`,array:!0,description:`The regions field`}).option(`require-tls-inbound`,{type:`boolean`,description:`The require_tls_inbound field`}).option(`require-tls-outbound`,{type:`boolean`,description:`The require_tls_outbound field`}).option(`transport`,{type:`string`,description:`The transport field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ke={command:`edit <domain-id>`,describe:`Updates configuration for a protected email domain. Only provided fields will be modified. Changes affect delivery mode, security settings, and regional processing.`,builder:Ge,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings 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?c({allowed_delivery_modes:e[`allowed-delivery-modes`],domain:f(e.domain,`domain`,`text`),drop_dispositions:e[`drop-dispositions`],folder:f(e.folder,`folder`,`text`),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`)}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.emailSecurity.settings.domains.edit({body:t,account_id:i,domain_id:e[`domain-id`]})),{successLabel:`Updated`});return}let a=c({allowed_delivery_modes:e[`allowed-delivery-modes`],domain:f(e.domain,`domain`,`text`),drop_dispositions:e[`drop-dispositions`],folder:f(e.folder,`folder`,`text`),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`)});l(await d(`Updating`,async()=>n.emailSecurity.settings.domains.edit({body:a,account_id:i,domain_id:e[`domain-id`]})),{successLabel:`Updated`})}};function qe(e){return e.positional(`domain-id`,{type:`string`,description:`Domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`get <domain-id>`,describe:`Retrieves detailed information for a specific protected email domain including its delivery configuration, SPF/DMARC status, and authorization state.`,builder:qe,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings 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 n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.settings.domains.get({account_id:i,domain_id:e[`domain-id`]})),{successLabel:`Loaded`})}};function Ye(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`domain`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`allowed-delivery-mode`,{type:`string`,description:`Delivery mode to filter by.`,choices:[`DIRECT`,`BCC`,`JOURNAL`,`API`,`RETRO_SCAN`]}).option(`domain`,{type:`string`,description:`Domain names to filter by.`}).option(`active-delivery-mode`,{type:`string`,description:`Currently active delivery mode to filter by.`,choices:[`DIRECT`,`BCC`,`JOURNAL`,`API`,`RETRO_SCAN`]}).option(`integration-id`,{type:`string`,description:`Integration ID to filter by.`}).option(`status`,{type:`string`,description:`Filters response to domains with the provided status.`,choices:[`pending`,`active`,`failed`,`timeout`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`list`,describe:`Returns a paginated list of email domains protected by Email Security. Includes domain configuration, delivery modes, and authorization status. Supports filtering by delivery mode and integration ID.`,builder:m(Ye),handler:async e=>{let n={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){u({command:`cf email-security settings domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/domains`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.settings.domains.list({account_id:a,...n})),{successLabel:`Loaded`})}},Ze={command:`domains`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command(He).command(We).command(Ke).command(Je).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(e){return e.option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:`The pattern field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a trusted domain`})}const $e={command:`create`,describe:`Creates a new trusted domain pattern. Use for partner domains or approved senders that should bypass recent domain registration and similarity checks. Configure whether it prevents recent domain or spoof dispositions.`,builder:Qe,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings trusted-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({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`)}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailSecurity.settings.trustedDomains.create({body:t,account_id:i})),{successLabel:`Created`});return}let a=c({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`)});l(await d(`Creating`,async()=>n.emailSecurity.settings.trustedDomains.create({body:a,account_id:i})),{successLabel:`Created`})}};function et(e){return e.positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tt={command:`delete <trusted-domain-id>`,describe:`Removes a trusted domain pattern. After deletion, emails from this domain will be subject to normal recent domain and similarity checks.`,builder:et,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings trusted-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/${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 n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}l(await d(`Deleting`,async()=>n.emailSecurity.settings.trustedDomains.delete({account_id:a,trusted_domain_id:e[`trusted-domain-id`]})),{successLabel:`Deleted`})}};function $(e){return e.positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier`,demandOption:!0}).option(`comments`,{type:`string`,description:`The comments field`}).option(`is-recent`,{type:`boolean`,description:`Select to prevent recently registered domains from triggering a Suspicious or Malicious disposition.`}).option(`is-regex`,{type:`boolean`,description:`The is_regex field`}).option(`is-similarity`,{type:`boolean`,description:`Select for partner or other approved domains that have similar spelling to your connected domains. Prevents listed domains from triggering a Spoof disposition.`}).option(`pattern`,{type:`string`,description:`The pattern field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update a trusted domain`})}const nt={command:`edit <trusted-domain-id>`,describe:`Updates an existing trusted domain pattern. Only provided fields will be modified. Changes take effect for new emails matching the pattern.`,builder:$,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings trusted-domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/${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?c({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`)}):s(e.body)});return}let n=await o(e),i=e.local?p:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.emailSecurity.settings.trustedDomains.edit({body:t,account_id:i,trusted_domain_id:e[`trusted-domain-id`]})),{successLabel:`Updated`});return}let a=c({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`)});l(await d(`Updating`,async()=>n.emailSecurity.settings.trustedDomains.edit({body:a,account_id:i,trusted_domain_id:e[`trusted-domain-id`]})),{successLabel:`Updated`})}};function rt(e){return e.positional(`trusted-domain-id`,{type:`string`,description:`Trusted domain identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`get <trusted-domain-id>`,describe:`Retrieves details for a specific trusted domain pattern including its pattern value, whether it uses regex matching, and which detection types it affects.`,builder:rt,handler:async e=>{if(e.dryRun){u({command:`cf email-security settings trusted-domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains/${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 n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.emailSecurity.settings.trustedDomains.get({account_id:i,trusted_domain_id:e[`trusted-domain-id`]})),{successLabel:`Loaded`})}};function at(e){return e.option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`search`,{type:`string`,description:`Search term for filtering records. Behavior may change.`}).option(`order`,{type:`string`,description:`Field to sort by.`,choices:[`pattern`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`is-recent`,{type:`boolean`,description:`Filter to show only recently registered domains that are trusted to prevent triggering Suspicious or Malicious dispositions.`}).option(`is-similarity`,{type:`boolean`,description:`Filter to show only proximity domains (partner or approved domains with similar spelling to connected domains) that prevent Spoof dispositions.`}).option(`pattern`,{type:`string`,description:`Pattern`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`list`,describe:`Returns a paginated list of trusted domain patterns. Trusted domains prevent false positives for recently registered domains and lookalike domain detections. Patterns can use regular expressions for flexible matching.`,builder:m(at),handler:async e=>{let n={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){u({command:`cf email-security settings trusted-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/settings/trusted_domains`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.settings.trustedDomains.list({account_id:a,...n})),{successLabel:`Loaded`})}},st={command:`trusted-domains`,describe:`Email security policies — allow lists, blocked senders, trusted domains, and impersonation registry`,builder:e=>e.command($e).command(tt).command(nt).command(it).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ct={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(se).command(ke).command(Be).command(Ze).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lt(e){return e.option(`start`,{type:`string`,description:"The beginning of the search date range. Defaults to `now - 30 days`."}).option(`end`,{type:`string`,description:"The end of the search date range. Defaults to `now`."}).option(`type`,{type:`string`,description:`Type`,choices:[`TEAM`,`USER`]}).option(`submission-id`,{type:`string`,description:`Submission ID`}).option(`original-disposition`,{type:`string`,description:`Original disposition`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`requested-disposition`,{type:`string`,description:`Requested disposition`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`outcome-disposition`,{type:`string`,description:`Outcome disposition`,choices:[`MALICIOUS`,`SUSPICIOUS`,`SPOOF`,`SPAM`,`BULK`,`NONE`]}).option(`status`,{type:`string`,description:`Status`}).option(`query`,{type:`string`,description:`Query`}).option(`escalated-from-user`,{type:`boolean`,description:`When true, return only submissions that were escalated by an end user (vs. by the security team). When false, return only submissions that were not escalated by an end user. When omitted, no filter is applied.`}).option(`page`,{type:`number`,description:`Current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`The number of results per page. Maximum value is 1000.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ut={command:`list`,describe:`Returns information for submissions made to reclassify emails. Shows the status, outcome, and disposition changes for reclassification requests made by users or the security team. Useful for tracking false positive/negative reports.`,builder:m(lt),handler:async e=>{let n={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`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){u({command:`cf email-security submissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email-security/submissions`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.emailSecurity.submissions.list({account_id:a,...n})),{successLabel:`Loaded`})}},dt={command:`submissions`,describe:`User and admin email submissions for classification review`,builder:e=>e.command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ft={command:`email-security`,describe:`Cloud email security (Area 1) — investigate threats, manage allow/block policies, and detect phishing`,builder:e=>e.command(U).command(q).command(ct).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ft as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,g as n,w as r,x as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Returns the current daily sending quota for the account and, when a quota is resolved, the account's current usage against it. Quota is null when not yet available; usage is null when there is no resolved quota or usage is temporarily unavailable.`,builder:p,handler:async e=>{if(e.dryRun){l({command:`cf email-sending limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/limits`,pathParams:{},bodyKind:`none`});return}let r=await a(e),i=e.local?f:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.emailSending.limits.get({account_id:i})),{successLabel:`Loaded`})}},h={command:`limits`,describe:`Operations for limits`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`send-raw`,describe:`Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`,builder:g,handler:async r=>{if(r.dryRun){l({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({from:d(r.from,`from`,`text`),mime_message:d(r[`mime-message`],`mime-message`,`text`),recipients:r.recipients}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.emailSending.sendRaw({...e,account_id:p})),{successLabel:`Created`});return}if(r.from===void 0&&(r.from=await e(`from`,`Sender email address.`)),r[`mime-message`]===void 0&&(r[`mime-message`]=await e(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),r.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let m=s({from:d(r.from,`from`,`text`),mime_message:d(r[`mime-message`],`mime-message`,`text`),recipients:r.recipients});c(await u(`Creating`,async()=>i.emailSending.sendRaw({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`send`,describe:`Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`,builder:v,handler:async r=>{if(r.dryRun){l({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({bcc:{address:d(r[`bcc-address`],`bcc-address`,`text`),name:d(r[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(r[`cc-address`],`cc-address`,`text`),name:d(r[`cc-name`],`cc-name`,`text`)},from:{address:d(r[`from-address`],`from-address`,`text`),name:d(r[`from-name`],`from-name`,`text`)},html:d(r.html,`html`,`text`),reply_to:{address:d(r[`reply-to-address`],`reply-to-address`,`text`),name:d(r[`reply-to-name`],`reply-to-name`,`text`)},subject:d(r.subject,`subject`,`text`),text:d(r.text,`text`,`text`),to:{address:d(r[`to-address`],`to-address`,`text`),name:d(r[`to-name`],`to-name`,`text`)}}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.emailSending.send({...e,account_id:p})),{successLabel:`Created`});return}r.subject===void 0&&(r.subject=await e(`subject`,`Email subject line.`));let m=s({bcc:{address:d(r[`bcc-address`],`bcc-address`,`text`),name:d(r[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(r[`cc-address`],`cc-address`,`text`),name:d(r[`cc-name`],`cc-name`,`text`)},from:{address:d(r[`from-address`],`from-address`,`text`),name:d(r[`from-name`],`from-name`,`text`)},html:d(r.html,`html`,`text`),reply_to:{address:d(r[`reply-to-address`],`reply-to-address`,`text`),name:d(r[`reply-to-name`],`reply-to-name`,`text`)},subject:d(r.subject,`subject`,`text`),text:d(r.text,`text`,`text`),to:{address:d(r[`to-address`],`to-address`,`text`),name:d(r[`to-name`],`to-name`,`text`)}});c(await u(`Creating`,async()=>i.emailSending.send({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present.`,builder:b,handler:async t=>{if(t.dryRun){l({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({name:d(t.name,`name`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.emailSending.subdomains.create({...e,zone_id:r})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await e(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(t.name,`name`,`text`)});c(await u(`Creating`,async()=>n.emailSending.subdomains.create({...f,zone_id:r})),{successLabel:`Created`})}};function S(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <subdomain-id>`,describe:`Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>t.emailSending.subdomains.delete({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`fix <subdomain-id>`,describe:`Idempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns fix`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Creating`,async()=>t.emailSending.subdomains.dns.fix({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Created`})}};function E(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get-status <subdomain-id>`,describe:`Returns the desired DNS records for a sending subdomain along with a live diff against actual DNS state. Use this to detect missing, unlocked, foreign, or multi-record conflicts before deciding whether to call the fix endpoint.`,builder:E,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns/status`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.getStatus({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <subdomain-id>`,describe:`Returns the expected DNS records for a sending subdomain.`,builder:O,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.get({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}},A={command:`dns`,describe:`Operations for subdomains.dns`,builder:e=>e.command(T).command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <subdomain-id>`,describe:`Gets information for a specific sending subdomain.`,builder:j,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.emailSending.subdomains.get({zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Lists all sending-enabled subdomains for the zone.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.emailSending.subdomains.list({zone_id:n})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`preview`,describe:`Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status.`,builder:F,handler:async t=>{if(t.dryRun){l({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({name:d(t.name,`name`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Loading`,async()=>n.emailSending.subdomains.preview({...e,zone_id:r})),{successLabel:`Loaded`});return}t.name===void 0&&(t.name=await e(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(t.name,`name`,`text`)});c(await u(`Loading`,async()=>n.emailSending.subdomains.preview({...f,zone_id:r})),{successLabel:`Loaded`})}};function L(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`preview-enabled`,{type:`boolean`,description:`Whether sent messages from this subdomain can be previewed in the activity log.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <subdomain-id>`,describe:`Updates the activity-log preview preference for a sending subdomain.`,builder:L,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({preview_enabled:e[`preview-enabled`]}):o(e.body)});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=o(e.body);c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...r,zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`});return}if(e[`preview-enabled`]===void 0)throw Error(`--preview-enabled is required (or pass --body with this field set).`);let r=s({preview_enabled:e[`preview-enabled`]});c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...r,zone_id:n,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`})}},z={command:`subdomains`,describe:`Operations for subdomains`,builder:e=>e.command(x).command(C).command(M).command(P).command(I).command(R).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`email-sending`,describe:`Send emails and manage sending subdomains`,builder:e=>e.command(y).command(_).command(h).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{B as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{w as e,x as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-DrDErV9w.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./cli-types-BeyOc81z.mjs";function u(e){return e.option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const d={command:`bulk-delete`,describe:`Deletes one or more existing filters.`,builder:u,handler:async r=>{let i={id:r.id};if(r.dryRun){o({command:`cf filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),l=await t({zone:r.zone},c,{quiet:r.quiet});if(r.zoneId=l,!await e({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.filters.bulkDelete({zone_id:l,...i})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`bulk-update`,describe:`Updates one or more existing filters.`,builder:f,handler:async e=>{if(e.dryRun){o({command:`cf filters bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body)});return}let i=await n(e),c=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=r(e.body);a(await s(`Updating`,async()=>i.filters.bulkUpdate({body:t,zone_id:c})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Creates one or more filters.`,builder:m,handler:async e=>{if(e.dryRun){o({command:`cf filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body)});return}let i=await n(e),c=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=r(e.body);a(await s(`Creating`,async()=>i.filters.create({body:t,zone_id:c})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <filter-id>`,describe:`Deletes an existing filter.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf filters delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/filters/${r[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(r[`filter-id`]))}`,pathParams:{"filter-id":String(r[`filter-id`]??``),"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=await t({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await e({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>i.filters.delete({zone_id:c,filter_id:r[`filter-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <filter-id>`,describe:`Fetches the details of a filter.`,builder:v,handler:async e=>{if(e.dryRun){o({command:`cf filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.filters.get({zone_id:i,filter_id:e[`filter-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`expression`,{type:`string`,description:`A case-insensitive string to find in the expression.`}).option(`description`,{type:`string`,description:`A case-insensitive string to find in the description.`}).option(`ref`,{type:`string`,description:`The filter ref (a short reference tag) to search for. Must be an exact match.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of filters per page.`}).option(`id`,{type:`string`,description:`The unique identifier of the filter.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Fetches filters in a zone. You can filter the results using several optional parameters.`,builder:l(b),handler:async e=>{let r={paused:e.paused,expression:e.expression,description:e.description,ref:e.ref,page:e.page,per_page:e[`per-page`],id:e.id};if(e.dryRun){o({command:`cf filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(e),c=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>i.filters.list({zone_id:c,...r})),{successLabel:`Loaded`})}};function S(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the filter.`}).option(`expression`,{type:`string`,description:`The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`ref`,{type:`string`,description:`A short reference tag. Allows you to select related filters.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <filter-id>`,describe:`Updates an existing filter.`,builder:S,handler:async e=>{if(e.dryRun){o({command:`cf filters update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({description:c(e.description,`description`,`text`),expression:c(e.expression,`expression`,`text`),paused:e.paused,ref:c(e.ref,`ref`,`text`)}):r(e.body)});return}let l=await n(e),u=await t({zone:e.zone},l,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=r(e.body);a(await s(`Updating`,async()=>l.filters.update({body:t,zone_id:u,filter_id:e[`filter-id`]})),{successLabel:`Updated`});return}let d=i({description:c(e.description,`description`,`text`),expression:c(e.expression,`expression`,`text`),paused:e.paused,ref:c(e.ref,`ref`,`text`)});a(await s(`Updating`,async()=>l.filters.update({body:d,zone_id:u,filter_id:e[`filter-id`]})),{successLabel:`Updated`})}},w={command:`filters`,describe:`Filter expressions used by legacy firewall rules to match requests — prefer Rulesets for new configurations`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|