cf 0.10.0 → 0.12.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 +15 -5
- package/dist/_meta/agent-context.json +13 -5
- package/dist/_meta/commands.json +2393 -262
- package/dist/_meta/hand-written-commands.json +960 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
- package/dist/account-CPbieCZ4.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
- package/dist/agent-memory-BrHMIU0E.mjs +6 -0
- package/dist/ai-audit-BoZuL84i.mjs +2 -0
- package/dist/ai-gateway-DE50Jem1.mjs +13 -0
- package/dist/ai-search-Fx7NHCHB.mjs +7 -0
- package/dist/ai-security-DyLbY9kv.mjs +4 -0
- package/dist/ai-v2fP1r0s.mjs +5 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
- package/dist/analytics-BygTfozw.mjs +3 -0
- package/dist/analytics_engine-4L-q362P.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
- package/dist/argo-TzXPN7tz.mjs +2 -0
- package/dist/args-CDgWUP4J.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
- package/dist/audit-logs-CqY7zzwv.mjs +2 -0
- package/dist/auth-CPLdkOC7.mjs +5 -0
- package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
- package/dist/billing-DHQuRT8S.mjs +3 -0
- package/dist/body-parser-BGVbwPeM.mjs +2 -0
- package/dist/bot-management-CfqG79hF.mjs +5 -0
- package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
- package/dist/brand-protection-DYttrKIM.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
- package/dist/browser-run-373D4e1i.mjs +4 -0
- package/dist/build-D0ir_S70.mjs +2 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
- package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
- package/dist/cf-yPz_IqW6.mjs +18 -0
- package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
- package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
- package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
- package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
- package/dist/command-BV87D4tR.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
- package/dist/config.d.mts +1451 -1366
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
- package/dist/containers-BDBsEs7-.mjs +58 -0
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
- package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
- package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
- package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
- package/dist/custom-pages-Buki_Cb8.mjs +3 -0
- package/dist/d1-n2in0cSF.mjs +20 -0
- package/dist/data-security-DzOQMkv3.mjs +7 -0
- package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-BUSz35vq.mjs +2 -0
- package/dist/deploy-input-BvD9aRP1.mjs +2 -0
- package/dist/dev-DY_DquQx.mjs +4 -0
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
- package/dist/dist-BBx1io2f.mjs +2 -0
- package/dist/dist-Cb9TJ2VV.mjs +9 -0
- package/dist/dist-DV7LR38l.mjs +387 -0
- package/dist/dist-DvizctjW.mjs +48 -0
- package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-ILZRVpnp.mjs +2 -0
- package/dist/durable-objects-DhDL3San.mjs +2 -0
- package/dist/email-auth-BROqK6-C.mjs +2 -0
- package/dist/email-routing-BZXHDAOO.mjs +6 -0
- package/dist/email-security-DVumybrk.mjs +18 -0
- package/dist/email-sending-CDQ3_wyz.mjs +7 -0
- package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
- package/dist/flagship-fFBiZUz-.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
- package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
- package/dist/iam-Bk7K_PPO.mjs +6 -0
- package/dist/images-BAEFb9q1.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
- package/dist/interactive-CRnq-B5I.mjs +11 -0
- package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
- package/dist/ips-DU0ti0i0.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
- package/dist/keys-DqldTZqH.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
- package/dist/load-balancers-Dg4pDad1.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
- package/dist/local-runtime--IQr44qq.mjs +2 -0
- package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
- package/dist/logo-matches-CWUzxY7G.mjs +2 -0
- package/dist/logos-BTfdkDPi.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
- package/dist/magic-transit-B5skt0G7.mjs +111 -0
- package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
- package/dist/matches-DeYaB4I0.mjs +2 -0
- package/dist/mcp-ChjBiMx2.mjs +4 -0
- package/dist/mesh-DRVAFLBX.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
- package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
- package/dist/oauth-DAa7SwkM.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
- package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
- package/dist/observability-DnyI8rPJ.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
- package/dist/organizations-B3aU-RCG.mjs +2 -0
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
- package/dist/page-rules-CzbyXbt6.mjs +27 -0
- package/dist/pages-CX8yefTI.mjs +14 -0
- package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
- package/dist/pipelines-BZ1KGupx.mjs +6 -0
- package/dist/precursor-D42A9ay5.mjs +4 -0
- package/dist/progress-jYW64HY7.mjs +2 -0
- package/dist/project-settings-BN7tL0c7.mjs +3 -0
- package/dist/prompt-CyATfGUu.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
- package/dist/queries-xvETUjUE.mjs +3 -0
- package/dist/queues-CpqHDtxF.mjs +6 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
- package/dist/r2-jhmLvD1z.mjs +24 -0
- package/dist/radar-C2J16wpX.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
- package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
- package/dist/registrar-BI5ewTAk.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
- package/dist/reporting-CxsdHAH3.mjs +2 -0
- package/dist/request-tracers-DJJCncft.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
- package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
- package/dist/rules-PpsDU89Q.mjs +4 -0
- package/dist/rulesets-DP12Aqik.mjs +5 -0
- package/dist/rum-DxvpzJYc.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
- package/dist/schema-flags-CTfQVGCs.mjs +5 -0
- package/dist/schemas-BFCBlp_W.mjs +65 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
- package/dist/security-center-008FMs_z.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
- package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
- package/dist/smart-shield-DpFscIk8.mjs +4 -0
- package/dist/snippets-CCKgI2ZX.mjs +4 -0
- package/dist/spawn-C3_tJ3RB.mjs +526 -0
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
- package/dist/src-CEb2fgtT.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
- package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
- package/dist/submit-DF2G5CIz.mjs +2 -0
- package/dist/tags-nFJJHlLJ.mjs +2 -0
- package/dist/tenant-CRLw1oRU.mjs +2 -0
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
- package/dist/tunnels-iVA3MrdS.mjs +2 -0
- package/dist/turnstile-DQHP6-_b.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
- package/dist/url-info-BVgdb_pf.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
- package/dist/url-scanner-DwuDZLPk.mjs +2 -0
- package/dist/user-I_MbB_KX.mjs +12 -0
- package/dist/values-S-Q7-5o8.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
- package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
- package/dist/web3-CdbfoZ2x.mjs +4 -0
- package/dist/workers-DQ9Q7czn.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
- package/dist/zaraz-DbKvA_8C.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
- package/dist/zone-D2zrbJI2.mjs +2 -0
- package/dist/zones-DrpxQ_-A.mjs +21 -0
- package/package.json +12 -8
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/args-DlUhyGU0.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/containers-CKW081JA.mjs +0 -54
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-CZ7bgNDu.mjs +0 -2
- package/dist/dev-V10MG-Bg.mjs +0 -4
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/local-runtime-Dh3keC5v.mjs +0 -2
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/spawn-O1RS01vr.mjs +0 -523
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.audioTracks.delete({account_id:l,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Deleted`})}};function
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.captions.language.delete({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Deleted`})}};function j(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <language>`,describe:`Lists the captions or subtitles for provided language.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.captions.language.get({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Loaded`})}};function N(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const P={command:`update <language>`,describe:`Uploads the caption or subtitle file to the endpoint for a specific BCP47 language. One caption or subtitle file per language is allowed.`,builder:N,handler:async c=>{if(c.dryRun){o({command:`cf stream captions language update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}/captions/${c.language==null?`<language>`:encodeURIComponent(String(c.language))}`,pathParams:{language:String(c.language??``),identifier:String(c.identifier??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await i(c),u=c.local?e:await t();if(c.accountId=u,c.file!==void 0||c.body!==void 0){let e=new FormData;if(c.file){let t=f(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);a(await s(`Updating`,async()=>r(l,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(c.identifier))}/captions/${encodeURIComponent(String(c.language))}`,{body:e})),{successLabel:`Updated`});return}if(c.body){let e=d(c.body,`body`,`binary`);a(await s(`Updating`,async()=>r(l,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(c.identifier))}/captions/${encodeURIComponent(String(c.language))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function F(e){return e.positional(`language`,{type:`string`,description:`The language tag in BCP 47 format.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <language>`,describe:`Return WebVTT captions for a provided language.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language vtt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}/vtt`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a,g((await s(`Loading`,async()=>_(`/accounts/${a}/stream/${encodeURIComponent(String(r.identifier))}/captions/${encodeURIComponent(String(r.language))}/vtt`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}},L={command:`vtt`,describe:`Operations for captions.language.vtt`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`language`,describe:`Operations for captions.language`,builder:e=>e.command(O).command(A).command(M).command(P).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`captions`,describe:`Upload, generate, or retrieve captions and subtitles for videos in multiple languages`,builder:e=>e.command(E).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin."}).option(`clipped-from-video-uid`,{type:`string`,description:`The unique video identifier (UID).`}).option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`end-time-seconds`,{type:`number`,description:`Specifies the end time for the video clip in seconds.`}).option(`input`,{type:`string`,description:`A video's URL. Preferred over 'url'.`}).option(`name`,{type:`string`,description:`A name for the video.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video.",default:!1}).option(`scheduled-deletion`,{type:`string`,description:"Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time."}).option(`start-time-seconds`,{type:`number`,description:`Specifies the start time for the video clip in seconds.`}).option(`thumbnail-timestamp-pct`,{type:`number`,description:`The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video.`,default:0}).option(`url`,{type:`string`,description:`A video's URL (legacy field, use 'input' instead).`}).option(`watermark-uid`,{type:`string`,description:`The unique identifier for the watermark profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`create`,describe:`Clips a video based on the specified start and end times provided in seconds.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf stream clip create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/clip`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:d(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:d(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:d(r.input,`input`,`text`),name:d(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:d(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:d(r.url,`url`,`text`),watermark:{uid:d(r[`watermark-uid`],`watermark-uid`,`text`)}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.stream.clip.create({...e,account_id:f})),{successLabel:`Created`});return}if(r[`clipped-from-video-uid`]===void 0&&(r[`clipped-from-video-uid`]=await p(`clipped-from-video-uid`,`The unique video identifier (UID).`)),r[`end-time-seconds`]===void 0)throw Error(`--end-time-seconds is required (or pass --body with this field set).`);if(r[`start-time-seconds`]===void 0)throw Error(`--start-time-seconds is required (or pass --body with this field set).`);let m=u({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:d(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:d(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:d(r.input,`input`,`text`),name:d(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:d(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:d(r.url,`url`,`text`),watermark:{uid:d(r[`watermark-uid`],`watermark-uid`,`text`)}});a(await s(`Creating`,async()=>l.stream.clip.create({...m,account_id:f})),{successLabel:`Created`})}},H={command:`clip`,describe:`Create a new video clip from an existing video by specifying start and end times`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`upload-creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin."}).option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`input`,{type:`string`,description:"A video's URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file. This is the preferred field over `url`."}).option(`name`,{type:`string`,description:`A video's name. Used for legacy compatibility.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video.",default:!1}).option(`scheduled-deletion`,{type:`string`,description:"Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time."}).option(`thumbnail-timestamp-pct`,{type:`number`,description:`The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video.`,default:0}).option(`url`,{type:`string`,description:"A video's URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file. This field is deprecated in favor of `input`."}).option(`watermark-uid`,{type:`string`,description:`The unique identifier for the watermark profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Copy upload request. Provide `input` (preferred) or `url` (deprecated)."})}const W={command:`create`,describe:`Uploads a video to Stream from a provided URL.`,builder:U,handler:async f=>{let p={};if(f[`upload-creator`]!==void 0&&(p[`Upload-Creator`]=String(f[`upload-creator`])),f.dryRun){o({command:`cf stream copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/copy`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({allowedOrigins:f[`allowed-origins`],creator:d(f.creator,`creator`,`text`),input:d(f.input,`input`,`text`),name:d(f.name,`name`,`text`),requireSignedURLs:f[`require-signed-urls`],scheduledDeletion:d(f[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:f[`thumbnail-timestamp-pct`],url:d(f.url,`url`,`text`),watermark:{uid:d(f[`watermark-uid`],`watermark-uid`,`text`)}}):c(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}let g={};f[`allowed-origins`]!==void 0&&l(g,[`allowedOrigins`],f[`allowed-origins`]),f.creator!==void 0&&l(g,[`creator`],d(f.creator,`creator`,`text`)),f.input!==void 0&&l(g,[`input`],d(f.input,`input`,`text`)),f.name!==void 0&&l(g,[`name`],d(f.name,`name`,`text`)),f[`require-signed-urls`]!==void 0&&l(g,[`requireSignedURLs`],f[`require-signed-urls`]),f[`scheduled-deletion`]!==void 0&&l(g,[`scheduledDeletion`],d(f[`scheduled-deletion`],`scheduled-deletion`,`text`)),f[`thumbnail-timestamp-pct`]!==void 0&&l(g,[`thumbnailTimestampPct`],f[`thumbnail-timestamp-pct`]),f.url!==void 0&&l(g,[`url`],d(f.url,`url`,`text`)),f[`watermark-uid`]!==void 0&&l(g,[`watermark`,`uid`],d(f[`watermark-uid`],`watermark-uid`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}},G={command:`copy`,describe:`Import a video from a URL into Stream for processing and delivery`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`direct-user`,{type:`boolean`,description:`Provisions a URL to let your end users upload videos directly to Cloudflare Stream without exposing your API token to clients.`}).option(`tus-resumable`,{type:`string`,description:`Specifies the TUS protocol version. This value must be included in every upload request.
|
|
5
|
-
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
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function
|
|
7
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.downloads.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function
|
|
8
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.keys.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function
|
|
9
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.delete({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})}};function
|
|
10
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.disable.create({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})}},
|
|
11
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.outputs.delete({account_id:l,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`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 r=>{if(r.dryRun){o({command:`cf stream live-inputs outputs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.liveInputs.outputs.list({account_id:l,live_input_identifier:r[`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 r=>{if(r.dryRun){o({command:`cf stream live-inputs outputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/outputs/${r[`output-identifier`]==null?`<output-identifier>`:encodeURIComponent(String(r[`output-identifier`]))}`,pathParams:{"output-identifier":String(r[`output-identifier`]??``),"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({enabled:r.enabled}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.stream.liveInputs.outputs.update({...e,account_id:d,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`output-identifier`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let f=u({enabled:r.enabled});a(await s(`Updating`,async()=>l.stream.liveInputs.outputs.update({...f,account_id:d,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`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 r=>{if(r.dryRun){o({command:`cf stream live-inputs rotate update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/rotate_keys`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.liveInputs.rotate.update({account_id:l,live_input_identifier:r[`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 r=>{if(r.dryRun){o({command:`cf stream live-inputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({defaultCreator:d(r[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:r[`delete-recording-after-days`],enabled:r.enabled,preferLowLatency:r[`prefer-low-latency`],recording:{allowedOrigins:r[`recording-allowed-origins`],hideLiveViewerCount:r[`recording-hide-live-viewer-count`],mode:d(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.stream.liveInputs.update({...e,account_id:f,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Updated`});return}let p=u({defaultCreator:d(r[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:r[`delete-recording-after-days`],enabled:r.enabled,preferLowLatency:r[`prefer-low-latency`],recording:{allowedOrigins:r[`recording-allowed-origins`],hideLiveViewerCount:r[`recording-hide-live-viewer-count`],mode:d(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}});a(await s(`Updating`,async()=>l.stream.liveInputs.update({...p,account_id:f,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Updated`})}},$e={command:`live-inputs`,describe:`Enable and disable live input streams`,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.`}).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 r=>{if(r.dryRun){o({command:`cf stream token create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/token`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?u({downloadable:r.downloadable,exp:r.exp,flags:{original:r[`flags-original`]},id:d(r.id,`id`,`text`),nbf:r.nbf,pem:d(r.pem,`pem`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.stream.token.create({...e,account_id:f,identifier:r.identifier})),{successLabel:`Created`});return}let p=u({downloadable:r.downloadable,exp:r.exp,flags:{original:r[`flags-original`]},id:d(r.id,`id`,`text`),nbf:r.nbf,pem:d(r.pem,`pem`,`text`)});a(await s(`Creating`,async()=>l.stream.token.create({...p,account_id:f,identifier:r.identifier})),{successLabel:`Created`})}},nt={command:`token`,describe:`Generate short-lived signed URL tokens for secure private video playback`,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:rt,handler:async r=>{if(r.dryRun){o({command:`cf stream typed-downloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads/${r[`download-type`]==null?`<download-type>`:encodeURIComponent(String(r[`download-type`]))}`,pathParams:{identifier:String(r.identifier??``),"download-type":String(r[`download-type`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.typedDownloads.create({account_id:l,identifier:r.identifier,download_type:r[`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:at,handler:async r=>{if(r.dryRun){o({command:`cf stream typed-downloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads/${r[`download-type`]==null?`<download-type>`:encodeURIComponent(String(r[`download-type`]))}`,pathParams:{identifier:String(r.identifier??``),"download-type":String(r[`download-type`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.typedDownloads.delete({account_id:l,identifier:r.identifier,download_type:r[`download-type`]})),{successLabel:`Deleted`})}},
|
|
13
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.watermarks.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function
|
|
14
|
-
`);return}a(await s(`Deleting`,async()=>c.stream.webhooks.delete({account_id:l})),{successLabel:`Deleted`})}};function
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{i as c,n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f,t as p}from"./input-validation-1esLElok.mjs";import{a as m,n as h}from"./prompt-CyATfGUu.mjs";import{t as g}from"./cli-types-C3nVfpSG.mjs";import{n as _,t as v}from"./raw-fetch-CNKIypJ7.mjs";function ee(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`label`,{type:`string`,description:`A string to uniquely identify the track amongst other audio track labels for the specified video.`}).option(`url`,{type:`string`,description:"An audio track URL. The server must be publicly routable and support `HTTP HEAD` requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` requests with a `content-range` header that includes the size of the file."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`copy <identifier>`,describe:`Adds an additional audio track to a video using the provided audio track URL.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks copy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio/copy`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?d({label:f(r.label,`label`,`text`),url:f(r.url,`url`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.stream.audioTracks.copy({...e,account_id:u,identifier:r.identifier})),{successLabel:`Created`});return}r.label===void 0&&(r.label=await m(`label`,`A string to uniquely identify the track amongst other audio track labels for the specified video.`));let p=d({label:f(r.label,`label`,`text`),url:f(r.url,`url`,`text`)});a(await s(`Creating`,async()=>c.stream.audioTracks.copy({...p,account_id:u,identifier:r.identifier})),{successLabel:`Created`})}};function y(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 b={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:y,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio/${r[`audio-identifier`]==null?`<audio-identifier>`:encodeURIComponent(String(r[`audio-identifier`]))}`,pathParams:{identifier:String(r.identifier??``),"audio-identifier":String(r[`audio-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.audioTracks.delete({account_id:l,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Deleted`})}};function x(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 S={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:x,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio/${r[`audio-identifier`]==null?`<audio-identifier>`:encodeURIComponent(String(r[`audio-identifier`]))}`,pathParams:{identifier:String(r.identifier??``),"audio-identifier":String(r[`audio-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?d({default:r.default,label:f(r.label,`label`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.stream.audioTracks.edit({...e,account_id:u,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Updated`});return}let p=d({default:r.default,label:f(r.label,`label`,`text`)});a(await s(`Updating`,async()=>c.stream.audioTracks.edit({...p,account_id:u,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Updated`})}};function C(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 w={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:C,handler:async r=>{if(r.dryRun){o({command:`cf stream audio-tracks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/audio`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.audioTracks.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}},T={command:`audio-tracks`,describe:`Add, edit, or remove additional audio tracks on a video`,builder:e=>e.command(te).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(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 D={command:`get <identifier>`,describe:`Lists the available captions or subtitles for a specific video.`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf stream captions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.captions.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}};function O(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 k={command:`create <language>`,describe:`Generate captions or subtitles for provided language via AI.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}/generate`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.captions.language.create({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Created`})}};function A(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 j={command:`delete <language>`,describe:`Removes the captions or subtitles from a video.`,builder:A,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.captions.language.delete({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Deleted`})}};function M(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 N={command:`get <language>`,describe:`Lists the captions or subtitles for provided language.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.captions.language.get({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Loaded`})}};function P(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 F={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:P,handler:async c=>{if(c.dryRun){o({command:`cf stream captions language update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}/captions/${c.language==null?`<language>`:encodeURIComponent(String(c.language))}`,pathParams:{language:String(c.language??``),identifier:String(c.identifier??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file}});return}let l=await i(c),u=c.local?e:await t();if(c.accountId=u,c.file!==void 0||c.body!==void 0){let e=new FormData;if(c.file){let t=p(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);a(await s(`Updating`,async()=>r(l,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(c.identifier))}/captions/${encodeURIComponent(String(c.language))}`,{body:e})),{successLabel:`Updated`});return}if(c.body){let e=f(c.body,`body`,`binary`);a(await s(`Updating`,async()=>r(l,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(c.identifier))}/captions/${encodeURIComponent(String(c.language))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function I(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 L={command:`get <language>`,describe:`Return WebVTT captions for a provided language.`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf stream captions language vtt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/captions/${r.language==null?`<language>`:encodeURIComponent(String(r.language))}/vtt`,pathParams:{language:String(r.language??``),identifier:String(r.identifier??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a,_((await s(`Loading`,async()=>v(`/accounts/${a}/stream/${encodeURIComponent(String(r.identifier))}/captions/${encodeURIComponent(String(r.language))}/vtt`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}},R={command:`vtt`,describe:`Operations for captions.language.vtt`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`language`,describe:`Operations for captions.language`,builder:e=>e.command(k).command(j).command(N).command(F).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`captions`,describe:`Upload, generate, or retrieve captions and subtitles for videos in multiple languages`,builder:e=>e.command(D).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(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 H={command:`create`,describe:`Clips a video based on the specified start and end times provided in seconds.`,builder:V,handler:async r=>{if(r.dryRun){o({command:`cf stream clip create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/clip`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({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(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.stream.clip.create({...e,account_id:u})),{successLabel:`Created`});return}if(r[`clipped-from-video-uid`]===void 0&&(r[`clipped-from-video-uid`]=await m(`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=d({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`)}});a(await s(`Creating`,async()=>c.stream.clip.create({...p,account_id:u})),{successLabel:`Created`})}},U={command:`clip`,describe:`Create a new video clip from an existing video by specifying start and end times`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(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 G={command:`create`,describe:`Uploads a video to Stream from a provided URL.`,builder:W,handler:async u=>{let p={};if(u[`upload-creator`]!==void 0&&(p[`Upload-Creator`]=String(u[`upload-creator`])),u.dryRun){o({command:`cf stream copy create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/copy`,pathParams:{},bodyKind:`json`,body:u.body===void 0?d({allowedOrigins:u[`allowed-origins`],creator:f(u.creator,`creator`,`text`),input:f(u.input,`input`,`text`),name:f(u.name,`name`,`text`),requireSignedURLs:u[`require-signed-urls`],scheduledDeletion:f(u[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:u[`thumbnail-timestamp-pct`],url:f(u.url,`url`,`text`),watermark:{uid:f(u[`watermark-uid`],`watermark-uid`,`text`)}}):l(u.body)});return}let m=await i(u),h=u.local?e:await t();if(u.accountId=h,u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}let g={};u[`allowed-origins`]!==void 0&&c(g,[`allowedOrigins`],u[`allowed-origins`]),u.creator!==void 0&&c(g,[`creator`],f(u.creator,`creator`,`text`)),u.input!==void 0&&c(g,[`input`],f(u.input,`input`,`text`)),u.name!==void 0&&c(g,[`name`],f(u.name,`name`,`text`)),u[`require-signed-urls`]!==void 0&&c(g,[`requireSignedURLs`],u[`require-signed-urls`]),u[`scheduled-deletion`]!==void 0&&c(g,[`scheduledDeletion`],f(u[`scheduled-deletion`],`scheduled-deletion`,`text`)),u[`thumbnail-timestamp-pct`]!==void 0&&c(g,[`thumbnailTimestampPct`],u[`thumbnail-timestamp-pct`]),u.url!==void 0&&c(g,[`url`],f(u.url,`url`,`text`)),u[`watermark-uid`]!==void 0&&c(g,[`watermark`,`uid`],f(u[`watermark-uid`],`watermark-uid`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}},K={command:`copy`,describe:`Import a video from a URL into Stream for processing and delivery`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(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 J={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:q,handler:async c=>{let l={direct_user:c[`direct-user`]},u={};if(c[`tus-resumable`]!==void 0&&(u[`Tus-Resumable`]=String(c[`tus-resumable`])),c[`upload-creator`]!==void 0&&(u[`Upload-Creator`]=String(c[`upload-creator`])),c[`upload-length`]!==void 0&&(u[`Upload-Length`]=String(c[`upload-length`])),c[`upload-metadata`]!==void 0&&(u[`Upload-Metadata`]=String(c[`upload-metadata`])),c.dryRun){o({command:`cf stream create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream`,pathParams:{},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/stream`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})}};function Y(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 X={command:`delete <identifier>`,describe:`Deletes a video and its copies from Cloudflare Stream.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf stream delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function Z(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 Q={command:`create`,describe:`Creates a direct upload that allows video uploads without an API key.`,builder:Z,handler:async u=>{let p={};if(u[`upload-creator`]!==void 0&&(p[`Upload-Creator`]=String(u[`upload-creator`])),u.dryRun){o({command:`cf stream direct-upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/direct_upload`,pathParams:{},bodyKind:`json`,body:u.body===void 0?d({allowedOrigins:u[`allowed-origins`],creator:f(u.creator,`creator`,`text`),expiry:f(u.expiry,`expiry`,`text`),maxDurationSeconds:u[`max-duration-seconds`],requireSignedURLs:u[`require-signed-urls`],scheduledDeletion:f(u[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:u[`thumbnail-timestamp-pct`],watermark:{uid:f(u[`watermark-uid`],`watermark-uid`,`text`)}}):l(u.body)});return}let m=await i(u),h=u.local?e:await t();if(u.accountId=h,u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/direct_upload`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}if(u[`max-duration-seconds`]===void 0)throw Error(`--max-duration-seconds is required (or pass --body with this field set).`);let g={};u[`allowed-origins`]!==void 0&&c(g,[`allowedOrigins`],u[`allowed-origins`]),u.creator!==void 0&&c(g,[`creator`],f(u.creator,`creator`,`text`)),u.expiry!==void 0&&c(g,[`expiry`],f(u.expiry,`expiry`,`text`)),u[`max-duration-seconds`]!==void 0&&c(g,[`maxDurationSeconds`],u[`max-duration-seconds`]),u[`require-signed-urls`]!==void 0&&c(g,[`requireSignedURLs`],u[`require-signed-urls`]),u[`scheduled-deletion`]!==void 0&&c(g,[`scheduledDeletion`],f(u[`scheduled-deletion`],`scheduled-deletion`,`text`)),u[`thumbnail-timestamp-pct`]!==void 0&&c(g,[`thumbnailTimestampPct`],u[`thumbnail-timestamp-pct`]),u[`watermark-uid`]!==void 0&&c(g,[`watermark`,`uid`],f(u[`watermark-uid`],`watermark-uid`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/direct_upload`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}},ne={command:`direct-upload`,describe:`Generate a tokenized URL that lets end-users upload video directly to Stream`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(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 ie={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:re,handler:async r=>{if(r.dryRun){o({command:`cf stream downloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.downloads.create({account_id:l,identifier:r.identifier})),{successLabel:`Created`})}};function ae(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 oe={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:ae,handler:async r=>{if(r.dryRun){o({command:`cf stream downloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.downloads.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function se(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 ce={command:`get <identifier>`,describe:`Lists the downloads created for a video.`,builder:se,handler:async r=>{if(r.dryRun){o({command:`cf stream downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.downloads.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}},le={command:`downloads`,describe:`Create downloadable MP4 renditions of a video for offline viewing`,builder:e=>e.command(ie).command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(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 de={command:`edit <identifier>`,describe:`Edit details for a single video.`,builder:ue,handler:async r=>{if(r.dryRun){o({command:`cf stream edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?d({allowedOrigins:r[`allowed-origins`],creator:f(r.creator,`creator`,`text`),maxDurationSeconds:r[`max-duration-seconds`],publicDetails:{channel_link:f(r[`public-details-channel-link`],`public-details-channel-link`,`text`),logo:f(r[`public-details-logo`],`public-details-logo`,`text`),share_link:f(r[`public-details-share-link`],`public-details-share-link`,`text`),title:f(r[`public-details-title`],`public-details-title`,`text`)},requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:f(r[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],uid:f(r.uid,`uid`,`text`),uploadExpiry:f(r[`upload-expiry`],`upload-expiry`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.stream.edit({...e,account_id:u,identifier:r.identifier})),{successLabel:`Created`});return}let p=d({allowedOrigins:r[`allowed-origins`],creator:f(r.creator,`creator`,`text`),maxDurationSeconds:r[`max-duration-seconds`],publicDetails:{channel_link:f(r[`public-details-channel-link`],`public-details-channel-link`,`text`),logo:f(r[`public-details-logo`],`public-details-logo`,`text`),share_link:f(r[`public-details-share-link`],`public-details-share-link`,`text`),title:f(r[`public-details-title`],`public-details-title`,`text`)},requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:f(r[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],uid:f(r.uid,`uid`,`text`),uploadExpiry:f(r[`upload-expiry`],`upload-expiry`,`text`)});a(await s(`Creating`,async()=>c.stream.edit({...p,account_id:u,identifier:r.identifier})),{successLabel:`Created`})}};function fe(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 pe={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:fe,handler:async r=>{if(r.dryRun){o({command:`cf stream embed get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/embed`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a,_((await s(`Loading`,async()=>v(`/accounts/${a}/stream/${encodeURIComponent(String(r.identifier))}/embed`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}},me={command:`embed`,describe:`Retrieve the HTML embed code snippet for a video`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(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 ge={command:`get <identifier>`,describe:`Fetches details for a single video.`,builder:he,handler:async r=>{if(r.dryRun){o({command:`cf stream get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}};function _e(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={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:_e,handler:async r=>{if(r.dryRun){o({command:`cf stream keys create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/keys`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.keys.create({account_id:l})),{successLabel:`Created`})}};function ye(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 be={command:`delete <identifier>`,describe:`Deletes signing keys and revokes all signed URLs generated with the key.`,builder:ye,handler:async r=>{if(r.dryRun){o({command:`cf stream keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/keys/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.keys.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Lists the video ID and creation date and time when a signing key was created.`,builder:xe,handler:async r=>{if(r.dryRun){o({command:`cf stream keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/keys`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.keys.get({account_id:l})),{successLabel:`Loaded`})}},Ce={command:`keys`,describe:`Signing keys used to generate short-lived signed URLs for private video playback`,builder:e=>e.command(ve).command(be).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(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 Te={command:`list`,describe:`Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.`,builder:g(we),handler:async r=>{let c={status:r.status,creator:r.creator,type:r.type,asc:r.asc,video_name:r[`video-name`],search:r.search,start:r.start,end:r.end,include_counts:r[`include-counts`],id:r.id,name:r.name,live_input_id:r[`live-input-id`],before:r.before,after:r.after,limit:r.limit};if(r.dryRun){o({command:`cf stream list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.stream.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ee(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`."}).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 De={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:Ee,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({defaultCreator:f(r[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:r[`delete-recording-after-days`],enabled:r.enabled,preferLowLatency:r[`prefer-low-latency`],recording:{allowedOrigins:r[`recording-allowed-origins`],hideLiveViewerCount:r[`recording-hide-live-viewer-count`],mode:f(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.stream.liveInputs.create({...e,account_id:u})),{successLabel:`Created`});return}let p=d({defaultCreator:f(r[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:r[`delete-recording-after-days`],enabled:r.enabled,preferLowLatency:r[`prefer-low-latency`],recording:{allowedOrigins:r[`recording-allowed-origins`],hideLiveViewerCount:r[`recording-hide-live-viewer-count`],mode:f(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}});a(await s(`Creating`,async()=>c.stream.liveInputs.create({...p,account_id:u})),{successLabel:`Created`})}};function Oe(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 ke={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:Oe,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
9
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.delete({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})}};function Ae(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 je={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:Ae,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs disable create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/disable`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation disables a live input. Active streams to it are dropped.`})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.disable.create({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})}},Me={command:`disable`,describe:`Operations for live-inputs.disable`,builder:e=>e.command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(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 Pe={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:Ne,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs enable create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/enable`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.liveInputs.enable.create({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`})}},Fe={command:`enable`,describe:`Operations for live-inputs.enable`,builder:e=>e.command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(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 Le={command:`get <live-input-identifier>`,describe:`Retrieves details of an existing live input.`,builder:Ie,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.liveInputs.get({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Loaded`})}};function Re(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 ze={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:Re,handler:async r=>{let c={include_counts:r[`include-counts`]};if(r.dryRun){o({command:`cf stream live-inputs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.stream.liveInputs.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Be(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 Ve={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:Be,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs outputs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?d({enabled:r.enabled,streamKey:f(r[`stream-key`],`stream-key`,`text`),url:f(r.url,`url`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.stream.liveInputs.outputs.create({...e,account_id:u,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`});return}r[`stream-key`]===void 0&&(r[`stream-key`]=await m(`stream-key`,`The streamKey used to authenticate against an output's target.`,{kind:`secret`})),r.url===void 0&&(r.url=await m(`url`,`The URL an output uses to restream.`,{kind:`secret`}));let p=d({enabled:r.enabled,streamKey:f(r[`stream-key`],`stream-key`,`text`),url:f(r.url,`url`,`text`)});a(await s(`Creating`,async()=>c.stream.liveInputs.outputs.create({...p,account_id:u,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`})}};function He(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 Ue={command:`delete <output-identifier>`,describe:`Deletes an output and removes it from the associated live input.`,builder:He,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs outputs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/outputs/${r[`output-identifier`]==null?`<output-identifier>`:encodeURIComponent(String(r[`output-identifier`]))}`,pathParams:{"output-identifier":String(r[`output-identifier`]??``),"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
11
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.outputs.delete({account_id:l,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`output-identifier`]})),{successLabel:`Deleted`})}};function We(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 Ge={command:`list`,describe:`Retrieves all outputs associated with a specified live input.`,builder:We,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs outputs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.liveInputs.outputs.list({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Loaded`})}};function Ke(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 qe={command:`update <output-identifier>`,describe:`Updates the state of an output.`,builder:Ke,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs outputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/outputs/${r[`output-identifier`]==null?`<output-identifier>`:encodeURIComponent(String(r[`output-identifier`]))}`,pathParams:{"output-identifier":String(r[`output-identifier`]??``),"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?d({enabled:r.enabled}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.stream.liveInputs.outputs.update({...e,account_id:u,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`output-identifier`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let f=d({enabled:r.enabled});a(await s(`Updating`,async()=>c.stream.liveInputs.outputs.update({...f,account_id:u,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`output-identifier`]})),{successLabel:`Updated`})}},Je={command:`outputs`,describe:`Operations for live-inputs.outputs`,builder:e=>e.command(Ve).command(Ue).command(Ge).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ye(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 Xe={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:Ye,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs rotate update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}/rotate_keys`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.liveInputs.rotate.update({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`})}},Ze={command:`rotate`,describe:`Operations for live-inputs.rotate`,builder:e=>e.command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(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 $e={command:`update <live-input-identifier>`,describe:`Updates a specified live input.`,builder:Qe,handler:async r=>{if(r.dryRun){o({command:`cf stream live-inputs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/live_inputs/${r[`live-input-identifier`]==null?`<live-input-identifier>`:encodeURIComponent(String(r[`live-input-identifier`]))}`,pathParams:{"live-input-identifier":String(r[`live-input-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?d({defaultCreator:f(r[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:r[`delete-recording-after-days`],enabled:r.enabled,preferLowLatency:r[`prefer-low-latency`],recording:{allowedOrigins:r[`recording-allowed-origins`],hideLiveViewerCount:r[`recording-hide-live-viewer-count`],mode:f(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.stream.liveInputs.update({...e,account_id:u,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Updated`});return}let p=d({defaultCreator:f(r[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:r[`delete-recording-after-days`],enabled:r.enabled,preferLowLatency:r[`prefer-low-latency`],recording:{allowedOrigins:r[`recording-allowed-origins`],hideLiveViewerCount:r[`recording-hide-live-viewer-count`],mode:f(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}});a(await s(`Updating`,async()=>c.stream.liveInputs.update({...p,account_id:u,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Updated`})}},et={command:`live-inputs`,describe:`Enable and disable live input streams`,builder:e=>e.command(De).command(ke).command(Le).command(ze).command($e).command(Me).command(Fe).command(Je).command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`access-rules`,{type:`string`,description:`The optional list of access rule constraints on the token. Access can be blocked or allowed based on an IP, IP range, or by country. Access rules are evaluated from first to last. If a rule matches, the associated action is applied and no further rules are evaluated. Provide as a JSON array of objects or @path/to/file.json.`}).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.`}).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 nt={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:tt,handler:async r=>{if(r.dryRun){o({command:`cf stream token create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/token`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?d({accessRules:u(r[`access-rules`],`access-rules`),downloadable:r.downloadable,exp:r.exp,flags:{original:r[`flags-original`]},id:f(r.id,`id`,`text`),nbf:r.nbf,pem:f(r.pem,`pem`,`text`)}):l(r.body)});return}let c=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.stream.token.create({...e,account_id:p,identifier:r.identifier})),{successLabel:`Created`});return}let m=d({accessRules:u(r[`access-rules`],`access-rules`),downloadable:r.downloadable,exp:r.exp,flags:{original:r[`flags-original`]},id:f(r.id,`id`,`text`),nbf:r.nbf,pem:f(r.pem,`pem`,`text`)});a(await s(`Creating`,async()=>c.stream.token.create({...m,account_id:p,identifier:r.identifier})),{successLabel:`Created`})}},rt={command:`token`,describe:`Generate short-lived signed URL tokens for secure private video playback`,builder:e=>e.command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function it(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 at={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:it,handler:async r=>{if(r.dryRun){o({command:`cf stream typed-downloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads/${r[`download-type`]==null?`<download-type>`:encodeURIComponent(String(r[`download-type`]))}`,pathParams:{identifier:String(r.identifier??``),"download-type":String(r[`download-type`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.stream.typedDownloads.create({account_id:l,identifier:r.identifier,download_type:r[`download-type`]})),{successLabel:`Created`})}};function ot(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 st={command:`delete <download-type>`,describe:`Delete specific type of download. For backwards-compatibility, DELETE requests to /downloads will delete the default download.`,builder:ot,handler:async r=>{if(r.dryRun){o({command:`cf stream typed-downloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}/downloads/${r[`download-type`]==null?`<download-type>`:encodeURIComponent(String(r[`download-type`]))}`,pathParams:{identifier:String(r.identifier??``),"download-type":String(r[`download-type`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
12
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.typedDownloads.delete({account_id:l,identifier:r.identifier,download_type:r[`download-type`]})),{successLabel:`Deleted`})}},ct={command:`typed-downloads`,describe:`Type-specific stream download creation and deletion`,builder:e=>e.command(at).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lt(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 ut={command:`storage-usage`,describe:`Returns information about an account's storage use.`,builder:lt,handler:async r=>{let c={creator:r.creator};if(r.dryRun){o({command:`cf stream videos storage-usage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/storage-usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.stream.videos.storageUsage({account_id:u,...c})),{successLabel:`Loaded`})}},dt={command:`videos`,describe:`Aggregate video storage usage statistics for the account`,builder:e=>e.command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ft(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 pt={command:`create`,describe:"Creates watermark profiles using a single `HTTP POST multipart/form-data` request.",builder:ft,handler:async u=>{if(u.dryRun){o({command:`cf stream watermarks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/watermarks`,pathParams:{},bodyKind:`multipart`,body:{name:u.name,opacity:u.opacity,padding:u.padding,position:u.position,scale:u.scale,url:u.url,body:u.body,file:u.file}});return}let d=await i(u),m=u.local?e:await t();if(u.accountId=m,u.file!==void 0||u.body!==void 0||u.name!==void 0||u.opacity!==void 0||u.padding!==void 0||u.position!==void 0||u.scale!==void 0){let e=new FormData;if(u.file){let t=p(u.file);e.append(`file`,new Blob([t]),u.file.split(/[\\/]/).filter(Boolean).pop())}else u.body!==void 0&&e.append(`file`,u.body);u.name!==void 0&&e.append(`name`,String(f(u.name,`name`,`text`)??``)),u.opacity!==void 0&&e.append(`opacity`,String(u.opacity)),u.padding!==void 0&&e.append(`padding`,String(u.padding)),u.position!==void 0&&e.append(`position`,String(f(u.position,`position`,`text`)??``)),u.scale!==void 0&&e.append(`scale`,String(u.scale)),a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${m}/stream/watermarks`,{body:e})),{successLabel:`Created`});return}if(u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${m}/stream/watermarks`,{body:e})),{successLabel:`Created`});return}let h={};u.name!==void 0&&c(h,[`name`],f(u.name,`name`,`text`)),u.opacity!==void 0&&c(h,[`opacity`],u.opacity),u.padding!==void 0&&c(h,[`padding`],u.padding),u.position!==void 0&&c(h,[`position`],f(u.position,`position`,`text`)),u.scale!==void 0&&c(h,[`scale`],u.scale),u.url!==void 0&&c(h,[`url`],f(u.url,`url`,`text`)),a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${m}/stream/watermarks`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ht={command:`delete <identifier>`,describe:`Deletes a watermark profile.`,builder:mt,handler:async r=>{if(r.dryRun){o({command:`cf stream watermarks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/watermarks/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
13
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.watermarks.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})}};function gt(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 _t={command:`get <identifier>`,describe:`Retrieves details for a single watermark profile.`,builder:gt,handler:async r=>{if(r.dryRun){o({command:`cf stream watermarks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/watermarks/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.watermarks.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})}};function vt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yt={command:`list`,describe:`Lists all watermark profiles for an account.`,builder:vt,handler:async r=>{if(r.dryRun){o({command:`cf stream watermarks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/watermarks`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.watermarks.list({account_id:l})),{successLabel:`Loaded`})}},$={command:`watermarks`,describe:`Watermark profiles that overlay an image on every video in the account`,builder:e=>e.command(pt).command(ht).command(_t).command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bt(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 xt={command:`delete`,describe:`Deletes a webhook.`,builder:bt,handler:async r=>{if(r.dryRun){o({command:`cf stream webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/webhook`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}a(await s(`Deleting`,async()=>c.stream.webhooks.delete({account_id:l})),{successLabel:`Deleted`})}};function St(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ct={command:`get`,describe:`Retrieves a list of webhooks.`,builder:St,handler:async r=>{if(r.dryRun){o({command:`cf stream webhooks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/webhook`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.stream.webhooks.get({account_id:l})),{successLabel:`Loaded`})}};function wt(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 Tt={command:`update`,describe:`Creates a webhook notification.`,builder:wt,handler:async r=>{if(r.dryRun){o({command:`cf stream webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/webhook`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({notification_url:f(r[`notification-url`],`notification-url`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.stream.webhooks.update({...e,account_id:u})),{successLabel:`Updated`});return}let p=d({notification_url:f(r[`notification-url`],`notification-url`,`text`)});a(await s(`Updating`,async()=>c.stream.webhooks.update({...p,account_id:u})),{successLabel:`Updated`})}},Et={command:`webhooks`,describe:`Webhook notifications for video lifecycle events (ready, error, etc.)`,builder:e=>e.command(xt).command(Ct).command(Tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Dt={command:`stream`,describe:`Video encoding, storage, and delivery — upload, live-stream, clip, caption, and embed video at scale`,builder:e=>e.command(J).command(X).command(de).command(ge).command(Te).command(T).command(B).command(U).command(K).command(ne).command(le).command(me).command(Ce).command(et).command(rt).command(ct).command(dt).command($).command(Et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Dt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`create`,describe:`Return new URL submissions`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf submit create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/submit`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.submit.create({account_id:l})),{successLabel:`Created`})}},l={command:`submit`,describe:`submit`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{t as s}from"./cli-types-C3nVfpSG.mjs";function c(e){return e.option(`type`,{type:`string`,description:`Filter by resource type. Can be repeated to filter by multiple types (OR logic). Example: ?type=zone&type=worker`}).option(`name`,{type:`string`,description:`Filter by resource name. Performs a case-insensitive substring match. Example: ?name=my-zone`}).option(`id`,{type:`string`,description:`Filter by resource ID. Can be repeated up to 50 times to filter by multiple IDs. Example: ?id=abc&id=def`}).option(`case-insensitive`,{type:`boolean`,description:"Match `tag` keys and values case-insensitively. Stored casing is unchanged. Example: ?tag=environment=production&case_insensitive=true"}).option(`tag`,{type:`string`,description:"Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.\n\nSupported syntax:\n- **Key-only**: `tag=<key>` - Resource must have the tag key (e.g., `tag=production`)\n- **Key-value**: `tag=<key>=<value>` - Resource must have the tag with specific value (e.g., `tag=env=prod`)\n- **Multiple values (OR)**: `tag=<key>=<v1>,<v2>` - Resource must have tag with any of the values (e.g., `tag=env=prod,staging`)\n- **Negate key-only**: `tag=!<key>` - Resource must not have the tag key (e.g., `tag=!archived`)\n- **Negate key-value**: `tag=<key>!=<value>` - Resource must not have the tag with specific value (e.g., `tag=region!=us-west-1`)\n\nMultiple tag parameters are combined with AND logic."}).option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`list`,describe:`Lists all tagged resources for an account.`,builder:s(c),handler:async s=>{let c={type:s.type,name:s.name,id:s.id,case_insensitive:s[`case-insensitive`],tag:s.tag,cursor:s.cursor};if(s.dryRun){a({command:`cf tags resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/resources`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.tags.resources.list({account_id:u,...c})),{successLabel:`Loaded`})}},u={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},d={command:`tags`,describe:`tags`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-DY_Y2bXC.mjs";import{t}from"./output-BqDR9h74.mjs";import{t as n}from"./dry-run-ILZRVpnp.mjs";import{t as r}from"./progress-jYW64HY7.mjs";function i(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`List of account types available for the Tenant to provision accounts.`,builder:i,handler:async i=>{if(i.dryRun){n({command:`cf tenant account-type list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/account_types`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.accountType.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},o={command:`account-type`,describe:`Operations for account-type`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function s(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`List of accounts for the Tenant.`,builder:s,handler:async i=>{if(i.dryRun){n({command:`cf tenant account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/accounts`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.account.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},l={command:`account`,describe:`Operations for account`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`List of innate entitlements available for the Tenant.`,builder:u,handler:async i=>{if(i.dryRun){n({command:`cf tenant entitlement list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/entitlements`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.entitlement.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},f={command:`entitlement`,describe:`Operations for entitlement`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function p(e){return e.positional(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <tenant-id>`,describe:`Retrieves a Tenant by Tenant ID.`,builder:p,handler:async i=>{if(i.dryRun){n({command:`cf tenant get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.get({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`tenant-id`,{type:`string`,description:`Tenant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List of active members (Cloudflare users) for the Tenant.`,builder:h,handler:async i=>{if(i.dryRun){n({command:`cf tenant membership list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(i[`tenant-id`]))}/memberships`,pathParams:{"tenant-id":String(i[`tenant-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenant.membership.list({tenant_id:i[`tenant-id`]})),{successLabel:`Loaded`})}},_={command:`membership`,describe:`Operations for membership`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`tenant`,describe:`tenant`,builder:e=>e.command(m).command(l).command(o).command(f).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-DY_Y2bXC.mjs";import{t}from"./output-BqDR9h74.mjs";import{t as n}from"./dry-run-ILZRVpnp.mjs";import{t as r}from"./progress-jYW64HY7.mjs";import{n as i,t as a}from"./body-parser-BGVbwPeM.mjs";import{n as o}from"./input-validation-1esLElok.mjs";import{a as s,n as c}from"./prompt-CyATfGUu.mjs";function l(e){return e.positional(`tenant-tag`,{type:`string`,description:`Tenant identifier tag.`,demandOption:!0}).option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,default:1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`create <tenant-tag>`,describe:`Adds a custom nameserver for a tenant.`,builder:l,handler:async c=>{if(c.dryRun){n({command:`cf tenant-custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/tenants/${c[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(c[`tenant-tag`]))}/custom_ns`,pathParams:{"tenant-tag":String(c[`tenant-tag`]??``)},bodyKind:`json`,body:c.body===void 0?a({ns_name:o(c[`ns-name`],`ns-name`,`text`),ns_set:c[`ns-set`]}):i(c.body)});return}let l=await e(c);if(c.body){let e=i(c.body);t(await r(`Creating`,async()=>l.tenantCustomNameservers.create({body:e,tenant_tag:c[`tenant-tag`]})),{successLabel:`Created`});return}c[`ns-name`]===void 0&&(c[`ns-name`]=await s(`ns-name`,`The FQDN of the name server.`));let u=a({ns_name:o(c[`ns-name`],`ns-name`,`text`),ns_set:c[`ns-set`]});t(await r(`Creating`,async()=>l.tenantCustomNameservers.create({body:u,tenant_tag:c[`tenant-tag`]})),{successLabel:`Created`})}};function d(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,demandOption:!0}).option(`tenant-tag`,{type:`string`,description:`Tenant identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <custom-ns-id>`,describe:`Deletes a tenant's custom nameserver.`,builder:d,handler:async i=>{if(i.dryRun){n({command:`cf tenant-custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(i[`tenant-tag`]))}/custom_ns/${i[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(i[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(i[`custom-ns-id`]??``),"tenant-tag":String(i[`tenant-tag`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await c({force:!!i.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}t(await r(`Deleting`,async()=>a.tenantCustomNameservers.delete({tenant_tag:i[`tenant-tag`],custom_ns_id:i[`custom-ns-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`tenant-tag`,{type:`string`,description:`Tenant identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <tenant-tag>`,describe:`Lists a tenant's custom nameservers.`,builder:p,handler:async i=>{if(i.dryRun){n({command:`cf tenant-custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${i[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(i[`tenant-tag`]))}/custom_ns`,pathParams:{"tenant-tag":String(i[`tenant-tag`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.tenantCustomNameservers.get({tenant_tag:i[`tenant-tag`]})),{successLabel:`Loaded`})}},h={command:`tenant-custom-nameservers`,describe:`tenant-custom-nameservers`,builder:e=>e.command(u).command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./output-
|
|
2
|
+
import{t as e}from"./output-BqDR9h74.mjs";import{n as t,t as n}from"./metadata-DEqBUaSv.mjs";function r(e){return e.replace(/[\s-]+/g,`_`)}function i(e){let t={type:e.type,description:e.description};return`default`in e&&e.default!==void 0&&(t.default=e.default),e.enum&&e.enum.length>0&&(t.enum=e.enum),t}function a(e){let t={},n=[];for(let r of e.arguments)t[r.name]=i(r),r.required&&n.push(r.name);for(let r of e.options)t[r.name]=i(r),r.required&&n.push(r.name);return{name:r(e.command),description:e.description,inputSchema:{type:`object`,properties:t,required:n}}}const o={command:`tools`,describe:!1,builder:e=>e,handler:async r=>{let i=t(import.meta.url,`commands.json`,n)?.commands??null;if(i===null){console.error(`Warning: Command metadata file not found. Run the build to generate it.`),e({version:`1.0`,tools:[]});return}e({version:`1.0`,tools:i.map(a)})}};export{o as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,n as d}from"./prompt-CyATfGUu.mjs";import{t as f}from"./cli-types-C3nVfpSG.mjs";function p(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <tunnel-id>`,describe:`Retrieves the configuration for a remotely managed Cloudflare Tunnel.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf tunnel config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.config.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function h(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-origin-request-access-aud-tag`,{type:`string`,array:!0,description:`Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API.`}).option(`config-origin-request-access-required`,{type:`boolean`,description:`Deny traffic that has not fulfilled Access authorization.`}).option(`config-origin-request-access-team-name`,{type:`string`,description:`The config.originRequest.access.teamName field`}).option(`config-origin-request-ca-pool`,{type:`string`,description:`Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare.`}).option(`config-origin-request-connect-timeout`,{type:`number`,description:`Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout.`}).option(`config-origin-request-disable-chunked-encoding`,{type:`boolean`,description:`Disables chunked transfer encoding. Useful if you are running a WSGI server.`}).option(`config-origin-request-http2origin`,{type:`boolean`,description:`Attempt to connect to origin using HTTP2. Origin must be configured as https.`}).option(`config-origin-request-http-host-header`,{type:`string`,description:`Sets the HTTP Host header on requests sent to the local service.`}).option(`config-origin-request-keep-alive-connections`,{type:`number`,description:`Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections.`}).option(`config-origin-request-keep-alive-timeout`,{type:`number`,description:`Timeout after which an idle keepalive connection can be discarded.`}).option(`config-origin-request-match-snito-host`,{type:`boolean`,description:`Auto configure the Hostname on the origin server certificate.`}).option(`config-origin-request-no-happy-eyeballs`,{type:`boolean`,description:`Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols.`}).option(`config-origin-request-no-tlsverify`,{type:`boolean`,description:`Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted.`}).option(`config-origin-request-origin-server-name`,{type:`string`,description:`Hostname that cloudflared should expect from your origin server certificate.`}).option(`config-origin-request-proxy-type`,{type:`string`,description:`cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy.
|
|
3
3
|
`}).option(`config-origin-request-tcp-keep-alive`,{type:`number`,description:`The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server.`}).option(`config-origin-request-tls-timeout`,{type:`number`,description:`Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`config-origin-request-access-aud-tag`,`config-origin-request-access-required`,`config-origin-request-access-team-name`,`config-origin-request-ca-pool`,`config-origin-request-connect-timeout`,`config-origin-request-disable-chunked-encoding`,`config-origin-request-http2origin`,`config-origin-request-http-host-header`,`config-origin-request-keep-alive-connections`,`config-origin-request-keep-alive-timeout`,`config-origin-request-match-snito-host`,`config-origin-request-no-happy-eyeballs`,`config-origin-request-no-tlsverify`,`config-origin-request-origin-server-name`,`config-origin-request-proxy-type`,`config-origin-request-tcp-keep-alive`,`config-origin-request-tls-timeout`].some(t=>e[t]!==void 0)){let t=[`config-origin-request-access-aud-tag`,`config-origin-request-access-team-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0})}const g={command:`update <tunnel-id>`,describe:`Replaces the configuration for a remotely managed Cloudflare Tunnel, including its ingress rules and origin request settings.`,builder:h,handler:async u=>{if(u.dryRun){a({command:`cf tunnel config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({config:{originRequest:{access:{audTag:u[`config-origin-request-access-aud-tag`],required:u[`config-origin-request-access-required`],teamName:l(u[`config-origin-request-access-team-name`],`config-origin-request-access-team-name`,`text`)},caPool:l(u[`config-origin-request-ca-pool`],`config-origin-request-ca-pool`,`text`),connectTimeout:u[`config-origin-request-connect-timeout`],disableChunkedEncoding:u[`config-origin-request-disable-chunked-encoding`],http2Origin:u[`config-origin-request-http2origin`],httpHostHeader:l(u[`config-origin-request-http-host-header`],`config-origin-request-http-host-header`,`text`),keepAliveConnections:u[`config-origin-request-keep-alive-connections`],keepAliveTimeout:u[`config-origin-request-keep-alive-timeout`],matchSNItoHost:u[`config-origin-request-match-snito-host`],noHappyEyeballs:u[`config-origin-request-no-happy-eyeballs`],noTLSVerify:u[`config-origin-request-no-tlsverify`],originServerName:l(u[`config-origin-request-origin-server-name`],`config-origin-request-origin-server-name`,`text`),proxyType:l(u[`config-origin-request-proxy-type`],`config-origin-request-proxy-type`,`text`),tcpKeepAlive:u[`config-origin-request-tcp-keep-alive`],tlsTimeout:u[`config-origin-request-tls-timeout`]}}}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.tunnel.config.update({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({config:{originRequest:{access:{audTag:u[`config-origin-request-access-aud-tag`],required:u[`config-origin-request-access-required`],teamName:l(u[`config-origin-request-access-team-name`],`config-origin-request-access-team-name`,`text`)},caPool:l(u[`config-origin-request-ca-pool`],`config-origin-request-ca-pool`,`text`),connectTimeout:u[`config-origin-request-connect-timeout`],disableChunkedEncoding:u[`config-origin-request-disable-chunked-encoding`],http2Origin:u[`config-origin-request-http2origin`],httpHostHeader:l(u[`config-origin-request-http-host-header`],`config-origin-request-http-host-header`,`text`),keepAliveConnections:u[`config-origin-request-keep-alive-connections`],keepAliveTimeout:u[`config-origin-request-keep-alive-timeout`],matchSNItoHost:u[`config-origin-request-match-snito-host`],noHappyEyeballs:u[`config-origin-request-no-happy-eyeballs`],noTLSVerify:u[`config-origin-request-no-tlsverify`],originServerName:l(u[`config-origin-request-origin-server-name`],`config-origin-request-origin-server-name`,`text`),proxyType:l(u[`config-origin-request-proxy-type`],`config-origin-request-proxy-type`,`text`),tcpKeepAlive:u[`config-origin-request-tcp-keep-alive`],tlsTimeout:u[`config-origin-request-tls-timeout`]}}});i(await o(`Updating`,async()=>d.tunnel.config.update({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}},_={command:`config`,describe:`Operations for config`,builder:e=>e.command(m).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`client-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`cleanup <tunnel-id>`,describe:`Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel independently of its current state. If no connector id (client_id) is provided all connectors will be removed. We recommend running this command after rotating tokens.`,builder:v,handler:async s=>{let c={client_id:s[`client-id`]};if(s.dryRun){a({command:`cf tunnel connections cleanup`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();if(s.accountId=u,!await d({force:!!s.force,message:`This operation removes Cloudflare Tunnel connections.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>l.tunnel.connections.cleanup({account_id:u,tunnel_id:s[`tunnel-id`],...c})),{successLabel:`Deleted`})}};function b(e){return e.option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists the connections for a Cloudflare Tunnel, including connector IDs, cloudflared versions, and Cloudflare locations.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf tunnel connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.connections.list({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},S={command:`connections`,describe:`Operations for connections`,builder:e=>e.command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <connector-id>`,describe:`Retrieves a connector and its connection details for a Cloudflare Tunnel, including its cloudflared version, architecture, and connected Cloudflare locations.`,builder:C,handler:async s=>{if(s.dryRun){a({command:`cf tunnel connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``),"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.connectors.get({account_id:l,tunnel_id:s[`tunnel-id`],connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},T={command:`connectors`,describe:`Operations for connectors`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`config-source`,{type:`string`,description:"Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.",choices:[`local`,`cloudflare`],default:`local`}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Creates a remotely or locally managed Cloudflare Tunnel in an account. After creation, retrieve its token and run cloudflared to establish the connector connection.`,builder:E,handler:async d=>{if(d.dryRun){a({command:`cf tunnel create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({config_src:l(d[`config-source`],`config-source`,`text`),name:l(d.name,`name`,`text`),tunnel_secret:l(d[`tunnel-secret`],`tunnel-secret`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.tunnel.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for a tunnel.`));let m=c({config_src:l(d[`config-source`],`config-source`,`text`),name:l(d.name,`name`,`text`),tunnel_secret:l(d[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Creating`,async()=>f.tunnel.create({...m,account_id:p})),{successLabel:`Created`})}};function O(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const k={command:`delete <tunnel-id>`,describe:`Permanently deletes a Cloudflare Tunnel from an account. The tunnel must have no active connections.`,builder:O,handler:async s=>{if(s.dryRun){a({command:`cf tunnel delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation permanently deletes a Cloudflare Tunnel.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>c.tunnel.delete({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Deleted`})}};function A(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`edit <tunnel-id>`,describe:`Updates the name or secret of an existing Cloudflare Tunnel.`,builder:A,handler:async u=>{if(u.dryRun){a({command:`cf tunnel edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.tunnel.edit({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Updating`,async()=>d.tunnel.edit({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}};function M(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <tunnel-id>`,describe:`Fetches a single Cloudflare Tunnel.`,builder:M,handler:async s=>{if(s.dryRun){a({command:`cf tunnel get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function P(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Lists and filters Cloudflare Tunnels in an account.`,builder:f(P),handler:async s=>{let c={name:s.name,is_deleted:s[`is-deleted`],existed_at:s[`existed-at`],uuid:s.uuid,was_active_at:s[`was-active-at`],was_inactive_at:s[`was-inactive-at`],include_prefix:s[`include-prefix`],exclude_prefix:s[`exclude-prefix`],status:s.status,per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf tunnel list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.tunnel.list({account_id:u,...c})),{successLabel:`Loaded`})}};function I(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`resources`,{type:`string`,array:!0,description:`The resources field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`create <tunnel-id>`,describe:`Creates a short-lived management token for the requested Tunnel management resources, such as streaming logs. Treat the token as a secret.`,builder:I,handler:async l=>{if(l.dryRun){a({command:`cf tunnel management token create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${l[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(l[`tunnel-id`]))}/management`,pathParams:{"tunnel-id":String(l[`tunnel-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({resources:l.resources}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.tunnel.management.token.create({...e,account_id:d,tunnel_id:l[`tunnel-id`]})),{successLabel:`Created`});return}if(l.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let f=c({resources:l.resources});i(await o(`Creating`,async()=>u.tunnel.management.token.create({...f,account_id:d,tunnel_id:l[`tunnel-id`]})),{successLabel:`Created`})}},R={command:`token`,describe:`Operations for management.token`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`management`,describe:`Operations for management`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <tunnel-id>`,describe:`Retrieves the token used to run cloudflared and associate it with a specific Cloudflare Tunnel. Treat the token as a secret.`,builder:B,handler:async s=>{if(s.dryRun){a({command:`cf tunnel token get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/cfd_tunnel/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/token`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.tunnel.token.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},H={command:`token`,describe:`Operations for token`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`tunnel`,describe:`tunnel`,builder:e=>e.command(D).command(k).command(j).command(N).command(F).command(_).command(S).command(T).command(z).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
|