cf 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
- package/dist/{accounts-CjtZ8x1z.mjs → accounts-B_joQcMi.mjs} +9 -9
- package/dist/{acm-C2lYIWs1.mjs → acm-_kIHqYME.mjs} +2 -2
- package/dist/{addressing-CHFK6uxW.mjs → addressing-CaFlw8y1.mjs} +10 -10
- package/dist/{agent-context-CgGCT0xU.mjs → agent-context-DMPfi54f.mjs} +1 -1
- package/dist/ai-CqnhNb_c.mjs +2 -0
- package/dist/ai-gateway-pgYGI519.mjs +8 -0
- package/dist/ai-search-eqQMPQol.mjs +7 -0
- package/dist/ai_gateway--vuVLnOm.mjs +4 -0
- package/dist/{alerting-Bk85NNf5.mjs → alerting-CPxHiYHb.mjs} +5 -5
- package/dist/{analytics-CkhhhZWZ.mjs → analytics-DSSRDZz8.mjs} +1 -1
- package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
- package/dist/{api-gateway-CWdR4Ne7.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
- package/dist/argo-aC6A3JyX.mjs +2 -0
- package/dist/artifacts-HD4V2xpK.mjs +4 -0
- package/dist/audit-logs-BuExU_nz.mjs +2 -0
- package/dist/auth-CSC4yhEJ.mjs +9 -0
- package/dist/auth-D5hNsOFq.mjs +5 -0
- package/dist/billing-COaghyxl.mjs +2 -0
- package/dist/bot-management-DmEzeV1Y.mjs +5 -0
- package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
- package/dist/brand-protection-dPrGe8sL.mjs +3 -0
- package/dist/{browser-rendering-Rae0AUt0.mjs → browser-rendering-BiSGnpBf.mjs} +3 -3
- package/dist/{build-BE4o4imx.mjs → build-HuS9-R0V.mjs} +2 -2
- package/dist/{cache-B7pRbpTy.mjs → cache-CY-7Lt71.mjs} +4 -4
- package/dist/{calls-DXRWsZ8n.mjs → calls-wOQGDWPl.mjs} +3 -3
- package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
- package/dist/client-certificates-CRf41xLe.mjs +3 -0
- package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
- package/dist/{cloudforce-one-B6HYfk5Z.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
- package/dist/{completions-D_9WsLG7.mjs → completions-DOeHPdCG.mjs} +2 -2
- package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
- package/dist/connectivity-Bx3MgTHX.mjs +3 -0
- package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
- package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
- package/dist/connectors-DRt4e6d_.mjs +3 -0
- package/dist/{content-scanning-CnW2A0pv.mjs → content-scanning-Cd2vy5Sz.mjs} +3 -3
- package/dist/context-jpewmual.mjs +2 -0
- package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
- package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
- package/dist/custom-nameservers-CWqA51in.mjs +3 -0
- package/dist/custom-pages-DeUKEFGe.mjs +4 -0
- package/dist/d1-DvWY9Gp4.mjs +4 -0
- package/dist/data-security-BPo6dIWu.mjs +6 -0
- package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
- package/dist/{deploy-KBRFIatG.mjs → deploy-dVrgDUOp.mjs} +1 -1
- package/dist/{dev-pPazzZvt.mjs → dev-C01_Lby6.mjs} +1 -1
- package/dist/diagnostics-6nKPmVgz.mjs +3 -0
- package/dist/{dispatch-namespaces-Cz2rajnP.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
- package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
- package/dist/{dist-DA54ZQu0.mjs → dist-t_YrL25p.mjs} +1 -1
- package/dist/{dns-62t95Xif.mjs → dns-ClciFGxx.mjs} +13 -13
- package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
- package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
- package/dist/{email-routing-BDUYYeV3.mjs → email-routing-CGXhFqF5.mjs} +9 -9
- package/dist/{email-security-ChHA6eqQ.mjs → email-security-D5viPq8S.mjs} +7 -7
- package/dist/email-sending-C2jpc3gh.mjs +3 -0
- package/dist/{filters-qJpU9uAS.mjs → filters-bzsFcWt0.mjs} +3 -3
- package/dist/{firewall-C3DDwfwh.mjs → firewall-DYZcTtIC.mjs} +10 -10
- package/dist/{fraud-DY3YXFVf.mjs → fraud-C03MtdZb.mjs} +1 -1
- package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
- package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
- package/dist/hostnames-CFgIVI3s.mjs +3 -0
- package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
- package/dist/iam-DqVPzGrb.mjs +6 -0
- package/dist/{images-D1jI3r3O.mjs → images-BYfl4YgR.mjs} +6 -6
- package/dist/index.mjs +1 -1
- package/dist/intel-duTEPIHc.mjs +3 -0
- package/dist/{ips-B6JETVOY.mjs → ips-nv9INuWZ.mjs} +1 -1
- package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
- package/dist/{kv-CSWoD9ks.mjs → kv-CZoV4tiv.mjs} +4 -4
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
- package/dist/{load-balancers-Du1tNuUt.mjs → load-balancers--OMg0HNt.mjs} +5 -5
- package/dist/{logpush-SuJyO-uX.mjs → logpush-C0_lZTyY.mjs} +3 -3
- package/dist/{logs-DcDNRPRl.mjs → logs-BtpWZQfV.mjs} +2 -2
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
- package/dist/{magic-network-monitoring-CqtvOePQ.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
- package/dist/{magic-transit-BTbkhBtF.mjs → magic-transit-CLhMcJ_-.mjs} +32 -32
- package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
- package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
- package/dist/{network-interconnects-DsiNytOU.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
- package/dist/oauth-Bk-F-tIO.mjs +52 -0
- package/dist/{observability-CLqZ7OSi.mjs → observability-BynRbTF4.mjs} +3 -3
- package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
- package/dist/{organizations-aRi1bhFC.mjs → organizations-BqJHyvMK.mjs} +3 -3
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
- package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
- package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
- package/dist/{page-rules-CYqtPU1p.mjs → page-rules-EZHJePmn.mjs} +4 -4
- package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CXJioWPs.mjs} +5 -5
- package/dist/{pages-ChurJ2H7.mjs → pages-D4aYteKk.mjs} +8 -8
- package/dist/{pipelines-CeyujvRf.mjs → pipelines-G8Iusxq-.mjs} +5 -5
- package/dist/progress-DrDErV9w.mjs +2 -0
- package/dist/queues-DEkbKqZX.mjs +6 -0
- package/dist/{r2-BtuTO3vQ.mjs → r2-CV0IkCAW.mjs} +9 -9
- package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
- package/dist/{radar-CzGM92uM.mjs → radar-D986zPJr.mjs} +1 -1
- package/dist/{rate-limits-Bbk7HxP7.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
- package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
- package/dist/{realtime-kit-CivLpkpg.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
- package/dist/{registrar-8IeA5DKd.mjs → registrar-CDIwTz3G.mjs} +6 -6
- package/dist/request-tracers-D7SFMDik.mjs +2 -0
- package/dist/{resource-sharing-B-Pcto7-.mjs → resource-sharing-YIQ04jXE.mjs} +4 -4
- package/dist/{resource-tagging-Bpb6Qq1M.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
- package/dist/rules-DHjLP5Kx.mjs +4 -0
- package/dist/{rulesets-lYczEcJp.mjs → rulesets-q4QABpKs.mjs} +7 -7
- package/dist/rum-SmT4HZmM.mjs +4 -0
- package/dist/{schema-hefO-tzo.mjs → schema-BR31o4P6.mjs} +1 -1
- package/dist/{schema-validation-DTq517Em.mjs → schema-validation-vVetgC_P.mjs} +5 -5
- package/dist/{scim-BiLfOQ89.mjs → scim-ChOkZpNx.mjs} +2 -2
- package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
- package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-BAK9G12O.mjs} +12 -12
- package/dist/security-center-eScuYDKP.mjs +2 -0
- package/dist/security-txt-x7R4gmQu.mjs +3 -0
- package/dist/session-DHYCE-PM.mjs +93 -0
- package/dist/shared-BAjo72Lz.mjs +2 -0
- package/dist/{smart-shield-DblHIce0.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
- package/dist/snippets-DrlgYJYp.mjs +4 -0
- package/dist/{spawn-DK7pott_.mjs → spawn-CCGzKlC4.mjs} +1 -1
- package/dist/{spectrum-CnrG0jIC.mjs → spectrum-pVGxb7u5.mjs} +6 -6
- package/dist/speed-ZFrMWDgd.mjs +4 -0
- package/dist/src-DU7FBCOX.mjs +108 -0
- package/dist/ssl-9JY05sYt.mjs +15 -0
- package/dist/{stream-CGTRN4ZN.mjs → stream-tRU39b8K.mjs} +13 -13
- package/dist/{tenants-o_M62Y1n.mjs → tenants-HLGUazms.mjs} +1 -1
- package/dist/{token-validation-Ca5AGEns.mjs → token-validation-_VdamKpz.mjs} +4 -4
- package/dist/{tools-DtNNmO6l.mjs → tools-D_hfUU_Z.mjs} +1 -1
- package/dist/{turnstile-l7mo9BWL.mjs → turnstile-BRzXd28B.mjs} +4 -4
- package/dist/{ui-B97lRnOv.mjs → ui-erjBdVKL.mjs} +1 -1
- package/dist/url-normalization-D-NxuLtN.mjs +3 -0
- package/dist/url-scanner-BzzR6iDx.mjs +2 -0
- package/dist/{user-CiyYZ69X.mjs → user-C4omq__w.mjs} +1 -1
- package/dist/vectorize-By6EqcNR.mjs +4 -0
- package/dist/{versions-B6E8WQyA.mjs → versions-CBHwWPAM.mjs} +1 -1
- package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
- package/dist/{web3-DlHE0CZc.mjs → web3-DQ5dmE9W.mjs} +3 -3
- package/dist/{workers-DRAkU6YR.mjs → workers-D8Be7_as.mjs} +14 -14
- package/dist/workers-builds-BE3W3qNk.mjs +7 -0
- package/dist/{workflows-z6oapEJs.mjs → workflows-BWWufqFA.mjs} +3 -3
- package/dist/zaraz-Bsa9AvVL.mjs +2 -0
- package/dist/{zero-trust-fyyIelWx.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
- package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
- package/dist/{zones-MSULnDwW.mjs → zones-BXtdwt6E.mjs} +6 -6
- package/package.json +1 -1
- package/dist/ai-DS3i-I1a.mjs +0 -2
- package/dist/ai-gateway-RIsegO2x.mjs +0 -8
- package/dist/ai-search-Dcj4BauG.mjs +0 -7
- package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
- package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
- package/dist/argo-DnJRVnGX.mjs +0 -2
- package/dist/artifacts-BVWKiJUl.mjs +0 -4
- package/dist/audit-logs-DjTstbzL.mjs +0 -2
- package/dist/auth-BqDOIrKX.mjs +0 -150
- package/dist/auth-DKkSwnxh.mjs +0 -5
- package/dist/billing-3rEqF83h.mjs +0 -2
- package/dist/bot-management-CJxD1pqi.mjs +0 -5
- package/dist/botnet-feed-MG91D7BR.mjs +0 -3
- package/dist/brand-protection-CK7gJi06.mjs +0 -3
- package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
- package/dist/client-certificates-B0ebLJdk.mjs +0 -3
- package/dist/cloud-connector-BOjaggJk.mjs +0 -2
- package/dist/connectivity-welFvZ7X.mjs +0 -3
- package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
- package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
- package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
- package/dist/connectors-3vjrdFLB.mjs +0 -3
- package/dist/context-CONbNKO-.mjs +0 -2
- package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
- package/dist/custom-pages-5fCSP8in.mjs +0 -4
- package/dist/d1-CyiRbZZn.mjs +0 -4
- package/dist/data-security-Casx4OS_.mjs +0 -6
- package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
- package/dist/diagnostics-BqYDoDfw.mjs +0 -3
- package/dist/dns-firewall-Coy8d47t.mjs +0 -57
- package/dist/durable-objects-BSuRERkw.mjs +0 -2
- package/dist/email-sending-CVrRqn6S.mjs +0 -3
- package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
- package/dist/hostnames-BdAQo1Mr.mjs +0 -3
- package/dist/hyperdrive-99OJV9nl.mjs +0 -18
- package/dist/iam-BRbpg3lN.mjs +0 -6
- package/dist/intel-C3ajLpXd.mjs +0 -3
- package/dist/keyless-certificates-C4MZ4xnf.mjs +0 -3
- package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
- package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
- package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
- package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
- package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
- package/dist/progress-Cent9Lsg.mjs +0 -2
- package/dist/queues-Rf_n11Cx.mjs +0 -6
- package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
- package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
- package/dist/request-tracers-D1aH4NmL.mjs +0 -2
- package/dist/rules-B10XWY10.mjs +0 -4
- package/dist/rum-B5GUKa4I.mjs +0 -4
- package/dist/security-center-AVpTOBK3.mjs +0 -2
- package/dist/security-txt-DVlh8y9l.mjs +0 -3
- package/dist/shared-0bwWVDLo.mjs +0 -2
- package/dist/snippets-DrpqSXYC.mjs +0 -4
- package/dist/speed-BzRY3Xlh.mjs +0 -4
- package/dist/src-D9_Gq68b.mjs +0 -108
- package/dist/ssl-Cp6tQkZH.mjs +0 -15
- package/dist/url-normalization-D1CogSIG.mjs +0 -3
- package/dist/url-scanner-BnJHJqcz.mjs +0 -2
- package/dist/vectorize-D3LgMLOn.mjs +0 -4
- package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
- package/dist/zaraz-CyzfYOEU.mjs +0 -2
- package/dist/zero_trust-BAhlNkjo.mjs +0 -3
- /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
- /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
- /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-BeyOc81z.mjs} +0 -0
- /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
- /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
- /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
- /package/dist/{metadata-jh2EIan8.mjs → metadata-OOwvpR8m.mjs} +0 -0
- /package/dist/{resolve-D1mG0REg.mjs → resolve-C3h-mwp7.mjs} +0 -0
- /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.audioTracks.delete({account_id:o,identifier:
|
|
4
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.captions.language.delete({account_id:o,identifier:t.identifier,language:t.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 t=>{if(t.dryRun){u({command:`cf stream captions language get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}/captions/${t.language==null?`<language>`:encodeURIComponent(String(t.language))}`,pathParams:{language:String(t.language??``),identifier:String(t.identifier??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?m:await r(n);t.accountId=i,l(await d(`Loading`,async()=>n.stream.captions.language.get({account_id:i,identifier:t.identifier,language:t.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 t=>{if(t.dryRun){u({command:`cf stream captions language update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}/captions/${t.language==null?`<language>`:encodeURIComponent(String(t.language))}`,pathParams:{language:String(t.language??``),identifier:String(t.identifier??``)},bodyKind:`multipart`,body:{body:t.body,file:t.file}});return}let n=await a(t),o=t.local?m:await r(n);if(t.accountId=o,t.file!==void 0||t.body!==void 0){let e=new FormData;if(t.file){let n=p(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);l(await d(`Updating`,async()=>i(n,`PUT`,`/accounts/${o}/stream/${encodeURIComponent(String(t.identifier))}/captions/${encodeURIComponent(String(t.language))}`,{body:e})),{successLabel:`Updated`});return}if(t.body){let e=f(t.body,`body`,`binary`);l(await d(`Updating`,async()=>i(n,`PUT`,`/accounts/${o}/stream/${encodeURIComponent(String(t.identifier))}/captions/${encodeURIComponent(String(t.language))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(t.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 t=>{if(t.dryRun){u({command:`cf stream captions language vtt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}/captions/${t.language==null?`<language>`:encodeURIComponent(String(t.language))}/vtt`,pathParams:{language:String(t.language??``),identifier:String(t.identifier??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?m:await r(n);t.accountId=i,g((await d(`Loading`,async()=>_(`/accounts/${i}/stream/${encodeURIComponent(String(t.identifier))}/captions/${encodeURIComponent(String(t.language))}/vtt`,{method:`GET`,localEndpoint:t.local?t.localEndpoint:void 0}))).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:`Operations for captions`,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 n=>{if(n.dryRun){u({command:`cf stream clip create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/clip`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({allowedOrigins:n[`allowed-origins`],clippedFromVideoUID:f(n[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:f(n.creator,`creator`,`text`),endTimeSeconds:n[`end-time-seconds`],input:f(n.input,`input`,`text`),name:f(n.name,`name`,`text`),requireSignedURLs:n[`require-signed-urls`],scheduledDeletion:f(n[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:n[`start-time-seconds`],thumbnailTimestampPct:n[`thumbnail-timestamp-pct`],url:f(n.url,`url`,`text`),watermark:{uid:f(n[`watermark-uid`],`watermark-uid`,`text`)}}):o(n.body)});return}let i=await a(n),s=n.local?m:await r(i);if(n.accountId=s,n.body){let e=o(n.body);l(await d(`Creating`,async()=>i.stream.clip.create({...e,account_id:s})),{successLabel:`Created`});return}if(n[`clipped-from-video-uid`]===void 0&&(n[`clipped-from-video-uid`]=await t(`clipped-from-video-uid`,`The unique video identifier (UID).`)),n[`end-time-seconds`]===void 0)throw Error(`--end-time-seconds is required (or pass --body with this field set).`);if(n[`start-time-seconds`]===void 0)throw Error(`--start-time-seconds is required (or pass --body with this field set).`);let p=c({allowedOrigins:n[`allowed-origins`],clippedFromVideoUID:f(n[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:f(n.creator,`creator`,`text`),endTimeSeconds:n[`end-time-seconds`],input:f(n.input,`input`,`text`),name:f(n.name,`name`,`text`),requireSignedURLs:n[`require-signed-urls`],scheduledDeletion:f(n[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:n[`start-time-seconds`],thumbnailTimestampPct:n[`thumbnail-timestamp-pct`],url:f(n.url,`url`,`text`),watermark:{uid:f(n[`watermark-uid`],`watermark-uid`,`text`)}});l(await d(`Creating`,async()=>i.stream.clip.create({...p,account_id:s})),{successLabel:`Created`})}},H={command:`clip`,describe:`Operations for clip`,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 t=>{let n={};if(t[`upload-creator`]!==void 0&&(n[`Upload-Creator`]=String(t[`upload-creator`])),t.dryRun){u({command:`cf stream copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/copy`,pathParams:{},bodyKind:`json`,body:t.body===void 0?c({allowedOrigins:t[`allowed-origins`],creator:f(t.creator,`creator`,`text`),input:f(t.input,`input`,`text`),name:f(t.name,`name`,`text`),requireSignedURLs:t[`require-signed-urls`],scheduledDeletion:f(t[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:t[`thumbnail-timestamp-pct`],url:f(t.url,`url`,`text`),watermark:{uid:f(t[`watermark-uid`],`watermark-uid`,`text`)}}):o(t.body)});return}let p=await a(t),h=t.local?m:await r(p);if(t.accountId=h,t.body){let e=o(t.body);l(await d(`Creating`,async()=>i(p,`POST`,`/accounts/${h}/stream/copy`,{body:e,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Created`});return}let g={};t[`allowed-origins`]!==void 0&&s(g,[`allowedOrigins`],t[`allowed-origins`]),t.creator!==void 0&&s(g,[`creator`],f(t.creator,`creator`,`text`)),t.input!==void 0&&s(g,[`input`],f(t.input,`input`,`text`)),t.name!==void 0&&s(g,[`name`],f(t.name,`name`,`text`)),t[`require-signed-urls`]!==void 0&&s(g,[`requireSignedURLs`],t[`require-signed-urls`]),t[`scheduled-deletion`]!==void 0&&s(g,[`scheduledDeletion`],f(t[`scheduled-deletion`],`scheduled-deletion`,`text`)),t[`thumbnail-timestamp-pct`]!==void 0&&s(g,[`thumbnailTimestampPct`],t[`thumbnail-timestamp-pct`]),t.url!==void 0&&s(g,[`url`],f(t.url,`url`,`text`)),t[`watermark-uid`]!==void 0&&s(g,[`watermark`,`uid`],f(t[`watermark-uid`],`watermark-uid`,`text`)),l(await d(`Creating`,async()=>i(p,`POST`,`/accounts/${h}/stream/copy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Created`})}},G={command:`copy`,describe:`Operations for copy`,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
|
-
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
|
|
6
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.delete({account_id:o,identifier:
|
|
7
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.downloads.delete({account_id:o,identifier:
|
|
8
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.keys.delete({account_id:o,identifier:
|
|
9
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.liveInputs.delete({account_id:o,live_input_identifier:
|
|
10
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.liveInputs.disable.create({account_id:o,live_input_identifier:
|
|
11
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.liveInputs.outputs.delete({account_id:o,live_input_identifier:t[`live-input-identifier`],output_identifier:t[`output-identifier`]})),{successLabel:`Deleted`})}};function Ue(e){return e.option(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`list`,describe:`Retrieves all outputs associated with a specified live input.`,builder:Ue,handler:async t=>{if(t.dryRun){u({command:`cf stream live-inputs outputs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/live_inputs/${t[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(t[`live-input-identifier`]))}/outputs`,pathParams:{"live-input-identifier":String(t[`live-input-identifier`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?m:await r(n);t.accountId=i,l(await d(`Loading`,async()=>n.stream.liveInputs.outputs.list({account_id:i,live_input_identifier:t[`live-input-identifier`]})),{successLabel:`Loaded`})}};function Ge(e){return e.positional(`output-identifier`,{type:`string`,description:`A unique identifier for the output.`,demandOption:!0}).option(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`When enabled, live video streamed to the associated live input will be sent to the output URL. When disabled, live video will not be sent to the output URL, even when streaming to the associated live input. Use this to control precisely when you start and stop simulcasting to specific destinations like YouTube and Twitch.`}).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 Ke={command:`update <output-identifier>`,describe:`Updates the state of an output.`,builder:Ge,handler:async t=>{if(t.dryRun){u({command:`cf stream live-inputs outputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/live_inputs/${t[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(t[`live-input-identifier`]))}/outputs/${t[`output-identifier`]==null?`<output-identifier>`:encodeURIComponent(String(t[`output-identifier`]))}`,pathParams:{"output-identifier":String(t[`output-identifier`]??``),"live-input-identifier":String(t[`live-input-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({enabled:t.enabled}):o(t.body)});return}let n=await a(t),i=t.local?m:await r(n);if(t.accountId=i,t.body){let e=o(t.body);l(await d(`Updating`,async()=>n.stream.liveInputs.outputs.update({...e,account_id:i,live_input_identifier:t[`live-input-identifier`],output_identifier:t[`output-identifier`]})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let s=c({enabled:t.enabled});l(await d(`Updating`,async()=>n.stream.liveInputs.outputs.update({...s,account_id:i,live_input_identifier:t[`live-input-identifier`],output_identifier:t[`output-identifier`]})),{successLabel:`Updated`})}},qe={command:`outputs`,describe:`Operations for live-inputs.outputs`,builder:e=>e.command(Be).command(He).command(We).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`update <live-input-identifier>`,describe:`Rotates the credentials for a live input without changing its identifier. Old credentials are revoked, broadcasts using stale credentials are automatically disconnected shortly after rotation, and the response returns refreshed credentials.`,builder:Je,handler:async t=>{if(t.dryRun){u({command:`cf stream live-inputs rotate update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/live_inputs/${t[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(t[`live-input-identifier`]))}/rotate_keys`,pathParams:{"live-input-identifier":String(t[`live-input-identifier`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?m:await r(n);t.accountId=i,l(await d(`Creating`,async()=>n.stream.liveInputs.rotate.update({account_id:i,live_input_identifier:t[`live-input-identifier`]})),{successLabel:`Created`})}},Xe={command:`rotate`,describe:`Operations for live-inputs.rotate`,builder:e=>e.command(Ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ze(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`default-creator`,{type:`string`,description:`Sets the creator ID asssociated with this live input.`}).option(`delete-recording-after-days`,{type:`number`,description:"Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion."}).option(`enabled`,{type:`boolean`,description:`Indicates whether the live input is enabled and can accept streams.`}).option(`prefer-low-latency`,{type:`boolean`,description:`When enabled, the live stream is delivered using Low-Latency HLS (LL-HLS), reducing glass-to-glass latency for viewers at the cost of reduced player compatibility.`}).option(`recording-allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display videos created with this input. Enter allowed origin domains in an array and use `*` for wildcard subdomains. An empty array allows videos to be viewed on any origin."}).option(`recording-hide-live-viewer-count`,{type:`boolean`,description:"Disables reporting the number of live viewers when this property is set to `true`."}).option(`recording-mode`,{type:`string`,description:"Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.",choices:[`off`,`automatic`]}).option(`recording-require-signed-urls`,{type:`boolean`,description:"Indicates if a video using the live input has the `requireSignedURLs` property set. Also enforces access controls on any video recording of the livestream with the live input."}).option(`recording-timeout-seconds`,{type:`number`,description:"Determines the amount of time a live input configured in `automatic` mode should wait before a recording transitions from live to on-demand. `0` is recommended for most use cases and indicates the platform default should be used."}).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 Qe={command:`update <live-input-identifier>`,describe:`Updates a specified live input.`,builder:Ze,handler:async t=>{if(t.dryRun){u({command:`cf stream live-inputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/live_inputs/${t[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(t[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(t[`live-input-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({defaultCreator:f(t[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:t[`delete-recording-after-days`],enabled:t.enabled,preferLowLatency:t[`prefer-low-latency`],recording:{allowedOrigins:t[`recording-allowed-origins`],hideLiveViewerCount:t[`recording-hide-live-viewer-count`],mode:f(t[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:t[`recording-require-signed-urls`],timeoutSeconds:t[`recording-timeout-seconds`]}}):o(t.body)});return}let n=await a(t),i=t.local?m:await r(n);if(t.accountId=i,t.body){let e=o(t.body);l(await d(`Updating`,async()=>n.stream.liveInputs.update({...e,account_id:i,live_input_identifier:t[`live-input-identifier`]})),{successLabel:`Updated`});return}let s=c({defaultCreator:f(t[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:t[`delete-recording-after-days`],enabled:t.enabled,preferLowLatency:t[`prefer-low-latency`],recording:{allowedOrigins:t[`recording-allowed-origins`],hideLiveViewerCount:t[`recording-hide-live-viewer-count`],mode:f(t[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:t[`recording-require-signed-urls`],timeoutSeconds:t[`recording-timeout-seconds`]}});l(await d(`Updating`,async()=>n.stream.liveInputs.update({...s,account_id:i,live_input_identifier:t[`live-input-identifier`]})),{successLabel:`Updated`})}},$e={command:`live-inputs`,describe:`Operations for live-inputs`,builder:e=>e.command(Ee).command(Oe).command(Ie).command(Re).command(Qe).command(je).command(Pe).command(qe).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function et(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`downloadable`,{type:`boolean`,description:`The optional boolean value that enables using signed tokens to access MP4 download links for a video.`,default:!1}).option(`exp`,{type:`number`,description:`The optional unix epoch timestamp that specficies the time after a token is not accepted. The maximum time specification is 24 hours from issuing time. If this field is not set, the default is one hour after issuing.`}).option(`flags-original`,{type:`boolean`,description:`Whether to return the original video without transformations.`,default:!1}).option(`id`,{type:`string`,description:"The optional ID of a Stream signing key. If present, the `pem` field is also required."}).option(`nbf`,{type:`number`,description:`The optional unix epoch timestamp that specifies the time before a the token is not accepted. If this field is not set, the default is one hour before issuing.`}).option(`pem`,{type:`string`,description:"The optional base64 encoded private key in PEM format associated with a Stream signing key. If present, the `id` field is also required."}).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 tt={command:`create <identifier>`,describe:`Creates a signed URL token for a video. If a body is not provided in the request, a token is created with default values.`,builder:et,handler:async t=>{if(t.dryRun){u({command:`cf stream token create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}/token`,pathParams:{identifier:String(t.identifier??``)},bodyKind:`json`,body:t.body===void 0?c({downloadable:t.downloadable,exp:t.exp,flags:{original:t[`flags-original`]},id:f(t.id,`id`,`text`),nbf:t.nbf,pem:f(t.pem,`pem`,`text`)}):o(t.body)});return}let n=await a(t),i=t.local?m:await r(n);if(t.accountId=i,t.body){let e=o(t.body);l(await d(`Creating`,async()=>n.stream.token.create({...e,account_id:i,identifier:t.identifier})),{successLabel:`Created`});return}let s=c({downloadable:t.downloadable,exp:t.exp,flags:{original:t[`flags-original`]},id:f(t.id,`id`,`text`),nbf:t.nbf,pem:f(t.pem,`pem`,`text`)});l(await d(`Creating`,async()=>n.stream.token.create({...s,account_id:i,identifier:t.identifier})),{successLabel:`Created`})}},nt={command:`token`,describe:`Operations for token`,builder:e=>e.command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(e){return e.positional(`download-type`,{type:`string`,description:"The type of downloads available are: `default`, `audio`.",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 it={command:`create <download-type>`,describe:`Creates a download for a video of specified type. For backwards-compatibility, POST requests to /downloads will enable the default download.`,builder:h(rt),handler:async t=>{if(t.dryRun){u({command:`cf stream typed-downloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}/downloads/${t[`download-type`]==null?`<download-type>`:encodeURIComponent(String(t[`download-type`]))}`,pathParams:{identifier:String(t.identifier??``),"download-type":String(t[`download-type`]??``)},bodyKind:`none`});return}let n=await a(t),i=t.local?m:await r(n);t.accountId=i,l(await d(`Creating`,async()=>n.stream.typedDownloads.create({account_id:i,identifier:t.identifier,download_type:t[`download-type`]})),{successLabel:`Created`})}};function at(e){return e.positional(`download-type`,{type:`string`,description:"The type of downloads available are: `default`, `audio`.",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 ot={command:`delete <download-type>`,describe:`Delete specific type of download. For backwards-compatibility, DELETE requests to /downloads will delete the default download.`,builder:h(at),handler:async t=>{if(t.dryRun){u({command:`cf stream typed-downloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/stream/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}/downloads/${t[`download-type`]==null?`<download-type>`:encodeURIComponent(String(t[`download-type`]))}`,pathParams:{identifier:String(t.identifier??``),"download-type":String(t[`download-type`]??``)},bodyKind:`none`});return}let i=await a(t),o=t.local?m:await r(i);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.typedDownloads.delete({account_id:o,identifier:
|
|
13
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.watermarks.delete({account_id:o,identifier:
|
|
14
|
-
`);return}l(await d(`Deleting`,async()=>i.stream.webhooks.delete({account_id:o})),{successLabel:`Deleted`})}};function xt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`get`,describe:`Retrieves a list of webhooks.`,builder:xt,handler:async
|
|
2
|
+
import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{i,n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,r as s,t as c}from"./body-parser-DWSy7uZ8.mjs";import{t as l}from"./output-B6fBFRqe.mjs";import{n as u,t as d}from"./progress-DrDErV9w.mjs";import{n as f,t as p}from"./input-validation-_fMCApaH.mjs";import{t as m}from"./local-CYc9q7l2.mjs";import{t as h}from"./cli-types-BeyOc81z.mjs";import{n as g,t as _}from"./raw-fetch-_n0lMAnD.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){u({command:`cf stream audio-tracks copy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<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?c({label:f(r.label,`label`,`text`),url:f(r.url,`url`,`text`)}):o(r.body)});return}let i=await a(r),s=r.local?m:await n(i);if(r.accountId=s,r.body){let e=o(r.body);l(await d(`Creating`,async()=>i.stream.audioTracks.copy({...e,account_id:s,identifier:r.identifier})),{successLabel:`Created`});return}r.label===void 0&&(r.label=await e(`label`,`A string to uniquely identify the track amongst other audio track labels for the specified video.`));let p=c({label:f(r.label,`label`,`text`),url:f(r.url,`url`,`text`)});l(await d(`Creating`,async()=>i.stream.audioTracks.copy({...p,account_id:s,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 e=>{if(e.dryRun){u({command:`cf stream audio-tracks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/audio/${e[`audio-identifier`]==null?`<audio-identifier>`:encodeURIComponent(String(e[`audio-identifier`]))}`,pathParams:{identifier:String(e.identifier??``),"audio-identifier":String(e[`audio-identifier`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.audioTracks.delete({account_id:o,identifier:e.identifier,audio_identifier:e[`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 e=>{if(e.dryRun){u({command:`cf stream audio-tracks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/audio/${e[`audio-identifier`]==null?`<audio-identifier>`:encodeURIComponent(String(e[`audio-identifier`]))}`,pathParams:{identifier:String(e.identifier??``),"audio-identifier":String(e[`audio-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({default:e.default,label:f(e.label,`label`,`text`)}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Updating`,async()=>r.stream.audioTracks.edit({...t,account_id:i,identifier:e.identifier,audio_identifier:e[`audio-identifier`]})),{successLabel:`Updated`});return}let s=c({default:e.default,label:f(e.label,`label`,`text`)});l(await d(`Updating`,async()=>r.stream.audioTracks.edit({...s,account_id:i,identifier:e.identifier,audio_identifier:e[`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 e=>{if(e.dryRun){u({command:`cf stream audio-tracks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/audio`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.audioTracks.get({account_id:i,identifier:e.identifier})),{successLabel:`Loaded`})}},w={command:`audio-tracks`,describe:`Operations for audio-tracks`,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 e=>{if(e.dryRun){u({command:`cf stream captions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/captions`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.captions.get({account_id:i,identifier:e.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 e=>{if(e.dryRun){u({command:`cf stream captions language create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/captions/${e.language==null?`<language>`:encodeURIComponent(String(e.language))}/generate`,pathParams:{language:String(e.language??``),identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Creating`,async()=>r.stream.captions.language.create({account_id:i,identifier:e.identifier,language:e.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 e=>{if(e.dryRun){u({command:`cf stream captions language delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/captions/${e.language==null?`<language>`:encodeURIComponent(String(e.language))}`,pathParams:{language:String(e.language??``),identifier:String(e.identifier??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.captions.language.delete({account_id:o,identifier:e.identifier,language:e.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 e=>{if(e.dryRun){u({command:`cf stream captions language get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/captions/${e.language==null?`<language>`:encodeURIComponent(String(e.language))}`,pathParams:{language:String(e.language??``),identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.captions.language.get({account_id:i,identifier:e.identifier,language:e.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 e=>{if(e.dryRun){u({command:`cf stream captions language update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/captions/${e.language==null?`<language>`:encodeURIComponent(String(e.language))}`,pathParams:{language:String(e.language??``),identifier:String(e.identifier??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file}});return}let r=await a(e),o=e.local?m:await n(r);if(e.accountId=o,e.file!==void 0||e.body!==void 0){let t=new FormData;if(e.file){let n=p(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);l(await d(`Updating`,async()=>i(r,`PUT`,`/accounts/${o}/stream/${encodeURIComponent(String(e.identifier))}/captions/${encodeURIComponent(String(e.language))}`,{body:t})),{successLabel:`Updated`});return}if(e.body){let t=f(e.body,`body`,`binary`);l(await d(`Updating`,async()=>i(r,`PUT`,`/accounts/${o}/stream/${encodeURIComponent(String(e.identifier))}/captions/${encodeURIComponent(String(e.language))}`,{body:t,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function 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 e=>{if(e.dryRun){u({command:`cf stream captions language vtt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/captions/${e.language==null?`<language>`:encodeURIComponent(String(e.language))}/vtt`,pathParams:{language:String(e.language??``),identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,g((await d(`Loading`,async()=>_(`/accounts/${i}/stream/${encodeURIComponent(String(e.identifier))}/captions/${encodeURIComponent(String(e.language))}/vtt`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}))).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:`Operations for captions`,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){u({command:`cf stream clip create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/clip`,pathParams:{},bodyKind:`json`,body:r.body===void 0?c({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:f(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:f(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:f(r.input,`input`,`text`),name:f(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:f(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:f(r.url,`url`,`text`),watermark:{uid:f(r[`watermark-uid`],`watermark-uid`,`text`)}}):o(r.body)});return}let i=await a(r),s=r.local?m:await n(i);if(r.accountId=s,r.body){let e=o(r.body);l(await d(`Creating`,async()=>i.stream.clip.create({...e,account_id:s})),{successLabel:`Created`});return}if(r[`clipped-from-video-uid`]===void 0&&(r[`clipped-from-video-uid`]=await e(`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 p=c({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:f(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:f(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:f(r.input,`input`,`text`),name:f(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:f(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:f(r.url,`url`,`text`),watermark:{uid:f(r[`watermark-uid`],`watermark-uid`,`text`)}});l(await d(`Creating`,async()=>i.stream.clip.create({...p,account_id:s})),{successLabel:`Created`})}},H={command:`clip`,describe:`Operations for clip`,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 e=>{let r={};if(e[`upload-creator`]!==void 0&&(r[`Upload-Creator`]=String(e[`upload-creator`])),e.dryRun){u({command:`cf stream copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/copy`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({allowedOrigins:e[`allowed-origins`],creator:f(e.creator,`creator`,`text`),input:f(e.input,`input`,`text`),name:f(e.name,`name`,`text`),requireSignedURLs:e[`require-signed-urls`],scheduledDeletion:f(e[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:e[`thumbnail-timestamp-pct`],url:f(e.url,`url`,`text`),watermark:{uid:f(e[`watermark-uid`],`watermark-uid`,`text`)}}):o(e.body)});return}let p=await a(e),h=e.local?m:await n(p);if(e.accountId=h,e.body){let t=o(e.body);l(await d(`Creating`,async()=>i(p,`POST`,`/accounts/${h}/stream/copy`,{body:t,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`});return}let g={};e[`allowed-origins`]!==void 0&&s(g,[`allowedOrigins`],e[`allowed-origins`]),e.creator!==void 0&&s(g,[`creator`],f(e.creator,`creator`,`text`)),e.input!==void 0&&s(g,[`input`],f(e.input,`input`,`text`)),e.name!==void 0&&s(g,[`name`],f(e.name,`name`,`text`)),e[`require-signed-urls`]!==void 0&&s(g,[`requireSignedURLs`],e[`require-signed-urls`]),e[`scheduled-deletion`]!==void 0&&s(g,[`scheduledDeletion`],f(e[`scheduled-deletion`],`scheduled-deletion`,`text`)),e[`thumbnail-timestamp-pct`]!==void 0&&s(g,[`thumbnailTimestampPct`],e[`thumbnail-timestamp-pct`]),e.url!==void 0&&s(g,[`url`],f(e.url,`url`,`text`)),e[`watermark-uid`]!==void 0&&s(g,[`watermark`,`uid`],f(e[`watermark-uid`],`watermark-uid`,`text`)),l(await d(`Creating`,async()=>i(p,`POST`,`/accounts/${h}/stream/copy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}},G={command:`copy`,describe:`Operations for copy`,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
|
+
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 e=>{let r={direct_user:e[`direct-user`]},o={};if(e[`tus-resumable`]!==void 0&&(o[`Tus-Resumable`]=String(e[`tus-resumable`])),e[`upload-creator`]!==void 0&&(o[`Upload-Creator`]=String(e[`upload-creator`])),e[`upload-length`]!==void 0&&(o[`Upload-Length`]=String(e[`upload-length`])),e[`upload-metadata`]!==void 0&&(o[`Upload-Metadata`]=String(e[`upload-metadata`])),e.dryRun){u({command:`cf stream create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream`,pathParams:{},query:r,bodyKind:`none`});return}let s=await a(e),c=e.local?m:await n(s);e.accountId=c,l(await d(`Creating`,async()=>i(s,`POST`,`/accounts/${c}/stream`,{query:r,headers:Object.keys(o).length>0?o: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 e=>{if(e.dryRun){u({command:`cf stream delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.delete({account_id:o,identifier:e.identifier})),{successLabel:`Deleted`})}};function X(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(`expiry`,{type:`string`,description:`The date and time after upload when videos will not be accepted.`,default:`Now + 30 minutes`}).option(`max-duration-seconds`,{type:`number`,description:"The maximum duration in seconds for a video upload. Can be set for a video that is not yet uploaded to limit its duration. Uploads that exceed the specified duration will fail during processing. A value of `-1` means the value is unknown."}).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(`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 Z={command:`create`,describe:`Creates a direct upload that allows video uploads without an API key.`,builder:X,handler:async e=>{let r={};if(e[`upload-creator`]!==void 0&&(r[`Upload-Creator`]=String(e[`upload-creator`])),e.dryRun){u({command:`cf stream direct-upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/direct_upload`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({allowedOrigins:e[`allowed-origins`],creator:f(e.creator,`creator`,`text`),expiry:f(e.expiry,`expiry`,`text`),maxDurationSeconds:e[`max-duration-seconds`],requireSignedURLs:e[`require-signed-urls`],scheduledDeletion:f(e[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:e[`thumbnail-timestamp-pct`],watermark:{uid:f(e[`watermark-uid`],`watermark-uid`,`text`)}}):o(e.body)});return}let p=await a(e),h=e.local?m:await n(p);if(e.accountId=h,e.body){let t=o(e.body);l(await d(`Creating`,async()=>i(p,`POST`,`/accounts/${h}/stream/direct_upload`,{body:t,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`});return}if(e[`max-duration-seconds`]===void 0)throw Error(`--max-duration-seconds is required (or pass --body with this field set).`);let g={};e[`allowed-origins`]!==void 0&&s(g,[`allowedOrigins`],e[`allowed-origins`]),e.creator!==void 0&&s(g,[`creator`],f(e.creator,`creator`,`text`)),e.expiry!==void 0&&s(g,[`expiry`],f(e.expiry,`expiry`,`text`)),e[`max-duration-seconds`]!==void 0&&s(g,[`maxDurationSeconds`],e[`max-duration-seconds`]),e[`require-signed-urls`]!==void 0&&s(g,[`requireSignedURLs`],e[`require-signed-urls`]),e[`scheduled-deletion`]!==void 0&&s(g,[`scheduledDeletion`],f(e[`scheduled-deletion`],`scheduled-deletion`,`text`)),e[`thumbnail-timestamp-pct`]!==void 0&&s(g,[`thumbnailTimestampPct`],e[`thumbnail-timestamp-pct`]),e[`watermark-uid`]!==void 0&&s(g,[`watermark`,`uid`],f(e[`watermark-uid`],`watermark-uid`,`text`)),l(await d(`Creating`,async()=>i(p,`POST`,`/accounts/${h}/stream/direct_upload`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Created`})}},Q={command:`direct-upload`,describe:`Operations for direct-upload`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(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 re={command:`create <identifier>`,describe:"Creates a download for a video when a video is ready to view. Use `/downloads/{download_type}` instead for type-specific downloads. Available types are `default` and `audio`.",builder:ne,handler:async e=>{if(e.dryRun){u({command:`cf stream downloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/downloads`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Creating`,async()=>r.stream.downloads.create({account_id:i,identifier:e.identifier})),{successLabel:`Created`})}};function ie(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 ae={command:`delete <identifier>`,describe:"Delete the downloads for a video. Use `/downloads/{download_type}` instead for type-specific downloads. Available types are `default` and `audio`.",builder:ie,handler:async e=>{if(e.dryRun){u({command:`cf stream downloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/downloads`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.downloads.delete({account_id:o,identifier:e.identifier})),{successLabel:`Deleted`})}};function oe(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 se={command:`get <identifier>`,describe:`Lists the downloads created for a video.`,builder:oe,handler:async e=>{if(e.dryRun){u({command:`cf stream downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/downloads`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.downloads.get({account_id:i,identifier:e.identifier})),{successLabel:`Loaded`})}},ce={command:`downloads`,describe:`Operations for downloads`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).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(`max-duration-seconds`,{type:`number`,description:"The maximum duration in seconds for a video upload. Can be set for a video that is not yet uploaded to limit its duration. Uploads that exceed the specified duration will fail during processing. A value of `-1` means the value is unknown."}).option(`public-details-channel-link`,{type:`string`,description:`The publicDetails.channel_link field`}).option(`public-details-logo`,{type:`string`,description:`The publicDetails.logo field`}).option(`public-details-share-link`,{type:`string`,description:`The publicDetails.share_link field`}).option(`public-details-title`,{type:`string`,description:`The publicDetails.title field`}).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(`uid`,{type:`string`,description:`The unique identifier for the video. Can be used to verify the video being updated.`}).option(`upload-expiry`,{type:`string`,description:`The date and time when the video upload URL is no longer valid for direct user uploads.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`edit <identifier>`,describe:`Edit details for a single video.`,builder:le,handler:async e=>{if(e.dryRun){u({command:`cf stream edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?c({allowedOrigins:e[`allowed-origins`],creator:f(e.creator,`creator`,`text`),maxDurationSeconds:e[`max-duration-seconds`],publicDetails:{channel_link:f(e[`public-details-channel-link`],`public-details-channel-link`,`text`),logo:f(e[`public-details-logo`],`public-details-logo`,`text`),share_link:f(e[`public-details-share-link`],`public-details-share-link`,`text`),title:f(e[`public-details-title`],`public-details-title`,`text`)},requireSignedURLs:e[`require-signed-urls`],scheduledDeletion:f(e[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:e[`thumbnail-timestamp-pct`],uid:f(e.uid,`uid`,`text`),uploadExpiry:f(e[`upload-expiry`],`upload-expiry`,`text`)}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Creating`,async()=>r.stream.edit({...t,account_id:i,identifier:e.identifier})),{successLabel:`Created`});return}let s=c({allowedOrigins:e[`allowed-origins`],creator:f(e.creator,`creator`,`text`),maxDurationSeconds:e[`max-duration-seconds`],publicDetails:{channel_link:f(e[`public-details-channel-link`],`public-details-channel-link`,`text`),logo:f(e[`public-details-logo`],`public-details-logo`,`text`),share_link:f(e[`public-details-share-link`],`public-details-share-link`,`text`),title:f(e[`public-details-title`],`public-details-title`,`text`)},requireSignedURLs:e[`require-signed-urls`],scheduledDeletion:f(e[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:e[`thumbnail-timestamp-pct`],uid:f(e.uid,`uid`,`text`),uploadExpiry:f(e[`upload-expiry`],`upload-expiry`,`text`)});l(await d(`Creating`,async()=>r.stream.edit({...s,account_id:i,identifier:e.identifier})),{successLabel:`Created`})}};function de(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 fe={command:`get <identifier>`,describe:`Fetches an HTML code snippet to embed a video in a web page delivered through Cloudflare. On success, returns an HTML fragment for use on web pages to display a video. On failure, returns a JSON response body.`,builder:de,handler:async e=>{if(e.dryRun){u({command:`cf stream embed get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/embed`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,g((await d(`Loading`,async()=>_(`/accounts/${i}/stream/${encodeURIComponent(String(e.identifier))}/embed`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}))).toString(`utf-8`))}},pe={command:`embed`,describe:`Operations for embed`,builder:e=>e.command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(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 he={command:`get <identifier>`,describe:`Fetches details for a single video.`,builder:me,handler:async e=>{if(e.dryRun){u({command:`cf stream get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.get({account_id:i,identifier:e.identifier})),{successLabel:`Loaded`})}};function ge(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`create`,describe:`Creates an RSA private key in PEM and JWK formats. Key files are only displayed once after creation. Keys are created, used, and deleted independently of videos, and every key can sign any video.`,builder:ge,handler:async e=>{if(e.dryRun){u({command:`cf stream keys create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/keys`,pathParams:{},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Creating`,async()=>r.stream.keys.create({account_id:i})),{successLabel:`Created`})}};function ve(e){return e.positional(`identifier`,{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 ye={command:`delete <identifier>`,describe:`Deletes signing keys and revokes all signed URLs generated with the key.`,builder:ve,handler:async e=>{if(e.dryRun){u({command:`cf stream keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/keys/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.keys.delete({account_id:o,identifier:e.identifier})),{successLabel:`Deleted`})}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get`,describe:`Lists the video ID and creation date and time when a signing key was created.`,builder:be,handler:async e=>{if(e.dryRun){u({command:`cf stream keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/keys`,pathParams:{},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.keys.get({account_id:i})),{successLabel:`Loaded`})}},Se={command:`keys`,describe:`Operations for keys`,builder:e=>e.command(_e).command(ye).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.option(`status`,{type:`string`,description:`Specifies the processing status for all quality levels for a video.`,choices:[`pendingupload`,`downloading`,`queued`,`inprogress`,`ready`,`error`,`live-inprogress`]}).option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`type`,{type:`string`,description:"Specifies whether the video is `vod` or `live`."}).option(`asc`,{type:`boolean`,description:`Lists videos in ascending order of creation.`}).option(`video-name`,{type:`string`,description:"Provides a fast, exact string match on the `name` key in the `meta` field."}).option(`search`,{type:`string`,description:"Provides a partial word match of the `name` key in the `meta` field. Slow for medium to large video libraries. May be unavailable for very large libraries."}).option(`start`,{type:`string`,description:`Lists videos created after the specified date.`}).option(`end`,{type:`string`,description:`Lists videos created before the specified date.`}).option(`include-counts`,{type:`boolean`,description:`Includes the total number of videos associated with the submitted query parameters.`}).option(`id`,{type:`string`,description:`Filter by video ID(s). Can be a single ID or a comma-separated list of IDs.`}).option(`name`,{type:`string`,description:`Filter by video name/UID(s). Can be a single name or a comma-separated list.`}).option(`live-input-id`,{type:`string`,description:`Filter by live input ID to find videos associated with a specific live stream.`}).option(`before`,{type:`string`,description:`Alias for 'end'. Returns videos created before this date/time (RFC 3339 format).`}).option(`after`,{type:`string`,description:`Alias for 'start'. Returns videos created after this date/time (RFC 3339 format).`}).option(`limit`,{type:`number`,description:`Maximum number of videos to return (default 1000, max 1000).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`list`,describe:`Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.`,builder:h(Ce),handler:async e=>{let r={status:e.status,creator:e.creator,type:e.type,asc:e.asc,video_name:e[`video-name`],search:e.search,start:e.start,end:e.end,include_counts:e[`include-counts`],id:e.id,name:e.name,live_input_id:e[`live-input-id`],before:e.before,after:e.after,limit:e.limit};if(e.dryRun){u({command:`cf stream list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream`,pathParams:{},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);e.accountId=o,l(await d(`Loading`,async()=>i.stream.list({account_id:o,...r})),{successLabel:`Loaded`})}};function Te(e){return e.option(`default-creator`,{type:`string`,description:`Sets the creator ID asssociated with this live input.`}).option(`delete-recording-after-days`,{type:`number`,description:"Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion."}).option(`enabled`,{type:`boolean`,description:`Indicates whether the live input is enabled and can accept streams.`,default:!0}).option(`prefer-low-latency`,{type:`boolean`,description:`When enabled, the live stream is delivered using Low-Latency HLS (LL-HLS), reducing glass-to-glass latency for viewers at the cost of reduced player compatibility.`,default:!1}).option(`recording-allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display videos created with this input. Enter allowed origin domains in an array and use `*` for wildcard subdomains. An empty array allows videos to be viewed on any origin."}).option(`recording-hide-live-viewer-count`,{type:`boolean`,description:"Disables reporting the number of live viewers when this property is set to `true`.",default:!1}).option(`recording-mode`,{type:`string`,description:"Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.",choices:[`off`,`automatic`],default:`off`}).option(`recording-require-signed-urls`,{type:`boolean`,description:"Indicates if a video using the live input has the `requireSignedURLs` property set. Also enforces access controls on any video recording of the livestream with the live input.",default:!1}).option(`recording-timeout-seconds`,{type:`number`,description:"Determines the amount of time a live input configured in `automatic` mode should wait before a recording transitions from live to on-demand. `0` is recommended for most use cases and indicates the platform default should be used.",default:0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`create`,describe:`Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.`,builder:Te,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({defaultCreator:f(e[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:e[`delete-recording-after-days`],enabled:e.enabled,preferLowLatency:e[`prefer-low-latency`],recording:{allowedOrigins:e[`recording-allowed-origins`],hideLiveViewerCount:e[`recording-hide-live-viewer-count`],mode:f(e[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:e[`recording-require-signed-urls`],timeoutSeconds:e[`recording-timeout-seconds`]}}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Creating`,async()=>r.stream.liveInputs.create({...t,account_id:i})),{successLabel:`Created`});return}let s=c({defaultCreator:f(e[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:e[`delete-recording-after-days`],enabled:e.enabled,preferLowLatency:e[`prefer-low-latency`],recording:{allowedOrigins:e[`recording-allowed-origins`],hideLiveViewerCount:e[`recording-hide-live-viewer-count`],mode:f(e[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:e[`recording-require-signed-urls`],timeoutSeconds:e[`recording-timeout-seconds`]}});l(await d(`Creating`,async()=>r.stream.liveInputs.create({...s,account_id:i})),{successLabel:`Created`})}};function De(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,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 Oe={command:`delete <live-input-identifier>`,describe:`Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.`,builder:De,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
9
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.liveInputs.delete({account_id:o,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Deleted`})}};function ke(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ae={command:`create <live-input-identifier>`,describe:`Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls until enabled.`,builder:ke,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs disable create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}/disable`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force,message:`This operation disables a live input. Active streams to it are dropped.`})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.liveInputs.disable.create({account_id:o,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Deleted`})}},je={command:`disable`,describe:`Operations for live-inputs.disable`,builder:e=>e.command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`create <live-input-identifier>`,describe:`Allows a live input to be streamed to and makes the live input accessible to any future API calls.`,builder:Me,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs enable create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}/enable`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Creating`,async()=>r.stream.liveInputs.enable.create({account_id:i,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Created`})}},Pe={command:`enable`,describe:`Operations for live-inputs.enable`,builder:e=>e.command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`get <live-input-identifier>`,describe:`Retrieves details of an existing live input.`,builder:Fe,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.liveInputs.get({account_id:i,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Loaded`})}};function Le(e){return e.option(`include-counts`,{type:`boolean`,description:`Includes the total number of videos associated with the submitted query parameters.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`list`,describe:`Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.`,builder:Le,handler:async e=>{let r={include_counts:e[`include-counts`]};if(e.dryRun){u({command:`cf stream live-inputs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs`,pathParams:{},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);e.accountId=o,l(await d(`Loading`,async()=>i.stream.liveInputs.list({account_id:o,...r})),{successLabel:`Loaded`})}};function ze(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`When enabled, live video streamed to the associated live input will be sent to the output URL. When disabled, live video will not be sent to the output URL, even when streaming to the associated live input. Use this to control precisely when you start and stop simulcasting to specific destinations like YouTube and Twitch.`,default:!0}).option(`stream-key`,{type:`string`,description:`The streamKey used to authenticate against an output's target.`}).option(`url`,{type:`string`,description:`The URL an output uses to restream.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Be={command:`create <live-input-identifier>`,describe:`Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs.`,builder:ze,handler:async r=>{if(r.dryRun){u({command:`cf stream live-inputs outputs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/outputs`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?c({enabled:r.enabled,streamKey:f(r[`stream-key`],`stream-key`,`text`),url:f(r.url,`url`,`text`)}):o(r.body)});return}let i=await a(r),s=r.local?m:await n(i);if(r.accountId=s,r.body){let e=o(r.body);l(await d(`Creating`,async()=>i.stream.liveInputs.outputs.create({...e,account_id:s,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`});return}r[`stream-key`]===void 0&&(r[`stream-key`]=await e(`stream-key`,`The streamKey used to authenticate against an output's target.`,{kind:`secret`})),r.url===void 0&&(r.url=await e(`url`,`The URL an output uses to restream.`,{kind:`secret`}));let p=c({enabled:r.enabled,streamKey:f(r[`stream-key`],`stream-key`,`text`),url:f(r.url,`url`,`text`)});l(await d(`Creating`,async()=>i.stream.liveInputs.outputs.create({...p,account_id:s,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`})}};function Ve(e){return e.positional(`output-identifier`,{type:`string`,description:`A unique identifier for the output.`,demandOption:!0}).option(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,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 He={command:`delete <output-identifier>`,describe:`Deletes an output and removes it from the associated live input.`,builder:Ve,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs outputs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}/outputs/${e[`output-identifier`]==null?`<output-identifier>`:encodeURIComponent(String(e[`output-identifier`]))}`,pathParams:{"output-identifier":String(e[`output-identifier`]??``),"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
11
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.liveInputs.outputs.delete({account_id:o,live_input_identifier:e[`live-input-identifier`],output_identifier:e[`output-identifier`]})),{successLabel:`Deleted`})}};function Ue(e){return e.option(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`list`,describe:`Retrieves all outputs associated with a specified live input.`,builder:Ue,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs outputs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}/outputs`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.liveInputs.outputs.list({account_id:i,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Loaded`})}};function Ge(e){return e.positional(`output-identifier`,{type:`string`,description:`A unique identifier for the output.`,demandOption:!0}).option(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`When enabled, live video streamed to the associated live input will be sent to the output URL. When disabled, live video will not be sent to the output URL, even when streaming to the associated live input. Use this to control precisely when you start and stop simulcasting to specific destinations like YouTube and Twitch.`}).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 Ke={command:`update <output-identifier>`,describe:`Updates the state of an output.`,builder:Ge,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs outputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}/outputs/${e[`output-identifier`]==null?`<output-identifier>`:encodeURIComponent(String(e[`output-identifier`]))}`,pathParams:{"output-identifier":String(e[`output-identifier`]??``),"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Updating`,async()=>r.stream.liveInputs.outputs.update({...t,account_id:i,live_input_identifier:e[`live-input-identifier`],output_identifier:e[`output-identifier`]})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let s=c({enabled:e.enabled});l(await d(`Updating`,async()=>r.stream.liveInputs.outputs.update({...s,account_id:i,live_input_identifier:e[`live-input-identifier`],output_identifier:e[`output-identifier`]})),{successLabel:`Updated`})}},qe={command:`outputs`,describe:`Operations for live-inputs.outputs`,builder:e=>e.command(Be).command(He).command(We).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`update <live-input-identifier>`,describe:`Rotates the credentials for a live input without changing its identifier. Old credentials are revoked, broadcasts using stale credentials are automatically disconnected shortly after rotation, and the response returns refreshed credentials.`,builder:Je,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs rotate update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}/rotate_keys`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Creating`,async()=>r.stream.liveInputs.rotate.update({account_id:i,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Created`})}},Xe={command:`rotate`,describe:`Operations for live-inputs.rotate`,builder:e=>e.command(Ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ze(e){return e.positional(`live-input-identifier`,{type:`string`,description:`A unique identifier for a live input.`,demandOption:!0}).option(`default-creator`,{type:`string`,description:`Sets the creator ID asssociated with this live input.`}).option(`delete-recording-after-days`,{type:`number`,description:"Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion."}).option(`enabled`,{type:`boolean`,description:`Indicates whether the live input is enabled and can accept streams.`}).option(`prefer-low-latency`,{type:`boolean`,description:`When enabled, the live stream is delivered using Low-Latency HLS (LL-HLS), reducing glass-to-glass latency for viewers at the cost of reduced player compatibility.`}).option(`recording-allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display videos created with this input. Enter allowed origin domains in an array and use `*` for wildcard subdomains. An empty array allows videos to be viewed on any origin."}).option(`recording-hide-live-viewer-count`,{type:`boolean`,description:"Disables reporting the number of live viewers when this property is set to `true`."}).option(`recording-mode`,{type:`string`,description:"Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.",choices:[`off`,`automatic`]}).option(`recording-require-signed-urls`,{type:`boolean`,description:"Indicates if a video using the live input has the `requireSignedURLs` property set. Also enforces access controls on any video recording of the livestream with the live input."}).option(`recording-timeout-seconds`,{type:`number`,description:"Determines the amount of time a live input configured in `automatic` mode should wait before a recording transitions from live to on-demand. `0` is recommended for most use cases and indicates the platform default should be used."}).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 Qe={command:`update <live-input-identifier>`,describe:`Updates a specified live input.`,builder:Ze,handler:async e=>{if(e.dryRun){u({command:`cf stream live-inputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/live_inputs/${e[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(e[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(e[`live-input-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({defaultCreator:f(e[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:e[`delete-recording-after-days`],enabled:e.enabled,preferLowLatency:e[`prefer-low-latency`],recording:{allowedOrigins:e[`recording-allowed-origins`],hideLiveViewerCount:e[`recording-hide-live-viewer-count`],mode:f(e[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:e[`recording-require-signed-urls`],timeoutSeconds:e[`recording-timeout-seconds`]}}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Updating`,async()=>r.stream.liveInputs.update({...t,account_id:i,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Updated`});return}let s=c({defaultCreator:f(e[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:e[`delete-recording-after-days`],enabled:e.enabled,preferLowLatency:e[`prefer-low-latency`],recording:{allowedOrigins:e[`recording-allowed-origins`],hideLiveViewerCount:e[`recording-hide-live-viewer-count`],mode:f(e[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:e[`recording-require-signed-urls`],timeoutSeconds:e[`recording-timeout-seconds`]}});l(await d(`Updating`,async()=>r.stream.liveInputs.update({...s,account_id:i,live_input_identifier:e[`live-input-identifier`]})),{successLabel:`Updated`})}},$e={command:`live-inputs`,describe:`Operations for live-inputs`,builder:e=>e.command(Ee).command(Oe).command(Ie).command(Re).command(Qe).command(je).command(Pe).command(qe).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function et(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`downloadable`,{type:`boolean`,description:`The optional boolean value that enables using signed tokens to access MP4 download links for a video.`,default:!1}).option(`exp`,{type:`number`,description:`The optional unix epoch timestamp that specficies the time after a token is not accepted. The maximum time specification is 24 hours from issuing time. If this field is not set, the default is one hour after issuing.`}).option(`flags-original`,{type:`boolean`,description:`Whether to return the original video without transformations.`,default:!1}).option(`id`,{type:`string`,description:"The optional ID of a Stream signing key. If present, the `pem` field is also required."}).option(`nbf`,{type:`number`,description:`The optional unix epoch timestamp that specifies the time before a the token is not accepted. If this field is not set, the default is one hour before issuing.`}).option(`pem`,{type:`string`,description:"The optional base64 encoded private key in PEM format associated with a Stream signing key. If present, the `id` field is also required."}).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 tt={command:`create <identifier>`,describe:`Creates a signed URL token for a video. If a body is not provided in the request, a token is created with default values.`,builder:et,handler:async e=>{if(e.dryRun){u({command:`cf stream token create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/token`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?c({downloadable:e.downloadable,exp:e.exp,flags:{original:e[`flags-original`]},id:f(e.id,`id`,`text`),nbf:e.nbf,pem:f(e.pem,`pem`,`text`)}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Creating`,async()=>r.stream.token.create({...t,account_id:i,identifier:e.identifier})),{successLabel:`Created`});return}let s=c({downloadable:e.downloadable,exp:e.exp,flags:{original:e[`flags-original`]},id:f(e.id,`id`,`text`),nbf:e.nbf,pem:f(e.pem,`pem`,`text`)});l(await d(`Creating`,async()=>r.stream.token.create({...s,account_id:i,identifier:e.identifier})),{successLabel:`Created`})}},nt={command:`token`,describe:`Operations for token`,builder:e=>e.command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(e){return e.positional(`download-type`,{type:`string`,description:"The type of downloads available are: `default`, `audio`.",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 it={command:`create <download-type>`,describe:`Creates a download for a video of specified type. For backwards-compatibility, POST requests to /downloads will enable the default download.`,builder:h(rt),handler:async e=>{if(e.dryRun){u({command:`cf stream typed-downloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/downloads/${e[`download-type`]==null?`<download-type>`:encodeURIComponent(String(e[`download-type`]))}`,pathParams:{identifier:String(e.identifier??``),"download-type":String(e[`download-type`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Creating`,async()=>r.stream.typedDownloads.create({account_id:i,identifier:e.identifier,download_type:e[`download-type`]})),{successLabel:`Created`})}};function at(e){return e.positional(`download-type`,{type:`string`,description:"The type of downloads available are: `default`, `audio`.",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 ot={command:`delete <download-type>`,describe:`Delete specific type of download. For backwards-compatibility, DELETE requests to /downloads will delete the default download.`,builder:h(at),handler:async e=>{if(e.dryRun){u({command:`cf stream typed-downloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/downloads/${e[`download-type`]==null?`<download-type>`:encodeURIComponent(String(e[`download-type`]))}`,pathParams:{identifier:String(e.identifier??``),"download-type":String(e[`download-type`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
12
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.typedDownloads.delete({account_id:o,identifier:e.identifier,download_type:e[`download-type`]})),{successLabel:`Deleted`})}},st={command:`typed-downloads`,describe:`Operations for typed-downloads`,builder:e=>e.command(it).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ct(e){return e.option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lt={command:`storage-usage`,describe:`Returns information about an account's storage use.`,builder:ct,handler:async e=>{let r={creator:e.creator};if(e.dryRun){u({command:`cf stream videos storage-usage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/storage-usage`,pathParams:{},query:r,bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);e.accountId=o,l(await d(`Loading`,async()=>i.stream.videos.storageUsage({account_id:o,...r})),{successLabel:`Loaded`})}},ut={command:`videos`,describe:`Operations for videos`,builder:e=>e.command(lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dt(e){return e.option(`name`,{type:`string`,description:`A short description of the watermark profile.`,default:``}).option(`opacity`,{type:`number`,description:"The translucency of the image. A value of `0.0` makes the image completely transparent, and `1.0` makes the image completely opaque. Note that if the image is already semi-transparent, setting this to `1.0` will not make the image completely opaque.",default:1}).option(`padding`,{type:`number`,description:"The whitespace between the adjacent edges (determined by position) of the video and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded video width or length, as determined by the algorithm.",default:.05}).option(`position`,{type:`string`,description:"The location of the image. Valid positions are: `upperRight`, `upperLeft`, `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the `padding` parameter.",default:`upperRight`}).option(`scale`,{type:`number`,description:"The size of the image relative to the overall size of the video. This parameter will adapt to horizontal and vertical videos automatically. `0.0` indicates no scaling (use the size of the image as-is), and `1.0 `fills the entire video.",default:.15}).option(`url`,{type:`string`,description:`URL of the watermark image to copy.`}).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 ft={command:`create`,describe:"Creates watermark profiles using a single `HTTP POST multipart/form-data` request.",builder:dt,handler:async e=>{if(e.dryRun){u({command:`cf stream watermarks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/watermarks`,pathParams:{},bodyKind:`multipart`,body:{name:e.name,opacity:e.opacity,padding:e.padding,position:e.position,scale:e.scale,url:e.url,body:e.body,file:e.file}});return}let r=await a(e),c=e.local?m:await n(r);if(e.accountId=c,e.file!==void 0||e.body!==void 0||e.name!==void 0||e.opacity!==void 0||e.padding!==void 0||e.position!==void 0||e.scale!==void 0){let t=new FormData;if(e.file){let n=p(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);e.name!==void 0&&t.append(`name`,String(f(e.name,`name`,`text`)??``)),e.opacity!==void 0&&t.append(`opacity`,String(e.opacity)),e.padding!==void 0&&t.append(`padding`,String(e.padding)),e.position!==void 0&&t.append(`position`,String(f(e.position,`position`,`text`)??``)),e.scale!==void 0&&t.append(`scale`,String(e.scale)),l(await d(`Creating`,async()=>i(r,`POST`,`/accounts/${c}/stream/watermarks`,{body:t})),{successLabel:`Created`});return}if(e.body){let t=o(e.body);l(await d(`Creating`,async()=>i(r,`POST`,`/accounts/${c}/stream/watermarks`,{body:t})),{successLabel:`Created`});return}let h={};e.name!==void 0&&s(h,[`name`],f(e.name,`name`,`text`)),e.opacity!==void 0&&s(h,[`opacity`],e.opacity),e.padding!==void 0&&s(h,[`padding`],e.padding),e.position!==void 0&&s(h,[`position`],f(e.position,`position`,`text`)),e.scale!==void 0&&s(h,[`scale`],e.scale),e.url!==void 0&&s(h,[`url`],f(e.url,`url`,`text`)),l(await d(`Creating`,async()=>i(r,`POST`,`/accounts/${c}/stream/watermarks`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function $(e){return e.positional(`identifier`,{type:`string`,description:`The unique identifier for a watermark profile.`,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 pt={command:`delete <identifier>`,describe:`Deletes a watermark profile.`,builder:$,handler:async e=>{if(e.dryRun){u({command:`cf stream watermarks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/watermarks/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
13
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.watermarks.delete({account_id:o,identifier:e.identifier})),{successLabel:`Deleted`})}};function mt(e){return e.positional(`identifier`,{type:`string`,description:`The unique identifier for a watermark profile.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`get <identifier>`,describe:`Retrieves details for a single watermark profile.`,builder:mt,handler:async e=>{if(e.dryRun){u({command:`cf stream watermarks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/watermarks/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.watermarks.get({account_id:i,identifier:e.identifier})),{successLabel:`Loaded`})}};function gt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _t={command:`list`,describe:`Lists all watermark profiles for an account.`,builder:gt,handler:async e=>{if(e.dryRun){u({command:`cf stream watermarks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/watermarks`,pathParams:{},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.watermarks.list({account_id:i})),{successLabel:`Loaded`})}},vt={command:`watermarks`,describe:`Operations for watermarks`,builder:e=>e.command(ft).command(pt).command(ht).command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yt(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 bt={command:`delete`,describe:`Deletes a webhook.`,builder:yt,handler:async e=>{if(e.dryRun){u({command:`cf stream webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/webhook`,pathParams:{},bodyKind:`none`});return}let i=await a(e),o=e.local?m:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}l(await d(`Deleting`,async()=>i.stream.webhooks.delete({account_id:o})),{successLabel:`Deleted`})}};function xt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`get`,describe:`Retrieves a list of webhooks.`,builder:xt,handler:async e=>{if(e.dryRun){u({command:`cf stream webhooks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/webhook`,pathParams:{},bodyKind:`none`});return}let r=await a(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.stream.webhooks.get({account_id:i})),{successLabel:`Loaded`})}};function Ct(e){return e.option(`notification-url`,{type:`string`,description:`The URL where webhooks will be sent.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const wt={command:`update`,describe:`Creates a webhook notification.`,builder:Ct,handler:async e=>{if(e.dryRun){u({command:`cf stream webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/stream/webhook`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({notificationUrl:f(e[`notification-url`],`notification-url`,`text`)}):o(e.body)});return}let r=await a(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=o(e.body);l(await d(`Updating`,async()=>r.stream.webhooks.update({...t,account_id:i})),{successLabel:`Updated`});return}let s=c({notificationUrl:f(e[`notification-url`],`notification-url`,`text`)});l(await d(`Updating`,async()=>r.stream.webhooks.update({...s,account_id:i})),{successLabel:`Updated`})}},Tt={command:`webhooks`,describe:`Operations for webhooks`,builder:e=>e.command(bt).command(St).command(wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Et={command:`stream`,describe:`stream`,builder:e=>e.command(q).command(Y).command(ue).command(he).command(we).command(w).command(z).command(H).command(G).command(Q).command(ce).command(pe).command(Se).command($e).command(nt).command(st).command(ut).command(vt).command(Tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Et as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-
|
|
2
|
+
import{n as e}from"./auth-CSC4yhEJ.mjs";import{t}from"./output-B6fBFRqe.mjs";import{n,t as r}from"./progress-DrDErV9w.mjs";function i(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 a={command:`get <tenant-id>`,describe:`List of account types available for the Tenant to provision accounts.`,builder:i,handler:async i=>{if(i.dryRun){n({command:`cf tenants account-types get`,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.tenants.accountTypes.get({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},o={command:`account-types`,describe:`Operations for account-types`,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 tenants accounts 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.tenants.accounts.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},l={command:`accounts`,describe:`Operations for accounts`,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 tenants entitlements 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.tenants.entitlements.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},f={command:`entitlements`,describe:`Operations for entitlements`,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 tenants 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.tenants.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 tenants memberships 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.tenants.memberships.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},_={command:`memberships`,describe:`Operations for memberships`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`tenants`,describe:`Multi-tenant account management — manage tenant accounts, entitlements, and memberships`,builder:e=>e.command(m).command(o).command(l).command(f).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|