cf 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +96 -95
- package/dist/_meta/commands.json +16558 -13965
- package/dist/_meta/schemas.json +52979 -16753
- package/dist/abuse-reports-dMIfUJ8v.mjs +8 -0
- package/dist/accounts-Kx1epdA1.mjs +22 -0
- package/dist/acm-Utu252kC.mjs +3 -0
- package/dist/addressing-CBq7Z7Vq.mjs +12 -0
- package/dist/{agent-context-D26woB9J.mjs → agent-context-BGTU299M.mjs} +1 -1
- package/dist/ai-DOOKLPkG.mjs +2 -0
- package/dist/ai-gateway-Cj1T3avF.mjs +8 -0
- package/dist/ai-search-CQF_Sn7d.mjs +7 -0
- package/dist/ai_gateway-C3fH22C0.mjs +4 -0
- package/dist/alerting-CqmEIaKn.mjs +6 -0
- package/dist/analytics-Dv-X8x7D.mjs +20 -0
- package/dist/analytics_engine-DdXVR8z2.mjs +2 -0
- package/dist/api-gateway-CNv0IHTU.mjs +33 -0
- package/dist/argo-CX_A4kcn.mjs +2 -0
- package/dist/audit-logs-BfBf3oo-.mjs +2 -0
- package/dist/auth-SyWhMmPu.mjs +6 -0
- package/dist/auth-ffdf9yR0.mjs +135 -0
- package/dist/autorag-BuGhGTeZ.mjs +2 -0
- package/dist/billing-PoG81XaQ.mjs +2 -0
- package/dist/body-parser-DKa8Ipg1.mjs +2 -0
- package/dist/bot-management-CFvtVx62.mjs +5 -0
- package/dist/botnet-feed-B-M4Yu0W.mjs +3 -0
- package/dist/brand-protection-D05Eg-_6.mjs +3 -0
- package/dist/browser-rendering-xu8F_Rrv.mjs +4 -0
- package/dist/build-DYkGW4dh.mjs +1054 -0
- package/dist/cache-DsoW6Xwv.mjs +5 -0
- package/dist/calls-CZbO7TyR.mjs +4 -0
- package/dist/certificate-authorities-D2yr7_3t.mjs +2 -0
- package/dist/cli-types-CRIDdDw3.mjs +2 -0
- package/dist/client-certificates-MJcDsTId.mjs +3 -0
- package/dist/cloud-connector-DWOrN2eM.mjs +2 -0
- package/dist/cloudforce-one-2Bhz8YdW.mjs +21 -0
- package/dist/{completions-BKrxcfhN.mjs → completions-BwRpZQVn.mjs} +1 -1
- package/dist/{config-BIfdEY0E.mjs → config-DYzlVxcB.mjs} +1 -1
- package/dist/connectivity-BX8C7tvK.mjs +3 -0
- package/dist/content-scanning-r6uzMO1r.mjs +4 -0
- package/dist/context-DGlHRGWM.mjs +2 -0
- package/dist/custom-certificates-aAiEguR7.mjs +5 -0
- package/dist/custom-hostnames-AG5yBHIi.mjs +5 -0
- package/dist/custom-nameservers-D1DtlRue.mjs +3 -0
- package/dist/custom-pages-DQCi2plU.mjs +4 -0
- package/dist/d1-DbnYhw45.mjs +4 -0
- package/dist/data-security-D_EtYBfo.mjs +6 -0
- package/dist/dcv-delegation-CHspSzTI.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-CQial3kN.mjs +2 -0
- package/dist/{dev-BfKYB-R_.mjs → dev-B38LfCTl.mjs} +1 -1
- package/dist/diagnostics-BJQGjVJn.mjs +3 -0
- package/dist/dispatch-namespaces-DmHvoBOg.mjs +7 -0
- package/dist/{dist-C_bu5HwZ.mjs → dist-AIcZFk0U.mjs} +7 -7
- package/dist/dist-DNBSHor6.mjs +301 -0
- package/dist/dns-VMhQSr5n.mjs +29 -0
- package/dist/dns-firewall-B4DVXFBQ.mjs +57 -0
- package/dist/durable-objects-CTboySEo.mjs +2 -0
- package/dist/email-routing-tIR2SFu-.mjs +10 -0
- package/dist/email-security-Ca1id3rZ.mjs +8 -0
- package/dist/email-sending-DwWKc5jC.mjs +3 -0
- package/dist/filters-A4dg_a68.mjs +4 -0
- package/dist/firewall-DWPQgYd9.mjs +11 -0
- package/dist/fraud-BMkSsJGU.mjs +20 -0
- package/dist/google-tag-gateway-BGD49nRC.mjs +2 -0
- package/dist/healthchecks-CtIfrFql.mjs +4 -0
- package/dist/hostnames-BiomxukN.mjs +3 -0
- package/dist/hyperdrive-Da104VaQ.mjs +18 -0
- package/dist/iam-BIGKo0WW.mjs +6 -0
- package/dist/images-BO8FbDAa.mjs +5 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-CY6_79v8.mjs +3 -0
- package/dist/{ips-B0cK7D0_.mjs → ips-K4bzaGqd.mjs} +1 -1
- package/dist/keyless-certificates-CZC-L8gM.mjs +3 -0
- package/dist/kv-8o27w_pY.mjs +5 -0
- package/dist/leaked-credential-checks-qLzRyu85.mjs +3 -0
- package/dist/load-balancers-DtG8nj25.mjs +6 -0
- package/dist/logpush-4L0njy1d.mjs +4 -0
- package/dist/logs-B_Yp95hv.mjs +3 -0
- package/dist/magic-cloud-networking-CSOM3EM-.mjs +5 -0
- package/dist/magic-network-monitoring-BnwvM4-I.mjs +4 -0
- package/dist/magic-transit-CXDyvhxq.mjs +90 -0
- package/dist/managed-transforms-D15yVbZx.mjs +3 -0
- package/dist/mtls-certificates-D8k0AXWK.mjs +3 -0
- package/dist/network-interconnects-rrr7red3.mjs +36 -0
- package/dist/observability-DWvpqnQJ.mjs +4 -0
- package/dist/organizations-T77D50Sq.mjs +41 -0
- package/dist/origin-ca-certificates-DXIvD8H5.mjs +3 -0
- package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +2 -0
- package/dist/origin-tls-client-auth-CaVW1Ztp.mjs +4 -0
- package/dist/output-BJFNwj7b.mjs +2 -0
- package/dist/page-rules-CjZPTMQX.mjs +18 -0
- package/dist/page-shield-D5RRNJCY.mjs +37 -0
- package/dist/pages-CWJtJnL0.mjs +11 -0
- package/dist/pipelines-B0L_7j9e.mjs +6 -0
- package/dist/{progress-DZfTxbrx.mjs → progress-CrCGTq7N.mjs} +1 -1
- package/dist/queues-CN6DPhRR.mjs +6 -0
- package/dist/r2-DQIcyRtA.mjs +21 -0
- package/dist/r2-data-catalog-Bbo93TJx.mjs +14 -0
- package/dist/radar-Bxb0WX8V.mjs +2 -0
- package/dist/rate-limits-DcrQV6Ar.mjs +5 -0
- package/dist/raw-fetch-Dlccg0Tr.mjs +2 -0
- package/dist/realtime-kit-CaquuVOE.mjs +18 -0
- package/dist/registrar-Ko-xZemf.mjs +46 -0
- package/dist/request-tracers-DOW_reTJ.mjs +2 -0
- package/dist/{resolve-BuJRWSk0.mjs → resolve-4-OSeHlK.mjs} +1 -1
- package/dist/resource-sharing-D7TX0JV0.mjs +5 -0
- package/dist/resource-tagging-C3qtLzCz.mjs +16 -0
- package/dist/rules-BXRADHL5.mjs +4 -0
- package/dist/rulesets-CBgpeSvJ.mjs +8 -0
- package/dist/rum-BjPptTUP.mjs +4 -0
- package/dist/{schema-D0_cbcDt.mjs → schema-D16TgWBg.mjs} +1 -1
- package/dist/schema-validation-Dgv_opM3.mjs +24 -0
- package/dist/scim-DdSEr4kZ.mjs +3 -0
- package/dist/secrets-store-7BfyvJLb.mjs +25 -0
- package/dist/security-center-DAy6AKtT.mjs +2 -0
- package/dist/security-txt-xAMb7K6Y.mjs +3 -0
- package/dist/session-COHHdS7A.mjs +5 -0
- package/dist/shared-AGtpXwwL.mjs +2 -0
- package/dist/smart-shield-TeWZFnH2.mjs +3 -0
- package/dist/snippets-CCSsCXVs.mjs +4 -0
- package/dist/{spawn-D_cjG87Z.mjs → spawn-DcppKGI5.mjs} +1 -1
- package/dist/spectrum-CTTZID8u.mjs +63 -0
- package/dist/speed-CuzTE0AL.mjs +4 -0
- package/dist/{src-C5qivNKH.mjs → src-BW6vfAwE.mjs} +15 -15
- package/dist/ssl-BWA2LdwC.mjs +15 -0
- package/dist/stream-GFsIZ-pP.mjs +14 -0
- package/dist/tenants-Bd7NGQ_m.mjs +2 -0
- package/dist/token-validation-DAgtFOvs.mjs +10 -0
- package/dist/{tools-CtKbk6VS.mjs → tools-DXQmfFuE.mjs} +1 -1
- package/dist/turnstile-cfdaO4ca.mjs +23 -0
- package/dist/{ui-mP_arYIg.mjs → ui-D4KtlMh9.mjs} +1 -1
- package/dist/url-normalization-B5RN4nLD.mjs +3 -0
- package/dist/url-scanner-BrZ1L9OC.mjs +2 -0
- package/dist/user-CAo-yCJA.mjs +10 -0
- package/dist/vectorize-C7_oQlaI.mjs +4 -0
- package/dist/versions-CUwWJWmy.mjs +2 -0
- package/dist/waiting-rooms-Dln5ICg5.mjs +11 -0
- package/dist/web3-HQJRm38W.mjs +4 -0
- package/dist/workers-Dg7ddG2Q.mjs +18 -0
- package/dist/workers-builds-AVfx8IyL.mjs +7 -0
- package/dist/workflows-VquuSh2J.mjs +4 -0
- package/dist/zaraz-xYSWIV4P.mjs +2 -0
- package/dist/zero-trust-CP96wnSh.mjs +118 -0
- package/dist/zones-BSgmZ9WC.mjs +21 -0
- package/package.json +7 -6
- package/dist/abuse-reports-ChV_yD7f.mjs +0 -8
- package/dist/accounts-BCYecXFh.mjs +0 -21
- package/dist/acm-DD8zSds2.mjs +0 -3
- package/dist/addressing-D4Eqw5Bi.mjs +0 -13
- package/dist/ai-DfXMOMx_.mjs +0 -2
- package/dist/ai-gateway-DdRFthMo.mjs +0 -8
- package/dist/ai-search-C_68CDj1.mjs +0 -7
- package/dist/alerting-DbhqhVCp.mjs +0 -6
- package/dist/analytics-BSBBc7ep.mjs +0 -20
- package/dist/api-gateway-CZ4swbkQ.mjs +0 -33
- package/dist/argo-tms9ZwHO.mjs +0 -2
- package/dist/audit-logs-24qyW8cl.mjs +0 -2
- package/dist/auth-BlSmtIKd.mjs +0 -112
- package/dist/auth-DQ8miey6.mjs +0 -6
- package/dist/autorag-kgNt06GD.mjs +0 -2
- package/dist/billing-lwBHNTXC.mjs +0 -2
- package/dist/body-parser-Br-BoYk-.mjs +0 -2
- package/dist/bot-management-LKf7BqUr.mjs +0 -5
- package/dist/botnet-feed-nQ-gErTS.mjs +0 -3
- package/dist/brand-protection-DOKv9GRr.mjs +0 -3
- package/dist/browser-rendering-CBExtgGt.mjs +0 -4
- package/dist/build-C_48VvoK.mjs +0 -1056
- package/dist/builds-C_ySULja.mjs +0 -2
- package/dist/cache-BBiiNZHP.mjs +0 -5
- package/dist/calls-DA5Xzwev.mjs +0 -4
- package/dist/certificate-authorities-sXyR_yGp.mjs +0 -2
- package/dist/client-certificates-tV0aCLQJ.mjs +0 -3
- package/dist/cloud-connector-DZfHcSso.mjs +0 -2
- package/dist/cloudforce-one-y1PgQmI9.mjs +0 -21
- package/dist/connectivity-8SOqaFDn.mjs +0 -3
- package/dist/content-scanning-B9y6K_G5.mjs +0 -4
- package/dist/context-DTIbtQn5.mjs +0 -2
- package/dist/custom-certificates-sWksR8Ys.mjs +0 -5
- package/dist/custom-hostnames-91QZkdqN.mjs +0 -5
- package/dist/custom-nameservers-DajZaZvE.mjs +0 -3
- package/dist/custom-pages-Cu7gmwzT.mjs +0 -4
- package/dist/d1-H_VRsVmF.mjs +0 -3
- package/dist/dcv-delegation-C-qhEYEZ.mjs +0 -2
- package/dist/deploy--9wYOkHg.mjs +0 -2
- package/dist/diagnostics-D2B2LPZZ.mjs +0 -3
- package/dist/dispatch-namespaces-CyrXBU_w.mjs +0 -7
- package/dist/dist-DvKjT2TT.mjs +0 -303
- package/dist/dns-Bn9Uz_Nj.mjs +0 -29
- package/dist/dns-firewall-BslP4p-j.mjs +0 -57
- package/dist/durable-objects-BN1ZnHhm.mjs +0 -2
- package/dist/email-routing-n2TnTaRR.mjs +0 -10
- package/dist/email-security-C9SEx0kh.mjs +0 -60
- package/dist/email-sending-DayZ7u3I.mjs +0 -3
- package/dist/filters-CI_XTgfQ.mjs +0 -4
- package/dist/firewall-CcaayGig.mjs +0 -11
- package/dist/fraud-Cr7aPCV8.mjs +0 -8
- package/dist/google-tag-gateway-B3GpYgQ4.mjs +0 -2
- package/dist/healthchecks-CVTsR_OC.mjs +0 -4
- package/dist/hostnames-Bd_Wa5l6.mjs +0 -3
- package/dist/hyperdrive-BBJhEDZd.mjs +0 -18
- package/dist/iam-D_FN0pDF.mjs +0 -6
- package/dist/images-CAP2hAlZ.mjs +0 -5
- package/dist/intel-CkxfzqmJ.mjs +0 -3
- package/dist/keyless-certificates-LcLmHZsX.mjs +0 -3
- package/dist/kv-_TkUQ6fs.mjs +0 -5
- package/dist/leaked-credential-checks-Dhvaen22.mjs +0 -3
- package/dist/load-balancers-Ckr0UIpk.mjs +0 -6
- package/dist/logpush-Cj946hxT.mjs +0 -4
- package/dist/logs-DgC9hjvJ.mjs +0 -3
- package/dist/magic-cloud-networking-WbDvPzuG.mjs +0 -5
- package/dist/magic-network-monitoring-BcHShvGQ.mjs +0 -4
- package/dist/magic-transit-B8sCOkt_.mjs +0 -89
- package/dist/managed-transforms-BpOr-8HY.mjs +0 -3
- package/dist/mtls-certificates-fOul8D5g.mjs +0 -3
- package/dist/network-interconnects-BSW65xlh.mjs +0 -36
- package/dist/organizations-T4vKGFAb.mjs +0 -41
- package/dist/origin-ca-certificates-ChM0lZ64.mjs +0 -3
- package/dist/origin-post-quantum-encryption-C7o26ARh.mjs +0 -2
- package/dist/origin-tls-client-auth-D32dpZk_.mjs +0 -5
- package/dist/output-D7_yAFVR.mjs +0 -2
- package/dist/page-rules-RFoj8CjN.mjs +0 -18
- package/dist/page-shield-VTktzKDN.mjs +0 -37
- package/dist/pages-L1ITjXDZ.mjs +0 -10
- package/dist/pipelines-BPO0Lnil.mjs +0 -6
- package/dist/queues-B0C06L9r.mjs +0 -6
- package/dist/r2-DP020Tmq.mjs +0 -21
- package/dist/r2-data-catalog-Dmipvz5F.mjs +0 -14
- package/dist/radar-DR3VMknH.mjs +0 -2
- package/dist/rate-limits-DnHPBPgU.mjs +0 -5
- package/dist/raw-fetch-DlXYwVA8.mjs +0 -2
- package/dist/realtime-kit-C430aq2d.mjs +0 -6
- package/dist/registrar-7Qy50zbW.mjs +0 -46
- package/dist/request-tracers-sv99NDIl.mjs +0 -2
- package/dist/resource-sharing-uEjC7lnQ.mjs +0 -5
- package/dist/resource-tagging-CiODdP3N.mjs +0 -16
- package/dist/rules-FXAyTrwk.mjs +0 -4
- package/dist/rulesets-B6aUsFFB.mjs +0 -8
- package/dist/rum-CyyGJhp5.mjs +0 -4
- package/dist/schema-validation-ByU49h--.mjs +0 -4
- package/dist/scim-DdTS65_C.mjs +0 -3
- package/dist/scm-CilfPOue.mjs +0 -2
- package/dist/secrets-store-ClOUVhBJ.mjs +0 -18
- package/dist/security-center-4iSBqTrf.mjs +0 -2
- package/dist/security-txt-kGxdkDY6.mjs +0 -3
- package/dist/session-mW-s8ghP.mjs +0 -2
- package/dist/smart-shield-B-SQd2Qp.mjs +0 -3
- package/dist/snippets-Aq58ojqw.mjs +0 -4
- package/dist/spectrum-0gFvGI6y.mjs +0 -59
- package/dist/speed-DAZU8w3T.mjs +0 -4
- package/dist/ssl-BRlXa-5w.mjs +0 -15
- package/dist/stream-BAxsVeBX.mjs +0 -14
- package/dist/tenants-Df6xDqoA.mjs +0 -2
- package/dist/token-validation-pO4dCjCy.mjs +0 -4
- package/dist/turnstile-B1dmO8wE.mjs +0 -23
- package/dist/url-normalization-sUDVmrUt.mjs +0 -3
- package/dist/url-scanner-CwOKRkYo.mjs +0 -2
- package/dist/user-D_UrIdNq.mjs +0 -10
- package/dist/vectorize-BEbBn9G9.mjs +0 -4
- package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
- package/dist/waiting-rooms-BQC-urV4.mjs +0 -11
- package/dist/web3-CIH2iQeX.mjs +0 -4
- package/dist/workers-B9EvrpH3.mjs +0 -16
- package/dist/workers-builds-DzWSiRd2.mjs +0 -7
- package/dist/workflows-aD81gA4k.mjs +0 -4
- package/dist/zaraz-Cg1dsvrZ.mjs +0 -2
- package/dist/zero-trust-D-xQXWcy.mjs +0 -119
- package/dist/zones-DQzucJDd.mjs +0 -28
- /package/dist/{metadata-DGdCpUxn.mjs → metadata-5VwHPW6C.mjs} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,E as t,S as n,T as r,n as i}from"./auth-ffdf9yR0.mjs";import{n as a,t as o}from"./body-parser-DKa8Ipg1.mjs";import{t as s}from"./output-BJFNwj7b.mjs";import{n as c,t as l}from"./progress-CrCGTq7N.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./cli-types-CRIDdDw3.mjs";function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`trigger`,describe:`Triggeres a new activation check for a PENDING Zone. This can be triggered every 5 min for paygo/ent customers, every hour for FREE Zones.`,builder:f,handler:async e=>{if(e.dryRun){c({command:`cf zones activation-check trigger`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/activation_check`,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,s(await l(`Updating`,async()=>t.zones.activationCheck.trigger({zone_id:r})),{successLabel:`Updated`})}},te={command:`activation-check`,describe:`Operations for activation-check`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).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:`edit`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:p,handler:async e=>{if(e.dryRun){c({command:`cf zones aegis edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`)}}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.aegis.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`)}});s(await l(`Updating`,async()=>t.zones.aegis.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf zones aegis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/aegis`,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,s(await l(`Loading`,async()=>t.zones.aegis.get({zone_id:r})),{successLabel:`Loaded`})}},_={command:`aegis`,describe:`Aegis operations`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`account-id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial zone is
|
|
3
|
+
typically a partner-hosted zone or a CNAME setup.
|
|
4
|
+
`,choices:[`full`,`partial`,`secondary`,`internal`],default:`full`}).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 Zone`,builder:v,handler:async t=>{if(t.dryRun){c({command:`cf zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({account:{id:u(t[`account-id`],`account-id`,`text`)},name:u(t.name,`name`,`text`),type:u(t.type,`type`,`text`)}):a(t.body)});return}let n=await i(t);if(t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.zones.create({...e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await e(`name`,`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`));let r=o({account:{id:u(t[`account-id`],`account-id`,`text`)},name:u(t.name,`name`,`text`),type:u(t.type,`type`,`text`)});s(await l(`Creating`,async()=>n.zones.create({...r})),{successLabel:`Created`})}};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})}const x={command:`delete`,describe:`Deletes an existing zone.`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),a=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=a,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}s(await l(`Deleting`,async()=>t.zones.delete({zone_id:a})),{successLabel:`Deleted`})}};function S(e){return e.option(`paused`,{type:`boolean`,description:`Indicates whether the zone is only using Cloudflare DNS services. A
|
|
6
|
+
true value means the zone will not receive security or performance
|
|
7
|
+
benefits.
|
|
8
|
+
`}).option(`plan-id`,{type:`string`,description:`Identifier`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial
|
|
9
|
+
zone is typically a partner-hosted zone or a CNAME setup. This
|
|
10
|
+
parameter is only available to Enterprise customers or if it has
|
|
11
|
+
been explicitly enabled on a zone.
|
|
12
|
+
`,choices:[`full`,`partial`,`secondary`,`internal`]}).option(`vanity-name-servers`,{type:`string`,array:!0,description:`An array of domains used for custom name servers. This is only
|
|
13
|
+
available for Business and Enterprise plans.`}).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`,describe:`Edits a zone. Only one zone property can be changed at a time.`,builder:S,handler:async e=>{if(e.dryRun){c({command:`cf zones edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({paused:e.paused,plan:{id:u(e[`plan-id`],`plan-id`,`text`)},type:u(e.type,`type`,`text`),vanity_name_servers:e[`vanity-name-servers`]}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({paused:e.paused,plan:{id:u(e[`plan-id`],`plan-id`,`text`)},type:u(e.type,`type`,`text`),vanity_name_servers:e[`vanity-name-servers`]});s(await l(`Updating`,async()=>t.zones.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function w(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 T={command:`create`,describe:`Creates environments for a zone.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf zones environments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(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=a(e.body);s(await l(`Creating`,async()=>t.zones.environments.create({body:n,zone_id:r})),{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 E(e){return e.positional(`environment-id`,{type:`string`,description:`Reference identifier for the environment.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <environment-id>`,describe:`Deletes a zone environment by reference identifier.`,builder:E,handler:async e=>{if(e.dryRun){c({command:`cf zones environments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`none`});return}let t=await i(e),a=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=a,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}s(await l(`Deleting`,async()=>t.zones.environments.delete({zone_id:a,environment_id:e[`environment-id`]})),{successLabel:`Deleted`})}};function O(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 k={command:`edit`,describe:`Applies partial updates to zone environments.`,builder:O,handler:async e=>{if(e.dryRun){c({command:`cf zones environments edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.environments.edit({body:n,zone_id:r})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Lists configured environments for a zone.`,builder:A,handler:async e=>{if(e.dryRun){c({command:`cf zones environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,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,s(await l(`Loading`,async()=>t.zones.environments.list({zone_id:r})),{successLabel:`Loaded`})}};function M(e){return e.positional(`environment-id`,{type:`string`,description:`Reference identifier for the environment.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`rollback <environment-id>`,describe:`Rolls a zone environment back to its previous version.`,builder:M,handler:async e=>{if(e.dryRun){c({command:`cf zones environments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/rollback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>t.zones.environments.rollback({zone_id:r,environment_id:e[`environment-id`]})),{successLabel:`Created`})}};function P(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 F={command:`update`,describe:`Replaces the full environment configuration for a zone.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf zones environments update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.environments.update({body:n,zone_id:r})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},I={command:`environments`,describe:`Operations for environments`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:L,handler:async e=>{if(e.dryRun){c({command:`cf zones fonts edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/fonts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let r=await i(e),d=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.zones.fonts.edit({...t,zone_id:d})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await t(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>r.zones.fonts.edit({...f,zone_id:d})),{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:`get`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:z,handler:async e=>{if(e.dryRun){c({command:`cf zones fonts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/fonts`,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,s(await l(`Loading`,async()=>t.zones.fonts.get({zone_id:r})),{successLabel:`Loaded`})}},V={command:`fonts`,describe:`Fonts operations`,builder:e=>e.command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:`Zone Details`,builder:H,handler:async e=>{if(e.dryRun){c({command:`cf zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}`,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,s(await l(`Loading`,async()=>t.zones.get({zone_id:r})),{successLabel:`Loaded`})}};function W(e){return e.option(`include-subdomains`,{type:`boolean`,description:`If provided, the zone hold will extend to block any subdomain of the given zone, as well
|
|
15
|
+
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
16
|
+
'example.com' and include_subdomains=true will block 'example.com',
|
|
17
|
+
'staging.example.com', 'api.staging.example.com', etc.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`create`,describe:`Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. Zone holds cannot be enabled on CDN-only zones.`,builder:W,handler:async e=>{let t={include_subdomains:e[`include-subdomains`]};if(e.dryRun){c({command:`cf zones holds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,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,s(await l(`Creating`,async()=>r.zones.holds.create({zone_id:a,...t})),{successLabel:`Created`})}};function K(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. Otherwise, the hold will be\ndisabled indefinitely. `hold_after` cannot be provided for CDN-only zones."}).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 q={command:`delete`,describe:"Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. Existing zone holds can be removed from CDN-only zones when `hold_after` is not provided. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:K,handler:async e=>{let t={hold_after:e[`hold-after`]};if(e.dryRun){c({command:`cf zones holds delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let a=await i(e),o=await n({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
18
|
+
`);return}s(await l(`Deleting`,async()=>a.zones.holds.delete({zone_id:o,...t})),{successLabel:`Deleted`})}};function J(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided and future-dated, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. A past-dated `hold_after` value will have\nno effect on an existing, enabled hold. Providing an empty string will set its value\nto the current time. Providing `null` will disable the hold indefinitely."}).option(`include-subdomains`,{type:`boolean`,description:`If \`true\`, the zone hold will extend to block any subdomain of the given zone, as well
|
|
19
|
+
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
20
|
+
'example.com' and include_subdomains=true will block 'example.com',
|
|
21
|
+
'staging.example.com', 'api.staging.example.com', etc.`}).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:`edit`,describe:"Update the `hold_after` and/or `include_subdomains` values on an existing zone hold. The hold is enabled if the `hold_after` date-time value is in the past. Existing zone holds can be removed from CDN-only zones by setting `hold_after` to `null`. Other zone hold updates cannot be made on CDN-only zones. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:J,handler:async e=>{if(e.dryRun){c({command:`cf zones holds edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({hold_after:u(e[`hold-after`],`hold-after`,`text`),include_subdomains:e[`include-subdomains`]}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.holds.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({hold_after:u(e[`hold-after`],`hold-after`,`text`),include_subdomains:e[`include-subdomains`]});s(await l(`Updating`,async()=>t.zones.holds.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get`,describe:`Retrieve whether the zone is subject to a zone hold, and metadata about the hold.`,builder:X,handler:async e=>{if(e.dryRun){c({command:`cf zones holds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/hold`,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,s(await l(`Loading`,async()=>t.zones.holds.get({zone_id:r})),{successLabel:`Loaded`})}},Q={command:`holds`,describe:`Operations for holds`,builder:e=>e.command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`name`,{type:`string`,description:"A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`status`,{type:`string`,description:`Specify a zone status to filter by.`,choices:[`initializing`,`pending`,`active`,`moved`]}).option(`type`,{type:`string`,description:`Zone types to filter by. Multiple types can be specified as a comma-separated list (e.g., ?type=full,partial,secondary). When this parameter is not provided, zones with type "internal" are excluded from the results.`}).option(`account-id`,{type:`string`,description:`Filter by an account ID.`}).option(`account-name`,{type:`string`,description:"An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`order`,{type:`string`,description:`Field to order zones by.`,choices:[`name`,`status`,`account.id`,`account.name`,`plan.id`]}).option(`direction`,{type:`string`,description:`Direction to order zones.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`list`,describe:`Lists, searches, sorts, and filters your zones. Listing zones across more than 500 accounts is currently not allowed.`,builder:d(ne),handler:async e=>{let t={name:e.name,status:e.status,type:e.type,"account.id":e[`account-id`],"account.name":e[`account-name`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,match:e.match};if(e.dryRun){c({command:`cf zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.zones.list(t)),{successLabel:`Loaded`})}};function ie(e){return e.option(`value`,{type:`number`,description:`Value of the Origin H2 Max Streams Setting.`}).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:`edit`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:ie,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-h2-max-streams edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_h2_max_streams`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:e.value}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.originH2MaxStreams.edit({...n,zone_id:r})),{successLabel:`Updated`});return}if(e.value===void 0)throw Error(`--value is required (or pass --body with this field set).`);let u=o({value:e.value});s(await l(`Updating`,async()=>t.zones.originH2MaxStreams.edit({...u,zone_id:r})),{successLabel:`Updated`})}};function oe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:oe,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-h2-max-streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_h2_max_streams`,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,s(await l(`Loading`,async()=>t.zones.originH2MaxStreams.get({zone_id:r})),{successLabel:`Loaded`})}},ce={command:`origin-h2-max-streams`,describe:`Origin H2 Max Streams operations`,builder:e=>e.command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Max HTTP Version Setting.`,choices:[`2`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`edit`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:le,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-max-http-version edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_max_http_version`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let r=await i(e),d=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.zones.originMaxHttpVersion.edit({...t,zone_id:d})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await t(`value`,`Value of the Origin Max HTTP Version Setting.`,[`2`,`1`]));let f=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>r.zones.originMaxHttpVersion.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function de(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:de,handler:async e=>{if(e.dryRun){c({command:`cf zones origin-max-http-version get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/origin_max_http_version`,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,s(await l(`Loading`,async()=>t.zones.originMaxHttpVersion.get({zone_id:r})),{successLabel:`Loaded`})}},pe={command:`origin-max-http-version`,describe:`Origin Max Http Version operations`,builder:e=>e.command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`plan-identifier`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <plan-identifier>`,describe:`Details of the available plan that the zone can subscribe to.`,builder:me,handler:async e=>{if(e.dryRun){c({command:`cf zones plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/available_plans/${e[`plan-identifier`]==null?`<plan-identifier>`:encodeURIComponent(String(e[`plan-identifier`]))}`,pathParams:{"plan-identifier":String(e[`plan-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,s(await l(`Loading`,async()=>t.zones.plans.get({zone_id:r,plan_identifier:e[`plan-identifier`]})),{successLabel:`Loaded`})}};function ge(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Lists available plans the zone can subscribe to.`,builder:ge,handler:async e=>{if(e.dryRun){c({command:`cf zones plans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/available_plans`,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,s(await l(`Loading`,async()=>t.zones.plans.list({zone_id:r})),{successLabel:`Loaded`})}},ve={command:`plans`,describe:`Operations for plans`,builder:e=>e.command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get`,describe:`Lists all rate plans the zone can subscribe to.`,builder:ye,handler:async e=>{if(e.dryRun){c({command:`cf zones rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/available_rate_plans`,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,s(await l(`Loading`,async()=>t.zones.ratePlans.get({zone_id:r})),{successLabel:`Loaded`})}},xe={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`value`,{type:`string`,description:`Value can either be On or Off.`}).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:`Toggles RUM on/off for an existing zone.`,builder:Se,handler:async e=>{if(e.dryRun){c({command:`cf zones rum edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/rum`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.rum.edit({...n,zone_id:r})),{successLabel:`Updated`});return}let d=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>t.zones.rum.edit({...d,zone_id:r})),{successLabel:`Updated`})}};function we(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get`,describe:`Retrieves RUM status for a zone.`,builder:we,handler:async e=>{if(e.dryRun){c({command:`cf zones rum get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/rum`,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,s(await l(`Loading`,async()=>t.zones.rum.get({zone_id:r})),{successLabel:`Loaded`})}},Ee={command:`rum`,describe:`Rum operations`,builder:e=>e.command(Ce).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`ssl-recommender enrollment setting.`}).option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`value-cache-by-device-type`,{type:`boolean`,description:`Indicates whether or not [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) is enabled.`}).option(`value-cf`,{type:`boolean`,description:`Indicates whether or not Cloudflare proxy is enabled.`}).option(`value-hostnames`,{type:`string`,array:!0,description:`An array of hostnames where Automatic Platform Optimization for WordPress is activated.`}).option(`value-wordpress`,{type:`boolean`,description:`Indicates whether or not site is powered by WordPress.`}).option(`value-wp-plugin`,{type:`boolean`,description:`Indicates whether or not [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is installed.`}).option(`value-strict-transport-security-enabled`,{type:`boolean`,description:`Whether or not strict transport security is enabled.`}).option(`value-strict-transport-security-include-subdomains`,{type:`boolean`,description:`Include all subdomains for strict transport security.`}).option(`value-strict-transport-security-max-age`,{type:`number`,description:`Max age in seconds of the strict transport security.`}).option(`value-strict-transport-security-nosniff`,{type:`boolean`,description:`Whether or not to include 'X-Content-Type-Options: nosniff' header.`}).option(`value-strict-transport-security-preload`,{type:`boolean`,description:`Enable automatic preload of the HSTS configuration.`}).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)`}).conflicts(`value-pool-id`,[`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).conflicts(`value-cache-by-device-type`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cache-by-device-type`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`]).conflicts(`value-cf`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cf`,[`value-strict-transport-security-enabled`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-hostnames`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-hostnames`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-cache-by-device-type`]).conflicts(`value-wordpress`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wordpress`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-wp-plugin`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wp-plugin`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-hostnames`,`value-cache-by-device-type`]).implies(`value-strict-transport-security-enabled`,[`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-strict-transport-security-include-subdomains`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-max-age`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-nosniff`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-preload`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`])}const Oe={command:`edit <setting-id>`,describe:`Updates a single zone setting by the identifier`,builder:De,handler:async e=>{if(e.dryRun){c({command:`cf zones settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/${e[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(e[`setting-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"setting-id":String(e[`setting-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({enabled:e.enabled,value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:e[`value-cache-by-device-type`],cf:e[`value-cf`],hostnames:e[`value-hostnames`],wordpress:e[`value-wordpress`],wp_plugin:e[`value-wp-plugin`],strict_transport_security:{enabled:e[`value-strict-transport-security-enabled`],include_subdomains:e[`value-strict-transport-security-include-subdomains`],max_age:e[`value-strict-transport-security-max-age`],nosniff:e[`value-strict-transport-security-nosniff`],preload:e[`value-strict-transport-security-preload`]}}}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.settings.edit({body:n,zone_id:r,setting_id:e[`setting-id`]})),{successLabel:`Updated`});return}let d=o({enabled:e.enabled,value:{enabled:e[`value-enabled`],pool_id:u(e[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:e[`value-cache-by-device-type`],cf:e[`value-cf`],hostnames:e[`value-hostnames`],wordpress:e[`value-wordpress`],wp_plugin:e[`value-wp-plugin`],strict_transport_security:{enabled:e[`value-strict-transport-security-enabled`],include_subdomains:e[`value-strict-transport-security-include-subdomains`],max_age:e[`value-strict-transport-security-max-age`],nosniff:e[`value-strict-transport-security-nosniff`],preload:e[`value-strict-transport-security-preload`]}}});s(await l(`Updating`,async()=>t.zones.settings.edit({body:d,zone_id:r,setting_id:e[`setting-id`]})),{successLabel:`Updated`})}};function ke(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <setting-id>`,describe:`Fetch a single zone setting by name`,builder:ke,handler:async e=>{if(e.dryRun){c({command:`cf zones settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/${e[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(e[`setting-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"setting-id":String(e[`setting-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.zones.settings.get({zone_id:r,setting_id:e[`setting-id`]})),{successLabel:`Loaded`})}},je={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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 Ne={command:`edit`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:Me,handler:async e=>{if(e.dryRun){c({command:`cf zones speed-brain edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/speed_brain`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:u(e.value,`value`,`text`)}):a(e.body)});return}let r=await i(e),d=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=d,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.zones.speedBrain.edit({...t,zone_id:d})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await t(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=o({value:u(e.value,`value`,`text`)});s(await l(`Updating`,async()=>r.zones.speedBrain.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:Pe,handler:async e=>{if(e.dryRun){c({command:`cf zones speed-brain get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/speed_brain`,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,s(await l(`Loading`,async()=>t.zones.speedBrain.get({zone_id:r})),{successLabel:`Loaded`})}},Fe={command:`speed-brain`,describe:`Speed Brain operations`,builder:e=>e.command(Ne).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 a zone subscription, either plan or add-ons.`,builder:Ie,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}}):a(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=a(e.body);s(await l(`Creating`,async()=>t.zones.subscriptions.create({body:n,zone_id:r})),{successLabel:`Created`});return}let d=o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}});s(await l(`Creating`,async()=>t.zones.subscriptions.create({body:d,zone_id:r})),{successLabel:`Created`})}};function Re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ze={command:`get`,describe:`Lists zone subscription details.`,builder:Re,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/subscription`,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,s(await l(`Loading`,async()=>t.zones.subscriptions.get({zone_id:r})),{successLabel:`Loaded`})}};function Be(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ve={command:`update`,describe:`Updates zone subscriptions, either plan or add-ons.`,builder:Be,handler:async e=>{if(e.dryRun){c({command:`cf zones subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}}):a(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=a(e.body);s(await l(`Updating`,async()=>t.zones.subscriptions.update({body:n,zone_id:r})),{successLabel:`Updated`});return}let d=o({app:{install_id:u(e[`app-install-id`],`app-install-id`,`text`)},frequency:u(e.frequency,`frequency`,`text`),rate_plan:{currency:u(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:u(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:u(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}});s(await l(`Updating`,async()=>t.zones.subscriptions.update({body:d,zone_id:r})),{successLabel:`Updated`})}},He={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Le).command(ze).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ue={command:`zones`,describe:`Zones are domains on Cloudflare — list, create, and configure domain settings`,builder:e=>e.command(y).command(x).command(C).command(U).command(re).command(te).command(_).command(I).command(V).command(Q).command(ce).command(pe).command(ve).command(xe).command(Ee).command(je).command(Fe).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ue as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The Cloudflare CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"type": "module",
|
|
33
33
|
"main": "./dist/index.mjs",
|
|
34
34
|
"imports": {
|
|
35
|
-
"#lib/*": "./src/lib/*"
|
|
35
|
+
"#lib/*": "./src/lib/*",
|
|
36
|
+
"#sdk": "./src/sdk/sdk/index.ts"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"blake3-wasm": "2.1.5"
|
|
@@ -42,11 +43,11 @@
|
|
|
42
43
|
"@clack/core": "1.2.0",
|
|
43
44
|
"@clack/prompts": "^1.2.0",
|
|
44
45
|
"@cloudflare/cli-shared-helpers": "^0.1.0",
|
|
45
|
-
"@cloudflare/deploy-helpers": "^0.
|
|
46
|
+
"@cloudflare/deploy-helpers": "^0.4.0",
|
|
46
47
|
"@cloudflare/forge": "file:../../vendor/cloudflare-forge-0.1.0.tgz",
|
|
47
|
-
"@cloudflare/forge-sdk-ts": "file:../../vendor/cloudflare-forge-sdk-ts-0.1.0.tgz",
|
|
48
|
-
"@cloudflare/workers-auth": "
|
|
49
|
-
"@cloudflare/workers-utils": "^0.
|
|
48
|
+
"@cloudflare/forge-transformer-sdk-ts": "file:../../vendor/cloudflare-forge-transformer-sdk-ts-0.1.0.tgz",
|
|
49
|
+
"@cloudflare/workers-auth": "^0.4.2",
|
|
50
|
+
"@cloudflare/workers-utils": "^0.26.0",
|
|
50
51
|
"@types/node": "25.3.5",
|
|
51
52
|
"@types/yargs": "17.0.35",
|
|
52
53
|
"am-i-vibing": "^0.1.1",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,m as t,p as n,t as r,u as i}from"./auth-BlSmtIKd.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-DZfTxbrx.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.positional(`reportParam`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
3
|
-
`}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
4
|
-
`,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
5
|
-
`}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
6
|
-
`,choices:[`send`,`send-anon`,`none`]}).option(`signature`,{type:`string`,description:`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`}).option(`state`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`justification`,{type:`string`,description:`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters.
|
|
7
|
-
`}).option(`trademark-number`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-office`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-symbol`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`destination-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ports-protocols`,{type:`string`,description:`A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual port/protocol should not exceed 100 characters. The list should not have more than 30 unique ports and protocols.`}).option(`source-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ncmec-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
8
|
-
`,choices:[`send`,`send-anon`]}).option(`reg-who-request-reg-who-authorization-statement`,{type:`string`,description:`Optional authorization statement or power of attorney per RDP 10.2.1.3.`}).option(`reg-who-request-reg-who-good-faith-affirmation`,{type:`boolean`,description:`Affirmation that the request is made in good faith per RDP 10.2.4. Must be true.`}).option(`reg-who-request-reg-who-lawful-processing-agreement`,{type:`boolean`,description:`Agreement to process data lawfully per RDP 10.2.5. Must be true.`}).option(`reg-who-request-reg-who-legal-basis`,{type:`string`,description:`Legal rights and rationale for the request per RDP 10.2.3. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-request-type`,{type:`string`,description:`The type of WHOIS data request per RDP procedure.`,choices:[`disclosure`,`invalid_whois`]}).option(`reg-who-request-reg-who-requested-data-elements`,{type:`string`,array:!0,description:`The specific WHOIS data elements being requested per RDP 10.2.2. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-requestor-type`,{type:`string`,description:`The nature of the requestor per RDP 10.2.1.2.`,choices:[`government`,`corporation`,`individual`]}).option(`ncsei-subject-representation`,{type:`boolean`,description:`If the submitter is the target of NCSEI in the URLs of the abuse report.`}).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)`}).conflicts(`address1`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`address1`,[`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agent-name`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agent-name`,[`address1`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agree`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agree`,[`address1`,`agent-name`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`city`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`city`,[`address1`,`agent-name`,`agree`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`country`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`original-work`]).implies(`country`,[`address1`,`agent-name`,`agree`,`city`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`host-notification`,[`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).conflicts(`original-work`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`country`]).implies(`original-work`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`signature`,`state`]).conflicts(`signature`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`signature`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`state`]).conflicts(`state`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`state`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`]).conflicts(`justification`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`trademark-number`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-number`,[`host-notification`,`justification`,`trademark-office`,`trademark-symbol`]).conflicts(`trademark-office`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-office`,[`host-notification`,`justification`,`trademark-number`,`trademark-symbol`]).conflicts(`trademark-symbol`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-symbol`,[`host-notification`,`justification`,`trademark-number`,`trademark-office`]).conflicts(`destination-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ports-protocols`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`source-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ncmec-notification`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`ncmec-notification`,[`host-notification`,`justification`]).conflicts(`reg-who-request-reg-who-authorization-statement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-good-faith-affirmation`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-lawful-processing-agreement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-legal-basis`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-request-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requested-data-elements`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requestor-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`ncsei-subject-representation`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).implies(`ncsei-subject-representation`,[`host-notification`]).check(e=>{if([`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`].some(t=>e[t]!==void 0)){let t=[`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0})}const p={command:`create <reportParam>`,describe:`Submit the Abuse Report of a particular type`,builder:f,handler:async f=>{if(f.dryRun){c({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${f.reportParam??`<reportParam>`}`,pathParams:{reportParam:String(f.reportParam??``)},bodyKind:`json`,body:{comments:f.comments,company:f.company,email:f.email,email2:f.email2,name:f.name,reportedCountry:f.reportedCountry,reportedUserAgent:f.reportedUserAgent,tele:f.tele,title:f.title,urls:f.urls,address1:f.address1,agentName:f.agentName,agree:f.agree,city:f.city,country:f.country,hostNotification:f.hostNotification,originalWork:f.originalWork,ownerNotification:f.ownerNotification,signature:f.signature,state:f.state,justification:f.justification,trademarkNumber:f.trademarkNumber,trademarkOffice:f.trademarkOffice,trademarkSymbol:f.trademarkSymbol,destinationIps:f.destinationIps,portsProtocols:f.portsProtocols,sourceIps:f.sourceIps,ncmecNotification:f.ncmecNotification,regWhoRequestRegWhoAuthorizationStatement:f.regWhoRequestRegWhoAuthorizationStatement,regWhoRequestRegWhoGoodFaithAffirmation:f.regWhoRequestRegWhoGoodFaithAffirmation,regWhoRequestRegWhoLawfulProcessingAgreement:f.regWhoRequestRegWhoLawfulProcessingAgreement,regWhoRequestRegWhoLegalBasis:f.regWhoRequestRegWhoLegalBasis,regWhoRequestRegWhoRequestType:f.regWhoRequestRegWhoRequestType,regWhoRequestRegWhoRequestedDataElements:f.regWhoRequestRegWhoRequestedDataElements,regWhoRequestRegWhoRequestorType:f.regWhoRequestRegWhoRequestorType,ncseiSubjectRepresentation:f.ncseiSubjectRepresentation,body:f.body}});return}let p=await r(f),m=f.local?d:await e(p);if(f.accountId=m,f.body){let e=o(f.body);s(await l(`Creating`,async()=>p.post(`/accounts/${m}/abuse-reports/${f.reportParam}`,{body:e})),{successLabel:`Created`});return}f.email===void 0&&(f.email=await t(`email`,`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.email2===void 0&&(f.email2=await t(`email2`,"Should match the value provided in `email`")),f.name===void 0&&(f.name=await t(`name`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.urls===void 0&&(f.urls=await t(`urls`,`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),f.ownerNotification===void 0&&(f.ownerNotification=await n(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`]));let h={};f.comments!==void 0&&a(h,[`comments`],u(f.comments,`comments`,`text`)),f.company!==void 0&&a(h,[`company`],u(f.company,`company`,`text`)),f.email!==void 0&&a(h,[`email`],u(f.email,`email`,`text`)),f.email2!==void 0&&a(h,[`email2`],u(f.email2,`email2`,`text`)),f.name!==void 0&&a(h,[`name`],u(f.name,`name`,`text`)),f.reportedCountry!==void 0&&a(h,[`reported_country`],u(f.reportedCountry,`reportedCountry`,`text`)),f.reportedUserAgent!==void 0&&a(h,[`reported_user_agent`],u(f.reportedUserAgent,`reportedUserAgent`,`text`)),f.tele!==void 0&&a(h,[`tele`],u(f.tele,`tele`,`text`)),f.title!==void 0&&a(h,[`title`],u(f.title,`title`,`text`)),f.urls!==void 0&&a(h,[`urls`],u(f.urls,`urls`,`text`)),f.address1!==void 0&&a(h,[`address1`],u(f.address1,`address1`,`text`)),f.agentName!==void 0&&a(h,[`agent_name`],u(f.agentName,`agentName`,`text`)),f.agree!==void 0&&a(h,[`agree`],f.agree),f.city!==void 0&&a(h,[`city`],u(f.city,`city`,`text`)),f.country!==void 0&&a(h,[`country`],u(f.country,`country`,`text`)),f.hostNotification!==void 0&&a(h,[`host_notification`],u(f.hostNotification,`hostNotification`,`text`)),f.originalWork!==void 0&&a(h,[`original_work`],u(f.originalWork,`originalWork`,`text`)),f.ownerNotification!==void 0&&a(h,[`owner_notification`],u(f.ownerNotification,`ownerNotification`,`text`)),f.signature!==void 0&&a(h,[`signature`],u(f.signature,`signature`,`text`)),f.state!==void 0&&a(h,[`state`],u(f.state,`state`,`text`)),f.justification!==void 0&&a(h,[`justification`],u(f.justification,`justification`,`text`)),f.trademarkNumber!==void 0&&a(h,[`trademark_number`],u(f.trademarkNumber,`trademarkNumber`,`text`)),f.trademarkOffice!==void 0&&a(h,[`trademark_office`],u(f.trademarkOffice,`trademarkOffice`,`text`)),f.trademarkSymbol!==void 0&&a(h,[`trademark_symbol`],u(f.trademarkSymbol,`trademarkSymbol`,`text`)),f.destinationIps!==void 0&&a(h,[`destination_ips`],u(f.destinationIps,`destinationIps`,`text`)),f.portsProtocols!==void 0&&a(h,[`ports_protocols`],u(f.portsProtocols,`portsProtocols`,`text`)),f.sourceIps!==void 0&&a(h,[`source_ips`],u(f.sourceIps,`sourceIps`,`text`)),f.ncmecNotification!==void 0&&a(h,[`ncmec_notification`],u(f.ncmecNotification,`ncmecNotification`,`text`)),f.regWhoRequestRegWhoAuthorizationStatement!==void 0&&a(h,[`reg_who_request`,`reg_who_authorization_statement`],u(f.regWhoRequestRegWhoAuthorizationStatement,`regWhoRequestRegWhoAuthorizationStatement`,`text`)),f.regWhoRequestRegWhoGoodFaithAffirmation!==void 0&&a(h,[`reg_who_request`,`reg_who_good_faith_affirmation`],f.regWhoRequestRegWhoGoodFaithAffirmation),f.regWhoRequestRegWhoLawfulProcessingAgreement!==void 0&&a(h,[`reg_who_request`,`reg_who_lawful_processing_agreement`],f.regWhoRequestRegWhoLawfulProcessingAgreement),f.regWhoRequestRegWhoLegalBasis!==void 0&&a(h,[`reg_who_request`,`reg_who_legal_basis`],u(f.regWhoRequestRegWhoLegalBasis,`regWhoRequestRegWhoLegalBasis`,`text`)),f.regWhoRequestRegWhoRequestType!==void 0&&a(h,[`reg_who_request`,`reg_who_request_type`],u(f.regWhoRequestRegWhoRequestType,`regWhoRequestRegWhoRequestType`,`text`)),f.regWhoRequestRegWhoRequestedDataElements!==void 0&&a(h,[`reg_who_request`,`reg_who_requested_data_elements`],f.regWhoRequestRegWhoRequestedDataElements),f.regWhoRequestRegWhoRequestorType!==void 0&&a(h,[`reg_who_request`,`reg_who_requestor_type`],u(f.regWhoRequestRegWhoRequestorType,`regWhoRequestRegWhoRequestorType`,`text`)),f.ncseiSubjectRepresentation!==void 0&&a(h,[`ncsei_subject_representation`],f.ncseiSubjectRepresentation),s(await l(`Creating`,async()=>p.post(`/accounts/${m}/abuse-reports/${f.reportParam}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function m(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1)`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent to hosts or submitters.`,builder:m,handler:async t=>{let n={page:t.page,per_page:t.perPage};if(t.dryRun){c({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${t.reportId??`<reportId>`}/emails`,pathParams:{reportId:String(t.reportId??``)},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.emails.list(o,t.reportId,n)),{successLabel:`Loaded`})}},g={command:`emails`,describe:`Emails operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`reportParam`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <reportParam>`,describe:`Retrieve the details of an abuse report.`,builder:_,handler:async t=>{if(t.dryRun){c({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${t.reportParam??`<reportParam>`}`,pathParams:{reportParam:String(t.reportParam??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.abuseReports.get(a,t.reportParam)),{successLabel:`Loaded`})}};function y(e){return e.option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order (id, cdate, domain, type, status)`}).option(`domain`,{type:`string`,description:`Filter by domain name related to the abuse report`}).option(`created-before`,{type:`string`,description:`Returns reports created before the specified date`}).option(`created-after`,{type:`string`,description:`Returns reports created after the specified date`}).option(`status`,{type:`string`,description:`Filter by the status of the report.`,choices:[`accepted`,`in_review`]}).option(`type`,{type:`string`,description:`Filter by the type of the report.`,choices:[`PHISH`,`GEN`,`THREAT`,`DMCA`,`EMER`,`TM`,`REG_WHO`,`NCSEI`,`NETWORK`]}).option(`mitigation-status`,{type:`string`,description:`Filter reports that have any mitigations in the given status.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List the abuse reports for a given account`,builder:y,handler:async t=>{let n={page:t.page,per_page:t.perPage,sort:t.sort,domain:t.domain,created_before:t.createdBefore,created_after:t.createdAfter,status:t.status,type:t.type,mitigation_status:t.mitigationStatus};if(t.dryRun){c({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.list(o,n)),{successLabel:`Loaded`})}};function x(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set, e.g. ?type=rate_limit_cache&type=legal_block.`,choices:[`legal_block`,`misleading_interstitial`,`phishing_interstitial`,`network_block`,`rate_limit_cache`,`account_suspend`,`redirect_video_stream`]}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:x,handler:async t=>{let n={page:t.page,per_page:t.perPage,sort:t.sort,type:t.type,effective_before:t.effectiveBefore,effective_after:t.effectiveAfter,status:t.status,entity_type:t.entityType};if(t.dryRun){c({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${t.reportId??`<reportId>`}/mitigations`,pathParams:{reportId:String(t.reportId??``)},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.abuseReports.mitigations.list(o,t.reportId,n)),{successLabel:`Loaded`})}};function C(e){return e.positional(`reportId`,{type:`string`,description:`Abuse Report ID`,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 w={command:`review <reportId>`,describe:`Request a review for mitigations on an account.`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/abuse-reports/${t.reportId??`<reportId>`}/mitigations/appeal`,pathParams:{reportId:String(t.reportId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await r(t),a=t.local?d:await e(n);if(t.accountId=a,t.body){let e=o(t.body);s(await l(`Creating`,async()=>n.post(`/accounts/${a}/abuse-reports/${t.reportId}/mitigations/appeal`,{body:e})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>n.abuseReports.mitigations.review(a,t.reportId)),{successLabel:`Created`})}},T={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(p).command(v).command(b).command(g).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,m as n,t as r,u as i}from"./auth-BlSmtIKd.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-DZfTxbrx.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";import{t as d}from"./local-VJaJ3BZ1.mjs";function f(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const p={command:`create`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f,handler:async t=>{if(t.dryRun){c({command:`cf accounts account-organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:{destinationOrganizationId:t.destinationOrganizationId,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/move`,{body:e})),{successLabel:`Created`});return}t.destinationOrganizationId===void 0&&(t.destinationOrganizationId=await n(`destination-organization-id`,``));let m={};t.destinationOrganizationId!==void 0&&a(m,[`destination_organization_id`],u(t.destinationOrganizationId,`destinationOrganizationId`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/move`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}},m={command:`account-organizations`,describe:`Move accounts between organizations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:ee,handler:async t=>{if(t.dryRun){c({command:`cf accounts account-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.accountProfile.get(a)),{successLabel:`Loaded`})}};function h(e){return e.option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 g={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf accounts account-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:{businessAddress:t.businessAddress,businessEmail:t.businessEmail,businessName:t.businessName,businessPhone:t.businessPhone,externalMetadata:t.externalMetadata,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Updating`,async()=>f.put(`/accounts/${p}/profile`,{body:e})),{successLabel:`Updated`});return}t.businessAddress===void 0&&(t.businessAddress=await n(`business-address`,``)),t.businessEmail===void 0&&(t.businessEmail=await n(`business-email`,``)),t.businessName===void 0&&(t.businessName=await n(`business-name`,``)),t.businessPhone===void 0&&(t.businessPhone=await n(`business-phone`,``)),t.externalMetadata===void 0&&(t.externalMetadata=await n(`external-metadata`,``));let m={};t.businessAddress!==void 0&&a(m,[`business_address`],u(t.businessAddress,`businessAddress`,`text`)),t.businessEmail!==void 0&&a(m,[`business_email`],u(t.businessEmail,`businessEmail`,`text`)),t.businessName!==void 0&&a(m,[`business_name`],u(t.businessName,`businessName`,`text`)),t.businessPhone!==void 0&&a(m,[`business_phone`],u(t.businessPhone,`businessPhone`,`text`)),t.externalMetadata!==void 0&&a(m,[`external_metadata`],u(t.externalMetadata,`externalMetadata`,`text`)),s(await l(`Updating`,async()=>f.put(`/accounts/${p}/profile`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},_={command:`account-profile`,describe:`View and manage the profile for a Cloudflare account`,builder:e=>e.command(te).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
|
|
3
|
-
- name: Filter by application name (e.g., name:HR)
|
|
4
|
-
- id: Filter by application ID (e.g., id:0b63249c-95bf-4cc0-a7cc-d7faaaf1dac0)
|
|
5
|
-
- human_id: Filter by human-readable ID (e.g., human_id:HR)
|
|
6
|
-
- hostname: Filter by hostname or support domain (e.g., hostname:portal.example.com)
|
|
7
|
-
- source: Filter by application source name (e.g., source:cloudflare)
|
|
8
|
-
- ip_subnet: Filter by IP subnet using CIDR containment — returns applications where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32 matches apps with 10.0.0.0/16)
|
|
9
|
-
- intel_id: Filter by Intel API ID (e.g., intel_id:498).
|
|
10
|
-
.`}).option(`limit`,{type:`number`,description:`Limit of number of results to return (max 250).`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`order-by`,{type:`string`,description:`Order by result by field name and order (e.g., name:asc).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`applications`,describe:`List applications with different filters.`,builder:v,handler:async t=>{let n={filter:t.filter,limit:t.limit,offset:t.offset,order_by:t.orderBy};if(t.dryRun){c({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/applications`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.applications.get.applications(o,n)),{successLabel:`Loaded`})}};function b(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`id <id>`,describe:`Get application by ID.`,builder:b,handler:async t=>{if(t.dryRun){c({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/applications/${t.id??`<id>`}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.applications.get.by.id(a,t.id)),{successLabel:`Loaded`})}},S={command:`by`,describe:`Applications operations`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`get`,describe:`Applications operations`,builder:e=>e.command(y).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`applications`,describe:`Operations for applications`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`id <id>`,describe:`Get application category by ID.`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/categories/${t.id??`<id>`}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.categories.get.by.id(a,t.id)),{successLabel:`Loaded`})}},D={command:`by`,describe:`Categories operations`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`categories`,describe:`List application categories.`,builder:O,handler:async t=>{let n={limit:t.limit,offset:t.offset};if(t.dryRun){c({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/resource-library/categories`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.categories.get.categories(o,n)),{successLabel:`Loaded`})}},A={command:`get`,describe:`Categories operations`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`categories`,describe:`Operations for categories`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`name`,{type:`string`,description:`Account name`}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const N={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:M,handler:async e=>{if(e.dryRun){c({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:{name:e.name,unitId:e.unitId,body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/accounts`,{body:n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await n(`name`,`Account name`));let i={};e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),e.unitId!==void 0&&a(i,[`unit`,`id`],u(e.unitId,`unitId`,`text`)),s(await l(`Creating`,async()=>t.post(`/accounts`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:P,handler:async n=>{if(n.dryRun){c({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let a=await r(n),o=n.local?d:await e(a);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
11
|
-
`);return}s(await l(`Deleting`,async()=>a.accounts.delete(o)),{successLabel:`Deleted`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:I,handler:async t=>{if(t.dryRun){c({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.get(a)),{successLabel:`Loaded`})}};function R(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).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:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:R,handler:async e=>{let t={name:e.name,page:e.page,per_page:e.perPage,direction:e.direction};if(e.dryRun){c({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await r(e);s(await l(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function B(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the 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:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:B,handler:async t=>{let n={account_name:t.accountName,action_result:t.actionResult,action_type:t.actionType,actor_context:t.actorContext,actor_email:t.actorEmail,actor_id:t.actorId,actor_ip_address:t.actorIpAddress,actor_token_id:t.actorTokenId,actor_token_name:t.actorTokenName,actor_type:t.actorType,audit_log_id:t.auditLogId,id:t.id,raw_cf_ray_id:t.rawCfRayId,raw_method:t.rawMethod,raw_status_code:t.rawStatusCode,raw_uri:t.rawUri,resource_id:t.resourceId,resource_product:t.resourceProduct,resource_type:t.resourceType,resource_scope:t.resourceScope,zone_id:t.zoneId,zone_name:t.zoneName,"account_name.not":t.accountNameNot,"action_result.not":t.actionResultNot,"action_type.not":t.actionTypeNot,"actor_context.not":t.actorContextNot,"actor_email.not":t.actorEmailNot,"actor_id.not":t.actorIdNot,"actor_ip_address.not":t.actorIpAddressNot,"actor_token_id.not":t.actorTokenIdNot,"actor_token_name.not":t.actorTokenNameNot,"actor_type.not":t.actorTypeNot,"audit_log_id.not":t.auditLogIdNot,"id.not":t.idNot,"raw_cf_ray_id.not":t.rawCfRayIdNot,"raw_method.not":t.rawMethodNot,"raw_status_code.not":t.rawStatusCodeNot,"raw_uri.not":t.rawUriNot,"resource_id.not":t.resourceIdNot,"resource_product.not":t.resourceProductNot,"resource_type.not":t.resourceTypeNot,"resource_scope.not":t.resourceScopeNot,"zone_id.not":t.zoneIdNot,"zone_name.not":t.zoneNameNot,since:t.since,before:t.before,direction:t.direction,limit:t.limit,cursor:t.cursor};if(t.dryRun){c({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/logs/audit`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.logs.audit.list(o,n)),{successLabel:`Loaded`})}},H={command:`audit`,describe:`Retrieve audit log entries that record actions taken on the account`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
|
|
12
|
-
Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
|
|
13
|
-
`,choices:[`accepted`,`pending`]}).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 G={command:`create`,describe:`Add a user to the list of members for this account.`,builder:W,handler:async t=>{if(t.dryRun){c({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:{email:t.email,roles:t.roles,status:t.status,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/members`,{body:e})),{successLabel:`Created`});return}t.email===void 0&&(t.email=await n(`email`,`The contact email address of the user.`));let m={};t.email!==void 0&&a(m,[`email`],u(t.email,`email`,`text`)),t.roles!==void 0&&a(m,[`roles`],t.roles),t.status!==void 0&&a(m,[`status`],u(t.status,`status`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/members`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function K(e){return e.positional(`memberId`,{type:`string`,description:`Membership identifier tag.`,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 q={command:`delete <memberId>`,describe:`Remove a member from an account.`,builder:K,handler:async n=>{if(n.dryRun){c({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members/${n.memberId??`<memberId>`}`,pathParams:{memberId:String(n.memberId??``)},bodyKind:`json`,body:{body:n.body}});return}let a=await r(n),u=n.local?d:await e(a);if(n.accountId=u,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
14
|
-
`);return}if(n.body){let e=o(n.body);s(await l(`Deleting`,async()=>a.delete(`/accounts/${u}/members/${n.memberId}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>a.accounts.members.delete(n.memberId,u)),{successLabel:`Deleted`})}};function J(e){return e.positional(`memberId`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <memberId>`,describe:`Get information about a specific member of an account.`,builder:J,handler:async t=>{if(t.dryRun){c({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members/${t.memberId??`<memberId>`}`,pathParams:{memberId:String(t.memberId??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.members.get(t.memberId,a)),{successLabel:`Loaded`})}};function X(e){return e.option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`user.first_name`,`user.last_name`,`user.email`,`status`]}).option(`status`,{type:`string`,description:`A member's status in the account.`,choices:[`accepted`,`pending`,`rejected`]}).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:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`List all members of an account.`,builder:X,handler:async t=>{let n={order:t.order,status:t.status,page:t.page,per_page:t.perPage,direction:t.direction};if(t.dryRun){c({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.members.list(o,n)),{successLabel:`Loaded`})}};function Q(e){return e.positional(`memberId`,{type:`string`,description:`Membership identifier tag.`,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 ne={command:`update <memberId>`,describe:`Modify an account member.`,builder:Q,handler:async t=>{if(t.dryRun){c({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/members/${t.memberId??`<memberId>`}`,pathParams:{memberId:String(t.memberId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await r(t),a=t.local?d:await e(n);if(t.accountId=a,t.body){let e=o(t.body);s(await l(`Updating`,async()=>n.put(`/accounts/${a}/members/${t.memberId}`,{body:e})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>n.accounts.members.update(t.memberId,a)),{successLabel:`Updated`})}},re={command:`members`,describe:`Invite, inspect, update, and remove users who have access to this account`,builder:e=>e.command(G).command(q).command(Y).command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).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:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:ie,handler:async e=>{if(e.dryRun){c({command:`cf accounts move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:{accountIds:e.accountIds,destinationOrganizationId:e.destinationOrganizationId,body:e.body}});return}let t=await r(e);if(e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/accounts/move`,{body:n})),{successLabel:`Created`});return}if(e.accountIds===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e.destinationOrganizationId===void 0&&(e.destinationOrganizationId=await n(`destination-organization-id`,`Move accounts to this organization ID.`));let i={};e.accountIds!==void 0&&a(i,[`account_ids`],e.accountIds),e.destinationOrganizationId!==void 0&&a(i,[`destination_organization_id`],u(e.destinationOrganizationId,`destinationOrganizationId`,`text`)),s(await l(`Creating`,async()=>t.post(`/accounts/move`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function oe(e){return e.positional(`roleId`,{type:`string`,description:`Role identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <roleId>`,describe:`Get information about a specific role for an account.`,builder:oe,handler:async t=>{if(t.dryRun){c({command:`cf accounts roles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/roles/${t.roleId??`<roleId>`}`,pathParams:{roleId:String(t.roleId??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.roles.get(t.roleId,a)),{successLabel:`Loaded`})}};function ce(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of roles per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`Get all available roles for an account.`,builder:ce,handler:async t=>{let n={page:t.page,per_page:t.perPage};if(t.dryRun){c({command:`cf accounts roles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/roles`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.roles.list(o,n)),{successLabel:`Loaded`})}},ue={command:`roles`,describe:`View the roles available for assigning to account members, each defining a set of permissions`,builder:e=>e.command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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:`Creates an account subscription.`,builder:de,handler:async t=>{if(t.dryRun){c({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`json`,body:{appInstallId:t.appInstallId,frequency:t.frequency,ratePlanCurrency:t.ratePlanCurrency,ratePlanExternallyManaged:t.ratePlanExternallyManaged,ratePlanId:t.ratePlanId,ratePlanIsContract:t.ratePlanIsContract,ratePlanPublicName:t.ratePlanPublicName,ratePlanScope:t.ratePlanScope,ratePlanSets:t.ratePlanSets,body:t.body}});return}let n=await r(t),f=t.local?d:await e(n);if(t.accountId=f,t.body){let e=o(t.body);s(await l(`Creating`,async()=>n.post(`/accounts/${f}/subscriptions`,{body:e})),{successLabel:`Created`});return}let p={};t.appInstallId!==void 0&&a(p,[`app`,`install_id`],u(t.appInstallId,`appInstallId`,`text`)),t.frequency!==void 0&&a(p,[`frequency`],u(t.frequency,`frequency`,`text`)),t.ratePlanCurrency!==void 0&&a(p,[`rate_plan`,`currency`],u(t.ratePlanCurrency,`ratePlanCurrency`,`text`)),t.ratePlanExternallyManaged!==void 0&&a(p,[`rate_plan`,`externally_managed`],t.ratePlanExternallyManaged),t.ratePlanId!==void 0&&a(p,[`rate_plan`,`id`],u(t.ratePlanId,`ratePlanId`,`text`)),t.ratePlanIsContract!==void 0&&a(p,[`rate_plan`,`is_contract`],t.ratePlanIsContract),t.ratePlanPublicName!==void 0&&a(p,[`rate_plan`,`public_name`],u(t.ratePlanPublicName,`ratePlanPublicName`,`text`)),t.ratePlanScope!==void 0&&a(p,[`rate_plan`,`scope`],u(t.ratePlanScope,`ratePlanScope`,`text`)),t.ratePlanSets!==void 0&&a(p,[`rate_plan`,`sets`],t.ratePlanSets),s(await l(`Creating`,async()=>n.post(`/accounts/${f}/subscriptions`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function pe(e){return e.positional(`subscriptionIdentifier`,{type:`string`,description:`Subscription identifier tag.`,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 <subscriptionIdentifier>`,describe:`Deletes an account's subscription.`,builder:pe,handler:async n=>{if(n.dryRun){c({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions/${n.subscriptionIdentifier??`<subscriptionIdentifier>`}`,pathParams:{subscriptionIdentifier:String(n.subscriptionIdentifier??``)},bodyKind:`json`,body:{body:n.body}});return}let a=await r(n),u=n.local?d:await e(a);if(n.accountId=u,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
15
|
-
`);return}if(n.body){let e=o(n.body);s(await l(`Deleting`,async()=>a.delete(`/accounts/${u}/subscriptions/${n.subscriptionIdentifier}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>a.accounts.subscriptions.delete(n.subscriptionIdentifier,u)),{successLabel:`Deleted`})}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`get`,describe:`Lists all of an account's subscriptions.`,builder:he,handler:async t=>{if(t.dryRun){c({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions`,pathParams:{},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.subscriptions.get(a)),{successLabel:`Loaded`})}};function _e(e){return e.positional(`subscriptionIdentifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update <subscriptionIdentifier>`,describe:`Updates an account subscription.`,builder:_e,handler:async t=>{if(t.dryRun){c({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/subscriptions/${t.subscriptionIdentifier??`<subscriptionIdentifier>`}`,pathParams:{subscriptionIdentifier:String(t.subscriptionIdentifier??``)},bodyKind:`json`,body:{appInstallId:t.appInstallId,frequency:t.frequency,ratePlanCurrency:t.ratePlanCurrency,ratePlanExternallyManaged:t.ratePlanExternallyManaged,ratePlanId:t.ratePlanId,ratePlanIsContract:t.ratePlanIsContract,ratePlanPublicName:t.ratePlanPublicName,ratePlanScope:t.ratePlanScope,ratePlanSets:t.ratePlanSets,body:t.body}});return}let n=await r(t),f=t.local?d:await e(n);if(t.accountId=f,t.body){let e=o(t.body);s(await l(`Updating`,async()=>n.put(`/accounts/${f}/subscriptions/${t.subscriptionIdentifier}`,{body:e})),{successLabel:`Updated`});return}let p={};t.appInstallId!==void 0&&a(p,[`app`,`install_id`],u(t.appInstallId,`appInstallId`,`text`)),t.frequency!==void 0&&a(p,[`frequency`],u(t.frequency,`frequency`,`text`)),t.ratePlanCurrency!==void 0&&a(p,[`rate_plan`,`currency`],u(t.ratePlanCurrency,`ratePlanCurrency`,`text`)),t.ratePlanExternallyManaged!==void 0&&a(p,[`rate_plan`,`externally_managed`],t.ratePlanExternallyManaged),t.ratePlanId!==void 0&&a(p,[`rate_plan`,`id`],u(t.ratePlanId,`ratePlanId`,`text`)),t.ratePlanIsContract!==void 0&&a(p,[`rate_plan`,`is_contract`],t.ratePlanIsContract),t.ratePlanPublicName!==void 0&&a(p,[`rate_plan`,`public_name`],u(t.ratePlanPublicName,`ratePlanPublicName`,`text`)),t.ratePlanScope!==void 0&&a(p,[`rate_plan`,`scope`],u(t.ratePlanScope,`ratePlanScope`,`text`)),t.ratePlanSets!==void 0&&a(p,[`rate_plan`,`sets`],t.ratePlanSets),s(await l(`Updating`,async()=>n.put(`/accounts/${f}/subscriptions/${t.subscriptionIdentifier}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},ye={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(fe).command(me).command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xe={command:`create`,describe:`Create a new Account Owned API token.`,builder:be,handler:async t=>{if(t.dryRun){c({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:{conditionRequestIpIn:t.conditionRequestIpIn,conditionRequestIpNotIn:t.conditionRequestIpNotIn,expiresOn:t.expiresOn,name:t.name,notBefore:t.notBefore,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Creating`,async()=>f.post(`/accounts/${p}/tokens`,{body:e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await n(`name`,`Token name.`));let m={};t.conditionRequestIpIn!==void 0&&a(m,[`condition`,`request_ip`,`in`],t.conditionRequestIpIn),t.conditionRequestIpNotIn!==void 0&&a(m,[`condition`,`request_ip`,`not_in`],t.conditionRequestIpNotIn),t.expiresOn!==void 0&&a(m,[`expires_on`],u(t.expiresOn,`expiresOn`,`text`)),t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),t.notBefore!==void 0&&a(m,[`not_before`],u(t.notBefore,`notBefore`,`text`)),s(await l(`Creating`,async()=>f.post(`/accounts/${p}/tokens`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function Se(e){return e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,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 Ce={command:`delete <tokenId>`,describe:`Destroy an Account Owned API token.`,builder:Se,handler:async n=>{if(n.dryRun){c({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${n.tokenId??`<tokenId>`}`,pathParams:{tokenId:String(n.tokenId??``)},bodyKind:`json`,body:{body:n.body}});return}let a=await r(n),u=n.local?d:await e(a);if(n.accountId=u,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
16
|
-
`);return}if(n.body){let e=o(n.body);s(await l(`Deleting`,async()=>a.delete(`/accounts/${u}/tokens/${n.tokenId}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>a.accounts.tokens.delete(u,n.tokenId)),{successLabel:`Deleted`})}};function we(e){return e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get <tokenId>`,describe:`Get information about a specific Account Owned API token.`,builder:we,handler:async t=>{if(t.dryRun){c({command:`cf accounts tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${t.tokenId??`<tokenId>`}`,pathParams:{tokenId:String(t.tokenId??``)},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.tokens.get(a,t.tokenId)),{successLabel:`Loaded`})}};function Ee(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:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`list`,describe:`List all Account Owned API tokens created for this account.`,builder:Ee,handler:async t=>{let n={page:t.page,per_page:t.perPage,direction:t.direction};if(t.dryRun){c({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.tokens.list(o,n)),{successLabel:`Loaded`})}};function Oe(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
|
|
17
|
-
The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
|
|
18
|
-
The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:Oe,handler:async t=>{let n={name:t.name,scope:t.scope};if(t.dryRun){c({command:`cf accounts tokens permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.tokens.permissionGroups.get(o,n)),{successLabel:`Loaded`})}};function Ae(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
|
|
19
|
-
The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
|
|
20
|
-
The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:Ae,handler:async t=>{let n={name:t.name,scope:t.scope};if(t.dryRun){c({command:`cf accounts tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(t),o=t.local?d:await e(a);t.accountId=o,s(await l(`Loading`,async()=>a.accounts.tokens.permissionGroups.list(o,n)),{successLabel:`Loaded`})}},Me={command:`permission-groups`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`status`,{type:`string`,description:`Status of the token.`,choices:[`active`,`disabled`,`expired`]}).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 Pe={command:`update <tokenId>`,describe:`Update an existing token.`,builder:Ne,handler:async t=>{if(t.dryRun){c({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${t.tokenId??`<tokenId>`}`,pathParams:{tokenId:String(t.tokenId??``)},bodyKind:`json`,body:{conditionRequestIpIn:t.conditionRequestIpIn,conditionRequestIpNotIn:t.conditionRequestIpNotIn,expiresOn:t.expiresOn,name:t.name,notBefore:t.notBefore,status:t.status,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Updating`,async()=>f.put(`/accounts/${p}/tokens/${t.tokenId}`,{body:e})),{successLabel:`Updated`});return}t.name===void 0&&(t.name=await n(`name`,`Token name.`));let m={};t.conditionRequestIpIn!==void 0&&a(m,[`condition`,`request_ip`,`in`],t.conditionRequestIpIn),t.conditionRequestIpNotIn!==void 0&&a(m,[`condition`,`request_ip`,`not_in`],t.conditionRequestIpNotIn),t.expiresOn!==void 0&&a(m,[`expires_on`],u(t.expiresOn,`expiresOn`,`text`)),t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),t.notBefore!==void 0&&a(m,[`not_before`],u(t.notBefore,`notBefore`,`text`)),t.status!==void 0&&a(m,[`status`],u(t.status,`status`,`text`)),s(await l(`Updating`,async()=>f.put(`/accounts/${p}/tokens/${t.tokenId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}};function $(e){return e.positional(`tokenId`,{type:`string`,description:`Token identifier tag.`,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 Fe={command:`update <tokenId>`,describe:`Roll the Account Owned API token secret.`,builder:$,handler:async t=>{if(t.dryRun){c({command:`cf accounts tokens value update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/${t.tokenId??`<tokenId>`}/value`,pathParams:{tokenId:String(t.tokenId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await r(t),a=t.local?d:await e(n);if(t.accountId=a,t.body){let e=o(t.body);s(await l(`Updating`,async()=>n.put(`/accounts/${a}/tokens/${t.tokenId}/value`,{body:e})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>n.accounts.tokens.value.update(a,t.tokenId)),{successLabel:`Updated`})}},Ie={command:`value`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`verify`,describe:`Test whether a token works.`,builder:Le,handler:async t=>{if(t.dryRun){c({command:`cf accounts tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/tokens/verify`,pathParams:{},bodyKind:`none`});return}let n=await r(t),a=t.local?d:await e(n);t.accountId=a,s(await l(`Loading`,async()=>n.accounts.tokens.verify(a)),{successLabel:`Loaded`})}},ze={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(xe).command(Ce).command(Te).command(De).command(Pe).command(Re).command(Me).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Be(e){return e.option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
|
|
21
|
-
Two-Factor Authentication is enabled`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ve={command:`update`,describe:`Update an existing account.`,builder:Be,handler:async t=>{if(t.dryRun){c({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:{id:t.id,name:t.name,settingsAbuseContactEmail:t.settingsAbuseContactEmail,settingsEnforceTwofactor:t.settingsEnforceTwofactor,body:t.body}});return}let f=await r(t),p=t.local?d:await e(f);if(t.accountId=p,t.body){let e=o(t.body);s(await l(`Updating`,async()=>f.put(`/accounts/${p}`,{body:e})),{successLabel:`Updated`});return}t.id===void 0&&(t.id=await n(`id`,`Identifier`)),t.name===void 0&&(t.name=await n(`name`,`Account name`));let m={};t.id!==void 0&&a(m,[`id`],u(t.id,`id`,`text`)),t.name!==void 0&&a(m,[`name`],u(t.name,`name`,`text`)),t.settingsAbuseContactEmail!==void 0&&a(m,[`settings`,`abuse_contact_email`],u(t.settingsAbuseContactEmail,`settingsAbuseContactEmail`,`text`)),t.settingsEnforceTwofactor!==void 0&&a(m,[`settings`,`enforce_twofactor`],t.settingsEnforceTwofactor),s(await l(`Updating`,async()=>f.put(`/accounts/${p}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}},He={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(N).command(F).command(L).command(z).command(ae).command(Ve).command(m).command(_).command(w).command(j).command(U).command(re).command(ue).command(ye).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
|
package/dist/acm-DD8zSds2.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{f as e,l as t,m as n,t as r}from"./auth-BlSmtIKd.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-DZfTxbrx.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Add Custom Origin Trust Store for a Zone.`,builder:u,handler:async e=>{if(e.dryRun){s({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/custom_trust_store`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{certificate:e.certificate,body:e.body}});return}let u=await r(e);if(e.zoneId=await t({zone:e.zone},u,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/acm/custom_trust_store`,{body:t})),{successLabel:`Created`});return}e.certificate===void 0&&(e.certificate=await n(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let d={};e.certificate!==void 0&&i(d,[`certificate`],l(e.certificate,`certificate`,`text`)),o(await c(`Creating`,async()=>u.post(`/zones/${e.zoneId}/acm/custom_trust_store`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function f(e){return e.positional(`customOriginTrustStoreId`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <customOriginTrustStoreId>`,describe:`Removes a CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async n=>{if(n.dryRun){s({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zoneId??`<zoneId>`}/acm/custom_trust_store/${n.customOriginTrustStoreId??`<customOriginTrustStoreId>`}`,pathParams:{customOriginTrustStoreId:String(n.customOriginTrustStoreId??``),zoneId:String(n.zoneId??``)},bodyKind:`none`});return}let i=await r(n),a=await t({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=a,!await e({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>i.acm.customTrustStore.delete(n.customOriginTrustStoreId,a)),{successLabel:`Deleted`})}};function m(e){return e.positional(`customOriginTrustStoreId`,{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 <customOriginTrustStoreId>`,describe:`Retrieves details about a specific certificate in the custom origin trust store, including expiration and subject information.`,builder:m,handler:async e=>{if(e.dryRun){s({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/custom_trust_store/${e.customOriginTrustStoreId??`<customOriginTrustStoreId>`}`,pathParams:{customOriginTrustStoreId:String(e.customOriginTrustStoreId??``),zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.acm.customTrustStore.get(e.customOriginTrustStoreId,i)),{successLabel:`Loaded`})}};function g(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:g,handler:async e=>{let n={page:e.page,per_page:e.perPage,limit:e.limit,offset:e.offset};if(e.dryRun){s({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/custom_trust_store`,pathParams:{zoneId:String(e.zoneId??``)},query:n,bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.acm.customTrustStore.list(a,n)),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Upload CA certificates that Cloudflare trusts when connecting to your origin server`,builder:e=>e.command(d).command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in 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 b={command:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:y,handler:async e=>{if(e.dryRun){s({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/total_tls`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{certificateAuthority:e.certificateAuthority,enabled:e.enabled,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/acm/total_tls`,{body:t})),{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u={};e.certificateAuthority!==void 0&&i(u,[`certificate_authority`],l(e.certificateAuthority,`certificateAuthority`,`text`)),e.enabled!==void 0&&i(u,[`enabled`],e.enabled),o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/acm/total_tls`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/total_tls`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`none`});return}let n=await r(e),i=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>n.acm.totalTLS.get(i)),{successLabel:`Loaded`})}};function C(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in 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 w={command:`update`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:C,handler:async e=>{if(e.dryRun){s({command:`cf acm total-tls update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/acm/total_tls`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{certificateAuthority:e.certificateAuthority,enabled:e.enabled,body:e.body}});return}let n=await r(e);if(e.zoneId=await t({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=a(e.body);o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/acm/total_tls`,{body:t})),{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u={};e.certificateAuthority!==void 0&&i(u,[`certificate_authority`],l(e.certificateAuthority,`certificateAuthority`,`text`)),e.enabled!==void 0&&i(u,[`enabled`],e.enabled),o(await c(`Creating`,async()=>n.post(`/zones/${e.zoneId}/acm/total_tls`,{body:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}},T={command:`total-tls`,describe:`Automatically issue certificates for all hostnames and subdomains in your zone`,builder:e=>e.command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`acm`,describe:`Advanced Certificate Manager — Total TLS auto-issuance and custom origin trust store certificates`,builder:e=>e.command(v).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{a as e,f as t,l as n,m as r,t as i,u as a}from"./auth-BlSmtIKd.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-DZfTxbrx.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-DlXYwVA8.mjs";function te(e){return e.positional(`addressMapId`,{type:`string`,description:`Identifier of an Address Map.`,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 h={command:`delete <addressMapId>`,describe:`Remove an account as a member of a particular address map.`,builder:te,handler:async n=>{if(n.dryRun){let e=a();l({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/addressing/address_maps/${n.addressMapId??`<addressMapId>`}/accounts/${e??`<account-id>`}`,pathParams:{addressMapId:String(n.addressMapId??``)},bodyKind:`json`,body:{body:n.body}});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>r.delete(`/accounts/${o}/addressing/address_maps/${n.addressMapId}/accounts/${o}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.addressing.addressMaps.accounts.delete(o,n.addressMapId)),{successLabel:`Deleted`})}};function g(e){return e.positional(`addressMapId`,{type:`string`,description:`Identifier of an Address Map.`,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 _={command:`update <addressMapId>`,describe:`Add an account as a member of a particular address map.`,builder:g,handler:async t=>{if(t.dryRun){let e=a();l({command:`cf addressing address-maps accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/accounts/${e??`<account-id>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.put(`/accounts/${r}/addressing/address_maps/${t.addressMapId}/accounts/${r}`,{body:e})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>n.addressing.addressMaps.accounts.update(r,t.addressMapId)),{successLabel:`Updated`})}},v={command:`accounts`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`,default:!1}).option(`ips`,{type:`string`,array:!0,description:`The 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 b={command:`create`,describe:`Create a new address map under the account.`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf addressing address-maps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`json`,body:{description:t.description,enabled:t.enabled,ips:t.ips,body:t.body}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/addressing/address_maps`,{body:e})),{successLabel:`Created`});return}let f={};t.description!==void 0&&o(f,[`description`],d(t.description,`description`,`text`)),t.enabled!==void 0&&o(f,[`enabled`],t.enabled),t.ips!==void 0&&o(f,[`ips`],t.ips),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/addressing/address_maps`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Created`})}};function x(e){return e.positional(`addressMapId`,{type:`string`,description:`Identifier of an Address Map.`,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 S={command:`delete <addressMapId>`,describe:`Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.`,builder:x,handler:async n=>{if(n.dryRun){l({command:`cf addressing address-maps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${n.addressMapId??`<addressMapId>`}`,pathParams:{addressMapId:String(n.addressMapId??``)},bodyKind:`json`,body:{body:n.body}});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>r.delete(`/accounts/${o}/addressing/address_maps/${n.addressMapId}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.addressing.addressMaps.delete(n.addressMapId,o)),{successLabel:`Deleted`})}};function C(e){return e.positional(`addressMapId`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`default-sni`,{type:`string`,description:`If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account.`}).option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <addressMapId>`,describe:`Modify properties of an address map owned by the account.`,builder:C,handler:async t=>{if(t.dryRun){l({command:`cf addressing address-maps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{defaultSni:t.defaultSni,description:t.description,enabled:t.enabled,body:t.body}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/addressing/address_maps/${t.addressMapId}`,{body:e})),{successLabel:`Updated`});return}let f={};t.defaultSni!==void 0&&o(f,[`default_sni`],d(t.defaultSni,`defaultSni`,`text`)),t.description!==void 0&&o(f,[`description`],d(t.description,`description`,`text`)),t.enabled!==void 0&&o(f,[`enabled`],t.enabled),c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/addressing/address_maps/${t.addressMapId}`,{body:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}};function T(e){return e.positional(`addressMapId`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <addressMapId>`,describe:`Show a particular address map owned by the account.`,builder:T,handler:async t=>{if(t.dryRun){l({command:`cf addressing address-maps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}`,pathParams:{addressMapId:String(t.addressMapId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.addressMaps.get(t.addressMapId,r)),{successLabel:`Loaded`})}};function D(e){return e.positional(`ipAddress`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 O={command:`delete <ipAddress>`,describe:`Remove an IP from a particular address map.`,builder:D,handler:async n=>{if(n.dryRun){l({command:`cf addressing address-maps ips delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${n.addressMapId??`<addressMapId>`}/ips/${n.ipAddress??`<ipAddress>`}`,pathParams:{ipAddress:String(n.ipAddress??``),addressMapId:String(n.addressMapId??``)},bodyKind:`json`,body:{body:n.body}});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>r.delete(`/accounts/${o}/addressing/address_maps/${n.addressMapId}/ips/${n.ipAddress}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.addressing.addressMaps.ips.delete(n.ipAddress,n.addressMapId,o)),{successLabel:`Deleted`})}};function k(e){return e.positional(`ipAddress`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`update <ipAddress>`,describe:`Add an IP from a prefix owned by the account to a particular address map.`,builder:k,handler:async t=>{if(t.dryRun){l({command:`cf addressing address-maps ips update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/ips/${t.ipAddress??`<ipAddress>`}`,pathParams:{ipAddress:String(t.ipAddress??``),addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.put(`/accounts/${r}/addressing/address_maps/${t.addressMapId}/ips/${t.ipAddress}`,{body:e})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>n.addressing.addressMaps.ips.update(t.ipAddress,t.addressMapId,r)),{successLabel:`Updated`})}},j={command:`ips`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List all address maps owned by the account.`,builder:M,handler:async t=>{if(t.dryRun){l({command:`cf addressing address-maps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.addressMaps.list(r)),{successLabel:`Loaded`})}};function P(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 F={command:`delete`,describe:`Remove a zone as a member of a particular address map.`,builder:P,handler:async r=>{if(r.dryRun){l({command:`cf addressing address-maps zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${r.addressMapId??`<addressMapId>`}/zones/${r.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(r.zoneId??``),addressMapId:String(r.addressMapId??``)},bodyKind:`json`,body:{body:r.body}});return}let o=await i(r),d=r.local?p:await e(o);r.accountId=d;let f=await n({zone:r.zone},o,{quiet:r.quiet});if(r.zoneId=f,!await t({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}if(r.body){let e=s(r.body);c(await u(`Deleting`,async()=>o.delete(`/accounts/${d}/addressing/address_maps/${r.addressMapId}/zones/${r.zoneId}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>o.addressing.addressMaps.zones.delete(f,r.addressMapId,d)),{successLabel:`Deleted`})}};function I(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 L={command:`update`,describe:`Add a zone as a member of a particular address map.`,builder:I,handler:async t=>{if(t.dryRun){l({command:`cf addressing address-maps zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/address_maps/${t.addressMapId??`<addressMapId>`}/zones/${t.zoneId??`<zoneId>`}`,pathParams:{zoneId:String(t.zoneId??``),addressMapId:String(t.addressMapId??``)},bodyKind:`json`,body:{body:t.body}});return}let r=await i(t),o=t.local?p:await e(r);t.accountId=o;let d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=s(t.body);c(await u(`Updating`,async()=>r.put(`/accounts/${o}/addressing/address_maps/${t.addressMapId}/zones/${t.zoneId}`,{body:e})),{successLabel:`Updated`});return}c(await u(`Updating`,async()=>r.addressing.addressMaps.zones.update(d,t.addressMapId,o)),{successLabel:`Updated`})}},R={command:`zones`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`address-maps`,describe:`Map Cloudflare IPs to specific zones or accounts for custom Anycast addressing`,builder:e=>e.command(b).command(S).command(w).command(E).command(N).command(v).command(j).command(R).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})}const V={command:`list`,describe:`List all leases owned by the account.`,builder:B,handler:async t=>{if(t.dryRun){l({command:`cf addressing leases list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/leases`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.leases.list(r)),{successLabel:`Loaded`})}},H={command:`leases`,describe:`Leases operations`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};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(`loa-document`,{type:`string`,description:`LOA document to upload.`})}const W={command:`create`,describe:`Submit LOA document (pdf format) under the account.`,builder:U,handler:async t=>{if(t.dryRun){l({command:`cf addressing loa-documents create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/loa_documents`,pathParams:{},bodyKind:`multipart`,body:{body:t.body,file:t.file,loaDocument:t.loaDocument}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.file!==void 0||t.body!==void 0||t.loaDocument!==void 0){let e=new FormData;if(t.file){let n=f(t.file);e.append(`file`,new Blob([n]),t.file.split(`/`).pop())}else t.body!==void 0&&e.append(`file`,t.body);t.loaDocument!==void 0&&e.append(`loa_document`,String(d(t.loaDocument,`loaDocument`,`text`)??``)),c(await u(`Creating`,async()=>n.post(`/accounts/${r}/addressing/loa_documents`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=d(t.body,`body`,`binary`);c(await u(`Creating`,async()=>n.post(`/accounts/${r}/addressing/loa_documents`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function G(e){return e.positional(`loaDocumentId`,{type:`string`,description:`Identifier for the uploaded LOA document.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const K={command:`get <loaDocumentId>`,describe:`Download specified LOA document under the account.`,builder:G,handler:async t=>{if(t.dryRun){l({command:`cf addressing loa-documents get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/loa_documents/${t.loaDocumentId??`<loaDocumentId>`}/download`,pathParams:{loaDocumentId:String(t.loaDocumentId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r;let o=await u(`Loading`,async()=>ee(`/accounts/${r}/addressing/loa_documents/${t.loaDocumentId}/download`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}));m(t.text===!0?o.toString(`utf-8`):o)}},q={command:`loa-documents`,describe:`Letter of Authorization documents required to verify IP prefix ownership`,builder:e=>e.command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`advertised`,{type:`boolean`,description:"Advertisement status of the prefix. If `true`, the BGP route for the prefix is advertised to the Internet. If \n`false`, the BGP route is withdrawn.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`edit <prefixId>`,describe:`Advertise or withdraw the BGP route for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.`,builder:J,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes advertisement-status edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/status`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{advertised:t.advertised,body:t.body}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/addressing/prefixes/${t.prefixId}/bgp/status`,{body:e})),{successLabel:`Updated`});return}if(t.advertised===void 0)throw Error(`--advertised is required (or pass --body with this field set).`);let d={};t.advertised!==void 0&&o(d,[`advertised`],t.advertised),c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/addressing/prefixes/${t.prefixId}/bgp/status`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function X(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <prefixId>`,describe:`View the current advertisement state for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.`,builder:X,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes advertisement-status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/status`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.advertisementStatus.get(t.prefixId,r)),{successLabel:`Loaded`})}},Q={command:`advertisement-status`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`create <prefixId>`,describe:`Create a BGP prefix, controlling the BGP advertisement status of a specific subnet. When created, BGP prefixes are initially withdrawn, and can be advertised with the Update BGP Prefix API.`,builder:ne,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes bgp-prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/prefixes`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{cidr:t.cidr,body:t.body}});return}let n=await i(t),f=t.local?p:await e(n);if(t.accountId=f,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes/${t.prefixId}/bgp/prefixes`,{body:e})),{successLabel:`Created`});return}t.cidr===void 0&&(t.cidr=await r(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let m={};t.cidr!==void 0&&o(m,[`cidr`],d(t.cidr,`cidr`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes/${t.prefixId}/bgp/prefixes`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function ie(e){return e.positional(`bgpPrefixId`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ae={command:`delete <bgpPrefixId>`,describe:`Delete a BGP Prefix associated with the specified IP Prefix. A BGP Prefix must be withdrawn before it can be deleted.`,builder:ie,handler:async n=>{if(n.dryRun){l({command:`cf addressing prefixes bgp-prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${n.prefixId??`<prefixId>`}/bgp/prefixes/${n.bgpPrefixId??`<bgpPrefixId>`}`,pathParams:{prefixId:String(n.prefixId??``),bgpPrefixId:String(n.bgpPrefixId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}c(await u(`Deleting`,async()=>r.addressing.prefixes.bgpPrefixes.delete(o,n.prefixId,n.bgpPrefixId)),{successLabel:`Deleted`})}};function oe(e){return e.positional(`bgpPrefixId`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`asn-prepend-count`,{type:`number`,description:`Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute`,default:0}).option(`auto-advertise-withdraw`,{type:`boolean`,description:`Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no matching BGP prefix in the Magic routing table. When true, Cloudflare will automatically withdraw the BGP prefix when there are no matching BGP routes, and will resume advertising when there is at least one matching BGP route.`,default:!1}).option(`on-demand-advertised`,{type:`boolean`,description:`The on_demand.advertised 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 se={command:`edit <bgpPrefixId>`,describe:`Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn).`,builder:oe,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes bgp-prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/prefixes/${t.bgpPrefixId??`<bgpPrefixId>`}`,pathParams:{prefixId:String(t.prefixId??``),bgpPrefixId:String(t.bgpPrefixId??``)},bodyKind:`json`,body:{asnPrependCount:t.asnPrependCount,autoAdvertiseWithdraw:t.autoAdvertiseWithdraw,onDemandAdvertised:t.onDemandAdvertised,body:t.body}});return}let n=await i(t),r=t.local?p:await e(n);if(t.accountId=r,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/addressing/prefixes/${t.prefixId}/bgp/prefixes/${t.bgpPrefixId}`,{body:e})),{successLabel:`Updated`});return}let d={};t.asnPrependCount!==void 0&&o(d,[`asn_prepend_count`],t.asnPrependCount),t.autoAdvertiseWithdraw!==void 0&&o(d,[`auto_advertise_withdraw`],t.autoAdvertiseWithdraw),t.onDemandAdvertised!==void 0&&o(d,[`on_demand`,`advertised`],t.onDemandAdvertised),c(await u(`Updating`,async()=>n.patch(`/accounts/${r}/addressing/prefixes/${t.prefixId}/bgp/prefixes/${t.bgpPrefixId}`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function ce(e){return e.positional(`bgpPrefixId`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`get <bgpPrefixId>`,describe:`Retrieve a single BGP Prefix according to its identifier`,builder:ce,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes bgp-prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/prefixes/${t.bgpPrefixId??`<bgpPrefixId>`}`,pathParams:{prefixId:String(t.prefixId??``),bgpPrefixId:String(t.bgpPrefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.bgpPrefixes.get(r,t.prefixId,t.bgpPrefixId)),{successLabel:`Loaded`})}};function ue(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to control which specific subnets are advertised to the Internet. It is possible to advertise subnets more specific than an IP Prefix by creating more specific BGP Prefixes.`,builder:ue,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes bgp-prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bgp/prefixes`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.bgpPrefixes.list(r,t.prefixId)),{successLabel:`Loaded`})}},fe={command:`bgp-prefixes`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(re).command(ae).command(se).command(le).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`asn`,{type:`number`,description:`Autonomous System Number (ASN) the prefix will be advertised under.`}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`delegate-loa-creation`,{type:`boolean`,description:`Whether Cloudflare is allowed to generate the LOA document on behalf of the prefix owner.`,default:!1}).option(`description`,{type:`string`,description:`Description of the prefix.`}).option(`loa-document-id`,{type:`string`,description:`Identifier for the uploaded LOA document.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const me={command:`create`,describe:`Add a new prefix under the account.`,builder:pe,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`json`,body:{asn:t.asn,cidr:t.cidr,delegateLoaCreation:t.delegateLoaCreation,description:t.description,loaDocumentId:t.loaDocumentId,body:t.body}});return}let n=await i(t),f=t.local?p:await e(n);if(t.accountId=f,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes`,{body:e})),{successLabel:`Created`});return}if(t.asn===void 0)throw Error(`--asn is required (or pass --body with this field set).`);t.cidr===void 0&&(t.cidr=await r(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let m={};t.asn!==void 0&&o(m,[`asn`],t.asn),t.cidr!==void 0&&o(m,[`cidr`],d(t.cidr,`cidr`,`text`)),t.delegateLoaCreation!==void 0&&o(m,[`delegate_loa_creation`],t.delegateLoaCreation),t.description!==void 0&&o(m,[`description`],d(t.description,`description`,`text`)),t.loaDocumentId!==void 0&&o(m,[`loa_document_id`],d(t.loaDocumentId,`loaDocumentId`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function he(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`delegated-account-id`,{type:`string`,description:`Account identifier for the account to which prefix is being delegated.`}).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:`create <prefixId>`,describe:`Create a new account delegation for a given IP prefix.`,builder:he,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes delegations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/delegations`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{cidr:t.cidr,delegatedAccountId:t.delegatedAccountId,body:t.body}});return}let n=await i(t),f=t.local?p:await e(n);if(t.accountId=f,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes/${t.prefixId}/delegations`,{body:e})),{successLabel:`Created`});return}t.cidr===void 0&&(t.cidr=await r(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),t.delegatedAccountId===void 0&&(t.delegatedAccountId=await r(`delegated-account-id`,`Account identifier for the account to which prefix is being delegated.`));let m={};t.cidr!==void 0&&o(m,[`cidr`],d(t.cidr,`cidr`,`text`)),t.delegatedAccountId!==void 0&&o(m,[`delegated_account_id`],d(t.delegatedAccountId,`delegatedAccountId`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes/${t.prefixId}/delegations`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function _e(e){return e.positional(`delegationId`,{type:`string`,description:`Identifier of a Delegation.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 ve={command:`delete <delegationId>`,describe:`Delete an account delegation for a given IP prefix.`,builder:_e,handler:async n=>{if(n.dryRun){l({command:`cf addressing prefixes delegations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${n.prefixId??`<prefixId>`}/delegations/${n.delegationId??`<delegationId>`}`,pathParams:{delegationId:String(n.delegationId??``),prefixId:String(n.prefixId??``)},bodyKind:`json`,body:{body:n.body}});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>r.delete(`/accounts/${o}/addressing/prefixes/${n.prefixId}/delegations/${n.delegationId}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.addressing.prefixes.delegations.delete(n.delegationId,n.prefixId,o)),{successLabel:`Deleted`})}};function ye(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`list`,describe:`List all delegations for a given account IP prefix.`,builder:ye,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes delegations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/delegations`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.delegations.list(t.prefixId,r)),{successLabel:`Loaded`})}},xe={command:`delegations`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(ge).command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,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 Ce={command:`delete <prefixId>`,describe:`Delete an unapproved prefix owned by the account.`,builder:Se,handler:async n=>{if(n.dryRun){l({command:`cf addressing prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${n.prefixId??`<prefixId>`}`,pathParams:{prefixId:String(n.prefixId??``)},bodyKind:`json`,body:{body:n.body}});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}if(n.body){let e=s(n.body);c(await u(`Deleting`,async()=>r.delete(`/accounts/${o}/addressing/prefixes/${n.prefixId}`,{body:e})),{successLabel:`Deleted`});return}c(await u(`Deleting`,async()=>r.addressing.prefixes.delete(n.prefixId,o)),{successLabel:`Deleted`})}};function we(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the prefix.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Te={command:`edit <prefixId>`,describe:`Modify the description for a prefix owned by the account.`,builder:we,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{description:t.description,body:t.body}});return}let n=await i(t),f=t.local?p:await e(n);if(t.accountId=f,t.body){let e=s(t.body);c(await u(`Updating`,async()=>n.patch(`/accounts/${f}/addressing/prefixes/${t.prefixId}`,{body:e})),{successLabel:`Updated`});return}t.description===void 0&&(t.description=await r(`description`,`Description of the prefix.`));let m={};t.description!==void 0&&o(m,[`description`],d(t.description,`description`,`text`)),c(await u(`Updating`,async()=>n.patch(`/accounts/${f}/addressing/prefixes/${t.prefixId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated`})}};function Ee(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`get <prefixId>`,describe:`List a particular prefix owned by the account.`,builder:Ee,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.get(t.prefixId,r)),{successLabel:`Loaded`})}};function Oe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`List all prefixes owned by the account.`,builder:Oe,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.list(r)),{successLabel:`Loaded`})}};function Ae(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`service-id`,{type:`string`,description:`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the
|
|
10
|
-
**List Services** endpoint.
|
|
11
|
-
`}).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 <prefixId>`,describe:`Creates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. **NOTE:** The first Service Binding created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent Service Bindings may be created with a more-specific CIDR. Refer to the [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) for compatibility details.`,builder:Ae,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes service-bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bindings`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`json`,body:{cidr:t.cidr,serviceId:t.serviceId,body:t.body}});return}let n=await i(t),f=t.local?p:await e(n);if(t.accountId=f,t.body){let e=s(t.body);c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes/${t.prefixId}/bindings`,{body:e})),{successLabel:`Created`});return}t.cidr===void 0&&(t.cidr=await r(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),t.serviceId===void 0&&(t.serviceId=await r(`service-id`,`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the **List Services** endpoint. `));let m={};t.cidr!==void 0&&o(m,[`cidr`],d(t.cidr,`cidr`,`text`)),t.serviceId!==void 0&&o(m,[`service_id`],d(t.serviceId,`serviceId`,`text`)),c(await u(`Creating`,async()=>n.post(`/accounts/${f}/addressing/prefixes/${t.prefixId}/bindings`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function Me(e){return e.positional(`bindingId`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <bindingId>`,describe:`Delete a Service Binding`,builder:Me,handler:async n=>{if(n.dryRun){l({command:`cf addressing prefixes service-bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${n.prefixId??`<prefixId>`}/bindings/${n.bindingId??`<bindingId>`}`,pathParams:{prefixId:String(n.prefixId??``),bindingId:String(n.bindingId??``)},bodyKind:`none`});return}let r=await i(n),o=n.local?p:await e(r);if(n.accountId=o,!await t({force:!!n.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);return}c(await u(`Deleting`,async()=>r.addressing.prefixes.serviceBindings.delete(o,n.prefixId,n.bindingId)),{successLabel:`Deleted`})}};function Pe(e){return e.positional(`bindingId`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`get <bindingId>`,describe:`Fetch a single Service Binding`,builder:Pe,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes service-bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bindings/${t.bindingId??`<bindingId>`}`,pathParams:{prefixId:String(t.prefixId??``),bindingId:String(t.bindingId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.serviceBindings.get(r,t.prefixId,t.bindingId)),{successLabel:`Loaded`})}};function Ie(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`list`,describe:"List the Cloudflare services this prefix is currently bound to. Traffic sent to an address within an IP prefix will be routed to the Cloudflare service of the most-specific Service Binding matching the address. **Example:** binding `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other IPs in the prefix to Cloudflare Magic Transit.",builder:Ie,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes service-bindings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/bindings`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.prefixes.serviceBindings.list(r,t.prefixId)),{successLabel:`Loaded`})}},Re={command:`service-bindings`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(je).command(Ne).command(Fe).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.positional(`prefixId`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`create <prefixId>`,describe:`Triggers a new prefix validation. The checks are run asynchronously and include IRR, RPKI, and prefix ownership.`,builder:ze,handler:async t=>{if(t.dryRun){l({command:`cf addressing prefixes validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/prefixes/${t.prefixId??`<prefixId>`}/validate`,pathParams:{prefixId:String(t.prefixId??``)},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Creating`,async()=>n.addressing.prefixes.validate.create(t.prefixId,r)),{successLabel:`Created`})}},Ve={command:`validate`,describe:`Additional IP prefix operations — BGP prefix deletion and prefix validation`,builder:e=>e.command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`prefixes`,describe:`BYOIP prefixes — onboard your own IP ranges, manage BGP announcements, service bindings, and delegations`,builder:e=>e.command(me).command(Ce).command(Te).command(De).command(ke).command(Q).command(fe).command(xe).command(Re).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ue(e){return e.option(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`"}).option(`region-key`,{type:`string`,description:`Identifying key for the region`}).option(`routing`,{type:`string`,description:`Configure which routing method to use for the regional hostname`,default:`dns`}).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:`create`,describe:`Create a new Regional Hostname entry. Cloudflare will only use data centers that are physically located within the chosen region to decrypt and service HTTPS traffic. Learn more about [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/).`,builder:Ue,handler:async e=>{if(e.dryRun){l({command:`cf addressing regional-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{hostname:e.hostname,regionKey:e.regionKey,routing:e.routing,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}/addressing/regional_hostnames`,{body:n})),{successLabel:`Created`});return}e.hostname===void 0&&(e.hostname=await r(`hostname`,"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`")),e.regionKey===void 0&&(e.regionKey=await r(`region-key`,`Identifying key for the region`));let a={};e.hostname!==void 0&&o(a,[`hostname`],d(e.hostname,`hostname`,`text`)),e.regionKey!==void 0&&o(a,[`region_key`],d(e.regionKey,`regionKey`,`text`)),e.routing!==void 0&&o(a,[`routing`],d(e.routing,`routing`,`text`)),c(await u(`Creating`,async()=>t.post(`/zones/${e.zoneId}/addressing/regional_hostnames`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Created`})}};function Ge(e){return e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",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 <hostname>`,describe:`Delete the region configuration for a specific Regional Hostname.`,builder:Ge,handler:async e=>{if(e.dryRun){l({command:`cf addressing regional-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames/${e.hostname??`<hostname>`}`,pathParams:{zoneId:String(e.zoneId??``),hostname:String(e.hostname??``)},bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
|
|
13
|
-
`);return}c(await u(`Deleting`,async()=>r.addressing.regionalHostnames.delete(a,e.hostname)),{successLabel:`Deleted`})}};function qe(e){return e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",demandOption:!0}).option(`region-key`,{type:`string`,description:`Identifying key for the region`}).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:`edit <hostname>`,describe:`Update the configuration for a specific Regional Hostname. Only the region_key of a hostname is mutable.`,builder:qe,handler:async e=>{if(e.dryRun){l({command:`cf addressing regional-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames/${e.hostname??`<hostname>`}`,pathParams:{zoneId:String(e.zoneId??``),hostname:String(e.hostname??``)},bodyKind:`json`,body:{regionKey:e.regionKey,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}/addressing/regional_hostnames/${e.hostname}`,{body:n})),{successLabel:`Updated`});return}e.regionKey===void 0&&(e.regionKey=await r(`region-key`,`Identifying key for the region`));let a={};e.regionKey!==void 0&&o(a,[`region_key`],d(e.regionKey,`regionKey`,`text`)),c(await u(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/addressing/regional_hostnames/${e.hostname}`,{body:Object.keys(a).length>0?a:void 0})),{successLabel:`Updated`})}};function $(e){return e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`get <hostname>`,describe:`Fetch the configuration for a specific Regional Hostname, within a zone.`,builder:$,handler:async e=>{if(e.dryRun){l({command:`cf addressing regional-hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames/${e.hostname??`<hostname>`}`,pathParams:{zoneId:String(e.zoneId??``),hostname:String(e.hostname??``)},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.addressing.regionalHostnames.get(r,e.hostname)),{successLabel:`Loaded`})}};function Xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`list`,describe:`List all Regional Hostnames within a zone.`,builder:Xe,handler:async e=>{if(e.dryRun){l({command:`cf addressing regional-hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/addressing/regional_hostnames`,pathParams:{zoneId:String(e.zoneId??``)},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.addressing.regionalHostnames.list(r)),{successLabel:`Loaded`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`list`,describe:`List all Regional Services regions available for use by this account.`,builder:Qe,handler:async t=>{if(t.dryRun){l({command:`cf addressing regional-hostnames regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/regional_hostnames/regions`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.regionalHostnames.regions.list(r)),{successLabel:`Loaded`})}},et={command:`regions`,describe:`Pin hostnames to specific geographic regions for data locality compliance`,builder:e=>e.command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},tt={command:`regional-hostnames`,describe:`Pin hostnames to specific geographic regions for data locality compliance`,builder:e=>e.command(We).command(Ke).command(Je).command(Ye).command(Ze).command(et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`list`,describe:`Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a service running on the Cloudflare network to enable a Cloudflare product on the IP addresses. This endpoint can be used as a reference of available services on the Cloudflare network, and their service IDs.`,builder:nt,handler:async t=>{if(t.dryRun){l({command:`cf addressing services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/addressing/services`,pathParams:{},bodyKind:`none`});return}let n=await i(t),r=t.local?p:await e(n);t.accountId=r,c(await u(`Loading`,async()=>n.addressing.services.list(r)),{successLabel:`Loaded`})}},it={command:`services`,describe:`Cloudflare services (CDN, Spectrum, Magic Transit) that IP prefixes can be bound to`,builder:e=>e.command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},at={command:`addressing`,describe:`IP address management — BYOIP prefixes, address maps, regional hostnames, and BGP advertisement control`,builder:e=>e.command(z).command(H).command(q).command(He).command(tt).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{at as default};
|