cf 0.5.0 → 0.7.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 (317) hide show
  1. package/dist/_meta/agent-context.json +78 -41
  2. package/dist/_meta/commands.json +19888 -21071
  3. package/dist/_meta/schemas.json +14305 -15328
  4. package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
  5. package/dist/account-D8mYiWxQ.mjs +2 -0
  6. package/dist/accounts-CJci1Oez.mjs +23 -0
  7. package/dist/acm-CmCd985Q.mjs +3 -0
  8. package/dist/addressing-R7p6TRBe.mjs +12 -0
  9. package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
  10. package/dist/ai-BzJg0RIX.mjs +3 -0
  11. package/dist/ai-audit-B0vJNOZG.mjs +2 -0
  12. package/dist/ai-gateway-D3vJR3My.mjs +10 -0
  13. package/dist/ai-search-CNg7W7U4.mjs +7 -0
  14. package/dist/alerting-_sdM0B0S.mjs +6 -0
  15. package/dist/alerts-dpT6Qsdu.mjs +2 -0
  16. package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
  17. package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
  18. package/dist/api-gateway-D4AIEtUq.mjs +33 -0
  19. package/dist/argo-Bjk6nFfs.mjs +2 -0
  20. package/dist/artifacts-Ba4b3iOa.mjs +4 -0
  21. package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
  22. package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
  23. package/dist/auth-D_zyQbDR.mjs +5 -0
  24. package/dist/autorag-Cnpp8PAG.mjs +2 -0
  25. package/dist/billing-Dz6Zj8Eq.mjs +2 -0
  26. package/dist/bot-management-pFwIbFi-.mjs +5 -0
  27. package/dist/botnet-feed-BY9uGChY.mjs +3 -0
  28. package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
  29. package/dist/brands-CGpk9nZB.mjs +2 -0
  30. package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
  31. package/dist/browser-run-DhHtz4y3.mjs +4 -0
  32. package/dist/build-CWuStmDi.mjs +2 -0
  33. package/dist/cache-DVhkiIGK.mjs +5 -0
  34. package/dist/calls-95zjvIcO.mjs +4 -0
  35. package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
  36. package/dist/cf-BLT7uKJF.mjs +18 -0
  37. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
  38. package/dist/clear-DXx8WBAN.mjs +2 -0
  39. package/dist/client-certificates-D6mE4vJu.mjs +3 -0
  40. package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
  41. package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
  42. package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
  43. package/dist/connectivity-DJkE3crz.mjs +3 -0
  44. package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
  45. package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
  46. package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
  47. package/dist/connectors-zWaZTi2A.mjs +3 -0
  48. package/dist/content-scanning-CGvGf04y.mjs +4 -0
  49. package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
  50. package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
  51. package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
  52. package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
  53. package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
  54. package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
  55. package/dist/d1-78Ym1P6D.mjs +4 -0
  56. package/dist/data-security-zmFoMwRU.mjs +6 -0
  57. package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
  58. package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
  59. package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
  60. package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
  61. package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
  62. package/dist/dist-B7hsuvbF.mjs +57 -0
  63. package/dist/dist-BH-4NQOV.mjs +134 -0
  64. package/dist/dns-D7VAaCyO.mjs +29 -0
  65. package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
  66. package/dist/domain-info-CRvKc2Lg.mjs +2 -0
  67. package/dist/durable-objects-BIpvyu9m.mjs +2 -0
  68. package/dist/email-auth-Cx--s8W4.mjs +2 -0
  69. package/dist/email-routing-CiDbivcN.mjs +10 -0
  70. package/dist/email-security-BYeAuSc6.mjs +12 -0
  71. package/dist/email-sending-Dg2rSmHH.mjs +4 -0
  72. package/dist/filters-DZ8YnQ90.mjs +4 -0
  73. package/dist/firewall-DEd1hs_I.mjs +11 -0
  74. package/dist/flagship-DVw7xGoP.mjs +4 -0
  75. package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
  76. package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
  77. package/dist/healthchecks-Da9N3ix4.mjs +4 -0
  78. package/dist/hostnames-mimZu2tB.mjs +3 -0
  79. package/dist/hyperdrive-BNdvxOos.mjs +21 -0
  80. package/dist/iam-DGQ-OgRl.mjs +6 -0
  81. package/dist/images-CI6Iy9ho.mjs +7 -0
  82. package/dist/index.mjs +1 -1
  83. package/dist/intel-BDB-aRtU.mjs +3 -0
  84. package/dist/internal-Czlp5Ekb.mjs +2 -0
  85. package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
  86. package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
  87. package/dist/kv-BHerx4dZ.mjs +5 -0
  88. package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
  89. package/dist/live-Ce7dZW7p.mjs +2 -0
  90. package/dist/load-balancers-DSjS5WKw.mjs +6 -0
  91. package/dist/logexplorer-DBIfTlRP.mjs +24 -0
  92. package/dist/logo-matches-C00iGpzW.mjs +2 -0
  93. package/dist/logos-CJLhx1go.mjs +3 -0
  94. package/dist/logpush-Cr1U-eK-.mjs +5 -0
  95. package/dist/logs-DMvtchc6.mjs +3 -0
  96. package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
  97. package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
  98. package/dist/magic-transit-DiKiPUax.mjs +110 -0
  99. package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
  100. package/dist/matches-B0yHbQ2I.mjs +2 -0
  101. package/dist/moq-UgBawOXe.mjs +13 -0
  102. package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
  103. package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
  104. package/dist/oauth-DBJ5GSFk.mjs +40 -0
  105. package/dist/observability-B-1y36QS.mjs +4 -0
  106. package/dist/organization-Dq3PClZ7.mjs +41 -0
  107. package/dist/organizations-AhsQkHyX.mjs +2 -0
  108. package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
  109. package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
  110. package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
  111. package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
  112. package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
  113. package/dist/pages-BsXF11Kv.mjs +11 -0
  114. package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
  115. package/dist/pipelines-D_QhSnGW.mjs +6 -0
  116. package/dist/progress-O88q63Bk.mjs +2 -0
  117. package/dist/prompt-DTAWiEm2.mjs +3 -0
  118. package/dist/queries-CAE95-OH.mjs +3 -0
  119. package/dist/queues-BBz35Mqd.mjs +6 -0
  120. package/dist/r2-Zp99S5xF.mjs +21 -0
  121. package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
  122. package/dist/radar-Cij-XVQJ.mjs +2 -0
  123. package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
  124. package/dist/rate-limits-DSdToIWv.mjs +5 -0
  125. package/dist/raw-fetch-DgezeshQ.mjs +2 -0
  126. package/dist/ready-DMpJvyaz.mjs +2 -0
  127. package/dist/realtime-kit-9rJcapfM.mjs +18 -0
  128. package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
  129. package/dist/refute-BGTpr5sy.mjs +2 -0
  130. package/dist/registrar-CXViZlah.mjs +83 -0
  131. package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
  132. package/dist/request-tracers-DATfBnE9.mjs +2 -0
  133. package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
  134. package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
  135. package/dist/resource-tagging-BTn05AOj.mjs +16 -0
  136. package/dist/rules-ens3OHme.mjs +4 -0
  137. package/dist/rulesets-bkreZRao.mjs +8 -0
  138. package/dist/rum-CpgXFcwl.mjs +4 -0
  139. package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
  140. package/dist/scan-page-BqoQTk3R.mjs +2 -0
  141. package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
  142. package/dist/schema-validation-Ca6o94ts.mjs +24 -0
  143. package/dist/scim-C4oT8TMc.mjs +4 -0
  144. package/dist/sdk-pQ5kaGUX.mjs +3 -0
  145. package/dist/search-C4T5riPh.mjs +2 -0
  146. package/dist/secrets-store-CWEuiDNo.mjs +7 -0
  147. package/dist/security-center-BOvm7xy6.mjs +2 -0
  148. package/dist/security-txt-BCAUBctN.mjs +3 -0
  149. package/dist/session-B1ARgLG7.mjs +2 -0
  150. package/dist/share-DhmVspmL.mjs +5 -0
  151. package/dist/shared-Bod3-Exx.mjs +990 -0
  152. package/dist/signed-url-DA509wgp.mjs +2 -0
  153. package/dist/smart-shield-DZm4fn6z.mjs +3 -0
  154. package/dist/snippets-oQ0u26-z.mjs +4 -0
  155. package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
  156. package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
  157. package/dist/speed-DqNnvLBD.mjs +4 -0
  158. package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
  159. package/dist/ssl-tS3CYZsZ.mjs +15 -0
  160. package/dist/state-OsdDJvdj.mjs +2 -0
  161. package/dist/stream-Bud9Os5V.mjs +14 -0
  162. package/dist/submission-info-DfIXmu-M.mjs +2 -0
  163. package/dist/submit-BtP8she2.mjs +2 -0
  164. package/dist/tenant-CMwHa-tU.mjs +2 -0
  165. package/dist/token-validation-BYC7HTok.mjs +10 -0
  166. package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
  167. package/dist/total-queries-DdLBNJzd.mjs +2 -0
  168. package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
  169. package/dist/turnstile-CP4nScaL.mjs +23 -0
  170. package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
  171. package/dist/url-info-Chs9h7Y-.mjs +2 -0
  172. package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
  173. package/dist/url-scanner-D4pYNlO-.mjs +2 -0
  174. package/dist/user-DtefniLc.mjs +11 -0
  175. package/dist/vectorize-BeAY2g-7.mjs +4 -0
  176. package/dist/verify-D7J3F_NZ.mjs +2 -0
  177. package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
  178. package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
  179. package/dist/web3-Dhw79l4S.mjs +4 -0
  180. package/dist/workers-builds-CuOAB3u4.mjs +7 -0
  181. package/dist/workers-l3zMNOU6.mjs +20 -0
  182. package/dist/workflows-rb7RYBKP.mjs +6 -0
  183. package/dist/zaraz-CHecMYuo.mjs +2 -0
  184. package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
  185. package/dist/zone-BnnqJwW-.mjs +2 -0
  186. package/dist/zones-DpI2YikF.mjs +21 -0
  187. package/package.json +3 -1
  188. package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
  189. package/dist/accounts-B_joQcMi.mjs +0 -22
  190. package/dist/acm-_kIHqYME.mjs +0 -3
  191. package/dist/addressing-CaFlw8y1.mjs +0 -12
  192. package/dist/ai-CqnhNb_c.mjs +0 -2
  193. package/dist/ai-gateway-pgYGI519.mjs +0 -8
  194. package/dist/ai-search-eqQMPQol.mjs +0 -7
  195. package/dist/ai_gateway--vuVLnOm.mjs +0 -4
  196. package/dist/alerting-CPxHiYHb.mjs +0 -6
  197. package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
  198. package/dist/api-gateway-BXXGFCVR.mjs +0 -33
  199. package/dist/argo-aC6A3JyX.mjs +0 -2
  200. package/dist/artifacts-HD4V2xpK.mjs +0 -4
  201. package/dist/auth-D5hNsOFq.mjs +0 -5
  202. package/dist/billing-COaghyxl.mjs +0 -2
  203. package/dist/bot-management-DmEzeV1Y.mjs +0 -5
  204. package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
  205. package/dist/brand-protection-dPrGe8sL.mjs +0 -3
  206. package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
  207. package/dist/build-HuS9-R0V.mjs +0 -1054
  208. package/dist/cache-CY-7Lt71.mjs +0 -5
  209. package/dist/calls-wOQGDWPl.mjs +0 -4
  210. package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
  211. package/dist/client-certificates-CRf41xLe.mjs +0 -3
  212. package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
  213. package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
  214. package/dist/config-B5k-XbwS.mjs +0 -2
  215. package/dist/connectivity-Bx3MgTHX.mjs +0 -3
  216. package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
  217. package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
  218. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
  219. package/dist/connectors-DRt4e6d_.mjs +0 -3
  220. package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
  221. package/dist/context-jpewmual.mjs +0 -2
  222. package/dist/custom-certificates-DYE-9epx.mjs +0 -5
  223. package/dist/custom-hostnames-CtuTdFcX.mjs +0 -5
  224. package/dist/custom-nameservers-CWqA51in.mjs +0 -3
  225. package/dist/custom-pages-DeUKEFGe.mjs +0 -4
  226. package/dist/d1-DvWY9Gp4.mjs +0 -4
  227. package/dist/data-security-BPo6dIWu.mjs +0 -6
  228. package/dist/diagnostics-6nKPmVgz.mjs +0 -3
  229. package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
  230. package/dist/dist-C6zxsVdY.mjs +0 -306
  231. package/dist/dist-t_YrL25p.mjs +0 -82
  232. package/dist/dns-ClciFGxx.mjs +0 -29
  233. package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
  234. package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
  235. package/dist/email-routing-CGXhFqF5.mjs +0 -10
  236. package/dist/email-security-D5viPq8S.mjs +0 -8
  237. package/dist/email-sending-C2jpc3gh.mjs +0 -3
  238. package/dist/filters-bzsFcWt0.mjs +0 -4
  239. package/dist/firewall-DYZcTtIC.mjs +0 -11
  240. package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
  241. package/dist/healthchecks-DRoAlWgr.mjs +0 -4
  242. package/dist/hostnames-CFgIVI3s.mjs +0 -3
  243. package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
  244. package/dist/iam-DqVPzGrb.mjs +0 -6
  245. package/dist/images-BYfl4YgR.mjs +0 -7
  246. package/dist/intel-duTEPIHc.mjs +0 -3
  247. package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
  248. package/dist/kv-CZoV4tiv.mjs +0 -5
  249. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
  250. package/dist/load-balancers--OMg0HNt.mjs +0 -6
  251. package/dist/logpush-C0_lZTyY.mjs +0 -4
  252. package/dist/logs-BtpWZQfV.mjs +0 -3
  253. package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
  254. package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
  255. package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
  256. package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
  257. package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
  258. package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
  259. package/dist/oauth-Bk-F-tIO.mjs +0 -52
  260. package/dist/observability-BynRbTF4.mjs +0 -4
  261. package/dist/organizations-BqJHyvMK.mjs +0 -41
  262. package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
  263. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
  264. package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
  265. package/dist/pages-D4aYteKk.mjs +0 -11
  266. package/dist/pipelines-G8Iusxq-.mjs +0 -6
  267. package/dist/progress-DrDErV9w.mjs +0 -2
  268. package/dist/queues-DEkbKqZX.mjs +0 -6
  269. package/dist/r2-CV0IkCAW.mjs +0 -21
  270. package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
  271. package/dist/radar-D986zPJr.mjs +0 -2
  272. package/dist/rate-limits-B2wRsUX1.mjs +0 -5
  273. package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
  274. package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
  275. package/dist/registrar-CDIwTz3G.mjs +0 -46
  276. package/dist/request-tracers-D7SFMDik.mjs +0 -2
  277. package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
  278. package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
  279. package/dist/rules-DHjLP5Kx.mjs +0 -4
  280. package/dist/rulesets-q4QABpKs.mjs +0 -8
  281. package/dist/rum-SmT4HZmM.mjs +0 -4
  282. package/dist/schema-validation-vVetgC_P.mjs +0 -24
  283. package/dist/scim-ChOkZpNx.mjs +0 -3
  284. package/dist/sdk-DhIhH6GB.mjs +0 -5
  285. package/dist/secrets-store-BAK9G12O.mjs +0 -25
  286. package/dist/security-center-eScuYDKP.mjs +0 -2
  287. package/dist/security-txt-x7R4gmQu.mjs +0 -3
  288. package/dist/session-DHYCE-PM.mjs +0 -93
  289. package/dist/shared-BAjo72Lz.mjs +0 -2
  290. package/dist/smart-shield-CWlSsNi8.mjs +0 -3
  291. package/dist/snippets-DrlgYJYp.mjs +0 -4
  292. package/dist/speed-ZFrMWDgd.mjs +0 -4
  293. package/dist/ssl-9JY05sYt.mjs +0 -15
  294. package/dist/stream-tRU39b8K.mjs +0 -14
  295. package/dist/tenants-HLGUazms.mjs +0 -2
  296. package/dist/token-validation-_VdamKpz.mjs +0 -10
  297. package/dist/turnstile-BRzXd28B.mjs +0 -23
  298. package/dist/url-normalization-D-NxuLtN.mjs +0 -3
  299. package/dist/url-scanner-BzzR6iDx.mjs +0 -2
  300. package/dist/user-C4omq__w.mjs +0 -10
  301. package/dist/vectorize-By6EqcNR.mjs +0 -4
  302. package/dist/waiting-rooms-u6KwrzWd.mjs +0 -11
  303. package/dist/web3-DQ5dmE9W.mjs +0 -4
  304. package/dist/workers-D8Be7_as.mjs +0 -18
  305. package/dist/workers-builds-BE3W3qNk.mjs +0 -7
  306. package/dist/workflows-BWWufqFA.mjs +0 -4
  307. package/dist/zaraz-Bsa9AvVL.mjs +0 -2
  308. package/dist/zero-trust-UNVZFnKu.mjs +0 -118
  309. package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
  310. package/dist/zones-BXtdwt6E.mjs +0 -21
  311. /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
  312. /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
  313. /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
  314. /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
  315. /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
  316. /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
  317. /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{w as e,x as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-DrDErV9w.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";function l(e){return e.option(`match-request-methods`,{type:`string`,array:!0,description:"The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit."}).option(`match-request-schemes`,{type:`string`,array:!0,description:"The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional."}).option(`match-request-url`,{type:`string`,description:"The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone."}).option(`match-response-origin-traffic`,{type:`boolean`,description:`When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional.
3
- Notes: This field is deprecated. Instead, use response headers and set "origin_traffic" to "false" to avoid legacy behaviour interacting with the "response_headers" property.`}).option(`period`,{type:`number`,description:`The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.`}).option(`threshold`,{type:`number`,description:"The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const u={command:`create`,describe:`Creates a new rate limit for a zone. Refer to the object definition for a list of required attributes.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf rate-limits create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rate_limits`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({match:{request:{methods:e[`match-request-methods`],schemes:e[`match-request-schemes`],url:c(e[`match-request-url`],`match-request-url`,`text`)},response:{origin_traffic:e[`match-response-origin-traffic`]}},period:e.period,threshold:e.threshold}):r(e.body)});return}let l=await n(e),u=await t({zone:e.zone},l,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=r(e.body);a(await s(`Creating`,async()=>l.rateLimits.create({...t,zone_id:u})),{successLabel:`Created`});return}if(e.period===void 0)throw Error(`--period is required (or pass --body with this field set).`);if(e.threshold===void 0)throw Error(`--threshold is required (or pass --body with this field set).`);let d=i({match:{request:{methods:e[`match-request-methods`],schemes:e[`match-request-schemes`],url:c(e[`match-request-url`],`match-request-url`,`text`)},response:{origin_traffic:e[`match-response-origin-traffic`]}},period:e.period,threshold:e.threshold});a(await s(`Creating`,async()=>l.rateLimits.create({...d,zone_id:u})),{successLabel:`Created`})}};function d(e){return e.positional(`rate-limit-id`,{type:`string`,description:`Defines the unique identifier of the rate limit.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <rate-limit-id>`,describe:`Deletes an existing rate limit.`,builder:d,handler:async r=>{if(r.dryRun){o({command:`cf rate-limits delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/rate_limits/${r[`rate-limit-id`]==null?`<rate-limit-id>`:encodeURIComponent(String(r[`rate-limit-id`]))}`,pathParams:{"rate-limit-id":String(r[`rate-limit-id`]??``),"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=await t({zone:r.zone},i,{quiet:r.quiet});if(r.zoneId=c,!await e({force:!!r.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>i.rateLimits.delete({zone_id:c,rate_limit_id:r[`rate-limit-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`rate-limit-id`,{type:`string`,description:`Defines the unique identifier of the rate limit.`,demandOption:!0}).option(`match-request-methods`,{type:`string`,array:!0,description:"The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit."}).option(`match-request-schemes`,{type:`string`,array:!0,description:"The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional."}).option(`match-request-url`,{type:`string`,description:"The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone."}).option(`match-response-origin-traffic`,{type:`boolean`,description:`When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional.
5
- Notes: This field is deprecated. Instead, use response headers and set "origin_traffic" to "false" to avoid legacy behaviour interacting with the "response_headers" property.`}).option(`period`,{type:`number`,description:`The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.`}).option(`threshold`,{type:`number`,description:"The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period."}).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 m={command:`edit <rate-limit-id>`,describe:`Updates an existing rate limit.`,builder:p,handler:async e=>{if(e.dryRun){o({command:`cf rate-limits edit`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rate_limits/${e[`rate-limit-id`]==null?`<rate-limit-id>`:encodeURIComponent(String(e[`rate-limit-id`]))}`,pathParams:{"rate-limit-id":String(e[`rate-limit-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({match:{request:{methods:e[`match-request-methods`],schemes:e[`match-request-schemes`],url:c(e[`match-request-url`],`match-request-url`,`text`)},response:{origin_traffic:e[`match-response-origin-traffic`]}},period:e.period,threshold:e.threshold}):r(e.body)});return}let l=await n(e),u=await t({zone:e.zone},l,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=r(e.body);a(await s(`Updating`,async()=>l.rateLimits.edit({...t,zone_id:u,rate_limit_id:e[`rate-limit-id`]})),{successLabel:`Updated`});return}if(e.period===void 0)throw Error(`--period is required (or pass --body with this field set).`);if(e.threshold===void 0)throw Error(`--threshold is required (or pass --body with this field set).`);let d=i({match:{request:{methods:e[`match-request-methods`],schemes:e[`match-request-schemes`],url:c(e[`match-request-url`],`match-request-url`,`text`)},response:{origin_traffic:e[`match-response-origin-traffic`]}},period:e.period,threshold:e.threshold});a(await s(`Updating`,async()=>l.rateLimits.edit({...d,zone_id:u,rate_limit_id:e[`rate-limit-id`]})),{successLabel:`Updated`})}};function h(e){return e.positional(`rate-limit-id`,{type:`string`,description:`Defines the unique identifier of the rate limit.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <rate-limit-id>`,describe:`Fetches the details of a rate limit.`,builder:h,handler:async e=>{if(e.dryRun){o({command:`cf rate-limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rate_limits/${e[`rate-limit-id`]==null?`<rate-limit-id>`:encodeURIComponent(String(e[`rate-limit-id`]))}`,pathParams:{"rate-limit-id":String(e[`rate-limit-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.rateLimits.get({zone_id:i,rate_limit_id:e[`rate-limit-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`page`,{type:`number`,description:`Defines the page number of paginated results.`}).option(`per-page`,{type:`number`,description:"Defines the maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Fetches the rate limits for a zone.`,builder:_,handler:async e=>{let r={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf rate-limits list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/rate_limits`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:r,bodyKind:`none`});return}let i=await n(e),c=await t({zone:e.zone},i,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>i.rateLimits.list({zone_id:c,...r})),{successLabel:`Loaded`})}},y={command:`rate-limits`,describe:`Legacy per-zone rate limiting rules — prefer Advanced Rate Limiting in Rulesets for new configurations`,builder:e=>e.command(u).command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./sdk-DhIhH6GB.mjs";import{g as t}from"./dist-C6zxsVdY.mjs";import{_ as n}from"./oauth-Bk-F-tIO.mjs";import{a as r,r as i}from"./auth-CSC4yhEJ.mjs";import{n as a}from"./local-CYc9q7l2.mjs";async function o(o,s={}){let{method:c=`GET`,localEndpoint:l}=s,u=`${t({compliance_region:n()})}${o}`,d={...r()};s.headers&&Object.assign(d,s.headers);let f=globalThis.fetch;l===void 0?d.Authorization=`Bearer ${await i()}`:f=a({endpoint:l});let p,m=s.body;m!=null&&(m instanceof FormData?p=m:Buffer.isBuffer(m)||m instanceof Uint8Array||m instanceof ArrayBuffer?(p=m,d[`Content-Type`]??=s.contentType??`application/octet-stream`):typeof m==`string`?(p=m,s.contentType&&(d[`Content-Type`]??=s.contentType)):(p=JSON.stringify(m),d[`Content-Type`]??=s.contentType??`application/json`));let h=await f(u,{method:c,headers:d,...p===void 0?{}:{body:p}});if(!h.ok){let t=h.headers.get(`content-type`)??``,n;try{n=t.includes(`application/json`)?await h.json():await h.text()}catch{n=null}throw new e({statusCode:h.status,body:n,rawResponse:{status:h.status,statusText:h.statusText,url:h.url||u,headers:h.headers,redirected:h.redirected,type:h.type}})}let g=await h.arrayBuffer();return Buffer.from(g)}function s(e){process.stdout.write(e)}export{s as n,o as t};
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.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 e(`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()=>i.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 e=>{if(e.dryRun){l({command:`cf realtime-kit active-session get-active-session`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-session`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.activeSession.getActiveSession({account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit active-session kick-all-participants`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-session/kick-all`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Creating`,async()=>n.realtimeKit.activeSession.kickAllParticipants({account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit active-session kick-participants`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-session/kick`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({custom_participant_ids:e[`custom-participant-ids`],participant_ids:e[`participant-ids`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.realtimeKit.activeSession.kickParticipants({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`]})),{successLabel:`Created`});return}if(e[`custom-participant-ids`]===void 0)throw Error(`--custom-participant-ids is required (or pass --body with this field set).`);if(e[`participant-ids`]===void 0)throw Error(`--participant-ids is required (or pass --body with this field set).`);let d=s({custom_participant_ids:e[`custom-participant-ids`],participant_ids:e[`participant-ids`]});c(await u(`Creating`,async()=>n.realtimeKit.activeSession.kickParticipants({...d,account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{let n={start_date:e[`start-date`],end_date:e[`end-date`]};if(e.dryRun){l({command:`cf realtime-kit analytics get-org-analytics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/analytics/daywise`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.analytics.getOrgAnalytics({account_id:o,app_id:e[`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 e=>{let n={page_no:e[`page-no`],per_page:e[`per-page`],search:e.search,sort_order:e[`sort-order`]};if(e.dryRun){l({command:`cf realtime-kit apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/apps`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.realtimeKit.apps.post({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await e(`name`,`The name field`));let m=s({name:d(n.name,`name`,`text`)});c(await u(`Creating`,async()=>i.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 e=>{if(e.dryRun){l({command:`cf realtime-kit kit meetings active-session mute-all create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-session/mute-all`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({allow_unmute:e[`allow-unmute`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.muteAll.create({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`]})),{successLabel:`Created`});return}if(e[`allow-unmute`]===void 0)throw Error(`--allow-unmute is required (or pass --body with this field set).`);let d=s({allow_unmute:e[`allow-unmute`]});c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.muteAll.create({...d,account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit kit meetings active-session mute create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-session/mute`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({custom_participant_ids:e[`custom-participant-ids`],participant_ids:e[`participant-ids`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.mute.create({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`]})),{successLabel:`Created`});return}if(e[`custom-participant-ids`]===void 0)throw Error(`--custom-participant-ids is required (or pass --body with this field set).`);if(e[`participant-ids`]===void 0)throw Error(`--participant-ids is required (or pass --body with this field set).`);let d=s({custom_participant_ids:e[`custom-participant-ids`],participant_ids:e[`participant-ids`]});c(await u(`Creating`,async()=>n.realtimeKit.kit.meetings.activeSession.mute.create({...d,account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{let n={page_no:e[`page-no`],per_page:e[`per-page`]};if(e.dryRun){l({command:`cf realtime-kit kit meetings livestream get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/livestream`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.kit.meetings.livestream.get({account_id:o,app_id:e[`app-id`],meeting_id:e[`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 e=>{let n={per_page:e[`per-page`],page_no:e[`page-no`]};if(e.dryRun){l({command:`cf realtime-kit kit sessions livestream sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/livestream-sessions`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.kit.sessions.livestream.sessions.get({account_id:o,app_id:e[`app-id`],session_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit livestreams get-active-livestreams-for-livestream-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/livestreams/${e[`livestream-id`]==null?`<livestream-id>`:encodeURIComponent(String(e[`livestream-id`]))}/active-livestream-session`,pathParams:{"app-id":String(e[`app-id`]??``),"livestream-id":String(e[`livestream-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.livestreams.getActiveLivestreamsForLivestreamId({account_id:i,app_id:e[`app-id`],livestream_id:e[`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 e=>{let n={exclude_meetings:e[`exclude-meetings`],per_page:e[`per-page`],page_no:e[`page-no`],status:e.status,start_time:e[`start-time`],end_time:e[`end-time`],sort_order:e[`sort-order`]};if(e.dryRun){l({command:`cf realtime-kit livestreams get-all-livestreams`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/livestreams`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.livestreams.getAllLivestreams({account_id:o,app_id:e[`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 e=>{let n={start_time:e[`start-time`],end_time:e[`end-time`],filters:e.filters};if(e.dryRun){l({command:`cf realtime-kit livestreams get-livestream-analytics-complete`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/analytics/livestreams/overall`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.livestreams.getLivestreamAnalyticsComplete({account_id:o,app_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit livestreams get-livestream-session-details-for-session-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/livestreams/sessions/${e[`livestream-session-id`]==null?`<livestream-session-id>`:encodeURIComponent(String(e[`livestream-session-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"livestream-session-id":String(e[`livestream-session-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.livestreams.getLivestreamSessionDetailsForSessionId({account_id:i,app_id:e[`app-id`],"livestream-session-id":e[`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 e=>{let n={page_no:e[`page-no`],per_page:e[`per-page`]};if(e.dryRun){l({command:`cf realtime-kit livestreams get-livestream-session-for-livestream-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/livestreams/${e[`livestream-id`]==null?`<livestream-id>`:encodeURIComponent(String(e[`livestream-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"livestream-id":String(e[`livestream-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.livestreams.getLivestreamSessionForLivestreamId({account_id:o,app_id:e[`app-id`],livestream_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit livestreams get-meeting-active-livestreams`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-livestream`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.livestreams.getMeetingActiveLivestreams({account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit livestreams start-livestreaming-a-meeting`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/livestreams`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`),video_config:{height:e[`video-config-height`],width:e[`video-config-width`]}}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.realtimeKit.livestreams.startLivestreamingAMeeting({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`]})),{successLabel:`Created`});return}let p=s({name:d(e.name,`name`,`text`),video_config:{height:e[`video-config-height`],width:e[`video-config-width`]}});c(await u(`Creating`,async()=>n.realtimeKit.livestreams.startLivestreamingAMeeting({...p,account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit livestreams stop-livestreaming-a-meeting`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/active-livestream/stop`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.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:e[`app-id`],meeting_id:e[`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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.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 e(`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 e(`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()=>i.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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({ai_config:{summarization:{summary_type:d(e[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(e[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:e[`ai-config-summarization-word-limit`]},transcription:{keywords:e[`ai-config-transcription-keywords`],language:d(e[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:e[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:e[`live-stream-on-start`],persist_chat:e[`persist-chat`],record_on_start:e[`record-on-start`],recording_config:{audio_config:{channel:d(e[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(e[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:e[`recording-config-audio-config-export-file`]},file_name_prefix:d(e[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(e[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:e[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:e[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(e[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(e[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(e[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(e[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(e[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(e[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:e[`recording-config-storage-config-port`],private_key:d(e[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(e[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(e[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(e[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(e[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(e[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:e[`recording-config-video-config-export-file`],height:e[`recording-config-video-config-height`],watermark:{position:d(e[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(e[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:e[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:e[`session-keep-alive-time-in-secs`],summarize_on_end:e[`summarize-on-end`],title:d(e.title,`title`,`text`),transcribe_on_end:e[`transcribe-on-end`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.realtimeKit.meetings.create({...t,account_id:i,app_id:e[`app-id`]})),{successLabel:`Created`});return}let p=s({ai_config:{summarization:{summary_type:d(e[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(e[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:e[`ai-config-summarization-word-limit`]},transcription:{keywords:e[`ai-config-transcription-keywords`],language:d(e[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:e[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:e[`live-stream-on-start`],persist_chat:e[`persist-chat`],record_on_start:e[`record-on-start`],recording_config:{audio_config:{channel:d(e[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(e[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:e[`recording-config-audio-config-export-file`]},file_name_prefix:d(e[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(e[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:e[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:e[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(e[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(e[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(e[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(e[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(e[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(e[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:e[`recording-config-storage-config-port`],private_key:d(e[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(e[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(e[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(e[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(e[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(e[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:e[`recording-config-video-config-export-file`],height:e[`recording-config-video-config-height`],watermark:{position:d(e[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(e[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:e[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:e[`session-keep-alive-time-in-secs`],summarize_on_end:e[`summarize-on-end`],title:d(e.title,`title`,`text`),transcribe_on_end:e[`transcribe-on-end`]});c(await u(`Creating`,async()=>n.realtimeKit.meetings.create({...p,account_id:i,app_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings delete-meeting-participant`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/participants/${e[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(e[`participant-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``),"participant-id":String(e[`participant-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
7
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.meetings.deleteMeetingParticipant({account_id:o,app_id:e[`app-id`],meeting_id:e[`meeting-id`],participant_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings edit-participant`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/participants/${e[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(e[`participant-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``),"participant-id":String(e[`participant-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`),picture:d(e.picture,`picture`,`text`),preset_name:d(e[`preset-name`],`preset-name`,`text`)}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.realtimeKit.meetings.editParticipant({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`],participant_id:e[`participant-id`]})),{successLabel:`Updated`});return}let p=s({name:d(e.name,`name`,`text`),picture:d(e.picture,`picture`,`text`),preset_name:d(e[`preset-name`],`preset-name`,`text`)});c(await u(`Updating`,async()=>n.realtimeKit.meetings.editParticipant({...p,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`],participant_id:e[`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 e=>{let n={name:e.name};if(e.dryRun){l({command:`cf realtime-kit meetings get-meeting-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.meetings.getMeetingById({account_id:o,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings get-meeting-participant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/participants/${e[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(e[`participant-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``),"participant-id":String(e[`participant-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.meetings.getMeetingParticipant({account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`],participant_id:e[`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 e=>{let n={page_no:e[`page-no`],per_page:e[`per-page`]};if(e.dryRun){l({command:`cf realtime-kit meetings get-meeting-participants`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/participants`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.meetings.getMeetingParticipants({account_id:o,app_id:e[`app-id`],meeting_id:e[`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 e=>{let n={page_no:e[`page-no`],per_page:e[`per-page`],start_time:e[`start-time`],end_time:e[`end-time`],search:e.search,status:e.status};if(e.dryRun){l({command:`cf realtime-kit meetings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.meetings.get({account_id:o,app_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings refresh-participant-token`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}/participants/${e[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(e[`participant-id`]))}/token`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``),"participant-id":String(e[`participant-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Creating`,async()=>n.realtimeKit.meetings.refreshParticipantToken({account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`],participant_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings replace-meeting-by-id`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({ai_config:{summarization:{summary_type:d(e[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(e[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:e[`ai-config-summarization-word-limit`]},transcription:{keywords:e[`ai-config-transcription-keywords`],language:d(e[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:e[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:e[`live-stream-on-start`],persist_chat:e[`persist-chat`],record_on_start:e[`record-on-start`],recording_config:{audio_config:{channel:d(e[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(e[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:e[`recording-config-audio-config-export-file`]},file_name_prefix:d(e[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(e[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:e[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:e[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(e[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(e[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(e[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(e[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(e[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(e[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:e[`recording-config-storage-config-port`],private_key:d(e[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(e[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(e[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(e[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(e[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(e[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:e[`recording-config-video-config-export-file`],height:e[`recording-config-video-config-height`],watermark:{position:d(e[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(e[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:e[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:e[`session-keep-alive-time-in-secs`],summarize_on_end:e[`summarize-on-end`],title:d(e.title,`title`,`text`),transcribe_on_end:e[`transcribe-on-end`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.realtimeKit.meetings.replaceMeetingById({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`]})),{successLabel:`Updated`});return}let p=s({ai_config:{summarization:{summary_type:d(e[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(e[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:e[`ai-config-summarization-word-limit`]},transcription:{keywords:e[`ai-config-transcription-keywords`],language:d(e[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:e[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:e[`live-stream-on-start`],persist_chat:e[`persist-chat`],record_on_start:e[`record-on-start`],recording_config:{audio_config:{channel:d(e[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(e[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:e[`recording-config-audio-config-export-file`]},file_name_prefix:d(e[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(e[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:e[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:e[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(e[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(e[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(e[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(e[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(e[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(e[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:e[`recording-config-storage-config-port`],private_key:d(e[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(e[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(e[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(e[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(e[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(e[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:e[`recording-config-video-config-export-file`],height:e[`recording-config-video-config-height`],watermark:{position:d(e[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(e[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:e[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:e[`session-keep-alive-time-in-secs`],summarize_on_end:e[`summarize-on-end`],title:d(e.title,`title`,`text`),transcribe_on_end:e[`transcribe-on-end`]});c(await u(`Updating`,async()=>n.realtimeKit.meetings.replaceMeetingById({...p,account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit meetings update-meeting-by-id`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/meetings/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({ai_config:{summarization:{summary_type:d(e[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(e[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:e[`ai-config-summarization-word-limit`]},transcription:{keywords:e[`ai-config-transcription-keywords`],language:d(e[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:e[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:e[`live-stream-on-start`],persist_chat:e[`persist-chat`],record_on_start:e[`record-on-start`],recording_config:{audio_config:{channel:d(e[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(e[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:e[`recording-config-audio-config-export-file`]},file_name_prefix:d(e[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(e[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:e[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:e[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(e[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(e[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(e[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(e[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(e[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(e[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:e[`recording-config-storage-config-port`],private_key:d(e[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(e[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(e[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(e[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(e[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(e[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:e[`recording-config-video-config-export-file`],height:e[`recording-config-video-config-height`],watermark:{position:d(e[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(e[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:e[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:e[`session-keep-alive-time-in-secs`],status:d(e.status,`status`,`text`),summarize_on_end:e[`summarize-on-end`],title:d(e.title,`title`,`text`),transcribe_on_end:e[`transcribe-on-end`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.realtimeKit.meetings.updateMeetingById({...t,account_id:i,app_id:e[`app-id`],meeting_id:e[`meeting-id`]})),{successLabel:`Updated`});return}let p=s({ai_config:{summarization:{summary_type:d(e[`ai-config-summarization-summary-type`],`ai-config-summarization-summary-type`,`text`),text_format:d(e[`ai-config-summarization-text-format`],`ai-config-summarization-text-format`,`text`),word_limit:e[`ai-config-summarization-word-limit`]},transcription:{keywords:e[`ai-config-transcription-keywords`],language:d(e[`ai-config-transcription-language`],`ai-config-transcription-language`,`text`),profanity_filter:e[`ai-config-transcription-profanity-filter`]}},live_stream_on_start:e[`live-stream-on-start`],persist_chat:e[`persist-chat`],record_on_start:e[`record-on-start`],recording_config:{audio_config:{channel:d(e[`recording-config-audio-config-channel`],`recording-config-audio-config-channel`,`text`),codec:d(e[`recording-config-audio-config-codec`],`recording-config-audio-config-codec`,`text`),export_file:e[`recording-config-audio-config-export-file`]},file_name_prefix:d(e[`recording-config-file-name-prefix`],`recording-config-file-name-prefix`,`text`),live_streaming_config:{rtmp_url:d(e[`recording-config-live-streaming-config-rtmp-url`],`recording-config-live-streaming-config-rtmp-url`,`text`)},max_seconds:e[`recording-config-max-seconds`],realtimekit_bucket_config:{enabled:e[`recording-config-realtimekit-bucket-config-enabled`]},storage_config:{access_key:d(e[`recording-config-storage-config-access-key`],`recording-config-storage-config-access-key`,`text`),auth_method:d(e[`recording-config-storage-config-auth-method`],`recording-config-storage-config-auth-method`,`text`),bucket:d(e[`recording-config-storage-config-bucket`],`recording-config-storage-config-bucket`,`text`),host:d(e[`recording-config-storage-config-host`],`recording-config-storage-config-host`,`text`),password:d(e[`recording-config-storage-config-password`],`recording-config-storage-config-password`,`text`),path:d(e[`recording-config-storage-config-path`],`recording-config-storage-config-path`,`text`),port:e[`recording-config-storage-config-port`],private_key:d(e[`recording-config-storage-config-private-key`],`recording-config-storage-config-private-key`,`text`),region:d(e[`recording-config-storage-config-region`],`recording-config-storage-config-region`,`text`),secret:d(e[`recording-config-storage-config-secret`],`recording-config-storage-config-secret`,`text`),type:d(e[`recording-config-storage-config-type`],`recording-config-storage-config-type`,`text`),username:d(e[`recording-config-storage-config-username`],`recording-config-storage-config-username`,`text`)},video_config:{codec:d(e[`recording-config-video-config-codec`],`recording-config-video-config-codec`,`text`),export_file:e[`recording-config-video-config-export-file`],height:e[`recording-config-video-config-height`],watermark:{position:d(e[`recording-config-video-config-watermark-position`],`recording-config-video-config-watermark-position`,`text`),url:d(e[`recording-config-video-config-watermark-url`],`recording-config-video-config-watermark-url`,`text`)},width:e[`recording-config-video-config-width`]}},session_keep_alive_time_in_secs:e[`session-keep-alive-time-in-secs`],status:d(e.status,`status`,`text`),summarize_on_end:e[`summarize-on-end`],title:d(e.title,`title`,`text`),transcribe_on_end:e[`transcribe-on-end`]});c(await u(`Updating`,async()=>n.realtimeKit.meetings.updateMeetingById({...p,account_id:i,app_id:e[`app-id`],meeting_id:e[`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 i=>{if(i.dryRun){l({command:`cf realtime-kit presets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/presets`,pathParams:{"app-id":String(i[`app-id`]??``)},bodyKind:`json`,body:i.body===void 0?s({config:{livestream_viewer_qualities:i[`config-livestream-viewer-qualities`],max_screenshare_count:i[`config-max-screenshare-count`],max_video_streams:{desktop:i[`config-max-video-streams-desktop`],mobile:i[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:i[`config-media-audio-enable-high-bitrate`],enable_stereo:i[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:i[`config-media-screenshare-frame-rate`],quality:d(i[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:i[`config-media-video-frame-rate`],quality:d(i[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:i[`config-media-video-simulcast`]}},view_type:d(i[`config-view-type`],`config-view-type`,`text`)},name:d(i.name,`name`,`text`),permissions:{accept_stage_requests:i[`permissions-accept-stage-requests`],accept_waiting_requests:i[`permissions-accept-waiting-requests`],can_accept_production_requests:i[`permissions-can-accept-production-requests`],can_change_participant_permissions:i[`permissions-can-change-participant-permissions`],can_edit_display_name:i[`permissions-can-edit-display-name`],can_livestream:i[`permissions-can-livestream`],can_record:i[`permissions-can-record`],can_spotlight:i[`permissions-can-spotlight`],chat:{private:{can_receive:i[`permissions-chat-private-can-receive`],can_send:i[`permissions-chat-private-can-send`],files:i[`permissions-chat-private-files`],text:i[`permissions-chat-private-text`]},public:{can_send:i[`permissions-chat-public-can-send`],files:i[`permissions-chat-public-files`],text:i[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:i[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:i[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:i[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:i[`permissions-disable-participant-audio`],disable_participant_screensharing:i[`permissions-disable-participant-screensharing`],disable_participant_video:i[`permissions-disable-participant-video`],hidden_participant:i[`permissions-hidden-participant`],is_recorder:i[`permissions-is-recorder`],kick_participant:i[`permissions-kick-participant`],media:{audio:{can_produce:d(i[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(i[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(i[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:i[`permissions-pin-participant`],plugins:{can_close:i[`permissions-plugins-can-close`],can_edit_config:i[`permissions-plugins-can-edit-config`],can_start:i[`permissions-plugins-can-start`]},polls:{can_create:i[`permissions-polls-can-create`],can_view:i[`permissions-polls-can-view`],can_vote:i[`permissions-polls-can-vote`]},recorder_type:d(i[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:i[`permissions-show-participant-list`],stage_access:d(i[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:i[`permissions-stage-enabled`],transcription_enabled:i[`permissions-transcription-enabled`],waiting_room_type:d(i[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(i[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(i[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(i[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(i[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(i[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(i[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(i[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(i[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(i[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(i[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(i[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:i[`ui-design-tokens-spacing-base`],theme:d(i[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.realtimeKit.presets.create({body:e,account_id:m,app_id:i[`app-id`]})),{successLabel:`Created`});return}if(i[`config-max-screenshare-count`]===void 0)throw Error(`--config-max-screenshare-count is required (or pass --body with this field set).`);if(i[`config-max-video-streams-desktop`]===void 0)throw Error(`--config-max-video-streams-desktop is required (or pass --body with this field set).`);if(i[`config-max-video-streams-mobile`]===void 0)throw Error(`--config-max-video-streams-mobile is required (or pass --body with this field set).`);if(i[`config-media-screenshare-frame-rate`]===void 0)throw Error(`--config-media-screenshare-frame-rate is required (or pass --body with this field set).`);if(i[`config-media-screenshare-quality`]===void 0&&(i[`config-media-screenshare-quality`]=await n(`config-media-screenshare-quality`,`Quality of screen share `,[`hd`,`vga`,`qvga`,`fhd`,`uhd`])),i[`config-media-video-frame-rate`]===void 0)throw Error(`--config-media-video-frame-rate is required (or pass --body with this field set).`);if(i[`config-media-video-quality`]===void 0&&(i[`config-media-video-quality`]=await n(`config-media-video-quality`,`Video quality of participants`,[`hd`,`vga`,`qvga`,`fhd`,`uhd`])),i[`config-view-type`]===void 0&&(i[`config-view-type`]=await n(`config-view-type`,`Type of the meeting`,[`GROUP_CALL`,`WEBINAR`,`AUDIO_ROOM`,`LIVESTREAM`])),i.name===void 0&&(i.name=await e(`name`,`Name of the preset`)),i[`permissions-accept-waiting-requests`]===void 0)throw Error(`--permissions-accept-waiting-requests is required (or pass --body with this field set).`);if(i[`permissions-can-accept-production-requests`]===void 0)throw Error(`--permissions-can-accept-production-requests is required (or pass --body with this field set).`);if(i[`permissions-can-change-participant-permissions`]===void 0)throw Error(`--permissions-can-change-participant-permissions is required (or pass --body with this field set).`);if(i[`permissions-can-edit-display-name`]===void 0)throw Error(`--permissions-can-edit-display-name is required (or pass --body with this field set).`);if(i[`permissions-can-livestream`]===void 0)throw Error(`--permissions-can-livestream is required (or pass --body with this field set).`);if(i[`permissions-can-record`]===void 0)throw Error(`--permissions-can-record is required (or pass --body with this field set).`);if(i[`permissions-can-spotlight`]===void 0)throw Error(`--permissions-can-spotlight is required (or pass --body with this field set).`);if(i[`permissions-chat-private-can-receive`]===void 0)throw Error(`--permissions-chat-private-can-receive is required (or pass --body with this field set).`);if(i[`permissions-chat-private-can-send`]===void 0)throw Error(`--permissions-chat-private-can-send is required (or pass --body with this field set).`);if(i[`permissions-chat-private-files`]===void 0)throw Error(`--permissions-chat-private-files is required (or pass --body with this field set).`);if(i[`permissions-chat-private-text`]===void 0)throw Error(`--permissions-chat-private-text is required (or pass --body with this field set).`);if(i[`permissions-chat-public-can-send`]===void 0)throw Error(`--permissions-chat-public-can-send is required (or pass --body with this field set).`);if(i[`permissions-chat-public-files`]===void 0)throw Error(`--permissions-chat-public-files is required (or pass --body with this field set).`);if(i[`permissions-chat-public-text`]===void 0)throw Error(`--permissions-chat-public-text is required (or pass --body with this field set).`);if(i[`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(i[`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(i[`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(i[`permissions-disable-participant-audio`]===void 0)throw Error(`--permissions-disable-participant-audio is required (or pass --body with this field set).`);if(i[`permissions-disable-participant-screensharing`]===void 0)throw Error(`--permissions-disable-participant-screensharing is required (or pass --body with this field set).`);if(i[`permissions-disable-participant-video`]===void 0)throw Error(`--permissions-disable-participant-video is required (or pass --body with this field set).`);if(i[`permissions-hidden-participant`]===void 0)throw Error(`--permissions-hidden-participant is required (or pass --body with this field set).`);if(i[`permissions-kick-participant`]===void 0)throw Error(`--permissions-kick-participant is required (or pass --body with this field set).`);if(i[`permissions-media-audio-can-produce`]===void 0&&(i[`permissions-media-audio-can-produce`]=await n(`permissions-media-audio-can-produce`,`Can produce audio`,[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`])),i[`permissions-media-screenshare-can-produce`]===void 0&&(i[`permissions-media-screenshare-can-produce`]=await n(`permissions-media-screenshare-can-produce`,`Can produce screen share video`,[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`])),i[`permissions-media-video-can-produce`]===void 0&&(i[`permissions-media-video-can-produce`]=await n(`permissions-media-video-can-produce`,`Can produce video`,[`ALLOWED`,`NOT_ALLOWED`,`CAN_REQUEST`])),i[`permissions-pin-participant`]===void 0)throw Error(`--permissions-pin-participant is required (or pass --body with this field set).`);if(i[`permissions-plugins-can-close`]===void 0)throw Error(`--permissions-plugins-can-close is required (or pass --body with this field set).`);if(i[`permissions-plugins-can-edit-config`]===void 0)throw Error(`--permissions-plugins-can-edit-config is required (or pass --body with this field set).`);if(i[`permissions-plugins-can-start`]===void 0)throw Error(`--permissions-plugins-can-start is required (or pass --body with this field set).`);if(i[`permissions-polls-can-create`]===void 0)throw Error(`--permissions-polls-can-create is required (or pass --body with this field set).`);if(i[`permissions-polls-can-view`]===void 0)throw Error(`--permissions-polls-can-view is required (or pass --body with this field set).`);if(i[`permissions-polls-can-vote`]===void 0)throw Error(`--permissions-polls-can-vote is required (or pass --body with this field set).`);if(i[`permissions-recorder-type`]===void 0&&(i[`permissions-recorder-type`]=await n(`permissions-recorder-type`,`Type of the recording peer`,[`RECORDER`,`LIVESTREAMER`,`NONE`])),i[`permissions-show-participant-list`]===void 0)throw Error(`--permissions-show-participant-list is required (or pass --body with this field set).`);if(i[`permissions-waiting-room-type`]===void 0&&(i[`permissions-waiting-room-type`]=await n(`permissions-waiting-room-type`,`Waiting room type`,[`SKIP`,`ON_PRIVILEGED_USER_ENTRY`,`SKIP_ON_ACCEPT`])),i[`ui-design-tokens-border-radius`]===void 0&&(i[`ui-design-tokens-border-radius`]=await n(`ui-design-tokens-border-radius`,`The ui.design_tokens.border_radius field`,[`sharp`,`rounded`,`extra-rounded`,`circular`])),i[`ui-design-tokens-border-width`]===void 0&&(i[`ui-design-tokens-border-width`]=await n(`ui-design-tokens-border-width`,`The ui.design_tokens.border_width field`,[`none`,`thin`,`fat`])),i[`ui-design-tokens-colors-danger`]===void 0&&(i[`ui-design-tokens-colors-danger`]=await e(`ui-design-tokens-colors-danger`,`The ui.design_tokens.colors.danger field`)),i[`ui-design-tokens-colors-success`]===void 0&&(i[`ui-design-tokens-colors-success`]=await e(`ui-design-tokens-colors-success`,`The ui.design_tokens.colors.success field`)),i[`ui-design-tokens-colors-text`]===void 0&&(i[`ui-design-tokens-colors-text`]=await e(`ui-design-tokens-colors-text`,`The ui.design_tokens.colors.text field`)),i[`ui-design-tokens-colors-text-on-brand`]===void 0&&(i[`ui-design-tokens-colors-text-on-brand`]=await e(`ui-design-tokens-colors-text-on-brand`,`The ui.design_tokens.colors.text_on_brand field`)),i[`ui-design-tokens-colors-video-bg`]===void 0&&(i[`ui-design-tokens-colors-video-bg`]=await e(`ui-design-tokens-colors-video-bg`,`The ui.design_tokens.colors.video_bg field`)),i[`ui-design-tokens-colors-warning`]===void 0&&(i[`ui-design-tokens-colors-warning`]=await e(`ui-design-tokens-colors-warning`,`The ui.design_tokens.colors.warning field`)),i[`ui-design-tokens-spacing-base`]===void 0)throw Error(`--ui-design-tokens-spacing-base is required (or pass --body with this field set).`);i[`ui-design-tokens-theme`]===void 0&&(i[`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:i[`config-livestream-viewer-qualities`],max_screenshare_count:i[`config-max-screenshare-count`],max_video_streams:{desktop:i[`config-max-video-streams-desktop`],mobile:i[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:i[`config-media-audio-enable-high-bitrate`],enable_stereo:i[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:i[`config-media-screenshare-frame-rate`],quality:d(i[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:i[`config-media-video-frame-rate`],quality:d(i[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:i[`config-media-video-simulcast`]}},view_type:d(i[`config-view-type`],`config-view-type`,`text`)},name:d(i.name,`name`,`text`),permissions:{accept_stage_requests:i[`permissions-accept-stage-requests`],accept_waiting_requests:i[`permissions-accept-waiting-requests`],can_accept_production_requests:i[`permissions-can-accept-production-requests`],can_change_participant_permissions:i[`permissions-can-change-participant-permissions`],can_edit_display_name:i[`permissions-can-edit-display-name`],can_livestream:i[`permissions-can-livestream`],can_record:i[`permissions-can-record`],can_spotlight:i[`permissions-can-spotlight`],chat:{private:{can_receive:i[`permissions-chat-private-can-receive`],can_send:i[`permissions-chat-private-can-send`],files:i[`permissions-chat-private-files`],text:i[`permissions-chat-private-text`]},public:{can_send:i[`permissions-chat-public-can-send`],files:i[`permissions-chat-public-files`],text:i[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:i[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:i[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:i[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:i[`permissions-disable-participant-audio`],disable_participant_screensharing:i[`permissions-disable-participant-screensharing`],disable_participant_video:i[`permissions-disable-participant-video`],hidden_participant:i[`permissions-hidden-participant`],is_recorder:i[`permissions-is-recorder`],kick_participant:i[`permissions-kick-participant`],media:{audio:{can_produce:d(i[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(i[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(i[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:i[`permissions-pin-participant`],plugins:{can_close:i[`permissions-plugins-can-close`],can_edit_config:i[`permissions-plugins-can-edit-config`],can_start:i[`permissions-plugins-can-start`]},polls:{can_create:i[`permissions-polls-can-create`],can_view:i[`permissions-polls-can-view`],can_vote:i[`permissions-polls-can-vote`]},recorder_type:d(i[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:i[`permissions-show-participant-list`],stage_access:d(i[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:i[`permissions-stage-enabled`],transcription_enabled:i[`permissions-transcription-enabled`],waiting_room_type:d(i[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(i[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(i[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(i[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(i[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(i[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(i[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(i[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(i[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(i[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(i[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(i[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:i[`ui-design-tokens-spacing-base`],theme:d(i[`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:i[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit presets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/presets/${e[`preset-id`]==null?`<preset-id>`:encodeURIComponent(String(e[`preset-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"preset-id":String(e[`preset-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
14
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.presets.delete({account_id:o,app_id:e[`app-id`],preset_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit presets get-preset-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/presets/${e[`preset-id`]==null?`<preset-id>`:encodeURIComponent(String(e[`preset-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"preset-id":String(e[`preset-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.presets.getPresetById({account_id:i,app_id:e[`app-id`],preset_id:e[`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 e=>{let n={per_page:e[`per-page`],page_no:e[`page-no`],search:e.search};if(e.dryRun){l({command:`cf realtime-kit presets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/presets`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.presets.get({account_id:o,app_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit presets update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/presets/${e[`preset-id`]==null?`<preset-id>`:encodeURIComponent(String(e[`preset-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"preset-id":String(e[`preset-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({config:{livestream_viewer_qualities:e[`config-livestream-viewer-qualities`],max_screenshare_count:e[`config-max-screenshare-count`],max_video_streams:{desktop:e[`config-max-video-streams-desktop`],mobile:e[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:e[`config-media-audio-enable-high-bitrate`],enable_stereo:e[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:e[`config-media-screenshare-frame-rate`],quality:d(e[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:e[`config-media-video-frame-rate`],quality:d(e[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:e[`config-media-video-simulcast`]}},view_type:d(e[`config-view-type`],`config-view-type`,`text`)},name:d(e.name,`name`,`text`),permissions:{accept_stage_requests:e[`permissions-accept-stage-requests`],accept_waiting_requests:e[`permissions-accept-waiting-requests`],can_accept_production_requests:e[`permissions-can-accept-production-requests`],can_change_participant_permissions:e[`permissions-can-change-participant-permissions`],can_edit_display_name:e[`permissions-can-edit-display-name`],can_livestream:e[`permissions-can-livestream`],can_record:e[`permissions-can-record`],can_spotlight:e[`permissions-can-spotlight`],chat:{private:{can_receive:e[`permissions-chat-private-can-receive`],can_send:e[`permissions-chat-private-can-send`],files:e[`permissions-chat-private-files`],text:e[`permissions-chat-private-text`]},public:{can_send:e[`permissions-chat-public-can-send`],files:e[`permissions-chat-public-files`],text:e[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:e[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:e[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:e[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:e[`permissions-disable-participant-audio`],disable_participant_screensharing:e[`permissions-disable-participant-screensharing`],disable_participant_video:e[`permissions-disable-participant-video`],hidden_participant:e[`permissions-hidden-participant`],is_recorder:e[`permissions-is-recorder`],kick_participant:e[`permissions-kick-participant`],media:{audio:{can_produce:d(e[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(e[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(e[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:e[`permissions-pin-participant`],plugins:{can_close:e[`permissions-plugins-can-close`],can_edit_config:e[`permissions-plugins-can-edit-config`],can_start:e[`permissions-plugins-can-start`]},polls:{can_create:e[`permissions-polls-can-create`],can_view:e[`permissions-polls-can-view`],can_vote:e[`permissions-polls-can-vote`]},recorder_type:d(e[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:e[`permissions-show-participant-list`],stage_access:d(e[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:e[`permissions-stage-enabled`],transcription_enabled:e[`permissions-transcription-enabled`],waiting_room_type:d(e[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(e[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(e[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(e[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(e[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(e[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(e[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(e[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(e[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(e[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(e[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(e[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:e[`ui-design-tokens-spacing-base`],theme:d(e[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.realtimeKit.presets.update({...t,account_id:i,app_id:e[`app-id`],preset_id:e[`preset-id`]})),{successLabel:`Updated`});return}let p=s({config:{livestream_viewer_qualities:e[`config-livestream-viewer-qualities`],max_screenshare_count:e[`config-max-screenshare-count`],max_video_streams:{desktop:e[`config-max-video-streams-desktop`],mobile:e[`config-max-video-streams-mobile`]},media:{audio:{enable_high_bitrate:e[`config-media-audio-enable-high-bitrate`],enable_stereo:e[`config-media-audio-enable-stereo`]},screenshare:{frame_rate:e[`config-media-screenshare-frame-rate`],quality:d(e[`config-media-screenshare-quality`],`config-media-screenshare-quality`,`text`)},video:{frame_rate:e[`config-media-video-frame-rate`],quality:d(e[`config-media-video-quality`],`config-media-video-quality`,`text`),simulcast:e[`config-media-video-simulcast`]}},view_type:d(e[`config-view-type`],`config-view-type`,`text`)},name:d(e.name,`name`,`text`),permissions:{accept_stage_requests:e[`permissions-accept-stage-requests`],accept_waiting_requests:e[`permissions-accept-waiting-requests`],can_accept_production_requests:e[`permissions-can-accept-production-requests`],can_change_participant_permissions:e[`permissions-can-change-participant-permissions`],can_edit_display_name:e[`permissions-can-edit-display-name`],can_livestream:e[`permissions-can-livestream`],can_record:e[`permissions-can-record`],can_spotlight:e[`permissions-can-spotlight`],chat:{private:{can_receive:e[`permissions-chat-private-can-receive`],can_send:e[`permissions-chat-private-can-send`],files:e[`permissions-chat-private-files`],text:e[`permissions-chat-private-text`]},public:{can_send:e[`permissions-chat-public-can-send`],files:e[`permissions-chat-public-files`],text:e[`permissions-chat-public-text`]}},connected_meetings:{can_alter_connected_meetings:e[`permissions-connected-meetings-can-alter-connected-meetings`],can_switch_connected_meetings:e[`permissions-connected-meetings-can-switch-connected-meetings`],can_switch_to_parent_meeting:e[`permissions-connected-meetings-can-switch-to-parent-meeting`]},disable_participant_audio:e[`permissions-disable-participant-audio`],disable_participant_screensharing:e[`permissions-disable-participant-screensharing`],disable_participant_video:e[`permissions-disable-participant-video`],hidden_participant:e[`permissions-hidden-participant`],is_recorder:e[`permissions-is-recorder`],kick_participant:e[`permissions-kick-participant`],media:{audio:{can_produce:d(e[`permissions-media-audio-can-produce`],`permissions-media-audio-can-produce`,`text`)},screenshare:{can_produce:d(e[`permissions-media-screenshare-can-produce`],`permissions-media-screenshare-can-produce`,`text`)},video:{can_produce:d(e[`permissions-media-video-can-produce`],`permissions-media-video-can-produce`,`text`)}},pin_participant:e[`permissions-pin-participant`],plugins:{can_close:e[`permissions-plugins-can-close`],can_edit_config:e[`permissions-plugins-can-edit-config`],can_start:e[`permissions-plugins-can-start`]},polls:{can_create:e[`permissions-polls-can-create`],can_view:e[`permissions-polls-can-view`],can_vote:e[`permissions-polls-can-vote`]},recorder_type:d(e[`permissions-recorder-type`],`permissions-recorder-type`,`text`),show_participant_list:e[`permissions-show-participant-list`],stage_access:d(e[`permissions-stage-access`],`permissions-stage-access`,`text`),stage_enabled:e[`permissions-stage-enabled`],transcription_enabled:e[`permissions-transcription-enabled`],waiting_room_type:d(e[`permissions-waiting-room-type`],`permissions-waiting-room-type`,`text`)},ui:{design_tokens:{border_radius:d(e[`ui-design-tokens-border-radius`],`ui-design-tokens-border-radius`,`text`),border_width:d(e[`ui-design-tokens-border-width`],`ui-design-tokens-border-width`,`text`),colors:{danger:d(e[`ui-design-tokens-colors-danger`],`ui-design-tokens-colors-danger`,`text`),success:d(e[`ui-design-tokens-colors-success`],`ui-design-tokens-colors-success`,`text`),text:d(e[`ui-design-tokens-colors-text`],`ui-design-tokens-colors-text`,`text`),text_on_brand:d(e[`ui-design-tokens-colors-text-on-brand`],`ui-design-tokens-colors-text-on-brand`,`text`),video_bg:d(e[`ui-design-tokens-colors-video-bg`],`ui-design-tokens-colors-video-bg`,`text`),warning:d(e[`ui-design-tokens-colors-warning`],`ui-design-tokens-colors-warning`,`text`)},font_family:d(e[`ui-design-tokens-font-family`],`ui-design-tokens-font-family`,`text`),google_font:d(e[`ui-design-tokens-google-font`],`ui-design-tokens-google-font`,`text`),logo:d(e[`ui-design-tokens-logo`],`ui-design-tokens-logo`,`text`),spacing_base:e[`ui-design-tokens-spacing-base`],theme:d(e[`ui-design-tokens-theme`],`ui-design-tokens-theme`,`text`)}}});c(await u(`Updating`,async()=>n.realtimeKit.presets.update({...p,account_id:i,app_id:e[`app-id`],preset_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit recordings get-active-recordings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/recordings/active-recording/${e[`meeting-id`]==null?`<meeting-id>`:encodeURIComponent(String(e[`meeting-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"meeting-id":String(e[`meeting-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.recordings.getActiveRecordings({account_id:i,app_id:e[`app-id`],meeting_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit recordings get-one-recording`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/recordings/${e[`recording-id`]==null?`<recording-id>`:encodeURIComponent(String(e[`recording-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"recording-id":String(e[`recording-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.recordings.getOneRecording({account_id:i,app_id:e[`app-id`],recording_id:e[`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 e=>{let n={meeting_id:e[`meeting-id`],page_no:e[`page-no`],per_page:e[`per-page`],expired:e.expired,search:e.search,sort_by:e[`sort-by`],sort_order:e[`sort-order`],start_time:e[`start-time`],end_time:e[`end-time`],status:e.status};if(e.dryRun){l({command:`cf realtime-kit recordings get-recordings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/recordings`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.recordings.getRecordings({account_id:o,app_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit recordings pause-resume-stop-recording`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/recordings/${e[`recording-id`]==null?`<recording-id>`:encodeURIComponent(String(e[`recording-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"recording-id":String(e[`recording-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({action:d(e.action,`action`,`text`)}):o(e.body)});return}let i=await a(e),p=e.local?f:await r(i);if(e.accountId=p,e.body){let t=o(e.body);c(await u(`Updating`,async()=>i.realtimeKit.recordings.pauseResumeStopRecording({...t,account_id:p,app_id:e[`app-id`],recording_id:e[`recording-id`]})),{successLabel:`Updated`});return}e.action===void 0&&(e.action=await n(`action`,`The action field`,[`stop`,`pause`,`resume`]));let m=s({action:d(e.action,`action`,`text`)});c(await u(`Updating`,async()=>i.realtimeKit.recordings.pauseResumeStopRecording({...m,account_id:p,app_id:e[`app-id`],recording_id:e[`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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.realtimeKit.recordings.startRecordings({...e,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`});return}n[`meeting-id`]===void 0&&(n[`meeting-id`]=await e(`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()=>i.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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.realtimeKit.recordings.startTrackRecording({...e,account_id:p,app_id:n[`app-id`]})),{successLabel:`Created`});return}n[`meeting-id`]===void 0&&(n[`meeting-id`]=await e(`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()=>i.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 e=>{if(e.dryRun){l({command:`cf realtime-kit sessions generate-summary-of-transcripts`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/summary`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Creating`,async()=>n.realtimeKit.sessions.generateSummaryOfTranscripts({account_id:i,app_id:e[`app-id`],session_id:e[`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 e=>{let n={filters:e.filters,include_peer_events:e[`include-peer-events`]};if(e.dryRun){l({command:`cf realtime-kit sessions get-participant-data-from-peer-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/peer-report/${e[`peer-id`]==null?`<peer-id>`:encodeURIComponent(String(e[`peer-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"peer-id":String(e[`peer-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.sessions.getParticipantDataFromPeerId({account_id:o,app_id:e[`app-id`],peer_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit sessions get-session-chat`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/chat`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.sessions.getSessionChat({account_id:i,app_id:e[`app-id`],session_id:e[`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 e=>{let n={include_breakout_rooms:e[`include-breakout-rooms`]};if(e.dryRun){l({command:`cf realtime-kit sessions get-session-details`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.sessions.getSessionDetails({account_id:o,app_id:e[`app-id`],session_id:e[`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 e=>{let n={include_peer_events:e[`include-peer-events`]};if(e.dryRun){l({command:`cf realtime-kit sessions get-session-participant-details`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/participants/${e[`participant-id`]==null?`<participant-id>`:encodeURIComponent(String(e[`participant-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"participant-id":String(e[`participant-id`]??``),"session-id":String(e[`session-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.sessions.getSessionParticipantDetails({account_id:o,app_id:e[`app-id`],session_id:e[`session-id`],participant_id:e[`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 e=>{let n={search:e.search,page_no:e[`page-no`],per_page:e[`per-page`],sort_order:e[`sort-order`],sort_by:e[`sort-by`],include_peer_events:e[`include-peer-events`],view:e.view};if(e.dryRun){l({command:`cf realtime-kit sessions get-session-participants`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/participants`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.sessions.getSessionParticipants({account_id:o,app_id:e[`app-id`],session_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit sessions get-session-summary`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/summary`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.sessions.getSessionSummary({account_id:i,app_id:e[`app-id`],session_id:e[`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 e=>{let n={format:e.format};if(e.dryRun){l({command:`cf realtime-kit sessions get-session-transcripts`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions/${e[`session-id`]==null?`<session-id>`:encodeURIComponent(String(e[`session-id`]))}/transcript`,pathParams:{"app-id":String(e[`app-id`]??``),"session-id":String(e[`session-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.sessions.getSessionTranscripts({account_id:o,app_id:e[`app-id`],session_id:e[`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 e=>{let n={page_no:e[`page-no`],per_page:e[`per-page`],sort_by:e[`sort-by`],sort_order:e[`sort-order`],start_time:e[`start-time`],end_time:e[`end-time`],participants:e.participants,status:e.status,search:e.search,associated_id:e[`associated-id`]};if(e.dryRun){l({command:`cf realtime-kit sessions get-sessions`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/sessions`,pathParams:{"app-id":String(e[`app-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.realtimeKit.sessions.getSessions({account_id:o,app_id:e[`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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.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 e(`name`,`Name of the webhook`)),n.url===void 0&&(n.url=await e(`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()=>i.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 e=>{if(e.dryRun){l({command:`cf realtime-kit webhooks delete-webhook`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
18
- `);return}c(await u(`Deleting`,async()=>n.realtimeKit.webhooks.deleteWebhook({account_id:o,app_id:e[`app-id`],webhook_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit webhooks edit-webhook`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({enabled:e.enabled,events:e.events,name:d(e.name,`name`,`text`),url:d(e.url,`url`,`text`)}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.realtimeKit.webhooks.editWebhook({...t,account_id:i,app_id:e[`app-id`],webhook_id:e[`webhook-id`]})),{successLabel:`Updated`});return}let p=s({enabled:e.enabled,events:e.events,name:d(e.name,`name`,`text`),url:d(e.url,`url`,`text`)});c(await u(`Updating`,async()=>n.realtimeKit.webhooks.editWebhook({...p,account_id:i,app_id:e[`app-id`],webhook_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit webhooks get-webhook-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"app-id":String(e[`app-id`]??``),"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.webhooks.getWebhookById({account_id:i,app_id:e[`app-id`],webhook_id:e[`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 e=>{if(e.dryRun){l({command:`cf realtime-kit webhooks get-webhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/realtime/kit/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/webhooks`,pathParams:{"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.realtimeKit.webhooks.getWebhooks({account_id:i,app_id:e[`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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Updating`,async()=>i.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 e(`name`,`Name of the webhook`)),n.url===void 0&&(n.url=await e(`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()=>i.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,46 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,S as t,g as n}from"./oauth-Bk-F-tIO.mjs";import{i as r,n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,r as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.mjs";function m(e){return e.option(`domains`,{type:`string`,array:!0,description:`List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension.
3
- - Minimum: 1 domain
4
- - Maximum: 20 domains per request
5
- - Domains on unsupported extensions are returned with \`registrable: false\` and a \`reason\` field
6
- - Malformed domain names (e.g., missing extension) may be omitted from the response
7
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const h={command:`domain-check`,describe:"Performs real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.",builder:m,handler:async e=>{if(e.dryRun){l({command:`cf registrar domain-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({domains:e.domains}):a(e.body)});return}let r=await i(e),o=e.local?f:await n(r);if(e.accountId=o,e.body){let t=a(e.body);c(await u(`Creating`,async()=>r.registrar.domainCheck({...t,account_id:o})),{successLabel:`Created`});return}if(e.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let d=s({domains:e.domains});c(await u(`Creating`,async()=>r.registrar.domainCheck({...d,account_id:o})),{successLabel:`Created`})}};function g(e){return e.option(`q`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
8
- - Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
9
- - Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,description:`Limits results to specific domain extensions from the supported set. If not specified,
10
- returns results across all supported extensions. Extensions not in the supported
11
- set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`domain-search`,describe:'Searches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.',builder:g,handler:async e=>{let r={q:e.q,extensions:e.extensions,limit:e.limit};if(e.dryRun){l({command:`cf registrar domain-search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/domain-search`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?f:await n(a);e.accountId=o,c(await u(`Loading`,async()=>a.registrar.domainSearch({account_id:o,...r})),{successLabel:`Loaded`})}};function v(e){return e.option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
12
- waiting for the operation to complete (RFC 7240).
13
-
14
- The header may be combined with other preferences using standard
15
- comma-separated syntax.`}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal. Defaults to \`false\` if omitted.
16
- Setting this field to \`true\` is an explicit opt-in authorizing
17
- Cloudflare to charge the account's default payment method up to 30
18
- days before domain expiry to renew the domain automatically.
19
- Renewal pricing may change over time based on registry pricing.
20
- `,default:!1}).option(`contacts-registrant-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
21
- communications from the registry, including ownership verification
22
- and renewal notices.
23
- `}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
24
- Most registrations do not require a fax number.
25
- `}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` with no\nspaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567`\n(UK), `+81.312345678` (Japan).\n"}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:`Full legal name of the registrant (individual or authorized representative).`}).option(`contacts-registrant-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`domain-name`,{type:`string`,description:`Fully qualified domain name (FQDN) including the extension
26
- (e.g., \`example.com\`, \`mybrand.app\`). The domain name uniquely
27
- identifies a registration — the same domain cannot be registered
28
- twice, making it a natural idempotency key for registration requests.
29
- `}).option(`privacy-mode`,{type:`string`,description:"WHOIS privacy mode for the registration. Defaults to `redaction`.\n- `off`: Do not request WHOIS privacy.\n- `redaction`: Request WHOIS redaction where supported by the extension.\n Some extensions do not support privacy/redaction.\n",choices:[`redaction`],default:`redaction`}).option(`years`,{type:`number`,description:`Number of years to register (1–10). If omitted, defaults to the
30
- minimum registration period required by the registry for this
31
- extension. For most extensions this is 1 year, but some extensions
32
- require longer minimum terms (e.g., \`.ai\` requires a minimum of
33
- 2 years).
34
-
35
- The registry for each extension may also enforce its own maximum
36
- registration term. If the requested value exceeds the registry's
37
- maximum, the registration will be rejected. When in doubt, use the
38
- default by omitting this field.
39
- `}).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([`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`].some(t=>e[t]!==void 0)){let t=[`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --contacts-* flag is set`)}return!0})}const y={command:`create`,describe:"Starts a domain registration workflow. This is a billable operation — successful registration charges the account's default payment method. All successful domain registrations are non-refundable — once the workflow completes with `state: succeeded`, the charge cannot be reversed. ### Prerequisites - The account must have a billing profile with a valid default payment method. Set this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. - The account must not already be at the maximum supported domain limit. A single account may own up to 100 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Express mode The only required field is `domain_name`. If `contacts` is omitted, the system uses the account's default address book entry as the registrant. If no default exists and no contact is provided, the request fails. Set up a default address book entry and accept the required agreement at `https://dash.cloudflare.com/{account_id}/domains/registrations`. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.",builder:v,handler:async p=>{let m={};if(p.prefer!==void 0&&(m.Prefer=String(p.prefer)),p.dryRun){l({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:p.body===void 0?s({auto_renew:p[`auto-renew`],contacts:{registrant:{email:d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}}},domain_name:d(p[`domain-name`],`domain-name`,`text`),privacy_mode:d(p[`privacy-mode`],`privacy-mode`,`text`),years:p.years}):a(p.body)});return}let h=await i(p),g=p.local?f:await n(h);if(p.accountId=g,p.body){let e=a(p.body);c(await u(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}p[`domain-name`]===void 0&&(p[`domain-name`]=await e(`domain-name`,"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests. "));let _={};p[`auto-renew`]!==void 0&&o(_,[`auto_renew`],p[`auto-renew`]),p[`contacts-registrant-email`]!==void 0&&o(_,[`contacts`,`registrant`,`email`],d(p[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),p[`contacts-registrant-fax`]!==void 0&&o(_,[`contacts`,`registrant`,`fax`],d(p[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),p[`contacts-registrant-phone`]!==void 0&&o(_,[`contacts`,`registrant`,`phone`],d(p[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),p[`contacts-registrant-postal-info-name`]!==void 0&&o(_,[`contacts`,`registrant`,`postal_info`,`name`],d(p[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),p[`contacts-registrant-postal-info-organization`]!==void 0&&o(_,[`contacts`,`registrant`,`postal_info`,`organization`],d(p[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),p[`domain-name`]!==void 0&&o(_,[`domain_name`],d(p[`domain-name`],`domain-name`,`text`)),p[`privacy-mode`]!==void 0&&o(_,[`privacy_mode`],d(p[`privacy-mode`],`privacy-mode`,`text`)),p.years!==void 0&&o(_,[`years`],p.years),c(await u(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/registrar/registrations`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function b(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get-status <domain-name>`,describe:"Returns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```",builder:b,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await n(r);e.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.getStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`domain-name`,{type:`string`,description:"Fully qualified domain name (FQDN) including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get-update-status <domain-name>`,describe:"Returns the current status of a domain update workflow. Use this endpoint to poll for completion when the PATCH response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. Use increasing backoff between polls. When the workflow remains blocked on a third party, use a longer polling interval and do not poll indefinitely.",builder:S,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await n(r);e.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.getUpdateStatus({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <domain-name>`,describe:"Returns the current state of a domain registration. This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both `created_at` and `expires_at` are present in the response.",builder:w,handler:async e=>{if(e.dryRun){l({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await n(r);e.accountId=a,c(await u(`Loading`,async()=>r.registrar.registrations.get({account_id:a,domain_name:e[`domain-name`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
40
- Pass this value to fetch the next page of results. Omit (or
41
- pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date\n(`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:"Returns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.",builder:p(E),handler:async e=>{let r={cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){l({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?f:await n(a);e.accountId=o,c(await u(`Loading`,async()=>a.registrar.registrations.list({account_id:o,...r})),{successLabel:`Loaded`})}};function O(e){return e.positional(`domain-name`,{type:`string`,description:`Domain name to update.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to receive an immediate `202 Accepted` without\nwaiting for the operation to complete (RFC 7240)."}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal.
42
- Setting this field to \`true\` authorizes Cloudflare to charge the
43
- account's default payment method up to 30 days before domain expiry
44
- to renew the domain automatically. Renewal pricing may change over
45
- time based on registry pricing.
46
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const k={command:`update <domain-name>`,describe:"Updates an existing domain registration. By default, the server holds the connection for a bounded, server-defined amount of time while the update completes. Most updates finish within this window and return `200 OK` with a completed workflow status. If the update is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`. This endpoint currently supports updating `auto_renew` only.",builder:O,handler:async e=>{let d={};if(e.prefer!==void 0&&(d.Prefer=String(e.prefer)),e.dryRun){l({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?s({auto_renew:e[`auto-renew`]}):a(e.body)});return}let p=await i(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=a(e.body);c(await u(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:t,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`});return}let h={};e[`auto-renew`]!==void 0&&o(h,[`auto_renew`],e[`auto-renew`]),c(await u(`Updating`,async()=>r(p,`PATCH`,`/accounts/${m}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},A={command:`registrations`,describe:`Domain registrations — purchase, view, update, and inspect registration status`,builder:e=>e.command(y).command(T).command(x).command(C).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`registrar`,describe:`Domain registration and transfer management through Cloudflare Registrar`,builder:e=>e.command(h).command(_).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};