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,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{E as e,S as t,T as n,i 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";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`clear`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:d,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Creating`,async()=>n.cache.cacheReserve.clear({zone_id:r})),{successLabel:`Created`})}};function p(e){return e.option(`value`,{type:`string`,description:`Value of the Cache Reserve zone setting.`,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 m={command:`edit`,describe:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:p,handler:async n=>{if(n.dryRun){c({command:`cf cache cache-reserve edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Value of the Cache Reserve zone setting.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.cacheReserve.edit({...f,zone_id:d})),{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:`Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`,builder:h,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.cacheReserve.get({zone_id:r})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`status`,describe:`You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf cache cache-reserve status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.cacheReserve.status({zone_id:r})),{successLabel:`Loaded`})}},y={command:`cache-reserve`,describe:`Persistent storage tier that keeps cached assets even after eviction from edge caches`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`purge`,describe:'### Purge All Cached Content Removes ALL files from Cloudflare\'s cache. All tiers can purge everything. ``` {"purge_everything": true} ``` ### Purge Cached Content by URL Granularly removes one or more files from Cloudflare\'s cache by specifying URLs. All tiers can purge by URL. To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header. **NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise. Single file purge example with files: ``` {"files": ["http://www.example.com/css/styles.css", "http://www.example.com/js/index.js"]} ``` Single file purge example with url and header pairs: ``` {"files": [{"url": "http://www.example.com/cat_picture.jpg", "headers": {"CF-IPCountry": "US", "CF-Device-Type": "desktop", "Accept-Language": "zh-CN"}}, {"url": "http://www.example.com/dog_picture.jpg", "headers": {"CF-IPCountry": "EU", "CF-Device-Type": "mobile", "Accept-Language": "en-US"}}]} ``` ### Purge Cached Content by Tag, Host or Prefix Granularly removes one or more files from Cloudflare\'s cache either by specifying the host, the associated Cache-Tag, or a Prefix. Flex purge with tags: ``` {"tags": ["a-cache-tag", "another-cache-tag"]} ``` Flex purge with hosts: ``` {"hosts": ["www.example.com", "images.example.com"]} ``` Flex purge with prefixes: ``` {"prefixes": ["www.example.com/foo", "images.example.com/bar/baz"]} ``` ### Availability and limits Please refer to [purge cache availability and limits documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).',builder:b,handler:async e=>{if(e.dryRun){c({command:`cf cache purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/purge_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let o=await i(e),u=await t({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,!await n({force:!!e.force,message:`This operation destroys cached content for a zone.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}if(e.body){let t=a(e.body);s(await l(`Deleting`,async()=>o.cache.purge({body:t,zone_id:u})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>r(o,`POST`,`/zones/${e.zoneId}/purge_cache`)),{successLabel:`Deleted`})}};function S(e){return e.option(`value`,{type:`string`,description:`Value of the Regional Tiered Cache zone setting.`,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 C={command:`edit`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:S,handler:async n=>{if(n.dryRun){c({command:`cf cache regional-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Value of the Regional Tiered Cache zone setting.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.regionalTieredCache.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf cache regional-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.regionalTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},E={command:`regional-tiered-cache`,describe:`Restrict tiered cache topology to data centers within a specific geographic region`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(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 O={command:`delete`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}s(await l(`Deleting`,async()=>r.cache.smartTieredCache.delete({zone_id:a})),{successLabel:`Deleted`})}};function k(e){return e.option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const A={command:`edit`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:k,handler:async n=>{if(n.dryRun){c({command:`cf cache smart-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?o({value:u(n.value,`value`,`text`)}):a(n.body)});return}let r=await i(n),d=await t({zone:n.zone},r,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=a(n.body);s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:e,zone_id:d})),{successLabel:`Updated`});return}n.value===void 0&&(n.value=await e(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let f=o({value:u(n.value,`value`,`text`)});s(await l(`Updating`,async()=>r.cache.smartTieredCache.edit({body:f,zone_id:d})),{successLabel:`Updated`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get`,describe:`Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf cache smart-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.smartTieredCache.get({zone_id:r})),{successLabel:`Loaded`})}},N={command:`smart-tiered-cache`,describe:`Automatically determine the best upper-tier data centers for tiered cache topology`,builder:e=>e.command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};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:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:P,handler:async e=>{if(e.dryRun){c({command:`cf cache variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await t({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}s(await l(`Deleting`,async()=>r.cache.variants.delete({zone_id:a})),{successLabel:`Deleted`})}};function I(e){return e.option(`value-avif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for avif.`}).option(`value-bmp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for bmp.`}).option(`value-gif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for gif.`}).option(`value-jp2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jp2.`}).option(`value-jpeg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpeg.`}).option(`value-jpg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg.`}).option(`value-jpg2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg2.`}).option(`value-png`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for png.`}).option(`value-tif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tif.`}).option(`value-tiff`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tiff.`}).option(`value-webp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for webp.`}).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:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf cache variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}}):a(e.body)});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=r,e.body){let t=a(e.body);s(await l(`Updating`,async()=>n.cache.variants.edit({...t,zone_id:r})),{successLabel:`Updated`});return}let u=o({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}});s(await l(`Updating`,async()=>n.cache.variants.edit({...u,zone_id:r})),{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:`Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf cache variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(e),r=await t({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>n.cache.variants.get({zone_id:r})),{successLabel:`Loaded`})}},B={command:`variants`,describe:`Serve different cached versions of an image based on the Accept header (WebP, AVIF, etc.)`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`cache`,describe:`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(x).command(y).command(E).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{C as e,T as t,_ as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./local-VJaJ3BZ1.mjs";function d(e){return e.option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Creates a new Cloudflare calls app. An app is an unique enviroment where each Session can access all Tracks within the app.`,builder:d,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.calls.sfu.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.sfu.create({body:p,account_id:f})),{successLabel:`Created`})}};function p(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,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 m={command:`delete <app-id>`,describe:`Deletes an app from Cloudflare Calls`,builder:p,handler:async i=>{if(i.dryRun){s({command:`cf calls sfu delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"app-id":String(i[`app-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>a.calls.sfu.delete({account_id:l,app_id:i[`app-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <app-id>`,describe:`Fetches details for a single Calls app.`,builder:h,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.get({account_id:a,app_id:t[`app-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Lists all apps in the Cloudflare account`,builder:_,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps`,pathParams:{},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.sfu.list({account_id:a})),{successLabel:`Loaded`})}};function y(e){return e.positional(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of Calls app, not shown to end users.`}).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:`update <app-id>`,describe:`Edit details for a single app.`,builder:y,handler:async t=>{if(t.dryRun){s({command:`cf calls sfu update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.calls.sfu.update({body:e,account_id:f,app_id:t[`app-id`]})),{successLabel:`Updated`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.sfu.update({body:p,account_id:f,app_id:t[`app-id`]})),{successLabel:`Updated`})}},x={command:`sfu`,describe:`Selective Forwarding Unit apps that route WebRTC media between participants`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create`,describe:`Creates a new Cloudflare Calls TURN key.`,builder:S,handler:async t=>{if(t.dryRun){s({command:`cf calls turn create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.calls.turn.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Creating`,async()=>d.calls.turn.create({body:p,account_id:f})),{successLabel:`Created`})}};function w(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,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 T={command:`delete <key-id>`,describe:`Deletes a TURN key from Cloudflare Calls`,builder:w,handler:async i=>{if(i.dryRun){s({command:`cf calls turn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${i[`key-id`]==null?`<key-id>`:encodeURIComponent(String(i[`key-id`]))}`,pathParams:{"key-id":String(i[`key-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}o(await c(`Deleting`,async()=>a.calls.turn.delete({account_id:l,key_id:i[`key-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <key-id>`,describe:`Fetches details for a single TURN key.`,builder:E,handler:async t=>{if(t.dryRun){s({command:`cf calls turn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${t[`key-id`]==null?`<key-id>`:encodeURIComponent(String(t[`key-id`]))}`,pathParams:{"key-id":String(t[`key-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.get({account_id:a,key_id:t[`key-id`]})),{successLabel:`Loaded`})}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists all TURN keys in the Cloudflare account`,builder:O,handler:async t=>{if(t.dryRun){s({command:`cf calls turn list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys`,pathParams:{},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.calls.turn.list({account_id:a})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for a item.`,demandOption:!0}).option(`name`,{type:`string`,description:`A short description of a TURN key, not shown to end users.`}).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:`update <key-id>`,describe:`Edit details for a single TURN key.`,builder:A,handler:async t=>{if(t.dryRun){s({command:`cf calls turn update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/calls/turn_keys/${t[`key-id`]==null?`<key-id>`:encodeURIComponent(String(t[`key-id`]))}`,pathParams:{"key-id":String(t[`key-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({name:l(t.name,`name`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.calls.turn.update({body:e,account_id:f,key_id:t[`key-id`]})),{successLabel:`Updated`});return}let p=a({name:l(t.name,`name`,`text`)});o(await c(`Updating`,async()=>d.calls.turn.update({body:p,account_id:f,key_id:t[`key-id`]})),{successLabel:`Updated`})}},M={command:`turn`,describe:`TURN relay keys that help clients traverse NATs and firewalls for peer-to-peer connectivity`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`calls`,describe:`Real-time audio/video communication infrastructure — SFU apps for WebRTC and TURN relay keys`,builder:e=>e.command(x).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{S as e,n as t}from"./auth-ffdf9yR0.mjs";import{n,t as r}from"./body-parser-DKa8Ipg1.mjs";import{t as i}from"./output-BJFNwj7b.mjs";import{n as a,t as o}from"./progress-CrCGTq7N.mjs";import{n as s}from"./input-validation-zEO81MWN.mjs";function c(e){return e.option(`mtls-certificate-id`,{type:`string`,description:`The UUID to match against for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the results will be the hostnames associated to your active Cloudflare Managed CA.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`List Hostname Associations.`,builder:c,handler:async n=>{let r={mtls_certificate_id:n[`mtls-certificate-id`]};if(n.dryRun){a({command:`cf certificate-authorities hostname-associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/certificate_authorities/hostname_associations`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},query:r,bodyKind:`none`});return}let s=await t(n),c=await e({zone:n.zone},s,{quiet:n.quiet});n.zoneId=c,i(await o(`Loading`,async()=>s.certificateAuthorities.hostnameAssociations.get({zone_id:c,...r})),{successLabel:`Loaded`})}};function u(e){return e.option(`hostnames`,{type:`string`,array:!0,description:`The hostnames field`}).option(`mtls-certificate-id`,{type:`string`,description:`The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtls_certificate_id is given, the hostnames will be associated to your active Cloudflare Managed CA.`}).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:`update`,describe:`Replace Hostname Associations.`,builder:u,handler:async c=>{if(c.dryRun){a({command:`cf certificate-authorities hostname-associations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/certificate_authorities/hostname_associations`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?r({hostnames:c.hostnames,mtls_certificate_id:s(c[`mtls-certificate-id`],`mtls-certificate-id`,`text`)}):n(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=n(c.body);i(await o(`Updating`,async()=>l.certificateAuthorities.hostnameAssociations.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=r({hostnames:c.hostnames,mtls_certificate_id:s(c[`mtls-certificate-id`],`mtls-certificate-id`,`text`)});i(await o(`Updating`,async()=>l.certificateAuthorities.hostnameAssociations.update({...d,zone_id:u})),{successLabel:`Updated`})}},f={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`certificate-authorities`,describe:`Map client certificates to specific hostnames for mTLS authentication`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,S as t,T as n,n as r}from"./auth-ffdf9yR0.mjs";import{n as i,t as a}from"./body-parser-DKa8Ipg1.mjs";import{t as o}from"./output-BJFNwj7b.mjs";import{n as s,t as c}from"./progress-CrCGTq7N.mjs";import{n as l}from"./input-validation-zEO81MWN.mjs";import{t as u}from"./cli-types-CRIDdDw3.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`validity-days`,{type:`number`,description:`The number of days the Client Certificate will be valid after the issued_on date.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create a new API Shield mTLS Client Certificate.`,builder:d,handler:async n=>{if(n.dryRun){s({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({csr:l(n.csr,`csr`,`text`),validity_days:n[`validity-days`]}):i(n.body)});return}let u=await r(n),d=await t({zone:n.zone},u,{quiet:n.quiet});if(n.zoneId=d,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.clientCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(n.csr===void 0&&(n.csr=await e(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),n[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=a({csr:l(n.csr,`csr`,`text`),validity_days:n[`validity-days`]});o(await c(`Creating`,async()=>u.clientCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function p(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <client-certificate-id>`,describe:`Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf client-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates/${e[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(e[`client-certificate-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"client-certificate-id":String(e[`client-certificate-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await t({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await n({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>i.clientCertificates.delete({zone_id:a,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`reactivate`,{type:`boolean`,description:`The reactivate 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:`edit <client-certificate-id>`,describe:`If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint.`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf client-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates/${e[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(e[`client-certificate-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"client-certificate-id":String(e[`client-certificate-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({reactivate:e.reactivate}):i(e.body)});return}let n=await r(e),l=await t({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=l,e.body){let t=i(e.body);o(await c(`Updating`,async()=>n.clientCertificates.edit({...t,zone_id:l,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Updated`});return}let u=a({reactivate:e.reactivate});o(await c(`Updating`,async()=>n.clientCertificates.edit({...u,zone_id:l,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Updated`})}};function _(e){return e.positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <client-certificate-id>`,describe:`Get Details for a single mTLS API Shield Client Certificate.`,builder:_,handler:async e=>{if(e.dryRun){s({command:`cf client-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates/${e[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(e[`client-certificate-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"client-certificate-id":String(e[`client-certificate-id`]??``)},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.clientCertificates.get({zone_id:i,client_certificate_id:e[`client-certificate-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`status`,{type:`string`,description:`Client Certitifcate Status to filter results by.`,choices:[`all`,`active`,`pending_reactivation`,`pending_revocation`,`revoked`]}).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 b={command:`list`,describe:`List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination.`,builder:u(y),handler:async e=>{let n={status:e.status,page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){s({command:`cf client-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},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.clientCertificates.list({zone_id:a,...n})),{successLabel:`Loaded`})}},x={command:`client-certificates`,describe:`Issue and manage client certificates for mutual TLS (mTLS) authentication on your zone`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{x as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{S as e,n as t}from"./auth-ffdf9yR0.mjs";import{n}from"./body-parser-DKa8Ipg1.mjs";import{t as r}from"./output-BJFNwj7b.mjs";import{n as i,t as a}from"./progress-CrCGTq7N.mjs";function o(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`list`,describe:`Retrieves the Cloud Connector rules configured for a zone. Rules define how traffic is routed to cloud services.`,builder:o,handler:async n=>{if(n.dryRun){i({command:`cf cloud-connector rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(n),s=await e({zone:n.zone},o,{quiet:n.quiet});n.zoneId=s,r(await a(`Loading`,async()=>o.cloudConnector.rules.list({zone_id:s})),{successLabel:`Loaded`})}};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 l={command:`update`,describe:`Updates Cloud Connector rules for a zone, replacing the existing rule configuration.`,builder:c,handler:async o=>{if(o.dryRun){i({command:`cf cloud-connector rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/cloud_connector/rules`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:n(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=n(o.body);r(await a(`Updating`,async()=>s.cloudConnector.rules.update({body:e,zone_id:c})),{successLabel:`Updated`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},u={command:`rules`,describe:`Routing rules that map request patterns to cloud provider endpoints`,builder:e=>e.command(s).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`cloud-connector`,describe:`Route traffic from Cloudflare directly to cloud provider services (AWS, Azure, GCP) without origin servers`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|