cf 0.1.0 → 0.3.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 +96 -95
- package/dist/_meta/commands.json +16558 -13965
- package/dist/_meta/schemas.json +52979 -16753
- package/dist/abuse-reports-dMIfUJ8v.mjs +8 -0
- package/dist/accounts-Kx1epdA1.mjs +22 -0
- package/dist/acm-Utu252kC.mjs +3 -0
- package/dist/addressing-CBq7Z7Vq.mjs +12 -0
- package/dist/{agent-context-D26woB9J.mjs → agent-context-BGTU299M.mjs} +1 -1
- package/dist/ai-DOOKLPkG.mjs +2 -0
- package/dist/ai-gateway-Cj1T3avF.mjs +8 -0
- package/dist/ai-search-CQF_Sn7d.mjs +7 -0
- package/dist/ai_gateway-C3fH22C0.mjs +4 -0
- package/dist/alerting-CqmEIaKn.mjs +6 -0
- package/dist/analytics-Dv-X8x7D.mjs +20 -0
- package/dist/analytics_engine-DdXVR8z2.mjs +2 -0
- package/dist/api-gateway-CNv0IHTU.mjs +33 -0
- package/dist/argo-CX_A4kcn.mjs +2 -0
- package/dist/audit-logs-BfBf3oo-.mjs +2 -0
- package/dist/auth-SyWhMmPu.mjs +6 -0
- package/dist/auth-ffdf9yR0.mjs +135 -0
- package/dist/autorag-BuGhGTeZ.mjs +2 -0
- package/dist/billing-PoG81XaQ.mjs +2 -0
- package/dist/body-parser-DKa8Ipg1.mjs +2 -0
- package/dist/bot-management-CFvtVx62.mjs +5 -0
- package/dist/botnet-feed-B-M4Yu0W.mjs +3 -0
- package/dist/brand-protection-D05Eg-_6.mjs +3 -0
- package/dist/browser-rendering-xu8F_Rrv.mjs +4 -0
- package/dist/build-DYkGW4dh.mjs +1054 -0
- package/dist/cache-DsoW6Xwv.mjs +5 -0
- package/dist/calls-CZbO7TyR.mjs +4 -0
- package/dist/certificate-authorities-D2yr7_3t.mjs +2 -0
- package/dist/cli-types-CRIDdDw3.mjs +2 -0
- package/dist/client-certificates-MJcDsTId.mjs +3 -0
- package/dist/cloud-connector-DWOrN2eM.mjs +2 -0
- package/dist/cloudforce-one-2Bhz8YdW.mjs +21 -0
- package/dist/{completions-BKrxcfhN.mjs → completions-BwRpZQVn.mjs} +1 -1
- package/dist/{config-BIfdEY0E.mjs → config-DYzlVxcB.mjs} +1 -1
- package/dist/connectivity-BX8C7tvK.mjs +3 -0
- package/dist/content-scanning-r6uzMO1r.mjs +4 -0
- package/dist/context-DGlHRGWM.mjs +2 -0
- package/dist/custom-certificates-aAiEguR7.mjs +5 -0
- package/dist/custom-hostnames-AG5yBHIi.mjs +5 -0
- package/dist/custom-nameservers-D1DtlRue.mjs +3 -0
- package/dist/custom-pages-DQCi2plU.mjs +4 -0
- package/dist/d1-DbnYhw45.mjs +4 -0
- package/dist/data-security-D_EtYBfo.mjs +6 -0
- package/dist/dcv-delegation-CHspSzTI.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-CQial3kN.mjs +2 -0
- package/dist/{dev-BfKYB-R_.mjs → dev-B38LfCTl.mjs} +1 -1
- package/dist/diagnostics-BJQGjVJn.mjs +3 -0
- package/dist/dispatch-namespaces-DmHvoBOg.mjs +7 -0
- package/dist/{dist-C_bu5HwZ.mjs → dist-AIcZFk0U.mjs} +7 -7
- package/dist/dist-DNBSHor6.mjs +301 -0
- package/dist/dns-VMhQSr5n.mjs +29 -0
- package/dist/dns-firewall-B4DVXFBQ.mjs +57 -0
- package/dist/durable-objects-CTboySEo.mjs +2 -0
- package/dist/email-routing-tIR2SFu-.mjs +10 -0
- package/dist/email-security-Ca1id3rZ.mjs +8 -0
- package/dist/email-sending-DwWKc5jC.mjs +3 -0
- package/dist/filters-A4dg_a68.mjs +4 -0
- package/dist/firewall-DWPQgYd9.mjs +11 -0
- package/dist/fraud-BMkSsJGU.mjs +20 -0
- package/dist/google-tag-gateway-BGD49nRC.mjs +2 -0
- package/dist/healthchecks-CtIfrFql.mjs +4 -0
- package/dist/hostnames-BiomxukN.mjs +3 -0
- package/dist/hyperdrive-Da104VaQ.mjs +18 -0
- package/dist/iam-BIGKo0WW.mjs +6 -0
- package/dist/images-BO8FbDAa.mjs +5 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-CY6_79v8.mjs +3 -0
- package/dist/{ips-B0cK7D0_.mjs → ips-K4bzaGqd.mjs} +1 -1
- package/dist/keyless-certificates-CZC-L8gM.mjs +3 -0
- package/dist/kv-8o27w_pY.mjs +5 -0
- package/dist/leaked-credential-checks-qLzRyu85.mjs +3 -0
- package/dist/load-balancers-DtG8nj25.mjs +6 -0
- package/dist/logpush-4L0njy1d.mjs +4 -0
- package/dist/logs-B_Yp95hv.mjs +3 -0
- package/dist/magic-cloud-networking-CSOM3EM-.mjs +5 -0
- package/dist/magic-network-monitoring-BnwvM4-I.mjs +4 -0
- package/dist/magic-transit-CXDyvhxq.mjs +90 -0
- package/dist/managed-transforms-D15yVbZx.mjs +3 -0
- package/dist/mtls-certificates-D8k0AXWK.mjs +3 -0
- package/dist/network-interconnects-rrr7red3.mjs +36 -0
- package/dist/observability-DWvpqnQJ.mjs +4 -0
- package/dist/organizations-T77D50Sq.mjs +41 -0
- package/dist/origin-ca-certificates-DXIvD8H5.mjs +3 -0
- package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +2 -0
- package/dist/origin-tls-client-auth-CaVW1Ztp.mjs +4 -0
- package/dist/output-BJFNwj7b.mjs +2 -0
- package/dist/page-rules-CjZPTMQX.mjs +18 -0
- package/dist/page-shield-D5RRNJCY.mjs +37 -0
- package/dist/pages-CWJtJnL0.mjs +11 -0
- package/dist/pipelines-B0L_7j9e.mjs +6 -0
- package/dist/{progress-DZfTxbrx.mjs → progress-CrCGTq7N.mjs} +1 -1
- package/dist/queues-CN6DPhRR.mjs +6 -0
- package/dist/r2-DQIcyRtA.mjs +21 -0
- package/dist/r2-data-catalog-Bbo93TJx.mjs +14 -0
- package/dist/radar-Bxb0WX8V.mjs +2 -0
- package/dist/rate-limits-DcrQV6Ar.mjs +5 -0
- package/dist/raw-fetch-Dlccg0Tr.mjs +2 -0
- package/dist/realtime-kit-CaquuVOE.mjs +18 -0
- package/dist/registrar-Ko-xZemf.mjs +46 -0
- package/dist/request-tracers-DOW_reTJ.mjs +2 -0
- package/dist/{resolve-BuJRWSk0.mjs → resolve-4-OSeHlK.mjs} +1 -1
- package/dist/resource-sharing-D7TX0JV0.mjs +5 -0
- package/dist/resource-tagging-C3qtLzCz.mjs +16 -0
- package/dist/rules-BXRADHL5.mjs +4 -0
- package/dist/rulesets-CBgpeSvJ.mjs +8 -0
- package/dist/rum-BjPptTUP.mjs +4 -0
- package/dist/{schema-D0_cbcDt.mjs → schema-D16TgWBg.mjs} +1 -1
- package/dist/schema-validation-Dgv_opM3.mjs +24 -0
- package/dist/scim-DdSEr4kZ.mjs +3 -0
- package/dist/secrets-store-7BfyvJLb.mjs +25 -0
- package/dist/security-center-DAy6AKtT.mjs +2 -0
- package/dist/security-txt-xAMb7K6Y.mjs +3 -0
- package/dist/session-COHHdS7A.mjs +5 -0
- package/dist/shared-AGtpXwwL.mjs +2 -0
- package/dist/smart-shield-TeWZFnH2.mjs +3 -0
- package/dist/snippets-CCSsCXVs.mjs +4 -0
- package/dist/{spawn-D_cjG87Z.mjs → spawn-DcppKGI5.mjs} +1 -1
- package/dist/spectrum-CTTZID8u.mjs +63 -0
- package/dist/speed-CuzTE0AL.mjs +4 -0
- package/dist/{src-C5qivNKH.mjs → src-BW6vfAwE.mjs} +15 -15
- package/dist/ssl-BWA2LdwC.mjs +15 -0
- package/dist/stream-GFsIZ-pP.mjs +14 -0
- package/dist/tenants-Bd7NGQ_m.mjs +2 -0
- package/dist/token-validation-DAgtFOvs.mjs +10 -0
- package/dist/{tools-CtKbk6VS.mjs → tools-DXQmfFuE.mjs} +1 -1
- package/dist/turnstile-cfdaO4ca.mjs +23 -0
- package/dist/{ui-mP_arYIg.mjs → ui-D4KtlMh9.mjs} +1 -1
- package/dist/url-normalization-B5RN4nLD.mjs +3 -0
- package/dist/url-scanner-BrZ1L9OC.mjs +2 -0
- package/dist/user-CAo-yCJA.mjs +10 -0
- package/dist/vectorize-C7_oQlaI.mjs +4 -0
- package/dist/versions-CUwWJWmy.mjs +2 -0
- package/dist/waiting-rooms-Dln5ICg5.mjs +11 -0
- package/dist/web3-HQJRm38W.mjs +4 -0
- package/dist/workers-Dg7ddG2Q.mjs +18 -0
- package/dist/workers-builds-AVfx8IyL.mjs +7 -0
- package/dist/workflows-VquuSh2J.mjs +4 -0
- package/dist/zaraz-xYSWIV4P.mjs +2 -0
- package/dist/zero-trust-CP96wnSh.mjs +118 -0
- package/dist/zones-BSgmZ9WC.mjs +21 -0
- package/package.json +7 -6
- package/dist/abuse-reports-ChV_yD7f.mjs +0 -8
- package/dist/accounts-BCYecXFh.mjs +0 -21
- package/dist/acm-DD8zSds2.mjs +0 -3
- package/dist/addressing-D4Eqw5Bi.mjs +0 -13
- package/dist/ai-DfXMOMx_.mjs +0 -2
- package/dist/ai-gateway-DdRFthMo.mjs +0 -8
- package/dist/ai-search-C_68CDj1.mjs +0 -7
- package/dist/alerting-DbhqhVCp.mjs +0 -6
- package/dist/analytics-BSBBc7ep.mjs +0 -20
- package/dist/api-gateway-CZ4swbkQ.mjs +0 -33
- package/dist/argo-tms9ZwHO.mjs +0 -2
- package/dist/audit-logs-24qyW8cl.mjs +0 -2
- package/dist/auth-BlSmtIKd.mjs +0 -112
- package/dist/auth-DQ8miey6.mjs +0 -6
- package/dist/autorag-kgNt06GD.mjs +0 -2
- package/dist/billing-lwBHNTXC.mjs +0 -2
- package/dist/body-parser-Br-BoYk-.mjs +0 -2
- package/dist/bot-management-LKf7BqUr.mjs +0 -5
- package/dist/botnet-feed-nQ-gErTS.mjs +0 -3
- package/dist/brand-protection-DOKv9GRr.mjs +0 -3
- package/dist/browser-rendering-CBExtgGt.mjs +0 -4
- package/dist/build-C_48VvoK.mjs +0 -1056
- package/dist/builds-C_ySULja.mjs +0 -2
- package/dist/cache-BBiiNZHP.mjs +0 -5
- package/dist/calls-DA5Xzwev.mjs +0 -4
- package/dist/certificate-authorities-sXyR_yGp.mjs +0 -2
- package/dist/client-certificates-tV0aCLQJ.mjs +0 -3
- package/dist/cloud-connector-DZfHcSso.mjs +0 -2
- package/dist/cloudforce-one-y1PgQmI9.mjs +0 -21
- package/dist/connectivity-8SOqaFDn.mjs +0 -3
- package/dist/content-scanning-B9y6K_G5.mjs +0 -4
- package/dist/context-DTIbtQn5.mjs +0 -2
- package/dist/custom-certificates-sWksR8Ys.mjs +0 -5
- package/dist/custom-hostnames-91QZkdqN.mjs +0 -5
- package/dist/custom-nameservers-DajZaZvE.mjs +0 -3
- package/dist/custom-pages-Cu7gmwzT.mjs +0 -4
- package/dist/d1-H_VRsVmF.mjs +0 -3
- package/dist/dcv-delegation-C-qhEYEZ.mjs +0 -2
- package/dist/deploy--9wYOkHg.mjs +0 -2
- package/dist/diagnostics-D2B2LPZZ.mjs +0 -3
- package/dist/dispatch-namespaces-CyrXBU_w.mjs +0 -7
- package/dist/dist-DvKjT2TT.mjs +0 -303
- package/dist/dns-Bn9Uz_Nj.mjs +0 -29
- package/dist/dns-firewall-BslP4p-j.mjs +0 -57
- package/dist/durable-objects-BN1ZnHhm.mjs +0 -2
- package/dist/email-routing-n2TnTaRR.mjs +0 -10
- package/dist/email-security-C9SEx0kh.mjs +0 -60
- package/dist/email-sending-DayZ7u3I.mjs +0 -3
- package/dist/filters-CI_XTgfQ.mjs +0 -4
- package/dist/firewall-CcaayGig.mjs +0 -11
- package/dist/fraud-Cr7aPCV8.mjs +0 -8
- package/dist/google-tag-gateway-B3GpYgQ4.mjs +0 -2
- package/dist/healthchecks-CVTsR_OC.mjs +0 -4
- package/dist/hostnames-Bd_Wa5l6.mjs +0 -3
- package/dist/hyperdrive-BBJhEDZd.mjs +0 -18
- package/dist/iam-D_FN0pDF.mjs +0 -6
- package/dist/images-CAP2hAlZ.mjs +0 -5
- package/dist/intel-CkxfzqmJ.mjs +0 -3
- package/dist/keyless-certificates-LcLmHZsX.mjs +0 -3
- package/dist/kv-_TkUQ6fs.mjs +0 -5
- package/dist/leaked-credential-checks-Dhvaen22.mjs +0 -3
- package/dist/load-balancers-Ckr0UIpk.mjs +0 -6
- package/dist/logpush-Cj946hxT.mjs +0 -4
- package/dist/logs-DgC9hjvJ.mjs +0 -3
- package/dist/magic-cloud-networking-WbDvPzuG.mjs +0 -5
- package/dist/magic-network-monitoring-BcHShvGQ.mjs +0 -4
- package/dist/magic-transit-B8sCOkt_.mjs +0 -89
- package/dist/managed-transforms-BpOr-8HY.mjs +0 -3
- package/dist/mtls-certificates-fOul8D5g.mjs +0 -3
- package/dist/network-interconnects-BSW65xlh.mjs +0 -36
- package/dist/organizations-T4vKGFAb.mjs +0 -41
- package/dist/origin-ca-certificates-ChM0lZ64.mjs +0 -3
- package/dist/origin-post-quantum-encryption-C7o26ARh.mjs +0 -2
- package/dist/origin-tls-client-auth-D32dpZk_.mjs +0 -5
- package/dist/output-D7_yAFVR.mjs +0 -2
- package/dist/page-rules-RFoj8CjN.mjs +0 -18
- package/dist/page-shield-VTktzKDN.mjs +0 -37
- package/dist/pages-L1ITjXDZ.mjs +0 -10
- package/dist/pipelines-BPO0Lnil.mjs +0 -6
- package/dist/queues-B0C06L9r.mjs +0 -6
- package/dist/r2-DP020Tmq.mjs +0 -21
- package/dist/r2-data-catalog-Dmipvz5F.mjs +0 -14
- package/dist/radar-DR3VMknH.mjs +0 -2
- package/dist/rate-limits-DnHPBPgU.mjs +0 -5
- package/dist/raw-fetch-DlXYwVA8.mjs +0 -2
- package/dist/realtime-kit-C430aq2d.mjs +0 -6
- package/dist/registrar-7Qy50zbW.mjs +0 -46
- package/dist/request-tracers-sv99NDIl.mjs +0 -2
- package/dist/resource-sharing-uEjC7lnQ.mjs +0 -5
- package/dist/resource-tagging-CiODdP3N.mjs +0 -16
- package/dist/rules-FXAyTrwk.mjs +0 -4
- package/dist/rulesets-B6aUsFFB.mjs +0 -8
- package/dist/rum-CyyGJhp5.mjs +0 -4
- package/dist/schema-validation-ByU49h--.mjs +0 -4
- package/dist/scim-DdTS65_C.mjs +0 -3
- package/dist/scm-CilfPOue.mjs +0 -2
- package/dist/secrets-store-ClOUVhBJ.mjs +0 -18
- package/dist/security-center-4iSBqTrf.mjs +0 -2
- package/dist/security-txt-kGxdkDY6.mjs +0 -3
- package/dist/session-mW-s8ghP.mjs +0 -2
- package/dist/smart-shield-B-SQd2Qp.mjs +0 -3
- package/dist/snippets-Aq58ojqw.mjs +0 -4
- package/dist/spectrum-0gFvGI6y.mjs +0 -59
- package/dist/speed-DAZU8w3T.mjs +0 -4
- package/dist/ssl-BRlXa-5w.mjs +0 -15
- package/dist/stream-BAxsVeBX.mjs +0 -14
- package/dist/tenants-Df6xDqoA.mjs +0 -2
- package/dist/token-validation-pO4dCjCy.mjs +0 -4
- package/dist/turnstile-B1dmO8wE.mjs +0 -23
- package/dist/url-normalization-sUDVmrUt.mjs +0 -3
- package/dist/url-scanner-CwOKRkYo.mjs +0 -2
- package/dist/user-D_UrIdNq.mjs +0 -10
- package/dist/vectorize-BEbBn9G9.mjs +0 -4
- package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
- package/dist/waiting-rooms-BQC-urV4.mjs +0 -11
- package/dist/web3-CIH2iQeX.mjs +0 -4
- package/dist/workers-B9EvrpH3.mjs +0 -16
- package/dist/workers-builds-DzWSiRd2.mjs +0 -7
- package/dist/workflows-aD81gA4k.mjs +0 -4
- package/dist/zaraz-Cg1dsvrZ.mjs +0 -2
- package/dist/zero-trust-D-xQXWcy.mjs +0 -119
- package/dist/zones-DQzucJDd.mjs +0 -28
- /package/dist/{metadata-DGdCpUxn.mjs → metadata-5VwHPW6C.mjs} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,D as t,S as n,T as r,_ as i,i as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f,t as p}from"./input-validation-zEO81MWN.mjs";import{t as m}from"./local-VJaJ3BZ1.mjs";import{t as h}from"./cli-types-CRIDdDw3.mjs";import{n as ee,t as te}from"./raw-fetch-Dlccg0Tr.mjs";function g(e){return e.option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`time-delta`,{type:`string`,description:`Unit of time to group data by.`,choices:[`all`,`auto`,`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:h(g),handler:async e=>{let t={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters,time_delta:e[`time-delta`]};if(e.dryRun){u({command:`cf dns analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_analytics/report/bytime`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.analytics.reports.bytimes.get({zone_id:i,...t})),{successLabel:`Loaded`})}},v={command:`bytimes`,describe:`DNS analytics and reporting`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:y,handler:async e=>{let t={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters};if(e.dryRun){u({command:`cf dns analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_analytics/report`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.analytics.reports.get({zone_id:i,...t})),{successLabel:`Loaded`})}},x={command:`reports`,describe:`DNS analytics and reporting`,builder:e=>e.command(b).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete`,describe:`Delete DNSSEC.`,builder:C,handler:async e=>{if(e.dryRun){u({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}l(await d(`Deleting`,async()=>t.dns.dnssec.delete({zone_id:i})),{successLabel:`Deleted`})}};function T(e){return e.option(`dnssec-multi-signer`,{type:`boolean`,description:`If true, multi-signer DNSSEC is enabled on the zone, allowing multiple
|
|
4
|
+
providers to serve a DNSSEC-signed zone at the same time.
|
|
5
|
+
This is required for DNSKEY records (except those automatically
|
|
6
|
+
generated by Cloudflare) to be added to the zone.
|
|
7
|
+
|
|
8
|
+
See [Multi-signer DNSSEC](https://developers.cloudflare.com/dns/dnssec/multi-signer-dnssec/) for details.`}).option(`dnssec-presigned`,{type:`boolean`,description:`If true, allows Cloudflare to transfer in a DNSSEC-signed zone
|
|
9
|
+
including signatures from an external provider, without requiring
|
|
10
|
+
Cloudflare to sign any records on the fly.
|
|
11
|
+
|
|
12
|
+
Note that this feature has some limitations.
|
|
13
|
+
See [Cloudflare as Secondary](https://developers.cloudflare.com/dns/zone-setups/zone-transfers/cloudflare-as-secondary/setup/#dnssec) for details.`}).option(`dnssec-use-nsec3`,{type:`boolean`,description:`If true, enables the use of NSEC3 together with DNSSEC on the zone.
|
|
14
|
+
Combined with setting dnssec_presigned to true, this enables the use of
|
|
15
|
+
NSEC3 records when transferring in from an external provider.
|
|
16
|
+
If dnssec_presigned is instead set to false (default), NSEC3 records will be
|
|
17
|
+
generated and signed at request time.
|
|
18
|
+
|
|
19
|
+
See [DNSSEC with NSEC3](https://developers.cloudflare.com/dns/dnssec/enable-nsec3/) for details.`}).option(`status`,{type:`string`,description:`Status of DNSSEC, based on user-desired state and presence of necessary records.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit`,describe:`Enable or disable DNSSEC.`,builder:T,handler:async e=>{if(e.dryRun){u({command:`cf dns dnssec edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({dnssec_multi_signer:e[`dnssec-multi-signer`],dnssec_presigned:e[`dnssec-presigned`],dnssec_use_nsec3:e[`dnssec-use-nsec3`],status:f(e.status,`status`,`text`)}):s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Updating`,async()=>t.dns.dnssec.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let i=c({dnssec_multi_signer:e[`dnssec-multi-signer`],dnssec_presigned:e[`dnssec-presigned`],dnssec_use_nsec3:e[`dnssec-use-nsec3`],status:f(e.status,`status`,`text`)});l(await d(`Updating`,async()=>t.dns.dnssec.edit({...i,zone_id:r})),{successLabel:`Updated`})}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Details about DNSSEC status and configuration.`,builder:D,handler:async e=>{if(e.dryRun){u({command:`cf dns dnssec get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.dnssec.get({zone_id:r})),{successLabel:`Loaded`})}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`zsks`,describe:`List the Zone Signing Keys (ZSKs) that DNSSEC uses for the zone.`,builder:k,handler:async e=>{if(e.dryRun){u({command:`cf dns dnssec list zsks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec/zsk`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.dnssec.list.zsks({zone_id:r})),{successLabel:`Loaded`})}},j={command:`list`,describe:`Operations for dnssec.list`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`dnssec`,describe:`Operations for dnssec`,builder:e=>e.command(w).command(E).command(O).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`batch`,describe:`Send a Batch of DNS Record API calls to be executed together. Notes: - Although Cloudflare will execute the batched operations in a single database transaction, Cloudflare's distributed KV store must treat each record change as a single key-value pair. This means that the propagation of changes is not atomic. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/batch-record-changes/ "Batch DNS records") for more information. - The operations you specify within the /batch request body are always executed in the following order: - Deletes - Patches - Puts - Posts`,builder:N,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){u({command:`cf dns records batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=s(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),l(await d(`Creating`,async()=>r.dns.records.batch({...n,zone_id:i,...t})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>r.dns.records.batch({zone_id:i,...t})),{successLabel:`Created`})}};function F(e){return e.option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`create`,describe:`Create a new DNS record for a zone. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:F,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){u({command:`cf dns records create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=s(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),l(await d(`Creating`,async()=>r.dns.records.create({body:n,zone_id:i,...t})),{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 L(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const R={command:`delete <dns-record-id>`,describe:`Permanently removes a DNS record from the zone.`,builder:L,handler:async e=>{if(e.dryRun){u({command:`cf dns records delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
20
|
+
`);return}l(await d(`Deleting`,async()=>t.dns.records.delete({zone_id:i,dns_record_id:e[`dns-record-id`]})),{successLabel:`Deleted`})}};function z(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`edit <dns-record-id>`,describe:`Update an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:z,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){u({command:`cf dns records edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=s(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),l(await d(`Updating`,async()=>r.dns.records.edit({body:n,zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{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 V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`export`,describe:`You can export your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:V,handler:async e=>{if(e.dryRun){u({command:`cf dns records export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/export`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e);e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),ee((await d(`Loading`,async()=>te(`/zones/${e.zoneId}/dns_records/export`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}))).toString(`utf-8`))}};function U(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <dns-record-id>`,describe:`Retrieves details for a specific DNS record in the zone.`,builder:U,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){u({command:`cf dns records get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.records.get({zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{successLabel:`Loaded`})}};function G(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`proxied`,{type:`string`,description:"Whether or not proxiable records should receive the performance and security benefits of Cloudflare. The value should be either `true` or `false`."})}const K={command:`import`,describe:`You can upload your [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this endpoint. It assumes that cURL is called from a location with bind_config.txt (valid BIND config) present. See [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") for more information.`,builder:G,handler:async e=>{if(e.dryRun){u({command:`cf dns records import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/import`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,proxied:e.proxied}});return}let t=await o(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.file!==void 0||e.body!==void 0||e.proxied!==void 0){let n=new FormData;if(e.file){let t=p(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e.proxied!==void 0&&n.append(`proxied`,String(f(e.proxied,`proxied`,`text`)??``)),l(await d(`Creating`,async()=>a(t,`POST`,`/zones/${e.zoneId}/dns_records/import`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=f(e.body,`body`,`binary`);l(await d(`Creating`,async()=>a(t,`POST`,`/zones/${e.zoneId}/dns_records/import`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{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 q(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS record name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS record name. Name filters are case-insensitive.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS record name. Name filters are case-insensitive.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS record name. Name filters are case-insensitive.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS record name. Name filters are case-insensitive.`}).option(`type`,{type:`string`,description:`Record type.`,choices:[`A`,`AAAA`,`CAA`,`CERT`,`CNAME`,`DNSKEY`,`DS`,`HTTPS`,`LOC`,`MX`,`NAPTR`,`NS`,`OPENPGPKEY`,`PTR`,`SMIMEA`,`SRV`,`SSHFP`,`SVCB`,`TLSA`,`TXT`,`URI`]}).option(`content`,{type:`string`,description:"Exact value of the DNS record content. This is a convenience alias for `content.exact`."}).option(`content-exact`,{type:`string`,description:`Exact value of the DNS record content. Content filters are case-insensitive.`}).option(`content-contains`,{type:`string`,description:`Substring of the DNS record content. Content filters are case-insensitive.`}).option(`content-startswith`,{type:`string`,description:`Prefix of the DNS record content. Content filters are case-insensitive.`}).option(`content-endswith`,{type:`string`,description:`Suffix of the DNS record content. Content filters are case-insensitive.`}).option(`proxied`,{type:`boolean`,description:`Whether the record is receiving the performance and security benefits of Cloudflare.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.",choices:[`any`,`all`]}).option(`comment`,{type:`string`,description:"Exact value of the DNS record comment. This is a convenience alias for `comment.exact`."}).option(`comment-present`,{type:`string`,description:`If this parameter is present, only records *with* a comment are returned.`}).option(`comment-absent`,{type:`string`,description:`If this parameter is present, only records *without* a comment are returned.`}).option(`comment-exact`,{type:`string`,description:`Exact value of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-contains`,{type:`string`,description:`Substring of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-startswith`,{type:`string`,description:`Prefix of the DNS record comment. Comment filters are case-insensitive.`}).option(`comment-endswith`,{type:`string`,description:`Suffix of the DNS record comment. Comment filters are case-insensitive.`}).option(`tag`,{type:`string`,description:"Condition on the DNS record tag.\n\nParameter values can be of the form `<tag-name>:<tag-value>` to search for an exact `name:value` pair, or just `<tag-name>` to search for records with a specific tag name regardless of its value.\n\nThis is a convenience shorthand for the more powerful `tag.<predicate>` parameters.\nExamples:\n- `tag=important` is equivalent to `tag.present=important`\n- `tag=team:DNS` is equivalent to `tag.exact=team:DNS`"}).option(`tag-present`,{type:`string`,description:`Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-absent`,{type:`string`,description:`Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.`}).option(`tag-exact`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value is `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-contains`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value contains `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-startswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value starts with `<tag-value>`. Tag filters are case-insensitive."}).option(`tag-endswith`,{type:`string`,description:"A tag and value, of the form `<tag-name>:<tag-value>`. The API will only return DNS records that have a tag named `<tag-name>` whose value ends with `<tag-value>`. Tag filters are case-insensitive."}).option(`search`,{type:`string`,description:"Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters."}).option(`tag-match`,{type:`string`,description:"Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS records per page.`}).option(`order`,{type:`string`,description:`Field to order DNS records by.`,choices:[`type`,`name`,`content`,`ttl`,`proxied`]}).option(`direction`,{type:`string`,description:`Direction to order DNS records in.`,choices:[`asc`,`desc`]}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowed-by-name`,{type:`string`,description:"Filters to records at or below the given NS delegation name, excluding the NS records that form the delegation itself. The value must be a subdomain of the zone; the zone apex is not accepted. Requires `include_shadow_metadata=true`. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`shadowing-name`,{type:`string`,description:`Returns NS records that shadow the given name, searching at the name itself and each of its ancestor names within the zone, excluding the zone apex. The value must be a subdomain of the zone; the zone apex is not accepted. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List, search, sort, and filter a zones' DNS records.`,builder:h(q),handler:async e=>{let t={name:e.name,"name.exact":e[`name-exact`],"name.contains":e[`name-contains`],"name.startswith":e[`name-startswith`],"name.endswith":e[`name-endswith`],type:e.type,content:e.content,"content.exact":e[`content-exact`],"content.contains":e[`content-contains`],"content.startswith":e[`content-startswith`],"content.endswith":e[`content-endswith`],proxied:e.proxied,match:e.match,comment:e.comment,"comment.present":e[`comment-present`],"comment.absent":e[`comment-absent`],"comment.exact":e[`comment-exact`],"comment.contains":e[`comment-contains`],"comment.startswith":e[`comment-startswith`],"comment.endswith":e[`comment-endswith`],tag:e.tag,"tag.present":e[`tag-present`],"tag.absent":e[`tag-absent`],"tag.exact":e[`tag-exact`],"tag.contains":e[`tag-contains`],"tag.startswith":e[`tag-startswith`],"tag.endswith":e[`tag-endswith`],search:e.search,tag_match:e[`tag-match`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,include_shadow_metadata:e[`include-shadow-metadata`],shadowed_by_name:e[`shadowed-by-name`],shadowing_name:e[`shadowing-name`]};if(e.dryRun){u({command:`cf dns records list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.dns.records.list({zone_id:i,...t})),{successLabel:`Loaded`})}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`scan-list`,describe:"Retrieves the list of DNS records discovered up to this point by the asynchronous scan. These records are temporary until explicitly accepted or rejected via `POST /scan/review`. Additional records may be discovered by the scan later.",builder:Y,handler:async e=>{if(e.dryRun){u({command:`cf dns records scan-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.records.scanList({zone_id:r})),{successLabel:`Loaded`})}};function Z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`scan-review`,describe:`Accept or reject DNS records found by the DNS records scan. Accepted records will be permanently added to the zone, while rejected records will be permanently deleted.`,builder:Z,handler:async e=>{if(e.dryRun){u({command:`cf dns records scan-review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/review`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Creating`,async()=>t.dns.records.scanReview({...n,zone_id:r})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>t.dns.records.scanReview({zone_id:r})),{successLabel:`Created`})}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`scan-trigger`,describe:"Initiates an asynchronous scan for common DNS records on your domain. Note that this **does not** automatically add records to your zone. The scan runs in the background, and results can be reviewed later using the `/scan/review` endpoints. Useful if you haven't updated your nameservers yet.",builder:ne,handler:async e=>{if(e.dryRun){u({command:`cf dns records scan-trigger`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan/trigger`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Creating`,async()=>t.dns.records.scanTrigger({zone_id:r})),{successLabel:`Created`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`scan`,describe:`Scan for common DNS records on your domain and automatically add them to your zone. Useful if you haven't updated your nameservers yet.`,builder:ie,handler:async e=>{if(e.dryRun){u({command:`cf dns records scan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/scan`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Creating`,async()=>t.dns.records.scan({zone_id:r})),{successLabel:`Created`})}};function oe(e){return e.positional(`dns-record-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`include-shadow-metadata`,{type:`boolean`,description:"Whether to include shadow metadata in the `meta` field of each record in the response. See [Shadowed records](https://developers.cloudflare.com/dns/manage-dns-records/reference/shadowed-records)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`update <dns-record-id>`,describe:`Overwrite an existing DNS record. Notes: - A/AAAA records cannot exist on the same name as CNAME records. - NS records cannot exist on the same name as any other record type. - Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.`,builder:oe,handler:async e=>{let t={include_shadow_metadata:e[`include-shadow-metadata`]};if(e.dryRun){u({command:`cf dns records update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/${e[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(e[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(e[`dns-record-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=s(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),l(await d(`Updating`,async()=>r.dns.records.update({body:n,zone_id:i,dns_record_id:e[`dns-record-id`],...t})),{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.`)}},ce={command:`records`,describe:`Operations for records`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).command(W).command(K).command(J).command(ae).command(X).command(Q).command(re).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`enforce-dns-only`,{type:`boolean`,description:`When enabled, forces all proxied DNS records in the account to behave as DNS-only at the edge, regardless of each record's individual proxy setting. Note that this account-level override does not modify the records themselves; it only affects how they are served at the edge. See more on [Enforce DNS-only](https://developers.cloudflare.com/dns/proxy-status/enforce-dns-only).`}).option(`zone-defaults-flatten-all-cnames`,{type:`boolean`,description:`Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.`}).option(`zone-defaults-foundation-dns`,{type:`boolean`,description:`Whether to enable Foundation DNS Advanced Nameservers on the zone.`}).option(`zone-defaults-internal-dns-reference-zone-id`,{type:`string`,description:`The ID of the zone to fallback to.`}).option(`zone-defaults-multi-provider`,{type:`boolean`,description:`Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.`}).option(`zone-defaults-ns-ttl`,{type:`number`,description:`The time to live (TTL) of the zone's nameserver (NS) records.`}).option(`zone-defaults-secondary-overrides`,{type:`boolean`,description:`Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.`}).option(`zone-defaults-soa-expire`,{type:`number`,description:`Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.`}).option(`zone-defaults-soa-min-ttl`,{type:`number`,description:`The time to live (TTL) for negative caching of records within the zone.`}).option(`zone-defaults-soa-mname`,{type:`string`,description:`The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.`}).option(`zone-defaults-soa-refresh`,{type:`number`,description:`Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.`}).option(`zone-defaults-soa-retry`,{type:`number`,description:`Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.`}).option(`zone-defaults-soa-rname`,{type:`string`,description:`The email address of the zone administrator, with the first label representing the local part of the email address.`}).option(`zone-defaults-soa-ttl`,{type:`number`,description:`The time to live (TTL) of the SOA record itself.`}).option(`zone-defaults-zone-mode`,{type:`string`,description:`Whether the zone mode is a regular or CDN/DNS only zone.`,choices:[`standard`,`cdn_only`,`dns_only`]}).option(`zone-defaults-nameservers-type`,{type:`string`,description:`Nameserver type`,choices:[`cloudflare.standard`,`cloudflare.standard.random`,`custom.account`,`custom.tenant`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`edit`,describe:`Update DNS settings for an account`,builder:le,handler:async t=>{if(t.dryRun){u({command:`cf dns settings account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?c({enforce_dns_only:t[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:t[`zone-defaults-flatten-all-cnames`],foundation_dns:t[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:f(t[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:t[`zone-defaults-multi-provider`],ns_ttl:t[`zone-defaults-ns-ttl`],secondary_overrides:t[`zone-defaults-secondary-overrides`],soa:{expire:t[`zone-defaults-soa-expire`],min_ttl:t[`zone-defaults-soa-min-ttl`],mname:f(t[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:t[`zone-defaults-soa-refresh`],retry:t[`zone-defaults-soa-retry`],rname:f(t[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:t[`zone-defaults-soa-ttl`]},zone_mode:f(t[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:f(t[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.dns.settings.account.edit({...e,account_id:r})),{successLabel:`Updated`});return}let a=c({enforce_dns_only:t[`enforce-dns-only`],zone_defaults:{flatten_all_cnames:t[`zone-defaults-flatten-all-cnames`],foundation_dns:t[`zone-defaults-foundation-dns`],internal_dns:{reference_zone_id:f(t[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)},multi_provider:t[`zone-defaults-multi-provider`],ns_ttl:t[`zone-defaults-ns-ttl`],secondary_overrides:t[`zone-defaults-secondary-overrides`],soa:{expire:t[`zone-defaults-soa-expire`],min_ttl:t[`zone-defaults-soa-min-ttl`],mname:f(t[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`),refresh:t[`zone-defaults-soa-refresh`],retry:t[`zone-defaults-soa-retry`],rname:f(t[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`),ttl:t[`zone-defaults-soa-ttl`]},zone_mode:f(t[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`),nameservers:{type:f(t[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)}}});l(await d(`Updating`,async()=>n.dns.settings.account.edit({...a,account_id:r})),{successLabel:`Updated`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get`,describe:`Show DNS settings for an account`,builder:de,handler:async t=>{if(t.dryRun){u({command:`cf dns settings account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.settings.account.get({account_id:r})),{successLabel:`Loaded`})}};function pe(e){return e.option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`create`,describe:`Create Internal DNS View for an account`,builder:pe,handler:async t=>{if(t.dryRun){u({command:`cf dns settings account views create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings/views`,pathParams:{},bodyKind:`json`,body:t.body===void 0?c({name:f(t.name,`name`,`text`),zones:t.zones}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.dns.settings.account.views.create({...e,account_id:r})),{successLabel:`Created`});return}let a=c({name:f(t.name,`name`,`text`),zones:t.zones});l(await d(`Creating`,async()=>n.dns.settings.account.views.create({...a,account_id:r})),{successLabel:`Created`})}};function he(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ge={command:`delete <view-id>`,describe:`Delete an existing Internal DNS View`,builder:he,handler:async t=>{if(t.dryRun){u({command:`cf dns settings account views delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings/views/${t[`view-id`]==null?`<view-id>`:encodeURIComponent(String(t[`view-id`]))}`,pathParams:{"view-id":String(t[`view-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
21
|
+
`);return}l(await d(`Deleting`,async()=>n.dns.settings.account.views.delete({account_id:a,view_id:t[`view-id`]})),{successLabel:`Deleted`})}};function _e(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the view.`}).option(`zones`,{type:`string`,array:!0,description:`The list of zones linked to this view.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`edit <view-id>`,describe:`Update an existing Internal DNS View`,builder:_e,handler:async t=>{if(t.dryRun){u({command:`cf dns settings account views edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings/views/${t[`view-id`]==null?`<view-id>`:encodeURIComponent(String(t[`view-id`]))}`,pathParams:{"view-id":String(t[`view-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({name:f(t.name,`name`,`text`),zones:t.zones}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.dns.settings.account.views.edit({...e,account_id:r,view_id:t[`view-id`]})),{successLabel:`Updated`});return}let a=c({name:f(t.name,`name`,`text`),zones:t.zones});l(await d(`Updating`,async()=>n.dns.settings.account.views.edit({...a,account_id:r,view_id:t[`view-id`]})),{successLabel:`Updated`})}};function ye(e){return e.positional(`view-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <view-id>`,describe:`Get DNS Internal View`,builder:ye,handler:async t=>{if(t.dryRun){u({command:`cf dns settings account views get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings/views/${t[`view-id`]==null?`<view-id>`:encodeURIComponent(String(t[`view-id`]))}`,pathParams:{"view-id":String(t[`view-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.settings.account.views.get({account_id:r,view_id:t[`view-id`]})),{successLabel:`Loaded`})}};function xe(e){return e.option(`name`,{type:`string`,description:"Exact value of the DNS view name. This is a convenience alias for `name.exact`."}).option(`name-exact`,{type:`string`,description:`Exact value of the DNS view name.`}).option(`name-contains`,{type:`string`,description:`Substring of the DNS view name.`}).option(`name-startswith`,{type:`string`,description:`Prefix of the DNS view name.`}).option(`name-endswith`,{type:`string`,description:`Suffix of the DNS view name.`}).option(`zone-id`,{type:`string`,description:`A zone ID that exists in the zones list for the view.`}).option(`zone-name`,{type:`string`,description:`A zone name that exists in the zones list for the view.`}).option(`match`,{type:`string`,description:"Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of DNS views per page.`}).option(`order`,{type:`string`,description:`Field to order DNS views by.`,choices:[`name`,`created_on`,`modified_on`]}).option(`direction`,{type:`string`,description:`Direction to order DNS views in.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List DNS Internal Views for an Account`,builder:h(xe),handler:async t=>{let n={name:t.name,"name.exact":t[`name-exact`],"name.contains":t[`name-contains`],"name.startswith":t[`name-startswith`],"name.endswith":t[`name-endswith`],zone_id:t[`zone-id`],zone_name:t[`zone-name`],match:t.match,page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){u({command:`cf dns settings account views list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_settings/views`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.dns.settings.account.views.list({account_id:a,...n})),{successLabel:`Loaded`})}},Ce={command:`views`,describe:`Operations for settings.account.views`,builder:e=>e.command(me).command(ge).command(ve).command(be).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`account`,describe:`Operations for settings.account`,builder:e=>e.command(ue).command(fe).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.option(`flatten-all-cnames`,{type:`boolean`,description:`Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations, a CNAME record at the zone apex will always be flattened.`}).option(`foundation-dns`,{type:`boolean`,description:`Whether to enable Foundation DNS Advanced Nameservers on the zone.`}).option(`internal-dns-reference-zone-id`,{type:`string`,description:`The ID of the zone to fallback to.`}).option(`multi-provider`,{type:`boolean`,description:`Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist, and to respect NS records at the zone apex during outbound zone transfers.`}).option(`ns-ttl`,{type:`number`,description:`The time to live (TTL) of the zone's nameserver (NS) records.`}).option(`secondary-overrides`,{type:`boolean`,description:`Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.`}).option(`soa-expire`,{type:`number`,description:`Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.`}).option(`soa-min-ttl`,{type:`number`,description:`The time to live (TTL) for negative caching of records within the zone.`}).option(`soa-mname`,{type:`string`,description:`The primary nameserver, which may be used for outbound zone transfers. If null, a Cloudflare-assigned value will be used.`}).option(`soa-refresh`,{type:`number`,description:`Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.`}).option(`soa-retry`,{type:`number`,description:`Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.`}).option(`soa-rname`,{type:`string`,description:`The email address of the zone administrator, with the first label representing the local part of the email address.`}).option(`soa-ttl`,{type:`number`,description:`The time to live (TTL) of the SOA record itself.`}).option(`zone-mode`,{type:`string`,description:`Whether the zone mode is a regular or CDN/DNS only zone.`,choices:[`standard`,`cdn_only`,`dns_only`]}).option(`nameservers-ns-set`,{type:`number`,description:`Configured nameserver set to be used for this zone`}).option(`nameservers-type`,{type:`string`,description:`Nameserver type`,choices:[`cloudflare.standard`,`custom.account`,`custom.tenant`,`custom.zone`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`edit`,describe:`Update DNS settings for a zone`,builder:Te,handler:async e=>{if(e.dryRun){u({command:`cf dns settings zone edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({flatten_all_cnames:e[`flatten-all-cnames`],foundation_dns:e[`foundation-dns`],internal_dns:{reference_zone_id:f(e[`internal-dns-reference-zone-id`],`internal-dns-reference-zone-id`,`text`)},multi_provider:e[`multi-provider`],ns_ttl:e[`ns-ttl`],secondary_overrides:e[`secondary-overrides`],soa:{expire:e[`soa-expire`],min_ttl:e[`soa-min-ttl`],mname:f(e[`soa-mname`],`soa-mname`,`text`),refresh:e[`soa-refresh`],retry:e[`soa-retry`],rname:f(e[`soa-rname`],`soa-rname`,`text`),ttl:e[`soa-ttl`]},zone_mode:f(e[`zone-mode`],`zone-mode`,`text`),nameservers:{ns_set:e[`nameservers-ns-set`],type:f(e[`nameservers-type`],`nameservers-type`,`text`)}}):s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Updating`,async()=>t.dns.settings.zone.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let i=c({flatten_all_cnames:e[`flatten-all-cnames`],foundation_dns:e[`foundation-dns`],internal_dns:{reference_zone_id:f(e[`internal-dns-reference-zone-id`],`internal-dns-reference-zone-id`,`text`)},multi_provider:e[`multi-provider`],ns_ttl:e[`ns-ttl`],secondary_overrides:e[`secondary-overrides`],soa:{expire:e[`soa-expire`],min_ttl:e[`soa-min-ttl`],mname:f(e[`soa-mname`],`soa-mname`,`text`),refresh:e[`soa-refresh`],retry:e[`soa-retry`],rname:f(e[`soa-rname`],`soa-rname`,`text`),ttl:e[`soa-ttl`]},zone_mode:f(e[`zone-mode`],`zone-mode`,`text`),nameservers:{ns_set:e[`nameservers-ns-set`],type:f(e[`nameservers-type`],`nameservers-type`,`text`)}});l(await d(`Updating`,async()=>t.dns.settings.zone.edit({...i,zone_id:r})),{successLabel:`Updated`})}};function De(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`get`,describe:`Show DNS settings for a zone`,builder:De,handler:async e=>{if(e.dryRun){u({command:`cf dns settings zone get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.settings.zone.get({zone_id:r})),{successLabel:`Loaded`})}},ke={command:`zone`,describe:`Operations for settings.zone`,builder:e=>e.command(Ee).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ae={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(we).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`get`,describe:`Get the current DNS record usage and quota for an account. May include internal DNS usage and quota.`,builder:je,handler:async t=>{if(t.dryRun){u({command:`cf dns usage account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_records/usage`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.usage.account.get({account_id:r})),{successLabel:`Loaded`})}},Ne={command:`account`,describe:`Operations for usage.account`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`get`,describe:`Get the current DNS record usage for a zone, including the number of records and the quota limit.`,builder:Pe,handler:async e=>{if(e.dryRun){u({command:`cf dns usage zone get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dns_records/usage`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.usage.zone.get({zone_id:r})),{successLabel:`Loaded`})}},Ie={command:`zone`,describe:`Operations for usage.zone`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Le={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(Ne).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Re(e){return e.option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ze={command:`create`,describe:`Create ACL.`,builder:Re,handler:async n=>{if(n.dryRun){u({command:`cf dns zone-transfers acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({ip_range:f(n[`ip-range`],`ip-range`,`text`),name:f(n.name,`name`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.dns.zoneTransfers.acls.create({...e,account_id:a})),{successLabel:`Created`});return}n[`ip-range`]===void 0&&(n[`ip-range`]=await t(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),n.name===void 0&&(n.name=await t(`name`,`The name of the acl.`));let p=c({ip_range:f(n[`ip-range`],`ip-range`,`text`),name:f(n.name,`name`,`text`)});l(await d(`Creating`,async()=>r.dns.zoneTransfers.acls.create({...p,account_id:a})),{successLabel:`Created`})}};function Be(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ve={command:`delete <acl-id>`,describe:`Delete ACL.`,builder:Be,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"acl-id":String(t[`acl-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}l(await d(`Deleting`,async()=>n.dns.zoneTransfers.acls.delete({account_id:a,acl_id:t[`acl-id`]})),{successLabel:`Deleted`})}};function He(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`get <acl-id>`,describe:`Get ACL.`,builder:He,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"acl-id":String(t[`acl-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.zoneTransfers.acls.get({account_id:r,acl_id:t[`acl-id`]})),{successLabel:`Loaded`})}};function We(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`list`,describe:`List ACLs.`,builder:We,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.zoneTransfers.acls.list({account_id:r})),{successLabel:`Loaded`})}};function Ke(e){return e.positional(`acl-id`,{type:`string`,description:`Acl ID`,demandOption:!0}).option(`ip-range`,{type:`string`,description:`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`}).option(`name`,{type:`string`,description:`The name of the acl.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qe={command:`update <acl-id>`,describe:`Modify ACL.`,builder:Ke,handler:async n=>{if(n.dryRun){u({command:`cf dns zone-transfers acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/acls/${n[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(n[`acl-id`]))}`,pathParams:{"acl-id":String(n[`acl-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({ip_range:f(n[`ip-range`],`ip-range`,`text`),name:f(n.name,`name`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Updating`,async()=>r.dns.zoneTransfers.acls.update({body:e,account_id:a,acl_id:n[`acl-id`]})),{successLabel:`Updated`});return}n[`ip-range`]===void 0&&(n[`ip-range`]=await t(`ip-range`,`Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively.`)),n.name===void 0&&(n.name=await t(`name`,`The name of the acl.`));let p=c({ip_range:f(n[`ip-range`],`ip-range`,`text`),name:f(n.name,`name`,`text`)});l(await d(`Updating`,async()=>r.dns.zoneTransfers.acls.update({body:p,account_id:a,acl_id:n[`acl-id`]})),{successLabel:`Updated`})}},Je={command:`acls`,describe:`Operations for zone-transfers.acls`,builder:e=>e.command(ze).command(Ve).command(Ue).command(Ge).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`create`,describe:`Sends AXFR zone transfer request to primary nameserver(s).`,builder:Ye,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers force-axfr create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/force_axfr`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Creating`,async()=>t.dns.zoneTransfers.forceAxfr.create({zone_id:r})),{successLabel:`Created`})}},Ze={command:`force-axfr`,describe:`Operations for zone-transfers.force-axfr`,builder:e=>e.command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
|
|
23
|
+
Not applicable for primary zones.`,default:86400}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $e={command:`create`,describe:`Create secondary zone configuration for incoming zone transfers.`,builder:Qe,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers incoming create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers}):s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>r.dns.zoneTransfers.incoming.create({body:t,zone_id:i})),{successLabel:`Created`});return}if(e[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await t(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let a=c({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers});l(await d(`Creating`,async()=>r.dns.zoneTransfers.incoming.create({body:a,zone_id:i})),{successLabel:`Created`})}};function et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tt={command:`delete`,describe:`Delete secondary zone configuration for incoming zone transfers.`,builder:et,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers incoming delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}l(await d(`Deleting`,async()=>t.dns.zoneTransfers.incoming.delete({zone_id:i})),{successLabel:`Deleted`})}};function nt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`get`,describe:`Get secondary zone configuration for incoming zone transfers.`,builder:nt,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers incoming get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.zoneTransfers.incoming.get({zone_id:r})),{successLabel:`Loaded`})}};function it(e){return e.option(`auto-refresh-seconds`,{type:`number`,description:`How often should a secondary zone auto refresh regardless of DNS NOTIFY.
|
|
25
|
+
Not applicable for primary zones.`}).option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const at={command:`update`,describe:`Update secondary zone configuration for incoming zone transfers.`,builder:it,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers incoming update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers}):s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>r.dns.zoneTransfers.incoming.update({body:t,zone_id:i})),{successLabel:`Updated`});return}if(e[`auto-refresh-seconds`]===void 0)throw Error(`--auto-refresh-seconds is required (or pass --body with this field set).`);if(e.name===void 0&&(e.name=await t(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let a=c({auto_refresh_seconds:e[`auto-refresh-seconds`],name:f(e.name,`name`,`text`),peers:e.peers});l(await d(`Updating`,async()=>r.dns.zoneTransfers.incoming.update({body:a,zone_id:i})),{successLabel:`Updated`})}},ot={command:`incoming`,describe:`Operations for zone-transfers.incoming`,builder:e=>e.command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ct={command:`create`,describe:`Create primary zone configuration for outgoing zone transfers.`,builder:st,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`),peers:e.peers}):s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>r.dns.zoneTransfers.outgoing.create({body:t,zone_id:i})),{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await t(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let a=c({name:f(e.name,`name`,`text`),peers:e.peers});l(await d(`Creating`,async()=>r.dns.zoneTransfers.outgoing.create({body:a,zone_id:i})),{successLabel:`Created`})}};function lt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ut={command:`delete`,describe:`Delete primary zone configuration for outgoing zone transfers.`,builder:lt,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
26
|
+
`);return}l(await d(`Deleting`,async()=>t.dns.zoneTransfers.outgoing.delete({zone_id:i})),{successLabel:`Deleted`})}};function dt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ft={command:`disable`,describe:`Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone.`,builder:dt,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force,message:`This operation turns off outgoing zone transfers for the primary zone, which means secondary zones will stop receiving updates.`})){process.stderr.write(`Aborted.
|
|
27
|
+
`);return}l(await d(`Deleting`,async()=>t.dns.zoneTransfers.outgoing.disable({zone_id:i})),{successLabel:`Deleted`})}};function pt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mt={command:`enable`,describe:`Enable outgoing zone transfers for primary zone.`,builder:pt,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Creating`,async()=>t.dns.zoneTransfers.outgoing.enable({zone_id:r})),{successLabel:`Created`})}};function ht(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gt={command:`force-notify`,describe:`Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.`,builder:ht,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing force-notify`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/force_notify`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Creating`,async()=>t.dns.zoneTransfers.outgoing.forceNotify({zone_id:r})),{successLabel:`Created`})}};function _t(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`get`,describe:`Get primary zone configuration for outgoing zone transfers.`,builder:_t,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.zoneTransfers.outgoing.get({zone_id:r})),{successLabel:`Loaded`})}};function yt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bt={command:`get`,describe:`Get primary zone transfer status.`,builder:yt,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing/status`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.dns.zoneTransfers.outgoing.status.get({zone_id:r})),{successLabel:`Loaded`})}},xt={command:`status`,describe:`Operations for zone-transfers.outgoing.status`,builder:e=>e.command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function St(e){return e.option(`name`,{type:`string`,description:`Zone name.`}).option(`peers`,{type:`string`,array:!0,description:`A list of peer tags.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ct={command:`update`,describe:`Update primary zone configuration for outgoing zone transfers.`,builder:St,handler:async e=>{if(e.dryRun){u({command:`cf dns zone-transfers outgoing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`),peers:e.peers}):s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>r.dns.zoneTransfers.outgoing.update({body:t,zone_id:i})),{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await t(`name`,`Zone name.`)),e.peers===void 0)throw Error(`--peers is required (or pass --body with this field set).`);let a=c({name:f(e.name,`name`,`text`),peers:e.peers});l(await d(`Updating`,async()=>r.dns.zoneTransfers.outgoing.update({body:a,zone_id:i})),{successLabel:`Updated`})}},wt={command:`outgoing`,describe:`Operations for zone-transfers.outgoing`,builder:e=>e.command(ct).command(ut).command(ft).command(mt).command(gt).command(vt).command(Ct).command(xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(e){return e.option(`name`,{type:`string`,description:`The name of the peer.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Et={command:`create`,describe:`Create Peer.`,builder:Tt,handler:async n=>{if(n.dryRun){u({command:`cf dns zone-transfers peers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({name:f(n.name,`name`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.dns.zoneTransfers.peers.create({...e,account_id:a})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`The name of the peer.`));let p=c({name:f(n.name,`name`,`text`)});l(await d(`Creating`,async()=>r.dns.zoneTransfers.peers.create({...p,account_id:a})),{successLabel:`Created`})}};function Dt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ot={command:`delete <peer-id>`,describe:`Delete Peer.`,builder:Dt,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers peers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/peers/${t[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(t[`peer-id`]))}`,pathParams:{"peer-id":String(t[`peer-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
28
|
+
`);return}l(await d(`Deleting`,async()=>n.dns.zoneTransfers.peers.delete({account_id:a,peer_id:t[`peer-id`]})),{successLabel:`Deleted`})}};function kt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`get <peer-id>`,describe:`Get Peer.`,builder:kt,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers peers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/peers/${t[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(t[`peer-id`]))}`,pathParams:{"peer-id":String(t[`peer-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.zoneTransfers.peers.get({account_id:r,peer_id:t[`peer-id`]})),{successLabel:`Loaded`})}};function jt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`list`,describe:`List Peers.`,builder:jt,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers peers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.zoneTransfers.peers.list({account_id:r})),{successLabel:`Loaded`})}};function Nt(e){return e.positional(`peer-id`,{type:`string`,description:`Peer ID`,demandOption:!0}).option(`ip`,{type:`string`,description:`IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to.`}).option(`ixfr-enable`,{type:`boolean`,description:`Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones.`}).option(`name`,{type:`string`,description:`The name of the peer.`}).option(`port`,{type:`number`,description:`DNS port of primary or secondary nameserver, depending on what zone this peer is linked to.`}).option(`tsig-id`,{type:`string`,description:`TSIG authentication will be used for zone transfer if configured.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $={command:`update <peer-id>`,describe:`Modify Peer.`,builder:Nt,handler:async n=>{if(n.dryRun){u({command:`cf dns zone-transfers peers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/peers/${n[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(n[`peer-id`]))}`,pathParams:{"peer-id":String(n[`peer-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({ip:f(n.ip,`ip`,`text`),ixfr_enable:n[`ixfr-enable`],name:f(n.name,`name`,`text`),port:n.port,tsig_id:f(n[`tsig-id`],`tsig-id`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Updating`,async()=>r.dns.zoneTransfers.peers.update({body:e,account_id:a,peer_id:n[`peer-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await t(`name`,`The name of the peer.`));let p=c({ip:f(n.ip,`ip`,`text`),ixfr_enable:n[`ixfr-enable`],name:f(n.name,`name`,`text`),port:n.port,tsig_id:f(n[`tsig-id`],`tsig-id`,`text`)});l(await d(`Updating`,async()=>r.dns.zoneTransfers.peers.update({body:p,account_id:a,peer_id:n[`peer-id`]})),{successLabel:`Updated`})}},Pt={command:`peers`,describe:`Operations for zone-transfers.peers`,builder:e=>e.command(Et).command(Ot).command(At).command(Mt).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ft(e){return e.option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const It={command:`create`,describe:`Create TSIG.`,builder:Ft,handler:async n=>{if(n.dryRun){u({command:`cf dns zone-transfers tsigs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({algo:f(n.algo,`algo`,`text`),name:f(n.name,`name`,`text`),secret:f(n.secret,`secret`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.dns.zoneTransfers.tsigs.create({body:e,account_id:a})),{successLabel:`Created`});return}n.algo===void 0&&(n.algo=await t(`algo`,`TSIG algorithm.`)),n.name===void 0&&(n.name=await t(`name`,`TSIG key name.`)),n.secret===void 0&&(n.secret=await t(`secret`,`TSIG secret.`,{kind:`secret`}));let p=c({algo:f(n.algo,`algo`,`text`),name:f(n.name,`name`,`text`),secret:f(n.secret,`secret`,`text`)});l(await d(`Creating`,async()=>r.dns.zoneTransfers.tsigs.create({body:p,account_id:a})),{successLabel:`Created`})}};function Lt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Rt={command:`delete <tsig-id>`,describe:`Delete TSIG.`,builder:Lt,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers tsigs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/tsigs/${t[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(t[`tsig-id`]))}`,pathParams:{"tsig-id":String(t[`tsig-id`]??``)},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
|
|
29
|
+
`);return}l(await d(`Deleting`,async()=>n.dns.zoneTransfers.tsigs.delete({account_id:a,tsig_id:t[`tsig-id`]})),{successLabel:`Deleted`})}};function zt(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bt={command:`get <tsig-id>`,describe:`Get TSIG.`,builder:zt,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers tsigs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/tsigs/${t[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(t[`tsig-id`]))}`,pathParams:{"tsig-id":String(t[`tsig-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.zoneTransfers.tsigs.get({account_id:r,tsig_id:t[`tsig-id`]})),{successLabel:`Loaded`})}};function Vt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ht={command:`list`,describe:`List TSIGs.`,builder:Vt,handler:async t=>{if(t.dryRun){u({command:`cf dns zone-transfers tsigs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.dns.zoneTransfers.tsigs.list({account_id:r})),{successLabel:`Loaded`})}};function Ut(e){return e.positional(`tsig-id`,{type:`string`,description:`Tsig ID`,demandOption:!0}).option(`algo`,{type:`string`,description:`TSIG algorithm.`}).option(`name`,{type:`string`,description:`TSIG key name.`}).option(`secret`,{type:`string`,description:`TSIG secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Wt={command:`update <tsig-id>`,describe:`Modify TSIG.`,builder:Ut,handler:async n=>{if(n.dryRun){u({command:`cf dns zone-transfers tsigs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/secondary_dns/tsigs/${n[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(n[`tsig-id`]))}`,pathParams:{"tsig-id":String(n[`tsig-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({algo:f(n.algo,`algo`,`text`),name:f(n.name,`name`,`text`),secret:f(n.secret,`secret`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Updating`,async()=>r.dns.zoneTransfers.tsigs.update({body:e,account_id:a,tsig_id:n[`tsig-id`]})),{successLabel:`Updated`});return}n.algo===void 0&&(n.algo=await t(`algo`,`TSIG algorithm.`)),n.name===void 0&&(n.name=await t(`name`,`TSIG key name.`)),n.secret===void 0&&(n.secret=await t(`secret`,`TSIG secret.`,{kind:`secret`}));let p=c({algo:f(n.algo,`algo`,`text`),name:f(n.name,`name`,`text`),secret:f(n.secret,`secret`,`text`)});l(await d(`Updating`,async()=>r.dns.zoneTransfers.tsigs.update({body:p,account_id:a,tsig_id:n[`tsig-id`]})),{successLabel:`Updated`})}},Gt={command:`tsigs`,describe:`Operations for zone-transfers.tsigs`,builder:e=>e.command(It).command(Rt).command(Bt).command(Ht).command(Wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Kt={command:`zone-transfers`,describe:`Operations for zone-transfers`,builder:e=>e.command(Je).command(Ze).command(ot).command(wt).command(Pt).command(Gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qt={command:`dns`,describe:`DNS management API for zones, records, DNSSEC, analytics, and zone transfers`,builder:e=>e.command(S).command(M).command(ce).command(Ae).command(Le).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{qt as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`time-delta`,{type:`string`,description:`Unit of time to group data by.`,choices:[`all`,`auto`,`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <dns-firewall-id>`,describe:`Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:d(f),handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters,time_delta:t[`time-delta`]};if(t.dryRun){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},m={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <dns-firewall-id>`,describe:`Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:h,handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters};if(t.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},_={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(g).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
|
|
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 t=>{if(t.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:t.body===void 0?a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`],dns_firewall_ip_count:t[`dns-firewall-ip-count`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.dnsFirewall.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`],dns_firewall_ip_count:t[`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 n(a);if(i.accountId=l,!await t({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 t=>{if(t.dryRun){s({command:`cf dns-firewall edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.dnsFirewall.edit({...e,account_id:f,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`});return}let p=a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`]});o(await c(`Updating`,async()=>d.dnsFirewall.edit({...p,account_id:f,dns_firewall_id:t[`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 t=>{if(t.dryRun){s({command:`cf dns-firewall get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.get({account_id:a,dns_firewall_id:t[`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 t=>{let i={page:t.page,per_page:t[`per-page`]};if(t.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(t),l=t.local?u:await n(a);t.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 t=>{if(t.dryRun){s({command:`cf dns-firewall reverse-dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:i(t.body)});return}let a=await r(t),l=t.local?u:await n(a);if(t.accountId=l,t.body){let e=i(t.body);o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({...e,account_id:l,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({account_id:l,dns_firewall_id:t[`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 t=>{if(t.dryRun){s({command:`cf dns-firewall reverse-dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.reverseDns.get({account_id:a,dns_firewall_id:t[`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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,_ as t,n}from"./auth-ffdf9yR0.mjs";import{t as r}from"./output-BJFNwj7b.mjs";import{n as i,t as a}from"./progress-CrCGTq7N.mjs";import{t as o}from"./local-VJaJ3BZ1.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,D as t,E as n,S as r,T as i,_ as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f}from"./input-validation-zEO81MWN.mjs";import{t as p}from"./local-VJaJ3BZ1.mjs";import{t as m}from"./cli-types-CRIDdDw3.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async n=>{if(n.dryRun){u({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({email:f(n.email,`email`,`text`)}):s(n.body)});return}let r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailRouting.addresses.create({...e,account_id:i})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await t(`email`,`The contact email address of the user.`));let m=c({email:f(n.email,`email`,`text`)});l(await d(`Creating`,async()=>r.emailRouting.addresses.create({...m,account_id:i})),{successLabel:`Created`})}};function h(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:h,handler:async t=>{if(t.dryRun){u({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);if(t.accountId=r,!await i({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}l(await d(`Deleting`,async()=>n.emailRouting.addresses.delete({account_id:r,destination_address_identifier:t[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:_,handler:async t=>{if(t.dryRun){u({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailRouting.addresses.get({account_id:r,destination_address_identifier:t[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Lists existing destination addresses.`,builder:m(y),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],direction:t.direction,verified:t.verified};if(t.dryRun){u({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),i=t.local?p:await a(r);t.accountId=i,l(await d(`Loading`,async()=>r.emailRouting.addresses.list({account_id:i,...n})),{successLabel:`Loaded`})}};function x(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:x,handler:async t=>{if(t.dryRun){u({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/addresses/${t[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(t[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(t[`destination-address-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({status:f(t.status,`status`,`text`)}):s(t.body)});return}let r=await o(t),i=t.local?p:await a(r);if(t.accountId=i,t.body){let e=s(t.body);l(await d(`Updating`,async()=>r.emailRouting.addresses.update({...e,account_id:i,destination_address_identifier:t[`destination-address-identifier`]})),{successLabel:`Updated`});return}t.status===void 0&&(t.status=await n(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=c({status:f(t.status,`status`,`text`)});l(await d(`Updating`,async()=>r.emailRouting.addresses.update({...m,account_id:i,destination_address_identifier:t[`destination-address-identifier`]})),{successLabel:`Updated`})}},C={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(te).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:w,handler:async e=>{if(e.dryRun){u({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}l(await d(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{successLabel:`Deleted`})}};function E(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:E,handler:async e=>{if(e.dryRun){u({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let i=c({name:f(e.name,`name`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.dns.create({body:i,zone_id:n})),{successLabel:`Created`})}};function O(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:O,handler:async e=>{if(e.dryRun){u({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}if(e.body){let r=s(e.body);l(await d(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let a=c({name:f(e.name,`name`,`text`)});l(await d(`Deleting`,async()=>t.emailRouting.dns.delete({body:a,zone_id:n})),{successLabel:`Deleted`})}};function A(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:A,handler:async e=>{if(e.dryRun){u({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let i=c({name:f(e.name,`name`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.dns.edit({body:i,zone_id:n})),{successLabel:`Updated`})}};function M(e){return e.option(`subdomain`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:M,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){u({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>n.emailRouting.dns.get({zone_id:i,...t})),{successLabel:`Loaded`})}},P={command:`dns`,describe:`Operations for dns`,builder:e=>e.command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:F,handler:async e=>{if(e.dryRun){u({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let i=c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});l(await d(`Updating`,async()=>t.emailRouting.edit({...i,zone_id:n})),{successLabel:`Updated`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:L,handler:async e=>{if(e.dryRun){u({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:z,handler:async e=>{if(e.dryRun){u({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:V,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{successLabel:`Loaded`})}};function U(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to specific destination address. Forward actions require all destination addresses to be verified.`,builder:U,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}let i=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:f(e.source,`source`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...i,zone_id:n})),{successLabel:`Updated`})}},G={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require all destination addresses to be verified.`,builder:K,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)}):s(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let i=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.rules.create({...i,zone_id:n})),{successLabel:`Created`})}};function J(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:J,handler:async e=>{if(e.dryRun){u({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
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 r({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 t=>{let n={page:t.page,per_page:t[`per-page`],enabled:t.enabled};if(t.dryRun){u({command:`cf email-routing rules list-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/rules`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),i=t.local?p:await a(r);t.accountId=i,l(await d(`Loading`,async()=>r.emailRouting.rules.listAccount({account_id:i,...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),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>n.emailRouting.rules.list({zone_id:i,...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/${e()??`<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 r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailRouting.rules.plan({...e,account_id:i})),{successLabel:`Created`});return}n[`owner-worker-tag`]===void 0&&(n[`owner-worker-tag`]=await t(`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()=>r.emailRouting.rules.plan({...m,account_id:i})),{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 r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.rules.update({...r,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`});return}let i=c({enabled:e.enabled,name:f(e.name,`name`,`text`),owner_worker_tag:f(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:f(e.source,`source`,`text`)});l(await d(`Updating`,async()=>t.emailRouting.rules.update({...i,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/${e()??`<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 r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailRouting.suppression.routing.create({...e,account_id:i})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await t(`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()=>r.emailRouting.suppression.routing.create({...m,account_id:i})),{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 t=>{if(t.dryRun){u({command:`cf email-routing suppression routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);if(t.accountId=r,!await i({force:!!t.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}l(await d(`Deleting`,async()=>n.emailRouting.suppression.routing.delete({account_id:r,suppression_id:t[`suppression-id`]})),{successLabel:`Deleted`})}};function me(e){return e.positional(`suppression-id`,{type:`string`,description:`Suppression ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <suppression-id>`,describe:`Retrieves a single email suppression for the specified account.`,builder:me,handler:async t=>{if(t.dryRun){u({command:`cf email-routing suppression routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailRouting.suppression.routing.get({account_id:r,suppression_id:t[`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 t=>{let n={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){u({command:`cf email-routing suppression routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/routing/suppression`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),i=t.local?p:await a(r);t.accountId=i,l(await d(`Loading`,async()=>r.emailRouting.suppression.routing.list({account_id:i,...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/${e()??`<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 r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.emailRouting.suppression.sending.create({...e,account_id:i})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await t(`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()=>r.emailRouting.suppression.sending.create({...m,account_id:i})),{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 t=>{if(t.dryRun){u({command:`cf email-routing suppression sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);if(t.accountId=r,!await i({force:!!t.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}l(await d(`Deleting`,async()=>n.emailRouting.suppression.sending.delete({account_id:r,suppression_id:t[`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 t=>{if(t.dryRun){u({command:`cf email-routing suppression sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.emailRouting.suppression.sending.get({account_id:r,suppression_id:t[`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 t=>{let n={page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){u({command:`cf email-routing suppression sending list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/suppression`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),i=t.local?p:await a(r);t.accountId=i,l(await d(`Loading`,async()=>r.emailRouting.suppression.sending.list({account_id:i,...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 e=>{if(e.dryRun){u({command:`cf email-routing suppression zone routing create`,method:`POST`,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`]??``)},bodyKind:`json`,body:e.body===void 0?c({email:f(e.email,`email`,`text`),expires_at:f(e[`expires-at`],`expires-at`,`text`)}):s(e.body)});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.routing.create({...t,zone_id:i})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The email field`));let a=c({email:f(e.email,`email`,`text`),expires_at:f(e[`expires-at`],`expires-at`,`text`)});l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.routing.create({...a,zone_id:i})),{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 r({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 r({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),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>n.emailRouting.suppression.zone.routing.list({zone_id:i,...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 e=>{if(e.dryRun){u({command:`cf email-routing suppression zone sending create`,method:`POST`,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`]??``)},bodyKind:`json`,body:e.body===void 0?c({email:f(e.email,`email`,`text`),expires_at:f(e[`expires-at`],`expires-at`,`text`)}):s(e.body)});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.sending.create({...t,zone_id:i})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The email field`));let a=c({email:f(e.email,`email`,`text`),expires_at:f(e[`expires-at`],`expires-at`,`text`)});l(await d(`Creating`,async()=>n.emailRouting.suppression.zone.sending.create({...a,zone_id:i})),{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 r({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 r({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),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>n.emailRouting.suppression.zone.sending.list({zone_id:i,...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 r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.emailRouting.unlock({body:r,zone_id:n})),{successLabel:`Created`});return}let i=c({name:f(e.name,`name`,`text`)});l(await d(`Creating`,async()=>t.emailRouting.unlock({body:i,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 r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.emailRouting.update({...r,zone_id:n})),{successLabel:`Updated`});return}let i=c({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});l(await d(`Updating`,async()=>t.emailRouting.update({...i,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};
|