cf 0.9.0 → 0.9.1
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/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CzDAjFpo.mjs} +1 -1
- package/dist/{access-RbqBFrSC.mjs → access-CxyW_sIW.mjs} +1 -1
- package/dist/{account-D7xvYqDx.mjs → account-Dd4-tDYJ.mjs} +1 -1
- package/dist/{account-tags-CKRh1jra.mjs → account-tags-65fAlHrf.mjs} +1 -1
- package/dist/{accounts-2pGhN4s8.mjs → accounts-Bp5KGc6r.mjs} +1 -1
- package/dist/{acm-Szq4CoQN.mjs → acm-CHacxa3s.mjs} +1 -1
- package/dist/{addressing-CgTTbuCF.mjs → addressing-BnqNmmYN.mjs} +1 -1
- package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-D--BQS0W.mjs} +1 -1
- package/dist/{ai-Cn0BniR4.mjs → ai-BnVlQDiI.mjs} +1 -1
- package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-CfpDKXkD.mjs} +1 -1
- package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-oG4j_oYN.mjs} +1 -1
- package/dist/{ai-search-2xP8FP_W.mjs → ai-search-B2l3B_jn.mjs} +1 -1
- package/dist/{ai-security-AUfzagSE.mjs → ai-security-byjIIrfl.mjs} +1 -1
- package/dist/{alerting-DbXVpGv3.mjs → alerting-qa8SkXlD.mjs} +1 -1
- package/dist/{analytics-UQrIx99t.mjs → analytics-DeIKjC9n.mjs} +1 -1
- package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-BnECMIWJ.mjs} +1 -1
- package/dist/{api-security-pSJdgmtK.mjs → api-security-MfHbfZyf.mjs} +1 -1
- package/dist/{argo-Br60zF3y.mjs → argo-DFerMyXF.mjs} +1 -1
- package/dist/{artifacts-D8HMRQmb.mjs → artifacts-CtyEYYDa.mjs} +1 -1
- package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-retFtvow.mjs} +1 -1
- package/dist/{auth-C6MhC9EZ.mjs → auth-DuLchM18.mjs} +2 -2
- package/dist/{auth-MeSu8lFz.mjs → auth-aazs91XL.mjs} +1 -1
- package/dist/{billing-0RNCYBJM.mjs → billing-CxQVqpGZ.mjs} +1 -1
- package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Rli7v7tg.mjs} +1 -1
- package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-Cw6XSEf8.mjs} +1 -1
- package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CTvnHGfV.mjs} +1 -1
- package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-q79xHrVW.mjs} +1 -1
- package/dist/{browser-run-C5pYOwtf.mjs → browser-run-FwtwnBzA.mjs} +1 -1
- package/dist/{build-Nivzj54_.mjs → build-Dji9BYmV.mjs} +1 -1
- package/dist/{cache-BgRIDcFJ.mjs → cache-Cl7vKJwH.mjs} +1 -1
- package/dist/{calls-JrRne0U0.mjs → calls-DtK_ANxq.mjs} +1 -1
- package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-DZP1RzAs.mjs} +1 -1
- package/dist/{cf-BUKsENG5.mjs → cf-oSz9pud_.mjs} +1 -1
- package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-BtPU9GsQ.mjs} +1 -1
- package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-DAn-3jwp.mjs} +1 -1
- package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-BpVcvhjZ.mjs} +1 -1
- package/dist/{cloudforce-one-Cp4bQmrG.mjs → cloudforce-one-2PecncfX.mjs} +1 -1
- package/dist/{connector-interrupts-BR47snkh.mjs → connector-interrupts-ollUcksZ.mjs} +1 -1
- package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-D5_3X7XW.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CJ9gLRFR.mjs} +1 -1
- package/dist/{connectors-BRCQSsos.mjs → connectors-Bo6ZT8PT.mjs} +1 -1
- package/dist/{containers-CfKOM_f5.mjs → containers-Bog7j0Hw.mjs} +1 -1
- package/dist/{content-scan-CB4xHGv1.mjs → content-scan-D03UfK2X.mjs} +1 -1
- package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DgS-7ADh.mjs} +1 -1
- package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-8AKtNnUg.mjs} +1 -1
- package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-4y35UC1X.mjs} +1 -1
- package/dist/{custom-csrs-D0zBkQT5.mjs → custom-csrs-DwBrLh-H.mjs} +1 -1
- package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-CDIAnsRa.mjs} +1 -1
- package/dist/{custom-nameservers-G2MWpRwY.mjs → custom-nameservers-stk7ymnP.mjs} +1 -1
- package/dist/{custom-pages-BINNZTds.mjs → custom-pages-vfDxrXbt.mjs} +1 -1
- package/dist/{d1-FmAh7T7l.mjs → d1-Cllm-iTT.mjs} +1 -1
- package/dist/{data-security-2fmzF_Me.mjs → data-security-rnoSCEdL.mjs} +1 -1
- package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-DCRCOL6l.mjs} +1 -1
- package/dist/{deploy-BzFbjH6a.mjs → deploy-DGlmjPTS.mjs} +1 -1
- package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-DhCo1I0I.mjs} +1 -1
- package/dist/{dev-CWaf-qW4.mjs → dev-BbLV0Ti-.mjs} +1 -1
- package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-D5Yo2xqx.mjs} +1 -1
- package/dist/{directory-CGNWfVQc.mjs → directory-CCndFkbQ.mjs} +1 -1
- package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-C48JQ9EA.mjs} +1 -1
- package/dist/{dls-CobKlH4N.mjs → dls-BBq99pjI.mjs} +1 -1
- package/dist/{dns-OfJXNYkK.mjs → dns-DdQYtenF.mjs} +1 -1
- package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-DdwVtm12.mjs} +1 -1
- package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-BvxXBht_.mjs} +1 -1
- package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DFvXKSkg.mjs} +1 -1
- package/dist/{email-routing-CRvIUSFm.mjs → email-routing-QBRPBlyl.mjs} +1 -1
- package/dist/{email-security-D-P8ln2L.mjs → email-security-BFagcRPP.mjs} +1 -1
- package/dist/{email-sending-BwRN8PMW.mjs → email-sending-Ddhe7xjN.mjs} +1 -1
- package/dist/{filters-DczM8qpH.mjs → filters-CGisPGD1.mjs} +1 -1
- package/dist/{firewall-BMiETRmM.mjs → firewall-DD8U-Brd.mjs} +1 -1
- package/dist/{flagship-CPkQMist.mjs → flagship-FJHc4mFi.mjs} +1 -1
- package/dist/{fraud-BhX0QNUl.mjs → fraud-AH47n-wL.mjs} +1 -1
- package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-149kbuG_.mjs} +1 -1
- package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-DfEUG007.mjs} +1 -1
- package/dist/{hostnames-CGAFkYT1.mjs → hostnames-DQUiD3Vr.mjs} +1 -1
- package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-RyQboMWI.mjs} +1 -1
- package/dist/{iam-Su_hpatD.mjs → iam-BhHYhMXO.mjs} +1 -1
- package/dist/{images-D2ZflvBi.mjs → images-CDViyKtZ.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DPGzVovJ.mjs → intel-YHZbPlS3.mjs} +1 -1
- package/dist/{interactive-CM2G03lr.mjs → interactive-mV8PABm6.mjs} +1 -1
- package/dist/{ips-C5-NH1b0.mjs → ips-BpCdldFx.mjs} +1 -1
- package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-oNu5jWKF.mjs} +1 -1
- package/dist/{keys-B0FBtlOD.mjs → keys-yYtv7Ztr.mjs} +1 -1
- package/dist/{kv-BbZ9st5o.mjs → kv-Bi9B4E0A.mjs} +1 -1
- package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DKRjBLcr.mjs} +1 -1
- package/dist/{load-balancers-Ct5cyyF9.mjs → load-balancers-jRCN75mX.mjs} +1 -1
- package/dist/{local-eEF0NF51.mjs → local-DTyuGwTw.mjs} +1 -1
- package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-IAXhEugU.mjs} +1 -1
- package/dist/{logexplorer-BhsAWxCr.mjs → logexplorer-kO8CULiK.mjs} +1 -1
- package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-LyDAYPbI.mjs} +1 -1
- package/dist/{logos-DS0krPAz.mjs → logos-O9f5bGSB.mjs} +1 -1
- package/dist/{logpush-CFQBi88z.mjs → logpush-dtXLu3Ck.mjs} +1 -1
- package/dist/{logs-C07M9zn-.mjs → logs-DmWWL5f9.mjs} +1 -1
- package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-XbTa6P52.mjs} +1 -1
- package/dist/{magic-network-monitoring-CY3CHSpX.mjs → magic-network-monitoring-CpfkgZMp.mjs} +1 -1
- package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-DwgZeIj-.mjs} +1 -1
- package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-DCmogkxv.mjs} +1 -1
- package/dist/{matches-CIaCrdrs.mjs → matches-BAeN8VM1.mjs} +1 -1
- package/dist/{mcp-D2afM8MD.mjs → mcp-DKZ2D050.mjs} +1 -1
- package/dist/{mesh-DLNLi3UT.mjs → mesh-CzIPtuaM.mjs} +1 -1
- package/dist/{moq-BBQVNGo1.mjs → moq-CJpE-eNj.mjs} +1 -1
- package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-Bbm_1lQI.mjs} +1 -1
- package/dist/{network-CmuJqtFJ.mjs → network-D2WRXCDe.mjs} +1 -1
- package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-Clq4X1U8.mjs} +1 -1
- package/dist/{oauth-BjHjJtnn.mjs → oauth-BPizUUqP.mjs} +1 -1
- package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-hilWfAlm.mjs} +1 -1
- package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-CmbgsPYd.mjs} +1 -1
- package/dist/{observability-B5p3iwrq.mjs → observability-DXYgDdU5.mjs} +1 -1
- package/dist/{organization-DQIfNVCT.mjs → organization-D41rIvJa.mjs} +1 -1
- package/dist/{organizations-L_ycAy6r.mjs → organizations-eNzfOwlP.mjs} +1 -1
- package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-DaiAmw45.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-7YztBged.mjs} +1 -1
- package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DRwURM8s.mjs} +1 -1
- package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-B2Csdc4h.mjs} +1 -1
- package/dist/{pages-CskAn5mR.mjs → pages-BAL6Q7OY.mjs} +1 -1
- package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-C-1-ZAtn.mjs} +1 -1
- package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-cyQOuFLb.mjs} +1 -1
- package/dist/{precursor-DgRWBN9_.mjs → precursor-BrweY39h.mjs} +1 -1
- package/dist/{progress-C-oFUtvC.mjs → progress-B84wYh91.mjs} +1 -1
- package/dist/{prompt-DM4z101s.mjs → prompt-CDtLWxNv.mjs} +1 -1
- package/dist/{queries-DrqcK0ZX.mjs → queries-oM8uGZy5.mjs} +1 -1
- package/dist/{queues-CutvMZcc.mjs → queues-CTx04ZNw.mjs} +1 -1
- package/dist/{r2-sFI62vhq.mjs → r2-CnlIUn7R.mjs} +1 -1
- package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-DLtf9d6o.mjs} +1 -1
- package/dist/{radar-Cu9rsTw_.mjs → radar-CGNgGh8v.mjs} +1 -1
- package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-B1YjnGue.mjs} +1 -1
- package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-Dz-QBoP_.mjs} +1 -1
- package/dist/{realtimekit-msnGHBbf.mjs → realtimekit-BPwzhNS9.mjs} +1 -1
- package/dist/{registrar-C0EsXf83.mjs → registrar-BEcb90RX.mjs} +1 -1
- package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-0i1T3zne.mjs} +1 -1
- package/dist/{registry-CJvn75Bq.mjs → registry-DDcSvd8H.mjs} +1 -1
- package/dist/{reporting-BB6sqe6r.mjs → reporting-CLbjHlnw.mjs} +1 -1
- package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-BcKpofP1.mjs} +1 -1
- package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-Ctdi9D-j.mjs} +1 -1
- package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-DGEyVTDN.mjs} +1 -1
- package/dist/{rules-C2BxykEe.mjs → rules-CmuB5rIN.mjs} +1 -1
- package/dist/{rulesets-BHvhAeG_.mjs → rulesets-CGaMq8vG.mjs} +1 -1
- package/dist/{rum-Dyno5zj3.mjs → rum-QT6EP4JK.mjs} +1 -1
- package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-DHryz6SF.mjs} +1 -1
- package/dist/{scim-Bb2xHpIz.mjs → scim-BgGsmHrL.mjs} +1 -1
- package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-BCpFhYFv.mjs} +1 -1
- package/dist/{security-center-DRC4Mf3R.mjs → security-center-BNm4uPVB.mjs} +1 -1
- package/dist/{security-txt-Bh_2gymk.mjs → security-txt-Be2Bif0z.mjs} +1 -1
- package/dist/{session-Br-q_UIW.mjs → session-Ckt20hHa.mjs} +1 -1
- package/dist/{share-DfTpOxhk.mjs → share-Bz2tFTUP.mjs} +1 -1
- package/dist/{shared-BNjZc02w.mjs → shared-BzPQog8H.mjs} +1 -1
- package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-SODkOUyO.mjs} +1 -1
- package/dist/{snippets-nSLwH8uJ.mjs → snippets-B5jY8v_7.mjs} +1 -1
- package/dist/{spawn-Bj8QRFJ5.mjs → spawn-CHkoow5W.mjs} +1 -1
- package/dist/{spectrum-DuhSUTZI.mjs → spectrum-BA0a42eM.mjs} +1 -1
- package/dist/{speed-Dgby_e1J.mjs → speed-mmOjxOzo.mjs} +1 -1
- package/dist/{src-CgAVPA4I.mjs → src-CHW7s5IS.mjs} +4 -4
- package/dist/{ssl-BsxTHasY.mjs → ssl-Yr6kELqg.mjs} +1 -1
- package/dist/{state-C1m9nwUm.mjs → state-DZC531l2.mjs} +1 -1
- package/dist/{stream-CkEOX5Ko.mjs → stream-Cu0kYWbc.mjs} +1 -1
- package/dist/{submit-BjdywxTq.mjs → submit-Dl_27e0n.mjs} +1 -1
- package/dist/{tags-CFAw_Sce.mjs → tags-Cdo_Pwtr.mjs} +1 -1
- package/dist/{tenant-C66iOy5O.mjs → tenant-EX-ANl6X.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-BPHUeckw.mjs} +1 -1
- package/dist/{triggers-Dv22ZXM4.mjs → triggers-Bf9hbP3h.mjs} +1 -1
- package/dist/{tunnel-BatkLdds.mjs → tunnel-CDYkWjnt.mjs} +1 -1
- package/dist/{tunnels-CstoXOoq.mjs → tunnels-CgyX8R2J.mjs} +1 -1
- package/dist/{turnstile-IoRtama4.mjs → turnstile-BUtzlW-0.mjs} +1 -1
- package/dist/{ui-DjQ4AQww.mjs → ui-DIpjthrV.mjs} +1 -1
- package/dist/{url-info-Hjhwr2la.mjs → url-info-CJsa1Oc9.mjs} +1 -1
- package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-BeKkOZz7.mjs} +1 -1
- package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-Cz-yl0_3.mjs} +1 -1
- package/dist/{user-CVHm-cnB.mjs → user-BxHjEqpd.mjs} +1 -1
- package/dist/{values-Cmlw5wGZ.mjs → values-C43NurfT.mjs} +1 -1
- package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CjXfiFH4.mjs} +1 -1
- package/dist/{versions-CU6Av1vh.mjs → versions-BFbc90Wu.mjs} +1 -1
- package/dist/{waiting-rooms-ku9UsAr9.mjs → waiting-rooms-C5jSQv_r.mjs} +1 -1
- package/dist/{web-assets-DmSKaxzf.mjs → web-assets-BzM5vVzy.mjs} +1 -1
- package/dist/{web3-DVv4jNul.mjs → web3-Ctv9HGiR.mjs} +1 -1
- package/dist/{workers-D8czeT64.mjs → workers-D-YbIedB.mjs} +1 -1
- package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B44wc67O.mjs} +1 -1
- package/dist/{workflows-BOi5MTEN.mjs → workflows-rFuQWClt.mjs} +1 -1
- package/dist/{zaraz-CGSSFJng.mjs → zaraz-BA6kY-b6.mjs} +1 -1
- package/dist/{zero-trust-BmA0VkgF.mjs → zero-trust-DOFLlUz1.mjs} +1 -1
- package/dist/{zone-Bx5ElO9U.mjs → zone-B_rgejLV.mjs} +1 -1
- package/dist/{zone-tags-izd3WWmy.mjs → zone-tags-BWdza4rH.mjs} +1 -1
- package/dist/{zones-_SnlZMiM.mjs → zones-DTWO7Vvn.mjs} +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-BjHjJtnn.mjs";import{r as t}from"./auth-C6MhC9EZ.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-C-oFUtvC.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{i as c,n as l}from"./prompt-DM4z101s.mjs";import{t as u}from"./cli-types-BWdZbsFE.mjs";function d(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.`,builder:d,handler:async c=>{if(c.dryRun){r({command:`cf ssl analyze create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ssl/analyze`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({bundle_method:s(c[`bundle-method`],`bundle-method`,`text`),certificate:s(c.certificate,`certificate`,`text`)}):a(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=a(c.body);n(await i(`Creating`,async()=>l.ssl.analyze.create({...e,zone_id:u})),{successLabel:`Created`});return}let d=o({bundle_method:s(c[`bundle-method`],`bundle-method`,`text`),certificate:s(c.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>l.ssl.analyze.create({...d,zone_id:u})),{successLabel:`Created`})}},p={command:`analyze`,describe:`Operations for analyze`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`enabled`,{type:`boolean`,description:`Controls enablement of Auto-Origin TLS KEX selection for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Auto-Origin TLS KEX selection.`})}const h={command:`edit`,describe:'Enable or disable Auto-Origin TLS KEX selection for the zone by sending `{"enabled": true}` or `{"enabled": false}`. When enabled, Cloudflare runs a periodic scan of the zone\'s origins to determine the preferred key-exchange algorithm and writes that preference to the edge so it is sent first in the TLS ClientHello to the origin.',builder:m,handler:async s=>{if(s.dryRun){r({command:`cf ssl auto-origin-tls-kex edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/settings/auto_origin_tls_kex`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.ssl.autoOriginTlsKex.edit({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({enabled:s.enabled});n(await i(`Updating`,async()=>c.ssl.autoOriginTlsKex.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:"When enabled, Cloudflare automatically selects the preferred TLS key-exchange algorithm to use when establishing the TLS connection to the zone's origin, picking from the algorithms permitted by the zone's `origin_tls_compliance_modes` setting. When disabled, the default key-exchange ordering is used.",builder:g,handler:async a=>{if(a.dryRun){r({command:`cf ssl auto-origin-tls-kex get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/auto_origin_tls_kex`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.autoOriginTlsKex.get({zone_id:s})),{successLabel:`Loaded`})}},v={command:`auto-origin-tls-kex`,describe:`Operations for auto-origin-tls-kex`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`If the system is enabled, the response will include next_scheduled_scan, representing the next time this zone will be scanned and the zone's ssl/tls encryption mode is potentially upgraded by the system. If the system is disabled, next_scheduled_scan will not be present in the response body.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf ssl automatic-upgrader get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.automaticUpgrader.get({zone_id:s})),{successLabel:`Loaded`})}};function x(e){return e.option(`value`,{type:`string`,description:`Controls enablement of Automatic SSL/TLS.`,choices:[`auto`,`custom`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Automatic SSL/TLS.`})}const S={command:`patch`,describe:`The automatic system is enabled when this endpoint is hit with value in the request body is set to "auto", and disabled when the request body value is set to "custom".`,builder:x,handler:async l=>{if(l.dryRun){r({command:`cf ssl automatic-upgrader patch`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.ssl.automaticUpgrader.patch({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Controls enablement of Automatic SSL/TLS.`,[`auto`,`custom`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.ssl.automaticUpgrader.patch({...f,zone_id:d})),{successLabel:`Updated`})}},C={command:`automatic-upgrader`,describe:`SSL automatic mode enrollment — get or update automatic SSL/TLS upgrader settings`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`certificate-authority`,{type:`string`,description:`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`hosts`,{type:`string`,array:!0,description:`Comma separated list of valid host names for the certificate packs. Must contain the zone apex, may not contain more than 50 hosts, and may not be empty.`}).option(`type`,{type:`string`,description:`Type of certificate pack.`,choices:[`advanced`]}).option(`validation-method`,{type:`string`,description:`Validation Method selected for the order.`,choices:[`txt`,`http`,`email`]}).option(`validity-days`,{type:`number`,description:`Validity Days selected for the order.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`For a given zone, order an advanced certificate pack.`,builder:w,handler:async l=>{if(l.dryRun){r({command:`cf ssl certificate-packs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/ssl/certificate_packs/order`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({certificate_authority:s(l[`certificate-authority`],`certificate-authority`,`text`),cloudflare_branding:l[`cloudflare-branding`],hosts:l.hosts,type:s(l.type,`type`,`text`),validation_method:s(l[`validation-method`],`validation-method`,`text`),validity_days:l[`validity-days`]}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.ssl.certificatePacks.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l[`certificate-authority`]===void 0&&(l[`certificate-authority`]=await c(`certificate-authority`,`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,[`google`,`lets_encrypt`,`ssl_com`])),l.hosts===void 0)throw Error(`--hosts is required (or pass --body with this field set).`);if(l.type===void 0&&(l.type=await c(`type`,`Type of certificate pack.`,[`advanced`])),l[`validation-method`]===void 0&&(l[`validation-method`]=await c(`validation-method`,`Validation Method selected for the order.`,[`txt`,`http`,`email`])),l[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=o({certificate_authority:s(l[`certificate-authority`],`certificate-authority`,`text`),cloudflare_branding:l[`cloudflare-branding`],hosts:l.hosts,type:s(l.type,`type`,`text`),validation_method:s(l[`validation-method`],`validation-method`,`text`),validity_days:l[`validity-days`]});n(await i(`Creating`,async()=>u.ssl.certificatePacks.create({...f,zone_id:d})),{successLabel:`Created`})}};function E(e){return e.positional(`certificate-pack-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 D={command:`delete <certificate-pack-id>`,describe:`For a given zone, delete an advanced certificate pack.`,builder:E,handler:async a=>{if(a.dryRun){r({command:`cf ssl certificate-packs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ssl/certificate_packs/${a[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(a[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(a[`certificate-pack-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
2
|
+
import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{i as c,n as l}from"./prompt-CDtLWxNv.mjs";import{t as u}from"./cli-types-BWdZbsFE.mjs";function d(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate.`,builder:d,handler:async c=>{if(c.dryRun){r({command:`cf ssl analyze create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ssl/analyze`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({bundle_method:s(c[`bundle-method`],`bundle-method`,`text`),certificate:s(c.certificate,`certificate`,`text`)}):a(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=a(c.body);n(await i(`Creating`,async()=>l.ssl.analyze.create({...e,zone_id:u})),{successLabel:`Created`});return}let d=o({bundle_method:s(c[`bundle-method`],`bundle-method`,`text`),certificate:s(c.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>l.ssl.analyze.create({...d,zone_id:u})),{successLabel:`Created`})}},p={command:`analyze`,describe:`Operations for analyze`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`enabled`,{type:`boolean`,description:`Controls enablement of Auto-Origin TLS KEX selection for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Auto-Origin TLS KEX selection.`})}const h={command:`edit`,describe:'Enable or disable Auto-Origin TLS KEX selection for the zone by sending `{"enabled": true}` or `{"enabled": false}`. When enabled, Cloudflare runs a periodic scan of the zone\'s origins to determine the preferred key-exchange algorithm and writes that preference to the edge so it is sent first in the TLS ClientHello to the origin.',builder:m,handler:async s=>{if(s.dryRun){r({command:`cf ssl auto-origin-tls-kex edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/settings/auto_origin_tls_kex`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.ssl.autoOriginTlsKex.edit({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({enabled:s.enabled});n(await i(`Updating`,async()=>c.ssl.autoOriginTlsKex.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:"When enabled, Cloudflare automatically selects the preferred TLS key-exchange algorithm to use when establishing the TLS connection to the zone's origin, picking from the algorithms permitted by the zone's `origin_tls_compliance_modes` setting. When disabled, the default key-exchange ordering is used.",builder:g,handler:async a=>{if(a.dryRun){r({command:`cf ssl auto-origin-tls-kex get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/auto_origin_tls_kex`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.autoOriginTlsKex.get({zone_id:s})),{successLabel:`Loaded`})}},v={command:`auto-origin-tls-kex`,describe:`Operations for auto-origin-tls-kex`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`If the system is enabled, the response will include next_scheduled_scan, representing the next time this zone will be scanned and the zone's ssl/tls encryption mode is potentially upgraded by the system. If the system is disabled, next_scheduled_scan will not be present in the response body.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf ssl automatic-upgrader get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.automaticUpgrader.get({zone_id:s})),{successLabel:`Loaded`})}};function x(e){return e.option(`value`,{type:`string`,description:`Controls enablement of Automatic SSL/TLS.`,choices:[`auto`,`custom`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Automatic SSL/TLS.`})}const S={command:`patch`,describe:`The automatic system is enabled when this endpoint is hit with value in the request body is set to "auto", and disabled when the request body value is set to "custom".`,builder:x,handler:async l=>{if(l.dryRun){r({command:`cf ssl automatic-upgrader patch`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/ssl_automatic_mode`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.ssl.automaticUpgrader.patch({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Controls enablement of Automatic SSL/TLS.`,[`auto`,`custom`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.ssl.automaticUpgrader.patch({...f,zone_id:d})),{successLabel:`Updated`})}},C={command:`automatic-upgrader`,describe:`SSL automatic mode enrollment — get or update automatic SSL/TLS upgrader settings`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`certificate-authority`,{type:`string`,description:`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`hosts`,{type:`string`,array:!0,description:`Comma separated list of valid host names for the certificate packs. Must contain the zone apex, may not contain more than 50 hosts, and may not be empty.`}).option(`type`,{type:`string`,description:`Type of certificate pack.`,choices:[`advanced`]}).option(`validation-method`,{type:`string`,description:`Validation Method selected for the order.`,choices:[`txt`,`http`,`email`]}).option(`validity-days`,{type:`number`,description:`Validity Days selected for the order.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`For a given zone, order an advanced certificate pack.`,builder:w,handler:async l=>{if(l.dryRun){r({command:`cf ssl certificate-packs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/ssl/certificate_packs/order`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({certificate_authority:s(l[`certificate-authority`],`certificate-authority`,`text`),cloudflare_branding:l[`cloudflare-branding`],hosts:l.hosts,type:s(l.type,`type`,`text`),validation_method:s(l[`validation-method`],`validation-method`,`text`),validity_days:l[`validity-days`]}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.ssl.certificatePacks.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l[`certificate-authority`]===void 0&&(l[`certificate-authority`]=await c(`certificate-authority`,`Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details](https://developers.cloudflare.com/ssl/reference/certificate-authorities).`,[`google`,`lets_encrypt`,`ssl_com`])),l.hosts===void 0)throw Error(`--hosts is required (or pass --body with this field set).`);if(l.type===void 0&&(l.type=await c(`type`,`Type of certificate pack.`,[`advanced`])),l[`validation-method`]===void 0&&(l[`validation-method`]=await c(`validation-method`,`Validation Method selected for the order.`,[`txt`,`http`,`email`])),l[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=o({certificate_authority:s(l[`certificate-authority`],`certificate-authority`,`text`),cloudflare_branding:l[`cloudflare-branding`],hosts:l.hosts,type:s(l.type,`type`,`text`),validation_method:s(l[`validation-method`],`validation-method`,`text`),validity_days:l[`validity-days`]});n(await i(`Creating`,async()=>u.ssl.certificatePacks.create({...f,zone_id:d})),{successLabel:`Created`})}};function E(e){return e.positional(`certificate-pack-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 D={command:`delete <certificate-pack-id>`,describe:`For a given zone, delete an advanced certificate pack.`,builder:E,handler:async a=>{if(a.dryRun){r({command:`cf ssl certificate-packs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ssl/certificate_packs/${a[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(a[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(a[`certificate-pack-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.ssl.certificatePacks.delete({zone_id:s,certificate_pack_id:a[`certificate-pack-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`edit <certificate-pack-id>`,describe:`For a given zone, restart validation or add cloudflare branding for an advanced certificate pack. The former is only a validation operation for a Certificate Pack in a validation_timed_out status.`,builder:O,handler:async s=>{if(s.dryRun){r({command:`cf ssl certificate-packs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ssl/certificate_packs/${s[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(s[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(s[`certificate-pack-id`]??``),"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({cloudflare_branding:s[`cloudflare-branding`]}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.ssl.certificatePacks.edit({...e,zone_id:l,certificate_pack_id:s[`certificate-pack-id`]})),{successLabel:`Updated`});return}let u=o({cloudflare_branding:s[`cloudflare-branding`]});n(await i(`Updating`,async()=>c.ssl.certificatePacks.edit({...u,zone_id:l,certificate_pack_id:s[`certificate-pack-id`]})),{successLabel:`Updated`})}};function A(e){return e.positional(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <certificate-pack-id>`,describe:`For a given zone, get a certificate pack.`,builder:A,handler:async a=>{if(a.dryRun){r({command:`cf ssl certificate-packs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ssl/certificate_packs/${a[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(a[`certificate-pack-id`]))}`,pathParams:{"certificate-pack-id":String(a[`certificate-pack-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.certificatePacks.get({zone_id:s,certificate_pack_id:a[`certificate-pack-id`]})),{successLabel:`Loaded`})}};function M(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of certificate packs per page.`}).option(`status`,{type:`string`,description:`Include Certificate Packs of all statuses, not just active ones.`,choices:[`all`]}).option(`deploy`,{type:`string`,description:`Specify the deployment environment for the certificate packs.`,choices:[`staging`,`production`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`For a given zone, list all active certificate packs.`,builder:u(M),handler:async a=>{let o={page:a.page,per_page:a[`per-page`],status:a.status,deploy:a.deploy};if(a.dryRun){r({command:`cf ssl certificate-packs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ssl/certificate_packs`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.ssl.certificatePacks.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`For a given zone, list certificate pack quotas.`,builder:P,handler:async a=>{if(a.dryRun){r({command:`cf ssl certificate-packs quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ssl/certificate_packs/quota`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.certificatePacks.quota.get({zone_id:s})),{successLabel:`Loaded`})}},I={command:`quota`,describe:`Operations for certificate-packs.quota`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`certificate-packs`,describe:`Operations for certificate-packs`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};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:`Retrieve the SSL/TLS Recommender's recommendation for a zone.`,builder:R,handler:async a=>{if(a.dryRun){r({command:`cf ssl recommendations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ssl/recommendation`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ssl.recommendations.get({zone_id:s})),{successLabel:`Loaded`})}},B={command:`recommendations`,describe:`Get the recommended SSL/TLS encryption mode based on your origin server's certificate configuration`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`enabled`,{type:`boolean`,description:`Disabling Universal SSL removes any currently active Universal SSL certificates for your zone from the edge and prevents any future Universal SSL certificates from being ordered. If there are no advanced certificates or custom certificates uploaded for the domain, visitors will be unable to access the domain over HTTPS.
|
|
4
4
|
|
|
5
5
|
By disabling Universal SSL, you understand that the following Cloudflare settings and preferences will result in visitors being unable to visit your domain unless you have uploaded a custom certificate or purchased an advanced certificate.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t}from"./cf-
|
|
2
|
+
import{i as e,r as t}from"./cf-oSz9pud_.mjs";import{join as n}from"node:path";const r=t(()=>n(e(),`state.json`));function i(){return r.read()??{}}function a(e){r.write({...i(),...e})}export{i as readState,a as updateState};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{a as r,r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,r as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,n as m}from"./prompt-CDtLWxNv.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import{n as g,t as _}from"./raw-fetch-Dz-QBoP_.mjs";function ee(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`label`,{type:`string`,description:`A string to uniquely identify the track amongst other audio track labels for the specified video.`}).option(`url`,{type:`string`,description:"An audio track URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`copy <identifier>`,describe:`Adds an additional audio track to a video using the provided audio track URL.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks copy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio/copy`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?u({label:d(r.label,`label`,`text`),url:d(r.url,`url`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.stream.audioTracks.copy({...e,account_id:f,identifier:r.identifier})),{successLabel:`Created`});return}r.label===void 0&&(r.label=await p(`label`,`A string to uniquely identify the track amongst other audio track labels for the specified video.`));let m=u({label:d(r.label,`label`,`text`),url:d(r.url,`url`,`text`)});a(await s(`Creating`,async()=>l.stream.audioTracks.copy({...m,account_id:f,identifier:r.identifier})),{successLabel:`Created`})}};function v(e){return e.positional(`audio-identifier`,{type:`string`,description:`The unique identifier for an additional audio track.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media 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 y={command:`delete <audio-identifier>`,describe:`Deletes additional audio tracks on a video. Deleting a default audio track is not allowed. You must assign another audio track as default prior to deletion.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio/${r[`audio-identifier`]==null?`<audio-identifier>`:encodeURIComponent(String(r[`audio-identifier`]))}`,pathParams:{identifier:String(r.identifier??``),"audio-identifier":String(r[`audio-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.stream.audioTracks.delete({account_id:l,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`audio-identifier`,{type:`string`,description:`The unique identifier for an additional audio track.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`default`,{type:`boolean`,description:`Denotes whether the audio track will be played by default in a player.`}).option(`label`,{type:`string`,description:`A string to uniquely identify the track amongst other audio track labels for the specified video.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`edit <audio-identifier>`,describe:"Edits additional audio tracks on a video. Editing the default status of an audio track to `true` will mark all other audio tracks on the video default status to `false`.",builder:b,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio/${r[`audio-identifier`]==null?`<audio-identifier>`:encodeURIComponent(String(r[`audio-identifier`]))}`,pathParams:{identifier:String(r.identifier??``),"audio-identifier":String(r[`audio-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({default:r.default,label:d(r.label,`label`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.stream.audioTracks.edit({...e,account_id:f,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Updated`});return}let p=u({default:r.default,label:d(r.label,`label`,`text`)});a(await s(`Updating`,async()=>l.stream.audioTracks.edit({...p,account_id:f,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Updated`})}};function S(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <identifier>`,describe:`Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.audioTracks.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}},w={command:`audio-tracks`,describe:`Add, edit, or remove additional audio tracks on a video`,builder:e=>e.command(te).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <identifier>`,describe:`Lists the available captions or subtitles for a specific video.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf stream captions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.captions.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}};function D(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`create <language>`,describe:`Generate captions or subtitles for provided language via AI.`,builder:D,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}/generate`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.captions.language.create({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Created`})}};function k(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media 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 A={command:`delete <language>`,describe:`Removes the captions or subtitles from a video.`,builder:k,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>c.stream.captions.language.delete({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Deleted`})}};function j(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <language>`,describe:`Lists the captions or subtitles for provided language.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.captions.language.get({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Loaded`})}};function N(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const P={command:`update <language>`,describe:`Uploads the caption or subtitle file to the endpoint for a specific BCP47 language. One caption or subtitle file per language is allowed.`,builder:N,handler:async c=>{if(c.dryRun){o({command:`cf stream captions language update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}/captions/${c.language==null?`<language>`:encodeURIComponent(String(c.language))}`,pathParams:{language:String(c.language??``),identifier:String(c.identifier??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await i(c),u=c.local?e:await t();if(c.accountId=u,c.file!==void 0||c.body!==void 0){let e=new FormData;if(c.file){let t=f(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);a(await s(`Updating`,async()=>r(l,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(c.identifier))}/captions/${encodeURIComponent(String(c.language))}`,{body:e})),{successLabel:`Updated`});return}if(c.body){let e=d(c.body,`body`,`binary`);a(await s(`Updating`,async()=>r(l,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(c.identifier))}/captions/${encodeURIComponent(String(c.language))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function F(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <language>`,describe:`Return WebVTT captions for a provided language.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language vtt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}/vtt`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a,g((await s(`Loading`,async()=>_(`/accounts/${a}/stream/${encodeURIComponent(String(r.identifier))}/captions/${encodeURIComponent(String(r.language))}/vtt`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}},L={command:`vtt`,describe:`Operations for captions.language.vtt`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`language`,describe:`Operations for captions.language`,builder:e=>e.command(O).command(A).command(M).command(P).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`captions`,describe:`Upload, generate, or retrieve captions and subtitles for videos in multiple languages`,builder:e=>e.command(E).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin."}).option(`clipped-from-video-uid`,{type:`string`,description:`The unique video identifier (UID).`}).option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`end-time-seconds`,{type:`number`,description:`Specifies the end time for the video clip in seconds.`}).option(`input`,{type:`string`,description:`A video's URL. Preferred over 'url'.`}).option(`name`,{type:`string`,description:`A name for the video.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video.",default:!1}).option(`scheduled-deletion`,{type:`string`,description:"Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time."}).option(`start-time-seconds`,{type:`number`,description:`Specifies the start time for the video clip in seconds.`}).option(`thumbnail-timestamp-pct`,{type:`number`,description:`The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video.`,default:0}).option(`url`,{type:`string`,description:`A video's URL (legacy field, use 'input' instead).`}).option(`watermark-uid`,{type:`string`,description:`The unique identifier for the watermark profile.`}).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:`Clips a video based on the specified start and end times provided in seconds.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf stream clip create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/clip`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:d(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:d(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:d(r.input,`input`,`text`),name:d(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:d(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:d(r.url,`url`,`text`),watermark:{uid:d(r[`watermark-uid`],`watermark-uid`,`text`)}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.stream.clip.create({...e,account_id:f})),{successLabel:`Created`});return}if(r[`clipped-from-video-uid`]===void 0&&(r[`clipped-from-video-uid`]=await p(`clipped-from-video-uid`,`The unique video identifier (UID).`)),r[`end-time-seconds`]===void 0)throw Error(`--end-time-seconds is required (or pass --body with this field set).`);if(r[`start-time-seconds`]===void 0)throw Error(`--start-time-seconds is required (or pass --body with this field set).`);let m=u({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:d(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:d(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:d(r.input,`input`,`text`),name:d(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:d(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:d(r.url,`url`,`text`),watermark:{uid:d(r[`watermark-uid`],`watermark-uid`,`text`)}});a(await s(`Creating`,async()=>l.stream.clip.create({...m,account_id:f})),{successLabel:`Created`})}},H={command:`clip`,describe:`Create a new video clip from an existing video by specifying start and end times`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`upload-creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin."}).option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`input`,{type:`string`,description:"A video's URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file. This is the preferred field over `url`."}).option(`name`,{type:`string`,description:`A video's name. Used for legacy compatibility.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video.",default:!1}).option(`scheduled-deletion`,{type:`string`,description:"Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time."}).option(`thumbnail-timestamp-pct`,{type:`number`,description:`The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video.`,default:0}).option(`url`,{type:`string`,description:"A video's URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file. This field is deprecated in favor of `input`."}).option(`watermark-uid`,{type:`string`,description:`The unique identifier for the watermark profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Copy upload request. Provide `input` (preferred) or `url` (deprecated)."})}const W={command:`create`,describe:`Uploads a video to Stream from a provided URL.`,builder:U,handler:async f=>{let p={};if(f[`upload-creator`]!==void 0&&(p[`Upload-Creator`]=String(f[`upload-creator`])),f.dryRun){o({command:`cf stream copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/copy`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({allowedOrigins:f[`allowed-origins`],creator:d(f.creator,`creator`,`text`),input:d(f.input,`input`,`text`),name:d(f.name,`name`,`text`),requireSignedURLs:f[`require-signed-urls`],scheduledDeletion:d(f[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:f[`thumbnail-timestamp-pct`],url:d(f.url,`url`,`text`),watermark:{uid:d(f[`watermark-uid`],`watermark-uid`,`text`)}}):c(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}let g={};f[`allowed-origins`]!==void 0&&l(g,[`allowedOrigins`],f[`allowed-origins`]),f.creator!==void 0&&l(g,[`creator`],d(f.creator,`creator`,`text`)),f.input!==void 0&&l(g,[`input`],d(f.input,`input`,`text`)),f.name!==void 0&&l(g,[`name`],d(f.name,`name`,`text`)),f[`require-signed-urls`]!==void 0&&l(g,[`requireSignedURLs`],f[`require-signed-urls`]),f[`scheduled-deletion`]!==void 0&&l(g,[`scheduledDeletion`],d(f[`scheduled-deletion`],`scheduled-deletion`,`text`)),f[`thumbnail-timestamp-pct`]!==void 0&&l(g,[`thumbnailTimestampPct`],f[`thumbnail-timestamp-pct`]),f.url!==void 0&&l(g,[`url`],d(f.url,`url`,`text`)),f[`watermark-uid`]!==void 0&&l(g,[`watermark`,`uid`],d(f[`watermark-uid`],`watermark-uid`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}},G={command:`copy`,describe:`Import a video from a URL into Stream for processing and delivery`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`direct-user`,{type:`boolean`,description:`Provisions a URL to let your end users upload videos directly to Cloudflare Stream without exposing your API token to clients.`}).option(`tus-resumable`,{type:`string`,description:`Specifies the TUS protocol version. This value must be included in every upload request.
|
|
5
5
|
Notes: The only supported version of TUS protocol is 1.0.0.`,demandOption:!0}).option(`upload-creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`upload-length`,{type:`string`,description:`Indicates the size of the entire upload in bytes. The value must be a non-negative integer.`,demandOption:!0}).option(`upload-metadata`,{type:`string`,description:"Comma-separated key-value pairs following the TUS protocol specification. Values are Base-64 encoded.\nSupported keys: `name`, `requiresignedurls`, `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`, `maxdurationseconds`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`create`,describe:"Initiates a video upload using the TUS protocol. On success, the server responds with a status code 201 (created) and includes a `location` header to indicate where the content should be uploaded. Refer to https://tus.io for protocol details.",builder:K,handler:async c=>{let l={direct_user:c[`direct-user`]},u={};if(c[`tus-resumable`]!==void 0&&(u[`Tus-Resumable`]=String(c[`tus-resumable`])),c[`upload-creator`]!==void 0&&(u[`Upload-Creator`]=String(c[`upload-creator`])),c[`upload-length`]!==void 0&&(u[`Upload-Length`]=String(c[`upload-length`])),c[`upload-metadata`]!==void 0&&(u[`Upload-Metadata`]=String(c[`upload-metadata`])),c.dryRun){o({command:`cf stream create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream`,pathParams:{},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/stream`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}};function J(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media 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 Y={command:`delete <identifier>`,describe:`Deletes a video and its copies from Cloudflare Stream.`,builder:J,handler:async r=>{if(r.dryRun){o({command:`cf stream delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`create`,describe:`Return new URL submissions`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf submit create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/submit`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.submit.create({account_id:l})),{successLabel:`Created`})}},l={command:`submit`,describe:`submit`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{t as s}from"./cli-types-BWdZbsFE.mjs";function c(e){return e.option(`type`,{type:`string`,description:`Filter by resource type. Can be repeated to filter by multiple types (OR logic). Example: ?type=zone&type=worker`}).option(`name`,{type:`string`,description:`Filter by resource name. Performs a case-insensitive substring match. Example: ?name=my-zone`}).option(`id`,{type:`string`,description:`Filter by resource ID. Can be repeated up to 50 times to filter by multiple IDs. Example: ?id=abc&id=def`}).option(`case-insensitive`,{type:`boolean`,description:"Match `tag` keys and values case-insensitively. Stored casing is unchanged. Example: ?tag=environment=production&case_insensitive=true"}).option(`tag`,{type:`string`,description:"Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.\n\nSupported syntax:\n- **Key-only**: `tag=<key>` - Resource must have the tag key (e.g., `tag=production`)\n- **Key-value**: `tag=<key>=<value>` - Resource must have the tag with specific value (e.g., `tag=env=prod`)\n- **Multiple values (OR)**: `tag=<key>=<v1>,<v2>` - Resource must have tag with any of the values (e.g., `tag=env=prod,staging`)\n- **Negate key-only**: `tag=!<key>` - Resource must not have the tag key (e.g., `tag=!archived`)\n- **Negate key-value**: `tag=<key>!=<value>` - Resource must not have the tag with specific value (e.g., `tag=region!=us-west-1`)\n\nMultiple tag parameters are combined with AND logic."}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`list`,describe:`Lists all tagged resources for an account.`,builder:s(c),handler:async s=>{let c={type:s.type,name:s.name,id:s.id,case_insensitive:s[`case-insensitive`],tag:s.tag,cursor:s.cursor};if(s.dryRun){a({command:`cf tags resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/resources`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.tags.resources.list({account_id:u,...c})),{successLabel:`Loaded`})}},u={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`tags`,describe:`tags`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";function i(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`List of account types available for the Tenant to provision accounts.`,builder:i,handler:async i=>{if(i.dryRun){n({command:`cf tenant account-type list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/account_types`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.accountType.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},o={command:`account-type`,describe:`Operations for account-type`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function s(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`List of accounts for the Tenant.`,builder:s,handler:async i=>{if(i.dryRun){n({command:`cf tenant account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/accounts`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.account.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},l={command:`account`,describe:`Operations for account`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`List of innate entitlements available for the Tenant.`,builder:u,handler:async i=>{if(i.dryRun){n({command:`cf tenant entitlement list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/entitlements`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.entitlement.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},f={command:`entitlement`,describe:`Operations for entitlement`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.positional(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <tenant-id>`,describe:`Retrieves a Tenant by Tenant ID.`,builder:p,handler:async i=>{if(i.dryRun){n({command:`cf tenant get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.get({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List of active members (Cloudflare users) for the Tenant.`,builder:h,handler:async i=>{if(i.dryRun){n({command:`cf tenant membership list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/memberships`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.membership.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},_={command:`membership`,describe:`Operations for membership`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`tenant`,describe:`tenant`,builder:e=>e.command(m).command(l).command(o).command(f).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|
package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-BPHUeckw.mjs}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";import{n as i,t as a}from"./body-parser-CYD7PKFC.mjs";import{n as o}from"./input-validation-BBKJRoRB.mjs";import{a as s,n as c}from"./prompt-CDtLWxNv.mjs";function l(e){return e.positional(`tenant-tag`,{type:`string`,description:`Tenant identifier tag.`,demandOption:!0}).option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,default:1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`create <tenant-tag>`,describe:`Adds a custom nameserver for a tenant.`,builder:l,handler:async c=>{if(c.dryRun){n({command:`cf tenant-custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/tenants/${c[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(c[`tenant-tag`]))}/custom_ns`,pathParams:{"tenant-tag":String(c[`tenant-tag`]??``)},bodyKind:`json`,body:c.body===void 0?a({ns_name:o(c[`ns-name`],`ns-name`,`text`),ns_set:c[`ns-set`]}):i(c.body)});return}let l=await e(c);if(c.body){let e=i(c.body);t(await r(`Creating`,async()=>l.tenantCustomNameservers.create({body:e,tenant_tag:c[`tenant-tag`]})),{successLabel:`Created`});return}c[`ns-name`]===void 0&&(c[`ns-name`]=await s(`ns-name`,`The FQDN of the name server.`));let u=a({ns_name:o(c[`ns-name`],`ns-name`,`text`),ns_set:c[`ns-set`]});t(await r(`Creating`,async()=>l.tenantCustomNameservers.create({body:u,tenant_tag:c[`tenant-tag`]})),{successLabel:`Created`})}};function d(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,demandOption:!0}).option(`tenant-tag`,{type:`string`,description:`Tenant identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <custom-ns-id>`,describe:`Deletes a tenant's custom nameserver.`,builder:d,handler:async i=>{if(i.dryRun){n({command:`cf tenant-custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(i[`tenant-tag`]))}/custom_ns/${i[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(i[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(i[`custom-ns-id`]??``),"tenant-tag":String(i[`tenant-tag`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await c({force:!!i.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}t(await r(`Deleting`,async()=>a.tenantCustomNameservers.delete({tenant_tag:i[`tenant-tag`],custom_ns_id:i[`custom-ns-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`tenant-tag`,{type:`string`,description:`Tenant identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <tenant-tag>`,describe:`Lists a tenant's custom nameservers.`,builder:p,handler:async i=>{if(i.dryRun){n({command:`cf tenant-custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(i[`tenant-tag`]))}/custom_ns`,pathParams:{"tenant-tag":String(i[`tenant-tag`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenantCustomNameservers.get({tenant_tag:i[`tenant-tag`]})),{successLabel:`Loaded`})}},h={command:`tenant-custom-nameservers`,describe:`tenant-custom-nameservers`,builder:e=>e.command(u).command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as e,o as t}from"./theme-BePJemMn.mjs";import"./ui-
|
|
2
|
+
import{a as e,o as t}from"./theme-BePJemMn.mjs";import"./ui-DIpjthrV.mjs";import{f as n}from"./oauth-BPizUUqP.mjs";import{c as r}from"./interactive-mV8PABm6.mjs";import{i}from"./auth-DuLchM18.mjs";import{a,i as o,n as s}from"./build-Dji9BYmV.mjs";import{a as c,l,r as u,s as d}from"./deploy-input-DhCo1I0I.mjs";function f(e){return e.option(`mode`,{type:`string`,alias:`m`,description:`Build mode (e.g. production, staging, preview)`}).option(`dry-run`,{type:`boolean`,description:`Build a project and run checks without applying triggers`,default:!1})}const p={command:`deploy`,describe:`Apply triggers (Routes, Workflows, Cron triggers etc.)`,builder:f,handler:async f=>{await s(f.mode),r.message(``,{spacing:0});let{workers:{default:p},settings:m}=await a(process.cwd()),{wranglerConfig:h}=o(p,m),g=await i(),_=await n();l(c(g)),r.message(e.bold(`Deploy triggers`),{symbol:t.dim(`├`),spacing:0}),await d(u(p,h,_,f)),r.success(f[`dry-run`]?`Dry run complete`:`Trigger deploy complete`)}},m={command:`triggers`,describe:`Manage triggers (Routes, Workflows, Cron triggers etc.)`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-CDtLWxNv.mjs";import{t as f}from"./cli-types-BWdZbsFE.mjs";function p(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <tunnel-id>`,describe:`Retrieves the configuration for a remotely managed Cloudflare Tunnel.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf tunnel config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.config.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function h(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-origin-request-access-aud-tag`,{type:`string`,array:!0,description:`Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API.`}).option(`config-origin-request-access-required`,{type:`boolean`,description:`Deny traffic that has not fulfilled Access authorization.`}).option(`config-origin-request-access-team-name`,{type:`string`,description:`The config.originRequest.access.teamName field`}).option(`config-origin-request-ca-pool`,{type:`string`,description:`Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare.`}).option(`config-origin-request-connect-timeout`,{type:`number`,description:`Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout.`}).option(`config-origin-request-disable-chunked-encoding`,{type:`boolean`,description:`Disables chunked transfer encoding. Useful if you are running a WSGI server.`}).option(`config-origin-request-http2origin`,{type:`boolean`,description:`Attempt to connect to origin using HTTP2. Origin must be configured as https.`}).option(`config-origin-request-http-host-header`,{type:`string`,description:`Sets the HTTP Host header on requests sent to the local service.`}).option(`config-origin-request-keep-alive-connections`,{type:`number`,description:`Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections.`}).option(`config-origin-request-keep-alive-timeout`,{type:`number`,description:`Timeout after which an idle keepalive connection can be discarded.`}).option(`config-origin-request-match-snito-host`,{type:`boolean`,description:`Auto configure the Hostname on the origin server certificate.`}).option(`config-origin-request-no-happy-eyeballs`,{type:`boolean`,description:`Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols.`}).option(`config-origin-request-no-tlsverify`,{type:`boolean`,description:`Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted.`}).option(`config-origin-request-origin-server-name`,{type:`string`,description:`Hostname that cloudflared should expect from your origin server certificate.`}).option(`config-origin-request-proxy-type`,{type:`string`,description:`cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy.
|
|
3
3
|
`}).option(`config-origin-request-tcp-keep-alive`,{type:`number`,description:`The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server.`}).option(`config-origin-request-tls-timeout`,{type:`number`,description:`Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server.`}).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)`}).check(e=>{if([`config-origin-request-access-aud-tag`,`config-origin-request-access-required`,`config-origin-request-access-team-name`,`config-origin-request-ca-pool`,`config-origin-request-connect-timeout`,`config-origin-request-disable-chunked-encoding`,`config-origin-request-http2origin`,`config-origin-request-http-host-header`,`config-origin-request-keep-alive-connections`,`config-origin-request-keep-alive-timeout`,`config-origin-request-match-snito-host`,`config-origin-request-no-happy-eyeballs`,`config-origin-request-no-tlsverify`,`config-origin-request-origin-server-name`,`config-origin-request-proxy-type`,`config-origin-request-tcp-keep-alive`,`config-origin-request-tls-timeout`].some(t=>e[t]!==void 0)){let t=[`config-origin-request-access-aud-tag`,`config-origin-request-access-team-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0})}const g={command:`update <tunnel-id>`,describe:`Replaces the configuration for a remotely managed Cloudflare Tunnel, including its ingress rules and origin request settings.`,builder:h,handler:async u=>{if(u.dryRun){a({command:`cf tunnel config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({config:{originRequest:{access:{audTag:u[`config-origin-request-access-aud-tag`],required:u[`config-origin-request-access-required`],teamName:l(u[`config-origin-request-access-team-name`],`config-origin-request-access-team-name`,`text`)},caPool:l(u[`config-origin-request-ca-pool`],`config-origin-request-ca-pool`,`text`),connectTimeout:u[`config-origin-request-connect-timeout`],disableChunkedEncoding:u[`config-origin-request-disable-chunked-encoding`],http2Origin:u[`config-origin-request-http2origin`],httpHostHeader:l(u[`config-origin-request-http-host-header`],`config-origin-request-http-host-header`,`text`),keepAliveConnections:u[`config-origin-request-keep-alive-connections`],keepAliveTimeout:u[`config-origin-request-keep-alive-timeout`],matchSNItoHost:u[`config-origin-request-match-snito-host`],noHappyEyeballs:u[`config-origin-request-no-happy-eyeballs`],noTLSVerify:u[`config-origin-request-no-tlsverify`],originServerName:l(u[`config-origin-request-origin-server-name`],`config-origin-request-origin-server-name`,`text`),proxyType:l(u[`config-origin-request-proxy-type`],`config-origin-request-proxy-type`,`text`),tcpKeepAlive:u[`config-origin-request-tcp-keep-alive`],tlsTimeout:u[`config-origin-request-tls-timeout`]}}}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.tunnel.config.update({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({config:{originRequest:{access:{audTag:u[`config-origin-request-access-aud-tag`],required:u[`config-origin-request-access-required`],teamName:l(u[`config-origin-request-access-team-name`],`config-origin-request-access-team-name`,`text`)},caPool:l(u[`config-origin-request-ca-pool`],`config-origin-request-ca-pool`,`text`),connectTimeout:u[`config-origin-request-connect-timeout`],disableChunkedEncoding:u[`config-origin-request-disable-chunked-encoding`],http2Origin:u[`config-origin-request-http2origin`],httpHostHeader:l(u[`config-origin-request-http-host-header`],`config-origin-request-http-host-header`,`text`),keepAliveConnections:u[`config-origin-request-keep-alive-connections`],keepAliveTimeout:u[`config-origin-request-keep-alive-timeout`],matchSNItoHost:u[`config-origin-request-match-snito-host`],noHappyEyeballs:u[`config-origin-request-no-happy-eyeballs`],noTLSVerify:u[`config-origin-request-no-tlsverify`],originServerName:l(u[`config-origin-request-origin-server-name`],`config-origin-request-origin-server-name`,`text`),proxyType:l(u[`config-origin-request-proxy-type`],`config-origin-request-proxy-type`,`text`),tcpKeepAlive:u[`config-origin-request-tcp-keep-alive`],tlsTimeout:u[`config-origin-request-tls-timeout`]}}});i(await o(`Updating`,async()=>d.tunnel.config.update({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}},_={command:`config`,describe:`Operations for config`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`client-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`cleanup <tunnel-id>`,describe:`Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel independently of its current state. If no connector id (client_id) is provided all connectors will be removed. We recommend running this command after rotating tokens.`,builder:v,handler:async s=>{let c={client_id:s[`client-id`]};if(s.dryRun){a({command:`cf tunnel connections cleanup`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();if(s.accountId=u,!await d({force:!!s.force,message:`This operation removes Cloudflare Tunnel connections.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>l.tunnel.connections.cleanup({account_id:u,tunnel_id:s[`tunnel-id`],...c})),{successLabel:`Deleted`})}};function b(e){return e.option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists the connections for a Cloudflare Tunnel, including connector IDs, cloudflared versions, and Cloudflare locations.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf tunnel connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.connections.list({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},S={command:`connections`,describe:`Operations for connections`,builder:e=>e.command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <connector-id>`,describe:`Retrieves a connector and its connection details for a Cloudflare Tunnel, including its cloudflared version, architecture, and connected Cloudflare locations.`,builder:C,handler:async s=>{if(s.dryRun){a({command:`cf tunnel connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``),"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.connectors.get({account_id:l,tunnel_id:s[`tunnel-id`],connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},T={command:`connectors`,describe:`Operations for connectors`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`config-source`,{type:`string`,description:"Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.",choices:[`local`,`cloudflare`],default:`local`}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Creates a remotely or locally managed Cloudflare Tunnel in an account. After creation, retrieve its token and run cloudflared to establish the connector connection.`,builder:E,handler:async d=>{if(d.dryRun){a({command:`cf tunnel create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({config_src:l(d[`config-source`],`config-source`,`text`),name:l(d.name,`name`,`text`),tunnel_secret:l(d[`tunnel-secret`],`tunnel-secret`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.tunnel.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for a tunnel.`));let m=c({config_src:l(d[`config-source`],`config-source`,`text`),name:l(d.name,`name`,`text`),tunnel_secret:l(d[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Creating`,async()=>f.tunnel.create({...m,account_id:p})),{successLabel:`Created`})}};function O(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,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 k={command:`delete <tunnel-id>`,describe:`Permanently deletes a Cloudflare Tunnel from an account. The tunnel must have no active connections.`,builder:O,handler:async s=>{if(s.dryRun){a({command:`cf tunnel delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation permanently deletes a Cloudflare Tunnel.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>c.tunnel.delete({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Deleted`})}};function A(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).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 <tunnel-id>`,describe:`Updates the name or secret of an existing Cloudflare Tunnel.`,builder:A,handler:async u=>{if(u.dryRun){a({command:`cf tunnel edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.tunnel.edit({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Updating`,async()=>d.tunnel.edit({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}};function M(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <tunnel-id>`,describe:`Fetches a single Cloudflare Tunnel.`,builder:M,handler:async s=>{if(s.dryRun){a({command:`cf tunnel get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function P(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists and filters Cloudflare Tunnels in an account.`,builder:f(P),handler:async s=>{let c={name:s.name,is_deleted:s[`is-deleted`],existed_at:s[`existed-at`],uuid:s.uuid,was_active_at:s[`was-active-at`],was_inactive_at:s[`was-inactive-at`],include_prefix:s[`include-prefix`],exclude_prefix:s[`exclude-prefix`],status:s.status,per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf tunnel list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.tunnel.list({account_id:u,...c})),{successLabel:`Loaded`})}};function I(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`resources`,{type:`string`,array:!0,description:`The resources 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 L={command:`create <tunnel-id>`,describe:`Creates a short-lived management token for the requested Tunnel management resources, such as streaming logs. Treat the token as a secret.`,builder:I,handler:async l=>{if(l.dryRun){a({command:`cf tunnel management token create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${l[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(l[`tunnel-id`]))}/management`,pathParams:{"tunnel-id":String(l[`tunnel-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({resources:l.resources}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.tunnel.management.token.create({...e,account_id:d,tunnel_id:l[`tunnel-id`]})),{successLabel:`Created`});return}if(l.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let f=c({resources:l.resources});i(await o(`Creating`,async()=>u.tunnel.management.token.create({...f,account_id:d,tunnel_id:l[`tunnel-id`]})),{successLabel:`Created`})}},R={command:`token`,describe:`Operations for management.token`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`management`,describe:`Operations for management`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <tunnel-id>`,describe:`Retrieves the token used to run cloudflared and associate it with a specific Cloudflare Tunnel. Treat the token as a secret.`,builder:B,handler:async s=>{if(s.dryRun){a({command:`cf tunnel token get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/token`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.token.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},H={command:`token`,describe:`Operations for token`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`tunnel`,describe:`tunnel`,builder:e=>e.command(D).command(k).command(j).command(N).command(F).command(_).command(S).command(T).command(z).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{t as s}from"./cli-types-BWdZbsFE.mjs";function c(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for the tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`tun-types`,{type:`string`,description:`The types of tunnels to filter by, separated by commas.`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`list`,describe:`Lists and filters all types of Tunnels in an account.`,builder:s(c),handler:async s=>{let c={name:s.name,is_deleted:s[`is-deleted`],existed_at:s[`existed-at`],uuid:s.uuid,was_active_at:s[`was-active-at`],was_inactive_at:s[`was-inactive-at`],include_prefix:s[`include-prefix`],exclude_prefix:s[`exclude-prefix`],tun_types:s[`tun-types`],status:s.status,per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf tunnels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tunnels`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.tunnels.list({account_id:u,...c})),{successLabel:`Loaded`})}},u={command:`tunnels`,describe:`tunnels`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{u as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`order`,{type:`string`,description:`Field to order widgets by.`,choices:[`id`,`sitekey`,`name`,`created_on`,`modified_on`]}).option(`direction`,{type:`string`,description:`Direction to order widgets.`,choices:[`asc`,`desc`]}).option(`filter`,{type:`string`,description:"Filter widgets by field using case-insensitive substring matching.\nFormat: `field:value`\n\nSupported fields:\n- `name` - Filter by widget name (e.g., `filter=name:login-form`)\n- `sitekey` - Filter by sitekey (e.g., `filter=sitekey:0x4AAA`)\n\nReturns 400 Bad Request if the field is unsupported or format is invalid.\nAn empty filter value returns all results."}).option(`bot-fight-mode`,{type:`boolean`,description:`If bot_fight_mode is set to \`true\`, Cloudflare issues computationally
|
|
3
3
|
expensive challenges in response to malicious bots (ENT only).
|
|
4
4
|
`}).option(`clearance-level`,{type:`string`,description:`If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,
|
|
5
5
|
this setting can determine the clearance level to be set
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./session-
|
|
2
|
+
import"./session-Ckt20hHa.mjs";import{i as e,n as t,t as n}from"./theme-BePJemMn.mjs";const r={bar:`│`,top:`┌`,bottom:`└`};function i(e,i,o){let s=o?.title??`Error`,c=t(),l=n.error,u=c.hex(l)(r.bar),d=c.hex(l)(r.top),f=c.hex(l)(r.bottom),p=Math.max(20,(process.stdout.columns||80)-2),m=[];if(m.push(``),m.push(`${d} ${c.hex(l).bold(s)}`),o?.rawMessage)for(let t of e.split(`
|
|
3
3
|
`))m.push(t.length>0?`${u} ${t}`:u);else for(let t of a(e,p))m.push(t.length>0?`${u} ${c.hex(l).bold(t)}`:u);if(i){m.push(u);for(let e of a(i,p))m.push(e.length>0?`${u} ${c.dim(e)}`:u)}return m.push(f),m.join(`
|
|
4
4
|
`)}function a(e,t){let n=[];for(let r of e.split(`
|
|
5
5
|
`)){if(r.length<=t){n.push(r);continue}let e=r.split(/\s+/),i=``;for(let r of e){if(!i){i=r;continue}i.length+1+r.length<=t?i+=` `+r:(n.push(i),i=r)}i&&n.push(i)}return n}function o(r){return`${t().hex(n.warning)(e.warning)} ${r}`}function s(r){return`${t().hex(n.info)(e.info)} ${r}`}function c(r){let i=t().hex(n.muted);return`${i(e.arrow)} ${i(r)}`}export{i,s as n,o as r,c as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return submitted URLs based on ID`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf url-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/url-info`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.urlInfo.get({account_id:l})),{successLabel:`Loaded`})}},l={command:`url-info`,describe:`url-info`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{i as c,n as l}from"./prompt-CDtLWxNv.mjs";function u(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 d={command:`delete`,describe:`Deletes the URL Normalization settings.`,builder:u,handler:async a=>{if(a.dryRun){r({command:`cf url-normalization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/url_normalization`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.urlNormalization.delete({zone_id:s})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Fetches the current URL Normalization settings.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf url-normalization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/url_normalization`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.urlNormalization.get({zone_id:s})),{successLabel:`Loaded`})}};function m(e){return e.option(`scope`,{type:`string`,description:`The scope of the URL normalization.`,choices:[`incoming`,`both`,`none`]}).option(`type`,{type:`string`,description:`The type of URL normalization performed by Cloudflare.`,choices:[`cloudflare`,`rfc3986`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A URL Normalization object.`})}const h={command:`update`,describe:`Updates the URL Normalization settings.`,builder:m,handler:async l=>{if(l.dryRun){r({command:`cf url-normalization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/url_normalization`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({scope:s(l.scope,`scope`,`text`),type:s(l.type,`type`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.urlNormalization.update({body:e,zone_id:d})),{successLabel:`Updated`});return}l.scope===void 0&&(l.scope=await c(`scope`,`The scope of the URL normalization.`,[`incoming`,`both`,`none`])),l.type===void 0&&(l.type=await c(`type`,`The type of URL normalization performed by Cloudflare.`,[`cloudflare`,`rfc3986`]));let f=o({scope:s(l.scope,`scope`,`text`),type:s(l.type,`type`,`text`)});n(await i(`Updating`,async()=>u.urlNormalization.update({body:f,zone_id:d})),{successLabel:`Updated`})}},g={command:`url-normalization`,describe:`url-normalization`,builder:e=>e.command(d).command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u}from"./prompt-DM4z101s.mjs";import{n as d,t as f}from"./raw-fetch-25gXED6c.mjs";function p(e){return e.positional(`response-id`,{type:`string`,description:`Response hash.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <response-id>`,describe:"Returns the raw response of the network request. Find the `response_id` in the `data.requests.response.hash`.",builder:p,handler:async i=>{if(i.dryRun){a({command:`cf url-scanner responses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/responses/${i[`response-id`]==null?`<response-id>`:encodeURIComponent(String(i[`response-id`]))}`,pathParams:{"response-id":String(i[`response-id`]??``)},bodyKind:`none`});return}await r(i);let s=i.local?e:await t();i.accountId=s,d((await o(`Loading`,async()=>f(`/accounts/${s}/urlscanner/v2/responses/${encodeURIComponent(String(i[`response-id`]))}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}))).toString(`utf-8`))}},h={command:`responses`,describe:`Raw HTTP response data captured during URL scans`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of urls to scan (up to a 100).`})}const _={command:`bulk-create`,describe:`Submit URLs to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/ and take into account scans submitted in bulk have lower priority and may take longer to finish.`,builder:g,handler:async c=>{if(c.dryRun){a({command:`cf url-scanner scans bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/bulk`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.urlScanner.scans.bulkCreate({body:e,account_id:u})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function v(e){return e.option(`agent-readiness`,{type:`boolean`,description:`Enable agent readiness checks.`}).option(`country`,{type:`string`,description:`Country to geo egress from`,choices:`AF.AL.DZ.AD.AO.AG.AR.AM.AU.AT.AZ.BH.BD.BB.BY.BE.BZ.BJ.BM.BT.BO.BA.BW.BR.BN.BG.BF.BI.KH.CM.CA.CV.KY.CF.TD.CL.CN.CO.KM.CG.CR.CI.HR.CU.CY.CZ.CD.DK.DJ.DM.DO.EC.EG.SV.GQ.ER.EE.SZ.ET.FJ.FI.FR.GA.GE.DE.GH.GR.GL.GD.GT.GN.GW.GY.HT.HN.HU.IS.IN.ID.IR.IQ.IE.IL.IT.JM.JP.JO.KZ.KE.KI.KW.KG.LA.LV.LB.LS.LR.LY.LI.LT.LU.MO.MG.MW.MY.MV.ML.MR.MU.MX.FM.MD.MC.MN.MS.MA.MZ.MM.NA.NR.NP.NL.NZ.NI.NE.NG.KP.MK.NO.OM.PK.PS.PA.PG.PY.PE.PH.PL.PT.QA.RO.RU.RW.SH.KN.LC.VC.WS.SM.ST.SA.SN.RS.SC.SL.SK.SI.SB.SO.ZA.KR.SS.ES.LK.SD.SR.SE.CH.SY.TW.TJ.TZ.TH.BS.GM.TL.TG.TO.TT.TN.TR.TM.UG.UA.AE.GB.US.UY.UZ.VU.VE.VN.YE.ZM.ZW`.split(`.`)}).option(`customagent`,{type:`string`,description:`The customagent field`}).option(`referer`,{type:`string`,description:`The referer field`}).option(`screenshots-resolutions`,{type:`string`,array:!0,description:`Take multiple screenshots targeting different device types.`}).option(`url`,{type:`string`,description:`The url field`}).option(`visibility`,{type:`string`,description:"The option `Public` means it will be included in listings like recent scans and search results. `Unlisted` means it will not be included in the aforementioned listings, users will need to have the scan's ID to access it. A a scan will be automatically marked as unlisted if it fails, if it contains potential PII or other sensitive material.",choices:[`Public`,`Unlisted`],default:`Public`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Submit a URL to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/.`,builder:v,handler:async d=>{if(d.dryRun){a({command:`cf url-scanner scans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/scan`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({agentReadiness:d[`agent-readiness`],country:l(d.country,`country`,`text`),customagent:l(d.customagent,`customagent`,`text`),referer:l(d.referer,`referer`,`text`),screenshotsResolutions:d[`screenshots-resolutions`],url:l(d.url,`url`,`text`),visibility:l(d.visibility,`visibility`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.urlScanner.scans.create({...e,account_id:p})),{successLabel:`Created`});return}d.url===void 0&&(d.url=await u(`url`,`The url field`));let m=c({agentReadiness:d[`agent-readiness`],country:l(d.country,`country`,`text`),customagent:l(d.customagent,`customagent`,`text`),referer:l(d.referer,`referer`,`text`),screenshotsResolutions:d[`screenshots-resolutions`],url:l(d.url,`url`,`text`),visibility:l(d.visibility,`visibility`,`text`)});i(await o(`Creating`,async()=>f.urlScanner.scans.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`dom <scan-id>`,describe:`Returns a plain text response, with the scan's DOM content as rendered by Chrome.`,builder:b,handler:async i=>{if(i.dryRun){a({command:`cf url-scanner scans dom`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/dom/${i[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(i[`scan-id`]))}`,pathParams:{"scan-id":String(i[`scan-id`]??``)},bodyKind:`none`});return}await r(i);let s=i.local?e:await t();i.accountId=s,d((await o(`Loading`,async()=>f(`/accounts/${s}/urlscanner/v2/dom/${encodeURIComponent(String(i[`scan-id`]))}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}))).toString(`utf-8`))}};function S(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <scan-id>`,describe:`Get URL scan by uuid`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf url-scanner scans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/result/${s[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(s[`scan-id`]))}`,pathParams:{"scan-id":String(s[`scan-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.urlScanner.scans.get({account_id:l,scan_id:s[`scan-id`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`har <scan-id>`,describe:`Get a URL scan's HAR file. See HAR spec at http://www.softwareishard.com/blog/har-12-spec/.`,builder:w,handler:async s=>{if(s.dryRun){a({command:`cf url-scanner scans har`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/har/${s[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(s[`scan-id`]))}`,pathParams:{"scan-id":String(s[`scan-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.urlScanner.scans.har({account_id:l,scan_id:s[`scan-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`size`,{type:`number`,description:`Limit the number of objects in the response.`}).option(`q`,{type:`string`,description:`Filter scans`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Use a subset of ElasticSearch Query syntax to filter scans. Some example queries:<br/> <br/>- 'path:"/bundles/jquery.js"': Searches for scans who requested resources with the given path.<br/>- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 where a resource with the given hash was downloaded.<br/>- 'page.domain:microsoft* AND verdicts.malicious:true AND NOT page.domain:microsoft.com': malicious scans whose hostname starts with "microsoft".<br/>- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025 January to 2025 February.`,builder:E,handler:async s=>{let c={size:s.size,q:s.q};if(s.dryRun){a({command:`cf url-scanner scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.urlScanner.scans.list({account_id:u,...c})),{successLabel:`Loaded`})}};function O(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`resolution`,{type:`string`,description:`Target device type.`,choices:[`desktop`,`mobile`,`tablet`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const k={command:`screenshot <scan-id>`,describe:`Get scan's screenshot by resolution (desktop/mobile/tablet).`,builder:O,handler:async i=>{let s={resolution:i.resolution};if(i.dryRun){a({command:`cf url-scanner scans screenshot`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/screenshots/${i[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(i[`scan-id`]))}.png`,pathParams:{"scan-id":String(i[`scan-id`]??``)},query:s,bodyKind:`none`});return}await r(i);let c=i.local?e:await t();i.accountId=c;let l=new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await o(`Loading`,async()=>f(`/accounts/${c}/urlscanner/v2/screenshots/${encodeURIComponent(String(i[`scan-id`]))}.png${l?`?`+l:``}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}));d(i.text===!0?u.toString(`utf-8`):u)}},A={command:`scans`,describe:`URL scan requests and results — submit URLs for analysis and retrieve threat verdicts`,builder:e=>e.command(_).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`url-scanner`,describe:`Scan URLs for phishing, malware, and other threats — submit scans and retrieve detailed results`,builder:e=>e.command(h).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
|
|
2
|
+
import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u}from"./prompt-CDtLWxNv.mjs";import{n as d,t as f}from"./raw-fetch-Dz-QBoP_.mjs";function p(e){return e.positional(`response-id`,{type:`string`,description:`Response hash.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <response-id>`,describe:"Returns the raw response of the network request. Find the `response_id` in the `data.requests.response.hash`.",builder:p,handler:async i=>{if(i.dryRun){a({command:`cf url-scanner responses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/responses/${i[`response-id`]==null?`<response-id>`:encodeURIComponent(String(i[`response-id`]))}`,pathParams:{"response-id":String(i[`response-id`]??``)},bodyKind:`none`});return}await r(i);let s=i.local?e:await t();i.accountId=s,d((await o(`Loading`,async()=>f(`/accounts/${s}/urlscanner/v2/responses/${encodeURIComponent(String(i[`response-id`]))}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}))).toString(`utf-8`))}},h={command:`responses`,describe:`Raw HTTP response data captured during URL scans`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of urls to scan (up to a 100).`})}const _={command:`bulk-create`,describe:`Submit URLs to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/ and take into account scans submitted in bulk have lower priority and may take longer to finish.`,builder:g,handler:async c=>{if(c.dryRun){a({command:`cf url-scanner scans bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/bulk`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.urlScanner.scans.bulkCreate({body:e,account_id:u})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function v(e){return e.option(`agent-readiness`,{type:`boolean`,description:`Enable agent readiness checks.`}).option(`country`,{type:`string`,description:`Country to geo egress from`,choices:`AF.AL.DZ.AD.AO.AG.AR.AM.AU.AT.AZ.BH.BD.BB.BY.BE.BZ.BJ.BM.BT.BO.BA.BW.BR.BN.BG.BF.BI.KH.CM.CA.CV.KY.CF.TD.CL.CN.CO.KM.CG.CR.CI.HR.CU.CY.CZ.CD.DK.DJ.DM.DO.EC.EG.SV.GQ.ER.EE.SZ.ET.FJ.FI.FR.GA.GE.DE.GH.GR.GL.GD.GT.GN.GW.GY.HT.HN.HU.IS.IN.ID.IR.IQ.IE.IL.IT.JM.JP.JO.KZ.KE.KI.KW.KG.LA.LV.LB.LS.LR.LY.LI.LT.LU.MO.MG.MW.MY.MV.ML.MR.MU.MX.FM.MD.MC.MN.MS.MA.MZ.MM.NA.NR.NP.NL.NZ.NI.NE.NG.KP.MK.NO.OM.PK.PS.PA.PG.PY.PE.PH.PL.PT.QA.RO.RU.RW.SH.KN.LC.VC.WS.SM.ST.SA.SN.RS.SC.SL.SK.SI.SB.SO.ZA.KR.SS.ES.LK.SD.SR.SE.CH.SY.TW.TJ.TZ.TH.BS.GM.TL.TG.TO.TT.TN.TR.TM.UG.UA.AE.GB.US.UY.UZ.VU.VE.VN.YE.ZM.ZW`.split(`.`)}).option(`customagent`,{type:`string`,description:`The customagent field`}).option(`referer`,{type:`string`,description:`The referer field`}).option(`screenshots-resolutions`,{type:`string`,array:!0,description:`Take multiple screenshots targeting different device types.`}).option(`url`,{type:`string`,description:`The url field`}).option(`visibility`,{type:`string`,description:"The option `Public` means it will be included in listings like recent scans and search results. `Unlisted` means it will not be included in the aforementioned listings, users will need to have the scan's ID to access it. A a scan will be automatically marked as unlisted if it fails, if it contains potential PII or other sensitive material.",choices:[`Public`,`Unlisted`],default:`Public`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Submit a URL to scan. Check limits at https://developers.cloudflare.com/security-center/investigate/scan-limits/.`,builder:v,handler:async d=>{if(d.dryRun){a({command:`cf url-scanner scans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/scan`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({agentReadiness:d[`agent-readiness`],country:l(d.country,`country`,`text`),customagent:l(d.customagent,`customagent`,`text`),referer:l(d.referer,`referer`,`text`),screenshotsResolutions:d[`screenshots-resolutions`],url:l(d.url,`url`,`text`),visibility:l(d.visibility,`visibility`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.urlScanner.scans.create({...e,account_id:p})),{successLabel:`Created`});return}d.url===void 0&&(d.url=await u(`url`,`The url field`));let m=c({agentReadiness:d[`agent-readiness`],country:l(d.country,`country`,`text`),customagent:l(d.customagent,`customagent`,`text`),referer:l(d.referer,`referer`,`text`),screenshotsResolutions:d[`screenshots-resolutions`],url:l(d.url,`url`,`text`),visibility:l(d.visibility,`visibility`,`text`)});i(await o(`Creating`,async()=>f.urlScanner.scans.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`dom <scan-id>`,describe:`Returns a plain text response, with the scan's DOM content as rendered by Chrome.`,builder:b,handler:async i=>{if(i.dryRun){a({command:`cf url-scanner scans dom`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/dom/${i[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(i[`scan-id`]))}`,pathParams:{"scan-id":String(i[`scan-id`]??``)},bodyKind:`none`});return}await r(i);let s=i.local?e:await t();i.accountId=s,d((await o(`Loading`,async()=>f(`/accounts/${s}/urlscanner/v2/dom/${encodeURIComponent(String(i[`scan-id`]))}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}))).toString(`utf-8`))}};function S(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <scan-id>`,describe:`Get URL scan by uuid`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf url-scanner scans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/result/${s[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(s[`scan-id`]))}`,pathParams:{"scan-id":String(s[`scan-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.urlScanner.scans.get({account_id:l,scan_id:s[`scan-id`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`har <scan-id>`,describe:`Get a URL scan's HAR file. See HAR spec at http://www.softwareishard.com/blog/har-12-spec/.`,builder:w,handler:async s=>{if(s.dryRun){a({command:`cf url-scanner scans har`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/har/${s[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(s[`scan-id`]))}`,pathParams:{"scan-id":String(s[`scan-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.urlScanner.scans.har({account_id:l,scan_id:s[`scan-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`size`,{type:`number`,description:`Limit the number of objects in the response.`}).option(`q`,{type:`string`,description:`Filter scans`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Use a subset of ElasticSearch Query syntax to filter scans. Some example queries:<br/> <br/>- 'path:"/bundles/jquery.js"': Searches for scans who requested resources with the given path.<br/>- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 where a resource with the given hash was downloaded.<br/>- 'page.domain:microsoft* AND verdicts.malicious:true AND NOT page.domain:microsoft.com': malicious scans whose hostname starts with "microsoft".<br/>- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025 January to 2025 February.`,builder:E,handler:async s=>{let c={size:s.size,q:s.q};if(s.dryRun){a({command:`cf url-scanner scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.urlScanner.scans.list({account_id:u,...c})),{successLabel:`Loaded`})}};function O(e){return e.positional(`scan-id`,{type:`string`,description:`Scan UUID.`,demandOption:!0}).option(`resolution`,{type:`string`,description:`Target device type.`,choices:[`desktop`,`mobile`,`tablet`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const k={command:`screenshot <scan-id>`,describe:`Get scan's screenshot by resolution (desktop/mobile/tablet).`,builder:O,handler:async i=>{let s={resolution:i.resolution};if(i.dryRun){a({command:`cf url-scanner scans screenshot`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/urlscanner/v2/screenshots/${i[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(i[`scan-id`]))}.png`,pathParams:{"scan-id":String(i[`scan-id`]??``)},query:s,bodyKind:`none`});return}await r(i);let c=i.local?e:await t();i.accountId=c;let l=new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await o(`Loading`,async()=>f(`/accounts/${c}/urlscanner/v2/screenshots/${encodeURIComponent(String(i[`scan-id`]))}.png${l?`?`+l:``}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}));d(i.text===!0?u.toString(`utf-8`):u)}},A={command:`scans`,describe:`URL scan requests and results — submit URLs for analysis and retrieve threat verdicts`,builder:e=>e.command(_).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`url-scanner`,describe:`Scan URLs for phishing, malware, and other threats — submit scans and retrieve detailed results`,builder:e=>e.command(h).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
|