cf 0.2.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 +63 -62
- package/dist/_meta/commands.json +12365 -9690
- package/dist/_meta/schemas.json +19206 -15404
- 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-5jmmOZhm.mjs → build-DYkGW4dh.mjs} +1 -1
- 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/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/{deploy-DbkiIzUr.mjs → deploy-CQial3kN.mjs} +1 -1
- package/dist/{dev-C6iSuQZm.mjs → dev-B38LfCTl.mjs} +1 -1
- package/dist/diagnostics-BJQGjVJn.mjs +3 -0
- package/dist/dispatch-namespaces-DmHvoBOg.mjs +7 -0
- package/dist/{dist-CnSubA1Z.mjs → dist-AIcZFk0U.mjs} +7 -7
- 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-B8fwxKZD.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-CjcQ6ato.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-CHBfkARI.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-DEzmTsEC.mjs → shared-AGtpXwwL.mjs} +1 -1
- package/dist/smart-shield-TeWZFnH2.mjs +3 -0
- package/dist/snippets-CCSsCXVs.mjs +4 -0
- package/dist/{spawn-13QQ0IwO.mjs → spawn-DcppKGI5.mjs} +1 -1
- package/dist/spectrum-CTTZID8u.mjs +63 -0
- package/dist/speed-CuzTE0AL.mjs +4 -0
- package/dist/{src-B9cKsgsg.mjs → src-BW6vfAwE.mjs} +10 -10
- 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-B7QiNu-d.mjs → tools-DXQmfFuE.mjs} +1 -1
- package/dist/turnstile-cfdaO4ca.mjs +23 -0
- package/dist/{ui-BXjU1dX1.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-DzyrlUAi.mjs → versions-CUwWJWmy.mjs} +1 -1
- 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 +4 -3
- package/dist/abuse-reports-KtfZhi6j.mjs +0 -8
- package/dist/accounts-BopMfODC.mjs +0 -21
- package/dist/acm-BT4vlnEJ.mjs +0 -3
- package/dist/addressing-B3uFxHst.mjs +0 -13
- package/dist/ai-DWHqwMap.mjs +0 -2
- package/dist/ai-gateway-CbKEO-3o.mjs +0 -8
- package/dist/ai-search-VnOQ5n--.mjs +0 -7
- package/dist/alerting-BmmgIlIO.mjs +0 -6
- package/dist/analytics-isY03taL.mjs +0 -20
- package/dist/api-gateway-DXurEbA-.mjs +0 -33
- package/dist/argo-B02BL_hp.mjs +0 -2
- package/dist/audit-logs-DcgR9xUc.mjs +0 -2
- package/dist/auth-CQcAgnOy.mjs +0 -135
- package/dist/auth-DenWm_X0.mjs +0 -6
- package/dist/autorag-CmrwnGVj.mjs +0 -2
- package/dist/billing-CaW1ZAB1.mjs +0 -2
- package/dist/body-parser-Br-BoYk-.mjs +0 -2
- package/dist/bot-management-CeBsFx68.mjs +0 -5
- package/dist/botnet-feed-B396vQeQ.mjs +0 -3
- package/dist/brand-protection-D4V1v5Kl.mjs +0 -3
- package/dist/browser-rendering-GF7rNtKI.mjs +0 -4
- package/dist/builds-C_ySULja.mjs +0 -2
- package/dist/cache-DmXizSMi.mjs +0 -5
- package/dist/calls-x4KQpTB4.mjs +0 -4
- package/dist/certificate-authorities-hC0SG-Ga.mjs +0 -2
- package/dist/client-certificates-BGVsDyeJ.mjs +0 -3
- package/dist/cloud-connector-BClQpEzI.mjs +0 -2
- package/dist/cloudforce-one-BfhFrO6M.mjs +0 -21
- package/dist/connectivity-G0NP6LtW.mjs +0 -3
- package/dist/content-scanning-DEtPJ7aF.mjs +0 -4
- package/dist/context-CC0Rhkhy.mjs +0 -2
- package/dist/custom-certificates-rJXFpUWu.mjs +0 -5
- package/dist/custom-hostnames-Be5mgLeF.mjs +0 -5
- package/dist/custom-nameservers-CoFdy6hD.mjs +0 -3
- package/dist/custom-pages-D-oErw57.mjs +0 -4
- package/dist/d1-C95ckPKI.mjs +0 -3
- package/dist/dcv-delegation-CWSkbGuc.mjs +0 -2
- package/dist/diagnostics-DEEhPnXj.mjs +0 -3
- package/dist/dispatch-namespaces-BzXeV7PH.mjs +0 -7
- package/dist/dns-firewall-BQXD_NxG.mjs +0 -57
- package/dist/dns-qW-3TZOT.mjs +0 -29
- package/dist/durable-objects-CgWFYEJJ.mjs +0 -2
- package/dist/email-routing-tdNJaCpJ.mjs +0 -10
- package/dist/email-security-DTVHNr2h.mjs +0 -60
- package/dist/email-sending-DsFTvE31.mjs +0 -3
- package/dist/filters-DO1Is_tI.mjs +0 -4
- package/dist/firewall-DbUhVTCg.mjs +0 -11
- package/dist/fraud-Bzr4njYb.mjs +0 -8
- package/dist/google-tag-gateway-BQxkA90M.mjs +0 -2
- package/dist/healthchecks-BBAs-lS_.mjs +0 -4
- package/dist/hostnames-Dz9PEUKS.mjs +0 -3
- package/dist/hyperdrive-B1iUJddG.mjs +0 -18
- package/dist/iam-CJM8gHpG.mjs +0 -6
- package/dist/images-DEoBmtFS.mjs +0 -5
- package/dist/intel-BM6xkZ0C.mjs +0 -3
- package/dist/keyless-certificates-DffYnd4b.mjs +0 -3
- package/dist/kv-BTceLtWZ.mjs +0 -5
- package/dist/leaked-credential-checks-CALfvoCo.mjs +0 -3
- package/dist/load-balancers-C1Ho1gCF.mjs +0 -6
- package/dist/logpush-CSYhgevA.mjs +0 -4
- package/dist/logs-DlIwmMpt.mjs +0 -3
- package/dist/magic-cloud-networking-Czu0pZ0a.mjs +0 -5
- package/dist/magic-network-monitoring-d7GJE5Yt.mjs +0 -4
- package/dist/magic-transit-qQmA-981.mjs +0 -89
- package/dist/managed-transforms-Dd6AnbWE.mjs +0 -3
- package/dist/mtls-certificates-C0rlCRGs.mjs +0 -3
- package/dist/network-interconnects-CxG2deY0.mjs +0 -36
- package/dist/organizations-DyEAiGiR.mjs +0 -41
- package/dist/origin-ca-certificates-S8RcoMF6.mjs +0 -3
- package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +0 -2
- package/dist/origin-tls-client-auth-BlxMmQrE.mjs +0 -5
- package/dist/output-D7_yAFVR.mjs +0 -2
- package/dist/page-rules-DP-w6TAm.mjs +0 -18
- package/dist/page-shield-Bf7kFp8c.mjs +0 -37
- package/dist/pages-D0Y_XRqW.mjs +0 -10
- package/dist/pipelines-C-SPESAk.mjs +0 -6
- package/dist/queues-wv6CZsi8.mjs +0 -6
- package/dist/r2-DuXjp9n5.mjs +0 -21
- package/dist/r2-data-catalog-DQCMrmNO.mjs +0 -14
- package/dist/radar-BW_ZHP8X.mjs +0 -2
- package/dist/rate-limits-DLTkIvwr.mjs +0 -5
- package/dist/raw-fetch-hRv-6P3D.mjs +0 -2
- package/dist/realtime-kit-Ch7Vg3vj.mjs +0 -6
- package/dist/registrar-DIIv6fWd.mjs +0 -46
- package/dist/request-tracers-DMej0Drs.mjs +0 -2
- package/dist/resource-sharing-CYJ7cMWq.mjs +0 -5
- package/dist/resource-tagging-Dnz65MgH.mjs +0 -16
- package/dist/rules-DLJpOYbC.mjs +0 -4
- package/dist/rulesets-D9nqEJT5.mjs +0 -8
- package/dist/rum-DBVmdPkp.mjs +0 -4
- package/dist/schema-validation-MCd3xdtX.mjs +0 -4
- package/dist/scim-DZA3VXog.mjs +0 -3
- package/dist/scm-CilfPOue.mjs +0 -2
- package/dist/secrets-store-BrvcZSOM.mjs +0 -21
- package/dist/security-center-BU6f3Cm1.mjs +0 -2
- package/dist/security-txt-BPIbP3dG.mjs +0 -3
- package/dist/session-H7IV2BrM.mjs +0 -2
- package/dist/smart-shield-e8XFBkiF.mjs +0 -3
- package/dist/snippets-B4M3MMb8.mjs +0 -4
- package/dist/spectrum-B0adfSRI.mjs +0 -59
- package/dist/speed-BVcUtkAz.mjs +0 -4
- package/dist/ssl-BAa91gsc.mjs +0 -15
- package/dist/stream-D53sxKb3.mjs +0 -14
- package/dist/tenants-bH5pt3dJ.mjs +0 -2
- package/dist/token-validation-M61Vx_Tw.mjs +0 -4
- package/dist/turnstile-wAU0Gc2Z.mjs +0 -23
- package/dist/url-normalization-DZrWDgB5.mjs +0 -3
- package/dist/url-scanner-Zo49edNp.mjs +0 -2
- package/dist/user-DbXlVReB.mjs +0 -10
- package/dist/vectorize-CUnTM0DT.mjs +0 -4
- package/dist/vuln-scanner-Br_2lQp1.mjs +0 -2
- package/dist/waiting-rooms-BZW0X69-.mjs +0 -11
- package/dist/web3-DueyOQtx.mjs +0 -4
- package/dist/workers-builds-BM_aoeUR.mjs +0 -7
- package/dist/workers-nV_vBCfV.mjs +0 -16
- package/dist/workflows-CQITmo-s.mjs +0 -4
- package/dist/zaraz-DIbpF5Op.mjs +0 -2
- package/dist/zero-trust-CKp8j512.mjs +0 -119
- package/dist/zones-BZ5tZDbH.mjs +0 -28
- /package/dist/{metadata-DGdCpUxn.mjs → metadata-5VwHPW6C.mjs} +0 -0
package/dist/zones-BZ5tZDbH.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{C as e,T as t,b as n,t as r,w as i}from"./auth-CQcAgnOy.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-CjcQ6ato.mjs";import{n as u}from"./input-validation-zEO81MWN.mjs";function d(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:d,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Updating`,async()=>t.zones.activationCheck.trigger(i)),{successLabel:`Updated`})}},te={command:`activation-check`,describe:`Operations for activation-check`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(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 p={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:f,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:{"value-enabled":e[`value-enabled`],"value-pool-id":e[`value-pool-id`],body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/aegis`,{body:n})),{successLabel:`Updated`});return}let i={};e[`value-enabled`]!==void 0&&a(i,[`value`,`enabled`],e[`value-enabled`]),e[`value-pool-id`]!==void 0&&a(i,[`value`,`pool_id`],u(e[`value-pool-id`],`value-pool-id`,`text`)),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/aegis`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={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:m,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.aegis.get(i)),{successLabel:`Loaded`})}},g={command:`aegis`,describe:`Aegis operations`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(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 v={command:`create`,describe:`Create Zone`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},bodyKind:`json`,body:{"account-id":e[`account-id`],name:e.name,type:e.type,body:e.body}});return}let n=await r(e);if(e.body){let t=o(e.body);s(await l(`Creating`,async()=>n.post(`/zones`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`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 i={};e[`account-id`]!==void 0&&a(i,[`account`,`id`],u(e[`account-id`],`account-id`,`text`)),e.name!==void 0&&a(i,[`name`],u(e.name,`name`,`text`)),e.type!==void 0&&a(i,[`type`],u(e.type,`type`,`text`)),s(await l(`Creating`,async()=>n.post(`/zones`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`delete`,describe:`Deletes an existing zone.`,builder:y,handler:async t=>{if(t.dryRun){c({command:`cf zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:{body:t.body}});return}let i=await r(t),a=await n({zone:t.zone},i,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(t.body){let e=o(t.body);s(await l(`Deleting`,async()=>i.delete(`/zones/${t.zoneId}`,{body:e})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>i.zones.delete(a)),{successLabel:`Deleted`})}};function x(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 S={command:`edit`,describe:`Edits a zone. Only one zone property can be changed at a time.`,builder:x,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:{paused:e.paused,"plan-id":e[`plan-id`],type:e.type,"vanity-name-servers":e[`vanity-name-servers`],body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}`,{body:n})),{successLabel:`Updated`});return}let i={};e.paused!==void 0&&a(i,[`paused`],e.paused),e[`plan-id`]!==void 0&&a(i,[`plan`,`id`],u(e[`plan-id`],`plan-id`,`text`)),e.type!==void 0&&a(i,[`type`],u(e.type,`type`,`text`)),e[`vanity-name-servers`]!==void 0&&a(i,[`vanity_name_servers`],e[`vanity-name-servers`]),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}};function C(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 w={command:`create`,describe:`Create zone environments`,builder:C,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:{body:e.body}});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/zones/${e.zoneId}/environments`,{body:n})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>t.zones.environments.create(i)),{successLabel:`Created`})}};function T(e){return e.positional(`environment-id`,{type:`string`,description:`Environment ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <environment-id>`,describe:`Delete zone environment`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf zones environments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/environments/${t[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(t[`environment-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"environment-id":String(t[`environment-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=await n({zone:t.zone},i,{quiet:t.quiet});if(t.zoneId=a,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
14
|
-
`);return}s(await l(`Deleting`,async()=>i.zones.environments.delete(a,t[`environment-id`])),{successLabel:`Deleted`})}};function D(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 O={command:`edit`,describe:`Partially update zone environments`,builder:D,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:{body:e.body}});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/environments`,{body:n})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>t.zones.environments.edit(i)),{successLabel:`Updated`})}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List zone environments`,builder:k,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.environments.list(i)),{successLabel:`Loaded`})}};function j(e){return e.positional(`environment-id`,{type:`string`,description:`Environment ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`rollback <environment-id>`,describe:`Roll back zone environment`,builder:j,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Creating`,async()=>t.zones.environments.rollback(i,e[`environment-id`])),{successLabel:`Created`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`update`,describe:`Upsert zone environments`,builder:N,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:{body:e.body}});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.put(`/zones/${e.zoneId}/environments`,{body:n})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>t.zones.environments.update(i)),{successLabel:`Updated`})}},F={command:`environments`,describe:`Operations for environments`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 L={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:I,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:{value:e.value,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/fonts`,{body:n})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await i(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let d={};e.value!==void 0&&a(d,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/fonts`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={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:R,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.fonts.get(i)),{successLabel:`Loaded`})}},B={command:`fonts`,describe:`Fonts operations`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Zone Details`,builder:V,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.get(i)),{successLabel:`Loaded`})}};function U(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 W={command:`create`,describe:`Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname.`,builder:U,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 i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,s(await l(`Creating`,async()=>i.zones.holds.create(a,t)),{successLabel:`Created`})}};function G(e){return e.option(`hold-after`,{type:`string`,description:`If \`hold_after\` is provided, the hold will be temporarily disabled,
|
|
18
|
-
then automatically re-enabled by the system at the time specified
|
|
19
|
-
in this RFC3339-formatted timestamp. Otherwise, the hold will be
|
|
20
|
-
disabled indefinitely.`}).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 K={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.`,builder:G,handler:async t=>{let i={hold_after:t[`hold-after`]};if(t.dryRun){c({command:`cf zones holds delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),o=await n({zone:t.zone},a,{quiet:t.quiet});if(t.zoneId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
|
|
21
|
-
`);return}s(await l(`Deleting`,async()=>a.zones.holds.delete(o,i)),{successLabel:`Deleted`})}};function q(e){return e.option(`hold-after`,{type:`string`,description:`If \`hold_after\` is provided and future-dated, the hold will be temporarily disabled,
|
|
22
|
-
then automatically re-enabled by the system at the time specified
|
|
23
|
-
in this RFC3339-formatted timestamp. A past-dated \`hold_after\` value will have
|
|
24
|
-
no effect on an existing, enabled hold. Providing an empty string will set its value
|
|
25
|
-
to the current time.`}).option(`include-subdomains`,{type:`boolean`,description:`If \`true\`, the zone hold will extend to block any subdomain of the given zone, as well
|
|
26
|
-
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
27
|
-
'example.com' and include_subdomains=true will block 'example.com',
|
|
28
|
-
'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 J={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.",builder:q,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:{"hold-after":e[`hold-after`],"include-subdomains":e[`include-subdomains`],body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/hold`,{body:n})),{successLabel:`Updated`});return}let i={};e[`hold-after`]!==void 0&&a(i,[`hold_after`],u(e[`hold-after`],`hold-after`,`text`)),e[`include-subdomains`]!==void 0&&a(i,[`include_subdomains`],e[`include-subdomains`]),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/hold`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get`,describe:`Retrieve whether the zone is subject to a zone hold, and metadata about the hold.`,builder:Y,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.holds.get(i)),{successLabel:`Loaded`})}},Z={command:`holds`,describe:`Operations for holds`,builder:e=>e.command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(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(`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 ne={command:`list`,describe:`Lists, searches, sorts, and filters your zones. Listing zones across more than 500 accounts is currently not allowed.`,builder:Q,handler:async e=>{let t={name:e.name,status:e.status,"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 r(e);s(await l(`Loading`,async()=>n.zones.list(t)),{successLabel:`Loaded`})}};function re(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 ie={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:re,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:{value:e.value,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/origin_h2_max_streams`,{body:n})),{successLabel:`Updated`});return}if(e.value===void 0)throw Error(`--value is required (or pass --body with this field set).`);let i={};e.value!==void 0&&a(i,[`value`],e.value),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/origin_h2_max_streams`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={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:ae,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.originH2MaxStreams.get(i)),{successLabel:`Loaded`})}},se={command:`origin-h2-max-streams`,describe:`Origin H2 Max Streams operations`,builder:e=>e.command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(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 le={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:ce,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:{value:e.value,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/origin_max_http_version`,{body:n})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await i(`value`,`Value of the Origin Max HTTP Version Setting.`,[`2`,`1`]));let d={};e.value!==void 0&&a(d,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/origin_max_http_version`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function ue(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={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:ue,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.originMaxHTTPVersion.get(i)),{successLabel:`Loaded`})}},fe={command:`origin-max-http-version`,describe:`Origin Max Http Version operations`,builder:e=>e.command(le).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(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 me={command:`get <plan-identifier>`,describe:`Details of the available plan that the zone can subscribe to.`,builder:pe,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.plans.get(e[`plan-identifier`],i)),{successLabel:`Loaded`})}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Lists available plans the zone can subscribe to.`,builder:he,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.plans.list(i)),{successLabel:`Loaded`})}},_e={command:`plans`,describe:`Operations for plans`,builder:e=>e.command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get`,describe:`Lists all rate plans the zone can subscribe to.`,builder:ve,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.ratePlans.get(i)),{successLabel:`Loaded`})}},be={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(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 Se={command:`edit`,describe:`Toggles RUM on/off for an existing zone.`,builder:xe,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:{value:e.value,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/rum`,{body:n})),{successLabel:`Updated`});return}let i={};e.value!==void 0&&a(i,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/rum`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}};function Ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get`,describe:`Retrieves RUM status for a zone.`,builder:Ce,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.rum.get(i)),{successLabel:`Loaded`})}},Te={command:`rum`,describe:`Rum operations`,builder:e=>e.command(Se).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(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 De={command:`edit <setting-id>`,describe:`Updates a single zone setting by the identifier`,builder:Ee,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:{enabled:e.enabled,"value-enabled":e[`value-enabled`],"value-pool-id":e[`value-pool-id`],"value-cache-by-device-type":e[`value-cache-by-device-type`],"value-cf":e[`value-cf`],"value-hostnames":e[`value-hostnames`],"value-wordpress":e[`value-wordpress`],"value-wp-plugin":e[`value-wp-plugin`],"value-strict-transport-security-enabled":e[`value-strict-transport-security-enabled`],"value-strict-transport-security-include-subdomains":e[`value-strict-transport-security-include-subdomains`],"value-strict-transport-security-max-age":e[`value-strict-transport-security-max-age`],"value-strict-transport-security-nosniff":e[`value-strict-transport-security-nosniff`],"value-strict-transport-security-preload":e[`value-strict-transport-security-preload`],body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/${encodeURIComponent(String(e[`setting-id`]))}`,{body:n})),{successLabel:`Updated`});return}let i={};e.enabled!==void 0&&a(i,[`enabled`],e.enabled),e[`value-enabled`]!==void 0&&a(i,[`value`,`enabled`],e[`value-enabled`]),e[`value-pool-id`]!==void 0&&a(i,[`value`,`pool_id`],u(e[`value-pool-id`],`value-pool-id`,`text`)),e[`value-cache-by-device-type`]!==void 0&&a(i,[`value`,`cache_by_device_type`],e[`value-cache-by-device-type`]),e[`value-cf`]!==void 0&&a(i,[`value`,`cf`],e[`value-cf`]),e[`value-hostnames`]!==void 0&&a(i,[`value`,`hostnames`],e[`value-hostnames`]),e[`value-wordpress`]!==void 0&&a(i,[`value`,`wordpress`],e[`value-wordpress`]),e[`value-wp-plugin`]!==void 0&&a(i,[`value`,`wp_plugin`],e[`value-wp-plugin`]),e[`value-strict-transport-security-enabled`]!==void 0&&a(i,[`value`,`strict_transport_security`,`enabled`],e[`value-strict-transport-security-enabled`]),e[`value-strict-transport-security-include-subdomains`]!==void 0&&a(i,[`value`,`strict_transport_security`,`include_subdomains`],e[`value-strict-transport-security-include-subdomains`]),e[`value-strict-transport-security-max-age`]!==void 0&&a(i,[`value`,`strict_transport_security`,`max_age`],e[`value-strict-transport-security-max-age`]),e[`value-strict-transport-security-nosniff`]!==void 0&&a(i,[`value`,`strict_transport_security`,`nosniff`],e[`value-strict-transport-security-nosniff`]),e[`value-strict-transport-security-preload`]!==void 0&&a(i,[`value`,`strict_transport_security`,`preload`],e[`value-strict-transport-security-preload`]),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/${encodeURIComponent(String(e[`setting-id`]))}`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}};function Oe(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 ke={command:`get <setting-id>`,describe:`Fetch a single zone setting by name`,builder:Oe,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.settings.get(i,e[`setting-id`])),{successLabel:`Loaded`})}},Ae={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(De).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(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 Me={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:je,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:{value:e.value,body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/speed_brain`,{body:n})),{successLabel:`Updated`});return}e.value===void 0&&(e.value=await i(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let d={};e.value!==void 0&&a(d,[`value`],u(e.value,`value`,`text`)),s(await l(`Updating`,async()=>t.patch(`/zones/${e.zoneId}/settings/speed_brain`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}};function Ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={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:Ne,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.speedBrain.get(i)),{successLabel:`Loaded`})}},$={command:`speed-brain`,describe:`Speed Brain operations`,builder:e=>e.command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(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 Ie={command:`create`,describe:`Create a zone subscription, either plan or add-ons.`,builder:Fe,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:{"app-install-id":e[`app-install-id`],frequency:e.frequency,"rate-plan-currency":e[`rate-plan-currency`],"rate-plan-externally-managed":e[`rate-plan-externally-managed`],"rate-plan-id":e[`rate-plan-id`],"rate-plan-is-contract":e[`rate-plan-is-contract`],"rate-plan-public-name":e[`rate-plan-public-name`],"rate-plan-scope":e[`rate-plan-scope`],"rate-plan-sets":e[`rate-plan-sets`],body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Creating`,async()=>t.post(`/zones/${e.zoneId}/subscription`,{body:n})),{successLabel:`Created`});return}let i={};e[`app-install-id`]!==void 0&&a(i,[`app`,`install_id`],u(e[`app-install-id`],`app-install-id`,`text`)),e.frequency!==void 0&&a(i,[`frequency`],u(e.frequency,`frequency`,`text`)),e[`rate-plan-currency`]!==void 0&&a(i,[`rate_plan`,`currency`],u(e[`rate-plan-currency`],`rate-plan-currency`,`text`)),e[`rate-plan-externally-managed`]!==void 0&&a(i,[`rate_plan`,`externally_managed`],e[`rate-plan-externally-managed`]),e[`rate-plan-id`]!==void 0&&a(i,[`rate_plan`,`id`],u(e[`rate-plan-id`],`rate-plan-id`,`text`)),e[`rate-plan-is-contract`]!==void 0&&a(i,[`rate_plan`,`is_contract`],e[`rate-plan-is-contract`]),e[`rate-plan-public-name`]!==void 0&&a(i,[`rate_plan`,`public_name`],u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`)),e[`rate-plan-scope`]!==void 0&&a(i,[`rate_plan`,`scope`],u(e[`rate-plan-scope`],`rate-plan-scope`,`text`)),e[`rate-plan-sets`]!==void 0&&a(i,[`rate_plan`,`sets`],e[`rate-plan-sets`]),s(await l(`Creating`,async()=>t.post(`/zones/${e.zoneId}/subscription`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Created`})}};function Le(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get`,describe:`Lists zone subscription details.`,builder:Le,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 r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,s(await l(`Loading`,async()=>t.zones.subscriptions.get(i)),{successLabel:`Loaded`})}};function ze(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 Be={command:`update`,describe:`Updates zone subscriptions, either plan or add-ons.`,builder:ze,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:{"app-install-id":e[`app-install-id`],frequency:e.frequency,"rate-plan-currency":e[`rate-plan-currency`],"rate-plan-externally-managed":e[`rate-plan-externally-managed`],"rate-plan-id":e[`rate-plan-id`],"rate-plan-is-contract":e[`rate-plan-is-contract`],"rate-plan-public-name":e[`rate-plan-public-name`],"rate-plan-scope":e[`rate-plan-scope`],"rate-plan-sets":e[`rate-plan-sets`],body:e.body}});return}let t=await r(e);if(e.zoneId=await n({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.put(`/zones/${e.zoneId}/subscription`,{body:n})),{successLabel:`Updated`});return}let i={};e[`app-install-id`]!==void 0&&a(i,[`app`,`install_id`],u(e[`app-install-id`],`app-install-id`,`text`)),e.frequency!==void 0&&a(i,[`frequency`],u(e.frequency,`frequency`,`text`)),e[`rate-plan-currency`]!==void 0&&a(i,[`rate_plan`,`currency`],u(e[`rate-plan-currency`],`rate-plan-currency`,`text`)),e[`rate-plan-externally-managed`]!==void 0&&a(i,[`rate_plan`,`externally_managed`],e[`rate-plan-externally-managed`]),e[`rate-plan-id`]!==void 0&&a(i,[`rate_plan`,`id`],u(e[`rate-plan-id`],`rate-plan-id`,`text`)),e[`rate-plan-is-contract`]!==void 0&&a(i,[`rate_plan`,`is_contract`],e[`rate-plan-is-contract`]),e[`rate-plan-public-name`]!==void 0&&a(i,[`rate_plan`,`public_name`],u(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`)),e[`rate-plan-scope`]!==void 0&&a(i,[`rate_plan`,`scope`],u(e[`rate-plan-scope`],`rate-plan-scope`,`text`)),e[`rate-plan-sets`]!==void 0&&a(i,[`rate_plan`,`sets`],e[`rate-plan-sets`]),s(await l(`Updating`,async()=>t.put(`/zones/${e.zoneId}/subscription`,{body:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`})}},Ve={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Ie).command(Re).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`zones`,describe:`Zones are domains on Cloudflare — list, create, and configure domain settings`,builder:e=>e.command(v).command(b).command(S).command(H).command(ne).command(te).command(g).command(F).command(B).command(Z).command(se).command(fe).command(_e).command(be).command(Te).command(Ae).command($).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
|
|
File without changes
|