cf 0.14.0 → 0.15.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.
Files changed (448) hide show
  1. package/dist/_meta/commands.json +4040 -1629
  2. package/dist/_meta/hand-written-commands.json +16 -43
  3. package/dist/_meta/schemas.json +445 -756
  4. package/dist/abuse-reports-BAQR1w79.mjs +26 -0
  5. package/dist/access-C8KMplzp.mjs +27 -0
  6. package/dist/account-B-KQSR0L.mjs +12 -0
  7. package/dist/account-tags-EncLJpLc.mjs +15 -0
  8. package/dist/accounts-BA4Mp3A_.mjs +132 -0
  9. package/dist/acm-ByxUJcqF.mjs +15 -0
  10. package/dist/addressing-C-ym0h0G.mjs +93 -0
  11. package/dist/agent-memory-CkPSiZDI.mjs +34 -0
  12. package/dist/ai-DkE_Q64s.mjs +31 -0
  13. package/dist/ai-audit-pPcjYWI5.mjs +6 -0
  14. package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
  15. package/dist/ai-search-DLD_kDS1.mjs +79 -0
  16. package/dist/ai-security-jyZcBl9g.mjs +10 -0
  17. package/dist/alerting-DOROjm8E.mjs +56 -0
  18. package/dist/analytics-rQ-h-plT.mjs +21 -0
  19. package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
  20. package/dist/{lifecycle-CadF_i2n.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
  21. package/dist/api-security-B8p8vp8u.mjs +154 -0
  22. package/dist/argo-g8SjUb_t.mjs +10 -0
  23. package/dist/artifacts-B1PaeF5h.mjs +43 -0
  24. package/dist/audit-logs-DmU_PHy_.mjs +4 -0
  25. package/dist/auth-CZqics6E.mjs +2 -0
  26. package/dist/auth-Cp7gT-AF.mjs +8 -0
  27. package/dist/billing-CvTbUg-H.mjs +23 -0
  28. package/dist/bot-management-z53tbcbH.mjs +9 -0
  29. package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
  30. package/dist/brand-protection-DzV211IQ.mjs +27 -0
  31. package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
  32. package/dist/browser-run-DYQvMAyo.mjs +46 -0
  33. package/dist/build-BPIp8J5F.mjs +2 -0
  34. package/dist/build-OC77a1zq.mjs +2 -0
  35. package/dist/builds-CwKRqjQ5.mjs +71 -0
  36. package/dist/cache-CugNPPsJ.mjs +45 -0
  37. package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
  38. package/dist/cf-oadujOtC.mjs +18 -0
  39. package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
  40. package/dist/chunk-DL5FNmn1.mjs +2 -0
  41. package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
  42. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
  43. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
  44. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
  45. package/dist/client-certificates-DZUIqBTB.mjs +13 -0
  46. package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
  47. package/dist/cloud-connector-avpf86kG.mjs +6 -0
  48. package/dist/cloudflared-DhItYrCq.mjs +2 -0
  49. package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
  50. package/dist/command-B2Qe-WUa.mjs +2 -0
  51. package/dist/{command-BL6weJf3.mjs → command-CF0giIIc.mjs} +1 -1
  52. package/dist/command-D45NW-R3.mjs +2 -0
  53. package/dist/command-DIvPLK8x.mjs +2 -0
  54. package/dist/{completions-Dn621okY.mjs → completions-xPLd1cvL.mjs} +3 -3
  55. package/dist/{config-BY6KpMZs.mjs → config-B4vIa0zp.mjs} +1 -1
  56. package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
  57. package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
  58. package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
  59. package/dist/connectors-BSmhzNB7.mjs +15 -0
  60. package/dist/containers-B5vDcFzo.mjs +78 -0
  61. package/dist/{dist-CFQREIRi.mjs → containers-CFzvhmyz.mjs} +84 -83
  62. package/dist/content-scan-CeLZAcbT.mjs +14 -0
  63. package/dist/cps-BlI_Od72.mjs +6 -0
  64. package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
  65. package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
  66. package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
  67. package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
  68. package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
  69. package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
  70. package/dist/custom-pages-BgfhGksj.mjs +21 -0
  71. package/dist/d1-P2kWbdID.mjs +45 -0
  72. package/dist/data-security-pBIozmRL.mjs +71 -0
  73. package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
  74. package/dist/delegate-GctF_lrq.mjs +2 -0
  75. package/dist/delegate.mjs +1 -1
  76. package/dist/{deploy-BtETDvDA.mjs → deploy-CVYdt3NK.mjs} +1 -1
  77. package/dist/{deploy-input-BoLTdQzS.mjs → deploy-input-DpOgndz4.mjs} +1 -1
  78. package/dist/{dev-B5WcIpEr.mjs → dev-PPUBjWcm.mjs} +1 -1
  79. package/dist/diagnostics-C62habGQ.mjs +15 -0
  80. package/dist/{dialog-Bud0hiYv.mjs → dialog-C_ccBiZp.mjs} +1 -1
  81. package/dist/dist-B4pQ4CXK.mjs +48 -0
  82. package/dist/{dist-BRg_z9Ut.mjs → dist-BpadEMNY.mjs} +1 -1
  83. package/dist/dist-dc4E1u01.mjs +272 -0
  84. package/dist/dls-CpkcyQ8C.mjs +17 -0
  85. package/dist/dns-DG1X4Wap.mjs +135 -0
  86. package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
  87. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
  88. package/dist/dry-run-CLX6Pbtq.mjs +2 -0
  89. package/dist/durable-objects-D214VhxH.mjs +8 -0
  90. package/dist/email-auth-Ba4ONan2.mjs +6 -0
  91. package/dist/email-routing-BlqKnqNM.mjs +45 -0
  92. package/dist/email-security-Dl1E1Dko.mjs +160 -0
  93. package/dist/email-sending-DIRSSRIz.mjs +47 -0
  94. package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
  95. package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
  96. package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
  97. package/dist/firewall-DdsDh8GD.mjs +56 -0
  98. package/dist/flagship-CkUIVW7c.mjs +28 -0
  99. package/dist/fraud-BUpZgvQT.mjs +22 -0
  100. package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
  101. package/dist/healthchecks-DjQWb3EM.mjs +22 -0
  102. package/dist/hostnames-ClBLPbct.mjs +11 -0
  103. package/dist/hyperdrive-U54xZsWU.mjs +37 -0
  104. package/dist/iam-T-wWmOep.mjs +52 -0
  105. package/dist/images-ia5UG1GW.mjs +71 -0
  106. package/dist/index.mjs +1 -1
  107. package/dist/intel-BhswZLMI.mjs +76 -0
  108. package/dist/{interactive-CGOh-aYq.mjs → interactive-B6woOLo-.mjs} +23 -23
  109. package/dist/interactive-DnUvQHjc.mjs +2 -0
  110. package/dist/ips-Dad_EvhM.mjs +4 -0
  111. package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
  112. package/dist/keys-DjIPvqj4.mjs +4 -0
  113. package/dist/kv-DzXVnK94.mjs +21 -0
  114. package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
  115. package/dist/lifecycle-Ichnb2x1.mjs +2 -0
  116. package/dist/load-balancers-3wGHPsYz.mjs +76 -0
  117. package/dist/local-B6b2OIBW.mjs +2 -0
  118. package/dist/local-BrfySqnx.mjs +2 -0
  119. package/dist/{local-runtime-Dj8k-p62.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
  120. package/dist/login-CEQbOgBM.mjs +5 -0
  121. package/dist/login-DEWvGuaU.mjs +2 -0
  122. package/dist/logo-matches-YGRPstPi.mjs +6 -0
  123. package/dist/logos-BirufUgo.mjs +7 -0
  124. package/dist/logpush-BlNbUHyV.mjs +46 -0
  125. package/dist/logs-DmFlVF9q.mjs +48 -0
  126. package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
  127. package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
  128. package/dist/magic-transit-CBVOK2aa.mjs +387 -0
  129. package/dist/managed-defense-BdW6s483.mjs +18 -0
  130. package/dist/managed-transforms-BIeiofIS.mjs +9 -0
  131. package/dist/matches-CAnwci0P.mjs +6 -0
  132. package/dist/mcp-BfhOMGFE.mjs +32 -0
  133. package/dist/mesh-CxUL2Wf-.mjs +26 -0
  134. package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
  135. package/dist/network-C68psMbz.mjs +50 -0
  136. package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
  137. package/dist/oauth-D4bkeMAw.mjs +14 -0
  138. package/dist/oauth-DouM-qz0.mjs +2 -0
  139. package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
  140. package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
  141. package/dist/observability-DpYxkFeZ.mjs +80 -0
  142. package/dist/{open-PBXRGS4R-ClEt4E8F.mjs → open-PBXRGS4R-C4CKEADM.mjs} +1 -1
  143. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
  144. package/dist/organization-Dg55Xfz7.mjs +75 -0
  145. package/dist/organizations-QnyzGjB2.mjs +4 -0
  146. package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
  147. package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
  148. package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
  149. package/dist/{output-Z2lQmPUW.mjs → output-Bia1u2k5.mjs} +1 -1
  150. package/dist/page-rules--D3eXrCf.mjs +39 -0
  151. package/dist/pages-Ce8DDgNr.mjs +60 -0
  152. package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
  153. package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
  154. package/dist/pipelines-CAqCgBLh.mjs +44 -0
  155. package/dist/precursor-DBnn4Q35.mjs +4 -0
  156. package/dist/previews-y_nSqWK5.mjs +4 -0
  157. package/dist/progress-Bi02B6v4.mjs +2 -0
  158. package/dist/{prompt-BP8XrQSj.mjs → prompt-Bx2PB-tt.mjs} +1 -1
  159. package/dist/queries-dg-CVXjf.mjs +9 -0
  160. package/dist/queues-C_ilLbRI.mjs +63 -0
  161. package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
  162. package/dist/r2-hZAkra-l.mjs +127 -0
  163. package/dist/radar-BO9b0aZy.mjs +300 -0
  164. package/dist/{raw-fetch-DNH2V8qH.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
  165. package/dist/realtime-eSavuSeE.mjs +172 -0
  166. package/dist/registrar-Ct30kOXZ.mjs +43 -0
  167. package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
  168. package/dist/{registry-BrtVdMrC.mjs → registry-vreNkX6u.mjs} +1 -1
  169. package/dist/reporting-B-F5aWUJ.mjs +14 -0
  170. package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
  171. package/dist/request-tracers-CaubpUFV.mjs +4 -0
  172. package/dist/resolve-BXemCSyA.mjs +2 -0
  173. package/dist/resolve-CUDKxUrW.mjs +2 -0
  174. package/dist/resource-sharing-6Snv-b69.mjs +40 -0
  175. package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
  176. package/dist/rules-C26eyeA5.mjs +18 -0
  177. package/dist/rulesets-BKzIwVtJ.mjs +37 -0
  178. package/dist/rum-Xdw5hyWY.mjs +30 -0
  179. package/dist/run-BBBMrSrs.mjs +2 -0
  180. package/dist/run-BRucX7Rz.mjs +2 -0
  181. package/dist/{schema-DmuJtMN5.mjs → schema-DqtYndhB.mjs} +1 -1
  182. package/dist/{schema-flags-CUGxFeZe.mjs → schema-flags-CebDI0f1.mjs} +1 -1
  183. package/dist/scim-odJTXiIe.mjs +18 -0
  184. package/dist/{sdk-Bvqx-_3z.mjs → sdk-CvIO3tWS.mjs} +1 -1
  185. package/dist/secrets-store-RYpWWzaw.mjs +24 -0
  186. package/dist/security-center-B3D95vCa.mjs +30 -0
  187. package/dist/security-txt-BSytVv-9.mjs +9 -0
  188. package/dist/shared-D67owd9x.mjs +2 -0
  189. package/dist/smart-shield-C83Sfnf4.mjs +24 -0
  190. package/dist/snippets-B6oE9WIa.mjs +20 -0
  191. package/dist/source-BR4_k2ad.mjs +6 -0
  192. package/dist/spawn-CKqJ9J4_.mjs +523 -0
  193. package/dist/spectrum-CfxY--X_.mjs +83 -0
  194. package/dist/speed-DzK-kiWt.mjs +24 -0
  195. package/dist/src-B3h6tKMt.mjs +108 -0
  196. package/dist/ssl-dnjzPcSB.mjs +45 -0
  197. package/dist/startup-profile-CYEokTVe.mjs +2 -0
  198. package/dist/startup-profile-CgWHy4rE.mjs +17 -0
  199. package/dist/state-BxCejn42.mjs +2 -0
  200. package/dist/state-DSzkxXML.mjs +2 -0
  201. package/dist/stream-oFyhS4Wi.mjs +102 -0
  202. package/dist/submit-4f-ravmC.mjs +4 -0
  203. package/dist/tags-DrIP6Uiq.mjs +4 -0
  204. package/dist/{telemetry-2s9Y3FaN.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
  205. package/dist/telemetry-Ds4epd3D.mjs +2 -0
  206. package/dist/telemetry-mKEb8lYB.mjs +2 -0
  207. package/dist/tenant-C-gc3NWv.mjs +12 -0
  208. package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
  209. package/dist/{tools-Dz1JCrHd.mjs → tools-BMKpYraQ.mjs} +1 -1
  210. package/dist/tunnels-D0QYsskp.mjs +29 -0
  211. package/dist/turnstile-C6Q3spRB.mjs +33 -0
  212. package/dist/ui-DH95w1Qk.mjs +5 -0
  213. package/dist/undici-DTSBJHNS.mjs +96 -0
  214. package/dist/update-check-BBS1K1jt.mjs +2 -0
  215. package/dist/update-check-CTLoakFV.mjs +2 -0
  216. package/dist/update-check-worker.mjs +2 -0
  217. package/dist/url-info-Cs0V89qq.mjs +4 -0
  218. package/dist/url-normalization-DaEQYy5h.mjs +9 -0
  219. package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
  220. package/dist/user-BV1VY3Kl.mjs +112 -0
  221. package/dist/values-qDS63E43.mjs +4 -0
  222. package/dist/vectorize-NFzD3mP5.mjs +32 -0
  223. package/dist/version-W6_TN_kN.mjs +2 -0
  224. package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
  225. package/dist/web-assets-Gd6z8dbt.mjs +64 -0
  226. package/dist/web3-DCJx4NRp.mjs +28 -0
  227. package/dist/workers-B-j-1ygi.mjs +36 -0
  228. package/dist/workers-builds-DPrNKjZW.mjs +14 -0
  229. package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
  230. package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
  231. package/dist/workflows-C2KKIJjl.mjs +43 -0
  232. package/dist/zaraz-CVLCs1IX.mjs +22 -0
  233. package/dist/zero-trust-BtJi4OXF.mjs +795 -0
  234. package/dist/zone-hKgt0WzO.mjs +4 -0
  235. package/dist/zones-CCNyaD3J.mjs +124 -0
  236. package/package.json +12 -9
  237. package/dist/_meta/agent-context.json +0 -195
  238. package/dist/abuse-reports-CDFjJ2e8.mjs +0 -8
  239. package/dist/access-BoT1waG4.mjs +0 -11
  240. package/dist/account-agnMUKWj.mjs +0 -2
  241. package/dist/account-tags-BRMMHCee.mjs +0 -9
  242. package/dist/accounts-Cut77dAt.mjs +0 -30
  243. package/dist/acm-C8WgXNCl.mjs +0 -3
  244. package/dist/addressing-CR8EV42x.mjs +0 -13
  245. package/dist/agent-context-Wj5TRRbW.mjs +0 -8
  246. package/dist/agent-memory-CVJpKKZy.mjs +0 -6
  247. package/dist/ai-BbNYt-yI.mjs +0 -5
  248. package/dist/ai-audit-mVajM-2i.mjs +0 -2
  249. package/dist/ai-gateway-BsepSA_v.mjs +0 -13
  250. package/dist/ai-search-DbEJqm5-.mjs +0 -7
  251. package/dist/ai-security-DmyB5EYk.mjs +0 -4
  252. package/dist/alerting-dmy3hd8O.mjs +0 -6
  253. package/dist/analytics-B1xBMla0.mjs +0 -5
  254. package/dist/analytics_engine-DazCn3iC.mjs +0 -2
  255. package/dist/api-security-0HXCzfHk.mjs +0 -50
  256. package/dist/argo-DSHsE8zv.mjs +0 -2
  257. package/dist/artifacts-CwiU9Mxu.mjs +0 -5
  258. package/dist/audit-logs-DwFtMDwH.mjs +0 -2
  259. package/dist/auth-B0ZyXc3y.mjs +0 -5
  260. package/dist/auth-DWxtJ918.mjs +0 -8
  261. package/dist/billing-Cbpadkgu.mjs +0 -3
  262. package/dist/bot-management-B6M2Vyyn.mjs +0 -5
  263. package/dist/botnet-feed-Dn8UuE4h.mjs +0 -3
  264. package/dist/brand-protection-B5R0b3pu.mjs +0 -3
  265. package/dist/browser-extension-D55pYZf_.mjs +0 -3
  266. package/dist/browser-run-C1b2VkGB.mjs +0 -4
  267. package/dist/build-CP2JUfV1.mjs +0 -2
  268. package/dist/builds-CVEXO_4a.mjs +0 -9
  269. package/dist/cache-BU5xX82E.mjs +0 -9
  270. package/dist/certificate-authorities--tZTWJWD.mjs +0 -2
  271. package/dist/cf-BV2HLCQm.mjs +0 -18
  272. package/dist/chunk-QBZBEHZB-BcCMlc8C.mjs +0 -2
  273. package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +0 -103
  274. package/dist/chunk-vbHwaUoU.mjs +0 -2
  275. package/dist/client-certificates-DX84qeYG.mjs +0 -3
  276. package/dist/client-side-security-DsSO2rZQ.mjs +0 -37
  277. package/dist/cloud-connector-cf8qlxap.mjs +0 -2
  278. package/dist/cloudforce-one-DzVXorbu.mjs +0 -32
  279. package/dist/command-DYrspBc0.mjs +0 -2
  280. package/dist/connector-interrupts-DqpqPPkp.mjs +0 -2
  281. package/dist/connector-telemetry-events-CCD-_B-8.mjs +0 -2
  282. package/dist/connector-telemetry-snapshots-D3CeGGhk.mjs +0 -2
  283. package/dist/connectors-aPQspZdg.mjs +0 -3
  284. package/dist/containers-D0Kjl8h-.mjs +0 -58
  285. package/dist/content-scan-BVx18XmS.mjs +0 -4
  286. package/dist/cps-ByazyM0x.mjs +0 -2
  287. package/dist/csamScanner-OG5lQxBC.mjs +0 -6
  288. package/dist/ct-alerting-BJx5n8Zf.mjs +0 -3
  289. package/dist/custom-certificates-BuJ2e9TA.mjs +0 -5
  290. package/dist/custom-csrs-CR_5qbST.mjs +0 -3
  291. package/dist/custom-hostnames-BzDTsQXb.mjs +0 -5
  292. package/dist/custom-nameservers-OfMPRGkD.mjs +0 -3
  293. package/dist/custom-pages-BmGXoTIo.mjs +0 -3
  294. package/dist/d1-DedC8N0N.mjs +0 -21
  295. package/dist/data-security-B2UB26ry.mjs +0 -7
  296. package/dist/dcv-delegation-C11vmzbG.mjs +0 -2
  297. package/dist/diagnostics-Cf6BLpAo.mjs +0 -3
  298. package/dist/dist-CyisSore.mjs +0 -371
  299. package/dist/dist-Dr4Hg_Up.mjs +0 -48
  300. package/dist/dls-R6PvHbhj.mjs +0 -3
  301. package/dist/dns-Cl8se64c.mjs +0 -29
  302. package/dist/dns-firewall-WtmKilDT.mjs +0 -57
  303. package/dist/dry-run-YSQndLvt.mjs +0 -2
  304. package/dist/durable-objects-jfVU6yp_.mjs +0 -2
  305. package/dist/email-auth-DPmZ85eW.mjs +0 -2
  306. package/dist/email-routing-Bf6DbNTr.mjs +0 -6
  307. package/dist/email-security-DTifjSxM.mjs +0 -18
  308. package/dist/email-sending-Dm3WkFHV.mjs +0 -7
  309. package/dist/error-sanitization-D8zuyPj_.mjs +0 -2
  310. package/dist/fieldExtractors-CeXZL0-I.mjs +0 -3
  311. package/dist/firewall-D5N2APXO.mjs +0 -8
  312. package/dist/flagship-sUOy9jei.mjs +0 -4
  313. package/dist/fraud-WLW2Ep1Z.mjs +0 -20
  314. package/dist/google-tag-gateway-lbww1FaJ.mjs +0 -2
  315. package/dist/healthchecks-0ih8Qjiw.mjs +0 -4
  316. package/dist/hostnames-Ba6FuL8K.mjs +0 -3
  317. package/dist/hyperdrive-DMqcU639.mjs +0 -21
  318. package/dist/iam-CXlYm0uC.mjs +0 -6
  319. package/dist/images-D_g1oli6.mjs +0 -8
  320. package/dist/intel-B8bS0ARd.mjs +0 -8
  321. package/dist/ips-68fzniN4.mjs +0 -2
  322. package/dist/keyless-certificates-CeLnqBvX.mjs +0 -3
  323. package/dist/keys-DkVdS2lF.mjs +0 -2
  324. package/dist/kv-gDAN50BQ.mjs +0 -5
  325. package/dist/leaked-credential-checks-DfnvHpvg.mjs +0 -4
  326. package/dist/load-balancers-m0HqyXPZ.mjs +0 -6
  327. package/dist/local-BwL_gesw.mjs +0 -2
  328. package/dist/logo-matches-DPbHlsKQ.mjs +0 -2
  329. package/dist/logos-DFBJFAYJ.mjs +0 -3
  330. package/dist/logpush-gzmlZayc.mjs +0 -4
  331. package/dist/logs-BuzwQgt5.mjs +0 -18
  332. package/dist/magic-cloud-networking-BbHCi1Vp.mjs +0 -5
  333. package/dist/magic-network-monitoring-kWMmnPTG.mjs +0 -4
  334. package/dist/magic-transit-ClSmJDKw.mjs +0 -111
  335. package/dist/managed-defense-EOihg1UR.mjs +0 -2
  336. package/dist/managed-transforms-BZ_XdGE2.mjs +0 -3
  337. package/dist/matches-B6sG0_fr.mjs +0 -2
  338. package/dist/mcp--kK0vS5i.mjs +0 -4
  339. package/dist/mesh-DfXYUHOO.mjs +0 -4
  340. package/dist/mtls-certificates-DZd-0X7l.mjs +0 -3
  341. package/dist/network-U6f_5ihp.mjs +0 -6
  342. package/dist/network-interconnects-DKZGTiYM.mjs +0 -41
  343. package/dist/oauth-BdVr2hJp.mjs +0 -14
  344. package/dist/oauth-clients-CY3OkPhC.mjs +0 -4
  345. package/dist/oauth-scopes-BTY7_5L-.mjs +0 -2
  346. package/dist/observability-Bsp-LdmJ.mjs +0 -10
  347. package/dist/organization-BSeMdj-7.mjs +0 -45
  348. package/dist/organizations-BroR48Nv.mjs +0 -2
  349. package/dist/origin-ca-certificates-jC-EMn6W.mjs +0 -3
  350. package/dist/origin-post-quantum-encryption-DIspLvA0.mjs +0 -2
  351. package/dist/origin-tls-client-auth-CZ_nUEcM.mjs +0 -4
  352. package/dist/page-rules-ZcdjPohY.mjs +0 -27
  353. package/dist/pages-W4tKa7xk.mjs +0 -14
  354. package/dist/pay-per-crawl-BNM1mJmP.mjs +0 -5
  355. package/dist/pay-per-use-DKxlnkH3.mjs +0 -2
  356. package/dist/pipelines-Dug0BR-c.mjs +0 -6
  357. package/dist/precursor-D-11DkRU.mjs +0 -4
  358. package/dist/previews-D_Nv4dR6.mjs +0 -4
  359. package/dist/progress-a5IKeKni.mjs +0 -2
  360. package/dist/queries-BdA2vJoe.mjs +0 -3
  361. package/dist/queues-Bu06ZqUE.mjs +0 -7
  362. package/dist/r2-COC9wMKb.mjs +0 -25
  363. package/dist/r2-data-catalog-CX5Rl5Qx.mjs +0 -16
  364. package/dist/radar-L-yoLIHF.mjs +0 -2
  365. package/dist/realtime-JKIiXfzi.mjs +0 -20
  366. package/dist/registrar-_dYUZrK0.mjs +0 -43
  367. package/dist/registrar-sandbox-D1yfW_Q_.mjs +0 -56
  368. package/dist/reporting-3fyoMcmb.mjs +0 -2
  369. package/dist/request-headers-BhQQAfJt.mjs +0 -2
  370. package/dist/request-tracers-TisEth2p.mjs +0 -2
  371. package/dist/resolve-CYUp6YgC.mjs +0 -2
  372. package/dist/resource-sharing-C4-dnohU.mjs +0 -6
  373. package/dist/resource-tagging-BRDifKqM.mjs +0 -2
  374. package/dist/rules-BCF3gIkw.mjs +0 -4
  375. package/dist/rulesets-wp6rllt3.mjs +0 -5
  376. package/dist/rum-B77awgoB.mjs +0 -4
  377. package/dist/run-BS8otL3u.mjs +0 -2
  378. package/dist/scim-C9BmUYil.mjs +0 -4
  379. package/dist/secrets-store-ckkZR2dM.mjs +0 -7
  380. package/dist/security-center-BCahKT57.mjs +0 -2
  381. package/dist/security-txt-0SI5du7I.mjs +0 -3
  382. package/dist/shared-D0B-7q-D.mjs +0 -2
  383. package/dist/smart-shield-BDPbrZa4.mjs +0 -4
  384. package/dist/snippets-CVRR_h0i.mjs +0 -4
  385. package/dist/spawn-DP4T92ss.mjs +0 -519
  386. package/dist/spectrum-CjNXQIQE.mjs +0 -63
  387. package/dist/speed-CrXCHk3h.mjs +0 -4
  388. package/dist/src-BbnV77C4.mjs +0 -108
  389. package/dist/ssl-DKORhHkh.mjs +0 -15
  390. package/dist/startup-profile-CBIH6yZy.mjs +0 -17
  391. package/dist/state-QUu6HfxC.mjs +0 -2
  392. package/dist/stream-wY3zi3FK.mjs +0 -16
  393. package/dist/submit-B-4oCBSk.mjs +0 -2
  394. package/dist/tags-5uJEkYJZ.mjs +0 -2
  395. package/dist/telemetry-n3NJourL.mjs +0 -2
  396. package/dist/tenant-BkFvv2o3.mjs +0 -2
  397. package/dist/tenant-custom-nameservers-DcjC1q0r.mjs +0 -3
  398. package/dist/tunnel-Cd4ipbvJ.mjs +0 -2
  399. package/dist/tunnels-9Zg3ePwD.mjs +0 -5
  400. package/dist/turnstile-BTwKYpzD.mjs +0 -23
  401. package/dist/ui-DQSZeaG5.mjs +0 -5
  402. package/dist/url-info-D7Y61BFd.mjs +0 -2
  403. package/dist/url-normalization-B4n8HiNQ.mjs +0 -3
  404. package/dist/url-scanner-CiCIltSQ.mjs +0 -2
  405. package/dist/user-DDFDGJ0Y.mjs +0 -12
  406. package/dist/values-DRznB_Cl.mjs +0 -2
  407. package/dist/vectorize-CbznPhzq.mjs +0 -4
  408. package/dist/waiting-rooms-CKP5hYBK.mjs +0 -11
  409. package/dist/web-assets-C-ZoSkkh.mjs +0 -8
  410. package/dist/web3-DwlN4dOw.mjs +0 -4
  411. package/dist/workers-builds-ECw_x_kp.mjs +0 -2
  412. package/dist/workers-for-platforms-BYGy46R6.mjs +0 -5
  413. package/dist/workers-vpc-CCosFcxz.mjs +0 -3
  414. package/dist/workers-zFMrbUkg.mjs +0 -6
  415. package/dist/workflows-C8GXGDRW.mjs +0 -5
  416. package/dist/zaraz-B5UIREaz.mjs +0 -2
  417. package/dist/zero-trust-DUp0XoIo.mjs +0 -91
  418. package/dist/zone-BGLkk-mL.mjs +0 -2
  419. package/dist/zones-CwYjNXMH.mjs +0 -44
  420. /package/dist/{alerts-CarPLL8k.mjs → alerts-CstOk8n0.mjs} +0 -0
  421. /package/dist/{autorag-zK-3harf.mjs → autorag-PRTwXGgn.mjs} +0 -0
  422. /package/dist/{body-parser-Cmw7PZ7a.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
  423. /package/dist/{brands-CpgTsX8h.mjs → brands-BHRXlWDm.mjs} +0 -0
  424. /package/dist/{clear-C5gzBA8G.mjs → clear-UvKESVx3.mjs} +0 -0
  425. /package/dist/{cli-types-abvWQN3T.mjs → cli-types-tt_LZMbn.mjs} +0 -0
  426. /package/dist/{connector-telemetry-events-latest-BY-dbhQZ.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
  427. /package/dist/{connector-telemetry-snapshots-latest-DoMvHvCO.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
  428. /package/dist/{domain-info-Cw3G4nap.mjs → domain-info-BqTDXNBo.mjs} +0 -0
  429. /package/dist/{health-DkEXPkS6.mjs → health-CwPzzrV6.mjs} +0 -0
  430. /package/dist/{input-validation-nF-0Ze2h.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
  431. /package/dist/{internal-4fU2r5en.mjs → internal-WLHfxX64.mjs} +0 -0
  432. /package/dist/{live-B4iGrwY2.mjs → live-D_k7eHdv.mjs} +0 -0
  433. /package/dist/{metadata-C5fJJr-k.mjs → metadata-APBiectA.mjs} +0 -0
  434. /package/dist/{project-settings-Bc3wYHo8.mjs → project-settings-DSXevRvj.mjs} +0 -0
  435. /package/dist/{rate-limit-analytics-DNsAFIeM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
  436. /package/dist/{rate-limits-CsOim7bm.mjs → rate-limits-C3K9smdl.mjs} +0 -0
  437. /package/dist/{ready-tTe-zcIw.mjs → ready-CvwvbdTX.mjs} +0 -0
  438. /package/dist/{recent-submissions-B3eTV5yC.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
  439. /package/dist/{refute-BY76YVrT.mjs → refute-CIAFMj00.mjs} +0 -0
  440. /package/dist/{scan-logo-DdoF_a5y.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
  441. /package/dist/{scan-page-sSgLwwZN.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
  442. /package/dist/{search-BFvQr-sl.mjs → search-12jA1b4l.mjs} +0 -0
  443. /package/dist/{signed-url-Cr8hiZPJ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
  444. /package/dist/{submission-info-DT2mLnu1.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
  445. /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
  446. /package/dist/{total-queries-6gs5iy9T.mjs → total-queries-CJTc9Pde.mjs} +0 -0
  447. /package/dist/{tracked-domains-D6XKO2EV.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
  448. /package/dist/{verify-CM1NakP0.mjs → verify-CZW5Fo1q.mjs} +0 -0
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import{n as e,r as t,t as n}from"./chunk-DL5FNmn1.mjs";import{at as r}from"./dist-dc4E1u01.mjs";import{t as i}from"./undici-DTSBJHNS.mjs";import{n as a,o}from"./chunk-QBZBEHZB-Byagrlop.mjs";import{gzipSync as s}from"node:zlib";import{randomUUID as c}from"node:crypto";import{readFile as l}from"node:fs/promises";import{clearTimeout as u,setTimeout as d}from"node:timers";import{Miniflare as f,convertV4MiniflareOptions as p}from"miniflare";var m=n(((e,t)=>{let n=[`nodebuffer`,`arraybuffer`,`fragments`],r=typeof Blob<`u`;r&&n.push(`blob`),t.exports={BINARY_TYPES:n,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,hasBlob:r,kForOnEventAttribute:Symbol(`kIsForOnEventAttribute`),kListener:Symbol(`kListener`),kStatusCode:Symbol(`status-code`),kWebSocket:Symbol(`websocket`),NOOP:()=>{}}})),h=n(((t,n)=>{let{EMPTY_BUFFER:r}=m(),i=Buffer[Symbol.species];function a(e,t){if(e.length===0)return r;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),a=0;for(let t=0;t<e.length;t++){let r=e[t];n.set(r,a),a+=r.length}return a<t?new i(n.buffer,n.byteOffset,a):n}function o(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[a]^t[a&3]}function s(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}function c(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function l(e){if(l.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new i(e):ArrayBuffer.isView(e)?t=new i(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),l.readOnly=!1),t}if(n.exports={concat:a,mask:o,toArrayBuffer:c,toBuffer:l,unmask:s},!process.env.WS_NO_BUFFER_UTIL)try{let t=e(`bufferutil`);n.exports.mask=function(e,n,r,i,a){a<48?o(e,n,r,i,a):t.mask(e,n,r,i,a)},n.exports.unmask=function(e,n){e.length<32?s(e,n):t.unmask(e,n)}}catch{}})),g=n(((e,t)=>{let n=Symbol(`kDone`),r=Symbol(`kRun`);t.exports=class{constructor(e){this[n]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[n])}}}})),_=n(((t,n)=>{let r=e(`zlib`),i=h(),a=g(),{kStatusCode:o}=m(),s=Buffer[Symbol.species],c=Buffer.from([0,0,255,255]),l=Symbol(`permessage-deflate`),u=Symbol(`total-length`),d=Symbol(`callback`),f=Symbol(`buffers`),p=Symbol(`error`),_;n.exports=class{constructor(e){this._options=e||{},this._threshold=this._options.threshold===void 0?1024:this._options.threshold,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,_||=new a(this._options.concurrencyLimit===void 0?10:this._options.concurrencyLimit)}static get extensionName(){return`permessage-deflate`}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits??(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&=(this._inflate.close(),null),this._deflate){let e=this._deflate[d];this._deflate.close(),this._deflate=null,e&&e(Error(`The deflate stream was closed while data was being processed`))}}acceptAsServer(e){let t=this._options,n=e.find(e=>!(t.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==`number`&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==`number`&&!e.client_max_window_bits));if(!n)throw Error(`None of the extension offers can be accepted`);return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits==`number`&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits==`number`?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error(`Unexpected parameter "client_no_context_takeover"`);if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits==`number`&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==`number`&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error(`Unexpected or invalid parameter "client_max_window_bits"`);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw Error(`Parameter "${t}" must have only a single value`);if(n=n[0],t===`client_max_window_bits`){if(n!==!0){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else if(t===`server_max_window_bits`){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(t===`client_no_context_takeover`||t===`server_no_context_takeover`){if(n!==!0)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else throw Error(`Unknown parameter "${t}"`);e[t]=n})}),e}decompress(e,t,n){_.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){_.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){let a=this._isServer?`client`:`server`;if(!this._inflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:r.Z_DEFAULT_WINDOWBITS;this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[l]=this,this._inflate[u]=0,this._inflate[f]=[],this._inflate.on(`error`,b),this._inflate.on(`data`,y)}this._inflate[d]=n,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush(()=>{let e=this._inflate[p];if(e){this._inflate.close(),this._inflate=null,n(e);return}let r=i.concat(this._inflate[f],this._inflate[u]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[u]=0,this._inflate[f]=[],t&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),n(null,r)})}_compress(e,t,n){let a=this._isServer?`server`:`client`;if(!this._deflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:r.Z_DEFAULT_WINDOWBITS;this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[u]=0,this._deflate[f]=[],this._deflate.on(`data`,v)}this._deflate[d]=n,this._deflate.write(e),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=i.concat(this._deflate[f],this._deflate[u]);t&&(e=new s(e.buffer,e.byteOffset,e.length-4)),this._deflate[d]=null,this._deflate[u]=0,this._deflate[f]=[],t&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),n(null,e)})}};function v(e){this[f].push(e),this[u]+=e.length}function y(e){if(this[u]+=e.length,this[l]._maxPayload<1||this[u]<=this[l]._maxPayload){this[f].push(e);return}this[p]=RangeError(`Max payload size exceeded`),this[p].code=`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`,this[p][o]=1009,this.removeListener(`data`,y),this.reset()}function b(e){if(this[l]._inflate=null,this[p]){this[d](this[p]);return}e[o]=1007,this[d](e)}})),v=n(((t,n)=>{let{isUtf8:r}=e(`buffer`),{hasBlob:i}=m(),a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function o(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function s(e){let t=e.length,n=0;for(;n<t;)if(!(e[n]&128))n++;else if((e[n]&224)==192){if(n+1===t||(e[n+1]&192)!=128||(e[n]&254)==192)return!1;n+=2}else if((e[n]&240)==224){if(n+2>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||e[n]===224&&(e[n+1]&224)==128||e[n]===237&&(e[n+1]&224)==160)return!1;n+=3}else if((e[n]&248)==240){if(n+3>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||(e[n+3]&192)!=128||e[n]===240&&(e[n+1]&240)==128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}function c(e){return i&&typeof e==`object`&&typeof e.arrayBuffer==`function`&&typeof e.type==`string`&&typeof e.stream==`function`&&(e[Symbol.toStringTag]===`Blob`||e[Symbol.toStringTag]===`File`)}if(n.exports={isBlob:c,isValidStatusCode:o,isValidUTF8:s,tokenChars:a},r)n.exports.isValidUTF8=function(e){return e.length<24?s(e):r(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=e(`utf-8-validate`);n.exports.isValidUTF8=function(e){return e.length<32?s(e):t(e)}}catch{}})),y=n(((t,n)=>{let{Writable:r}=e(`stream`),i=_(),{BINARY_TYPES:a,EMPTY_BUFFER:o,kStatusCode:s,kWebSocket:c}=m(),{concat:l,toArrayBuffer:u,unmask:d}=h(),{isValidStatusCode:f,isValidUTF8:p}=v(),g=Buffer[Symbol.species];n.exports=class extends r{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents===void 0?!0:e.allowSynchronousEvents,this._binaryType=e.binaryType||a[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[c]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,n){if(this._opcode===8&&this._state==0)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,`Too many buffered chunks`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let t=this._buffers[0];return this._buffers[0]=new g(t.buffer,t.byteOffset+e,t.length-e),new g(t.buffer,t.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new g(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){e(this.createError(RangeError,`RSV2 and RSV3 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_2_3`));return}let n=(t[0]&64)==64;if(n&&!this._extensions[i.extensionName]){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._fin=(t[0]&128)==128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(!this._fragmented){e(this.createError(RangeError,`invalid opcode 0`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){e(this.createError(RangeError,`FIN must be set`,!0,1002,`WS_ERR_EXPECTED_FIN`));return}if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,`WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH`));return}}else{e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)==128,this._isServer){if(!this._masked){e(this.createError(RangeError,`MASK must be set`,!0,1002,`WS_ERR_EXPECTED_MASK`));return}}else if(this._masked){e(this.createError(RangeError,`MASK must be clear`,!0,1002,`WS_ERR_UNEXPECTED_MASK`));return}this._payloadLength===126?this._state=1:this._payloadLength===127?this._state=2:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>2**21-1){e(this.createError(RangeError,`Unsupported WebSocket frame: payload length > 2^53 - 1`,!1,1009,`WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH`));return}this._payloadLength=n*2**32+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){e(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}this._masked?this._state=3:this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(e){let t=o;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&d(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=5,this.decompress(t,e);return}if(t.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){e(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._messageLength=this._totalPayloadLength,this._fragments.push(t)}this.dataMessage(e)}decompress(e,t){this._extensions[i.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){t(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){t(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._fragments.push(n)}this.dataMessage(t),this._state===0&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=0;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;r=this._binaryType===`nodebuffer`?l(n,t):this._binaryType===`arraybuffer`?u(l(n,t)):this._binaryType===`blob`?new Blob(n):n,this._allowSynchronousEvents?(this.emit(`message`,r,!0),this._state=0):(this._state=6,setImmediate(()=>{this.emit(`message`,r,!0),this._state=0,this.startLoop(e)}))}else{let r=l(n,t);if(!this._skipUTF8Validation&&!p(r)){e(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._state===5||this._allowSynchronousEvents?(this.emit(`message`,r,!1),this._state=0):(this._state=6,setImmediate(()=>{this.emit(`message`,r,!1),this._state=0,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit(`conclude`,1005,o),this.end();else{let n=e.readUInt16BE(0);if(!f(n)){t(this.createError(RangeError,`invalid status code ${n}`,!0,1002,`WS_ERR_INVALID_CLOSE_CODE`));return}let r=new g(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!p(r)){t(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._loop=!1,this.emit(`conclude`,n,r),this.end()}this._state=0;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?`ping`:`pong`,e),this._state=0):(this._state=6,setImmediate(()=>{this.emit(this._opcode===9?`ping`:`pong`,e),this._state=0,this.startLoop(t)}))}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,this.createError),a.code=i,a[s]=r,a}}})),b=n(((t,n)=>{let{Duplex:r}=e(`stream`),{randomFillSync:i}=e(`crypto`),{types:{isUint8Array:a}}=e(`util`),o=_(),{EMPTY_BUFFER:s,kWebSocket:c,NOOP:l}=m(),{isBlob:u,isValidStatusCode:d}=v(),{mask:f,toBuffer:p}=h(),g=Symbol(`kByteLength`),y=Buffer.alloc(4),b=8*1024,x,S=b;n.exports=class e{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=0,this.onerror=l,this[c]=void 0}static frame(e,t){let n,r=!1,a=2,o=!1;t.mask&&(n=t.maskBuffer||y,t.generateMask?t.generateMask(n):(S===b&&(x===void 0&&(x=Buffer.alloc(b)),i(x,0,b),S=0),n[0]=x[S++],n[1]=x[S++],n[2]=x[S++],n[3]=x[S++]),o=(n[0]|n[1]|n[2]|n[3])===0,a=6);let s;typeof e==`string`?(!t.mask||o)&&t[g]!==void 0?s=t[g]:(e=Buffer.from(e),s=e.length):(s=e.length,r=t.mask&&t.readOnly&&!o);let c=s;s>=65536?(a+=8,c=127):s>125&&(a+=2,c=126);let l=Buffer.allocUnsafe(r?s+a:a);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(s,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(s,4,6)),!t.mask||(l[1]|=128,l[a-4]=n[0],l[a-3]=n[1],l[a-2]=n[2],l[a-1]=n[3],o)?[l,e]:r?(f(e,n,l,a,s),[l]):(f(e,n,e,0,s),[l,e])}close(t,n,r,i){let o;if(t===void 0)o=s;else if(typeof t!=`number`||!d(t))throw TypeError(`First argument must be a valid error code number`);else if(n===void 0||!n.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let e=Buffer.byteLength(n);if(e>123)throw RangeError(`The message must not be greater than 123 bytes`);if(o=Buffer.allocUnsafe(2+e),o.writeUInt16BE(t,0),typeof n==`string`)o.write(n,2);else if(a(n))o.set(n,2);else throw TypeError(`Second argument must be a string or a Uint8Array`)}let c={[g]:o.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state===0?this.sendFrame(e.frame(o,c),i):this.enqueue([this.dispatch,o,!1,c,i])}ping(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):u(t)?(i=t.size,a=!1):(t=p(t),i=t.length,a=p.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[g]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};u(t)?this._state===0?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===0?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}pong(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):u(t)?(i=t.size,a=!1):(t=p(t),i=t.length,a=p.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[g]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};u(t)?this._state===0?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===0?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}send(e,t,n){let r=this._extensions[o.extensionName],i=t.binary?2:1,a=t.compress,s,c;typeof e==`string`?(s=Buffer.byteLength(e),c=!1):u(e)?(s=e.size,c=!1):(e=p(e),s=e.length,c=p.readOnly),this._firstFragment?(this._firstFragment=!1,a&&r&&r.params[r._isServer?`server_no_context_takeover`:`client_no_context_takeover`]&&(a=s>=r._threshold),this._compress=a):(a=!1,i=0),t.fin&&(this._firstFragment=!0);let l={[g]:s,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:a};u(e)?this._state===0?this.getBlobData(e,this._compress,l,n):this.enqueue([this.getBlobData,e,this._compress,l,n]):this._state===0?this.dispatch(e,this._compress,l,n):this.enqueue([this.dispatch,e,this._compress,l,n])}getBlobData(t,n,r,i){this._bufferedBytes+=r[g],this._state=2,t.arrayBuffer().then(t=>{if(this._socket.destroyed){let e=Error(`The socket was closed while the blob was being read`);process.nextTick(C,this,e,i);return}this._bufferedBytes-=r[g];let a=p(t);n?this.dispatch(a,n,r,i):(this._state=0,this.sendFrame(e.frame(a,r),i),this.dequeue())}).catch(e=>{process.nextTick(w,this,e,i)})}dispatch(t,n,r,i){if(!n){this.sendFrame(e.frame(t,r),i);return}let a=this._extensions[o.extensionName];this._bufferedBytes+=r[g],this._state=1,a.compress(t,r.fin,(t,n)=>{if(this._socket.destroyed){let e=Error(`The socket was closed while data was being compressed`);C(this,e,i);return}this._bufferedBytes-=r[g],this._state=0,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()})}dequeue(){for(;this._state===0&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][g],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][g],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};function C(e,t,n){typeof n==`function`&&n(t);for(let n=0;n<e._queue.length;n++){let r=e._queue[n],i=r[r.length-1];typeof i==`function`&&i(t)}}function w(e,t,n){C(e,t,n),e.onerror(t)}})),x=n(((e,t)=>{let{kForOnEventAttribute:n,kListener:r}=m(),i=Symbol(`kCode`),a=Symbol(`kData`),o=Symbol(`kError`),s=Symbol(`kMessage`),c=Symbol(`kReason`),l=Symbol(`kTarget`),u=Symbol(`kType`),d=Symbol(`kWasClean`);var f=class{constructor(e){this[l]=null,this[u]=e}get target(){return this[l]}get type(){return this[u]}};Object.defineProperty(f.prototype,`target`,{enumerable:!0}),Object.defineProperty(f.prototype,`type`,{enumerable:!0});var p=class extends f{constructor(e,t={}){super(e),this[i]=t.code===void 0?0:t.code,this[c]=t.reason===void 0?``:t.reason,this[d]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[i]}get reason(){return this[c]}get wasClean(){return this[d]}};Object.defineProperty(p.prototype,`code`,{enumerable:!0}),Object.defineProperty(p.prototype,`reason`,{enumerable:!0}),Object.defineProperty(p.prototype,`wasClean`,{enumerable:!0});var h=class extends f{constructor(e,t={}){super(e),this[o]=t.error===void 0?null:t.error,this[s]=t.message===void 0?``:t.message}get error(){return this[o]}get message(){return this[s]}};Object.defineProperty(h.prototype,`error`,{enumerable:!0}),Object.defineProperty(h.prototype,`message`,{enumerable:!0});var g=class extends f{constructor(e,t={}){super(e),this[a]=t.data===void 0?null:t.data}get data(){return this[a]}};Object.defineProperty(g.prototype,`data`,{enumerable:!0}),t.exports={CloseEvent:p,ErrorEvent:h,Event:f,EventTarget:{addEventListener(e,t,i={}){for(let a of this.listeners(e))if(!i[n]&&a[r]===t&&!a[n])return;let a;if(e===`message`)a=function(e,n){let r=new g(`message`,{data:n?e:e.toString()});r[l]=this,_(t,this,r)};else if(e===`close`)a=function(e,n){let r=new p(`close`,{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[l]=this,_(t,this,r)};else if(e===`error`)a=function(e){let n=new h(`error`,{error:e,message:e.message});n[l]=this,_(t,this,n)};else if(e===`open`)a=function(){let e=new f(`open`);e[l]=this,_(t,this,e)};else return;a[n]=!!i[n],a[r]=t,i.once?this.once(e,a):this.on(e,a)},removeEventListener(e,t){for(let i of this.listeners(e))if(i[r]===t&&!i[n]){this.removeListener(e,i);break}}},MessageEvent:g};function _(e,t,n){typeof e==`object`&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}})),S=n(((e,t)=>{let{tokenChars:n}=v();function r(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}function i(e){let t=Object.create(null),i=Object.create(null),a=!1,o=!1,s=!1,c,l,u=-1,d=-1,f=-1,p=0;for(;p<e.length;p++)if(d=e.charCodeAt(p),c===void 0)if(f===-1&&n[d]===1)u===-1&&(u=p);else if(p!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);d===44?(r(t,n,i),i=Object.create(null)):c=n,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);else if(l===void 0)if(f===-1&&n[d]===1)u===-1&&(u=p);else if(d===32||d===9)f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),r(i,e.slice(u,f),!0),d===44&&(r(t,c,i),i=Object.create(null),c=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)l=e.slice(u,p),u=f=-1;else throw SyntaxError(`Unexpected character at index ${p}`);else if(o){if(n[d]!==1)throw SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:a||=!0,o=!1}else if(s)if(n[d]===1)u===-1&&(u=p);else if(d===34&&u!==-1)s=!1,f=p;else if(d===92)o=!0;else throw SyntaxError(`Unexpected character at index ${p}`);else if(d===34&&e.charCodeAt(p-1)===61)s=!0;else if(f===-1&&n[d]===1)u===-1&&(u=p);else if(u!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);a&&=(n=n.replace(/\\/g,``),!1),r(i,l,n),d===44&&(r(t,c,i),i=Object.create(null),c=void 0),l=void 0,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);if(u===-1||s||d===32||d===9)throw SyntaxError(`Unexpected end of input`);f===-1&&(f=p);let m=e.slice(u,f);return c===void 0?r(t,m,i):(l===void 0?r(i,m,!0):a?r(i,l,m.replace(/\\/g,``)):r(i,l,m),r(t,c,i)),t}function a(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>e===!0?t:`${t}=${e}`).join(`; `)})).join(`; `)).join(`, `)}).join(`, `)}t.exports={format:a,parse:i}})),C=n(((t,n)=>{let r=e(`events`),i=e(`https`),a=e(`http`),o=e(`net`),s=e(`tls`),{randomBytes:c,createHash:l}=e(`crypto`),{Duplex:u,Readable:d}=e(`stream`),{URL:f}=e(`url`),p=_(),g=y(),C=b(),{isBlob:w}=v(),{BINARY_TYPES:T,CLOSE_TIMEOUT:E,EMPTY_BUFFER:D,GUID:O,kForOnEventAttribute:k,kListener:A,kStatusCode:j,kWebSocket:M,NOOP:N}=m(),{EventTarget:{addEventListener:P,removeEventListener:F}}=x(),{format:I,parse:L}=S(),{toBuffer:R}=h(),z=Symbol(`kAborted`),B=[8,13],V=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],H=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;var U=class e extends r{constructor(t,n,r){super(),this._binaryType=T[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=D,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol=``,this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t===null?(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0):(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n==`object`&&n?(r=n,n=[]):n=[n]),W(this,t,n,r))}get binaryType(){return this._binaryType}set binaryType(e){T.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,n,r){let i=new g({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),a=new C(t,this._extensions,r.generateMask);this._receiver=i,this._sender=a,this._socket=t,i[M]=this,a[M]=this,t[M]=this,i.on(`conclude`,ee),i.on(`drain`,te),i.on(`error`,ne),i.on(`message`,re),i.on(`ping`,ie),i.on(`pong`,ae),a.onerror=oe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on(`close`,se),t.on(`data`,$),t.on(`end`,ce),t.on(`error`,le),this._readyState=e.OPEN,this.emit(`open`)}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit(`close`,this._closeCode,this._closeMessage);return}this._extensions[p.extensionName]&&this._extensions[p.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit(`close`,this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){J(this,this._req,`WebSocket was closed before the connection was established`);return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Q(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof t==`function`?(r=t,t=n=void 0):typeof n==`function`&&(r=n,n=void 0),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){Y(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||D,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof t==`function`?(r=t,t=n=void 0):typeof n==`function`&&(r=n,n=void 0),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){Y(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||D,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof n==`function`&&(r=n,n={}),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){Y(this,t,r);return}let i={binary:typeof t!=`string`,mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[p.extensionName]||(i.compress=!1),this._sender.send(t||D,i,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){J(this,this._req,`WebSocket was closed before the connection was established`);return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(U,`CONNECTING`,{enumerable:!0,value:V.indexOf(`CONNECTING`)}),Object.defineProperty(U.prototype,`CONNECTING`,{enumerable:!0,value:V.indexOf(`CONNECTING`)}),Object.defineProperty(U,`OPEN`,{enumerable:!0,value:V.indexOf(`OPEN`)}),Object.defineProperty(U.prototype,`OPEN`,{enumerable:!0,value:V.indexOf(`OPEN`)}),Object.defineProperty(U,`CLOSING`,{enumerable:!0,value:V.indexOf(`CLOSING`)}),Object.defineProperty(U.prototype,`CLOSING`,{enumerable:!0,value:V.indexOf(`CLOSING`)}),Object.defineProperty(U,`CLOSED`,{enumerable:!0,value:V.indexOf(`CLOSED`)}),Object.defineProperty(U.prototype,`CLOSED`,{enumerable:!0,value:V.indexOf(`CLOSED`)}),[`binaryType`,`bufferedAmount`,`extensions`,`isPaused`,`protocol`,`readyState`,`url`].forEach(e=>{Object.defineProperty(U.prototype,e,{enumerable:!0})}),[`open`,`error`,`close`,`message`].forEach(e=>{Object.defineProperty(U.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[k])return t[A];return null},set(t){for(let t of this.listeners(e))if(t[k]){this.removeListener(e,t);break}typeof t==`function`&&this.addEventListener(e,t,{[k]:!0})}})}),U.prototype.addEventListener=P,U.prototype.removeEventListener=F,n.exports=U;function W(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:E,protocolVersion:B[1],maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:`GET`,host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!B.includes(o.protocolVersion))throw RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${B.join(`, `)})`);let s;if(t instanceof f)s=t;else try{s=new f(t)}catch{throw SyntaxError(`Invalid URL: ${t}`)}s.protocol===`http:`?s.protocol=`ws:`:s.protocol===`https:`&&(s.protocol=`wss:`),e._url=s.href;let u=s.protocol===`wss:`,d=s.protocol===`ws+unix:`,m;if(s.protocol!==`ws:`&&!u&&!d?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:d&&!s.pathname?m=`The URL's pathname is empty`:s.hash&&(m=`The URL contains a fragment identifier`),m){let t=SyntaxError(m);if(e._redirects===0)throw t;G(e,t);return}let h=u?443:80,g=c(16).toString(`base64`),_=u?i.request:a.request,v=new Set,y;if(o.createConnection=o.createConnection||(u?q:K),o.defaultPort=o.defaultPort||h,o.port=s.port||h,o.host=s.hostname.startsWith(`[`)?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":g,Connection:`Upgrade`,Upgrade:`websocket`},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(y=new p({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers[`Sec-WebSocket-Extensions`]=I({[p.extensionName]:y.offer()})),n.length){for(let e of n){if(typeof e!=`string`||!H.test(e)||v.has(e))throw SyntaxError(`An invalid or duplicated subprotocol was specified`);v.add(e)}o.headers[`Sec-WebSocket-Protocol`]=n.join(`,`)}if(o.origin&&(o.protocolVersion<13?o.headers[`Sec-WebSocket-Origin`]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),d){let e=o.path.split(`:`);o.socketPath=e[0],o.path=e[1]}let b;if(o.followRedirects){if(e._redirects===0){e._originalIpc=d,e._originalSecure=u,e._originalHostOrSocketPath=d?o.socketPath:s.host;let t=r&&r.headers;if(r={...r,headers:{}},t)for(let[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(e.listenerCount(`redirect`)===0){let t=d?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!u)&&(delete o.headers.authorization,delete o.headers.cookie,t||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization=`Basic `+Buffer.from(o.auth).toString(`base64`)),b=e._req=_(o),e._redirects&&e.emit(`redirect`,e.url,b)}else b=e._req=_(o);o.timeout&&b.on(`timeout`,()=>{J(e,b,`Opening handshake has timed out`)}),b.on(`error`,t=>{b===null||b[z]||(b=e._req=null,G(e,t))}),b.on(`response`,i=>{let a=i.headers.location,s=i.statusCode;if(a&&o.followRedirects&&s>=300&&s<400){if(++e._redirects>o.maxRedirects){J(e,b,`Maximum redirects exceeded`);return}b.abort();let i;try{i=new f(a,t)}catch{G(e,SyntaxError(`Invalid URL: ${a}`));return}W(e,i,n,r)}else e.emit(`unexpected-response`,b,i)||J(e,b,`Unexpected server response: ${i.statusCode}`)}),b.on(`upgrade`,(t,n,r)=>{if(e.emit(`upgrade`,t),e.readyState!==U.CONNECTING)return;b=e._req=null;let i=t.headers.upgrade;if(i===void 0||i.toLowerCase()!==`websocket`){J(e,n,`Invalid Upgrade header`);return}let a=l(`sha1`).update(g+O).digest(`base64`);if(t.headers[`sec-websocket-accept`]!==a){J(e,n,`Invalid Sec-WebSocket-Accept header`);return}let s=t.headers[`sec-websocket-protocol`],c;if(s===void 0?v.size&&(c=`Server sent no subprotocol`):v.size?v.has(s)||(c=`Server sent an invalid subprotocol`):c=`Server sent a subprotocol but none was requested`,c){J(e,n,c);return}s&&(e._protocol=s);let u=t.headers[`sec-websocket-extensions`];if(u!==void 0){if(!y){J(e,n,`Server sent a Sec-WebSocket-Extensions header but no extension was requested`);return}let t;try{t=L(u)}catch{J(e,n,`Invalid Sec-WebSocket-Extensions header`);return}let r=Object.keys(t);if(r.length!==1||r[0]!==p.extensionName){J(e,n,`Server indicated an extension that was not requested`);return}try{y.accept(t[p.extensionName])}catch{J(e,n,`Invalid Sec-WebSocket-Extensions header`);return}e._extensions[p.extensionName]=y}e.setSocket(n,r,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(b,e):b.end()}function G(e,t){e._readyState=U.CLOSING,e._errorEmitted=!0,e.emit(`error`,t),e.emitClose()}function K(e){return e.path=e.socketPath,o.connect(e)}function q(e){return e.path=void 0,!e.servername&&e.servername!==``&&(e.servername=o.isIP(e.host)?``:e.host),s.connect(e)}function J(e,t,n){e._readyState=U.CLOSING;let r=Error(n);Error.captureStackTrace(r,J),t.setHeader?(t[z]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(G,e,r)):(t.destroy(r),t.once(`error`,e.emit.bind(e,`error`)),t.once(`close`,e.emitClose.bind(e)))}function Y(e,t,n){if(t){let n=w(t)?t.size:R(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){let t=Error(`WebSocket is not open: readyState ${e.readyState} (${V[e.readyState]})`);process.nextTick(n,t)}}function ee(e,t){let n=this[M];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[M]!==void 0&&(n._socket.removeListener(`data`,$),process.nextTick(Z,n._socket),e===1005?n.close():n.close(e,t))}function te(){let e=this[M];e.isPaused||e._socket.resume()}function ne(e){let t=this[M];t._socket[M]!==void 0&&(t._socket.removeListener(`data`,$),process.nextTick(Z,t._socket),t.close(e[j])),t._errorEmitted||(t._errorEmitted=!0,t.emit(`error`,e))}function X(){this[M].emitClose()}function re(e,t){this[M].emit(`message`,e,t)}function ie(e){let t=this[M];t._autoPong&&t.pong(e,!this._isServer,N),t.emit(`ping`,e)}function ae(e){this[M].emit(`pong`,e)}function Z(e){e.resume()}function oe(e){let t=this[M];t.readyState!==U.CLOSED&&(t.readyState===U.OPEN&&(t._readyState=U.CLOSING,Q(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit(`error`,e)))}function Q(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function se(){let e=this[M];if(this.removeListener(`close`,se),this.removeListener(`data`,$),this.removeListener(`end`,ce),e._readyState=U.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[M]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on(`error`,X),e._receiver.on(`finish`,X))}function $(e){this[M]._receiver.write(e)||this.pause()}function ce(){let e=this[M];e._readyState=U.CLOSING,e._receiver.end(),this.end()}function le(){let e=this[M];this.removeListener(`error`,le),this.on(`error`,N),e&&(e._readyState=U.CLOSING,this.destroy())}})),w=n(((t,n)=>{C();let{Duplex:r}=e(`stream`);function i(e){e.emit(`close`)}function a(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o(e){this.removeListener(`error`,o),this.destroy(),this.listenerCount(`error`)===0&&this.emit(`error`,e)}function s(e,t){let n=!0,s=new r({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on(`message`,function(t,n){let r=!n&&s._readableState.objectMode?t.toString():t;s.push(r)||e.pause()}),e.once(`error`,function(e){s.destroyed||(n=!1,s.destroy(e))}),e.once(`close`,function(){s.destroyed||s.push(null)}),s._destroy=function(t,r){if(e.readyState===e.CLOSED){r(t),process.nextTick(i,s);return}let a=!1;e.once(`error`,function(e){a=!0,r(e)}),e.once(`close`,function(){a||r(t),process.nextTick(i,s)}),n&&e.terminate()},s._final=function(t){if(e.readyState===e.CONNECTING){e.once(`open`,function(){s._final(t)});return}e._socket!==null&&(e._socket._writableState.finished?(t(),s._readableState.endEmitted&&s.destroy()):(e._socket.once(`finish`,function(){t()}),e.close()))},s._read=function(){e.isPaused&&e.resume()},s._write=function(t,n,r){if(e.readyState===e.CONNECTING){e.once(`open`,function(){s._write(t,n,r)});return}e.send(t,r)},s.on(`end`,a),s.on(`error`,o),s}n.exports=s})),T=n(((e,t)=>{let{tokenChars:n}=v();function r(e){let t=new Set,r=-1,i=-1,a=0;for(;a<e.length;a++){let o=e.charCodeAt(a);if(i===-1&&n[o]===1)r===-1&&(r=a);else if(a!==0&&(o===32||o===9))i===-1&&r!==-1&&(i=a);else if(o===44){if(r===-1)throw SyntaxError(`Unexpected character at index ${a}`);i===-1&&(i=a);let n=e.slice(r,i);if(t.has(n))throw SyntaxError(`The "${n}" subprotocol is duplicated`);t.add(n),r=i=-1}else throw SyntaxError(`Unexpected character at index ${a}`)}if(r===-1||i!==-1)throw SyntaxError(`Unexpected end of input`);let o=e.slice(r,a);if(t.has(o))throw SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}t.exports={parse:r}})),E=n(((t,n)=>{let r=e(`events`),i=e(`http`),{Duplex:a}=e(`stream`),{createHash:o}=e(`crypto`),s=S(),c=_(),l=T(),u=C(),{CLOSE_TIMEOUT:d,GUID:f,kWebSocket:p}=m(),h=/^[+/0-9A-Za-z]{22}==$/;n.exports=class extends r{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:d,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:u,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw TypeError(`One and only one of the "port", "server", or "noServer" options must be specified`);if(e.port==null?e.server&&(this._server=e.server):(this._server=i.createServer((e,t)=>{let n=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":`text/plain`}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)),this._server){let e=this.emit.bind(this,`connection`);this._removeListeners=g(this._server,{listening:this.emit.bind(this,`listening`),error:this.emit.bind(this,`error`),upgrade:(t,n,r)=>{this.handleUpgrade(t,n,r,e)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw Error(`The server is operating in "noServer" mode`);return this._server?this._server.address():null}close(e){if(this._state===2){e&&this.once(`close`,()=>{e(Error(`The server is not running`))}),process.nextTick(v,this);return}if(e&&this.once(`close`,e),this._state!==1)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(v,this);else{let e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close(()=>{v(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf(`?`);if((t===-1?e.url:e.url.slice(0,t))!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on(`error`,y);let i=e.headers[`sec-websocket-key`],a=e.headers.upgrade,o=+e.headers[`sec-websocket-version`];if(e.method!==`GET`){x(this,e,t,405,`Invalid HTTP method`);return}if(a===void 0||a.toLowerCase()!==`websocket`){x(this,e,t,400,`Invalid Upgrade header`);return}if(i===void 0||!h.test(i)){x(this,e,t,400,`Missing or invalid Sec-WebSocket-Key header`);return}if(o!==13&&o!==8){x(this,e,t,400,`Missing or invalid Sec-WebSocket-Version header`,{"Sec-WebSocket-Version":`13, 8`});return}if(!this.shouldHandle(e)){b(t,400);return}let u=e.headers[`sec-websocket-protocol`],d=new Set;if(u!==void 0)try{d=l.parse(u)}catch{x(this,e,t,400,`Invalid Sec-WebSocket-Protocol header`);return}let f=e.headers[`sec-websocket-extensions`],p={};if(this.options.perMessageDeflate&&f!==void 0){let n=new c({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let e=s.parse(f);e[c.extensionName]&&(n.accept(e[c.extensionName]),p[c.extensionName]=n)}catch{x(this,e,t,400,`Invalid or unacceptable Sec-WebSocket-Extensions header`);return}}if(this.options.verifyClient){let a={origin:e.headers[`${o===8?`sec-websocket-origin`:`origin`}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(a,(a,o,s,c)=>{if(!a)return b(t,o||401,s,c);this.completeUpgrade(p,i,d,e,t,n,r)});return}if(!this.options.verifyClient(a))return b(t,401)}this.completeUpgrade(p,i,d,e,t,n,r)}completeUpgrade(e,t,n,r,i,a,l){if(!i.readable||!i.writable)return i.destroy();if(i[p])throw Error(`server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration`);if(this._state>0)return b(i,503);let u=[`HTTP/1.1 101 Switching Protocols`,`Upgrade: websocket`,`Connection: Upgrade`,`Sec-WebSocket-Accept: ${o(`sha1`).update(t+f).digest(`base64`)}`],d=new this.options.WebSocket(null,void 0,this.options);if(n.size){let e=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;e&&(u.push(`Sec-WebSocket-Protocol: ${e}`),d._protocol=e)}if(e[c.extensionName]){let t=e[c.extensionName].params,n=s.format({[c.extensionName]:[t]});u.push(`Sec-WebSocket-Extensions: ${n}`),d._extensions=e}this.emit(`headers`,u,r),i.write(u.concat(`\r
3
+ `).join(`\r
4
+ `)),i.removeListener(`error`,y),d.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on(`close`,()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(v,this)})),l(d,r)}};function g(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function v(e){e._state=2,e.emit(`close`)}function y(){this.destroy()}function b(e,t,n,r){n||=i.STATUS_CODES[t],r={Connection:`close`,"Content-Type":`text/html`,"Content-Length":Buffer.byteLength(n),...r},e.once(`finish`,e.destroy),e.end(`HTTP/1.1 ${t} ${i.STATUS_CODES[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join(`\r
5
+ `)+`\r
6
+ \r
7
+ `+n)}function x(e,t,n,r,i,a){if(e.listenerCount(`wsClientError`)){let r=Error(i);Error.captureStackTrace(r,x),e.emit(`wsClientError`,r,n,t)}else b(n,r,i,a)}})),D=i();w(),S(),_(),y(),b(),T();var O=t(C(),1);E();var k=1e4,A={esm:`ESModule`,commonjs:`CommonJS`,"compiled-wasm":`CompiledWasm`,buffer:`Data`,text:`Text`,python:`PythonModule`,"python-requirement":`PythonRequirement`};async function j(e){if(typeof e!=`string`)return e;let t=await l(e),n=t.findIndex(e=>e===10);return await new D.Response(t,{headers:{"Content-Type":`multipart/form-data; boundary=${Uint8Array.prototype.slice.call(t,2,n).toString()}`}}).formData()}o(j,`parseWorkerBundle`);async function M(e){let t=[];for(let n of e.values())n instanceof Blob&&n.type!==`application/source-map`&&t.push(n);let n=new Blob(t);return{size:n.size,gzipSize:s(await n.arrayBuffer()).byteLength}}o(M,`getBundleSize`);function N(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=e.samples??[],r=e.timeDeltas??[],i=0,a=0,o=0;for(let[e,s]of r.entries()){i+=s;let r=t.get(n[e]??0)?.callFrame.functionName;r===`(idle)`?a+=s:r===`(garbage collector)`&&(o+=s)}return{profileWindow:e.endTime-e.startTime,sampledTime:i,activeTime:i-a,garbageCollectionTime:o,idleTime:a,sampleCount:n.length}}o(N,`summarizeStartupProfile`);async function P(e){let t=await j(e),n=JSON.parse(t.get(`metadata`));if(typeof n.main_module!=`string`)throw new r(`Startup profiling does not support service-worker format Workers. Refer to https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ for migration guidance.`,{telemetryMessage:`startup profiling service worker format unsupported`});let i=await F(t,n.bindings),a=new f(p({name:`profiler`,compatibilityDate:typeof n.compatibility_date==`string`?n.compatibility_date:void 0,compatibilityFlags:Array.isArray(n.compatibility_flags)?n.compatibility_flags:void 0,...i.options,modulesRoot:`/`,modules:[{type:`ESModule`,path:c(),contents:`
8
+ async function startup() {
9
+ await import(${JSON.stringify(n.main_module)});
10
+ }
11
+ export default {
12
+ async fetch() {
13
+ await startup();
14
+ return new Response("ok");
15
+ }
16
+ }
17
+ `},...await q(t)],inspectorPort:0,handleStructuredLogs:o(()=>void 0,`handleStructuredLogs`)})),s=new AbortController,l=d(()=>{s.abort(new r(`Worker startup profiling timed out after ${k/1e3} seconds.`,{telemetryMessage:`startup profiling timed out`}))},k),m,h=o(e=>s.abort(e instanceof Error?e:Error(`Worker startup profiler inspector error: ${String(e)}`)),`onInspectorError`),g=o(()=>s.abort(Error(`The Worker startup profiler inspector connection closed.`)),`onInspectorClose`);try{await H(a.ready,s.signal);let e=await H(a.getInspectorURL(),s.signal);m=new O.default(new URL(`/core:user:profiler`,e.href)),m.on(`error`,h),m.on(`close`,g),await U(m,s.signal),await W(m,1,`Profiler.enable`,s.signal),await W(m,2,`Profiler.start`,s.signal);let t=await H(a.dispatchFetch(`https://example.com`,{signal:s.signal}),s.signal);if(await H(t.text(),s.signal),!t.ok&&i.unsupportedBindings.length>0){let e=` The upload contains bindings that cannot be reproduced locally during startup profiling: ${i.unsupportedBindings.map(e=>`${JSON.stringify(e.name)} (${JSON.stringify(e.type)})`).join(`, `)}.`;throw new r(`Worker startup profiling failed during module evaluation (status ${t.status}).${e}`,{telemetryMessage:`startup profiling module evaluation failed`})}let n=await W(m,3,`Profiler.stop`,s.signal);if(n?.profile===void 0)throw Error(`Inspector command Profiler.stop returned no profile.`);return n.profile}finally{try{await a.dispose()}finally{try{m!==void 0&&(m.off(`error`,h),m.off(`close`,g),m.readyState!==O.default.CLOSED&&(m.once(`error`,()=>void 0),m.terminate()))}finally{u(l)}}}}o(P,`analyseBundle`);async function F(e,t){let n={},r,i={},a={},o={},s={},c={},l,u={},d={},f={},p=[],m={},h={},g,_={},v,y={},b={},x={},S={},C={},w={},T={},E,D={},O,k={},A={},j={},M=[];for(let N of Array.isArray(t)?t:[]){if(!L(N)){M.push({name:`<unknown>`,type:`unknown`});continue}let t=N;if(I(t)){T[t.name]=R();continue}switch(t.type){case`plain_text`:case`secret_text`:c[t.name]=t.text;break;case`json`:c[t.name]=t.json;break;case`text_blob`:c[t.name]=await B(e,t);break;case`data_blob`:u[t.name]=await z(e,t);break;case`kv_namespace`:_[t.name]={id:t.namespace_id};break;case`d1`:d[t.name]={id:t.id};break;case`r2_bucket`:S[t.name]={id:t.bucket_name};break;case`queue`:x[t.name]={queueName:t.queue_name,deliveryDelay:t.delivery_delay};break;case`service`:T[t.name]=R(),M.push(t);break;case`assets`:T[t.name]=R();break;case`browser`:l={binding:t.name};break;case`ai`:r={binding:t.name};break;case`images`:g={binding:t.name};break;case`stream`:E={binding:t.name};break;case`version_metadata`:O=t.name;break;case`ai_search_namespace`:a[t.name]={namespace:t.namespace};break;case`ai_search`:i[t.name]={instance_name:t.instance_name};break;case`agent_memory`:n[t.name]={namespace:t.namespace};break;case`media`:v={binding:t.name};break;case`send_email`:{let e={name:t.name,allowed_sender_addresses:t.allowed_sender_addresses};t.destination_address===void 0?t.allowed_destination_addresses===void 0?p.push(e):p.push({...e,allowed_destination_addresses:t.allowed_destination_addresses}):p.push({...e,destination_address:t.destination_address});break}case`durable_object_namespace`:case`workflow`:M.push(t);break;case`vectorize`:D[t.name]={index_name:t.index_name};break;case`analytics_engine`:o[t.name]={dataset:t.dataset??`dataset`};break;case`dispatch_namespace`:f[t.name]={namespace:t.namespace};break;case`mtls_certificate`:y[t.name]={certificate_id:t.certificate_id};break;case`pipelines`:t.stream===void 0?t.pipeline===void 0?M.push(t):b[t.name]={pipeline:t.pipeline}:b[t.name]={stream:t.stream};break;case`secrets_store_secret`:w[t.name]={store_id:t.store_id,secret_name:t.secret_name};break;case`artifacts`:s[t.name]={namespace:t.namespace};break;case`unsafe_hello_world`:h[t.name]={enable_timer:t.enable_timer};break;case`flagship`:m[t.name]={app_id:t.app_id};break;case`ratelimit`:C[t.name]={namespace_id:t.namespace_id,simple:t.simple};break;case`vpc_service`:A[t.name]={service_id:t.service_id};break;case`vpc_network`:t.tunnel_id===void 0?t.network_id===void 0?M.push(t):k[t.name]={network_id:t.network_id}:k[t.name]={tunnel_id:t.tunnel_id};break;case`worker_loader`:j[t.name]={};break;case`inherit`:M.push(t);break;case`wasm_module`:M.push(t);break;case`hyperdrive`:M.push(t);break;case`logfwdr`:M.push(t);break;default:{let e=t;M.push(e)}}}return{options:{agentMemory:n,ai:r,aiSearchInstances:i,aiSearchNamespaces:a,analyticsEngineDatasets:o,artifacts:s,bindings:c,browserRendering:l,dataBlobBindings:u,d1Databases:d,dispatchNamespaces:f,email:{send_email:p},flagship:m,helloWorld:h,images:g,kvNamespaces:_,media:v,mtlsCertificates:y,pipelines:b,queueProducers:x,r2Buckets:S,ratelimits:C,secretsStoreSecrets:w,serviceBindings:T,stream:E,vectorize:D,versionMetadata:O,vpcNetworks:k,vpcServices:A,workerLoaders:j},unsupportedBindings:M}}o(F,`convertWorkerBundleBindings`);function I(e){switch(e.type){case`browser`:case`ai`:case`images`:case`kv_namespace`:case`workflow`:case`queue`:case`r2_bucket`:case`d1`:case`vectorize`:return e.raw===!0;default:return!1}}o(I,`isRawWorkerBinding`);function L(e){return typeof e==`object`&&!!e&&`name`in e&&typeof e.name==`string`&&`type`in e&&typeof e.type==`string`}o(L,`isNamedWorkerBinding`);function R(){return()=>new D.Response(`Binding calls are unavailable during startup profiling.`,{status:503})}o(R,`createOfflineFetcherBinding`);async function z(e,t){let n=V(e,t);return n instanceof Blob?new Uint8Array(await n.arrayBuffer()):new TextEncoder().encode(n)}o(z,`getBinaryBindingPart`);async function B(e,t){let n=V(e,t);return n instanceof Blob?await n.text():n}o(B,`getTextBindingPart`);function V(e,t){let n=e.get(t.part);if(n===null)throw new r(`Startup profiling could not find multipart part ${JSON.stringify(t.part)} for binding ${JSON.stringify(t.name)}.`,{telemetryMessage:`startup profiling binding part missing`});return n}o(V,`getBindingPart`);async function H(e,t){if(t.aborted)throw t.reason;return await new Promise((n,r)=>{let i=o(()=>r(t.reason),`onAbort`);t.addEventListener(`abort`,i,{once:!0}),e.then(n,r).finally(()=>{t.removeEventListener(`abort`,i)})})}o(H,`waitForPromise`);async function U(e,t){if(t.aborted)throw t.reason;return await new Promise((n,r)=>{let i=o(()=>{e.off(`open`,a),e.off(`error`,s),e.off(`close`,c),t.removeEventListener(`abort`,l)},`cleanup`),a=o(()=>{i(),n()},`onOpen`),s=o(e=>{i(),r(e)},`onError`),c=o(()=>{i(),r(Error(`The Worker startup profiler inspector connection closed.`))},`onClose`),l=o(()=>{i(),r(t.reason)},`onAbort`);e.once(`open`,a),e.once(`error`,s),e.once(`close`,c),t.addEventListener(`abort`,l,{once:!0})})}o(U,`waitForInspectorOpen`);async function W(e,t,n,r){if(r.aborted)throw r.reason;return await new Promise((i,a)=>{let s=o(()=>{e.off(`message`,c),r.removeEventListener(`abort`,l)},`cleanup`),c=o(e=>{let r;try{r=JSON.parse(e.toString())}catch(e){s(),a(e);return}if(r.id===t){if(s(),r.error!=null){a(Error(`Inspector command ${n} failed: ${r.error.message??`error ${r.error.code??`unknown`}`}`));return}i(r.result)}},`onMessage`),l=o(()=>{s(),a(r.reason)},`onAbort`);e.on(`message`,c),r.addEventListener(`abort`,l,{once:!0});try{e.send(JSON.stringify({id:t,method:n,params:{}}),e=>{e&&(s(),a(e))})}catch(e){s(),a(e)}})}o(W,`sendInspectorCommand`);async function G(e){return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e}o(G,`getEntryValue`);function K(e){if(e instanceof Blob)try{return A[a(e.type)]}catch{throw Error(`Unable to determine module type for ${e.type} mime type`)}return`Text`}o(K,`getModuleType`);async function q(e){return await Promise.all([...e.entries()].filter(e=>e[1]instanceof Blob&&e[1].type!==`application/source-map`).map(async([e,t])=>({type:K(t),path:e,contents:await G(t)})))}o(q,`convertWorkerBundleToModules`);export{N as i,M as n,j as r,P as t};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{i as e,r as t}from"./cf-oadujOtC.mjs";import{join as n}from"node:path";const r=t(()=>n(e(),`state.json`));function i(){return r.read()??{}}function a(e){let t=i();r.write({...t,...e,...e.telemetry===void 0?{}:{telemetry:{...t.telemetry,...e.telemetry}}})}export{a as n,i as t};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{n as e,t}from"./state-BxCejn42.mjs";export{t as readState,e as updateState};
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-D4bkeMAw.mjs";import{a as r,r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-CUWbw_Tq.mjs";import{n as p,t as m}from"./input-validation-Ch4Vllrm.mjs";import{a as h,n as g}from"./prompt-Bx2PB-tt.mjs";import{t as ee}from"./cli-types-tt_LZMbn.mjs";import{n as te,t as _}from"./raw-fetch-DNTQkXbg.mjs";function v(e){return e.usage(`$0 stream keys create
3
+
4
+ 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.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`create`,describe:`Create signing keys`,builder:v,handler:async r=>c({command:`stream keys create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 b(e){return e.usage(`$0 stream keys delete <identifier>
5
+
6
+ Deletes signing keys and revokes all signed URLs generated with the key.`).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 x={command:`delete <identifier>`,describe:`Delete signing keys`,builder:b,handler:async r=>c({command:`stream keys delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 g({force:!!r.force,message:`Permanently delete signing key? All tokens created with this key will become unauthorized!`})){process.stderr.write(`Aborted.
7
+ `);return}a(await s(`Deleting`,async()=>c.stream.keys.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})})};function S(e){return e.usage(`$0 stream keys list
8
+
9
+ Lists the video ID and creation date and time when a signing key was created.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List signing keys`,builder:S,handler:async r=>c({command:`stream keys list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream keys list`,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.list({account_id:l})),{successLabel:`Loaded`})})},w={command:`keys`,describe:`Signing keys used to generate short-lived signed URLs for private video playback`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 stream live-inputs create
10
+
11
+ Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.`).option(`idempotency-key`,{type:`string`,description:`Prevents duplicate live inputs from being created when retrying this request. The key is scoped to the account, may contain up to 255 bytes, and expires six hours after the live input is created. Reusing a key for a deleted input before expiry returns a 409 Conflict response.`}).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 E={command:`create`,describe:`Create a live input`,builder:T,handler:async d=>c({command:`stream live-inputs create`,classification:{safeFlags:[`enabled`,`prefer-low-latency`,`recording-hide-live-viewer-count`,`recording-mode`,`recording-require-signed-urls`,`dry-run`]}},d,async()=>{let c={};if(d[`idempotency-key`]!==void 0&&(c[`Idempotency-Key`]=String(d[`idempotency-key`])),d.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:d.body===void 0?f({defaultCreator:p(d[`default-creator`],`default-creator`,`text`),deleteRecordingAfterDays:d[`delete-recording-after-days`],enabled:d.enabled,preferLowLatency:d[`prefer-low-latency`],recording:{allowedOrigins:d[`recording-allowed-origins`],hideLiveViewerCount:d[`recording-hide-live-viewer-count`],mode:p(d[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:d[`recording-require-signed-urls`],timeoutSeconds:d[`recording-timeout-seconds`]}}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/live_inputs`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}let g={};d[`default-creator`]!==void 0&&l(g,[`defaultCreator`],p(d[`default-creator`],`default-creator`,`text`)),d[`delete-recording-after-days`]!==void 0&&l(g,[`deleteRecordingAfterDays`],d[`delete-recording-after-days`]),d.enabled!==void 0&&l(g,[`enabled`],d.enabled),d[`prefer-low-latency`]!==void 0&&l(g,[`preferLowLatency`],d[`prefer-low-latency`]),d[`recording-allowed-origins`]!==void 0&&l(g,[`recording`,`allowedOrigins`],d[`recording-allowed-origins`]),d[`recording-hide-live-viewer-count`]!==void 0&&l(g,[`recording`,`hideLiveViewerCount`],d[`recording-hide-live-viewer-count`]),d[`recording-mode`]!==void 0&&l(g,[`recording`,`mode`],p(d[`recording-mode`],`recording-mode`,`text`)),d[`recording-require-signed-urls`]!==void 0&&l(g,[`recording`,`requireSignedURLs`],d[`recording-require-signed-urls`]),d[`recording-timeout-seconds`]!==void 0&&l(g,[`recording`,`timeoutSeconds`],d[`recording-timeout-seconds`]),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/live_inputs`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function D(e){return e.usage(`$0 stream live-inputs delete <live-input-identifier>
12
+
13
+ Permanently delete a live input, making it inaccessible and blocking current and future broadcasts to it. Existing recordings will be retained.`).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 O={command:`delete <live-input-identifier>`,describe:`Delete a live input`,builder:D,handler:async r=>c({command:`stream live-inputs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 g({force:!!r.force,message:`Permanently delete this live input? It cannot be recreated.`})){process.stderr.write(`Aborted.
14
+ `);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.delete({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})})};function k(e){return e.usage(`$0 stream live-inputs disable <live-input-identifier>
15
+
16
+ Prevents a live input from being streamed to and terminates any active broadcasts until re-enabled.`).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 A={command:`disable <live-input-identifier>`,describe:`Disable a live input`,builder:k,handler:async r=>c({command:`stream live-inputs disable`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream live-inputs disable`,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 g({force:!!r.force,message:`Disable this live input? Active broadcasts will be terminated and future connections will be blocked until it is re-enabled.`})){process.stderr.write(`Aborted.
17
+ `);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.disable({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})})};function j(e){return e.usage(`$0 stream live-inputs enable <live-input-identifier>
18
+
19
+ Allows a disabled live input to start receiving broadcasts again.`).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 M={command:`enable <live-input-identifier>`,describe:`Enable a live input`,builder:j,handler:async r=>c({command:`stream live-inputs enable`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream live-inputs enable`,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({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`})})};function N(e){return e.usage(`$0 stream live-inputs get <live-input-identifier>
20
+
21
+ Retrieves details of an existing live input.`).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 P={command:`get <live-input-identifier>`,describe:`Retrieve a live input`,builder:N,handler:async r=>c({command:`stream live-inputs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 F(e){return e.usage(`$0 stream live-inputs list
22
+
23
+ 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.`).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 I={command:`list`,describe:`List live inputs`,builder:F,handler:async r=>c({command:`stream live-inputs list`,classification:{safeFlags:[`include-counts`,`dry-run`]}},r,async()=>{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 L(e){return e.usage(`$0 stream live-inputs outputs create <live-input-identifier>
24
+
25
+ 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.`).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 R={command:`create <live-input-identifier>`,describe:`Create a new output, connected to a live input`,builder:L,handler:async r=>c({command:`stream live-inputs outputs create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{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?f({enabled:r.enabled,streamKey:p(r[`stream-key`],`stream-key`,`text`),url:p(r.url,`url`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.stream.liveInputs.outputs.create({...e,account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`});return}r[`stream-key`]===void 0&&(r[`stream-key`]=await h(`stream-key`,`The streamKey used to authenticate against an output's target.`,{kind:`secret`})),r.url===void 0&&(r.url=await h(`url`,`The URL an output uses to restream.`,{kind:`secret`}));let d=f({enabled:r.enabled,streamKey:p(r[`stream-key`],`stream-key`,`text`),url:p(r.url,`url`,`text`)});a(await s(`Creating`,async()=>c.stream.liveInputs.outputs.create({...d,account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Created`})})};function z(e){return e.usage(`$0 stream live-inputs outputs delete <output-identifier>
26
+
27
+ Deletes an output and removes it from the associated live input.`).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 B={command:`delete <output-identifier>`,describe:`Delete an output`,builder:z,handler:async r=>c({command:`stream live-inputs outputs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 g({force:!!r.force,message:`Delete this output? Any active broadcast to this target will be terminated.`})){process.stderr.write(`Aborted.
28
+ `);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 V(e){return e.usage(`$0 stream live-inputs outputs list
29
+
30
+ Retrieves all outputs associated with a specified live input.`).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 H={command:`list`,describe:`List all outputs associated with a specified live input`,builder:V,handler:async r=>c({command:`stream live-inputs outputs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 U(e){return e.usage(`$0 stream live-inputs outputs update <output-identifier>
31
+
32
+ Updates the state of an output.`).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 W={command:`update <output-identifier>`,describe:`Update an output`,builder:U,handler:async r=>c({command:`stream live-inputs outputs update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{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?f({enabled:r.enabled}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.stream.liveInputs.outputs.update({...e,account_id:l,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 d=f({enabled:r.enabled});a(await s(`Updating`,async()=>c.stream.liveInputs.outputs.update({...d,account_id:l,live_input_identifier:r[`live-input-identifier`],output_identifier:r[`output-identifier`]})),{successLabel:`Updated`})})},G={command:`outputs`,describe:`Operations for live-inputs.outputs`,builder:e=>e.command(R).command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.usage(`$0 stream live-inputs rotate-keys <live-input-identifier>
33
+
34
+ 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.`).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 q={command:`rotate-keys <live-input-identifier>`,describe:`Rotate keys for a live input`,builder:K,handler:async r=>c({command:`stream live-inputs rotate-keys`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream live-inputs rotate-keys`,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();if(r.accountId=l,!await g({force:!!r.force,message:`Rotate keys for this live input? Active broadcasts will be terminated. New broadcasts cannot start with outdated credentials.`})){process.stderr.write(`Aborted.
35
+ `);return}a(await s(`Deleting`,async()=>c.stream.liveInputs.rotateKeys({account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Deleted`})})};function J(e){return e.usage(`$0 stream live-inputs update <live-input-identifier>
36
+
37
+ Updates a specified live input.`).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 Y={command:`update <live-input-identifier>`,describe:`Update a live input`,builder:J,handler:async r=>c({command:`stream live-inputs update`,classification:{safeFlags:[`enabled`,`prefer-low-latency`,`recording-hide-live-viewer-count`,`recording-mode`,`recording-require-signed-urls`,`dry-run`]}},r,async()=>{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?f({defaultCreator:p(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:p(r[`recording-mode`],`recording-mode`,`text`),requireSignedURLs:r[`recording-require-signed-urls`],timeoutSeconds:r[`recording-timeout-seconds`]}}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.stream.liveInputs.update({...e,account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Updated`});return}let d=f({defaultCreator:p(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:p(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({...d,account_id:l,live_input_identifier:r[`live-input-identifier`]})),{successLabel:`Updated`})})},X={command:`live-inputs`,describe:`Enable and disable live input streams`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(I).command(q).command(Y).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.usage(`$0 stream storage-usage
38
+
39
+ Returns information about an account's storage use.`).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 Q={command:`storage-usage`,describe:`Storage use`,builder:Z,handler:async r=>c({command:`stream storage-usage`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={creator:r.creator};if(r.dryRun){o({command:`cf stream 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.storageUsage({account_id:u,...c})),{successLabel:`Loaded`})})};function ne(e){return e.usage(`$0 stream videos audio-tracks copy <identifier>
40
+
41
+ Adds an additional audio track to a video using the provided audio track URL.`).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 re={command:`copy <identifier>`,describe:`Add audio tracks to a video`,builder:ne,handler:async r=>c({command:`stream videos audio-tracks copy`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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?f({label:p(r.label,`label`,`text`),url:p(r.url,`url`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.stream.videos.audioTracks.copy({...e,account_id:l,identifier:r.identifier})),{successLabel:`Created`});return}r.label===void 0&&(r.label=await h(`label`,`A string to uniquely identify the track amongst other audio track labels for the specified video.`));let d=f({label:p(r.label,`label`,`text`),url:p(r.url,`url`,`text`)});a(await s(`Creating`,async()=>c.stream.videos.audioTracks.copy({...d,account_id:l,identifier:r.identifier})),{successLabel:`Created`})})};function ie(e){return e.usage(`$0 stream videos audio-tracks delete <audio-identifier>
42
+
43
+ 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.`).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 ae={command:`delete <audio-identifier>`,describe:`Delete additional audio tracks on a video`,builder:ie,handler:async r=>c({command:`stream videos audio-tracks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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 g({force:!!r.force,message:`Permanently delete this audio track?`})){process.stderr.write(`Aborted.
44
+ `);return}a(await s(`Deleting`,async()=>c.stream.videos.audioTracks.delete({account_id:l,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Deleted`})})};function oe(e){return e.usage("$0 stream videos audio-tracks edit <audio-identifier>\n\nEdits 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`.").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 se={command:`edit <audio-identifier>`,describe:`Edit additional audio tracks on a video`,builder:oe,handler:async r=>c({command:`stream videos audio-tracks edit`,classification:{safeFlags:[`default`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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?f({default:r.default,label:p(r.label,`label`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.stream.videos.audioTracks.edit({...e,account_id:l,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Updated`});return}let d=f({default:r.default,label:p(r.label,`label`,`text`)});a(await s(`Updating`,async()=>c.stream.videos.audioTracks.edit({...d,account_id:l,identifier:r.identifier,audio_identifier:r[`audio-identifier`]})),{successLabel:`Updated`})})};function ce(e){return e.usage(`$0 stream videos audio-tracks list
45
+
46
+ Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.`).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 le={command:`list`,describe:`List additional audio tracks on a video`,builder:ce,handler:async r=>c({command:`stream videos audio-tracks list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos audio-tracks list`,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.videos.audioTracks.list({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})})},ue={command:`audio-tracks`,describe:`Operations for videos.audio-tracks`,builder:e=>e.command(re).command(ae).command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.usage(`$0 stream videos captions language delete <language>
47
+
48
+ Removes the captions or subtitles from a video.`).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 fe={command:`delete <language>`,describe:`Delete captions or subtitles`,builder:de,handler:async r=>c({command:`stream videos captions language delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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 g({force:!!r.force,message:`Remove this caption?`})){process.stderr.write(`Aborted.
49
+ `);return}a(await s(`Deleting`,async()=>c.stream.videos.captions.language.delete({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Deleted`})})};function pe(e){return e.usage(`$0 stream videos captions language generate <language>
50
+
51
+ Generate captions or subtitles for provided language via AI.`).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 me={command:`generate <language>`,describe:`Generate captions or subtitles for a provided language via AI`,builder:pe,handler:async r=>c({command:`stream videos captions language generate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos captions language generate`,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.videos.captions.language.generate({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Created`})})};function he(e){return e.usage(`$0 stream videos captions language get <language>
52
+
53
+ Lists the captions or subtitles for provided language.`).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 ge={command:`get <language>`,describe:`List captions or subtitles for a provided language`,builder:he,handler:async r=>c({command:`stream videos captions language get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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.videos.captions.language.get({account_id:l,identifier:r.identifier,language:r.language})),{successLabel:`Loaded`})})};function _e(e){return e.usage(`$0 stream videos captions language upload <language>
54
+
55
+ Uploads the caption or subtitle file to the endpoint for a specific BCP47 language. One caption or subtitle file per language is allowed.`).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 ve={command:`upload <language>`,describe:`Upload captions or subtitles`,builder:_e,handler:async l=>c({command:`stream videos captions language upload`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){o({command:`cf stream videos captions language upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/${l.identifier==null?`<identifier>`:encodeURIComponent(String(l.identifier))}/captions/${l.language==null?`<language>`:encodeURIComponent(String(l.language))}`,pathParams:{language:String(l.language??``),identifier:String(l.identifier??``)},bodyKind:`multipart`,body:{body:l.body,file:l.file}});return}let c=await i(l),u=l.local?e:await t();if(l.accountId=u,l.file!==void 0||l.body!==void 0){let e=new FormData;if(l.file){let t=m(l.file);e.append(`file`,new Blob([t]),l.file.split(/[\\/]/).filter(Boolean).pop())}else l.body!==void 0&&e.append(`file`,l.body);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(l.identifier))}/captions/${encodeURIComponent(String(l.language))}`,{body:e})),{successLabel:`Updated`});return}if(l.body){let e=p(l.body,`body`,`binary`);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${u}/stream/${encodeURIComponent(String(l.identifier))}/captions/${encodeURIComponent(String(l.language))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function ye(e){return e.usage(`$0 stream videos captions language vtt get <language>
56
+
57
+ Return WebVTT captions for a provided language.`).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 be={command:`get <language>`,describe:`Return WebVTT captions for a provided language`,builder:ye,handler:async r=>c({command:`stream videos captions language vtt get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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,te((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`))})},xe={command:`vtt`,describe:`Operations for videos.captions.language.vtt`,builder:e=>e.command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Se={command:`language`,describe:`Operations for videos.captions.language`,builder:e=>e.command(fe).command(me).command(ge).command(ve).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.usage(`$0 stream videos captions list
58
+
59
+ Lists the available captions or subtitles for a specific video.`).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 we={command:`list`,describe:`List captions or subtitles`,builder:Ce,handler:async r=>c({command:`stream videos captions list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos captions list`,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.videos.captions.list({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})})},Te={command:`captions`,describe:`Operations for videos.captions`,builder:e=>e.command(we).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.usage(`$0 stream videos clip
60
+
61
+ Clips a video based on the specified start and end times provided in seconds.`).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 De={command:`clip`,describe:`Clip videos given a start and end time`,builder:Ee,handler:async r=>c({command:`stream videos clip`,classification:{safeFlags:[`require-signed-urls`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos clip`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/clip`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:p(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:p(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:p(r.input,`input`,`text`),name:p(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:p(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:p(r.url,`url`,`text`),watermark:{uid:p(r[`watermark-uid`],`watermark-uid`,`text`)}}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.stream.videos.clip({...e,account_id:l})),{successLabel:`Created`});return}if(r[`clipped-from-video-uid`]===void 0&&(r[`clipped-from-video-uid`]=await h(`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 d=f({allowedOrigins:r[`allowed-origins`],clippedFromVideoUID:p(r[`clipped-from-video-uid`],`clipped-from-video-uid`,`text`),creator:p(r.creator,`creator`,`text`),endTimeSeconds:r[`end-time-seconds`],input:p(r.input,`input`,`text`),name:p(r.name,`name`,`text`),requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:p(r[`scheduled-deletion`],`scheduled-deletion`,`text`),startTimeSeconds:r[`start-time-seconds`],thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],url:p(r.url,`url`,`text`),watermark:{uid:p(r[`watermark-uid`],`watermark-uid`,`text`)}});a(await s(`Creating`,async()=>c.stream.videos.clip({...d,account_id:l})),{successLabel:`Created`})})};function Oe(e){return e.usage(`$0 stream videos copy
62
+
63
+ Uploads a video to Stream from a provided URL.`).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 ke={command:`copy`,describe:`Upload videos from a URL`,builder:Oe,handler:async d=>c({command:`stream videos copy`,classification:{safeFlags:[`require-signed-urls`,`dry-run`]}},d,async()=>{let c={};if(d[`upload-creator`]!==void 0&&(c[`Upload-Creator`]=String(d[`upload-creator`])),d.dryRun){o({command:`cf stream videos copy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/copy`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({allowedOrigins:d[`allowed-origins`],creator:p(d.creator,`creator`,`text`),input:p(d.input,`input`,`text`),name:p(d.name,`name`,`text`),requireSignedURLs:d[`require-signed-urls`],scheduledDeletion:p(d[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:d[`thumbnail-timestamp-pct`],url:p(d.url,`url`,`text`),watermark:{uid:p(d[`watermark-uid`],`watermark-uid`,`text`)}}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/copy`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}let g={};d[`allowed-origins`]!==void 0&&l(g,[`allowedOrigins`],d[`allowed-origins`]),d.creator!==void 0&&l(g,[`creator`],p(d.creator,`creator`,`text`)),d.input!==void 0&&l(g,[`input`],p(d.input,`input`,`text`)),d.name!==void 0&&l(g,[`name`],p(d.name,`name`,`text`)),d[`require-signed-urls`]!==void 0&&l(g,[`requireSignedURLs`],d[`require-signed-urls`]),d[`scheduled-deletion`]!==void 0&&l(g,[`scheduledDeletion`],p(d[`scheduled-deletion`],`scheduled-deletion`,`text`)),d[`thumbnail-timestamp-pct`]!==void 0&&l(g,[`thumbnailTimestampPct`],d[`thumbnail-timestamp-pct`]),d.url!==void 0&&l(g,[`url`],p(d.url,`url`,`text`)),d[`watermark-uid`]!==void 0&&l(g,[`watermark`,`uid`],p(d[`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(c).length>0?c:void 0})),{successLabel:`Created`})})};function Ae(e){return e.usage(`$0 stream videos create
64
+
65
+ 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.`).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.
66
+ 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 je={command:`create`,describe:`Initiate video uploads using TUS`,builder:Ae,handler:async l=>c({command:`stream videos create`,classification:{safeFlags:[`direct-user`,`dry-run`]}},l,async()=>{let c={direct_user:l[`direct-user`]},u={};if(l[`tus-resumable`]!==void 0&&(u[`Tus-Resumable`]=String(l[`tus-resumable`])),l[`upload-creator`]!==void 0&&(u[`Upload-Creator`]=String(l[`upload-creator`])),l[`upload-length`]!==void 0&&(u[`Upload-Length`]=String(l[`upload-length`])),l[`upload-metadata`]!==void 0&&(u[`Upload-Metadata`]=String(l[`upload-metadata`])),l.dryRun){o({command:`cf stream videos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream`,pathParams:{},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Creating`,async()=>r(d,`POST`,`/accounts/${f}/stream`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Created`})})};function Me(e){return e.usage(`$0 stream videos delete <identifier>
67
+
68
+ Deletes a video and its copies from Cloudflare Stream.`).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 Ne={command:`delete <identifier>`,describe:`Delete video`,builder:Me,handler:async r=>c({command:`stream videos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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 g({force:!!r.force,message:`Permanently delete this video?`})){process.stderr.write(`Aborted.
69
+ `);return}a(await s(`Deleting`,async()=>c.stream.videos.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})})};function Pe(e){return e.usage(`$0 stream videos direct-upload create
70
+
71
+ Creates a direct upload endpoint that allows an end-user to upload a video without an API key.`).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 Fe={command:`create`,describe:`Upload videos via direct upload URLs`,builder:Pe,handler:async d=>c({command:`stream videos direct-upload create`,classification:{safeFlags:[`require-signed-urls`,`dry-run`]}},d,async()=>{let c={};if(d[`upload-creator`]!==void 0&&(c[`Upload-Creator`]=String(d[`upload-creator`])),d.dryRun){o({command:`cf stream videos direct-upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/stream/direct_upload`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({allowedOrigins:d[`allowed-origins`],creator:p(d.creator,`creator`,`text`),expiry:p(d.expiry,`expiry`,`text`),maxDurationSeconds:d[`max-duration-seconds`],requireSignedURLs:d[`require-signed-urls`],scheduledDeletion:p(d[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:d[`thumbnail-timestamp-pct`],watermark:{uid:p(d[`watermark-uid`],`watermark-uid`,`text`)}}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/stream/direct_upload`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(d[`max-duration-seconds`]===void 0)throw Error(`--max-duration-seconds is required (or pass --body with this field set).`);let g={};d[`allowed-origins`]!==void 0&&l(g,[`allowedOrigins`],d[`allowed-origins`]),d.creator!==void 0&&l(g,[`creator`],p(d.creator,`creator`,`text`)),d.expiry!==void 0&&l(g,[`expiry`],p(d.expiry,`expiry`,`text`)),d[`max-duration-seconds`]!==void 0&&l(g,[`maxDurationSeconds`],d[`max-duration-seconds`]),d[`require-signed-urls`]!==void 0&&l(g,[`requireSignedURLs`],d[`require-signed-urls`]),d[`scheduled-deletion`]!==void 0&&l(g,[`scheduledDeletion`],p(d[`scheduled-deletion`],`scheduled-deletion`,`text`)),d[`thumbnail-timestamp-pct`]!==void 0&&l(g,[`thumbnailTimestampPct`],d[`thumbnail-timestamp-pct`]),d[`watermark-uid`]!==void 0&&l(g,[`watermark`,`uid`],p(d[`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(c).length>0?c:void 0})),{successLabel:`Created`})})},Ie={command:`direct-upload`,describe:`Operations for videos.direct-upload`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.usage(`$0 stream videos downloads create <download-type>
72
+
73
+ Creates a download for a video of specified type. For backwards-compatibility, POST requests to /downloads will enable the default download.`).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 Re={command:`create <download-type>`,describe:`Create download`,builder:Le,handler:async r=>c({command:`stream videos downloads create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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.videos.downloads.create({account_id:l,identifier:r.identifier,download_type:r[`download-type`]})),{successLabel:`Created`})})};function ze(e){return e.usage(`$0 stream videos downloads delete <download-type>
74
+
75
+ Delete specific type of download. For backwards-compatibility, DELETE requests to /downloads will delete the default download.`).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 Be={command:`delete <download-type>`,describe:`Delete download`,builder:ze,handler:async r=>c({command:`stream videos downloads delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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 g({force:!!r.force,message:`Remove this download? It will need to be regenerated for future use.`})){process.stderr.write(`Aborted.
76
+ `);return}a(await s(`Deleting`,async()=>c.stream.videos.downloads.delete({account_id:l,identifier:r.identifier,download_type:r[`download-type`]})),{successLabel:`Deleted`})})},Ve={command:`downloads`,describe:`Operations for videos.downloads`,builder:e=>e.command(Re).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function He(e){return e.usage(`$0 stream videos edit <identifier>
77
+
78
+ Edit details for a single video.`).positional(`identifier`,{type:`string`,description:`A Cloudflare-generated unique identifier for a media item.`,demandOption:!0}).option(`allowed-origins`,{type:`string`,array:!0,description:"Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. Empty arrays allow the video to be viewed on any origin."}).option(`creator`,{type:`string`,description:`A user-defined identifier for the media creator.`}).option(`max-duration-seconds`,{type:`number`,description:"The maximum duration in seconds for a video upload. Can be set for a video that is not yet uploaded to limit its duration. Uploads that exceed the specified duration will fail during processing. A value of `-1` means the value is unknown."}).option(`public-details-channel-link`,{type:`string`,description:`The publicDetails.channel_link field`}).option(`public-details-logo`,{type:`string`,description:`The publicDetails.logo field`}).option(`public-details-share-link`,{type:`string`,description:`The publicDetails.share_link field`}).option(`public-details-title`,{type:`string`,description:`The publicDetails.title field`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the video can be a accessed using the UID. When set to `true`, a signed token must be generated with a signing key to view the video.",default:!1}).option(`scheduled-deletion`,{type:`string`,description:"Indicates the date and time at which the video will be deleted. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion. If specified, must be at least 30 days from upload time."}).option(`thumbnail-timestamp-pct`,{type:`number`,description:`The timestamp for a thumbnail image calculated as a percentage value of the video's duration. To convert from a second-wise timestamp to a percentage, divide the desired timestamp by the total duration of the video. If this value is not set, the default thumbnail image is taken from 0s of the video.`,default:0}).option(`uid`,{type:`string`,description:`The unique identifier for the video. Can be used to verify the video being updated.`}).option(`upload-expiry`,{type:`string`,description:`The date and time when the video upload URL is no longer valid for direct user uploads.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ue={command:`edit <identifier>`,describe:`Edit video details`,builder:He,handler:async r=>c({command:`stream videos edit`,classification:{safeFlags:[`require-signed-urls`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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?f({allowedOrigins:r[`allowed-origins`],creator:p(r.creator,`creator`,`text`),maxDurationSeconds:r[`max-duration-seconds`],publicDetails:{channel_link:p(r[`public-details-channel-link`],`public-details-channel-link`,`text`),logo:p(r[`public-details-logo`],`public-details-logo`,`text`),share_link:p(r[`public-details-share-link`],`public-details-share-link`,`text`),title:p(r[`public-details-title`],`public-details-title`,`text`)},requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:p(r[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],uid:p(r.uid,`uid`,`text`),uploadExpiry:p(r[`upload-expiry`],`upload-expiry`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.stream.videos.edit({...e,account_id:l,identifier:r.identifier})),{successLabel:`Created`});return}let d=f({allowedOrigins:r[`allowed-origins`],creator:p(r.creator,`creator`,`text`),maxDurationSeconds:r[`max-duration-seconds`],publicDetails:{channel_link:p(r[`public-details-channel-link`],`public-details-channel-link`,`text`),logo:p(r[`public-details-logo`],`public-details-logo`,`text`),share_link:p(r[`public-details-share-link`],`public-details-share-link`,`text`),title:p(r[`public-details-title`],`public-details-title`,`text`)},requireSignedURLs:r[`require-signed-urls`],scheduledDeletion:p(r[`scheduled-deletion`],`scheduled-deletion`,`text`),thumbnailTimestampPct:r[`thumbnail-timestamp-pct`],uid:p(r.uid,`uid`,`text`),uploadExpiry:p(r[`upload-expiry`],`upload-expiry`,`text`)});a(await s(`Creating`,async()=>c.stream.videos.edit({...d,account_id:l,identifier:r.identifier})),{successLabel:`Created`})})};function We(e){return e.usage(`$0 stream videos get <identifier>
79
+
80
+ Fetches details for a single video.`).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:`Retrieve video details`,builder:We,handler:async r=>c({command:`stream videos get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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.videos.get({account_id:l,identifier:r.identifier})),{successLabel:`Loaded`})})};function Ke(e){return e.usage(`$0 stream videos list
81
+
82
+ Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.`).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 qe={command:`list`,describe:`List videos`,builder:ee(Ke),handler:async r=>c({command:`stream videos list`,classification:{safeFlags:[`status`,`asc`,`include-counts`,`dry-run`]}},r,async()=>{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 videos 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.videos.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Je(e){return e.usage(`$0 stream videos token create <identifier>
83
+
84
+ Creates a signed URL token for a video. If a body is not provided in the request, a token is created with default values.`).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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ye={command:`create <identifier>`,describe:`Create signed URL tokens for videos`,builder:Je,handler:async r=>c({command:`stream videos token create`,classification:{safeFlags:[`downloadable`,`flags-original`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf stream videos 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?f({accessRules:d(r[`access-rules`],`access-rules`),downloadable:r.downloadable,exp:r.exp,flags:{original:r[`flags-original`]},id:p(r.id,`id`,`text`),nbf:r.nbf,pem:p(r.pem,`pem`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`Provision temporary token? For use at scale, consider creating a signing key instead.`})){process.stderr.write(`Aborted.
85
+ `);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.stream.videos.token.create({...e,account_id:l,identifier:r.identifier})),{successLabel:`Deleted`});return}let m=f({accessRules:d(r[`access-rules`],`access-rules`),downloadable:r.downloadable,exp:r.exp,flags:{original:r[`flags-original`]},id:p(r.id,`id`,`text`),nbf:r.nbf,pem:p(r.pem,`pem`,`text`)});a(await s(`Deleting`,async()=>c.stream.videos.token.create({...m,account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})})},Xe={command:`token`,describe:`Operations for videos.token`,builder:e=>e.command(Ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ze={command:`videos`,describe:`Aggregate video storage usage statistics for the account`,builder:e=>e.command(De).command(ke).command(je).command(Ne).command(Ue).command(Ge).command(qe).command(ue).command(Te).command(Ie).command(Ve).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(e){return e.usage(`$0 stream watermarks create
86
+
87
+ Creates watermark profiles using a single \`HTTP POST multipart/form-data\` request.`).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 $e={command:`create`,describe:`Create watermark profiles via basic upload`,builder:Qe,handler:async d=>c({command:`stream watermarks create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.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:d.name,opacity:d.opacity,padding:d.padding,position:d.position,scale:d.scale,url:d.url,body:d.body,file:d.file}});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file!==void 0||d.body!==void 0||d.name!==void 0||d.opacity!==void 0||d.padding!==void 0||d.position!==void 0||d.scale!==void 0){let e=new FormData;if(d.file){let t=m(d.file);e.append(`file`,new Blob([t]),d.file.split(/[\\/]/).filter(Boolean).pop())}else d.body!==void 0&&e.append(`file`,d.body);d.name!==void 0&&e.append(`name`,String(p(d.name,`name`,`text`)??``)),d.opacity!==void 0&&e.append(`opacity`,String(d.opacity)),d.padding!==void 0&&e.append(`padding`,String(d.padding)),d.position!==void 0&&e.append(`position`,String(p(d.position,`position`,`text`)??``)),d.scale!==void 0&&e.append(`scale`,String(d.scale)),a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/stream/watermarks`,{body:e})),{successLabel:`Created`});return}if(d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/stream/watermarks`,{body:e})),{successLabel:`Created`});return}let h={};d.name!==void 0&&l(h,[`name`],p(d.name,`name`,`text`)),d.opacity!==void 0&&l(h,[`opacity`],d.opacity),d.padding!==void 0&&l(h,[`padding`],d.padding),d.position!==void 0&&l(h,[`position`],p(d.position,`position`,`text`)),d.scale!==void 0&&l(h,[`scale`],d.scale),d.url!==void 0&&l(h,[`url`],p(d.url,`url`,`text`)),a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/stream/watermarks`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})})};function et(e){return e.usage(`$0 stream watermarks delete <identifier>
88
+
89
+ Deletes a watermark profile.`).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 tt={command:`delete <identifier>`,describe:`Delete watermark profiles`,builder:et,handler:async r=>c({command:`stream watermarks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 g({force:!!r.force,message:`Remove this watermark profile? New upload requests referencing this profile will fail.`})){process.stderr.write(`Aborted.
90
+ `);return}a(await s(`Deleting`,async()=>c.stream.watermarks.delete({account_id:l,identifier:r.identifier})),{successLabel:`Deleted`})})};function $(e){return e.usage(`$0 stream watermarks get <identifier>
91
+
92
+ Retrieves details for a single watermark profile.`).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 nt={command:`get <identifier>`,describe:`Watermark profile details`,builder:$,handler:async r=>c({command:`stream watermarks get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 rt(e){return e.usage(`$0 stream watermarks list
93
+
94
+ Lists all watermark profiles for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`list`,describe:`List watermark profiles`,builder:rt,handler:async r=>c({command:`stream watermarks list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},at={command:`watermarks`,describe:`Watermark profiles that overlay an image on every video in the account`,builder:e=>e.command($e).command(tt).command(nt).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ot(e){return e.usage(`$0 stream webhooks delete
95
+
96
+ Deletes the on-demand video webhook.`).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`,describe:`Delete webhooks`,builder:ot,handler:async r=>c({command:`stream webhooks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 g({force:!!r.force,message:`Delete this webhook? If recreated, the secret will change.`})){process.stderr.write(`Aborted.
97
+ `);return}a(await s(`Deleting`,async()=>c.stream.webhooks.delete({account_id:l})),{successLabel:`Deleted`})})};function ct(e){return e.usage(`$0 stream webhooks get
98
+
99
+ Retrieve current on-demand webhook information.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lt={command:`get`,describe:`View webhook`,builder:ct,handler:async r=>c({command:`stream webhooks get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 ut(e){return e.usage(`$0 stream webhooks update
100
+
101
+ Create a webhook for notifications about on-demand video uploads.`).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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const dt={command:`update`,describe:`Create VOD webhooks`,builder:ut,handler:async r=>c({command:`stream webhooks update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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?f({notification_url:p(r[`notification-url`],`notification-url`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`Create a webhook for on-demand operations? Will replace previously configured webhook. Live input webhooks are handled via Notifications Service.`})){process.stderr.write(`Aborted.
102
+ `);return}if(r.body){let e=u(r.body);a(await s(`Deleting`,async()=>c.stream.webhooks.update({body:e,account_id:l})),{successLabel:`Deleted`});return}let d=f({notification_url:p(r[`notification-url`],`notification-url`,`text`)});a(await s(`Deleting`,async()=>c.stream.webhooks.update({body:d,account_id:l})),{successLabel:`Deleted`})})},ft={command:`webhooks`,describe:`Webhook notifications for video lifecycle events (ready, error, etc.)`,builder:e=>e.command(st).command(lt).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},pt={command:`stream`,describe:`Video encoding, storage, and delivery — upload, live-stream, clip, caption, and embed video at scale`,builder:e=>e.command(Q).command(w).command(X).command(Ze).command(at).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{pt as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-D4bkeMAw.mjs";import{r}from"./auth-Cp7gT-AF.mjs";import{t as i}from"./output-Bia1u2k5.mjs";import{t as a}from"./dry-run-CLX6Pbtq.mjs";import{t as o}from"./progress-Bi02B6v4.mjs";import{t as s}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";function c(e){return e.usage(`$0 submit create
3
+
4
+ Return new URL submissions`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`create`,describe:`Create new URL submissions`,builder:c,handler:async c=>s({command:`submit create`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.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 s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.submit.create({account_id:l})),{successLabel:`Created`})})},u={command:`submit`,describe:`submit`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{u as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-D4bkeMAw.mjs";import{r}from"./auth-Cp7gT-AF.mjs";import{t as i}from"./output-Bia1u2k5.mjs";import{t as a}from"./dry-run-CLX6Pbtq.mjs";import{t as o}from"./progress-Bi02B6v4.mjs";import{t as s}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{t as c}from"./cli-types-tt_LZMbn.mjs";function l(e){return e.usage(`$0 tags resources list
3
+
4
+ Lists all tagged resources for an account.`).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 u={command:`list`,describe:`List tagged resources`,builder:c(l),handler:async c=>s({command:`tags resources list`,classification:{safeFlags:[`case-insensitive`,`dry-run`]}},c,async()=>{let s={type:c.type,name:c.name,id:c.id,case_insensitive:c[`case-insensitive`],tag:c.tag,cursor:c.cursor};if(c.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:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.tags.resources.list({account_id:u,...s})),{successLabel:`Loaded`})})},d={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`tags`,describe:`tags`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,n as t}from"./theme-CeVf-5qG.mjs";import"./ui-DQSZeaG5.mjs";import{l as n,s as r,t as i}from"./config-BY6KpMZs.mjs";const a={command:`disable`,describe:`Disable cf telemetry collection`,handler:()=>{n(!1);let{enabled:e,source:a}=r(),o=t(),s=e?o.green(`Enabled`):o.red(`Disabled`),c=a===`env`?` (set by ${i})`:``;console.log(`Status: ${s}${c}\n`),console.log(e?`cf is collecting usage telemetry because ${i}=true overrides this setting.\n`:`cf is no longer collecting usage telemetry.
2
+ import{a as e,n as t}from"./theme-BiIYWOed.mjs";import"./ui-DH95w1Qk.mjs";import{l as n,s as r,t as i}from"./config-B4vIa0zp.mjs";const a={command:`disable`,describe:`Disable cf telemetry collection`,handler:()=>{n(!1);let{enabled:e,source:a}=r(),o=t(),s=e?o.green(`Enabled`):o.red(`Disabled`),c=a===`env`?` (set by ${i})`:``;console.log(`Status: ${s}${c}\n`),console.log(e?`cf is collecting usage telemetry because ${i}=true overrides this setting.\n`:`cf is no longer collecting usage telemetry.
3
3
  `)}},o={command:`enable`,describe:`Enable cf telemetry collection`,handler:()=>{n(!0);let{enabled:e,source:a}=r(),o=t(),s=e?o.green(`Enabled`):o.red(`Disabled`),c=a===`env`?` (set by ${i})`:``;console.log(`Status: ${s}${c}\n`),console.log(e?`cf is now collecting anonymous usage telemetry. Thank you for helping make cf better.
4
4
  `:`cf is not collecting usage telemetry because ${i}=false overrides this setting.\n`)}},s={command:`status`,describe:`Check whether cf telemetry collection is enabled`,handler:()=>{let n=t(),{enabled:a,source:o}=r(),s=a?n.green(`Enabled`):n.red(`Disabled`),c=o===`env`?` (set by ${i})`:``;console.log(`Status: ${s}${c}\n`),console.log(e.muted(`Configure on this machine: \`cf telemetry enable\` / \`cf telemetry disable\`.
5
5
  Override per invocation with ${i}=true/false.\nLearn more: https://github.com/cloudflare/cf/blob/main/packages/cli/telemetry.md`))}},c={command:`telemetry`,describe:`Configure whether cf collects anonymous usage telemetry`,builder:e=>e.command(s).command(o).command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{c as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{a as e,n as t,r as n,t as r}from"./lifecycle-Ichnb2x1.mjs";import{a as i,c as a,i as o,l as s,n as c,o as l,r as u,s as d,t as f}from"./config-B4vIa0zp.mjs";import{i as p,n as m,r as h,t as g}from"./run-BBBMrSrs.mjs";import{t as _}from"./telemetry-mKEb8lYB.mjs";export{f as TELEMETRY_ENV_VAR,c as TELEMETRY_POLICY_DATE,_ as UNKNOWN_COMMAND_EVENT,r as allTelemetryDispatchesSettled,t as beginTelemetryRun,u as getBannerLastShown,o as getDeviceId,p as getTelemetryDispatcher,i as getTelemetryFromEnv,l as isFirstUsage,n as markCommandReported,d as resolveTelemetry,g as runWithTelemetry,h as sanitizeArgs,a as setBannerLastShown,s as setTelemetryPermission,e as wasCommandReported,m as withTelemetry};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import"./config-B4vIa0zp.mjs";import"./run-BBBMrSrs.mjs";const e=`unknown command`;export{e as t};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";function a(e){return e.usage(`$0 tenant account-type list
3
+
4
+ List of account types available for the Tenant to provision accounts.`).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 o={command:`list`,describe:`Get tenant account types`,builder:a,handler:async a=>i({command:`tenant account-type list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf tenant account-type list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(a[`tenant-id`]))}/account_types`,pathParams:{"tenant-id":String(a[`tenant-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.tenant.accountType.list({tenant_id:a[`tenant-id`]})),{successLabel:`Loaded`})})},s={command:`account-type`,describe:`Operations for account-type`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function c(e){return e.usage(`$0 tenant account list
5
+
6
+ List of accounts for the Tenant.`).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 l={command:`list`,describe:`List tenant accounts`,builder:c,handler:async a=>i({command:`tenant account list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf tenant account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(a[`tenant-id`]))}/accounts`,pathParams:{"tenant-id":String(a[`tenant-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.tenant.account.list({tenant_id:a[`tenant-id`]})),{successLabel:`Loaded`})})},u={command:`account`,describe:`Operations for account`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function d(e){return e.usage(`$0 tenant entitlement list
7
+
8
+ List of innate entitlements available for the Tenant.`).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 f={command:`list`,describe:`List tenant entitlements`,builder:d,handler:async a=>i({command:`tenant entitlement list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf tenant entitlement list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(a[`tenant-id`]))}/entitlements`,pathParams:{"tenant-id":String(a[`tenant-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.tenant.entitlement.list({tenant_id:a[`tenant-id`]})),{successLabel:`Loaded`})})},p={command:`entitlement`,describe:`Operations for entitlement`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.usage(`$0 tenant get <tenant-id>
9
+
10
+ Retrieves a Tenant by Tenant ID.`).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 h={command:`get <tenant-id>`,describe:`Get tenant`,builder:m,handler:async a=>i({command:`tenant get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf tenant get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(a[`tenant-id`]))}`,pathParams:{"tenant-id":String(a[`tenant-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.tenant.get({tenant_id:a[`tenant-id`]})),{successLabel:`Loaded`})})};function g(e){return e.usage(`$0 tenant membership list
11
+
12
+ List of active members (Cloudflare users) for the Tenant.`).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 _={command:`list`,describe:`List tenant memberships`,builder:g,handler:async a=>i({command:`tenant membership list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf tenant membership list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-id`]==null?`<tenant-id>`:encodeURIComponent(String(a[`tenant-id`]))}/memberships`,pathParams:{"tenant-id":String(a[`tenant-id`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.tenant.membership.list({tenant_id:a[`tenant-id`]})),{successLabel:`Loaded`})})},v={command:`membership`,describe:`Operations for membership`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`tenant`,describe:`tenant`,builder:e=>e.command(h).command(u).command(s).command(p).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as a,t as o}from"./body-parser-CUWbw_Tq.mjs";import{n as s}from"./input-validation-Ch4Vllrm.mjs";import{a as c,n as l}from"./prompt-Bx2PB-tt.mjs";function u(e){return e.usage(`$0 tenant-custom-nameservers create <tenant-tag>
3
+
4
+ Adds a custom nameserver for a tenant.`).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 d={command:`create <tenant-tag>`,describe:`Add Tenant Custom Nameserver`,builder:u,handler:async l=>i({command:`tenant-custom-nameservers create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){n({command:`cf tenant-custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/tenants/${l[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(l[`tenant-tag`]))}/custom_ns`,pathParams:{"tenant-tag":String(l[`tenant-tag`]??``)},bodyKind:`json`,body:l.body===void 0?o({ns_name:s(l[`ns-name`],`ns-name`,`text`),ns_set:l[`ns-set`]}):a(l.body)});return}let i=await e(l);if(l.body){let e=a(l.body);t(await r(`Creating`,async()=>i.tenantCustomNameservers.create({body:e,tenant_tag:l[`tenant-tag`]})),{successLabel:`Created`});return}l[`ns-name`]===void 0&&(l[`ns-name`]=await c(`ns-name`,`The FQDN of the name server.`));let u=o({ns_name:s(l[`ns-name`],`ns-name`,`text`),ns_set:l[`ns-set`]});t(await r(`Creating`,async()=>i.tenantCustomNameservers.create({body:u,tenant_tag:l[`tenant-tag`]})),{successLabel:`Created`})})};function f(e){return e.usage(`$0 tenant-custom-nameservers delete <custom-ns-id>
5
+
6
+ Deletes a tenant's custom nameserver.`).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 p={command:`delete <custom-ns-id>`,describe:`Delete Tenant Custom Nameserver`,builder:f,handler:async a=>i({command:`tenant-custom-nameservers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},a,async()=>{if(a.dryRun){n({command:`cf tenant-custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(a[`tenant-tag`]))}/custom_ns/${a[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(a[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(a[`custom-ns-id`]??``),"tenant-tag":String(a[`tenant-tag`]??``)},bodyKind:`none`});return}let i=await e(a);if(!await l({force:!!a.force})){process.stderr.write(`Aborted.
7
+ `);return}t(await r(`Deleting`,async()=>i.tenantCustomNameservers.delete({tenant_tag:a[`tenant-tag`],custom_ns_id:a[`custom-ns-id`]})),{successLabel:`Deleted`})})};function m(e){return e.usage(`$0 tenant-custom-nameservers get <tenant-tag>
8
+
9
+ Lists a tenant's custom nameservers.`).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 h={command:`get <tenant-tag>`,describe:`List Tenant Custom Nameservers`,builder:m,handler:async a=>i({command:`tenant-custom-nameservers get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf tenant-custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/tenants/${a[`tenant-tag`]==null?`<tenant-tag>`:encodeURIComponent(String(a[`tenant-tag`]))}/custom_ns`,pathParams:{"tenant-tag":String(a[`tenant-tag`]??``)},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.tenantCustomNameservers.get({tenant_tag:a[`tenant-tag`]})),{successLabel:`Loaded`})})},g={command:`tenant-custom-nameservers`,describe:`tenant-custom-nameservers`,builder:e=>e.command(d).command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./output-Z2lQmPUW.mjs";import{n as t,t as n}from"./metadata-C5fJJr-k.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};
2
+ import{t as e}from"./output-Bia1u2k5.mjs";import{n as t,t as n}from"./metadata-APBiectA.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};