cf 0.1.0 → 0.2.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 +88 -88
- package/dist/_meta/commands.json +5268 -5350
- package/dist/_meta/schemas.json +33572 -1148
- package/dist/abuse-reports-KtfZhi6j.mjs +8 -0
- package/dist/accounts-BopMfODC.mjs +21 -0
- package/dist/acm-BT4vlnEJ.mjs +3 -0
- package/dist/addressing-B3uFxHst.mjs +13 -0
- package/dist/ai-DWHqwMap.mjs +2 -0
- package/dist/ai-gateway-CbKEO-3o.mjs +8 -0
- package/dist/ai-search-VnOQ5n--.mjs +7 -0
- package/dist/alerting-BmmgIlIO.mjs +6 -0
- package/dist/analytics-isY03taL.mjs +20 -0
- package/dist/api-gateway-DXurEbA-.mjs +33 -0
- package/dist/argo-B02BL_hp.mjs +2 -0
- package/dist/audit-logs-DcgR9xUc.mjs +2 -0
- package/dist/auth-CQcAgnOy.mjs +135 -0
- package/dist/{auth-DQ8miey6.mjs → auth-DenWm_X0.mjs} +3 -3
- package/dist/autorag-CmrwnGVj.mjs +2 -0
- package/dist/{billing-lwBHNTXC.mjs → billing-CaW1ZAB1.mjs} +1 -1
- package/dist/bot-management-CeBsFx68.mjs +5 -0
- package/dist/botnet-feed-B396vQeQ.mjs +3 -0
- package/dist/brand-protection-D4V1v5Kl.mjs +3 -0
- package/dist/browser-rendering-GF7rNtKI.mjs +4 -0
- package/dist/build-5jmmOZhm.mjs +1054 -0
- package/dist/cache-DmXizSMi.mjs +5 -0
- package/dist/calls-x4KQpTB4.mjs +4 -0
- package/dist/certificate-authorities-hC0SG-Ga.mjs +2 -0
- package/dist/client-certificates-BGVsDyeJ.mjs +3 -0
- package/dist/cloud-connector-BClQpEzI.mjs +2 -0
- package/dist/cloudforce-one-BfhFrO6M.mjs +21 -0
- package/dist/{config-BIfdEY0E.mjs → config-DYzlVxcB.mjs} +1 -1
- package/dist/connectivity-G0NP6LtW.mjs +3 -0
- package/dist/content-scanning-DEtPJ7aF.mjs +4 -0
- package/dist/context-CC0Rhkhy.mjs +2 -0
- package/dist/custom-certificates-rJXFpUWu.mjs +5 -0
- package/dist/custom-hostnames-Be5mgLeF.mjs +5 -0
- package/dist/custom-nameservers-CoFdy6hD.mjs +3 -0
- package/dist/custom-pages-D-oErw57.mjs +4 -0
- package/dist/d1-C95ckPKI.mjs +3 -0
- package/dist/dcv-delegation-CWSkbGuc.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-DbkiIzUr.mjs +2 -0
- package/dist/{dev-BfKYB-R_.mjs → dev-C6iSuQZm.mjs} +1 -1
- package/dist/diagnostics-DEEhPnXj.mjs +3 -0
- package/dist/dispatch-namespaces-BzXeV7PH.mjs +7 -0
- package/dist/{dist-C_bu5HwZ.mjs → dist-CnSubA1Z.mjs} +1 -1
- package/dist/dist-DNBSHor6.mjs +301 -0
- package/dist/dns-firewall-BQXD_NxG.mjs +57 -0
- package/dist/dns-qW-3TZOT.mjs +29 -0
- package/dist/durable-objects-CgWFYEJJ.mjs +2 -0
- package/dist/email-routing-tdNJaCpJ.mjs +10 -0
- package/dist/email-security-DTVHNr2h.mjs +60 -0
- package/dist/email-sending-DsFTvE31.mjs +3 -0
- package/dist/filters-DO1Is_tI.mjs +4 -0
- package/dist/firewall-DbUhVTCg.mjs +11 -0
- package/dist/fraud-Bzr4njYb.mjs +8 -0
- package/dist/google-tag-gateway-BQxkA90M.mjs +2 -0
- package/dist/healthchecks-BBAs-lS_.mjs +4 -0
- package/dist/hostnames-Dz9PEUKS.mjs +3 -0
- package/dist/hyperdrive-B1iUJddG.mjs +18 -0
- package/dist/iam-CJM8gHpG.mjs +6 -0
- package/dist/images-DEoBmtFS.mjs +5 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BM6xkZ0C.mjs +3 -0
- package/dist/{ips-B0cK7D0_.mjs → ips-B8fwxKZD.mjs} +1 -1
- package/dist/keyless-certificates-DffYnd4b.mjs +3 -0
- package/dist/kv-BTceLtWZ.mjs +5 -0
- package/dist/leaked-credential-checks-CALfvoCo.mjs +3 -0
- package/dist/load-balancers-C1Ho1gCF.mjs +6 -0
- package/dist/logpush-CSYhgevA.mjs +4 -0
- package/dist/logs-DlIwmMpt.mjs +3 -0
- package/dist/magic-cloud-networking-Czu0pZ0a.mjs +5 -0
- package/dist/magic-network-monitoring-d7GJE5Yt.mjs +4 -0
- package/dist/magic-transit-qQmA-981.mjs +89 -0
- package/dist/managed-transforms-Dd6AnbWE.mjs +3 -0
- package/dist/mtls-certificates-C0rlCRGs.mjs +3 -0
- package/dist/network-interconnects-CxG2deY0.mjs +36 -0
- package/dist/organizations-DyEAiGiR.mjs +41 -0
- package/dist/origin-ca-certificates-S8RcoMF6.mjs +3 -0
- package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +2 -0
- package/dist/origin-tls-client-auth-BlxMmQrE.mjs +5 -0
- package/dist/page-rules-DP-w6TAm.mjs +18 -0
- package/dist/page-shield-Bf7kFp8c.mjs +37 -0
- package/dist/pages-D0Y_XRqW.mjs +10 -0
- package/dist/pipelines-C-SPESAk.mjs +6 -0
- package/dist/{progress-DZfTxbrx.mjs → progress-CjcQ6ato.mjs} +1 -1
- package/dist/queues-wv6CZsi8.mjs +6 -0
- package/dist/r2-DuXjp9n5.mjs +21 -0
- package/dist/r2-data-catalog-DQCMrmNO.mjs +14 -0
- package/dist/radar-BW_ZHP8X.mjs +2 -0
- package/dist/rate-limits-DLTkIvwr.mjs +5 -0
- package/dist/raw-fetch-hRv-6P3D.mjs +2 -0
- package/dist/realtime-kit-Ch7Vg3vj.mjs +6 -0
- package/dist/{registrar-7Qy50zbW.mjs → registrar-DIIv6fWd.mjs} +6 -6
- package/dist/request-tracers-DMej0Drs.mjs +2 -0
- package/dist/resource-sharing-CYJ7cMWq.mjs +5 -0
- package/dist/resource-tagging-Dnz65MgH.mjs +16 -0
- package/dist/rules-DLJpOYbC.mjs +4 -0
- package/dist/rulesets-D9nqEJT5.mjs +8 -0
- package/dist/rum-DBVmdPkp.mjs +4 -0
- package/dist/schema-validation-MCd3xdtX.mjs +4 -0
- package/dist/scim-DZA3VXog.mjs +3 -0
- package/dist/secrets-store-BrvcZSOM.mjs +21 -0
- package/dist/security-center-BU6f3Cm1.mjs +2 -0
- package/dist/security-txt-BPIbP3dG.mjs +3 -0
- package/dist/{session-mW-s8ghP.mjs → session-H7IV2BrM.mjs} +1 -1
- package/dist/shared-DEzmTsEC.mjs +2 -0
- package/dist/smart-shield-e8XFBkiF.mjs +3 -0
- package/dist/snippets-B4M3MMb8.mjs +4 -0
- package/dist/{spawn-D_cjG87Z.mjs → spawn-13QQ0IwO.mjs} +1 -1
- package/dist/spectrum-B0adfSRI.mjs +59 -0
- package/dist/speed-BVcUtkAz.mjs +4 -0
- package/dist/{src-C5qivNKH.mjs → src-B9cKsgsg.mjs} +8 -8
- package/dist/ssl-BAa91gsc.mjs +15 -0
- package/dist/stream-D53sxKb3.mjs +14 -0
- package/dist/tenants-bH5pt3dJ.mjs +2 -0
- package/dist/token-validation-M61Vx_Tw.mjs +4 -0
- package/dist/turnstile-wAU0Gc2Z.mjs +23 -0
- package/dist/{ui-mP_arYIg.mjs → ui-BXjU1dX1.mjs} +1 -1
- package/dist/url-normalization-DZrWDgB5.mjs +3 -0
- package/dist/url-scanner-Zo49edNp.mjs +2 -0
- package/dist/user-DbXlVReB.mjs +10 -0
- package/dist/vectorize-CUnTM0DT.mjs +4 -0
- package/dist/versions-DzyrlUAi.mjs +2 -0
- package/dist/waiting-rooms-BZW0X69-.mjs +11 -0
- package/dist/web3-DueyOQtx.mjs +4 -0
- package/dist/workers-builds-BM_aoeUR.mjs +7 -0
- package/dist/workers-nV_vBCfV.mjs +16 -0
- package/dist/workflows-CQITmo-s.mjs +4 -0
- package/dist/zaraz-DIbpF5Op.mjs +2 -0
- package/dist/zero-trust-CKp8j512.mjs +119 -0
- package/dist/zones-BZ5tZDbH.mjs +28 -0
- package/package.json +4 -4
- 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/autorag-kgNt06GD.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/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/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/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/secrets-store-ClOUVhBJ.mjs +0 -18
- package/dist/security-center-4iSBqTrf.mjs +0 -2
- package/dist/security-txt-kGxdkDY6.mjs +0 -3
- 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/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/{schema-D0_cbcDt.mjs → schema-CHBfkARI.mjs} +0 -0
- /package/dist/{tools-CtKbk6VS.mjs → tools-B7QiNu-d.mjs} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,h as t,t as n,x as r}from"./auth-CQcAgnOy.mjs";import{n as i,t as a}from"./body-parser-Br-BoYk-.mjs";import{t as o}from"./output-D7_yAFVR.mjs";import{n as s,t as c}from"./progress-CjcQ6ato.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";function d(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:`string`,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 f={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,handler:async e=>{let i={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){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall/${e[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(e[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(e[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await n(e),l=e.local?u:await t(a);e.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get(e[`dns-firewall-id`],l,i)),{successLabel:`Loaded`})}},p={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(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:`string`,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 h={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:m,handler:async e=>{let i={metrics:e.metrics,dimensions:e.dimensions,since:e.since,until:e.until,limit:e.limit,sort:e.sort,filters:e.filters};if(e.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall/${e[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(e[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(e[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await n(e),l=e.local?u:await t(a);e.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get(e[`dns-firewall-id`],l,i)),{successLabel:`Loaded`})}},g={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(h).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(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:`Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster)`}).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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create a DNS Firewall cluster`,builder:v,handler:async e=>{if(e.dryRun){s({command:`cf dns-firewall create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall`,pathParams:{},bodyKind:`json`,body:{"attack-mitigation-enabled":e[`attack-mitigation-enabled`],"attack-mitigation-only-when-upstream-unhealthy":e[`attack-mitigation-only-when-upstream-unhealthy`],"deprecate-any-requests":e[`deprecate-any-requests`],"ecs-fallback":e[`ecs-fallback`],"maximum-cache-ttl":e[`maximum-cache-ttl`],"minimum-cache-ttl":e[`minimum-cache-ttl`],name:e.name,"negative-cache-ttl":e[`negative-cache-ttl`],ratelimit:e.ratelimit,retries:e.retries,"upstream-ips":e[`upstream-ips`],body:e.body}});return}let d=await n(e),f=e.local?u:await t(d);if(e.accountId=f,e.body){let t=a(e.body);o(await c(`Creating`,async()=>d.post(`/accounts/${f}/dns_firewall`,{body:t})),{successLabel:`Created`});return}let p={};e[`attack-mitigation-enabled`]!==void 0&&i(p,[`attack_mitigation`,`enabled`],e[`attack-mitigation-enabled`]),e[`attack-mitigation-only-when-upstream-unhealthy`]!==void 0&&i(p,[`attack_mitigation`,`only_when_upstream_unhealthy`],e[`attack-mitigation-only-when-upstream-unhealthy`]),e[`deprecate-any-requests`]!==void 0&&i(p,[`deprecate_any_requests`],e[`deprecate-any-requests`]),e[`ecs-fallback`]!==void 0&&i(p,[`ecs_fallback`],e[`ecs-fallback`]),e[`maximum-cache-ttl`]!==void 0&&i(p,[`maximum_cache_ttl`],e[`maximum-cache-ttl`]),e[`minimum-cache-ttl`]!==void 0&&i(p,[`minimum_cache_ttl`],e[`minimum-cache-ttl`]),e.name!==void 0&&i(p,[`name`],l(e.name,`name`,`text`)),e[`negative-cache-ttl`]!==void 0&&i(p,[`negative_cache_ttl`],e[`negative-cache-ttl`]),e.ratelimit!==void 0&&i(p,[`ratelimit`],e.ratelimit),e.retries!==void 0&&i(p,[`retries`],e.retries),e[`upstream-ips`]!==void 0&&i(p,[`upstream_ips`],e[`upstream-ips`]),o(await c(`Creating`,async()=>d.post(`/accounts/${f}/dns_firewall`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function b(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`delete <dns-firewall-id>`,describe:`Delete a DNS Firewall cluster`,builder:b,handler:async i=>{if(i.dryRun){s({command:`cf dns-firewall delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<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:`json`,body:{body:i.body}});return}let l=await n(i),d=i.local?u:await t(l);if(i.accountId=d,!await e({force:!!i.force})){process.stderr.write(`Aborted.
|
|
30
|
+
`);return}if(i.body){let e=a(i.body);o(await c(`Deleting`,async()=>l.delete(`/accounts/${d}/dns_firewall/${encodeURIComponent(String(i[`dns-firewall-id`]))}`,{body:e})),{successLabel:`Deleted`});return}o(await c(`Deleting`,async()=>l.dnsFirewall.delete(i[`dns-firewall-id`],d)),{successLabel:`Deleted`})}};function S(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:`Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster)`}).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 C={command:`edit <dns-firewall-id>`,describe:`Modify the configuration of a DNS Firewall cluster`,builder:S,handler:async e=>{if(e.dryRun){s({command:`cf dns-firewall edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall/${e[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(e[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(e[`dns-firewall-id`]??``)},bodyKind:`json`,body:{"attack-mitigation-enabled":e[`attack-mitigation-enabled`],"attack-mitigation-only-when-upstream-unhealthy":e[`attack-mitigation-only-when-upstream-unhealthy`],"deprecate-any-requests":e[`deprecate-any-requests`],"ecs-fallback":e[`ecs-fallback`],"maximum-cache-ttl":e[`maximum-cache-ttl`],"minimum-cache-ttl":e[`minimum-cache-ttl`],name:e.name,"negative-cache-ttl":e[`negative-cache-ttl`],ratelimit:e.ratelimit,retries:e.retries,"upstream-ips":e[`upstream-ips`],body:e.body}});return}let d=await n(e),f=e.local?u:await t(d);if(e.accountId=f,e.body){let t=a(e.body);o(await c(`Updating`,async()=>d.patch(`/accounts/${f}/dns_firewall/${encodeURIComponent(String(e[`dns-firewall-id`]))}`,{body:t})),{successLabel:`Updated`});return}let p={};e[`attack-mitigation-enabled`]!==void 0&&i(p,[`attack_mitigation`,`enabled`],e[`attack-mitigation-enabled`]),e[`attack-mitigation-only-when-upstream-unhealthy`]!==void 0&&i(p,[`attack_mitigation`,`only_when_upstream_unhealthy`],e[`attack-mitigation-only-when-upstream-unhealthy`]),e[`deprecate-any-requests`]!==void 0&&i(p,[`deprecate_any_requests`],e[`deprecate-any-requests`]),e[`ecs-fallback`]!==void 0&&i(p,[`ecs_fallback`],e[`ecs-fallback`]),e[`maximum-cache-ttl`]!==void 0&&i(p,[`maximum_cache_ttl`],e[`maximum-cache-ttl`]),e[`minimum-cache-ttl`]!==void 0&&i(p,[`minimum_cache_ttl`],e[`minimum-cache-ttl`]),e.name!==void 0&&i(p,[`name`],l(e.name,`name`,`text`)),e[`negative-cache-ttl`]!==void 0&&i(p,[`negative_cache_ttl`],e[`negative-cache-ttl`]),e.ratelimit!==void 0&&i(p,[`ratelimit`],e.ratelimit),e.retries!==void 0&&i(p,[`retries`],e.retries),e[`upstream-ips`]!==void 0&&i(p,[`upstream_ips`],e[`upstream-ips`]),o(await c(`Updating`,async()=>d.patch(`/accounts/${f}/dns_firewall/${encodeURIComponent(String(e[`dns-firewall-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function w(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 T={command:`get <dns-firewall-id>`,describe:`Show a single DNS Firewall cluster for an account`,builder:w,handler:async e=>{if(e.dryRun){s({command:`cf dns-firewall get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall/${e[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(e[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(e[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await n(e),a=e.local?u:await t(i);e.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.get(e[`dns-firewall-id`],a)),{successLabel:`Loaded`})}};function E(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 D={command:`list`,describe:`List DNS Firewall clusters for an account`,builder:E,handler:async e=>{let i={page:e.page,per_page:e[`per-page`]};if(e.dryRun){s({command:`cf dns-firewall list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall`,pathParams:{},query:i,bodyKind:`none`});return}let a=await n(e),l=e.local?u:await t(a);e.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.list(l,i)),{successLabel:`Loaded`})}};function O(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 k={command:`edit <dns-firewall-id>`,describe:`Update reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:O,handler:async e=>{if(e.dryRun){s({command:`cf dns-firewall reverse-dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall/${e[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(e[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(e[`dns-firewall-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let i=await n(e),l=e.local?u:await t(i);if(e.accountId=l,e.body){let t=a(e.body);o(await c(`Updating`,async()=>i.patch(`/accounts/${l}/dns_firewall/${encodeURIComponent(String(e[`dns-firewall-id`]))}/reverse_dns`,{body:t})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i.dnsFirewall.reverseDNS.edit(e[`dns-firewall-id`],l)),{successLabel:`Updated`})}};function A(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 j={command:`get <dns-firewall-id>`,describe:`Show reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf dns-firewall reverse-dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${r()??`<account-id>`}/dns_firewall/${e[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(e[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(e[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await n(e),a=e.local?u:await t(i);e.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.reverseDNS.get(e[`dns-firewall-id`],a)),{successLabel:`Loaded`})}},M={command:`reverse-dns`,describe:`PTR record configuration for reverse DNS lookups on DNS Firewall cluster IPs`,builder:e=>e.command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`dns-firewall`,describe:`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).command(_).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,T as t,b as n,h as r,t as i,x as a}from"./auth-CQcAgnOy.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-CjcQ6ato.mjs";import{n as d,t as f}from"./input-validation-zEO81MWN.mjs";import{t as p}from"./local-VJaJ3BZ1.mjs";import{n as m,t as ee}from"./raw-fetch-hRv-6P3D.mjs";function te(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:`string`,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 h={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:te,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){l({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 i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.dns.analytics.reports.bytimes.get(a,t)),{successLabel:`Loaded`})}},g={command:`bytimes`,describe:`DNS analytics and reporting`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(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:`string`,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 v={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:_,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){l({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 i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.dns.analytics.reports.get(a,t)),{successLabel:`Loaded`})}},y={command:`reports`,describe:`DNS analytics and reporting`,builder:e=>e.command(v).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`delete`,describe:`Delete DNSSEC.`,builder:x,handler:async t=>{if(t.dryRun){l({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.delete(`/zones/${t.zoneId}/dnssec`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.dns.dnssec.delete(a)),{successLabel:`Deleted`})}};function C(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 w={command:`edit`,describe:`Enable or disable DNSSEC.`,builder:C,handler:async e=>{if(e.dryRun){l({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:{"dnssec-multi-signer":e[`dnssec-multi-signer`],"dnssec-presigned":e[`dnssec-presigned`],"dnssec-use-nsec3":e[`dnssec-use-nsec3`],status:e.status,body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/dnssec`,{body:n})),{successLabel:`Updated`});return}let r={};e[`dnssec-multi-signer`]!==void 0&&o(r,[`dnssec_multi_signer`],e[`dnssec-multi-signer`]),e[`dnssec-presigned`]!==void 0&&o(r,[`dnssec_presigned`],e[`dnssec-presigned`]),e[`dnssec-use-nsec3`]!==void 0&&o(r,[`dnssec_use_nsec3`],e[`dnssec-use-nsec3`]),e.status!==void 0&&o(r,[`status`],d(e.status,`status`,`text`)),c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/dnssec`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Details about DNSSEC status and configuration.`,builder:T,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.dnssec.get(r)),{successLabel:`Loaded`})}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`zsks`,describe:`List the Zone Signing Keys (ZSKs) that DNSSEC uses for the zone.`,builder:D,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.dnssec.list.zsks(r)),{successLabel:`Loaded`})}},k={command:`list`,describe:`Manage DNSSEC settings for a zone`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`dnssec`,describe:`Manage DNSSEC settings for a zone`,builder:e=>e.command(S).command(w).command(E).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(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 M={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:j,handler:async e=>{if(e.dryRun){l({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`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/dns_records/batch`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.records.batch(r)),{successLabel:`Created`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`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:N,handler:async e=>{if(e.dryRun){l({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`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/dns_records`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.records.create(r)),{successLabel:`Created`})}};function F(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`delete <dns-record-id>`,describe:`Permanently removes a DNS record from the zone.`,builder:F,handler:async t=>{if(t.dryRun){l({command:`cf dns records delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/dns_records/${t[`dns-record-id`]==null?`<dns-record-id>`:encodeURIComponent(String(t[`dns-record-id`]))}`,pathParams:{"dns-record-id":String(t[`dns-record-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
20
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.delete(`/zones/${t.zoneId}/dns_records/${encodeURIComponent(String(t[`dns-record-id`]))}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.dns.records.delete(t[`dns-record-id`],a)),{successLabel:`Deleted`})}};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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={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:L,handler:async e=>{if(e.dryRun){l({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`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/dns_records/${encodeURIComponent(String(e[`dns-record-id`]))}`,{body:n})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>t.dns.records.edit(e[`dns-record-id`],r)),{successLabel:`Updated`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={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:z,handler:async e=>{if(e.dryRun){l({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 i(e);e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),m((await u(`Loading`,async()=>ee(`/zones/${e.zoneId}/dns_records/export`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}))).toString(`utf-8`))}};function V(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})}const H={command:`get <dns-record-id>`,describe:`Retrieves details for a specific DNS record in the zone.`,builder:V,handler:async e=>{if(e.dryRun){l({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`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.records.get(e[`dns-record-id`],r)),{successLabel:`Loaded`})}};function U(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 W={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:U,handler:async e=>{if(e.dryRun){l({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 i(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=f(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(d(e.proxied,`proxied`,`text`)??``)),c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/dns_records/import`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=d(e.body,`body`,`binary`);c(await u(`Creating`,async()=>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 G(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:`string`,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:`string`,description:`Page number of paginated results.`}).option(`per-page`,{type:`string`,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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List, search, sort, and filter a zones' DNS records.`,builder:G,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};if(e.dryRun){l({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 i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.dns.records.list(a,t)),{successLabel:`Loaded`})}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={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:q,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.records.scanList(r)),{successLabel:`Loaded`})}};function Y(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 X={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:Y,handler:async e=>{if(e.dryRun){l({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:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/dns_records/scan/review`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.records.scanReview(r)),{successLabel:`Created`})}};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-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:Z,handler:async e=>{if(e.dryRun){l({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:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/dns_records/scan/trigger`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.records.scanTrigger(r)),{successLabel:`Created`})}};function ne(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 re={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:ne,handler:async e=>{if(e.dryRun){l({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:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/dns_records/scan`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.records.scan(r)),{successLabel:`Created`})}};function ie(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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={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:ie,handler:async e=>{if(e.dryRun){l({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`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.put(`/zones/${e.zoneId}/dns_records/${encodeURIComponent(String(e[`dns-record-id`]))}`,{body:n})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>t.dns.records.update(e[`dns-record-id`],r)),{successLabel:`Updated`})}},oe={command:`records`,describe:`Manage DNS records for a zone`,builder:e=>e.command(M).command(P).command(I).command(R).command(B).command(H).command(W).command(K).command(re).command(J).command(X).command(Q).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(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 ce={command:`edit`,describe:`Update DNS settings for an account`,builder:se,handler:async e=>{if(e.dryRun){l({command:`cf dns settings account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_settings`,pathParams:{},bodyKind:`json`,body:{"enforce-dns-only":e[`enforce-dns-only`],"zone-defaults-flatten-all-cnames":e[`zone-defaults-flatten-all-cnames`],"zone-defaults-foundation-dns":e[`zone-defaults-foundation-dns`],"zone-defaults-internal-dns-reference-zone-id":e[`zone-defaults-internal-dns-reference-zone-id`],"zone-defaults-multi-provider":e[`zone-defaults-multi-provider`],"zone-defaults-ns-ttl":e[`zone-defaults-ns-ttl`],"zone-defaults-secondary-overrides":e[`zone-defaults-secondary-overrides`],"zone-defaults-soa-expire":e[`zone-defaults-soa-expire`],"zone-defaults-soa-min-ttl":e[`zone-defaults-soa-min-ttl`],"zone-defaults-soa-mname":e[`zone-defaults-soa-mname`],"zone-defaults-soa-refresh":e[`zone-defaults-soa-refresh`],"zone-defaults-soa-retry":e[`zone-defaults-soa-retry`],"zone-defaults-soa-rname":e[`zone-defaults-soa-rname`],"zone-defaults-soa-ttl":e[`zone-defaults-soa-ttl`],"zone-defaults-zone-mode":e[`zone-defaults-zone-mode`],"zone-defaults-nameservers-type":e[`zone-defaults-nameservers-type`],body:e.body}});return}let t=await i(e),n=e.local?p:await r(t);if(e.accountId=n,e.body){let r=s(e.body);c(await u(`Updating`,async()=>t.patch(`/accounts/${n}/dns_settings`,{body:r})),{successLabel:`Updated`});return}let f={};e[`enforce-dns-only`]!==void 0&&o(f,[`enforce_dns_only`],e[`enforce-dns-only`]),e[`zone-defaults-flatten-all-cnames`]!==void 0&&o(f,[`zone_defaults`,`flatten_all_cnames`],e[`zone-defaults-flatten-all-cnames`]),e[`zone-defaults-foundation-dns`]!==void 0&&o(f,[`zone_defaults`,`foundation_dns`],e[`zone-defaults-foundation-dns`]),e[`zone-defaults-internal-dns-reference-zone-id`]!==void 0&&o(f,[`zone_defaults`,`internal_dns`,`reference_zone_id`],d(e[`zone-defaults-internal-dns-reference-zone-id`],`zone-defaults-internal-dns-reference-zone-id`,`text`)),e[`zone-defaults-multi-provider`]!==void 0&&o(f,[`zone_defaults`,`multi_provider`],e[`zone-defaults-multi-provider`]),e[`zone-defaults-ns-ttl`]!==void 0&&o(f,[`zone_defaults`,`ns_ttl`],e[`zone-defaults-ns-ttl`]),e[`zone-defaults-secondary-overrides`]!==void 0&&o(f,[`zone_defaults`,`secondary_overrides`],e[`zone-defaults-secondary-overrides`]),e[`zone-defaults-soa-expire`]!==void 0&&o(f,[`zone_defaults`,`soa`,`expire`],e[`zone-defaults-soa-expire`]),e[`zone-defaults-soa-min-ttl`]!==void 0&&o(f,[`zone_defaults`,`soa`,`min_ttl`],e[`zone-defaults-soa-min-ttl`]),e[`zone-defaults-soa-mname`]!==void 0&&o(f,[`zone_defaults`,`soa`,`mname`],d(e[`zone-defaults-soa-mname`],`zone-defaults-soa-mname`,`text`)),e[`zone-defaults-soa-refresh`]!==void 0&&o(f,[`zone_defaults`,`soa`,`refresh`],e[`zone-defaults-soa-refresh`]),e[`zone-defaults-soa-retry`]!==void 0&&o(f,[`zone_defaults`,`soa`,`retry`],e[`zone-defaults-soa-retry`]),e[`zone-defaults-soa-rname`]!==void 0&&o(f,[`zone_defaults`,`soa`,`rname`],d(e[`zone-defaults-soa-rname`],`zone-defaults-soa-rname`,`text`)),e[`zone-defaults-soa-ttl`]!==void 0&&o(f,[`zone_defaults`,`soa`,`ttl`],e[`zone-defaults-soa-ttl`]),e[`zone-defaults-zone-mode`]!==void 0&&o(f,[`zone_defaults`,`zone_mode`],d(e[`zone-defaults-zone-mode`],`zone-defaults-zone-mode`,`text`)),e[`zone-defaults-nameservers-type`]!==void 0&&o(f,[`zone_defaults`,`nameservers`,`type`],d(e[`zone-defaults-nameservers-type`],`zone-defaults-nameservers-type`,`text`)),c(await u(`Updating`,async()=>t.patch(`/accounts/${n}/dns_settings`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}};function le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get`,describe:`Show DNS settings for an account`,builder:le,handler:async e=>{if(e.dryRun){l({command:`cf dns settings account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_settings`,pathParams:{},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.settings.account.get(n)),{successLabel:`Loaded`})}};function de(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 fe={command:`create`,describe:`Create Internal DNS View for an account`,builder:de,handler:async e=>{if(e.dryRun){l({command:`cf dns settings account views create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_settings/views`,pathParams:{},bodyKind:`json`,body:{name:e.name,zones:e.zones,body:e.body}});return}let t=await i(e),n=e.local?p:await r(t);if(e.accountId=n,e.body){let r=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${n}/dns_settings/views`,{body:r})),{successLabel:`Created`});return}let f={};e.name!==void 0&&o(f,[`name`],d(e.name,`name`,`text`)),e.zones!==void 0&&o(f,[`zones`],e.zones),c(await u(`Creating`,async()=>t.post(`/accounts/${n}/dns_settings/views`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Created`})}};function pe(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`delete <view-id>`,describe:`Delete an existing Internal DNS View`,builder:pe,handler:async t=>{if(t.dryRun){l({command:`cf dns settings account views delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<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:{body:t.body}});return}let n=await i(t),o=t.local?p:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
21
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>n.delete(`/accounts/${o}/dns_settings/views/${encodeURIComponent(String(t[`view-id`]))}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>n.dns.settings.account.views.delete(o,t[`view-id`])),{successLabel:`Deleted`})}};function he(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 ge={command:`edit <view-id>`,describe:`Update an existing Internal DNS View`,builder:he,handler:async e=>{if(e.dryRun){l({command:`cf dns settings account views edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_settings/views/${e[`view-id`]==null?`<view-id>`:encodeURIComponent(String(e[`view-id`]))}`,pathParams:{"view-id":String(e[`view-id`]??``)},bodyKind:`json`,body:{name:e.name,zones:e.zones,body:e.body}});return}let t=await i(e),n=e.local?p:await r(t);if(e.accountId=n,e.body){let r=s(e.body);c(await u(`Updating`,async()=>t.patch(`/accounts/${n}/dns_settings/views/${encodeURIComponent(String(e[`view-id`]))}`,{body:r})),{successLabel:`Updated`});return}let f={};e.name!==void 0&&o(f,[`name`],d(e.name,`name`,`text`)),e.zones!==void 0&&o(f,[`zones`],e.zones),c(await u(`Updating`,async()=>t.patch(`/accounts/${n}/dns_settings/views/${encodeURIComponent(String(e[`view-id`]))}`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}};function _e(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 ve={command:`get <view-id>`,describe:`Get DNS Internal View`,builder:_e,handler:async e=>{if(e.dryRun){l({command:`cf dns settings account views get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_settings/views/${e[`view-id`]==null?`<view-id>`:encodeURIComponent(String(e[`view-id`]))}`,pathParams:{"view-id":String(e[`view-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.settings.account.views.get(n,e[`view-id`])),{successLabel:`Loaded`})}};function ye(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:`string`,description:`Page number of paginated results.`}).option(`per-page`,{type:`string`,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 be={command:`list`,describe:`List DNS Internal Views for an Account`,builder:ye,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`],zone_id:e[`zone-id`],zone_name:e[`zone-name`],match:e.match,page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){l({command:`cf dns settings account views list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_settings/views`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e),o=e.local?p:await r(n);e.accountId=o,c(await u(`Loading`,async()=>n.dns.settings.account.views.list(o,t)),{successLabel:`Loaded`})}},xe={command:`views`,describe:`Views operations`,builder:e=>e.command(fe).command(me).command(ge).command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`account`,describe:`Operations for settings.account`,builder:e=>e.command(ce).command(ue).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(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 we={command:`edit`,describe:`Update DNS settings for a zone`,builder:Ce,handler:async e=>{if(e.dryRun){l({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:{"flatten-all-cnames":e[`flatten-all-cnames`],"foundation-dns":e[`foundation-dns`],"internal-dns-reference-zone-id":e[`internal-dns-reference-zone-id`],"multi-provider":e[`multi-provider`],"ns-ttl":e[`ns-ttl`],"secondary-overrides":e[`secondary-overrides`],"soa-expire":e[`soa-expire`],"soa-min-ttl":e[`soa-min-ttl`],"soa-mname":e[`soa-mname`],"soa-refresh":e[`soa-refresh`],"soa-retry":e[`soa-retry`],"soa-rname":e[`soa-rname`],"soa-ttl":e[`soa-ttl`],"zone-mode":e[`zone-mode`],"nameservers-ns-set":e[`nameservers-ns-set`],"nameservers-type":e[`nameservers-type`],body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/dns_settings`,{body:n})),{successLabel:`Updated`});return}let r={};e[`flatten-all-cnames`]!==void 0&&o(r,[`flatten_all_cnames`],e[`flatten-all-cnames`]),e[`foundation-dns`]!==void 0&&o(r,[`foundation_dns`],e[`foundation-dns`]),e[`internal-dns-reference-zone-id`]!==void 0&&o(r,[`internal_dns`,`reference_zone_id`],d(e[`internal-dns-reference-zone-id`],`internal-dns-reference-zone-id`,`text`)),e[`multi-provider`]!==void 0&&o(r,[`multi_provider`],e[`multi-provider`]),e[`ns-ttl`]!==void 0&&o(r,[`ns_ttl`],e[`ns-ttl`]),e[`secondary-overrides`]!==void 0&&o(r,[`secondary_overrides`],e[`secondary-overrides`]),e[`soa-expire`]!==void 0&&o(r,[`soa`,`expire`],e[`soa-expire`]),e[`soa-min-ttl`]!==void 0&&o(r,[`soa`,`min_ttl`],e[`soa-min-ttl`]),e[`soa-mname`]!==void 0&&o(r,[`soa`,`mname`],d(e[`soa-mname`],`soa-mname`,`text`)),e[`soa-refresh`]!==void 0&&o(r,[`soa`,`refresh`],e[`soa-refresh`]),e[`soa-retry`]!==void 0&&o(r,[`soa`,`retry`],e[`soa-retry`]),e[`soa-rname`]!==void 0&&o(r,[`soa`,`rname`],d(e[`soa-rname`],`soa-rname`,`text`)),e[`soa-ttl`]!==void 0&&o(r,[`soa`,`ttl`],e[`soa-ttl`]),e[`zone-mode`]!==void 0&&o(r,[`zone_mode`],d(e[`zone-mode`],`zone-mode`,`text`)),e[`nameservers-ns-set`]!==void 0&&o(r,[`nameservers`,`ns_set`],e[`nameservers-ns-set`]),e[`nameservers-type`]!==void 0&&o(r,[`nameservers`,`type`],d(e[`nameservers-type`],`nameservers-type`,`text`)),c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/dns_settings`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function Te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get`,describe:`Show DNS settings for a zone`,builder:Te,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.settings.zone.get(r)),{successLabel:`Loaded`})}},De={command:`zone`,describe:`DNS settings management for zones`,builder:e=>e.command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(Se).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get`,describe:`Get the current DNS record usage and quota for an account. May include internal DNS usage and quota.`,builder:ke,handler:async e=>{if(e.dryRun){l({command:`cf dns usage account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/dns_records/usage`,pathParams:{},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.usage.account.get(n)),{successLabel:`Loaded`})}},je={command:`account`,describe:`Usage operations`,builder:e=>e.command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`get`,describe:`Get the current DNS record usage for a zone, including the number of records and the quota limit.`,builder:Me,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.usage.zone.get(r)),{successLabel:`Loaded`})}},Pe={command:`zone`,describe:`Usage operations`,builder:e=>e.command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fe={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(je).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(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 Le={command:`create`,describe:`Create ACL.`,builder:Ie,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`json`,body:{"ip-range":e[`ip-range`],name:e.name,body:e.body}});return}let n=await i(e),f=e.local?p:await r(n);if(e.accountId=f,e.body){let t=s(e.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/secondary_dns/acls`,{body:t})),{successLabel:`Created`});return}e[`ip-range`]===void 0&&(e[`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.`)),e.name===void 0&&(e.name=await t(`name`,`The name of the acl.`));let m={};e[`ip-range`]!==void 0&&o(m,[`ip_range`],d(e[`ip-range`],`ip-range`,`text`)),e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/secondary_dns/acls`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function Re(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ze={command:`delete <acl-id>`,describe:`Delete ACL.`,builder:Re,handler:async t=>{if(t.dryRun){l({command:`cf dns zone-transfers acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/acls/${t[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(t[`acl-id`]))}`,pathParams:{"acl-id":String(t[`acl-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),o=t.local?p:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>n.delete(`/accounts/${o}/secondary_dns/acls/${encodeURIComponent(String(t[`acl-id`]))}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>n.dns.zoneTransfers.acls.delete(t[`acl-id`],o)),{successLabel:`Deleted`})}};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})}const Ve={command:`get <acl-id>`,describe:`Get ACL.`,builder:Be,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"acl-id":String(e[`acl-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.zoneTransfers.acls.get(e[`acl-id`],n)),{successLabel:`Loaded`})}};function He(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`list`,describe:`List ACLs.`,builder:He,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/acls`,pathParams:{},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.zoneTransfers.acls.list(n)),{successLabel:`Loaded`})}};function We(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 Ge={command:`update <acl-id>`,describe:`Modify ACL.`,builder:We,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/acls/${e[`acl-id`]==null?`<acl-id>`:encodeURIComponent(String(e[`acl-id`]))}`,pathParams:{"acl-id":String(e[`acl-id`]??``)},bodyKind:`json`,body:{"ip-range":e[`ip-range`],name:e.name,body:e.body}});return}let n=await i(e),f=e.local?p:await r(n);if(e.accountId=f,e.body){let t=s(e.body);c(await u(`Updating`,async()=>n.put(`/accounts/${f}/secondary_dns/acls/${encodeURIComponent(String(e[`acl-id`]))}`,{body:t})),{successLabel:`Updated`});return}e[`ip-range`]===void 0&&(e[`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.`)),e.name===void 0&&(e.name=await t(`name`,`The name of the acl.`));let m={};e[`ip-range`]!==void 0&&o(m,[`ip_range`],d(e[`ip-range`],`ip-range`,`text`)),e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),c(await u(`Updating`,async()=>n.put(`/accounts/${f}/secondary_dns/acls/${encodeURIComponent(String(e[`acl-id`]))}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},Ke={command:`acls`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(Le).command(ze).command(Ve).command(Ue).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(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 Je={command:`create`,describe:`Sends AXFR zone transfer request to primary nameserver(s).`,builder:qe,handler:async e=>{if(e.dryRun){l({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:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/secondary_dns/force_axfr`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.zoneTransfers.forceAxfr.create(r)),{successLabel:`Created`})}},Ye={command:`force-axfr`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(Je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xe(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 Ze={command:`create`,describe:`Create secondary zone configuration for incoming zone transfers.`,builder:Xe,handler:async e=>{if(e.dryRun){l({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:{"auto-refresh-seconds":e[`auto-refresh-seconds`],name:e.name,peers:e.peers,body:e.body}});return}let r=await i(e);if(e.zoneId=await n({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=s(e.body);c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/secondary_dns/incoming`,{body:t})),{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={};e[`auto-refresh-seconds`]!==void 0&&o(a,[`auto_refresh_seconds`],e[`auto-refresh-seconds`]),e.name!==void 0&&o(a,[`name`],d(e.name,`name`,`text`)),e.peers!==void 0&&o(a,[`peers`],e.peers),c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/secondary_dns/incoming`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $e={command:`delete`,describe:`Delete secondary zone configuration for incoming zone transfers.`,builder:Qe,handler:async t=>{if(t.dryRun){l({command:`cf dns zone-transfers incoming delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/incoming`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.delete(`/zones/${t.zoneId}/secondary_dns/incoming`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.dns.zoneTransfers.incoming.delete(a)),{successLabel:`Deleted`})}};function et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`get`,describe:`Get secondary zone configuration for incoming zone transfers.`,builder:et,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.zoneTransfers.incoming.get(r)),{successLabel:`Loaded`})}};function nt(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 rt={command:`update`,describe:`Update secondary zone configuration for incoming zone transfers.`,builder:nt,handler:async e=>{if(e.dryRun){l({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:{"auto-refresh-seconds":e[`auto-refresh-seconds`],name:e.name,peers:e.peers,body:e.body}});return}let r=await i(e);if(e.zoneId=await n({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=s(e.body);c(await u(`Updating`,async()=>r.put(`/zones/${e.zoneId}/secondary_dns/incoming`,{body:t})),{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={};e[`auto-refresh-seconds`]!==void 0&&o(a,[`auto_refresh_seconds`],e[`auto-refresh-seconds`]),e.name!==void 0&&o(a,[`name`],d(e.name,`name`,`text`)),e.peers!==void 0&&o(a,[`peers`],e.peers),c(await u(`Updating`,async()=>r.put(`/zones/${e.zoneId}/secondary_dns/incoming`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Updated`})}},it={command:`incoming`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(Ze).command($e).command(tt).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function at(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 ot={command:`create`,describe:`Create primary zone configuration for outgoing zone transfers.`,builder:at,handler:async e=>{if(e.dryRun){l({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:{name:e.name,peers:e.peers,body:e.body}});return}let r=await i(e);if(e.zoneId=await n({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=s(e.body);c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/secondary_dns/outgoing`,{body:t})),{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={};e.name!==void 0&&o(a,[`name`],d(e.name,`name`,`text`)),e.peers!==void 0&&o(a,[`peers`],e.peers),c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/secondary_dns/outgoing`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created`})}};function st(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ct={command:`delete`,describe:`Delete primary zone configuration for outgoing zone transfers.`,builder:st,handler:async t=>{if(t.dryRun){l({command:`cf dns zone-transfers outgoing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
26
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.delete(`/zones/${t.zoneId}/secondary_dns/outgoing`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.dns.zoneTransfers.outgoing.delete(a)),{successLabel:`Deleted`})}};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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ut={command:`disable`,describe:`Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone.`,builder:lt,handler:async t=>{if(t.dryRun){l({command:`cf dns zone-transfers outgoing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/secondary_dns/outgoing/disable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force,message:`This operation turns off outgoing zone transfers for the primary zone, which means secondary zones will stop receiving updates.`})){process.stderr.write(`Aborted.
|
|
27
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.post(`/zones/${t.zoneId}/secondary_dns/outgoing/disable`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.dns.zoneTransfers.outgoing.disable(a)),{successLabel:`Deleted`})}};function dt(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 ft={command:`enable`,describe:`Enable outgoing zone transfers for primary zone.`,builder:dt,handler:async e=>{if(e.dryRun){l({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:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/secondary_dns/outgoing/enable`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.zoneTransfers.outgoing.enable(r)),{successLabel:`Created`})}};function pt(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 mt={command:`force-notify`,describe:`Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone.`,builder:pt,handler:async e=>{if(e.dryRun){l({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:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/secondary_dns/outgoing/force_notify`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.dns.zoneTransfers.outgoing.forceNotify(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:`get`,describe:`Get primary zone configuration for outgoing zone transfers.`,builder:ht,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.zoneTransfers.outgoing.get(r)),{successLabel:`Loaded`})}};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 transfer status.`,builder:_t,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.dns.zoneTransfers.outgoing.status.get(r)),{successLabel:`Loaded`})}},yt={command:`status`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bt(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 xt={command:`update`,describe:`Update primary zone configuration for outgoing zone transfers.`,builder:bt,handler:async e=>{if(e.dryRun){l({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:{name:e.name,peers:e.peers,body:e.body}});return}let r=await i(e);if(e.zoneId=await n({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=s(e.body);c(await u(`Updating`,async()=>r.put(`/zones/${e.zoneId}/secondary_dns/outgoing`,{body:t})),{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={};e.name!==void 0&&o(a,[`name`],d(e.name,`name`,`text`)),e.peers!==void 0&&o(a,[`peers`],e.peers),c(await u(`Updating`,async()=>r.put(`/zones/${e.zoneId}/secondary_dns/outgoing`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Updated`})}},St={command:`outgoing`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(ot).command(ct).command(ut).command(ft).command(mt).command(gt).command(xt).command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ct(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 wt={command:`create`,describe:`Create Peer.`,builder:Ct,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers peers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`json`,body:{name:e.name,body:e.body}});return}let n=await i(e),f=e.local?p:await r(n);if(e.accountId=f,e.body){let t=s(e.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/secondary_dns/peers`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The name of the peer.`));let m={};e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/secondary_dns/peers`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function Tt(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Et={command:`delete <peer-id>`,describe:`Delete Peer.`,builder:Tt,handler:async t=>{if(t.dryRun){l({command:`cf dns zone-transfers peers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/peers/${t[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(t[`peer-id`]))}`,pathParams:{"peer-id":String(t[`peer-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),o=t.local?p:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
28
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>n.delete(`/accounts/${o}/secondary_dns/peers/${encodeURIComponent(String(t[`peer-id`]))}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>n.dns.zoneTransfers.peers.delete(t[`peer-id`],o)),{successLabel:`Deleted`})}};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})}const Ot={command:`get <peer-id>`,describe:`Get Peer.`,builder:Dt,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers peers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/peers/${e[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(e[`peer-id`]))}`,pathParams:{"peer-id":String(e[`peer-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.zoneTransfers.peers.get(e[`peer-id`],n)),{successLabel:`Loaded`})}};function kt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`list`,describe:`List Peers.`,builder:kt,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers peers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/peers`,pathParams:{},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.zoneTransfers.peers.list(n)),{successLabel:`Loaded`})}};function jt(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 Mt={command:`update <peer-id>`,describe:`Modify Peer.`,builder:jt,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers peers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/peers/${e[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(e[`peer-id`]))}`,pathParams:{"peer-id":String(e[`peer-id`]??``)},bodyKind:`json`,body:{ip:e.ip,"ixfr-enable":e[`ixfr-enable`],name:e.name,port:e.port,"tsig-id":e[`tsig-id`],body:e.body}});return}let n=await i(e),f=e.local?p:await r(n);if(e.accountId=f,e.body){let t=s(e.body);c(await u(`Updating`,async()=>n.put(`/accounts/${f}/secondary_dns/peers/${encodeURIComponent(String(e[`peer-id`]))}`,{body:t})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await t(`name`,`The name of the peer.`));let m={};e.ip!==void 0&&o(m,[`ip`],d(e.ip,`ip`,`text`)),e[`ixfr-enable`]!==void 0&&o(m,[`ixfr_enable`],e[`ixfr-enable`]),e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),e.port!==void 0&&o(m,[`port`],e.port),e[`tsig-id`]!==void 0&&o(m,[`tsig_id`],d(e[`tsig-id`],`tsig-id`,`text`)),c(await u(`Updating`,async()=>n.put(`/accounts/${f}/secondary_dns/peers/${encodeURIComponent(String(e[`peer-id`]))}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},Nt={command:`peers`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(wt).command(Et).command(Ot).command(At).command(Mt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(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 Pt={command:`create`,describe:`Create TSIG.`,builder:$,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers tsigs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`json`,body:{algo:e.algo,name:e.name,secret:e.secret,body:e.body}});return}let n=await i(e),f=e.local?p:await r(n);if(e.accountId=f,e.body){let t=s(e.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/secondary_dns/tsigs`,{body:t})),{successLabel:`Created`});return}e.algo===void 0&&(e.algo=await t(`algo`,`TSIG algorithm.`)),e.name===void 0&&(e.name=await t(`name`,`TSIG key name.`)),e.secret===void 0&&(e.secret=await t(`secret`,`TSIG secret.`,{kind:`secret`}));let m={};e.algo!==void 0&&o(m,[`algo`],d(e.algo,`algo`,`text`)),e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),e.secret!==void 0&&o(m,[`secret`],d(e.secret,`secret`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/secondary_dns/tsigs`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function Ft(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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const It={command:`delete <tsig-id>`,describe:`Delete TSIG.`,builder:Ft,handler:async t=>{if(t.dryRun){l({command:`cf dns zone-transfers tsigs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/tsigs/${t[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(t[`tsig-id`]))}`,pathParams:{"tsig-id":String(t[`tsig-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),o=t.local?p:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
29
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>n.delete(`/accounts/${o}/secondary_dns/tsigs/${encodeURIComponent(String(t[`tsig-id`]))}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>n.dns.zoneTransfers.tsigs.delete(t[`tsig-id`],o)),{successLabel:`Deleted`})}};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})}const Rt={command:`get <tsig-id>`,describe:`Get TSIG.`,builder:Lt,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers tsigs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/tsigs/${e[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(e[`tsig-id`]))}`,pathParams:{"tsig-id":String(e[`tsig-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.zoneTransfers.tsigs.get(e[`tsig-id`],n)),{successLabel:`Loaded`})}};function zt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bt={command:`list`,describe:`List TSIGs.`,builder:zt,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers tsigs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/tsigs`,pathParams:{},bodyKind:`none`});return}let t=await i(e),n=e.local?p:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.dns.zoneTransfers.tsigs.list(n)),{successLabel:`Loaded`})}};function Vt(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 Ht={command:`update <tsig-id>`,describe:`Modify TSIG.`,builder:Vt,handler:async e=>{if(e.dryRun){l({command:`cf dns zone-transfers tsigs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/secondary_dns/tsigs/${e[`tsig-id`]==null?`<tsig-id>`:encodeURIComponent(String(e[`tsig-id`]))}`,pathParams:{"tsig-id":String(e[`tsig-id`]??``)},bodyKind:`json`,body:{algo:e.algo,name:e.name,secret:e.secret,body:e.body}});return}let n=await i(e),f=e.local?p:await r(n);if(e.accountId=f,e.body){let t=s(e.body);c(await u(`Updating`,async()=>n.put(`/accounts/${f}/secondary_dns/tsigs/${encodeURIComponent(String(e[`tsig-id`]))}`,{body:t})),{successLabel:`Updated`});return}e.algo===void 0&&(e.algo=await t(`algo`,`TSIG algorithm.`)),e.name===void 0&&(e.name=await t(`name`,`TSIG key name.`)),e.secret===void 0&&(e.secret=await t(`secret`,`TSIG secret.`,{kind:`secret`}));let m={};e.algo!==void 0&&o(m,[`algo`],d(e.algo,`algo`,`text`)),e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),e.secret!==void 0&&o(m,[`secret`],d(e.secret,`secret`,`text`)),c(await u(`Updating`,async()=>n.put(`/accounts/${f}/secondary_dns/tsigs/${encodeURIComponent(String(e[`tsig-id`]))}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},Ut={command:`tsigs`,describe:`Secondary DNS and zone transfer management`,builder:e=>e.command(Pt).command(It).command(Rt).command(Bt).command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Wt={command:`zone-transfers`,describe:`Operations for zone-transfers`,builder:e=>e.command(Ke).command(Ye).command(it).command(St).command(Nt).command(Ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Gt={command:`dns`,describe:`DNS management API for zones, records, DNSSEC, analytics, and zone transfers`,builder:e=>e.command(b).command(A).command(oe).command(Oe).command(Fe).command(Wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Gt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as e,t,x as n}from"./auth-CQcAgnOy.mjs";import{t as r}from"./output-D7_yAFVR.mjs";import{n as i,t as a}from"./progress-CjcQ6ato.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/${n()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(s),u=s.local?o:await e(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.list(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/${n()??`<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 t(s),u=s.local?o:await e(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.objects.list(u,s.id,c)),{successLabel:`Loaded`})}},d={command:`objects`,describe:`List Durable Object namespaces and inspect individual object instances within them`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`List Durable Object namespaces and inspect individual object instances within them`,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,T as t,b as n,h as r,t as i,x as a}from"./auth-CQcAgnOy.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-CjcQ6ato.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(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 m={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:p,handler:async e=>{if(e.dryRun){l({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:{email:e.email,body:e.body}});return}let n=await i(e),p=e.local?f:await r(n);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>n.post(`/accounts/${p}/email/routing/addresses`,{body:t})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The contact email address of the user.`));let m={};e.email!==void 0&&o(m,[`email`],d(e.email,`email`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${p}/email/routing/addresses`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function ee(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 te={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:ee,handler:async t=>{if(t.dryRun){l({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<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 i(t),o=t.local?f:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}c(await u(`Deleting`,async()=>n.emailRouting.addresses.delete(t[`destination-address-identifier`],o)),{successLabel:`Deleted`})}};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})}const g={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:h,handler:async e=>{if(e.dryRun){l({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/routing/addresses/${e[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(e[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(e[`destination-address-identifier`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?f:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.emailRouting.addresses.get(e[`destination-address-identifier`],n)),{successLabel:`Loaded`})}};function _(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:`boolean`,description:`Filter by verified destination addresses.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Lists existing destination addresses.`,builder:_,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],direction:e.direction,verified:e.verified};if(e.dryRun){l({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e),o=e.local?f:await r(n);e.accountId=o,c(await u(`Loading`,async()=>n.emailRouting.addresses.list(o,t)),{successLabel:`Loaded`})}},y={command:`addresses`,describe:`Verified destination email addresses that can receive forwarded mail`,builder:e=>e.command(m).command(te).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:b,handler:async t=>{if(t.dryRun){l({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.post(`/zones/${t.zoneId}/email/routing/disable`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.emailRouting.disable(a)),{successLabel:`Deleted`})}};function S(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 C={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:S,handler:async e=>{if(e.dryRun){l({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:{name:e.name,body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/email/routing/dns`,{body:n})),{successLabel:`Created`});return}let r={};e.name!==void 0&&o(r,[`name`],d(e.name,`name`,`text`)),c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/email/routing/dns`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function w(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 T={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:w,handler:async t=>{if(t.dryRun){l({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{name:t.name,body:t.body}});return}let r=await i(t);if(t.zoneId=await n({zone:t.zone},r,{quiet:t.quiet}),!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>r.delete(`/zones/${t.zoneId}/email/routing/dns`,{body:e})),{successLabel:`Deleted`});return}let a={};t.name!==void 0&&o(a,[`name`],d(t.name,`name`,`text`)),c(await u(`Deleting`,async()=>r.delete(`/zones/${t.zoneId}/email/routing/dns`,{body:Object.keys(a).length>0?a:void 0})),{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:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:E,handler:async e=>{if(e.dryRun){l({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:{name:e.name,body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/email/routing/dns`,{body:n})),{successLabel:`Updated`});return}let r={};e.name!==void 0&&o(r,[`name`],d(e.name,`name`,`text`)),c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/email/routing/dns`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}};function O(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 k={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:O,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){l({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 r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.emailRouting.dns.get(a,t)),{successLabel:`Loaded`})}},A={command:`dns`,describe:`DNS records required for email routing (MX, SPF, DKIM) — enable, lock, or disable`,builder:e=>e.command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(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 M={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:j,handler:async e=>{if(e.dryRun){l({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:`json`,body:{body:e.body}});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/email/routing/enable`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.emailRouting.enable(r)),{successLabel:`Created`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:N,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailRouting.get(r)),{successLabel:`Loaded`})}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:F,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailRouting.rules.catchAlls.get(r)),{successLabel:`Loaded`})}};function L(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update`,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:L,handler:async e=>{if(e.dryRun){l({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:{enabled:e.enabled,name:e.name,body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.put(`/zones/${e.zoneId}/email/routing/rules/catch_all`,{body:n})),{successLabel:`Updated`});return}let r={};e.enabled!==void 0&&o(r,[`enabled`],e.enabled),e.name!==void 0&&o(r,[`name`],d(e.name,`name`,`text`)),c(await u(`Updating`,async()=>t.put(`/zones/${e.zoneId}/email/routing/rules/catch_all`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}},z={command:`catch-alls`,describe:`Routing rules that match incoming email addresses and forward to destination mailboxes`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default: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 V={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:B,handler:async e=>{if(e.dryRun){l({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:{enabled:e.enabled,name:e.name,priority:e.priority,body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/email/routing/rules`,{body:n})),{successLabel:`Created`});return}let r={};e.enabled!==void 0&&o(r,[`enabled`],e.enabled),e.name!==void 0&&o(r,[`name`],d(e.name,`name`,`text`)),e.priority!==void 0&&o(r,[`priority`],e.priority),c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/email/routing/rules`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}};function H(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 U={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:H,handler:async t=>{if(t.dryRun){l({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/rules/${t[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(t[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(t[`rule-identifier`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}c(await u(`Deleting`,async()=>r.emailRouting.rules.delete(t[`rule-identifier`],a)),{successLabel:`Deleted`})}};function W(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 G={command:`get <rule-identifier>`,describe:`Get information for a specific routing rule already created.`,builder:W,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailRouting.rules.get(e[`rule-identifier`],r)),{successLabel:`Loaded`})}};function K(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:`boolean`,description:`Filter by enabled routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Lists existing routing rules.`,builder:K,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],enabled:e.enabled};if(e.dryRun){l({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 r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.emailRouting.rules.list(a,t)),{successLabel:`Loaded`})}};function J(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(`priority`,{type:`number`,description:`Priority of the routing rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <rule-identifier>`,describe:`Update actions and matches, or enable/disable specific routing rules. Forward actions require all destination addresses to be verified.`,builder:J,handler:async e=>{if(e.dryRun){l({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:{enabled:e.enabled,name:e.name,priority:e.priority,body:e.body}});return}let t=await i(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.put(`/zones/${e.zoneId}/email/routing/rules/${encodeURIComponent(String(e[`rule-identifier`]))}`,{body:n})),{successLabel:`Updated`});return}let r={};e.enabled!==void 0&&o(r,[`enabled`],e.enabled),e.name!==void 0&&o(r,[`name`],d(e.name,`name`,`text`)),e.priority!==void 0&&o(r,[`priority`],e.priority),c(await u(`Updating`,async()=>t.put(`/zones/${e.zoneId}/email/routing/rules/${encodeURIComponent(String(e[`rule-identifier`]))}`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated`})}},X={command:`rules`,describe:`Routing rules that match incoming email addresses and forward to destination mailboxes`,builder:e=>e.command(V).command(U).command(G).command(q).command(Y).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(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 Q={command:`create`,describe:`Create a routing suppression entry`,builder:Z,handler:async e=>{if(e.dryRun){l({command:`cf email-routing suppression routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/routing/suppression`,pathParams:{},bodyKind:`json`,body:{email:e.email,"expires-at":e[`expires-at`],body:e.body}});return}let n=await i(e),p=e.local?f:await r(n);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>n.post(`/accounts/${p}/email/routing/suppression`,{body:t})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The email field`));let m={};e.email!==void 0&&o(m,[`email`],d(e.email,`email`,`text`)),e[`expires-at`]!==void 0&&o(m,[`expires_at`],d(e[`expires-at`],`expires-at`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${p}/email/routing/suppression`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function ne(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 re={command:`delete <suppression-id>`,describe:`Delete a routing suppression entry`,builder:ne,handler:async t=>{if(t.dryRun){l({command:`cf email-routing suppression routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<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 i(t),o=t.local?f:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}c(await u(`Deleting`,async()=>n.emailRouting.suppression.routing.delete(o,t[`suppression-id`])),{successLabel:`Deleted`})}};function ie(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 ae={command:`get <suppression-id>`,describe:`Get a routing suppression entry`,builder:ie,handler:async e=>{if(e.dryRun){l({command:`cf email-routing suppression routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/routing/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?f:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.emailRouting.suppression.routing.get(n,e[`suppression-id`])),{successLabel:`Loaded`})}};function oe(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 se={command:`list`,describe:`List routing suppression entries`,builder:oe,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){l({command:`cf email-routing suppression routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/routing/suppression`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e),o=e.local?f:await r(n);e.accountId=o,c(await u(`Loading`,async()=>n.emailRouting.suppression.routing.list(o,t)),{successLabel:`Loaded`})}},ce={command:`routing`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(Q).command(re).command(ae).command(se).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 ue={command:`create`,describe:`Create a sending suppression entry`,builder:le,handler:async e=>{if(e.dryRun){l({command:`cf email-routing suppression sending create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/sending/suppression`,pathParams:{},bodyKind:`json`,body:{email:e.email,"expires-at":e[`expires-at`],body:e.body}});return}let n=await i(e),p=e.local?f:await r(n);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>n.post(`/accounts/${p}/email/sending/suppression`,{body:t})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The email field`));let m={};e.email!==void 0&&o(m,[`email`],d(e.email,`email`,`text`)),e[`expires-at`]!==void 0&&o(m,[`expires_at`],d(e[`expires-at`],`expires-at`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${p}/email/sending/suppression`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function de(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 fe={command:`delete <suppression-id>`,describe:`Delete a sending suppression entry`,builder:de,handler:async t=>{if(t.dryRun){l({command:`cf email-routing suppression sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<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 i(t),o=t.local?f:await r(n);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}c(await u(`Deleting`,async()=>n.emailRouting.suppression.sending.delete(o,t[`suppression-id`])),{successLabel:`Deleted`})}};function pe(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 me={command:`get <suppression-id>`,describe:`Get a sending suppression entry`,builder:pe,handler:async e=>{if(e.dryRun){l({command:`cf email-routing suppression sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/sending/suppression/${e[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(e[`suppression-id`]))}`,pathParams:{"suppression-id":String(e[`suppression-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=e.local?f:await r(t);e.accountId=n,c(await u(`Loading`,async()=>t.emailRouting.suppression.sending.get(n,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 ge={command:`list`,describe:`List sending suppression entries`,builder:he,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){l({command:`cf email-routing suppression sending list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/email/sending/suppression`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e),o=e.local?f:await r(n);e.accountId=o,c(await u(`Loading`,async()=>n.emailRouting.suppression.sending.list(o,t)),{successLabel:`Loaded`})}},_e={command:`sending`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(ue).command(fe).command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(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 ye={command:`create`,describe:`Create a zone routing suppression entry`,builder:ve,handler:async e=>{if(e.dryRun){l({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:{email:e.email,"expires-at":e[`expires-at`],body:e.body}});return}let r=await i(e);if(e.zoneId=await n({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=s(e.body);c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/email/routing/suppression`,{body:t})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The email field`));let a={};e.email!==void 0&&o(a,[`email`],d(e.email,`email`,`text`)),e[`expires-at`]!==void 0&&o(a,[`expires_at`],d(e[`expires-at`],`expires-at`,`text`)),c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/email/routing/suppression`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created`})}};function be(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 xe={command:`delete <suppression-id>`,describe:`Delete a zone routing suppression entry`,builder:be,handler:async t=>{if(t.dryRun){l({command:`cf email-routing suppression zone routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/routing/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
9
|
+
`);return}c(await u(`Deleting`,async()=>r.emailRouting.suppression.zone.routing.delete(a,t[`suppression-id`])),{successLabel:`Deleted`})}};function Se(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 Ce={command:`get <suppression-id>`,describe:`Get a zone routing suppression entry`,builder:Se,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailRouting.suppression.zone.routing.get(r,e[`suppression-id`])),{successLabel:`Loaded`})}};function we(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 Te={command:`list`,describe:`List zone routing suppression entries`,builder:we,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){l({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 r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.emailRouting.suppression.zone.routing.list(a,t)),{successLabel:`Loaded`})}},Ee={command:`routing`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command(ye).command(xe).command(Ce).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(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 $={command:`create`,describe:`Create a zone sending suppression entry`,builder:De,handler:async e=>{if(e.dryRun){l({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:{email:e.email,"expires-at":e[`expires-at`],body:e.body}});return}let r=await i(e);if(e.zoneId=await n({zone:e.zone},r,{quiet:e.quiet}),e.body){let t=s(e.body);c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/email/sending/suppression`,{body:t})),{successLabel:`Created`});return}e.email===void 0&&(e.email=await t(`email`,`The email field`));let a={};e.email!==void 0&&o(a,[`email`],d(e.email,`email`,`text`)),e[`expires-at`]!==void 0&&o(a,[`expires_at`],d(e[`expires-at`],`expires-at`,`text`)),c(await u(`Creating`,async()=>r.post(`/zones/${e.zoneId}/email/sending/suppression`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created`})}};function Oe(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 ke={command:`delete <suppression-id>`,describe:`Delete a zone sending suppression entry`,builder:Oe,handler:async t=>{if(t.dryRun){l({command:`cf email-routing suppression zone sending delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/email/sending/suppression/${t[`suppression-id`]==null?`<suppression-id>`:encodeURIComponent(String(t[`suppression-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"suppression-id":String(t[`suppression-id`]??``)},bodyKind:`none`});return}let r=await i(t),a=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}c(await u(`Deleting`,async()=>r.emailRouting.suppression.zone.sending.delete(a,t[`suppression-id`])),{successLabel:`Deleted`})}};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})}const je={command:`get <suppression-id>`,describe:`Get a zone sending suppression entry`,builder:Ae,handler:async e=>{if(e.dryRun){l({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 i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailRouting.suppression.zone.sending.get(r,e[`suppression-id`])),{successLabel:`Loaded`})}};function Me(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 Ne={command:`list`,describe:`List zone sending suppression entries`,builder:Me,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){l({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 r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,c(await u(`Loading`,async()=>r.emailRouting.suppression.zone.sending.list(a,t)),{successLabel:`Loaded`})}},Pe={command:`sending`,describe:`Email suppression list management for routing and sending`,builder:e=>e.command($).command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fe={command:`zone`,describe:`Operations for suppression.zone`,builder:e=>e.command(Ee).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`suppression`,describe:`Operations for suppression`,builder:e=>e.command(ce).command(_e).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Le={command:`email-routing`,describe:`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,builder:e=>e.command(x).command(M).command(P).command(y).command(A).command(X).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Le as default};
|