cf 0.4.0 → 0.6.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 (255) hide show
  1. package/README.md +7 -1
  2. package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
  3. package/dist/accounts-BIY8wNGA.mjs +22 -0
  4. package/dist/{acm-C2lYIWs1.mjs → acm-SqcV8o5o.mjs} +2 -2
  5. package/dist/addressing-CygRm0pN.mjs +12 -0
  6. package/dist/{agent-context-CgGCT0xU.mjs → agent-context-CKb6w43K.mjs} +1 -1
  7. package/dist/ai-BAmEAjN3.mjs +2 -0
  8. package/dist/ai-gateway-BENwPvvB.mjs +8 -0
  9. package/dist/ai-search-Bv_Whw3E.mjs +7 -0
  10. package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
  11. package/dist/alerting-D_qWrsoY.mjs +6 -0
  12. package/dist/{analytics-CkhhhZWZ.mjs → analytics-CwFrx-Dr.mjs} +1 -1
  13. package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
  14. package/dist/api-gateway-D9PMVVqL.mjs +33 -0
  15. package/dist/argo-DwYGbyld.mjs +2 -0
  16. package/dist/artifacts-DKAjY_n4.mjs +4 -0
  17. package/dist/audit-logs-BvQ9uwuy.mjs +2 -0
  18. package/dist/auth-DX9KnJ0P.mjs +9 -0
  19. package/dist/auth-TYwGydWg.mjs +5 -0
  20. package/dist/billing-CRTlRU88.mjs +2 -0
  21. package/dist/{bot-management-CJxD1pqi.mjs → bot-management-DgW--8wM.mjs} +2 -2
  22. package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
  23. package/dist/brand-protection-ZikBtl0y.mjs +3 -0
  24. package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
  25. package/dist/build-Bgw8TV1p.mjs +134 -0
  26. package/dist/{cache-B7pRbpTy.mjs → cache-CeN5t6_W.mjs} +4 -4
  27. package/dist/calls-Cv0ieVg4.mjs +4 -0
  28. package/dist/certificate-authorities-BzZnWCac.mjs +2 -0
  29. package/dist/client-certificates-BFuzeBrj.mjs +3 -0
  30. package/dist/cloud-connector-D5h8Dzzg.mjs +2 -0
  31. package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
  32. package/dist/{completions-D_9WsLG7.mjs → completions-Bvzav4Mj.mjs} +2 -2
  33. package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
  34. package/dist/connectivity-CjkXmEhO.mjs +3 -0
  35. package/dist/connector-interrupts-B7eSface.mjs +2 -0
  36. package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
  37. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
  38. package/dist/connectors-YYu_Vx3H.mjs +3 -0
  39. package/dist/content-scanning-BorfRGKT.mjs +4 -0
  40. package/dist/context-C-WbewL6.mjs +2 -0
  41. package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-CfRj7QZb.mjs} +4 -4
  42. package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
  43. package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
  44. package/dist/custom-pages-DamGVA75.mjs +4 -0
  45. package/dist/d1-sK0O5THv.mjs +4 -0
  46. package/dist/data-security-DsWpoWiS.mjs +6 -0
  47. package/dist/dcv-delegation-BYsNl3qc.mjs +2 -0
  48. package/dist/{deploy-KBRFIatG.mjs → deploy-BzlPv3ro.mjs} +1 -1
  49. package/dist/{dev-pPazzZvt.mjs → dev-IOg-_s5_.mjs} +1 -1
  50. package/dist/diagnostics-CH7T2WR3.mjs +3 -0
  51. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
  52. package/dist/dist-B7hsuvbF.mjs +57 -0
  53. package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
  54. package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
  55. package/dist/dns-o7hUPMCG.mjs +29 -0
  56. package/dist/durable-objects-DgrTbvoF.mjs +2 -0
  57. package/dist/email-routing-owCvAEpf.mjs +10 -0
  58. package/dist/email-security-Dng3DVuf.mjs +8 -0
  59. package/dist/email-sending-bExMH4lu.mjs +3 -0
  60. package/dist/filters-DKs-wEzt.mjs +4 -0
  61. package/dist/{firewall-C3DDwfwh.mjs → firewall-BLaTtX3r.mjs} +10 -10
  62. package/dist/{fraud-DY3YXFVf.mjs → fraud-D8WmLKyH.mjs} +1 -1
  63. package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
  64. package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-BBtW8vRh.mjs} +3 -3
  65. package/dist/{hostnames-BdAQo1Mr.mjs → hostnames-Bh2IFxIw.mjs} +2 -2
  66. package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
  67. package/dist/iam-apCCcy7R.mjs +6 -0
  68. package/dist/images-Cxe45OHm.mjs +7 -0
  69. package/dist/index.mjs +1 -1
  70. package/dist/intel-8V4h6H46.mjs +3 -0
  71. package/dist/{ips-B6JETVOY.mjs → ips-BE7JbAnc.mjs} +1 -1
  72. package/dist/{keyless-certificates-C4MZ4xnf.mjs → keyless-certificates-CfJmXccT.mjs} +2 -2
  73. package/dist/kv-Dz6then8.mjs +5 -0
  74. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
  75. package/dist/load-balancers-ilsGgudX.mjs +6 -0
  76. package/dist/logpush-BH14TtuA.mjs +4 -0
  77. package/dist/logs-B8-mkf_I.mjs +3 -0
  78. package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
  79. package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
  80. package/dist/magic-transit-B-kU5e3s.mjs +89 -0
  81. package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
  82. package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
  83. package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
  84. package/dist/oauth-B5k80sip.mjs +61 -0
  85. package/dist/observability-9APhqFHo.mjs +4 -0
  86. package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
  87. package/dist/{organizations-aRi1bhFC.mjs → organizations-Dy3kiV_z.mjs} +6 -6
  88. package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
  90. package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-B30_2_dO.mjs} +3 -3
  91. package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
  92. package/dist/{page-rules-CYqtPU1p.mjs → page-rules-zQJGmTCd.mjs} +5 -5
  93. package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CxQk5k9X.mjs} +5 -5
  94. package/dist/pages-5DKLs7CQ.mjs +11 -0
  95. package/dist/pipelines-DfGE44xo.mjs +6 -0
  96. package/dist/progress-CL8I-7YK.mjs +2 -0
  97. package/dist/prompt-q3B7sM2A.mjs +3 -0
  98. package/dist/queues-BoenUGIw.mjs +6 -0
  99. package/dist/r2-Cq_JCjK0.mjs +21 -0
  100. package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
  101. package/dist/{radar-CzGM92uM.mjs → radar-YNOCio6T.mjs} +1 -1
  102. package/dist/rate-limits-CcAF3tMl.mjs +5 -0
  103. package/dist/raw-fetch-bIXC9D1m.mjs +2 -0
  104. package/dist/realtime-kit-4bCGviO5.mjs +18 -0
  105. package/dist/{registrar-8IeA5DKd.mjs → registrar-CfHlaOOf.mjs} +6 -6
  106. package/dist/request-tracers-DlHawg5l.mjs +2 -0
  107. package/dist/resource-sharing-7FhuboJE.mjs +5 -0
  108. package/dist/resource-tagging-divcugVb.mjs +16 -0
  109. package/dist/rules-CAXkege8.mjs +4 -0
  110. package/dist/rulesets-CBsdc8IV.mjs +8 -0
  111. package/dist/rum-D0hHPNl9.mjs +4 -0
  112. package/dist/{schema-hefO-tzo.mjs → schema-D8o6HcCr.mjs} +1 -1
  113. package/dist/schema-validation-BWNDnnIT.mjs +24 -0
  114. package/dist/scim-CWLli4fi.mjs +3 -0
  115. package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
  116. package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
  117. package/dist/security-center-BQT21oiM.mjs +2 -0
  118. package/dist/security-txt-CVpmJo29.mjs +3 -0
  119. package/dist/session-B8r8LNQN.mjs +93 -0
  120. package/dist/{build-BE4o4imx.mjs → shared-DQI8NGja.mjs} +324 -388
  121. package/dist/{smart-shield-DblHIce0.mjs → smart-shield-BreBC1Ap.mjs} +2 -2
  122. package/dist/{snippets-DrpqSXYC.mjs → snippets-BAJoWMSJ.mjs} +3 -3
  123. package/dist/{spawn-DK7pott_.mjs → spawn-pmGERpdB.mjs} +1 -1
  124. package/dist/{spectrum-CnrG0jIC.mjs → spectrum-DnIRLY95.mjs} +6 -6
  125. package/dist/speed-UYEVue28.mjs +4 -0
  126. package/dist/src-BQ1dr9xR.mjs +108 -0
  127. package/dist/{ssl-Cp6tQkZH.mjs → ssl-D3Pixs8M.mjs} +3 -3
  128. package/dist/stream-BUsuOfQh.mjs +14 -0
  129. package/dist/{tenants-o_M62Y1n.mjs → tenants-BdWJTtcg.mjs} +1 -1
  130. package/dist/{token-validation-Ca5AGEns.mjs → token-validation-DUvtXWur.mjs} +5 -5
  131. package/dist/{tools-DtNNmO6l.mjs → tools-CQtA5-cr.mjs} +1 -1
  132. package/dist/turnstile-CAKVnS1L.mjs +23 -0
  133. package/dist/{ui-B97lRnOv.mjs → ui-BrNwNHX9.mjs} +1 -1
  134. package/dist/url-normalization-DA-RAxs4.mjs +3 -0
  135. package/dist/url-scanner-DmYu43f7.mjs +2 -0
  136. package/dist/user-Bah4wGGN.mjs +10 -0
  137. package/dist/vectorize-DhvVG2By.mjs +4 -0
  138. package/dist/{versions-B6E8WQyA.mjs → versions-NUXxCr0s.mjs} +1 -1
  139. package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
  140. package/dist/web3-n3GW50u-.mjs +4 -0
  141. package/dist/workers-D6IaQ_F0.mjs +18 -0
  142. package/dist/workers-builds-DYi0OMMU.mjs +7 -0
  143. package/dist/workflows-DrdXUQ2g.mjs +4 -0
  144. package/dist/{zaraz-CyzfYOEU.mjs → zaraz-9l7KuLqh.mjs} +1 -1
  145. package/dist/zero-trust-D6V9GH2W.mjs +118 -0
  146. package/dist/zero_trust-BzXKAX_x.mjs +3 -0
  147. package/dist/{zones-MSULnDwW.mjs → zones-0MTkuaFk.mjs} +8 -8
  148. package/package.json +3 -1
  149. package/dist/accounts-CjtZ8x1z.mjs +0 -22
  150. package/dist/addressing-CHFK6uxW.mjs +0 -12
  151. package/dist/ai-DS3i-I1a.mjs +0 -2
  152. package/dist/ai-gateway-RIsegO2x.mjs +0 -8
  153. package/dist/ai-search-Dcj4BauG.mjs +0 -7
  154. package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
  155. package/dist/alerting-Bk85NNf5.mjs +0 -6
  156. package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
  157. package/dist/api-gateway-CWdR4Ne7.mjs +0 -33
  158. package/dist/argo-DnJRVnGX.mjs +0 -2
  159. package/dist/artifacts-BVWKiJUl.mjs +0 -4
  160. package/dist/audit-logs-DjTstbzL.mjs +0 -2
  161. package/dist/auth-BqDOIrKX.mjs +0 -150
  162. package/dist/auth-DKkSwnxh.mjs +0 -5
  163. package/dist/billing-3rEqF83h.mjs +0 -2
  164. package/dist/botnet-feed-MG91D7BR.mjs +0 -3
  165. package/dist/brand-protection-CK7gJi06.mjs +0 -3
  166. package/dist/browser-rendering-Rae0AUt0.mjs +0 -4
  167. package/dist/calls-DXRWsZ8n.mjs +0 -4
  168. package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
  169. package/dist/client-certificates-B0ebLJdk.mjs +0 -3
  170. package/dist/cloud-connector-BOjaggJk.mjs +0 -2
  171. package/dist/cloudforce-one-B6HYfk5Z.mjs +0 -21
  172. package/dist/connectivity-welFvZ7X.mjs +0 -3
  173. package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
  174. package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
  175. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
  176. package/dist/connectors-3vjrdFLB.mjs +0 -3
  177. package/dist/content-scanning-CnW2A0pv.mjs +0 -4
  178. package/dist/context-CONbNKO-.mjs +0 -2
  179. package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
  180. package/dist/custom-pages-5fCSP8in.mjs +0 -4
  181. package/dist/d1-CyiRbZZn.mjs +0 -4
  182. package/dist/data-security-Casx4OS_.mjs +0 -6
  183. package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
  184. package/dist/diagnostics-BqYDoDfw.mjs +0 -3
  185. package/dist/dispatch-namespaces-Cz2rajnP.mjs +0 -7
  186. package/dist/dist-DA54ZQu0.mjs +0 -82
  187. package/dist/dns-62t95Xif.mjs +0 -29
  188. package/dist/dns-firewall-Coy8d47t.mjs +0 -57
  189. package/dist/durable-objects-BSuRERkw.mjs +0 -2
  190. package/dist/email-routing-BDUYYeV3.mjs +0 -10
  191. package/dist/email-security-ChHA6eqQ.mjs +0 -8
  192. package/dist/email-sending-CVrRqn6S.mjs +0 -3
  193. package/dist/filters-qJpU9uAS.mjs +0 -4
  194. package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
  195. package/dist/hyperdrive-99OJV9nl.mjs +0 -18
  196. package/dist/iam-BRbpg3lN.mjs +0 -6
  197. package/dist/images-D1jI3r3O.mjs +0 -7
  198. package/dist/intel-C3ajLpXd.mjs +0 -3
  199. package/dist/kv-CSWoD9ks.mjs +0 -5
  200. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
  201. package/dist/load-balancers-Du1tNuUt.mjs +0 -6
  202. package/dist/logpush-SuJyO-uX.mjs +0 -4
  203. package/dist/logs-DcDNRPRl.mjs +0 -3
  204. package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
  205. package/dist/magic-network-monitoring-CqtvOePQ.mjs +0 -4
  206. package/dist/magic-transit-BTbkhBtF.mjs +0 -89
  207. package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
  208. package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
  209. package/dist/network-interconnects-DsiNytOU.mjs +0 -36
  210. package/dist/observability-CLqZ7OSi.mjs +0 -4
  211. package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
  212. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
  213. package/dist/pages-ChurJ2H7.mjs +0 -11
  214. package/dist/pipelines-CeyujvRf.mjs +0 -6
  215. package/dist/progress-Cent9Lsg.mjs +0 -2
  216. package/dist/queues-Rf_n11Cx.mjs +0 -6
  217. package/dist/r2-BtuTO3vQ.mjs +0 -21
  218. package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
  219. package/dist/rate-limits-Bbk7HxP7.mjs +0 -5
  220. package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
  221. package/dist/realtime-kit-CivLpkpg.mjs +0 -18
  222. package/dist/request-tracers-D1aH4NmL.mjs +0 -2
  223. package/dist/resource-sharing-B-Pcto7-.mjs +0 -5
  224. package/dist/resource-tagging-Bpb6Qq1M.mjs +0 -16
  225. package/dist/rules-B10XWY10.mjs +0 -4
  226. package/dist/rulesets-lYczEcJp.mjs +0 -8
  227. package/dist/rum-B5GUKa4I.mjs +0 -4
  228. package/dist/schema-validation-DTq517Em.mjs +0 -24
  229. package/dist/scim-BiLfOQ89.mjs +0 -3
  230. package/dist/security-center-AVpTOBK3.mjs +0 -2
  231. package/dist/security-txt-DVlh8y9l.mjs +0 -3
  232. package/dist/shared-0bwWVDLo.mjs +0 -2
  233. package/dist/speed-BzRY3Xlh.mjs +0 -4
  234. package/dist/src-D9_Gq68b.mjs +0 -108
  235. package/dist/stream-CGTRN4ZN.mjs +0 -14
  236. package/dist/turnstile-l7mo9BWL.mjs +0 -23
  237. package/dist/url-normalization-D1CogSIG.mjs +0 -3
  238. package/dist/url-scanner-BnJHJqcz.mjs +0 -2
  239. package/dist/user-CiyYZ69X.mjs +0 -10
  240. package/dist/vectorize-D3LgMLOn.mjs +0 -4
  241. package/dist/web3-DlHE0CZc.mjs +0 -4
  242. package/dist/workers-DRAkU6YR.mjs +0 -18
  243. package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
  244. package/dist/workflows-z6oapEJs.mjs +0 -4
  245. package/dist/zero-trust-fyyIelWx.mjs +0 -118
  246. package/dist/zero_trust-BAhlNkjo.mjs +0 -3
  247. /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  248. /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
  249. /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-DGgEbf8K.mjs} +0 -0
  250. /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
  251. /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
  252. /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
  253. /package/dist/{metadata-jh2EIan8.mjs → metadata-MPDDi08e.mjs} +0 -0
  254. /package/dist/{resolve-D1mG0REg.mjs → resolve-DGD57PFH.mjs} +0 -0
  255. /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";function m(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`anonymous`,{type:`boolean`,description:`if voters on a poll are anonymous`}).option(`hide-votes`,{type:`boolean`,description:`if votes on an option are visible before a person votes`}).option(`options`,{type:`string`,array:!0,description:`Different options for the question`}).option(`question`,{type:`string`,description:`Question of the poll`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new poll`})}const h={command:`create-poll <meeting-id>`,describe:`Creates a new poll in an active session for the given meeting ID.`,builder:m,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit active-session create-poll`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/meetings/${n[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(n[`meeting-id`]))}/active-session/poll`,pathParams:{"app-id":String(n[`app-id`]??``),"meeting-id":String(n[`meeting-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({anonymous:n.anonymous,hide_votes:n[`hide-votes`],options:n.options,question:d(n.question,`question`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.realtimeKit.activeSession.createPoll({...e,account_id:p,app_id:n[`app-id`],meeting_id:n[`meeting-id`]})),{successLabel:`Created`});return}if(n.options===void 0)throw Error(`--options is required (or pass --body with this field set).`);n.question===void 0&&(n.question=await t(`question`,`Question of the poll`));let m=s({anonymous:n.anonymous,hide_votes:n[`hide-votes`],options:n.options,question:d(n.question,`question`,`text`)});c(await u(`Creating`,async()=>r.realtimeKit.activeSession.createPoll({...m,account_id:p,app_id:n[`app-id`],meeting_id:n[`meeting-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get-active-session <meeting-id>`,describe:`Returns details of an ongoing active session for the given meeting ID.`,builder:ee,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit active-session get-active-session`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-session`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.activeSession.getActiveSession({account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`kick-all-participants <meeting-id>`,describe:`Kicks all participants from an active session for the given meeting ID.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit active-session kick-all-participants`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-session/kick-all`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Creating`,async()=>n.realtimeKit.activeSession.kickAllParticipants({account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`})}};function v(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`custom-participant-ids`,{type:`string`,array:!0,description:`The custom_participant_ids field`}).option(`participant-ids`,{type:`string`,array:!0,description:`The participant_ids field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for kicking participants from an active session. Only one of `participant_id` or `custom_participant_id` is required."})}const y={command:`kick-participants <meeting-id>`,describe:`Kicks one or more participants from an active session using user ID or custom participant ID.`,builder:v,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit active-session kick-participants`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-session/kick`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({custom_participant_ids:t[`custom-participant-ids`],participant_ids:t[`participant-ids`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.realtimeKit.activeSession.kickParticipants({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`});return}if(t[`custom-participant-ids`]===void 0)throw Error(`--custom-participant-ids is required (or pass --body with this field set).`);if(t[`participant-ids`]===void 0)throw Error(`--participant-ids is required (or pass --body with this field set).`);let d=s({custom_participant_ids:t[`custom-participant-ids`],participant_ids:t[`participant-ids`]});c(await u(`Creating`,async()=>n.realtimeKit.activeSession.kickParticipants({...d,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`})}},b={command:`active-session`,describe:`Currently active meeting sessions with live participant counts and controls`,builder:e=>e.command(h).command(te).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`start-date`,{type:`string`,description:`start date in YYYY-MM-DD format`}).option(`end-date`,{type:`string`,description:`end date in YYYY-MM-DD format`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-org-analytics <app-id>`,describe:`Returns day-wise session and recording analytics data of an App for the specified time range start_date to end_date. If start_date and end_date are not provided, the default time range is set from 30 days ago to the current date.`,builder:x,handler:async t=>{let n={start_date:t[`start-date`],end_date:t[`end-date`]};if(t.dryRun){l({command:`cf realtime-kit analytics get-org-analytics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/analytics/daywise`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.analytics.getOrgAnalytics({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}},C={command:`analytics`,describe:`Live streaming from meetings to external platforms with stream key management`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Search string that matches apps by name.`}).option(`sort-order`,{type:`string`,description:`Sort order for apps by creation time.`,choices:[`ASC`,`DESC`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Fetch all apps for your account`,builder:p(w),handler:async t=>{let n={page_no:t[`page-no`],per_page:t[`per-page`],search:t.search,sort_order:t[`sort-order`]};if(t.dryRun){l({command:`cf realtime-kit apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/apps`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.apps.get({account_id:o,...n})),{successLabel:`Loaded`})}};function E(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`post`,describe:`Create new app for your account`,builder:E,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit apps post`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/apps`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.realtimeKit.apps.post({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`The name field`));let m=s({name:d(n.name,`name`,`text`)});c(await u(`Creating`,async()=>r.realtimeKit.apps.post({...m,account_id:p})),{successLabel:`Created`})}},O={command:`apps`,describe:`Realtime Kit applications that group meetings, sessions, and configuration together`,builder:e=>e.command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`allow-unmute`,{type:`boolean`,description:`if false, participants won't be able to unmute themselves after they are muted`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for muting all participants in an active session.`})}const A={command:`create <meeting-id>`,describe:`Mutes all participants of an active session for the given meeting ID.`,builder:k,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit kit meetings active-session mute-all create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-session/mute-all`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({allow_unmute:t[`allow-unmute`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.muteAll.create({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`});return}if(t[`allow-unmute`]===void 0)throw Error(`--allow-unmute is required (or pass --body with this field set).`);let d=s({allow_unmute:t[`allow-unmute`]});c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.muteAll.create({...d,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`})}},j={command:`mute-all`,describe:`Kit operations`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`custom-participant-ids`,{type:`string`,array:!0,description:`The custom_participant_ids field`}).option(`participant-ids`,{type:`string`,array:!0,description:`The participant_ids field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for kicking participants from an active session. Only one of `participant_id` or `custom_participant_id` is required."})}const N={command:`create <meeting-id>`,describe:`Mutes one or more participants from an active session using user ID or custom participant ID.`,builder:M,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit kit meetings active-session mute create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-session/mute`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({custom_participant_ids:t[`custom-participant-ids`],participant_ids:t[`participant-ids`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.mute.create({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`});return}if(t[`custom-participant-ids`]===void 0)throw Error(`--custom-participant-ids is required (or pass --body with this field set).`);if(t[`participant-ids`]===void 0)throw Error(`--participant-ids is required (or pass --body with this field set).`);let d=s({custom_participant_ids:t[`custom-participant-ids`],participant_ids:t[`participant-ids`]});c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.mute.create({...d,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`})}},P={command:`mute`,describe:`Kit operations`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`active-session`,describe:`Operations for kit.meetings.active-session`,builder:e=>e.command(P).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <meeting-id>`,describe:"Returns livestream session details for the given meeting ID. Retreive the meeting ID using the `Create a meeting` API.",builder:I,handler:async t=>{let n={page_no:t[`page-no`],per_page:t[`per-page`]};if(t.dryRun){l({command:`cf realtime-kit kit meetings livestream get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/livestream`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.kit.meetings.livestream.get({account_id:o,app_id:t[`app-id`],meeting_id:t[`meeting-id`],...n})),{successLabel:`Loaded`})}},R={command:`livestream`,describe:`Kit operations`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`meetings`,describe:`Operations for kit.meetings`,builder:e=>e.command(F).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`session-id`,{type:`string`,description:`Session ID`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <session-id>`,describe:"Returns livestream session details for the given session ID. Retreive the session ID using the `Fetch all sessions of an App` API.",builder:B,handler:async t=>{let n={per_page:t[`per-page`],page_no:t[`page-no`]};if(t.dryRun){l({command:`cf realtime-kit kit sessions livestream sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/livestream-sessions`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.kit.sessions.livestream.sessions.get({account_id:o,app_id:t[`app-id`],session_id:t[`session-id`],...n})),{successLabel:`Loaded`})}},H={command:`sessions`,describe:`Kit operations`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`livestream`,describe:`Operations for kit.sessions.livestream`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`sessions`,describe:`Operations for kit.sessions`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`kit`,describe:`Operations for kit`,builder:e=>e.command(z).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`livestream-id`,{type:`string`,description:`Livestream ID`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get-active-livestreams-for-livestream-id <livestream-id>`,describe:"Returns details of all active livestreams for the given livestream ID. Retreive the livestream ID using the `Start livestreaming a meeting` API.",builder:K,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit livestreams get-active-livestreams-for-livestream-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/livestreams/${t[`livestream-id`]==null?`<livestream-id>`:encodeURIComponent(String(t[`livestream-id`]))}/active-livestream-session`,pathParams:{"app-id":String(t[`app-id`]??``),"livestream-id":String(t[`livestream-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.livestreams.getActiveLivestreamsForLivestreamId({account_id:r,app_id:t[`app-id`],livestream_id:t[`livestream-id`]})),{successLabel:`Loaded`})}};function J(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`exclude-meetings`,{type:`boolean`,description:`Exclude the RealtimeKit meetings that are livestreamed.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`status`,{type:`string`,description:`Specifies the status of the operation.`,choices:[`LIVE`,`IDLE`,`ERRORED`,`INVOKED`]}).option(`start-time`,{type:`string`,description:`Specify the start time range in ISO format to access the live stream.`}).option(`end-time`,{type:`string`,description:`Specify the end time range in ISO format to access the live stream.`}).option(`sort-order`,{type:`string`,description:`Specifies the sorting order for the results.`,choices:[`ASC`,`DSC`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get-all-livestreams <app-id>`,describe:"Returns details of livestreams associated with the given App ID. It includes livestreams created by your App and RealtimeKit meetings that are livestreamed by your App. If you only want details of livestreams created by your App and not RealtimeKit meetings, you can use the `exclude_meetings` query parameter.",builder:p(J),handler:async t=>{let n={exclude_meetings:t[`exclude-meetings`],per_page:t[`per-page`],page_no:t[`page-no`],status:t.status,start_time:t[`start-time`],end_time:t[`end-time`],sort_order:t[`sort-order`]};if(t.dryRun){l({command:`cf realtime-kit livestreams get-all-livestreams`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/livestreams`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.livestreams.getAllLivestreams({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}};function X(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`start-time`,{type:`number`,description:`Specify the start time as a Unix timestamp in seconds to access the livestream analytics.`}).option(`end-time`,{type:`number`,description:`Specify the end time as a Unix timestamp in seconds to access the livestream analytics.`}).option(`filters`,{type:`string`,description:`Optional filters for livestream analytics.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get-livestream-analytics-complete <app-id>`,describe:`Returns livestream analytics for the specified time range.`,builder:X,handler:async t=>{let n={start_time:t[`start-time`],end_time:t[`end-time`],filters:t.filters};if(t.dryRun){l({command:`cf realtime-kit livestreams get-livestream-analytics-complete`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/analytics/livestreams/overall`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.livestreams.getLivestreamAnalyticsComplete({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`livestream-session-id`,{type:`string`,description:`Livestream-session-id`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get-livestream-session-details-for-session-id <livestream-session-id>`,describe:"Returns livestream session details for the given livestream session ID. Retrieve the `livestream_session_id`using the `Fetch livestream session details using a session ID` API.",builder:Q,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit livestreams get-livestream-session-details-for-session-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/livestreams/sessions/${t[`livestream-session-id`]==null?`<livestream-session-id>`:encodeURIComponent(String(t[`livestream-session-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"livestream-session-id":String(t[`livestream-session-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.livestreams.getLivestreamSessionDetailsForSessionId({account_id:r,app_id:t[`app-id`],"livestream-session-id":t[`livestream-session-id`]})),{successLabel:`Loaded`})}};function re(e){return e.positional(`livestream-id`,{type:`string`,description:`Livestream ID`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get-livestream-session-for-livestream-id <livestream-id>`,describe:"Returns details of a livestream with sessions for the given livestream ID. Retreive the livestream ID using the `Start livestreaming a meeting` API.",builder:re,handler:async t=>{let n={page_no:t[`page-no`],per_page:t[`per-page`]};if(t.dryRun){l({command:`cf realtime-kit livestreams get-livestream-session-for-livestream-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/livestreams/${t[`livestream-id`]==null?`<livestream-id>`:encodeURIComponent(String(t[`livestream-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"livestream-id":String(t[`livestream-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.livestreams.getLivestreamSessionForLivestreamId({account_id:o,app_id:t[`app-id`],livestream_id:t[`livestream-id`],...n})),{successLabel:`Loaded`})}};function ae(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get-meeting-active-livestreams <meeting-id>`,describe:`Returns details of all active livestreams for the given meeting ID.`,builder:ae,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit livestreams get-meeting-active-livestreams`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-livestream`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.livestreams.getMeetingActiveLivestreams({account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Loaded`})}};function se(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`video-config-height`,{type:`number`,description:`Height of the livestreaming video in pixels`}).option(`video-config-width`,{type:`number`,description:`Width of the livestreaming video in pixels`}).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 ce={command:`start-livestreaming-a-meeting <meeting-id>`,describe:"Starts livestream of a meeting associated with the given meeting ID. Retreive the meeting ID using the `Create a meeting` API.",builder:se,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit livestreams start-livestreaming-a-meeting`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/livestreams`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({name:d(t.name,`name`,`text`),video_config:{height:t[`video-config-height`],width:t[`video-config-width`]}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.realtimeKit.livestreams.startLivestreamingAMeeting({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`});return}let p=s({name:d(t.name,`name`,`text`),video_config:{height:t[`video-config-height`],width:t[`video-config-width`]}});c(await u(`Creating`,async()=>n.realtimeKit.livestreams.startLivestreamingAMeeting({...p,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Created`})}};function le(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app 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 ue={command:`stop-livestreaming-a-meeting <meeting-id>`,describe:"Stops the active livestream of a meeting associated with the given meeting ID. Retreive the meeting ID using the `Create a meeting` API.",builder:le,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit livestreams stop-livestreaming-a-meeting`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/active-livestream/stop`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force,message:`This operation halts an active live-stream. Viewers lose the broadcast immediately.`})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.livestreams.stopLivestreamingAMeeting({account_id:o,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Deleted`})}},de={command:`livestreams`,describe:`Live streaming from meetings to external platforms with stream key management`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(ie).command(oe).command(ce).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting. Fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`custom-participant-id`,{type:`string`,description:`A unique participant ID. You must specify a unique ID for the participant, for example, UUID, email address, and so on. `}).option(`name`,{type:`string`,description:`(Optional) Name of the participant. `}).option(`picture`,{type:`string`,description:`(Optional) A URL to a picture to be used for the participant. `}).option(`preset-name`,{type:`string`,description:`Name of the preset to apply to this participant.`,default:`group_call_host`}).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 pe={command:`add-participant <meeting-id>`,describe:`Adds a participant to the given meeting ID.`,builder:fe,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit meetings add-participant`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/meetings/${n[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(n[`meeting-id`]))}/participants`,pathParams:{"app-id":String(n[`app-id`]??``),"meeting-id":String(n[`meeting-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({custom_participant_id:d(n[`custom-participant-id`],`custom-participant-id`,`text`),name:d(n.name,`name`,`text`),picture:d(n.picture,`picture`,`text`),preset_name:d(n[`preset-name`],`preset-name`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.realtimeKit.meetings.addParticipant({...e,account_id:p,app_id:n[`app-id`],meeting_id:n[`meeting-id`]})),{successLabel:`Created`});return}n[`custom-participant-id`]===void 0&&(n[`custom-participant-id`]=await t(`custom-participant-id`,`A unique participant ID. You must specify a unique ID for the participant, for example, UUID, email address, and so on. `)),n[`preset-name`]===void 0&&(n[`preset-name`]=await t(`preset-name`,`Name of the preset to apply to this participant.`));let m=s({custom_participant_id:d(n[`custom-participant-id`],`custom-participant-id`,`text`),name:d(n.name,`name`,`text`),picture:d(n.picture,`picture`,`text`),preset_name:d(n[`preset-name`],`preset-name`,`text`)});c(await u(`Creating`,async()=>r.realtimeKit.meetings.addParticipant({...m,account_id:p,app_id:n[`app-id`],meeting_id:n[`meeting-id`]})),{successLabel:`Created`})}};function me(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`ai-config-summarization-summary-type`,{type:`string`,description:`Defines the style of the summary, such as general, team meeting, or sales call.`,choices:[`general`,`team_meeting`,`sales_call`,`client_check_in`,`interview`,`daily_standup`,`one_on_one_meeting`,`lecture`,`code_review`],default:`general`}).option(`ai-config-summarization-text-format`,{type:`string`,description:`Determines the text format of the summary, such as plain text or markdown.`,choices:[`plain_text`,`markdown`],default:`markdown`}).option(`ai-config-summarization-word-limit`,{type:`number`,description:`Sets the maximum number of words in the meeting summary.`,default:500}).option(`ai-config-transcription-keywords`,{type:`string`,array:!0,description:`Adds specific terms to improve accurate detection during transcription.`}).option(`ai-config-transcription-language`,{type:`string`,description:`Specifies the language code for transcription to ensure accurate results.`,choices:[`en-US`,`en-IN`,`de`,`hi`,`sv`,`ru`,`pl`,`el`,`fr`,`nl`],default:`en-US`}).option(`ai-config-transcription-profanity-filter`,{type:`boolean`,description:`Control the inclusion of offensive language in transcriptions.`,default:!1}).option(`live-stream-on-start`,{type:`boolean`,description:`Specifies if the meeting should start getting livestreamed on start.`,default:!1}).option(`persist-chat`,{type:`boolean`,description:`If a meeting is set to persist_chat, meeting chat would remain for a week within the meeting space.`,default:!1}).option(`record-on-start`,{type:`boolean`,description:`Specifies if the meeting should start getting recorded as soon as someone joins the meeting.`,default:!1}).option(`recording-config-audio-config-channel`,{type:`string`,description:`Audio signal pathway within an audio file that carries a specific sound source.`,choices:[`mono`,`stereo`],default:`stereo`}).option(`recording-config-audio-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded. If VP8/VP9 is selected for videoConfig, changing audioConfig is not allowed. In this case, the codec in the audioConfig is automatically set to vorbis.`,choices:[`MP3`,`AAC`],default:`AAC`}).option(`recording-config-audio-config-export-file`,{type:`boolean`,description:`Controls whether to export audio file seperately`,default:!0}).option(`recording-config-file-name-prefix`,{type:`string`,description:`Adds a prefix to the beginning of the file name of the recording.`}).option(`recording-config-live-streaming-config-rtmp-url`,{type:`string`,description:`RTMP URL to stream to`}).option(`recording-config-max-seconds`,{type:`number`,description:`Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours.`}).option(`recording-config-realtimekit-bucket-config-enabled`,{type:`boolean`,description:"Controls whether recordings are uploaded to RealtimeKit's bucket. If set to false, `download_url`, `audio_download_url`, `download_url_expiry` won't be generated for a recording."}).option(`recording-config-storage-config-access-key`,{type:`string`,description:`Access key of the storage medium. Access key is not required for the \`gcs\` storage media type.
4
-
5
- Note that this field is not readable by clients, only writeable.`}).option(`recording-config-storage-config-auth-method`,{type:`string`,description:`Authentication method used for "sftp" type storage medium
6
- `,choices:[`KEY`,`PASSWORD`]}).option(`recording-config-storage-config-bucket`,{type:`string`,description:`Name of the storage medium's bucket.`}).option(`recording-config-storage-config-host`,{type:`string`,description:`SSH destination server host for SFTP type storage medium`}).option(`recording-config-storage-config-password`,{type:`string`,description:`SSH destination server password for SFTP type storage medium when auth_method is "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh private key.`}).option(`recording-config-storage-config-path`,{type:`string`,description:`Path relative to the bucket root at which the recording will be placed.`}).option(`recording-config-storage-config-port`,{type:`number`,description:`SSH destination server port for SFTP type storage medium`}).option(`recording-config-storage-config-private-key`,{type:`string`,description:`Private key used to login to destination SSH server for SFTP type storage medium, when auth_method used is "KEY"`}).option(`recording-config-storage-config-region`,{type:`string`,description:`Region of the storage medium.`}).option(`recording-config-storage-config-secret`,{type:`string`,description:"Secret key of the storage medium. Similar to `access_key`, it is only writeable by clients, not readable."}).option(`recording-config-storage-config-type`,{type:`string`,description:`Type of storage media.`,choices:[`aws`,`azure`,`digitalocean`,`gcs`,`sftp`]}).option(`recording-config-storage-config-username`,{type:`string`,description:`SSH destination server username for SFTP type storage medium`}).option(`recording-config-video-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded.`,choices:[`H264`,`VP8`],default:`H264`}).option(`recording-config-video-config-export-file`,{type:`boolean`,description:`Controls whether to export video file seperately`,default:!0}).option(`recording-config-video-config-height`,{type:`number`,description:`Height of the recording video in pixels`,default:720}).option(`recording-config-video-config-watermark-position`,{type:`string`,description:`Position of the watermark`,choices:[`left top`,`right top`,`left bottom`,`right bottom`],default:`left top`}).option(`recording-config-video-config-watermark-url`,{type:`string`,description:`URL of the watermark image`}).option(`recording-config-video-config-width`,{type:`number`,description:`Width of the recording video in pixels`,default:1280}).option(`session-keep-alive-time-in-secs`,{type:`number`,description:`Time in seconds, for which a session remains active, after the last participant has left the meeting.`,default:60}).option(`summarize-on-end`,{type:`boolean`,description:`Automatically generate summary of meetings using transcripts. Requires Transcriptions to be enabled, and can be retrieved via Webhooks or summary API.`,default:!1}).option(`title`,{type:`string`,description:`Title of the meeting`}).option(`transcribe-on-end`,{type:`boolean`,description:`Automatically generate transcripts when the meeting ends.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create meeting body`}).check(e=>{if([`recording-config-file-name-prefix`,`recording-config-live-streaming-config-rtmp-url`,`recording-config-max-seconds`,`recording-config-realtimekit-bucket-config-enabled`,`recording-config-storage-config-access-key`,`recording-config-storage-config-auth-method`,`recording-config-storage-config-bucket`,`recording-config-storage-config-host`,`recording-config-storage-config-password`,`recording-config-storage-config-path`,`recording-config-storage-config-port`,`recording-config-storage-config-private-key`,`recording-config-storage-config-region`,`recording-config-storage-config-secret`,`recording-config-storage-config-type`,`recording-config-storage-config-username`,`recording-config-video-config-watermark-url`].some(t=>e[t]!==void 0)){let t=[`recording-config-realtimekit-bucket-config-enabled`,`recording-config-storage-config-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --recording_config-* flag is set`)}return!0})}const he={command:`create <app-id>`,describe:`Create a meeting for the given App ID.`,builder:me,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({ai_config:{summarization:{summary_type:d(t[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(t[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:t[`ai-config-summarization-word-limit`]},transcription:{keywords:t[`ai-config-transcription-keywords`],language:d(t[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:t[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:t[`live-stream-on-start`],persist_chat:t[`persist-chat`],record_on_start:t[`record-on-start`],recording_config:{audio_config:{channel:d(t[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(t[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:t[`recording-config-audio-config-export-file`]},file_name_prefix:d(t[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(t[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:t[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:t[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(t[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(t[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(t[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(t[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(t[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(t[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:t[`recording-config-storage-config-port`],private_key:d(t[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(t[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(t[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(t[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(t[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(t[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:t[`recording-config-video-config-export-file`],height:t[`recording-config-video-config-height`],watermark:{position:d(t[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(t[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:t[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:t[`session-keep-alive-time-in-secs`],summarize_on_end:t[`summarize-on-end`],title:d(t.title,`title`,`text`),transcribe_on_end:t[`transcribe-on-end`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.realtimeKit.meetings.create({...e,account_id:r,app_id:t[`app-id`]})),{successLabel:`Created`});return}let p=s({ai_config:{summarization:{summary_type:d(t[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(t[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:t[`ai-config-summarization-word-limit`]},transcription:{keywords:t[`ai-config-transcription-keywords`],language:d(t[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:t[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:t[`live-stream-on-start`],persist_chat:t[`persist-chat`],record_on_start:t[`record-on-start`],recording_config:{audio_config:{channel:d(t[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(t[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:t[`recording-config-audio-config-export-file`]},file_name_prefix:d(t[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(t[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:t[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:t[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(t[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(t[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(t[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(t[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(t[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(t[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:t[`recording-config-storage-config-port`],private_key:d(t[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(t[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(t[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(t[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(t[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(t[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:t[`recording-config-video-config-export-file`],height:t[`recording-config-video-config-height`],watermark:{position:d(t[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(t[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:t[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:t[`session-keep-alive-time-in-secs`],summarize_on_end:t[`summarize-on-end`],title:d(t.title,`title`,`text`),transcribe_on_end:t[`transcribe-on-end`]});c(await u(`Creating`,async()=>n.realtimeKit.meetings.create({...p,account_id:r,app_id:t[`app-id`]})),{successLabel:`Created`})}};function ge(e){return e.positional(`participant-id`,{type:`string`,description:`ID of the participant. You can fetch the participant ID using the add a participant API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`meeting-id`,{type:`string`,description:`ID of the meeting. You can fetch the meeting ID using the create a meeting API.`,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 _e={command:`delete-meeting-participant <participant-id>`,describe:`Deletes a participant for the given meeting and participant ID.`,builder:ge,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings delete-meeting-participant`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/participants/${t[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(t[`participant-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``),"participant-id":String(t[`participant-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
7
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.meetings.deleteMeetingParticipant({account_id:o,app_id:t[`app-id`],meeting_id:t[`meeting-id`],participant_id:t[`participant-id`]})),{successLabel:`Deleted`})}};function ve(e){return e.positional(`participant-id`,{type:`string`,description:`ID of the participant. You can fetch the participant ID using the add a participant API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`meeting-id`,{type:`string`,description:`ID of the meeting. You can fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`name`,{type:`string`,description:`(Optional) Name of the participant.`}).option(`picture`,{type:`string`,description:`(Optional) A URL to a picture to be used for the participant.`}).option(`preset-name`,{type:`string`,description:`(Optional) Name of the preset to apply to this participant.`}).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 ye={command:`edit-participant <participant-id>`,describe:`Updates a participant's details for the given meeting and participant ID.`,builder:ve,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings edit-participant`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/participants/${t[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(t[`participant-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``),"participant-id":String(t[`participant-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({name:d(t.name,`name`,`text`),picture:d(t.picture,`picture`,`text`),preset_name:d(t[`preset-name`],`preset-name`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.realtimeKit.meetings.editParticipant({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`],participant_id:t[`participant-id`]})),{successLabel:`Updated`});return}let p=s({name:d(t.name,`name`,`text`),picture:d(t.picture,`picture`,`text`),preset_name:d(t[`preset-name`],`preset-name`,`text`)});c(await u(`Updating`,async()=>n.realtimeKit.meetings.editParticipant({...p,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`],participant_id:t[`participant-id`]})),{successLabel:`Updated`})}};function be(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting. Fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get-meeting-by-id <meeting-id>`,describe:`Returns a meeting details in an App for the given meeting ID.`,builder:be,handler:async t=>{let n={name:t.name};if(t.dryRun){l({command:`cf realtime-kit meetings get-meeting-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.meetings.getMeetingById({account_id:o,app_id:t[`app-id`],meeting_id:t[`meeting-id`],...n})),{successLabel:`Loaded`})}};function Se(e){return e.positional(`participant-id`,{type:`string`,description:`ID of the participant. You can fetch the participant ID using the add a participant API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`meeting-id`,{type:`string`,description:`ID of the meeting. You can fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get-meeting-participant <participant-id>`,describe:`Returns a participant details for the given meeting and participant ID.`,builder:Se,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings get-meeting-participant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/participants/${t[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(t[`participant-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``),"participant-id":String(t[`participant-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.meetings.getMeetingParticipant({account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`],participant_id:t[`participant-id`]})),{successLabel:`Loaded`})}};function we(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting. Fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get-meeting-participants <meeting-id>`,describe:`Returns all participants detail for the given meeting ID.`,builder:we,handler:async t=>{let n={page_no:t[`page-no`],per_page:t[`per-page`]};if(t.dryRun){l({command:`cf realtime-kit meetings get-meeting-participants`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/participants`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.meetings.getMeetingParticipants({account_id:o,app_id:t[`app-id`],meeting_id:t[`meeting-id`],...n})),{successLabel:`Loaded`})}};function Ee(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page`}).option(`start-time`,{type:`string`,description:`The start time range for which you want to retrieve the meetings. The time must be specified in ISO format.`}).option(`end-time`,{type:`string`,description:`The end time range for which you want to retrieve the meetings. The time must be specified in ISO format.`}).option(`search`,{type:`string`,description:`The search query string. You can search using the meeting ID or title.`}).option(`status`,{type:`string`,description:`Filter meetings by status.`,choices:[`ACTIVE`,`INACTIVE`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`get <app-id>`,describe:`Returns all meetings for the given App ID.`,builder:p(Ee),handler:async t=>{let n={page_no:t[`page-no`],per_page:t[`per-page`],start_time:t[`start-time`],end_time:t[`end-time`],search:t.search,status:t.status};if(t.dryRun){l({command:`cf realtime-kit meetings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.meetings.get({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}};function Oe(e){return e.positional(`participant-id`,{type:`string`,description:`ID of the participant. You can fetch the participant ID using the add a participant API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`meeting-id`,{type:`string`,description:`ID of the meeting. You can fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`refresh-participant-token <participant-id>`,describe:`Regenerates participant's authentication token for the given meeting and participant ID.`,builder:Oe,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings refresh-participant-token`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}/participants/${t[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(t[`participant-id`]))}/token`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``),"participant-id":String(t[`participant-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Creating`,async()=>n.realtimeKit.meetings.refreshParticipantToken({account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`],participant_id:t[`participant-id`]})),{successLabel:`Created`})}};function Ae(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting. Fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`ai-config-summarization-summary-type`,{type:`string`,description:`Defines the style of the summary, such as general, team meeting, or sales call.`,choices:[`general`,`team_meeting`,`sales_call`,`client_check_in`,`interview`,`daily_standup`,`one_on_one_meeting`,`lecture`,`code_review`]}).option(`ai-config-summarization-text-format`,{type:`string`,description:`Determines the text format of the summary, such as plain text or markdown.`,choices:[`plain_text`,`markdown`]}).option(`ai-config-summarization-word-limit`,{type:`number`,description:`Sets the maximum number of words in the meeting summary.`}).option(`ai-config-transcription-keywords`,{type:`string`,array:!0,description:`Adds specific terms to improve accurate detection during transcription.`}).option(`ai-config-transcription-language`,{type:`string`,description:`Specifies the language code for transcription to ensure accurate results.`,choices:[`en-US`,`en-IN`,`de`,`hi`,`sv`,`ru`,`pl`,`el`,`fr`,`nl`]}).option(`ai-config-transcription-profanity-filter`,{type:`boolean`,description:`Control the inclusion of offensive language in transcriptions.`}).option(`live-stream-on-start`,{type:`boolean`,description:`Specifies if the meeting should start getting livestreamed on start.`}).option(`persist-chat`,{type:`boolean`,description:`If a meeting is set to persist_chat, meeting chat would remain for a week within the meeting space.`}).option(`record-on-start`,{type:`boolean`,description:`Specifies if the meeting should start getting recorded as soon as someone joins the meeting.`}).option(`recording-config-audio-config-channel`,{type:`string`,description:`Audio signal pathway within an audio file that carries a specific sound source.`,choices:[`mono`,`stereo`]}).option(`recording-config-audio-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded. If VP8/VP9 is selected for videoConfig, changing audioConfig is not allowed. In this case, the codec in the audioConfig is automatically set to vorbis.`,choices:[`MP3`,`AAC`]}).option(`recording-config-audio-config-export-file`,{type:`boolean`,description:`Controls whether to export audio file seperately`}).option(`recording-config-file-name-prefix`,{type:`string`,description:`Adds a prefix to the beginning of the file name of the recording.`}).option(`recording-config-live-streaming-config-rtmp-url`,{type:`string`,description:`RTMP URL to stream to`}).option(`recording-config-max-seconds`,{type:`number`,description:`Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours.`}).option(`recording-config-realtimekit-bucket-config-enabled`,{type:`boolean`,description:"Controls whether recordings are uploaded to RealtimeKit's bucket. If set to false, `download_url`, `audio_download_url`, `download_url_expiry` won't be generated for a recording."}).option(`recording-config-storage-config-access-key`,{type:`string`,description:`Access key of the storage medium. Access key is not required for the \`gcs\` storage media type.
8
-
9
- Note that this field is not readable by clients, only writeable.`}).option(`recording-config-storage-config-auth-method`,{type:`string`,description:`Authentication method used for "sftp" type storage medium
10
- `,choices:[`KEY`,`PASSWORD`]}).option(`recording-config-storage-config-bucket`,{type:`string`,description:`Name of the storage medium's bucket.`}).option(`recording-config-storage-config-host`,{type:`string`,description:`SSH destination server host for SFTP type storage medium`}).option(`recording-config-storage-config-password`,{type:`string`,description:`SSH destination server password for SFTP type storage medium when auth_method is "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh private key.`}).option(`recording-config-storage-config-path`,{type:`string`,description:`Path relative to the bucket root at which the recording will be placed.`}).option(`recording-config-storage-config-port`,{type:`number`,description:`SSH destination server port for SFTP type storage medium`}).option(`recording-config-storage-config-private-key`,{type:`string`,description:`Private key used to login to destination SSH server for SFTP type storage medium, when auth_method used is "KEY"`}).option(`recording-config-storage-config-region`,{type:`string`,description:`Region of the storage medium.`}).option(`recording-config-storage-config-secret`,{type:`string`,description:"Secret key of the storage medium. Similar to `access_key`, it is only writeable by clients, not readable."}).option(`recording-config-storage-config-type`,{type:`string`,description:`Type of storage media.`,choices:[`aws`,`azure`,`digitalocean`,`gcs`,`sftp`]}).option(`recording-config-storage-config-username`,{type:`string`,description:`SSH destination server username for SFTP type storage medium`}).option(`recording-config-video-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded.`,choices:[`H264`,`VP8`]}).option(`recording-config-video-config-export-file`,{type:`boolean`,description:`Controls whether to export video file seperately`}).option(`recording-config-video-config-height`,{type:`number`,description:`Height of the recording video in pixels`}).option(`recording-config-video-config-watermark-position`,{type:`string`,description:`Position of the watermark`,choices:[`left top`,`right top`,`left bottom`,`right bottom`]}).option(`recording-config-video-config-watermark-url`,{type:`string`,description:`URL of the watermark image`}).option(`recording-config-video-config-width`,{type:`number`,description:`Width of the recording video in pixels`}).option(`session-keep-alive-time-in-secs`,{type:`number`,description:`Time in seconds, for which a session remains active, after the last participant has left the meeting.`}).option(`summarize-on-end`,{type:`boolean`,description:`Automatically generate summary of meetings using transcripts. Requires Transcriptions to be enabled, and can be retrieved via Webhooks or summary API.`}).option(`title`,{type:`string`,description:`Title of the meeting`}).option(`transcribe-on-end`,{type:`boolean`,description:`Automatically generate transcripts when the meeting ends.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create meeting body`}).check(e=>{if([`recording-config-file-name-prefix`,`recording-config-live-streaming-config-rtmp-url`,`recording-config-max-seconds`,`recording-config-realtimekit-bucket-config-enabled`,`recording-config-storage-config-access-key`,`recording-config-storage-config-auth-method`,`recording-config-storage-config-bucket`,`recording-config-storage-config-host`,`recording-config-storage-config-password`,`recording-config-storage-config-path`,`recording-config-storage-config-port`,`recording-config-storage-config-private-key`,`recording-config-storage-config-region`,`recording-config-storage-config-secret`,`recording-config-storage-config-type`,`recording-config-storage-config-username`,`recording-config-video-config-watermark-url`].some(t=>e[t]!==void 0)){let t=[`recording-config-realtimekit-bucket-config-enabled`,`recording-config-storage-config-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --recording_config-* flag is set`)}return!0})}const je={command:`replace-meeting-by-id <meeting-id>`,describe:`Replaces all the details for the given meeting ID.`,builder:Ae,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings replace-meeting-by-id`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({ai_config:{summarization:{summary_type:d(t[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(t[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:t[`ai-config-summarization-word-limit`]},transcription:{keywords:t[`ai-config-transcription-keywords`],language:d(t[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:t[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:t[`live-stream-on-start`],persist_chat:t[`persist-chat`],record_on_start:t[`record-on-start`],recording_config:{audio_config:{channel:d(t[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(t[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:t[`recording-config-audio-config-export-file`]},file_name_prefix:d(t[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(t[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:t[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:t[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(t[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(t[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(t[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(t[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(t[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(t[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:t[`recording-config-storage-config-port`],private_key:d(t[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(t[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(t[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(t[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(t[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(t[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:t[`recording-config-video-config-export-file`],height:t[`recording-config-video-config-height`],watermark:{position:d(t[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(t[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:t[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:t[`session-keep-alive-time-in-secs`],summarize_on_end:t[`summarize-on-end`],title:d(t.title,`title`,`text`),transcribe_on_end:t[`transcribe-on-end`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.realtimeKit.meetings.replaceMeetingById({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Updated`});return}let p=s({ai_config:{summarization:{summary_type:d(t[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(t[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:t[`ai-config-summarization-word-limit`]},transcription:{keywords:t[`ai-config-transcription-keywords`],language:d(t[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:t[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:t[`live-stream-on-start`],persist_chat:t[`persist-chat`],record_on_start:t[`record-on-start`],recording_config:{audio_config:{channel:d(t[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(t[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:t[`recording-config-audio-config-export-file`]},file_name_prefix:d(t[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(t[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:t[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:t[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(t[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(t[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(t[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(t[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(t[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(t[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:t[`recording-config-storage-config-port`],private_key:d(t[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(t[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(t[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(t[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(t[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(t[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:t[`recording-config-video-config-export-file`],height:t[`recording-config-video-config-height`],watermark:{position:d(t[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(t[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:t[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:t[`session-keep-alive-time-in-secs`],summarize_on_end:t[`summarize-on-end`],title:d(t.title,`title`,`text`),transcribe_on_end:t[`transcribe-on-end`]});c(await u(`Updating`,async()=>n.realtimeKit.meetings.replaceMeetingById({...p,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Updated`})}};function Me(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting. Fetch the meeting ID using the create a meeting API.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`ai-config-summarization-summary-type`,{type:`string`,description:`Defines the style of the summary, such as general, team meeting, or sales call.`,choices:[`general`,`team_meeting`,`sales_call`,`client_check_in`,`interview`,`daily_standup`,`one_on_one_meeting`,`lecture`,`code_review`]}).option(`ai-config-summarization-text-format`,{type:`string`,description:`Determines the text format of the summary, such as plain text or markdown.`,choices:[`plain_text`,`markdown`]}).option(`ai-config-summarization-word-limit`,{type:`number`,description:`Sets the maximum number of words in the meeting summary.`}).option(`ai-config-transcription-keywords`,{type:`string`,array:!0,description:`Adds specific terms to improve accurate detection during transcription.`}).option(`ai-config-transcription-language`,{type:`string`,description:`Specifies the language code for transcription to ensure accurate results.`,choices:[`en-US`,`en-IN`,`de`,`hi`,`sv`,`ru`,`pl`,`el`,`fr`,`nl`]}).option(`ai-config-transcription-profanity-filter`,{type:`boolean`,description:`Control the inclusion of offensive language in transcriptions.`}).option(`live-stream-on-start`,{type:`boolean`,description:`Specifies if the meeting should start getting livestreamed on start.`}).option(`persist-chat`,{type:`boolean`,description:`If a meeting is updated to persist_chat, meeting chat would remain for a week within the meeting space.`}).option(`record-on-start`,{type:`boolean`,description:`Specifies if the meeting should start getting recorded as soon as someone joins the meeting.`}).option(`recording-config-audio-config-channel`,{type:`string`,description:`Audio signal pathway within an audio file that carries a specific sound source.`,choices:[`mono`,`stereo`]}).option(`recording-config-audio-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded. If VP8/VP9 is selected for videoConfig, changing audioConfig is not allowed. In this case, the codec in the audioConfig is automatically set to vorbis.`,choices:[`MP3`,`AAC`]}).option(`recording-config-audio-config-export-file`,{type:`boolean`,description:`Controls whether to export audio file seperately`}).option(`recording-config-file-name-prefix`,{type:`string`,description:`Adds a prefix to the beginning of the file name of the recording.`}).option(`recording-config-live-streaming-config-rtmp-url`,{type:`string`,description:`RTMP URL to stream to`}).option(`recording-config-max-seconds`,{type:`number`,description:`Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours.`}).option(`recording-config-realtimekit-bucket-config-enabled`,{type:`boolean`,description:"Controls whether recordings are uploaded to RealtimeKit's bucket. If set to false, `download_url`, `audio_download_url`, `download_url_expiry` won't be generated for a recording."}).option(`recording-config-storage-config-access-key`,{type:`string`,description:`Access key of the storage medium. Access key is not required for the \`gcs\` storage media type.
11
-
12
- Note that this field is not readable by clients, only writeable.`}).option(`recording-config-storage-config-auth-method`,{type:`string`,description:`Authentication method used for "sftp" type storage medium
13
- `,choices:[`KEY`,`PASSWORD`]}).option(`recording-config-storage-config-bucket`,{type:`string`,description:`Name of the storage medium's bucket.`}).option(`recording-config-storage-config-host`,{type:`string`,description:`SSH destination server host for SFTP type storage medium`}).option(`recording-config-storage-config-password`,{type:`string`,description:`SSH destination server password for SFTP type storage medium when auth_method is "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh private key.`}).option(`recording-config-storage-config-path`,{type:`string`,description:`Path relative to the bucket root at which the recording will be placed.`}).option(`recording-config-storage-config-port`,{type:`number`,description:`SSH destination server port for SFTP type storage medium`}).option(`recording-config-storage-config-private-key`,{type:`string`,description:`Private key used to login to destination SSH server for SFTP type storage medium, when auth_method used is "KEY"`}).option(`recording-config-storage-config-region`,{type:`string`,description:`Region of the storage medium.`}).option(`recording-config-storage-config-secret`,{type:`string`,description:"Secret key of the storage medium. Similar to `access_key`, it is only writeable by clients, not readable."}).option(`recording-config-storage-config-type`,{type:`string`,description:`Type of storage media.`,choices:[`aws`,`azure`,`digitalocean`,`gcs`,`sftp`]}).option(`recording-config-storage-config-username`,{type:`string`,description:`SSH destination server username for SFTP type storage medium`}).option(`recording-config-video-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded.`,choices:[`H264`,`VP8`]}).option(`recording-config-video-config-export-file`,{type:`boolean`,description:`Controls whether to export video file seperately`}).option(`recording-config-video-config-height`,{type:`number`,description:`Height of the recording video in pixels`}).option(`recording-config-video-config-watermark-position`,{type:`string`,description:`Position of the watermark`,choices:[`left top`,`right top`,`left bottom`,`right bottom`]}).option(`recording-config-video-config-watermark-url`,{type:`string`,description:`URL of the watermark image`}).option(`recording-config-video-config-width`,{type:`number`,description:`Width of the recording video in pixels`}).option(`session-keep-alive-time-in-secs`,{type:`number`,description:`Time in seconds, for which a session remains active, after the last participant has left the meeting.`}).option(`status`,{type:`string`,description:"Whether the meeting is `ACTIVE` or `INACTIVE`. Users will not be able to join an `INACTIVE` meeting.",choices:[`ACTIVE`,`INACTIVE`]}).option(`summarize-on-end`,{type:`boolean`,description:`Automatically generate summary of meetings using transcripts. Requires Transcriptions to be enabled, and can be retrieved via Webhooks or summary API.`}).option(`title`,{type:`string`,description:`Title of the meeting`}).option(`transcribe-on-end`,{type:`boolean`,description:`Automatically generate transcripts when the meeting ends.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create meeting body`}).check(e=>{if([`recording-config-file-name-prefix`,`recording-config-live-streaming-config-rtmp-url`,`recording-config-max-seconds`,`recording-config-realtimekit-bucket-config-enabled`,`recording-config-storage-config-access-key`,`recording-config-storage-config-auth-method`,`recording-config-storage-config-bucket`,`recording-config-storage-config-host`,`recording-config-storage-config-password`,`recording-config-storage-config-path`,`recording-config-storage-config-port`,`recording-config-storage-config-private-key`,`recording-config-storage-config-region`,`recording-config-storage-config-secret`,`recording-config-storage-config-type`,`recording-config-storage-config-username`,`recording-config-video-config-watermark-url`].some(t=>e[t]!==void 0)){let t=[`recording-config-realtimekit-bucket-config-enabled`,`recording-config-storage-config-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --recording_config-* flag is set`)}return!0})}const Ne={command:`update-meeting-by-id <meeting-id>`,describe:`Updates a meeting in an App for the given meeting ID.`,builder:Me,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit meetings update-meeting-by-id`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/meetings/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({ai_config:{summarization:{summary_type:d(t[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(t[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:t[`ai-config-summarization-word-limit`]},transcription:{keywords:t[`ai-config-transcription-keywords`],language:d(t[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:t[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:t[`live-stream-on-start`],persist_chat:t[`persist-chat`],record_on_start:t[`record-on-start`],recording_config:{audio_config:{channel:d(t[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(t[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:t[`recording-config-audio-config-export-file`]},file_name_prefix:d(t[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(t[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:t[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:t[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(t[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(t[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(t[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(t[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(t[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(t[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:t[`recording-config-storage-config-port`],private_key:d(t[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(t[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(t[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(t[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(t[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(t[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:t[`recording-config-video-config-export-file`],height:t[`recording-config-video-config-height`],watermark:{position:d(t[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(t[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:t[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:t[`session-keep-alive-time-in-secs`],status:d(t.status,`status`,`text`),summarize_on_end:t[`summarize-on-end`],title:d(t.title,`title`,`text`),transcribe_on_end:t[`transcribe-on-end`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.realtimeKit.meetings.updateMeetingById({...e,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Updated`});return}let p=s({ai_config:{summarization:{summary_type:d(t[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(t[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:t[`ai-config-summarization-word-limit`]},transcription:{keywords:t[`ai-config-transcription-keywords`],language:d(t[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:t[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:t[`live-stream-on-start`],persist_chat:t[`persist-chat`],record_on_start:t[`record-on-start`],recording_config:{audio_config:{channel:d(t[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(t[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:t[`recording-config-audio-config-export-file`]},file_name_prefix:d(t[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(t[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:t[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:t[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(t[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(t[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(t[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(t[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(t[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(t[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:t[`recording-config-storage-config-port`],private_key:d(t[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(t[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(t[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(t[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(t[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(t[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:t[`recording-config-video-config-export-file`],height:t[`recording-config-video-config-height`],watermark:{position:d(t[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(t[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:t[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:t[`session-keep-alive-time-in-secs`],status:d(t.status,`status`,`text`),summarize_on_end:t[`summarize-on-end`],title:d(t.title,`title`,`text`),transcribe_on_end:t[`transcribe-on-end`]});c(await u(`Updating`,async()=>n.realtimeKit.meetings.updateMeetingById({...p,account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Updated`})}},Pe={command:`meetings`,describe:`Video meetings with participant management, access tokens, and recording controls`,builder:e=>e.command(pe).command(he).command(_e).command(ye).command(De).command(xe).command(Ce).command(Te).command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`config-livestream-viewer-qualities`,{type:`string`,array:!0,description:`Livestream viewer quality levels.`}).option(`config-max-screenshare-count`,{type:`number`,description:`Maximum number of screen shares that can be active at a given time`}).option(`config-max-video-streams-desktop`,{type:`number`,description:`Maximum number of video streams visible on desktop devices`}).option(`config-max-video-streams-mobile`,{type:`number`,description:`Maximum number of streams visible on mobile devices`}).option(`config-media-audio-enable-high-bitrate`,{type:`boolean`,description:`Enable High Quality Audio for your meetings`,default:!1}).option(`config-media-audio-enable-stereo`,{type:`boolean`,description:`Enable Stereo for your meetings`,default:!1}).option(`config-media-screenshare-frame-rate`,{type:`number`,description:`Frame rate of screen share`}).option(`config-media-screenshare-quality`,{type:`string`,description:`Quality of screen share `,choices:[`hd`,`vga`,`qvga`,`fhd`,`uhd`]}).option(`config-media-video-frame-rate`,{type:`number`,description:`Frame rate of participants' video`}).option(`config-media-video-quality`,{type:`string`,description:`Video quality of participants`,choices:[`hd`,`vga`,`qvga`,`fhd`,`uhd`]}).option(`config-media-video-simulcast`,{type:`boolean`,description:`Enable simulcast for participant videos.`,default:!1}).option(`config-view-type`,{type:`string`,description:`Type of the meeting`,choices:[`GROUP_CALL`,`WEBINAR`,`AUDIO_ROOM`,`LIVESTREAM`]}).option(`name`,{type:`string`,description:`Name of the preset`}).option(`permissions-accept-stage-requests`,{type:`boolean`,description:`The permissions.accept_stage_requests field`}).option(`permissions-accept-waiting-requests`,{type:`boolean`,description:`Whether this participant can accept waiting requests`}).option(`permissions-can-accept-production-requests`,{type:`boolean`,description:`The permissions.can_accept_production_requests field`}).option(`permissions-can-change-participant-permissions`,{type:`boolean`,description:`The permissions.can_change_participant_permissions field`}).option(`permissions-can-edit-display-name`,{type:`boolean`,description:`The permissions.can_edit_display_name field`}).option(`permissions-can-livestream`,{type:`boolean`,description:`The permissions.can_livestream field`}).option(`permissions-can-record`,{type:`boolean`,description:`The permissions.can_record field`}).option(`permissions-can-spotlight`,{type:`boolean`,description:`The permissions.can_spotlight field`}).option(`permissions-chat-private-can-receive`,{type:`boolean`,description:`The permissions.chat.private.can_receive field`}).option(`permissions-chat-private-can-send`,{type:`boolean`,description:`The permissions.chat.private.can_send field`}).option(`permissions-chat-private-files`,{type:`boolean`,description:`The permissions.chat.private.files field`}).option(`permissions-chat-private-text`,{type:`boolean`,description:`The permissions.chat.private.text field`}).option(`permissions-chat-public-can-send`,{type:`boolean`,description:`Can send messages in general`}).option(`permissions-chat-public-files`,{type:`boolean`,description:`Can send file messages`}).option(`permissions-chat-public-text`,{type:`boolean`,description:`Can send text messages`}).option(`permissions-connected-meetings-can-alter-connected-meetings`,{type:`boolean`,description:`The permissions.connected_meetings.can_alter_connected_meetings field`}).option(`permissions-connected-meetings-can-switch-connected-meetings`,{type:`boolean`,description:`The permissions.connected_meetings.can_switch_connected_meetings field`}).option(`permissions-connected-meetings-can-switch-to-parent-meeting`,{type:`boolean`,description:`The permissions.connected_meetings.can_switch_to_parent_meeting field`}).option(`permissions-disable-participant-audio`,{type:`boolean`,description:`The permissions.disable_participant_audio field`}).option(`permissions-disable-participant-screensharing`,{type:`boolean`,description:`The permissions.disable_participant_screensharing field`}).option(`permissions-disable-participant-video`,{type:`boolean`,description:`The permissions.disable_participant_video field`}).option(`permissions-hidden-participant`,{type:`boolean`,description:`Whether this participant is visible to others or not`}).option(`permissions-is-recorder`,{type:`boolean`,description:`The permissions.is_recorder field`,default:!1}).option(`permissions-kick-participant`,{type:`boolean`,description:`The permissions.kick_participant field`}).option(`permissions-media-audio-can-produce`,{type:`string`,description:`Can produce audio`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-media-screenshare-can-produce`,{type:`string`,description:`Can produce screen share video`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-media-video-can-produce`,{type:`string`,description:`Can produce video`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-pin-participant`,{type:`boolean`,description:`The permissions.pin_participant field`}).option(`permissions-plugins-can-close`,{type:`boolean`,description:`Can close plugins that are already open`}).option(`permissions-plugins-can-edit-config`,{type:`boolean`,description:`Can edit plugin config`}).option(`permissions-plugins-can-start`,{type:`boolean`,description:`Can start plugins`}).option(`permissions-polls-can-create`,{type:`boolean`,description:`Can create polls`}).option(`permissions-polls-can-view`,{type:`boolean`,description:`Can view polls`}).option(`permissions-polls-can-vote`,{type:`boolean`,description:`Can vote on polls`}).option(`permissions-recorder-type`,{type:`string`,description:`Type of the recording peer`,choices:[`RECORDER`,`LIVESTREAMER`,`NONE`],default:`NONE`}).option(`permissions-show-participant-list`,{type:`boolean`,description:`The permissions.show_participant_list field`}).option(`permissions-stage-access`,{type:`string`,description:`The permissions.stage_access field`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-stage-enabled`,{type:`boolean`,description:`The permissions.stage_enabled field`}).option(`permissions-transcription-enabled`,{type:`boolean`,description:`The permissions.transcription_enabled field`}).option(`permissions-waiting-room-type`,{type:`string`,description:`Waiting room type`,choices:[`SKIP`,`ON_PRIVILEGED_USER_ENTRY`,`SKIP_ON_ACCEPT`]}).option(`ui-design-tokens-border-radius`,{type:`string`,description:`The ui.design_tokens.border_radius field`,choices:[`sharp`,`rounded`,`extra-rounded`,`circular`]}).option(`ui-design-tokens-border-width`,{type:`string`,description:`The ui.design_tokens.border_width field`,choices:[`none`,`thin`,`fat`]}).option(`ui-design-tokens-colors-danger`,{type:`string`,description:`The ui.design_tokens.colors.danger field`,default:`#FF2D2D`}).option(`ui-design-tokens-colors-success`,{type:`string`,description:`The ui.design_tokens.colors.success field`,default:`#62A504`}).option(`ui-design-tokens-colors-text`,{type:`string`,description:`The ui.design_tokens.colors.text field`,default:`#EEEEEE`}).option(`ui-design-tokens-colors-text-on-brand`,{type:`string`,description:`The ui.design_tokens.colors.text_on_brand field`,default:`#EEEEEE`}).option(`ui-design-tokens-colors-video-bg`,{type:`string`,description:`The ui.design_tokens.colors.video_bg field`,default:`#191919`}).option(`ui-design-tokens-colors-warning`,{type:`string`,description:`The ui.design_tokens.colors.warning field`,default:`#FFCD07`}).option(`ui-design-tokens-font-family`,{type:`string`,description:`The ui.design_tokens.font_family field`}).option(`ui-design-tokens-google-font`,{type:`string`,description:`The ui.design_tokens.google_font field`}).option(`ui-design-tokens-logo`,{type:`string`,description:`The ui.design_tokens.logo field`}).option(`ui-design-tokens-spacing-base`,{type:`number`,description:`The ui.design_tokens.spacing_base field`,default:4}).option(`ui-design-tokens-theme`,{type:`string`,description:`The ui.design_tokens.theme field`,choices:[`darkest`,`dark`,`light`]}).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 Ie={command:`create <app-id>`,describe:`Creates a preset belonging to the current App`,builder:Fe,handler:async r=>{if(r.dryRun){l({command:`cf realtime-kit presets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/presets`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({config:{livestream_viewer_qualities:r[`config-livestream-viewer-qualities`],max_screenshare_count:r[`config-max-screenshare-count`],max_video_streams:{desktop:r[`config-max-video-streams-desktop`],mobile:r[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:r[`config-media-audio-enable-high-bitrate`],enable_stereo:r[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:r[`config-media-screenshare-frame-rate`],quality:d(r[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:r[`config-media-video-frame-rate`],quality:d(r[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:r[`config-media-video-simulcast`]}},view_type:d(r[`config-view-type`],`config-view-type`,`text`)},name:d(r.name,`name`,`text`),permissions:{accept_stage_requests:r[`permissions-accept-stage-requests`],accept_waiting_requests:r[`permissions-accept-waiting-requests`],can_accept_production_requests:r[`permissions-can-accept-production-requests`],can_change_participant_permissions:r[`permissions-can-change-participant-permissions`],can_edit_display_name:r[`permissions-can-edit-display-name`],can_livestream:r[`permissions-can-livestream`],can_record:r[`permissions-can-record`],can_spotlight:r[`permissions-can-spotlight`],chat:{private:{can_receive:r[`permissions-chat-private-can-receive`],can_send:r[`permissions-chat-private-can-send`],files:r[`permissions-chat-private-files`],text:r[`permissions-chat-private-text`]},public:{can_send:r[`permissions-chat-public-can-send`],files:r[`permissions-chat-public-files`],text:r[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:r[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:r[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:r[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:r[`permissions-disable-participant-audio`],disable_participant_screensharing:r[`permissions-disable-participant-screensharing`],disable_participant_video:r[`permissions-disable-participant-video`],hidden_participant:r[`permissions-hidden-participant`],is_recorder:r[`permissions-is-recorder`],kick_participant:r[`permissions-kick-participant`],media:{audio:{can_produce:d(r[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(r[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(r[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:r[`permissions-pin-participant`],plugins:{can_close:r[`permissions-plugins-can-close`],can_edit_config:r[`permissions-plugins-can-edit-config`],can_start:r[`permissions-plugins-can-start`]},polls:{can_create:r[`permissions-polls-can-create`],can_view:r[`permissions-polls-can-view`],can_vote:r[`permissions-polls-can-vote`]},recorder_type:d(r[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:r[`permissions-show-participant-list`],stage_access:d(r[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:r[`permissions-stage-enabled`],transcription_enabled:r[`permissions-transcription-enabled`],waiting_room_type:d(r[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(r[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(r[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(r[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(r[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(r[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(r[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(r[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(r[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(r[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(r[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(r[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:r[`ui-design-tokens-spacing-base`],theme:d(r[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.realtimeKit.presets.create({body:e,account_id:m,app_id:r[`app-id`]})),{successLabel:`Created`});return}if(r[`config-max-screenshare-count`]===void 0)throw Error(`--config-max-screenshare-count is required (or pass --body with this field set).`);if(r[`config-max-video-streams-desktop`]===void 0)throw Error(`--config-max-video-streams-desktop is required (or pass --body with this field set).`);if(r[`config-max-video-streams-mobile`]===void 0)throw Error(`--config-max-video-streams-mobile is required (or pass --body with this field set).`);if(r[`config-media-screenshare-frame-rate`]===void 0)throw Error(`--config-media-screenshare-frame-rate is required (or pass --body with this field set).`);if(r[`config-media-screenshare-quality`]===void 0&&(r[`config-media-screenshare-quality`]=await n(`config-media-screenshare-quality`,`Quality of screen share `,[`hd`,`vga`,`qvga`,`fhd`,`uhd`])),r[`config-media-video-frame-rate`]===void 0)throw Error(`--config-media-video-frame-rate is required (or pass --body with this field set).`);if(r[`config-media-video-quality`]===void 0&&(r[`config-media-video-quality`]=await n(`config-media-video-quality`,`Video quality of participants`,[`hd`,`vga`,`qvga`,`fhd`,`uhd`])),r[`config-view-type`]===void 0&&(r[`config-view-type`]=await n(`config-view-type`,`Type of the meeting`,[`GROUP_CALL`,`WEBINAR`,`AUDIO_ROOM`,`LIVESTREAM`])),r.name===void 0&&(r.name=await t(`name`,`Name of the preset`)),r[`permissions-accept-waiting-requests`]===void 0)throw Error(`--permissions-accept-waiting-requests is required (or pass --body with this field set).`);if(r[`permissions-can-accept-production-requests`]===void 0)throw Error(`--permissions-can-accept-production-requests is required (or pass --body with this field set).`);if(r[`permissions-can-change-participant-permissions`]===void 0)throw Error(`--permissions-can-change-participant-permissions is required (or pass --body with this field set).`);if(r[`permissions-can-edit-display-name`]===void 0)throw Error(`--permissions-can-edit-display-name is required (or pass --body with this field set).`);if(r[`permissions-can-livestream`]===void 0)throw Error(`--permissions-can-livestream is required (or pass --body with this field set).`);if(r[`permissions-can-record`]===void 0)throw Error(`--permissions-can-record is required (or pass --body with this field set).`);if(r[`permissions-can-spotlight`]===void 0)throw Error(`--permissions-can-spotlight is required (or pass --body with this field set).`);if(r[`permissions-chat-private-can-receive`]===void 0)throw Error(`--permissions-chat-private-can-receive is required (or pass --body with this field set).`);if(r[`permissions-chat-private-can-send`]===void 0)throw Error(`--permissions-chat-private-can-send is required (or pass --body with this field set).`);if(r[`permissions-chat-private-files`]===void 0)throw Error(`--permissions-chat-private-files is required (or pass --body with this field set).`);if(r[`permissions-chat-private-text`]===void 0)throw Error(`--permissions-chat-private-text is required (or pass --body with this field set).`);if(r[`permissions-chat-public-can-send`]===void 0)throw Error(`--permissions-chat-public-can-send is required (or pass --body with this field set).`);if(r[`permissions-chat-public-files`]===void 0)throw Error(`--permissions-chat-public-files is required (or pass --body with this field set).`);if(r[`permissions-chat-public-text`]===void 0)throw Error(`--permissions-chat-public-text is required (or pass --body with this field set).`);if(r[`permissions-connected-meetings-can-alter-connected-meetings`]===void 0)throw Error(`--permissions-connected-meetings-can-alter-connected-meetings is required (or pass --body with this field set).`);if(r[`permissions-connected-meetings-can-switch-connected-meetings`]===void 0)throw Error(`--permissions-connected-meetings-can-switch-connected-meetings is required (or pass --body with this field set).`);if(r[`permissions-connected-meetings-can-switch-to-parent-meeting`]===void 0)throw Error(`--permissions-connected-meetings-can-switch-to-parent-meeting is required (or pass --body with this field set).`);if(r[`permissions-disable-participant-audio`]===void 0)throw Error(`--permissions-disable-participant-audio is required (or pass --body with this field set).`);if(r[`permissions-disable-participant-screensharing`]===void 0)throw Error(`--permissions-disable-participant-screensharing is required (or pass --body with this field set).`);if(r[`permissions-disable-participant-video`]===void 0)throw Error(`--permissions-disable-participant-video is required (or pass --body with this field set).`);if(r[`permissions-hidden-participant`]===void 0)throw Error(`--permissions-hidden-participant is required (or pass --body with this field set).`);if(r[`permissions-kick-participant`]===void 0)throw Error(`--permissions-kick-participant is required (or pass --body with this field set).`);if(r[`permissions-media-audio-can-produce`]===void 0&&(r[`permissions-media-audio-can-produce`]=await n(`permissions-media-audio-can-produce`,`Can produce audio`,[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`])),r[`permissions-media-screenshare-can-produce`]===void 0&&(r[`permissions-media-screenshare-can-produce`]=await n(`permissions-media-screenshare-can-produce`,`Can produce screen share video`,[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`])),r[`permissions-media-video-can-produce`]===void 0&&(r[`permissions-media-video-can-produce`]=await n(`permissions-media-video-can-produce`,`Can produce video`,[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`])),r[`permissions-pin-participant`]===void 0)throw Error(`--permissions-pin-participant is required (or pass --body with this field set).`);if(r[`permissions-plugins-can-close`]===void 0)throw Error(`--permissions-plugins-can-close is required (or pass --body with this field set).`);if(r[`permissions-plugins-can-edit-config`]===void 0)throw Error(`--permissions-plugins-can-edit-config is required (or pass --body with this field set).`);if(r[`permissions-plugins-can-start`]===void 0)throw Error(`--permissions-plugins-can-start is required (or pass --body with this field set).`);if(r[`permissions-polls-can-create`]===void 0)throw Error(`--permissions-polls-can-create is required (or pass --body with this field set).`);if(r[`permissions-polls-can-view`]===void 0)throw Error(`--permissions-polls-can-view is required (or pass --body with this field set).`);if(r[`permissions-polls-can-vote`]===void 0)throw Error(`--permissions-polls-can-vote is required (or pass --body with this field set).`);if(r[`permissions-recorder-type`]===void 0&&(r[`permissions-recorder-type`]=await n(`permissions-recorder-type`,`Type of the recording peer`,[`RECORDER`,`LIVESTREAMER`,`NONE`])),r[`permissions-show-participant-list`]===void 0)throw Error(`--permissions-show-participant-list is required (or pass --body with this field set).`);if(r[`permissions-waiting-room-type`]===void 0&&(r[`permissions-waiting-room-type`]=await n(`permissions-waiting-room-type`,`Waiting room type`,[`SKIP`,`ON_PRIVILEGED_USER_ENTRY`,`SKIP_ON_ACCEPT`])),r[`ui-design-tokens-border-radius`]===void 0&&(r[`ui-design-tokens-border-radius`]=await n(`ui-design-tokens-border-radius`,`The ui.design_tokens.border_radius field`,[`sharp`,`rounded`,`extra-rounded`,`circular`])),r[`ui-design-tokens-border-width`]===void 0&&(r[`ui-design-tokens-border-width`]=await n(`ui-design-tokens-border-width`,`The ui.design_tokens.border_width field`,[`none`,`thin`,`fat`])),r[`ui-design-tokens-colors-danger`]===void 0&&(r[`ui-design-tokens-colors-danger`]=await t(`ui-design-tokens-colors-danger`,`The ui.design_tokens.colors.danger field`)),r[`ui-design-tokens-colors-success`]===void 0&&(r[`ui-design-tokens-colors-success`]=await t(`ui-design-tokens-colors-success`,`The ui.design_tokens.colors.success field`)),r[`ui-design-tokens-colors-text`]===void 0&&(r[`ui-design-tokens-colors-text`]=await t(`ui-design-tokens-colors-text`,`The ui.design_tokens.colors.text field`)),r[`ui-design-tokens-colors-text-on-brand`]===void 0&&(r[`ui-design-tokens-colors-text-on-brand`]=await t(`ui-design-tokens-colors-text-on-brand`,`The ui.design_tokens.colors.text_on_brand field`)),r[`ui-design-tokens-colors-video-bg`]===void 0&&(r[`ui-design-tokens-colors-video-bg`]=await t(`ui-design-tokens-colors-video-bg`,`The ui.design_tokens.colors.video_bg field`)),r[`ui-design-tokens-colors-warning`]===void 0&&(r[`ui-design-tokens-colors-warning`]=await t(`ui-design-tokens-colors-warning`,`The ui.design_tokens.colors.warning field`)),r[`ui-design-tokens-spacing-base`]===void 0)throw Error(`--ui-design-tokens-spacing-base is required (or pass --body with this field set).`);r[`ui-design-tokens-theme`]===void 0&&(r[`ui-design-tokens-theme`]=await n(`ui-design-tokens-theme`,`The ui.design_tokens.theme field`,[`darkest`,`dark`,`light`]));let h=s({config:{livestream_viewer_qualities:r[`config-livestream-viewer-qualities`],max_screenshare_count:r[`config-max-screenshare-count`],max_video_streams:{desktop:r[`config-max-video-streams-desktop`],mobile:r[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:r[`config-media-audio-enable-high-bitrate`],enable_stereo:r[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:r[`config-media-screenshare-frame-rate`],quality:d(r[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:r[`config-media-video-frame-rate`],quality:d(r[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:r[`config-media-video-simulcast`]}},view_type:d(r[`config-view-type`],`config-view-type`,`text`)},name:d(r.name,`name`,`text`),permissions:{accept_stage_requests:r[`permissions-accept-stage-requests`],accept_waiting_requests:r[`permissions-accept-waiting-requests`],can_accept_production_requests:r[`permissions-can-accept-production-requests`],can_change_participant_permissions:r[`permissions-can-change-participant-permissions`],can_edit_display_name:r[`permissions-can-edit-display-name`],can_livestream:r[`permissions-can-livestream`],can_record:r[`permissions-can-record`],can_spotlight:r[`permissions-can-spotlight`],chat:{private:{can_receive:r[`permissions-chat-private-can-receive`],can_send:r[`permissions-chat-private-can-send`],files:r[`permissions-chat-private-files`],text:r[`permissions-chat-private-text`]},public:{can_send:r[`permissions-chat-public-can-send`],files:r[`permissions-chat-public-files`],text:r[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:r[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:r[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:r[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:r[`permissions-disable-participant-audio`],disable_participant_screensharing:r[`permissions-disable-participant-screensharing`],disable_participant_video:r[`permissions-disable-participant-video`],hidden_participant:r[`permissions-hidden-participant`],is_recorder:r[`permissions-is-recorder`],kick_participant:r[`permissions-kick-participant`],media:{audio:{can_produce:d(r[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(r[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(r[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:r[`permissions-pin-participant`],plugins:{can_close:r[`permissions-plugins-can-close`],can_edit_config:r[`permissions-plugins-can-edit-config`],can_start:r[`permissions-plugins-can-start`]},polls:{can_create:r[`permissions-polls-can-create`],can_view:r[`permissions-polls-can-view`],can_vote:r[`permissions-polls-can-vote`]},recorder_type:d(r[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:r[`permissions-show-participant-list`],stage_access:d(r[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:r[`permissions-stage-enabled`],transcription_enabled:r[`permissions-transcription-enabled`],waiting_room_type:d(r[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(r[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(r[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(r[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(r[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(r[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(r[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(r[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(r[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(r[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(r[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(r[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:r[`ui-design-tokens-spacing-base`],theme:d(r[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}});c(await u(`Creating`,async()=>p.realtimeKit.presets.create({body:h,account_id:m,app_id:r[`app-id`]})),{successLabel:`Created`})}};function Le(e){return e.positional(`preset-id`,{type:`string`,description:`ID of the preset to fetch`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app 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 Re={command:`delete <preset-id>`,describe:`Deletes a preset using the provided preset ID`,builder:Le,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit presets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/presets/${t[`preset-id`]==null?`<preset-id>`:encodeURIComponent(String(t[`preset-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"preset-id":String(t[`preset-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
14
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.presets.delete({account_id:o,app_id:t[`app-id`],preset_id:t[`preset-id`]})),{successLabel:`Deleted`})}};function ze(e){return e.positional(`preset-id`,{type:`string`,description:`ID of the preset to fetch`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`get-preset-by-id <preset-id>`,describe:`Fetches details of a preset using the provided preset ID`,builder:ze,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit presets get-preset-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/presets/${t[`preset-id`]==null?`<preset-id>`:encodeURIComponent(String(t[`preset-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"preset-id":String(t[`preset-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.presets.getPresetById({account_id:r,app_id:t[`app-id`],preset_id:t[`preset-id`]})),{successLabel:`Loaded`})}};function Ve(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page`}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`search`,{type:`string`,description:`Search presets by name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`get <app-id>`,describe:`Fetches all the presets belonging to an App.`,builder:Ve,handler:async t=>{let n={per_page:t[`per-page`],page_no:t[`page-no`],search:t.search};if(t.dryRun){l({command:`cf realtime-kit presets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/presets`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.presets.get({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}};function Ue(e){return e.positional(`preset-id`,{type:`string`,description:`ID of the preset to fetch`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`config-livestream-viewer-qualities`,{type:`string`,array:!0,description:`Livestream viewer quality levels.`}).option(`config-max-screenshare-count`,{type:`number`,description:`Maximum number of screen shares that can be active at a given time`}).option(`config-max-video-streams-desktop`,{type:`number`,description:`Maximum number of video streams visible on desktop devices`}).option(`config-max-video-streams-mobile`,{type:`number`,description:`Maximum number of streams visible on mobile devices`}).option(`config-media-audio-enable-high-bitrate`,{type:`boolean`,description:`Enable High Quality Audio for your meetings`}).option(`config-media-audio-enable-stereo`,{type:`boolean`,description:`Enable Stereo for your meetings`}).option(`config-media-screenshare-frame-rate`,{type:`number`,description:`Frame rate of screen share`}).option(`config-media-screenshare-quality`,{type:`string`,description:`Quality of screen share `,choices:[`hd`,`vga`,`qvga`,`fhd`,`uhd`]}).option(`config-media-video-frame-rate`,{type:`number`,description:`Frame rate of participants' video`}).option(`config-media-video-quality`,{type:`string`,description:`Video quality of participants`,choices:[`hd`,`vga`,`qvga`,`fhd`,`uhd`]}).option(`config-media-video-simulcast`,{type:`boolean`,description:`Enable simulcast for participant videos.`}).option(`config-view-type`,{type:`string`,description:`Type of the meeting`,choices:[`GROUP_CALL`,`WEBINAR`,`AUDIO_ROOM`,`LIVESTREAM`]}).option(`name`,{type:`string`,description:`Name of the preset`}).option(`permissions-accept-stage-requests`,{type:`boolean`,description:`The permissions.accept_stage_requests field`}).option(`permissions-accept-waiting-requests`,{type:`boolean`,description:`Whether this participant can accept waiting requests`}).option(`permissions-can-accept-production-requests`,{type:`boolean`,description:`The permissions.can_accept_production_requests field`}).option(`permissions-can-change-participant-permissions`,{type:`boolean`,description:`The permissions.can_change_participant_permissions field`}).option(`permissions-can-edit-display-name`,{type:`boolean`,description:`The permissions.can_edit_display_name field`}).option(`permissions-can-livestream`,{type:`boolean`,description:`The permissions.can_livestream field`}).option(`permissions-can-record`,{type:`boolean`,description:`The permissions.can_record field`}).option(`permissions-can-spotlight`,{type:`boolean`,description:`The permissions.can_spotlight field`}).option(`permissions-chat-private-can-receive`,{type:`boolean`,description:`The permissions.chat.private.can_receive field`}).option(`permissions-chat-private-can-send`,{type:`boolean`,description:`The permissions.chat.private.can_send field`}).option(`permissions-chat-private-files`,{type:`boolean`,description:`The permissions.chat.private.files field`}).option(`permissions-chat-private-text`,{type:`boolean`,description:`The permissions.chat.private.text field`}).option(`permissions-chat-public-can-send`,{type:`boolean`,description:`Can send messages in general`}).option(`permissions-chat-public-files`,{type:`boolean`,description:`Can send file messages`}).option(`permissions-chat-public-text`,{type:`boolean`,description:`Can send text messages`}).option(`permissions-connected-meetings-can-alter-connected-meetings`,{type:`boolean`,description:`The permissions.connected_meetings.can_alter_connected_meetings field`}).option(`permissions-connected-meetings-can-switch-connected-meetings`,{type:`boolean`,description:`The permissions.connected_meetings.can_switch_connected_meetings field`}).option(`permissions-connected-meetings-can-switch-to-parent-meeting`,{type:`boolean`,description:`The permissions.connected_meetings.can_switch_to_parent_meeting field`}).option(`permissions-disable-participant-audio`,{type:`boolean`,description:`The permissions.disable_participant_audio field`}).option(`permissions-disable-participant-screensharing`,{type:`boolean`,description:`The permissions.disable_participant_screensharing field`}).option(`permissions-disable-participant-video`,{type:`boolean`,description:`The permissions.disable_participant_video field`}).option(`permissions-hidden-participant`,{type:`boolean`,description:`Whether this participant is visible to others or not`}).option(`permissions-is-recorder`,{type:`boolean`,description:`The permissions.is_recorder field`}).option(`permissions-kick-participant`,{type:`boolean`,description:`The permissions.kick_participant field`}).option(`permissions-media-audio-can-produce`,{type:`string`,description:`Can produce audio`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-media-screenshare-can-produce`,{type:`string`,description:`Can produce screen share video`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-media-video-can-produce`,{type:`string`,description:`Can produce video`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-pin-participant`,{type:`boolean`,description:`The permissions.pin_participant field`}).option(`permissions-plugins-can-close`,{type:`boolean`,description:`Can close plugins that are already open`}).option(`permissions-plugins-can-edit-config`,{type:`boolean`,description:`Can edit plugin config`}).option(`permissions-plugins-can-start`,{type:`boolean`,description:`Can start plugins`}).option(`permissions-polls-can-create`,{type:`boolean`,description:`Can create polls`}).option(`permissions-polls-can-view`,{type:`boolean`,description:`Can view polls`}).option(`permissions-polls-can-vote`,{type:`boolean`,description:`Can vote on polls`}).option(`permissions-recorder-type`,{type:`string`,description:`Type of the recording peer`,choices:[`RECORDER`,`LIVESTREAMER`,`NONE`]}).option(`permissions-show-participant-list`,{type:`boolean`,description:`The permissions.show_participant_list field`}).option(`permissions-stage-access`,{type:`string`,description:`The permissions.stage_access field`,choices:[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`]}).option(`permissions-stage-enabled`,{type:`boolean`,description:`The permissions.stage_enabled field`}).option(`permissions-transcription-enabled`,{type:`boolean`,description:`The permissions.transcription_enabled field`}).option(`permissions-waiting-room-type`,{type:`string`,description:`Waiting room type`,choices:[`SKIP`,`ON_PRIVILEGED_USER_ENTRY`,`SKIP_ON_ACCEPT`]}).option(`ui-design-tokens-border-radius`,{type:`string`,description:`The ui.design_tokens.border_radius field`,choices:[`sharp`,`rounded`,`extra-rounded`,`circular`]}).option(`ui-design-tokens-border-width`,{type:`string`,description:`The ui.design_tokens.border_width field`,choices:[`none`,`thin`,`fat`]}).option(`ui-design-tokens-colors-danger`,{type:`string`,description:`The ui.design_tokens.colors.danger field`}).option(`ui-design-tokens-colors-success`,{type:`string`,description:`The ui.design_tokens.colors.success field`}).option(`ui-design-tokens-colors-text`,{type:`string`,description:`The ui.design_tokens.colors.text field`}).option(`ui-design-tokens-colors-text-on-brand`,{type:`string`,description:`The ui.design_tokens.colors.text_on_brand field`}).option(`ui-design-tokens-colors-video-bg`,{type:`string`,description:`The ui.design_tokens.colors.video_bg field`}).option(`ui-design-tokens-colors-warning`,{type:`string`,description:`The ui.design_tokens.colors.warning field`}).option(`ui-design-tokens-font-family`,{type:`string`,description:`The ui.design_tokens.font_family field`}).option(`ui-design-tokens-google-font`,{type:`string`,description:`The ui.design_tokens.google_font field`}).option(`ui-design-tokens-logo`,{type:`string`,description:`The ui.design_tokens.logo field`}).option(`ui-design-tokens-spacing-base`,{type:`number`,description:`The ui.design_tokens.spacing_base field`}).option(`ui-design-tokens-theme`,{type:`string`,description:`The ui.design_tokens.theme field`,choices:[`darkest`,`dark`,`light`]}).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 We={command:`update <preset-id>`,describe:`Update a preset by the provided preset ID`,builder:Ue,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit presets update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/presets/${t[`preset-id`]==null?`<preset-id>`:encodeURIComponent(String(t[`preset-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"preset-id":String(t[`preset-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({config:{livestream_viewer_qualities:t[`config-livestream-viewer-qualities`],max_screenshare_count:t[`config-max-screenshare-count`],max_video_streams:{desktop:t[`config-max-video-streams-desktop`],mobile:t[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:t[`config-media-audio-enable-high-bitrate`],enable_stereo:t[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:t[`config-media-screenshare-frame-rate`],quality:d(t[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:t[`config-media-video-frame-rate`],quality:d(t[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:t[`config-media-video-simulcast`]}},view_type:d(t[`config-view-type`],`config-view-type`,`text`)},name:d(t.name,`name`,`text`),permissions:{accept_stage_requests:t[`permissions-accept-stage-requests`],accept_waiting_requests:t[`permissions-accept-waiting-requests`],can_accept_production_requests:t[`permissions-can-accept-production-requests`],can_change_participant_permissions:t[`permissions-can-change-participant-permissions`],can_edit_display_name:t[`permissions-can-edit-display-name`],can_livestream:t[`permissions-can-livestream`],can_record:t[`permissions-can-record`],can_spotlight:t[`permissions-can-spotlight`],chat:{private:{can_receive:t[`permissions-chat-private-can-receive`],can_send:t[`permissions-chat-private-can-send`],files:t[`permissions-chat-private-files`],text:t[`permissions-chat-private-text`]},public:{can_send:t[`permissions-chat-public-can-send`],files:t[`permissions-chat-public-files`],text:t[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:t[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:t[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:t[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:t[`permissions-disable-participant-audio`],disable_participant_screensharing:t[`permissions-disable-participant-screensharing`],disable_participant_video:t[`permissions-disable-participant-video`],hidden_participant:t[`permissions-hidden-participant`],is_recorder:t[`permissions-is-recorder`],kick_participant:t[`permissions-kick-participant`],media:{audio:{can_produce:d(t[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(t[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(t[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:t[`permissions-pin-participant`],plugins:{can_close:t[`permissions-plugins-can-close`],can_edit_config:t[`permissions-plugins-can-edit-config`],can_start:t[`permissions-plugins-can-start`]},polls:{can_create:t[`permissions-polls-can-create`],can_view:t[`permissions-polls-can-view`],can_vote:t[`permissions-polls-can-vote`]},recorder_type:d(t[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:t[`permissions-show-participant-list`],stage_access:d(t[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:t[`permissions-stage-enabled`],transcription_enabled:t[`permissions-transcription-enabled`],waiting_room_type:d(t[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(t[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(t[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(t[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(t[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(t[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(t[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(t[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(t[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(t[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(t[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(t[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:t[`ui-design-tokens-spacing-base`],theme:d(t[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.realtimeKit.presets.update({...e,account_id:r,app_id:t[`app-id`],preset_id:t[`preset-id`]})),{successLabel:`Updated`});return}let p=s({config:{livestream_viewer_qualities:t[`config-livestream-viewer-qualities`],max_screenshare_count:t[`config-max-screenshare-count`],max_video_streams:{desktop:t[`config-max-video-streams-desktop`],mobile:t[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:t[`config-media-audio-enable-high-bitrate`],enable_stereo:t[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:t[`config-media-screenshare-frame-rate`],quality:d(t[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:t[`config-media-video-frame-rate`],quality:d(t[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:t[`config-media-video-simulcast`]}},view_type:d(t[`config-view-type`],`config-view-type`,`text`)},name:d(t.name,`name`,`text`),permissions:{accept_stage_requests:t[`permissions-accept-stage-requests`],accept_waiting_requests:t[`permissions-accept-waiting-requests`],can_accept_production_requests:t[`permissions-can-accept-production-requests`],can_change_participant_permissions:t[`permissions-can-change-participant-permissions`],can_edit_display_name:t[`permissions-can-edit-display-name`],can_livestream:t[`permissions-can-livestream`],can_record:t[`permissions-can-record`],can_spotlight:t[`permissions-can-spotlight`],chat:{private:{can_receive:t[`permissions-chat-private-can-receive`],can_send:t[`permissions-chat-private-can-send`],files:t[`permissions-chat-private-files`],text:t[`permissions-chat-private-text`]},public:{can_send:t[`permissions-chat-public-can-send`],files:t[`permissions-chat-public-files`],text:t[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:t[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:t[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:t[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:t[`permissions-disable-participant-audio`],disable_participant_screensharing:t[`permissions-disable-participant-screensharing`],disable_participant_video:t[`permissions-disable-participant-video`],hidden_participant:t[`permissions-hidden-participant`],is_recorder:t[`permissions-is-recorder`],kick_participant:t[`permissions-kick-participant`],media:{audio:{can_produce:d(t[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(t[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(t[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:t[`permissions-pin-participant`],plugins:{can_close:t[`permissions-plugins-can-close`],can_edit_config:t[`permissions-plugins-can-edit-config`],can_start:t[`permissions-plugins-can-start`]},polls:{can_create:t[`permissions-polls-can-create`],can_view:t[`permissions-polls-can-view`],can_vote:t[`permissions-polls-can-vote`]},recorder_type:d(t[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:t[`permissions-show-participant-list`],stage_access:d(t[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:t[`permissions-stage-enabled`],transcription_enabled:t[`permissions-transcription-enabled`],waiting_room_type:d(t[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(t[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(t[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(t[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(t[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(t[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(t[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(t[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(t[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(t[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(t[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(t[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:t[`ui-design-tokens-spacing-base`],theme:d(t[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}});c(await u(`Updating`,async()=>n.realtimeKit.presets.update({...p,account_id:r,app_id:t[`app-id`],preset_id:t[`preset-id`]})),{successLabel:`Updated`})}},Ge={command:`presets`,describe:`Reusable meeting configuration presets for resolution, layout, and recording defaults`,builder:e=>e.command(Ie).command(Re).command(He).command(Be).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ke(e){return e.positional(`meeting-id`,{type:`string`,description:`ID of the meeting`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qe={command:`get-active-recordings <meeting-id>`,describe:`Returns the active recording details for the given meeting ID.`,builder:Ke,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit recordings get-active-recordings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/recordings/active-recording/${t[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(t[`meeting-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"meeting-id":String(t[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.recordings.getActiveRecordings({account_id:r,app_id:t[`app-id`],meeting_id:t[`meeting-id`]})),{successLabel:`Loaded`})}};function Je(e){return e.positional(`recording-id`,{type:`string`,description:`ID of the recording`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`get-one-recording <recording-id>`,describe:`Returns details of a recording for the given recording ID.`,builder:Je,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit recordings get-one-recording`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/recordings/${t[`recording-id`]==null?`<recording-id>`:encodeURIComponent(String(t[`recording-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"recording-id":String(t[`recording-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.recordings.getOneRecording({account_id:r,app_id:t[`app-id`],recording_id:t[`recording-id`]})),{successLabel:`Loaded`})}};function Xe(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`meeting-id`,{type:`string`,description:`ID of a meeting. Optional. Will limit results to only this meeting if passed.`}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page`}).option(`expired`,{type:`boolean`,description:`If passed, only shows expired/non-expired recordings on RealtimeKit's bucket`}).option(`search`,{type:`string`,description:`The search query string. You can search using the meeting ID or title.`}).option(`sort-by`,{type:`string`,description:`Sort by`,choices:[`invokedTime`]}).option(`sort-order`,{type:`string`,description:`Sort order`,choices:[`ASC`,`DESC`]}).option(`start-time`,{type:`string`,description:`The start time range for which you want to retrieve the meetings. The time must be specified in ISO format.`}).option(`end-time`,{type:`string`,description:`The end time range for which you want to retrieve the meetings. The time must be specified in ISO format.`}).option(`status`,{type:`string`,description:`Filter by one or more recording status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`get-recordings <app-id>`,describe:"Returns all recordings for an App. If the `meeting_id` parameter is passed, returns all recordings for the given meeting ID.",builder:p(Xe),handler:async t=>{let n={meeting_id:t[`meeting-id`],page_no:t[`page-no`],per_page:t[`per-page`],expired:t.expired,search:t.search,sort_by:t[`sort-by`],sort_order:t[`sort-order`],start_time:t[`start-time`],end_time:t[`end-time`],status:t.status};if(t.dryRun){l({command:`cf realtime-kit recordings get-recordings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/recordings`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.recordings.getRecordings({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}};function Qe(e){return e.positional(`recording-id`,{type:`string`,description:`ID of the recording`,demandOption:!0}).option(`app-id`,{type:`string`,description:`A Cloudflare-generated unique identifier for an item.`,demandOption:!0}).option(`action`,{type:`string`,description:`The action field`,choices:[`stop`,`pause`,`resume`]}).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:`pause-resume-stop-recording <recording-id>`,describe:`Pause/Resume/Stop a given recording ID.`,builder:Qe,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit recordings pause-resume-stop-recording`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/recordings/${t[`recording-id`]==null?`<recording-id>`:encodeURIComponent(String(t[`recording-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"recording-id":String(t[`recording-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({action:d(t.action,`action`,`text`)}):o(t.body)});return}let r=await a(t),p=t.local?f:await i(r);if(t.accountId=p,t.body){let e=o(t.body);c(await u(`Updating`,async()=>r.realtimeKit.recordings.pauseResumeStopRecording({...e,account_id:p,app_id:t[`app-id`],recording_id:t[`recording-id`]})),{successLabel:`Updated`});return}t.action===void 0&&(t.action=await n(`action`,`The action field`,[`stop`,`pause`,`resume`]));let m=s({action:d(t.action,`action`,`text`)});c(await u(`Updating`,async()=>r.realtimeKit.recordings.pauseResumeStopRecording({...m,account_id:p,app_id:t[`app-id`],recording_id:t[`recording-id`]})),{successLabel:`Updated`})}};function et(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`allow-multiple-recordings`,{type:`boolean`,description:"By default, a meeting allows only one recording to run at a time. Enabling the `allow_multiple_recordings` parameter to true allows you to initiate multiple recordings concurrently in the same meeting. This allows you to record separate videos of the same meeting with different configurations, such as portrait mode or landscape mode.",default:!1}).option(`audio-config-channel`,{type:`string`,description:`Audio signal pathway within an audio file that carries a specific sound source.`,choices:[`mono`,`stereo`],default:`stereo`}).option(`audio-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded. If VP8/VP9 is selected for videoConfig, changing audioConfig is not allowed. In this case, the codec in the audioConfig is automatically set to vorbis.`,choices:[`MP3`,`AAC`],default:`AAC`}).option(`audio-config-export-file`,{type:`boolean`,description:`Controls whether to export audio file seperately`,default:!0}).option(`file-name-prefix`,{type:`string`,description:`Update the recording file name.`}).option(`interactive-config-type`,{type:`string`,description:`The metadata is presented in the form of ID3 tags.`,choices:[`ID3`]}).option(`max-seconds`,{type:`number`,description:`Specifies the maximum duration for recording in seconds, ranging from a minimum of 60 seconds to a maximum of 24 hours.`}).option(`meeting-id`,{type:`string`,description:`ID of the meeting to record.`}).option(`realtimekit-bucket-config-enabled`,{type:`boolean`,description:"Controls whether recordings are uploaded to RealtimeKit's bucket. If set to false, `download_url`, `audio_download_url`, `download_url_expiry` won't be generated for a recording."}).option(`rtmp-out-config-rtmp-url`,{type:`string`,description:`RTMP URL to stream to`}).option(`storage-config-access-key`,{type:`string`,description:`Access key of the storage medium. Access key is not required for the \`gcs\` storage media type.
15
-
16
- Note that this field is not readable by clients, only writeable.`}).option(`storage-config-auth-method`,{type:`string`,description:`Authentication method used for "sftp" type storage medium
17
- `,choices:[`KEY`,`PASSWORD`]}).option(`storage-config-bucket`,{type:`string`,description:`Name of the storage medium's bucket.`}).option(`storage-config-host`,{type:`string`,description:`SSH destination server host for SFTP type storage medium`}).option(`storage-config-password`,{type:`string`,description:`SSH destination server password for SFTP type storage medium when auth_method is "PASSWORD". If auth_method is "KEY", this specifies the password for the ssh private key.`}).option(`storage-config-path`,{type:`string`,description:`Path relative to the bucket root at which the recording will be placed.`}).option(`storage-config-port`,{type:`number`,description:`SSH destination server port for SFTP type storage medium`}).option(`storage-config-private-key`,{type:`string`,description:`Private key used to login to destination SSH server for SFTP type storage medium, when auth_method used is "KEY"`}).option(`storage-config-region`,{type:`string`,description:`Region of the storage medium.`}).option(`storage-config-secret`,{type:`string`,description:"Secret key of the storage medium. Similar to `access_key`, it is only writeable by clients, not readable."}).option(`storage-config-type`,{type:`string`,description:`Type of storage media.`,choices:[`aws`,`azure`,`digitalocean`,`gcs`,`sftp`]}).option(`storage-config-username`,{type:`string`,description:`SSH destination server username for SFTP type storage medium`}).option(`url`,{type:`string`,description:`Pass a custom url to record arbitary screen`}).option(`video-config-codec`,{type:`string`,description:`Codec using which the recording will be encoded.`,choices:[`H264`,`VP8`],default:`H264`}).option(`video-config-export-file`,{type:`boolean`,description:`Controls whether to export video file seperately`,default:!0}).option(`video-config-height`,{type:`number`,description:`Height of the recording video in pixels`,default:720}).option(`video-config-watermark-position`,{type:`string`,description:`Position of the watermark`,choices:[`left top`,`right top`,`left bottom`,`right bottom`],default:`left top`}).option(`video-config-watermark-size-height`,{type:`number`,description:`Height of the watermark in px`}).option(`video-config-watermark-size-width`,{type:`number`,description:`Width of the watermark in px`}).option(`video-config-watermark-url`,{type:`string`,description:`URL of the watermark image`}).option(`video-config-width`,{type:`number`,description:`Width of the recording video in pixels`,default:1280}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`realtimekit-bucket-config-enabled`].some(t=>e[t]!==void 0)){let t=[`realtimekit-bucket-config-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --realtimekit_bucket_config-* flag is set`)}return!0}).check(e=>{if([`storage-config-access-key`,`storage-config-auth-method`,`storage-config-bucket`,`storage-config-host`,`storage-config-password`,`storage-config-path`,`storage-config-port`,`storage-config-private-key`,`storage-config-region`,`storage-config-secret`,`storage-config-type`,`storage-config-username`].some(t=>e[t]!==void 0)){let t=[`storage-config-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --storage_config-* flag is set`)}return!0})}const tt={command:`start-recordings <app-id>`,describe:`Starts recording a meeting. The meeting can be started by an App admin directly, or a participant with permissions to start a recording, based on the type of authorization used.`,builder:et,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit recordings start-recordings`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/recordings`,pathParams:{"app-id":String(n[`app-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({allow_multiple_recordings:n[`allow-multiple-recordings`],audio_config:{channel:d(n[`audio-config-channel`],`audio-config-channel`,`text`),codec:d(n[`audio-config-codec`],`audio-config-codec`,`text`),export_file:n[`audio-config-export-file`]},file_name_prefix:d(n[`file-name-prefix`],`file-name-prefix`,`text`),interactive_config:{type:d(n[`interactive-config-type`],`interactive-config-type`,`text`)},max_seconds:n[`max-seconds`],meeting_id:d(n[`meeting-id`],`meeting-id`,`text`),realtimekit_bucket_config:{enabled:n[`realtimekit-bucket-config-enabled`]},rtmp_out_config:{rtmp_url:d(n[`rtmp-out-config-rtmp-url`],`rtmp-out-config-rtmp-url`,`text`)},storage_config:{access_key:d(n[`storage-config-access-key`],`storage-config-access-key`,`text`),auth_method:d(n[`storage-config-auth-method`],`storage-config-auth-method`,`text`),bucket:d(n[`storage-config-bucket`],`storage-config-bucket`,`text`),host:d(n[`storage-config-host`],`storage-config-host`,`text`),password:d(n[`storage-config-password`],`storage-config-password`,`text`),path:d(n[`storage-config-path`],`storage-config-path`,`text`),port:n[`storage-config-port`],private_key:d(n[`storage-config-private-key`],`storage-config-private-key`,`text`),region:d(n[`storage-config-region`],`storage-config-region`,`text`),secret:d(n[`storage-config-secret`],`storage-config-secret`,`text`),type:d(n[`storage-config-type`],`storage-config-type`,`text`),username:d(n[`storage-config-username`],`storage-config-username`,`text`)},url:d(n.url,`url`,`text`),video_config:{codec:d(n[`video-config-codec`],`video-config-codec`,`text`),export_file:n[`video-config-export-file`],height:n[`video-config-height`],watermark:{position:d(n[`video-config-watermark-position`],`video-config-watermark-position`,`text`),size:{height:n[`video-config-watermark-size-height`],width:n[`video-config-watermark-size-width`]},url:d(n[`video-config-watermark-url`],`video-config-watermark-url`,`text`)},width:n[`video-config-width`]}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.realtimeKit.recordings.startRecordings({...e,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`});return}n[`meeting-id`]===void 0&&(n[`meeting-id`]=await t(`meeting-id`,`ID of the meeting to record.`));let m=s({allow_multiple_recordings:n[`allow-multiple-recordings`],audio_config:{channel:d(n[`audio-config-channel`],`audio-config-channel`,`text`),codec:d(n[`audio-config-codec`],`audio-config-codec`,`text`),export_file:n[`audio-config-export-file`]},file_name_prefix:d(n[`file-name-prefix`],`file-name-prefix`,`text`),interactive_config:{type:d(n[`interactive-config-type`],`interactive-config-type`,`text`)},max_seconds:n[`max-seconds`],meeting_id:d(n[`meeting-id`],`meeting-id`,`text`),realtimekit_bucket_config:{enabled:n[`realtimekit-bucket-config-enabled`]},rtmp_out_config:{rtmp_url:d(n[`rtmp-out-config-rtmp-url`],`rtmp-out-config-rtmp-url`,`text`)},storage_config:{access_key:d(n[`storage-config-access-key`],`storage-config-access-key`,`text`),auth_method:d(n[`storage-config-auth-method`],`storage-config-auth-method`,`text`),bucket:d(n[`storage-config-bucket`],`storage-config-bucket`,`text`),host:d(n[`storage-config-host`],`storage-config-host`,`text`),password:d(n[`storage-config-password`],`storage-config-password`,`text`),path:d(n[`storage-config-path`],`storage-config-path`,`text`),port:n[`storage-config-port`],private_key:d(n[`storage-config-private-key`],`storage-config-private-key`,`text`),region:d(n[`storage-config-region`],`storage-config-region`,`text`),secret:d(n[`storage-config-secret`],`storage-config-secret`,`text`),type:d(n[`storage-config-type`],`storage-config-type`,`text`),username:d(n[`storage-config-username`],`storage-config-username`,`text`)},url:d(n.url,`url`,`text`),video_config:{codec:d(n[`video-config-codec`],`video-config-codec`,`text`),export_file:n[`video-config-export-file`],height:n[`video-config-height`],watermark:{position:d(n[`video-config-watermark-position`],`video-config-watermark-position`,`text`),size:{height:n[`video-config-watermark-size-height`],width:n[`video-config-watermark-size-width`]},url:d(n[`video-config-watermark-url`],`video-config-watermark-url`,`text`)},width:n[`video-config-width`]}});c(await u(`Creating`,async()=>r.realtimeKit.recordings.startRecordings({...m,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`})}};function nt(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`meeting-id`,{type:`string`,description:`ID of the meeting to record.`}).option(`user-ids`,{type:`string`,array:!0,description:"Optional list of participant user IDs to record. Selective track recording (`user_ids`) is in early beta contact support to use this feature."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Starts audio track recording for an active meeting. Use `layers` only when you need to set a file name prefix. Selective track recording (`user_ids`) is in early beta contact support to use this feature."})}const rt={command:`start-track-recording <app-id>`,describe:`Starts track recording for a meeting. Track recording currently records separate participant audio tracks as WebM files in the RealtimeKit bucket. Video track recording is in development. For more information, refer to [Track recording](/realtime/realtimekit/recording-guide/track-recording/).`,builder:nt,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit recordings start-track-recording`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/recordings/track`,pathParams:{"app-id":String(n[`app-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({meeting_id:d(n[`meeting-id`],`meeting-id`,`text`),user_ids:n[`user-ids`]}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.realtimeKit.recordings.startTrackRecording({...e,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`});return}n[`meeting-id`]===void 0&&(n[`meeting-id`]=await t(`meeting-id`,`ID of the meeting to record.`));let m=s({meeting_id:d(n[`meeting-id`],`meeting-id`,`text`),user_ids:n[`user-ids`]});c(await u(`Creating`,async()=>r.realtimeKit.recordings.startTrackRecording({...m,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`})}},it={command:`recordings`,describe:`Meeting recordings — list, download, and manage recorded video and audio files`,builder:e=>e.command(qe).command(Ye).command(Ze).command($e).command(tt).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function at(e){return e.positional(`session-id`,{type:`string`,description:`Session ID`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`generate-summary-of-transcripts <session-id>`,describe:`Trigger Summary generation of Transcripts for the session ID.`,builder:at,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit sessions generate-summary-of-transcripts`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/summary`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Creating`,async()=>n.realtimeKit.sessions.generateSummaryOfTranscripts({account_id:r,app_id:t[`app-id`],session_id:t[`session-id`]})),{successLabel:`Created`})}};function st(e){return e.positional(`peer-id`,{type:`string`,description:`ID of the peer`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`filters`,{type:`string`,description:`Filter to apply to the peer report.`,choices:[`device_info`,`ip_information`,`precall_network_information`,`events`,`quality_stats`]}).option(`include-peer-events`,{type:`boolean`,description:`if true, response includes all the peer events of participant.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`get-participant-data-from-peer-id <peer-id>`,describe:`Returns participant details for the given peer ID along with call statistics.`,builder:p(st),handler:async t=>{let n={filters:t.filters,include_peer_events:t[`include-peer-events`]};if(t.dryRun){l({command:`cf realtime-kit sessions get-participant-data-from-peer-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/peer-report/${t[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(t[`peer-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"peer-id":String(t[`peer-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.sessions.getParticipantDataFromPeerId({account_id:o,app_id:t[`app-id`],peer_id:t[`peer-id`],...n})),{successLabel:`Loaded`})}};function lt(e){return e.positional(`session-id`,{type:`string`,description:`ID of the session`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ut={command:`get-session-chat <session-id>`,describe:`Returns a URL to download all chat messages of the session ID in CSV format.`,builder:lt,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit sessions get-session-chat`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/chat`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.sessions.getSessionChat({account_id:r,app_id:t[`app-id`],session_id:t[`session-id`]})),{successLabel:`Loaded`})}};function dt(e){return e.positional(`session-id`,{type:`string`,description:`ID of the session`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`include-breakout-rooms`,{type:`boolean`,description:`List all breakout rooms`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`get-session-details <session-id>`,describe:`Returns data of the given session ID including recording details.`,builder:dt,handler:async t=>{let n={include_breakout_rooms:t[`include-breakout-rooms`]};if(t.dryRun){l({command:`cf realtime-kit sessions get-session-details`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.sessions.getSessionDetails({account_id:o,app_id:t[`app-id`],session_id:t[`session-id`],...n})),{successLabel:`Loaded`})}};function pt(e){return e.positional(`participant-id`,{type:`string`,description:`ID of the participant`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`ID of the session`,demandOption:!0}).option(`include-peer-events`,{type:`boolean`,description:`if true, response includes all the peer events of participant.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mt={command:`get-session-participant-details <participant-id>`,describe:`Returns details of the given participant ID along with call statistics for the given session ID.`,builder:pt,handler:async t=>{let n={include_peer_events:t[`include-peer-events`]};if(t.dryRun){l({command:`cf realtime-kit sessions get-session-participant-details`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/participants/${t[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(t[`participant-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"participant-id":String(t[`participant-id`]??``),"session-id":String(t[`session-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.sessions.getSessionParticipantDetails({account_id:o,app_id:t[`app-id`],session_id:t[`session-id`],participant_id:t[`participant-id`],...n})),{successLabel:`Loaded`})}};function ht(e){return e.positional(`session-id`,{type:`string`,description:`ID of the session`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`search`,{type:`string`,description:`The search query string. You can search using participant ID, custom participant ID, or display name.`}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page`}).option(`sort-order`,{type:`string`,description:`Sort order`,choices:[`ASC`,`DESC`]}).option(`sort-by`,{type:`string`,description:`Sort by`,choices:[`joinedAt`,`duration`]}).option(`include-peer-events`,{type:`boolean`,description:`if true, response includes all the peer events of participants.`}).option(`view`,{type:`string`,description:"In breakout room sessions, the view parameter can be set to `raw` for session specific duration for participants or `consolidated` to accumulate breakout room durations.",choices:[`raw`,`consolidated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gt={command:`get-session-participants <session-id>`,describe:`Returns a list of participants for the given session ID.`,builder:p(ht),handler:async t=>{let n={search:t.search,page_no:t[`page-no`],per_page:t[`per-page`],sort_order:t[`sort-order`],sort_by:t[`sort-by`],include_peer_events:t[`include-peer-events`],view:t.view};if(t.dryRun){l({command:`cf realtime-kit sessions get-session-participants`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/participants`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.sessions.getSessionParticipants({account_id:o,app_id:t[`app-id`],session_id:t[`session-id`],...n})),{successLabel:`Loaded`})}};function _t(e){return e.positional(`session-id`,{type:`string`,description:`Session ID`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`get-session-summary <session-id>`,describe:`Returns a Summary URL to download the Summary of Transcripts for the session ID as plain text.`,builder:_t,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit sessions get-session-summary`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/summary`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.sessions.getSessionSummary({account_id:r,app_id:t[`app-id`],session_id:t[`session-id`]})),{successLabel:`Loaded`})}};function yt(e){return e.positional(`session-id`,{type:`string`,description:`ID of the session`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`format`,{type:`string`,description:`Transcript file format to fetch.`,choices:[`SRT`,`VTT`,`JSON`,`CSV`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bt={command:`get-session-transcripts <session-id>`,describe:`Returns a URL to download the transcript for the session ID in CSV format.`,builder:p(yt),handler:async t=>{let n={format:t.format};if(t.dryRun){l({command:`cf realtime-kit sessions get-session-transcripts`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions/${t[`session-id`]==null?`<session-id>`:encodeURIComponent(String(t[`session-id`]))}/transcript`,pathParams:{"app-id":String(t[`app-id`]??``),"session-id":String(t[`session-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.sessions.getSessionTranscripts({account_id:o,app_id:t[`app-id`],session_id:t[`session-id`],...n})),{successLabel:`Loaded`})}};function xt(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`page-no`,{type:`number`,description:`The page number from which you want your page search results to be displayed.`}).option(`per-page`,{type:`number`,description:`Number of results per page`}).option(`sort-by`,{type:`string`,description:`Sort by`,choices:[`minutesConsumed`,`createdAt`]}).option(`sort-order`,{type:`string`,description:`Sort order`,choices:[`ASC`,`DESC`]}).option(`start-time`,{type:`string`,description:`The start time range for which you want to retrieve the meetings. The time must be specified in ISO format.`}).option(`end-time`,{type:`string`,description:`The end time range for which you want to retrieve the meetings. The time must be specified in ISO format.`}).option(`participants`,{type:`string`,description:`Participants`}).option(`status`,{type:`string`,description:`Status`,choices:[`LIVE`,`ENDED`]}).option(`search`,{type:`string`,description:`Search string that matches sessions based on meeting title, meeting ID, and session ID`}).option(`associated-id`,{type:`string`,description:`ID of the meeting that sessions should be associated with`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`get-sessions <app-id>`,describe:`Returns details of all sessions of an App.`,builder:p(xt),handler:async t=>{let n={page_no:t[`page-no`],per_page:t[`per-page`],sort_by:t[`sort-by`],sort_order:t[`sort-order`],start_time:t[`start-time`],end_time:t[`end-time`],participants:t.participants,status:t.status,search:t.search,associated_id:t[`associated-id`]};if(t.dryRun){l({command:`cf realtime-kit sessions get-sessions`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/sessions`,pathParams:{"app-id":String(t[`app-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.realtimeKit.sessions.getSessions({account_id:o,app_id:t[`app-id`],...n})),{successLabel:`Loaded`})}},Ct={command:`sessions`,describe:`Active and historical meeting sessions with participant details and duration tracking`,builder:e=>e.command(ot).command(ct).command(ut).command(ft).command(mt).command(gt).command(vt).command(bt).command(St).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wt(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Set whether or not the webhook should be active when created`,default:!0}).option(`events`,{type:`string`,array:!0,description:`Events that this webhook will get triggered by`}).option(`name`,{type:`string`,description:`Name of the webhook`}).option(`url`,{type:`string`,description:`URL this webhook will send events to`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tt={command:`create-webhook <app-id>`,describe:`Adds a new webhook to an App.`,builder:wt,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit webhooks create-webhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/webhooks`,pathParams:{"app-id":String(n[`app-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({enabled:n.enabled,events:n.events,name:d(n.name,`name`,`text`),url:d(n.url,`url`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.realtimeKit.webhooks.createWebhook({body:e,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`});return}if(n.events===void 0)throw Error(`--events is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await t(`name`,`Name of the webhook`)),n.url===void 0&&(n.url=await t(`url`,`URL this webhook will send events to`));let m=s({enabled:n.enabled,events:n.events,name:d(n.name,`name`,`text`),url:d(n.url,`url`,`text`)});c(await u(`Creating`,async()=>r.realtimeKit.webhooks.createWebhook({body:m,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`})}};function Et(e){return e.positional(`webhook-id`,{type:`string`,description:`ID of the webhook`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app 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 $={command:`delete-webhook <webhook-id>`,describe:`Removes a webhook for the given webhook ID.`,builder:Et,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit webhooks delete-webhook`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
18
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.webhooks.deleteWebhook({account_id:o,app_id:t[`app-id`],webhook_id:t[`webhook-id`]})),{successLabel:`Deleted`})}};function Dt(e){return e.positional(`webhook-id`,{type:`string`,description:`ID of the webhook`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`events`,{type:`string`,array:!0,description:`Events that the webhook will get triggered by`}).option(`name`,{type:`string`,description:`Name of the webhook`}).option(`url`,{type:`string`,description:`URL the webhook will send events to`}).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 Ot={command:`edit-webhook <webhook-id>`,describe:`Edits the webhook details for the given webhook ID.`,builder:Dt,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit webhooks edit-webhook`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`),url:d(t.url,`url`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.realtimeKit.webhooks.editWebhook({...e,account_id:r,app_id:t[`app-id`],webhook_id:t[`webhook-id`]})),{successLabel:`Updated`});return}let p=s({enabled:t.enabled,events:t.events,name:d(t.name,`name`,`text`),url:d(t.url,`url`,`text`)});c(await u(`Updating`,async()=>n.realtimeKit.webhooks.editWebhook({...p,account_id:r,app_id:t[`app-id`],webhook_id:t[`webhook-id`]})),{successLabel:`Updated`})}};function kt(e){return e.positional(`webhook-id`,{type:`string`,description:`ID of the webhook`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`get-webhook-by-id <webhook-id>`,describe:`Returns webhook details for the given webhook ID.`,builder:kt,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit webhooks get-webhook-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"app-id":String(t[`app-id`]??``),"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.webhooks.getWebhookById({account_id:r,app_id:t[`app-id`],webhook_id:t[`webhook-id`]})),{successLabel:`Loaded`})}};function jt(e){return e.positional(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`get-webhooks <app-id>`,describe:`Returns details of all webhooks for an App.`,builder:jt,handler:async t=>{if(t.dryRun){l({command:`cf realtime-kit webhooks get-webhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/webhooks`,pathParams:{"app-id":String(t[`app-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.realtimeKit.webhooks.getWebhooks({account_id:r,app_id:t[`app-id`]})),{successLabel:`Loaded`})}};function Nt(e){return e.positional(`webhook-id`,{type:`string`,description:`ID of the webhook`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The app identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Set whether or not the webhook should be active when created`}).option(`events`,{type:`string`,array:!0,description:`Events that this webhook will get triggered by`}).option(`name`,{type:`string`,description:`Name of the webhook`}).option(`url`,{type:`string`,description:`URL this webhook will send events to`}).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 Pt={command:`replace-webhook <webhook-id>`,describe:`Replace all details for the given webhook ID.`,builder:Nt,handler:async n=>{if(n.dryRun){l({command:`cf realtime-kit webhooks replace-webhook`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/realtime/kit/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/webhooks/${n[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(n[`webhook-id`]))}`,pathParams:{"app-id":String(n[`app-id`]??``),"webhook-id":String(n[`webhook-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({enabled:n.enabled,events:n.events,name:d(n.name,`name`,`text`),url:d(n.url,`url`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Updating`,async()=>r.realtimeKit.webhooks.replaceWebhook({body:e,account_id:p,app_id:n[`app-id`],webhook_id:n[`webhook-id`]})),{successLabel:`Updated`});return}if(n.events===void 0)throw Error(`--events is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await t(`name`,`Name of the webhook`)),n.url===void 0&&(n.url=await t(`url`,`URL this webhook will send events to`));let m=s({enabled:n.enabled,events:n.events,name:d(n.name,`name`,`text`),url:d(n.url,`url`,`text`)});c(await u(`Updating`,async()=>r.realtimeKit.webhooks.replaceWebhook({body:m,account_id:p,app_id:n[`app-id`],webhook_id:n[`webhook-id`]})),{successLabel:`Updated`})}},Ft={command:`webhooks`,describe:`Webhook endpoints for real-time event notifications (meeting started, participant joined, etc.)`,builder:e=>e.command(Tt).command($).command(Ot).command(At).command(Mt).command(Pt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},It={command:`realtime-kit`,describe:`Real-time video and audio — meetings, livestreams, recordings, and session management via Cloudflare Calls`,builder:e=>e.command(b).command(C).command(O).command(G).command(de).command(Pe).command(Ge).command(it).command(Ct).command(Ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{It as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";function d(e){return e.option(`body-base64`,{type:`string`,description:`Base64 encoded request body`}).option(`body-plain-text`,{type:`string`,description:`Request body as plain text`}).option(`context-bot-score`,{type:`number`,description:`Bot score used for evaluating tracing request processing`}).option(`context-geoloc-city`,{type:`string`,description:`The context.geoloc.city field`}).option(`context-geoloc-continent`,{type:`string`,description:`The context.geoloc.continent field`}).option(`context-geoloc-is-eu-country`,{type:`boolean`,description:`The context.geoloc.is_eu_country field`}).option(`context-geoloc-iso-code`,{type:`string`,description:`The context.geoloc.iso_code field`}).option(`context-geoloc-latitude`,{type:`number`,description:`The context.geoloc.latitude field`}).option(`context-geoloc-longitude`,{type:`number`,description:`The context.geoloc.longitude field`}).option(`context-geoloc-postal-code`,{type:`string`,description:`The context.geoloc.postal_code field`}).option(`context-geoloc-region-code`,{type:`string`,description:`The context.geoloc.region_code field`}).option(`context-geoloc-subdivision-2-iso-code`,{type:`string`,description:`The context.geoloc.subdivision_2_iso_code field`}).option(`context-geoloc-timezone`,{type:`string`,description:`The context.geoloc.timezone field`}).option(`context-skip-challenge`,{type:`boolean`,description:`Whether to skip any challenges for tracing request (e.g.: captcha)`}).option(`context-threat-score`,{type:`number`,description:`Threat score used for evaluating tracing request processing`}).option(`method`,{type:`string`,description:`HTTP Method of tracing request`}).option(`protocol`,{type:`string`,description:`HTTP Protocol of tracing request`}).option(`skip-response`,{type:`boolean`,description:`Skip sending the request to the Origin server after all rules evaluation`}).option(`url`,{type:`string`,description:`URL to which perform tracing request`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Traces a simulated HTTP request through Cloudflare's edge to analyze how rules, settings, and configurations would process the request. Useful for debugging firewall rules, page rules, and other request transformations without sending actual traffic. Supports custom headers, cookies, body content, and geolocation context.`,builder:d,handler:async d=>{if(d.dryRun){s({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:d.body===void 0?a({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)}):i(d.body)});return}let f=await r(d),p=d.local?u:await n(f);if(d.accountId=p,d.body){let e=i(d.body);o(await c(`Creating`,async()=>f.requestTracers.traces.create({...e,account_id:p})),{successLabel:`Created`});return}d.method===void 0&&(d.method=await t(`method`,`HTTP Method of tracing request`)),d.url===void 0&&(d.url=await t(`url`,`URL to which perform tracing request`));let m=a({body:{base64:l(d[`body-base64`],`body-base64`,`text`),plain_text:l(d[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:d[`context-bot-score`],geoloc:{city:l(d[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:l(d[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:d[`context-geoloc-is-eu-country`],iso_code:l(d[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:d[`context-geoloc-latitude`],longitude:d[`context-geoloc-longitude`],postal_code:l(d[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:l(d[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:l(d[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:l(d[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:d[`context-skip-challenge`],threat_score:d[`context-threat-score`]},method:l(d.method,`method`,`text`),protocol:l(d.protocol,`protocol`,`text`),skip_response:d[`skip-response`],url:l(d.url,`url`,`text`)});o(await c(`Creating`,async()=>f.requestTracers.traces.create({...m,account_id:p})),{successLabel:`Created`})}},p={command:`traces`,describe:`Operations for traces`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`request-tracers`,describe:`request-tracers`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";function m(e){return e.option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`,builder:m,handler:async n=>{if(n.dryRun){l({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.resourceSharing.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`The name of the share.`));let m=s({name:d(n.name,`name`,`text`)});c(await u(`Creating`,async()=>r.resourceSharing.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`share-id`,{type:`string`,description:`Share 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 _={command:`delete <share-id>`,describe:`Deletion is not immediate, an updated share object with a new status will be returned.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.resourceSharing.delete({account_id:o,share_id:t[`share-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <share-id>`,describe:`Fetches share by ID.`,builder:v,handler:async t=>{let n={include_resources:t[`include-resources`],include_recipient_counts:t[`include-recipient-counts`]};if(t.dryRun){l({command:`cf resource-sharing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.resourceSharing.get({account_id:o,share_id:t[`share-id`],...n})),{successLabel:`Loaded`})}};function b(e){return e.option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`tag`,{type:`string`,description:"Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists all account shares.`,builder:p(b),handler:async t=>{let n={status:t.status,kind:t.kind,target_type:t[`target-type`],resource_types:t[`resource-types`],order:t.order,direction:t.direction,page:t.page,per_page:t[`per-page`],include_resources:t[`include-resources`],include_recipient_counts:t[`include-recipient-counts`],tag:t.tag};if(t.dryRun){l({command:`cf resource-sharing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.resourceSharing.list({account_id:o,...n})),{successLabel:`Loaded`})}};function S(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Optionally specify `recipient_account_id` to target a specific account, or `organization_id` to target the caller's whole organization. If neither is provided, the caller's organization is used. The legacy field `account_id` is accepted as a synonym for `recipient_account_id` during the deprecation period (see `x-sunset` on that field). "})}const C={command:`create <share-id>`,describe:`Adds a recipient to a resource share, granting them access to the shared resources.`,builder:S,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/recipients`,pathParams:{"share-id":String(t[`share-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({organization_id:d(t[`organization-id`],`organization-id`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.resourceSharing.recipients.create({body:e,account_id:r,share_id:t[`share-id`]})),{successLabel:`Created`});return}let p=s({organization_id:d(t[`organization-id`],`organization-id`,`text`)});c(await u(`Creating`,async()=>n.resourceSharing.recipients.create({body:p,account_id:r,share_id:t[`share-id`]})),{successLabel:`Created`})}};function w(e){return e.positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share 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 T={command:`delete <recipient-id>`,describe:`Deletion is not immediate, an updated share recipient object with a new status will be returned.`,builder:w,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/recipients/${t[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(t[`recipient-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``),"recipient-id":String(t[`recipient-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}c(await u(`Deleting`,async()=>n.resourceSharing.recipients.delete({account_id:o,share_id:t[`share-id`],recipient_id:t[`recipient-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <recipient-id>`,describe:`Get share recipient by ID.`,builder:E,handler:async t=>{let n={include_resources:t[`include-resources`]};if(t.dryRun){l({command:`cf resource-sharing recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/recipients/${t[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(t[`recipient-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``),"recipient-id":String(t[`recipient-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.resourceSharing.recipients.get({account_id:o,share_id:t[`share-id`],recipient_id:t[`recipient-id`],...n})),{successLabel:`Loaded`})}};function O(e){return e.option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List share recipients by share ID.`,builder:O,handler:async t=>{let n={include_resources:t[`include-resources`],page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf resource-sharing recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/recipients`,pathParams:{"share-id":String(t[`share-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.resourceSharing.recipients.list({account_id:o,share_id:t[`share-id`],...n})),{successLabel:`Loaded`})}};function A(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,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)`})}const j={command:`update <share-id>`,describe:`Changes a share's recipients to match the given list. Returns an error if the share targets an organization.`,builder:A,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/recipients`,pathParams:{"share-id":String(t[`share-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.resourceSharing.recipients.update({body:e,account_id:r,share_id:t[`share-id`]})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},M={command:`recipients`,describe:`Operations for recipients`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`]}).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 P={command:`create <share-id>`,describe:`Adds a resource to an existing share, making it available to share recipients.`,builder:N,handler:async r=>{if(r.dryRun){l({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${r[`share-id`]==null?`<share-id>`:encodeURIComponent(String(r[`share-id`]))}/resources`,pathParams:{"share-id":String(r[`share-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({resource_account_id:d(r[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(r[`resource-id`],`resource-id`,`text`),resource_type:d(r[`resource-type`],`resource-type`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.resourceSharing.resources.create({body:e,account_id:m,share_id:r[`share-id`]})),{successLabel:`Created`});return}r[`resource-account-id`]===void 0&&(r[`resource-account-id`]=await t(`resource-account-id`,`Account identifier.`)),r[`resource-id`]===void 0&&(r[`resource-id`]=await t(`resource-id`,`Share Resource identifier.`)),r[`resource-type`]===void 0&&(r[`resource-type`]=await n(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`]));let h=s({resource_account_id:d(r[`resource-account-id`],`resource-account-id`,`text`),resource_id:d(r[`resource-id`],`resource-id`,`text`),resource_type:d(r[`resource-type`],`resource-type`,`text`)});c(await u(`Creating`,async()=>p.resourceSharing.resources.create({body:h,account_id:m,share_id:r[`share-id`]})),{successLabel:`Created`})}};function F(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share 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 I={command:`delete <share-resource-id>`,describe:`Deletion is not immediate, an updated share resource object with a new status will be returned.`,builder:F,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing resources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/resources/${t[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(t[`share-resource-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``),"share-resource-id":String(t[`share-resource-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}c(await u(`Deleting`,async()=>n.resourceSharing.resources.delete({account_id:o,share_id:t[`share-id`],share_resource_id:t[`share-resource-id`]})),{successLabel:`Deleted`})}};function L(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <share-resource-id>`,describe:`Get share resource by ID.`,builder:L,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/resources/${t[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(t[`share-resource-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``),"share-resource-id":String(t[`share-resource-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.resourceSharing.resources.get({account_id:r,share_id:t[`share-id`],share_resource_id:t[`share-resource-id`]})),{successLabel:`Loaded`})}};function z(e){return e.option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter share resources by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`resource-type`,{type:`string`,description:`Filter share resources by resource_type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List share resources by share ID.`,builder:p(z),handler:async t=>{let n={status:t.status,resource_type:t[`resource-type`],page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf resource-sharing resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/resources`,pathParams:{"share-id":String(t[`share-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.resourceSharing.resources.list({account_id:o,share_id:t[`share-id`],...n})),{successLabel:`Loaded`})}};function V(e){return e.positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,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)`})}const H={command:`update <share-resource-id>`,describe:`Update is not immediate, an updated share resource object with a new status will be returned.`,builder:V,handler:async t=>{if(t.dryRun){l({command:`cf resource-sharing resources update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${t[`share-id`]==null?`<share-id>`:encodeURIComponent(String(t[`share-id`]))}/resources/${t[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(t[`share-resource-id`]))}`,pathParams:{"share-id":String(t[`share-id`]??``),"share-resource-id":String(t[`share-resource-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.resourceSharing.resources.update({...e,account_id:r,share_id:t[`share-id`],share_resource_id:t[`share-resource-id`]})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},U={command:`resources`,describe:`Operations for resources`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`update <share-id>`,describe:`Updating is not immediate, an updated share object with a new status will be returned.`,builder:W,handler:async n=>{if(n.dryRun){l({command:`cf resource-sharing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/shares/${n[`share-id`]==null?`<share-id>`:encodeURIComponent(String(n[`share-id`]))}`,pathParams:{"share-id":String(n[`share-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({name:d(n.name,`name`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Updating`,async()=>r.resourceSharing.update({...e,account_id:p,share_id:n[`share-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await t(`name`,`The name of the share.`));let m=s({name:d(n.name,`name`,`text`)});c(await u(`Updating`,async()=>r.resourceSharing.update({...m,account_id:p,share_id:n[`share-id`]})),{successLabel:`Updated`})}},K={command:`resource-sharing`,describe:`resource-sharing`,builder:e=>e.command(h).command(_).command(y).command(x).command(G).command(M).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};