@webex/plugin-meetings 3.0.0-beta.40 → 3.0.0-beta.401

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 (398) hide show
  1. package/README.md +58 -8
  2. package/dist/annotation/annotation.types.js +7 -0
  3. package/dist/annotation/annotation.types.js.map +1 -0
  4. package/dist/annotation/constants.js +49 -0
  5. package/dist/annotation/constants.js.map +1 -0
  6. package/dist/annotation/index.js +342 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +94 -15
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +45 -0
  11. package/dist/breakouts/events.js.map +1 -0
  12. package/dist/breakouts/index.js +625 -123
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/breakouts/utils.js +27 -8
  15. package/dist/breakouts/utils.js.map +1 -1
  16. package/dist/common/errors/no-meeting-info.js +51 -0
  17. package/dist/common/errors/no-meeting-info.js.map +1 -0
  18. package/dist/common/errors/reclaim-host-role-errors.js +158 -0
  19. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
  20. package/dist/common/errors/webex-errors.js +48 -7
  21. package/dist/common/errors/webex-errors.js.map +1 -1
  22. package/dist/common/logs/logger-proxy.js +1 -1
  23. package/dist/common/logs/logger-proxy.js.map +1 -1
  24. package/dist/common/logs/request.js +5 -1
  25. package/dist/common/logs/request.js.map +1 -1
  26. package/dist/common/queue.js +24 -9
  27. package/dist/common/queue.js.map +1 -1
  28. package/dist/config.js +6 -10
  29. package/dist/config.js.map +1 -1
  30. package/dist/constants.js +247 -34
  31. package/dist/constants.js.map +1 -1
  32. package/dist/controls-options-manager/enums.js +14 -2
  33. package/dist/controls-options-manager/enums.js.map +1 -1
  34. package/dist/controls-options-manager/index.js +109 -15
  35. package/dist/controls-options-manager/index.js.map +1 -1
  36. package/dist/controls-options-manager/types.js +7 -0
  37. package/dist/controls-options-manager/types.js.map +1 -0
  38. package/dist/controls-options-manager/util.js +309 -18
  39. package/dist/controls-options-manager/util.js.map +1 -1
  40. package/dist/index.js +116 -2
  41. package/dist/index.js.map +1 -1
  42. package/dist/interceptors/index.js +15 -0
  43. package/dist/interceptors/index.js.map +1 -0
  44. package/dist/interceptors/locusRetry.js +93 -0
  45. package/dist/interceptors/locusRetry.js.map +1 -0
  46. package/dist/interpretation/collection.js +23 -0
  47. package/dist/interpretation/collection.js.map +1 -0
  48. package/dist/interpretation/index.js +380 -0
  49. package/dist/interpretation/index.js.map +1 -0
  50. package/dist/interpretation/siLanguage.js +25 -0
  51. package/dist/interpretation/siLanguage.js.map +1 -0
  52. package/dist/locus-info/controlsUtils.js +91 -2
  53. package/dist/locus-info/controlsUtils.js.map +1 -1
  54. package/dist/locus-info/index.js +386 -62
  55. package/dist/locus-info/index.js.map +1 -1
  56. package/dist/locus-info/infoUtils.js +7 -1
  57. package/dist/locus-info/infoUtils.js.map +1 -1
  58. package/dist/locus-info/mediaSharesUtils.js +71 -1
  59. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  60. package/dist/locus-info/parser.js +249 -72
  61. package/dist/locus-info/parser.js.map +1 -1
  62. package/dist/locus-info/selfUtils.js +89 -14
  63. package/dist/locus-info/selfUtils.js.map +1 -1
  64. package/dist/media/index.js +65 -102
  65. package/dist/media/index.js.map +1 -1
  66. package/dist/media/properties.js +73 -124
  67. package/dist/media/properties.js.map +1 -1
  68. package/dist/mediaQualityMetrics/config.js +135 -330
  69. package/dist/mediaQualityMetrics/config.js.map +1 -1
  70. package/dist/meeting/in-meeting-actions.js +86 -2
  71. package/dist/meeting/in-meeting-actions.js.map +1 -1
  72. package/dist/meeting/index.js +4509 -3000
  73. package/dist/meeting/index.js.map +1 -1
  74. package/dist/meeting/locusMediaRequest.js +292 -0
  75. package/dist/meeting/locusMediaRequest.js.map +1 -0
  76. package/dist/meeting/muteState.js +236 -136
  77. package/dist/meeting/muteState.js.map +1 -1
  78. package/dist/meeting/request.js +185 -155
  79. package/dist/meeting/request.js.map +1 -1
  80. package/dist/meeting/util.js +676 -417
  81. package/dist/meeting/util.js.map +1 -1
  82. package/dist/meeting/voicea-meeting.js +172 -0
  83. package/dist/meeting/voicea-meeting.js.map +1 -0
  84. package/dist/meeting-info/index.js +73 -7
  85. package/dist/meeting-info/index.js.map +1 -1
  86. package/dist/meeting-info/meeting-info-v2.js +201 -57
  87. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  88. package/dist/meeting-info/util.js +8 -7
  89. package/dist/meeting-info/util.js.map +1 -1
  90. package/dist/meeting-info/utilv2.js +44 -40
  91. package/dist/meeting-info/utilv2.js.map +1 -1
  92. package/dist/meetings/collection.js +39 -0
  93. package/dist/meetings/collection.js.map +1 -1
  94. package/dist/meetings/index.js +484 -119
  95. package/dist/meetings/index.js.map +1 -1
  96. package/dist/meetings/meetings.types.js +7 -0
  97. package/dist/meetings/meetings.types.js.map +1 -0
  98. package/dist/meetings/request.js +2 -0
  99. package/dist/meetings/request.js.map +1 -1
  100. package/dist/meetings/util.js +73 -7
  101. package/dist/meetings/util.js.map +1 -1
  102. package/dist/member/index.js +57 -0
  103. package/dist/member/index.js.map +1 -1
  104. package/dist/member/types.js +25 -0
  105. package/dist/member/types.js.map +1 -0
  106. package/dist/member/util.js +132 -25
  107. package/dist/member/util.js.map +1 -1
  108. package/dist/members/collection.js +10 -0
  109. package/dist/members/collection.js.map +1 -1
  110. package/dist/members/index.js +100 -5
  111. package/dist/members/index.js.map +1 -1
  112. package/dist/members/request.js +106 -38
  113. package/dist/members/request.js.map +1 -1
  114. package/dist/members/types.js +15 -0
  115. package/dist/members/types.js.map +1 -0
  116. package/dist/members/util.js +326 -232
  117. package/dist/members/util.js.map +1 -1
  118. package/dist/metrics/constants.js +18 -1
  119. package/dist/metrics/constants.js.map +1 -1
  120. package/dist/metrics/index.js +1 -446
  121. package/dist/metrics/index.js.map +1 -1
  122. package/dist/multistream/mediaRequestManager.js +223 -32
  123. package/dist/multistream/mediaRequestManager.js.map +1 -1
  124. package/dist/multistream/receiveSlot.js +10 -0
  125. package/dist/multistream/receiveSlot.js.map +1 -1
  126. package/dist/multistream/receiveSlotManager.js +39 -36
  127. package/dist/multistream/receiveSlotManager.js.map +1 -1
  128. package/dist/multistream/remoteMedia.js +3 -1
  129. package/dist/multistream/remoteMedia.js.map +1 -1
  130. package/dist/multistream/remoteMediaGroup.js +76 -5
  131. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  132. package/dist/multistream/remoteMediaManager.js +366 -104
  133. package/dist/multistream/remoteMediaManager.js.map +1 -1
  134. package/dist/multistream/sendSlotManager.js +255 -0
  135. package/dist/multistream/sendSlotManager.js.map +1 -0
  136. package/dist/reachability/clusterReachability.js +356 -0
  137. package/dist/reachability/clusterReachability.js.map +1 -0
  138. package/dist/reachability/index.js +263 -390
  139. package/dist/reachability/index.js.map +1 -1
  140. package/dist/reachability/request.js +6 -4
  141. package/dist/reachability/request.js.map +1 -1
  142. package/dist/reachability/util.js +29 -0
  143. package/dist/reachability/util.js.map +1 -0
  144. package/dist/reconnection-manager/index.js +266 -202
  145. package/dist/reconnection-manager/index.js.map +1 -1
  146. package/dist/recording-controller/index.js +21 -2
  147. package/dist/recording-controller/index.js.map +1 -1
  148. package/dist/recording-controller/util.js +9 -8
  149. package/dist/recording-controller/util.js.map +1 -1
  150. package/dist/roap/index.js +66 -28
  151. package/dist/roap/index.js.map +1 -1
  152. package/dist/roap/request.js +48 -64
  153. package/dist/roap/request.js.map +1 -1
  154. package/dist/roap/turnDiscovery.js +407 -79
  155. package/dist/roap/turnDiscovery.js.map +1 -1
  156. package/dist/rtcMetrics/constants.js +12 -0
  157. package/dist/rtcMetrics/constants.js.map +1 -0
  158. package/dist/rtcMetrics/index.js +179 -0
  159. package/dist/rtcMetrics/index.js.map +1 -0
  160. package/dist/statsAnalyzer/index.js +357 -295
  161. package/dist/statsAnalyzer/index.js.map +1 -1
  162. package/dist/statsAnalyzer/mqaUtil.js +296 -156
  163. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  164. package/dist/types/annotation/annotation.types.d.ts +42 -0
  165. package/dist/types/annotation/constants.d.ts +31 -0
  166. package/dist/types/annotation/index.d.ts +117 -0
  167. package/dist/types/breakouts/events.d.ts +8 -0
  168. package/dist/types/breakouts/utils.d.ts +9 -2
  169. package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
  170. package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
  171. package/dist/types/common/errors/webex-errors.d.ts +25 -1
  172. package/dist/types/common/logs/request.d.ts +2 -0
  173. package/dist/types/common/queue.d.ts +9 -7
  174. package/dist/types/config.d.ts +2 -7
  175. package/dist/types/constants.d.ts +204 -32
  176. package/dist/types/controls-options-manager/enums.d.ts +11 -1
  177. package/dist/types/controls-options-manager/index.d.ts +17 -1
  178. package/dist/types/controls-options-manager/types.d.ts +43 -0
  179. package/dist/types/controls-options-manager/util.d.ts +1 -7
  180. package/dist/types/index.d.ts +6 -5
  181. package/dist/types/interceptors/index.d.ts +2 -0
  182. package/dist/types/interceptors/locusRetry.d.ts +27 -0
  183. package/dist/types/interpretation/collection.d.ts +5 -0
  184. package/dist/types/interpretation/index.d.ts +5 -0
  185. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  186. package/dist/types/locus-info/index.d.ts +57 -4
  187. package/dist/types/locus-info/parser.d.ts +66 -6
  188. package/dist/types/media/index.d.ts +2 -0
  189. package/dist/types/media/properties.d.ts +34 -49
  190. package/dist/types/mediaQualityMetrics/config.d.ts +99 -223
  191. package/dist/types/meeting/in-meeting-actions.d.ts +86 -2
  192. package/dist/types/meeting/index.d.ts +630 -505
  193. package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
  194. package/dist/types/meeting/muteState.d.ts +88 -26
  195. package/dist/types/meeting/request.d.ts +65 -43
  196. package/dist/types/meeting/util.d.ts +117 -1
  197. package/dist/types/meeting/voicea-meeting.d.ts +16 -0
  198. package/dist/types/meeting-info/index.d.ts +13 -1
  199. package/dist/types/meeting-info/meeting-info-v2.d.ts +31 -1
  200. package/dist/types/meetings/collection.d.ts +17 -0
  201. package/dist/types/meetings/index.d.ts +113 -21
  202. package/dist/types/meetings/meetings.types.d.ts +4 -0
  203. package/dist/types/member/index.d.ts +14 -0
  204. package/dist/types/member/types.d.ts +32 -0
  205. package/dist/types/members/collection.d.ts +5 -0
  206. package/dist/types/members/index.d.ts +35 -2
  207. package/dist/types/members/request.d.ts +73 -9
  208. package/dist/types/members/types.d.ts +25 -0
  209. package/dist/types/members/util.d.ts +214 -1
  210. package/dist/types/metrics/constants.d.ts +17 -0
  211. package/dist/types/metrics/index.d.ts +4 -111
  212. package/dist/types/multistream/mediaRequestManager.d.ts +72 -3
  213. package/dist/types/multistream/receiveSlot.d.ts +7 -3
  214. package/dist/types/multistream/receiveSlotManager.d.ts +14 -4
  215. package/dist/types/multistream/remoteMedia.d.ts +3 -31
  216. package/dist/types/multistream/remoteMediaGroup.d.ts +2 -9
  217. package/dist/types/multistream/remoteMediaManager.d.ts +62 -2
  218. package/dist/types/multistream/sendSlotManager.d.ts +70 -0
  219. package/dist/types/reachability/clusterReachability.d.ts +109 -0
  220. package/dist/types/reachability/index.d.ts +60 -95
  221. package/dist/types/reachability/request.d.ts +3 -1
  222. package/dist/types/reachability/util.d.ts +8 -0
  223. package/dist/types/reconnection-manager/index.d.ts +19 -0
  224. package/dist/types/recording-controller/index.d.ts +15 -1
  225. package/dist/types/recording-controller/util.d.ts +5 -4
  226. package/dist/types/roap/index.d.ts +11 -2
  227. package/dist/types/roap/request.d.ts +9 -8
  228. package/dist/types/roap/turnDiscovery.d.ts +90 -9
  229. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  230. package/dist/types/rtcMetrics/index.d.ts +61 -0
  231. package/dist/types/statsAnalyzer/index.d.ts +34 -12
  232. package/dist/types/statsAnalyzer/mqaUtil.d.ts +28 -4
  233. package/dist/types/webinar/collection.d.ts +16 -0
  234. package/dist/types/webinar/index.d.ts +5 -0
  235. package/dist/webinar/collection.js +44 -0
  236. package/dist/webinar/collection.js.map +1 -0
  237. package/dist/webinar/index.js +69 -0
  238. package/dist/webinar/index.js.map +1 -0
  239. package/package.json +22 -19
  240. package/src/annotation/annotation.types.ts +50 -0
  241. package/src/annotation/constants.ts +36 -0
  242. package/src/annotation/index.ts +328 -0
  243. package/src/breakouts/README.md +27 -6
  244. package/src/breakouts/breakout.ts +67 -9
  245. package/src/breakouts/events.ts +56 -0
  246. package/src/breakouts/index.ts +494 -73
  247. package/src/breakouts/utils.ts +26 -8
  248. package/src/common/errors/no-meeting-info.ts +24 -0
  249. package/src/common/errors/reclaim-host-role-errors.ts +134 -0
  250. package/src/common/errors/webex-errors.ts +44 -2
  251. package/src/common/logs/logger-proxy.ts +1 -1
  252. package/src/common/logs/request.ts +5 -1
  253. package/src/common/queue.ts +22 -8
  254. package/src/config.ts +6 -13
  255. package/src/constants.ts +234 -22
  256. package/src/controls-options-manager/enums.ts +12 -0
  257. package/src/controls-options-manager/index.ts +116 -21
  258. package/src/controls-options-manager/types.ts +59 -0
  259. package/src/controls-options-manager/util.ts +294 -14
  260. package/src/index.ts +45 -0
  261. package/src/interceptors/index.ts +3 -0
  262. package/src/interceptors/locusRetry.ts +67 -0
  263. package/src/interpretation/README.md +60 -0
  264. package/src/interpretation/collection.ts +19 -0
  265. package/src/interpretation/index.ts +349 -0
  266. package/src/interpretation/siLanguage.ts +18 -0
  267. package/src/locus-info/controlsUtils.ts +108 -0
  268. package/src/locus-info/index.ts +417 -59
  269. package/src/locus-info/infoUtils.ts +10 -2
  270. package/src/locus-info/mediaSharesUtils.ts +80 -0
  271. package/src/locus-info/parser.ts +258 -47
  272. package/src/locus-info/selfUtils.ts +81 -5
  273. package/src/media/index.ts +100 -108
  274. package/src/media/properties.ts +88 -117
  275. package/src/mediaQualityMetrics/config.ts +103 -238
  276. package/src/meeting/in-meeting-actions.ts +171 -3
  277. package/src/meeting/index.ts +3899 -2622
  278. package/src/meeting/locusMediaRequest.ts +313 -0
  279. package/src/meeting/muteState.ts +237 -136
  280. package/src/meeting/request.ts +166 -122
  281. package/src/meeting/util.ts +690 -395
  282. package/src/meeting/voicea-meeting.ts +122 -0
  283. package/src/meeting-info/index.ts +81 -8
  284. package/src/meeting-info/meeting-info-v2.ts +166 -16
  285. package/src/meeting-info/util.ts +13 -10
  286. package/src/meeting-info/utilv2.ts +47 -37
  287. package/src/meetings/collection.ts +33 -0
  288. package/src/meetings/index.ts +507 -127
  289. package/src/meetings/meetings.types.ts +12 -0
  290. package/src/meetings/request.ts +2 -0
  291. package/src/meetings/util.ts +81 -12
  292. package/src/member/index.ts +57 -0
  293. package/src/member/types.ts +38 -0
  294. package/src/member/util.ts +141 -25
  295. package/src/members/collection.ts +8 -0
  296. package/src/members/index.ts +133 -7
  297. package/src/members/request.ts +97 -17
  298. package/src/members/types.ts +29 -0
  299. package/src/members/util.ts +333 -240
  300. package/src/metrics/constants.ts +17 -0
  301. package/src/metrics/index.ts +1 -469
  302. package/src/multistream/mediaRequestManager.ts +271 -56
  303. package/src/multistream/receiveSlot.ts +11 -4
  304. package/src/multistream/receiveSlotManager.ts +34 -24
  305. package/src/multistream/remoteMedia.ts +5 -3
  306. package/src/multistream/remoteMediaGroup.ts +78 -0
  307. package/src/multistream/remoteMediaManager.ts +248 -44
  308. package/src/multistream/sendSlotManager.ts +199 -0
  309. package/src/reachability/clusterReachability.ts +320 -0
  310. package/src/reachability/index.ts +229 -346
  311. package/src/reachability/request.ts +8 -4
  312. package/src/reachability/util.ts +24 -0
  313. package/src/reconnection-manager/index.ts +128 -97
  314. package/src/recording-controller/index.ts +20 -3
  315. package/src/recording-controller/util.ts +26 -9
  316. package/src/roap/index.ts +76 -25
  317. package/src/roap/request.ts +48 -67
  318. package/src/roap/turnDiscovery.ts +331 -67
  319. package/src/rtcMetrics/constants.ts +3 -0
  320. package/src/rtcMetrics/index.ts +166 -0
  321. package/src/statsAnalyzer/index.ts +457 -416
  322. package/src/statsAnalyzer/mqaUtil.ts +317 -170
  323. package/src/webinar/collection.ts +31 -0
  324. package/src/webinar/index.ts +62 -0
  325. package/test/integration/spec/converged-space-meetings.js +60 -3
  326. package/test/integration/spec/journey.js +321 -262
  327. package/test/integration/spec/space-meeting.js +76 -3
  328. package/test/unit/spec/annotation/index.ts +418 -0
  329. package/test/unit/spec/breakouts/breakout.ts +119 -28
  330. package/test/unit/spec/breakouts/events.ts +89 -0
  331. package/test/unit/spec/breakouts/index.ts +1204 -118
  332. package/test/unit/spec/breakouts/utils.js +27 -2
  333. package/test/unit/spec/common/queue.js +31 -2
  334. package/test/unit/spec/controls-options-manager/index.js +163 -0
  335. package/test/unit/spec/controls-options-manager/util.js +576 -60
  336. package/test/unit/spec/fixture/locus.js +1 -0
  337. package/test/unit/spec/interceptors/locusRetry.ts +131 -0
  338. package/test/unit/spec/interpretation/collection.ts +15 -0
  339. package/test/unit/spec/interpretation/index.ts +625 -0
  340. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  341. package/test/unit/spec/locus-info/controlsUtils.js +316 -43
  342. package/test/unit/spec/locus-info/index.js +1372 -37
  343. package/test/unit/spec/locus-info/infoUtils.js +37 -15
  344. package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
  345. package/test/unit/spec/locus-info/mediaSharesUtils.ts +41 -0
  346. package/test/unit/spec/locus-info/parser.js +116 -35
  347. package/test/unit/spec/locus-info/selfConstant.js +27 -4
  348. package/test/unit/spec/locus-info/selfUtils.js +203 -17
  349. package/test/unit/spec/media/index.ts +178 -81
  350. package/test/unit/spec/media/properties.ts +2 -2
  351. package/test/unit/spec/meeting/in-meeting-actions.ts +85 -3
  352. package/test/unit/spec/meeting/index.js +7520 -2267
  353. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  354. package/test/unit/spec/meeting/muteState.js +549 -207
  355. package/test/unit/spec/meeting/request.js +476 -54
  356. package/test/unit/spec/meeting/utils.js +827 -74
  357. package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
  358. package/test/unit/spec/meeting-info/index.js +300 -0
  359. package/test/unit/spec/meeting-info/meetinginfov2.js +535 -9
  360. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  361. package/test/unit/spec/meetings/collection.js +26 -0
  362. package/test/unit/spec/meetings/index.js +1489 -219
  363. package/test/unit/spec/meetings/utils.js +229 -2
  364. package/test/unit/spec/member/index.js +61 -6
  365. package/test/unit/spec/member/util.js +510 -34
  366. package/test/unit/spec/members/index.js +432 -1
  367. package/test/unit/spec/members/request.js +206 -27
  368. package/test/unit/spec/members/utils.js +210 -0
  369. package/test/unit/spec/metrics/index.js +2 -52
  370. package/test/unit/spec/multistream/mediaRequestManager.ts +782 -114
  371. package/test/unit/spec/multistream/receiveSlot.ts +9 -1
  372. package/test/unit/spec/multistream/receiveSlotManager.ts +32 -30
  373. package/test/unit/spec/multistream/remoteMedia.ts +2 -0
  374. package/test/unit/spec/multistream/remoteMediaGroup.ts +345 -0
  375. package/test/unit/spec/multistream/remoteMediaManager.ts +525 -0
  376. package/test/unit/spec/multistream/sendSlotManager.ts +274 -0
  377. package/test/unit/spec/reachability/clusterReachability.ts +279 -0
  378. package/test/unit/spec/reachability/index.ts +551 -14
  379. package/test/unit/spec/reachability/request.js +3 -1
  380. package/test/unit/spec/reachability/util.ts +40 -0
  381. package/test/unit/spec/reconnection-manager/index.js +171 -11
  382. package/test/unit/spec/recording-controller/index.js +293 -218
  383. package/test/unit/spec/recording-controller/util.js +223 -96
  384. package/test/unit/spec/roap/index.ts +233 -81
  385. package/test/unit/spec/roap/request.ts +100 -62
  386. package/test/unit/spec/roap/turnDiscovery.ts +682 -108
  387. package/test/unit/spec/rtcMetrics/index.ts +122 -0
  388. package/test/unit/spec/stats-analyzer/index.js +1252 -12
  389. package/test/unit/spec/webinar/collection.ts +13 -0
  390. package/test/unit/spec/webinar/index.ts +60 -0
  391. package/test/utils/integrationTestUtils.js +46 -0
  392. package/test/utils/testUtils.js +0 -57
  393. package/test/utils/webex-test-users.js +12 -4
  394. package/dist/metrics/config.js +0 -289
  395. package/dist/metrics/config.js.map +0 -1
  396. package/dist/types/metrics/config.d.ts +0 -169
  397. package/src/index.js +0 -18
  398. package/src/metrics/config.ts +0 -485
@@ -6,6 +6,10 @@ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/o
6
6
  var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
7
7
  var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
8
8
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
9
+ var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
10
+ var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
11
+ var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
12
+ var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array");
9
13
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
10
14
  _Object$defineProperty(exports, "__esModule", {
11
15
  value: true
@@ -15,452 +19,707 @@ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/pr
15
19
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
16
20
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
17
21
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
18
- var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
22
+ var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
19
23
  var _webexErrors = require("../common/errors/webex-errors");
20
- var _metrics = _interopRequireDefault(require("../metrics"));
21
- var _config = require("../metrics/config");
22
- var _media = _interopRequireDefault(require("../media"));
23
24
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
24
25
  var _constants = require("../constants");
26
+ var _browserDetection = _interopRequireDefault(require("../common/browser-detection"));
25
27
  var _intentToJoin = _interopRequireDefault(require("../common/errors/intent-to-join"));
26
28
  var _joinMeeting = _interopRequireDefault(require("../common/errors/join-meeting"));
27
29
  var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
28
30
  var _permission = _interopRequireDefault(require("../common/errors/permission"));
29
31
  var _passwordError = _interopRequireDefault(require("../common/errors/password-error"));
30
32
  var _captchaError = _interopRequireDefault(require("../common/errors/captcha-error"));
33
+ var _triggerProxy = _interopRequireDefault(require("../common/events/trigger-proxy"));
34
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
35
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
31
37
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
38
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
33
- var MeetingUtil = {};
34
- MeetingUtil.parseLocusJoin = function (response) {
35
- var parsed = {};
39
+ var MeetingUtil = {
40
+ parseLocusJoin: function parseLocusJoin(response) {
41
+ var parsed = {};
36
42
 
37
- // First todo: add check for existance
38
- parsed.locus = response.body.locus;
39
- parsed.mediaConnections = response.body.mediaConnections;
40
- parsed.locusUrl = parsed.locus.url;
41
- parsed.locusId = parsed.locus.url.split('/').pop();
42
- parsed.selfId = parsed.locus.self.id;
43
+ // First todo: add check for existance
44
+ parsed.locus = response.body.locus;
45
+ parsed.mediaConnections = response.body.mediaConnections;
46
+ parsed.locusUrl = parsed.locus.url;
47
+ parsed.locusId = parsed.locus.url.split('/').pop();
48
+ parsed.selfId = parsed.locus.self.id;
43
49
 
44
- // we need mediaId before making roap calls
45
- parsed.mediaConnections.forEach(function (mediaConnection) {
46
- if (mediaConnection.mediaId) {
47
- parsed.mediaId = mediaConnection.mediaId;
48
- }
49
- });
50
- return parsed;
51
- };
52
- MeetingUtil.remoteUpdateAudioVideo = function (audioMuted, videoMuted, meeting) {
53
- if (!meeting) {
54
- return _promise.default.reject(new _parameter.default('You need a meeting object.'));
55
- }
56
- var localMedias = _media.default.generateLocalMedias(meeting.mediaId, audioMuted, videoMuted);
57
- if ((0, _isEmpty2.default)(localMedias)) {
58
- return _promise.default.reject(new _parameter.default('You need a media id on the meeting to change remote audio.'));
59
- }
60
- _metrics.default.postEvent({
61
- event: _config.eventType.MEDIA_REQUEST,
62
- meeting: meeting
63
- });
64
- return meeting.meetingRequest.remoteAudioVideoToggle({
65
- locusUrl: meeting.locusUrl,
66
- selfId: meeting.selfId,
67
- localMedias: localMedias,
68
- deviceUrl: meeting.deviceUrl,
69
- correlationId: meeting.correlationId,
70
- preferTranscoding: !meeting.isMultistream
71
- }).then(function (response) {
72
- _metrics.default.postEvent({
73
- event: _config.eventType.MEDIA_RESPONSE,
74
- meeting: meeting
50
+ // we need mediaId before making roap calls
51
+ parsed.mediaConnections.forEach(function (mediaConnection) {
52
+ if (mediaConnection.mediaId) {
53
+ parsed.mediaId = mediaConnection.mediaId;
54
+ }
75
55
  });
76
- return response.body.locus;
77
- });
78
- };
79
- MeetingUtil.hasOwner = function (info) {
80
- return info && info.owner;
81
- };
82
- MeetingUtil.isOwnerSelf = function (owner, selfId) {
83
- return owner === selfId;
84
- };
85
- MeetingUtil.isPinOrGuest = function (err) {
86
- var _err$body;
87
- return (err === null || err === void 0 ? void 0 : (_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.errorCode) && _constants.INTENT_TO_JOIN.includes(err.body.errorCode);
88
- };
89
- MeetingUtil.joinMeeting = function (meeting, options) {
90
- if (!meeting) {
91
- return _promise.default.reject(new _parameter.default('You need a meeting object.'));
92
- }
93
- _metrics.default.postEvent({
94
- event: _config.eventType.LOCUS_JOIN_REQUEST,
95
- meeting: meeting
96
- });
56
+ return parsed;
57
+ },
58
+ remoteUpdateAudioVideo: function remoteUpdateAudioVideo(meeting, audioMuted, videoMuted) {
59
+ var webex = meeting.getWebexObject();
60
+ if (!meeting) {
61
+ return _promise.default.reject(new _parameter.default('You need a meeting object.'));
62
+ }
63
+ if (!meeting.locusMediaRequest) {
64
+ return _promise.default.reject(new _parameter.default('You need a meeting with a media connection, call Meeting.addMedia() first.'));
65
+ }
97
66
 
98
- // eslint-disable-next-line no-warning-comments
99
- // TODO: check if the meeting is in JOINING state
100
- // if Joining state termintate the request as user might click multiple times
101
- return meeting.meetingRequest.joinMeeting({
102
- inviteeAddress: meeting.meetingJoinUrl || meeting.sipUri,
103
- meetingNumber: meeting.meetingNumber,
104
- deviceUrl: meeting.deviceUrl,
105
- locusUrl: meeting.locusUrl,
106
- correlationId: meeting.correlationId,
107
- roapMessage: options.roapMessage,
108
- permissionToken: meeting.permissionToken,
109
- resourceId: options.resourceId || null,
110
- moderator: options.moderator,
111
- pin: options.pin,
112
- moveToResource: options.moveToResource,
113
- preferTranscoding: !meeting.isMultistream,
114
- asResourceOccupant: options.asResourceOccupant,
115
- breakoutsSupported: options.breakoutsSupported
116
- }).then(function (res) {
117
- _metrics.default.postEvent({
118
- event: _config.eventType.LOCUS_JOIN_RESPONSE,
119
- meeting: meeting,
120
- data: {
121
- trigger: _config.trigger.LOCI_UPDATE,
122
- locus: res.body.locus,
123
- mediaConnections: res.body.mediaConnections,
124
- trackingId: res.headers.trackingid
67
+ // @ts-ignore
68
+ webex.internal.newMetrics.submitClientEvent({
69
+ name: 'client.locus.media.request',
70
+ options: {
71
+ meetingId: meeting.id
125
72
  }
126
73
  });
127
- return MeetingUtil.parseLocusJoin(res);
128
- });
129
- };
130
- MeetingUtil.cleanUp = function (meeting) {
131
- meeting.breakouts.cleanUp();
74
+ return meeting.locusMediaRequest.send({
75
+ type: 'LocalMute',
76
+ selfUrl: meeting.selfUrl,
77
+ mediaId: meeting.mediaId,
78
+ sequence: meeting.locusInfo.sequence,
79
+ muteOptions: {
80
+ audioMuted: audioMuted,
81
+ videoMuted: videoMuted
82
+ }
83
+ }).then(function (response) {
84
+ var _response$body;
85
+ // @ts-ignore
86
+ webex.internal.newMetrics.submitClientEvent({
87
+ name: 'client.locus.media.response',
88
+ options: {
89
+ meetingId: meeting.id
90
+ }
91
+ });
92
+ return response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.locus;
93
+ });
94
+ },
95
+ hasOwner: function hasOwner(info) {
96
+ return info && info.owner;
97
+ },
98
+ isOwnerSelf: function isOwnerSelf(owner, selfId) {
99
+ return owner === selfId;
100
+ },
101
+ isPinOrGuest: function isPinOrGuest(err) {
102
+ var _err$body;
103
+ return (err === null || err === void 0 ? void 0 : (_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.errorCode) && _constants.INTENT_TO_JOIN.includes(err.body.errorCode);
104
+ },
105
+ /**
106
+ * Returns the current state of knowledge about whether we are on an ipv4-only or ipv6-only or mixed (ipv4 and ipv6) network.
107
+ * The return value matches the possible values of "ipver" parameter used by the backend APIs.
108
+ *
109
+ * @param {Object} webex webex instance
110
+ * @returns {IP_VERSION|undefined} ipver value to be passed to the backend APIs or undefined if we should not pass any value to the backend
111
+ */
112
+ getIpVersion: function getIpVersion(webex) {
113
+ var _webex$internal$devic = webex.internal.device.ipNetworkDetector,
114
+ supportsIpV4 = _webex$internal$devic.supportsIpV4,
115
+ supportsIpV6 = _webex$internal$devic.supportsIpV6;
116
+ if ((0, _browserDetection.default)().isBrowser('firefox')) {
117
+ // our ipv6 solution relies on FQDN ICE candidates, but Firefox doesn't support them,
118
+ // see https://bugzilla.mozilla.org/show_bug.cgi?id=1713128
119
+ // so for Firefox we don't want the backend to activate the "ipv6 feature"
120
+ return undefined;
121
+ }
122
+ if (supportsIpV4 && supportsIpV6) {
123
+ return _constants.IP_VERSION.ipv4_and_ipv6;
124
+ }
125
+ if (supportsIpV4) {
126
+ return _constants.IP_VERSION.only_ipv4;
127
+ }
128
+ if (supportsIpV6) {
129
+ return _constants.IP_VERSION.only_ipv6;
130
+ }
131
+ return _constants.IP_VERSION.unknown;
132
+ },
133
+ joinMeeting: function joinMeeting(meeting, options) {
134
+ var _meeting$meetingInfo;
135
+ if (!meeting) {
136
+ return _promise.default.reject(new _parameter.default('You need a meeting object.'));
137
+ }
138
+ var webex = meeting.getWebexObject();
132
139
 
133
- // make sure we send last metrics before we close the peerconnection
134
- var stopStatsAnalyzer = meeting.statsAnalyzer ? meeting.statsAnalyzer.stopAnalyzer() : _promise.default.resolve();
135
- return stopStatsAnalyzer.then(function () {
136
- return meeting.closeLocalStream();
137
- }).then(function () {
138
- return meeting.closeLocalShare();
139
- }).then(function () {
140
- return meeting.closeRemoteTracks();
141
- }).then(function () {
142
- return meeting.closePeerConnections();
143
- }).then(function () {
144
- meeting.unsetLocalVideoTrack();
145
- meeting.unsetLocalShareTrack();
146
- meeting.unsetRemoteTracks();
147
- meeting.unsetPeerConnections();
148
- meeting.reconnectionManager.cleanUp();
149
- }).then(function () {
150
- return meeting.stopKeepAlive();
151
- }).then(function () {
152
- return meeting.updateLLMConnection();
153
- });
154
- };
155
- MeetingUtil.disconnectPhoneAudio = function (meeting, phoneUrl) {
156
- if (meeting.meetingState === _constants.FULL_STATE.INACTIVE) {
157
- return _promise.default.reject(new _webexErrors.MeetingNotActiveError());
158
- }
159
- var options = {
160
- locusUrl: meeting.locusUrl,
161
- selfId: meeting.selfId,
162
- correlationId: meeting.correlationId,
163
- phoneUrl: phoneUrl
164
- };
165
- return meeting.meetingRequest.disconnectPhoneAudio(options).then(function (response) {
166
- var _response$body;
167
- if (response !== null && response !== void 0 && (_response$body = response.body) !== null && _response$body !== void 0 && _response$body.locus) {
168
- meeting.locusInfo.onFullLocus(response.body.locus);
169
- }
170
- }).catch(function (err) {
171
- _loggerProxy.default.logger.error("Meeting:util#disconnectPhoneAudio --> An error occured while disconnecting phone audio in meeting ".concat(meeting.id, ", error: ").concat(err));
172
- return _promise.default.reject(err);
173
- });
174
- };
140
+ // @ts-ignore
141
+ webex.internal.newMetrics.submitClientEvent({
142
+ name: 'client.locus.join.request',
143
+ options: {
144
+ meetingId: meeting.id
145
+ }
146
+ });
175
147
 
176
- // by default will leave on meeting's resourceId
177
- // if you explicity want it not to leave on resource id, pass
178
- // {resourceId: null}
179
- // TODO: chris, you can modify this however you want
180
- MeetingUtil.leaveMeeting = function (meeting) {
181
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
182
- if (meeting.meetingState === _constants.FULL_STATE.INACTIVE) {
183
- // TODO: clean up if the meeting is already inactive
184
- return _promise.default.reject(new _webexErrors.MeetingNotActiveError());
185
- }
186
- if (MeetingUtil.isUserInLeftState(meeting.locusInfo)) {
187
- return _promise.default.reject(new _webexErrors.UserNotJoinedError());
188
- }
189
- var defaultOptions = {
190
- locusUrl: meeting.locusUrl,
191
- selfId: meeting.selfId,
192
- correlationId: meeting.correlationId,
193
- resourceId: meeting.resourceId,
194
- deviceUrl: meeting.deviceUrl
195
- };
196
- var leaveOptions = _objectSpread(_objectSpread({}, defaultOptions), options);
197
- return meeting.meetingRequest.leaveMeeting(leaveOptions).then(function (response) {
198
- if (response && response.body && response.body.locus) {
199
- // && !options.moveMeeting) {
200
- meeting.locusInfo.onFullLocus(response.body.locus);
201
- }
202
- return _promise.default.resolve();
203
- }).then(function () {
204
- if (options.moveMeeting) {
205
- return _promise.default.resolve();
206
- }
207
- return MeetingUtil.cleanUp(meeting);
208
- }).catch(function (err) {
209
- // TODO: If the meeting state comes as LEFT or INACTIVE as response then
210
- // 1) on leave clean up the meeting or simply do a sync on the meeting
211
- // 2) If the error says meeting is inactive then destroy the meeting object
212
- _loggerProxy.default.logger.error("Meeting:util#leaveMeeting --> An error occured while trying to leave meeting with an id of ".concat(meeting.id, ", error: ").concat(err));
213
- return _promise.default.reject(err);
214
- });
215
- };
216
- MeetingUtil.declineMeeting = function (meeting, reason) {
217
- return meeting.meetingRequest.declineMeeting({
218
- locusUrl: meeting.locusUrl,
219
- deviceUrl: meeting.deviceUrl,
220
- reason: reason
221
- });
222
- };
223
- MeetingUtil.isUserInLeftState = function (locusInfo) {
224
- var _locusInfo$parsedLocu, _locusInfo$parsedLocu2;
225
- return ((_locusInfo$parsedLocu = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu === void 0 ? void 0 : (_locusInfo$parsedLocu2 = _locusInfo$parsedLocu.self) === null || _locusInfo$parsedLocu2 === void 0 ? void 0 : _locusInfo$parsedLocu2.state) === _constants._LEFT_;
226
- };
227
- MeetingUtil.isUserInIdleState = function (locusInfo) {
228
- var _locusInfo$parsedLocu3, _locusInfo$parsedLocu4;
229
- return ((_locusInfo$parsedLocu3 = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu3 === void 0 ? void 0 : (_locusInfo$parsedLocu4 = _locusInfo$parsedLocu3.self) === null || _locusInfo$parsedLocu4 === void 0 ? void 0 : _locusInfo$parsedLocu4.state) === _constants._IDLE_;
230
- };
231
- MeetingUtil.isUserInJoinedState = function (locusInfo) {
232
- var _locusInfo$parsedLocu5, _locusInfo$parsedLocu6;
233
- return ((_locusInfo$parsedLocu5 = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu5 === void 0 ? void 0 : (_locusInfo$parsedLocu6 = _locusInfo$parsedLocu5.self) === null || _locusInfo$parsedLocu6 === void 0 ? void 0 : _locusInfo$parsedLocu6.state) === _constants._JOINED_;
234
- };
235
- MeetingUtil.isMediaEstablished = function (currentMediaStatus) {
236
- return currentMediaStatus && (currentMediaStatus.audio || currentMediaStatus.video || currentMediaStatus.share);
237
- };
238
- MeetingUtil.joinMeetingOptions = function (meeting) {
239
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
240
- meeting.resourceId = meeting.resourceId || options.resourceId;
241
- if (meeting.requiredCaptcha) {
242
- return _promise.default.reject(new _captchaError.default());
243
- }
244
- if (meeting.passwordStatus === _constants.PASSWORD_STATUS.REQUIRED) {
245
- return _promise.default.reject(new _passwordError.default());
246
- }
247
- if (options.pin) {
248
- _metrics.default.postEvent({
249
- event: _config.eventType.PIN_COLLECTED,
250
- meeting: meeting
148
+ // eslint-disable-next-line no-warning-comments
149
+ // TODO: check if the meeting is in JOINING state
150
+ // if Joining state termintate the request as user might click multiple times
151
+ return meeting.meetingRequest.joinMeeting({
152
+ inviteeAddress: meeting.meetingJoinUrl || meeting.sipUri,
153
+ meetingNumber: meeting.meetingNumber,
154
+ deviceUrl: meeting.deviceUrl,
155
+ locusUrl: meeting.locusUrl,
156
+ locusClusterUrl: (_meeting$meetingInfo = meeting.meetingInfo) === null || _meeting$meetingInfo === void 0 ? void 0 : _meeting$meetingInfo.locusClusterUrl,
157
+ correlationId: meeting.correlationId,
158
+ reachability: options.reachability,
159
+ roapMessage: options.roapMessage,
160
+ permissionToken: meeting.permissionToken,
161
+ resourceId: options.resourceId || null,
162
+ moderator: options.moderator,
163
+ pin: options.pin,
164
+ moveToResource: options.moveToResource,
165
+ preferTranscoding: !meeting.isMultistream,
166
+ asResourceOccupant: options.asResourceOccupant,
167
+ breakoutsSupported: options.breakoutsSupported,
168
+ locale: options.locale,
169
+ deviceCapabilities: options.deviceCapabilities,
170
+ liveAnnotationSupported: options.liveAnnotationSupported,
171
+ ipVersion: MeetingUtil.getIpVersion(meeting.getWebexObject())
172
+ }).then(function (res) {
173
+ // @ts-ignore
174
+ webex.internal.newMetrics.submitClientEvent({
175
+ name: 'client.locus.join.response',
176
+ payload: {
177
+ trigger: 'loci-update',
178
+ identifiers: {
179
+ trackingId: res.headers.trackingid
180
+ }
181
+ },
182
+ options: {
183
+ meetingId: meeting.id,
184
+ mediaConnections: res.body.mediaConnections
185
+ }
186
+ });
187
+ return MeetingUtil.parseLocusJoin(res);
251
188
  });
252
- }
189
+ },
190
+ cleanUp: function cleanUp(meeting) {
191
+ meeting.breakouts.cleanUp();
192
+ meeting.simultaneousInterpretation.cleanUp();
253
193
 
254
- // normal join meeting, scenario A, D
255
- return MeetingUtil.joinMeeting(meeting, options).then(function (response) {
256
- meeting.setLocus(response);
257
- return _promise.default.resolve(response);
258
- }).catch(function (err) {
259
- // joining a claimed PMR that is not my own, scenario B
260
- if (MeetingUtil.isPinOrGuest(err)) {
261
- _metrics.default.postEvent({
262
- event: _config.eventType.PIN_PROMPT,
263
- meeting: meeting
194
+ // make sure we send last metrics before we close the peerconnection
195
+ var stopStatsAnalyzer = meeting.statsAnalyzer ? meeting.statsAnalyzer.stopAnalyzer() : _promise.default.resolve();
196
+ return stopStatsAnalyzer.then(function () {
197
+ return meeting.closeRemoteStreams();
198
+ }).then(function () {
199
+ return meeting.closePeerConnections();
200
+ }).then(function () {
201
+ meeting.cleanupLocalStreams();
202
+ meeting.unsetRemoteStreams();
203
+ meeting.unsetPeerConnections();
204
+ meeting.reconnectionManager.cleanUp();
205
+ }).then(function () {
206
+ return meeting.stopKeepAlive();
207
+ }).then(function () {
208
+ var _meeting$config;
209
+ if ((_meeting$config = meeting.config) !== null && _meeting$config !== void 0 && _meeting$config.enableAutomaticLLM) {
210
+ meeting.updateLLMConnection();
211
+ }
212
+ });
213
+ },
214
+ disconnectPhoneAudio: function disconnectPhoneAudio(meeting, phoneUrl) {
215
+ if (meeting.meetingState === _constants.FULL_STATE.INACTIVE) {
216
+ return _promise.default.reject(new _webexErrors.MeetingNotActiveError());
217
+ }
218
+ var options = {
219
+ locusUrl: meeting.locusUrl,
220
+ selfId: meeting.selfId,
221
+ correlationId: meeting.correlationId,
222
+ phoneUrl: phoneUrl
223
+ };
224
+ return meeting.meetingRequest.disconnectPhoneAudio(options).catch(function (err) {
225
+ _loggerProxy.default.logger.error("Meeting:util#disconnectPhoneAudio --> An error occured while disconnecting phone audio in meeting ".concat(meeting.id, ", error: ").concat(err));
226
+ return _promise.default.reject(err);
227
+ });
228
+ },
229
+ /**
230
+ * Returns options for leaving a meeting.
231
+ * @param {any} meeting
232
+ * @param {any} options
233
+ * @returns {any} leave options
234
+ */
235
+ prepareLeaveMeetingOptions: function prepareLeaveMeetingOptions(meeting) {
236
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
237
+ var defaultOptions = {
238
+ locusUrl: meeting.locusUrl,
239
+ selfId: meeting.selfId,
240
+ correlationId: meeting.correlationId,
241
+ resourceId: meeting.resourceId,
242
+ deviceUrl: meeting.deviceUrl
243
+ };
244
+ return _objectSpread(_objectSpread({}, defaultOptions), options);
245
+ },
246
+ // by default will leave on meeting's resourceId
247
+ // if you explicity want it not to leave on resource id, pass
248
+ // {resourceId: null}
249
+ // TODO: chris, you can modify this however you want
250
+ leaveMeeting: function leaveMeeting(meeting) {
251
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
252
+ if (meeting.meetingState === _constants.FULL_STATE.INACTIVE) {
253
+ // TODO: clean up if the meeting is already inactive
254
+ return _promise.default.reject(new _webexErrors.MeetingNotActiveError());
255
+ }
256
+ if (MeetingUtil.isUserInLeftState(meeting.locusInfo)) {
257
+ return _promise.default.reject(new _webexErrors.UserNotJoinedError());
258
+ }
259
+ var leaveOptions = MeetingUtil.prepareLeaveMeetingOptions(meeting, options);
260
+ return meeting.meetingRequest.leaveMeeting(leaveOptions).then(function () {
261
+ if (options.moveMeeting) {
262
+ return _promise.default.resolve();
263
+ }
264
+ return MeetingUtil.cleanUp(meeting);
265
+ }).catch(function (err) {
266
+ // TODO: If the meeting state comes as LEFT or INACTIVE as response then
267
+ // 1) on leave clean up the meeting or simply do a sync on the meeting
268
+ // 2) If the error says meeting is inactive then destroy the meeting object
269
+ _loggerProxy.default.logger.error("Meeting:util#leaveMeeting --> An error occured while trying to leave meeting with an id of ".concat(meeting.id, ", error: ").concat(err));
270
+ return _promise.default.reject(err);
271
+ });
272
+ },
273
+ declineMeeting: function declineMeeting(meeting, reason) {
274
+ return meeting.meetingRequest.declineMeeting({
275
+ locusUrl: meeting.locusUrl,
276
+ deviceUrl: meeting.deviceUrl,
277
+ reason: reason
278
+ });
279
+ },
280
+ isUserInLeftState: function isUserInLeftState(locusInfo) {
281
+ var _locusInfo$parsedLocu, _locusInfo$parsedLocu2;
282
+ return ((_locusInfo$parsedLocu = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu === void 0 ? void 0 : (_locusInfo$parsedLocu2 = _locusInfo$parsedLocu.self) === null || _locusInfo$parsedLocu2 === void 0 ? void 0 : _locusInfo$parsedLocu2.state) === _constants._LEFT_;
283
+ },
284
+ isUserInIdleState: function isUserInIdleState(locusInfo) {
285
+ var _locusInfo$parsedLocu3, _locusInfo$parsedLocu4;
286
+ return ((_locusInfo$parsedLocu3 = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu3 === void 0 ? void 0 : (_locusInfo$parsedLocu4 = _locusInfo$parsedLocu3.self) === null || _locusInfo$parsedLocu4 === void 0 ? void 0 : _locusInfo$parsedLocu4.state) === _constants._IDLE_;
287
+ },
288
+ isUserInJoinedState: function isUserInJoinedState(locusInfo) {
289
+ var _locusInfo$parsedLocu5, _locusInfo$parsedLocu6;
290
+ return ((_locusInfo$parsedLocu5 = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu5 === void 0 ? void 0 : (_locusInfo$parsedLocu6 = _locusInfo$parsedLocu5.self) === null || _locusInfo$parsedLocu6 === void 0 ? void 0 : _locusInfo$parsedLocu6.state) === _constants._JOINED_;
291
+ },
292
+ isMediaEstablished: function isMediaEstablished(currentMediaStatus) {
293
+ return currentMediaStatus && (currentMediaStatus.audio || currentMediaStatus.video || currentMediaStatus.share);
294
+ },
295
+ joinMeetingOptions: function joinMeetingOptions(meeting) {
296
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
297
+ var webex = meeting.getWebexObject();
298
+ meeting.resourceId = meeting.resourceId || options.resourceId;
299
+ if (meeting.requiredCaptcha) {
300
+ return _promise.default.reject(new _captchaError.default());
301
+ }
302
+ if (meeting.passwordStatus === _constants.PASSWORD_STATUS.REQUIRED) {
303
+ return _promise.default.reject(new _passwordError.default());
304
+ }
305
+ if (options.pin) {
306
+ // @ts-ignore
307
+ webex.internal.newMetrics.submitClientEvent({
308
+ name: 'client.pin.collected',
309
+ options: {
310
+ meetingId: meeting.id
311
+ }
264
312
  });
313
+ }
314
+
315
+ // normal join meeting, scenario A, D
316
+ return MeetingUtil.joinMeeting(meeting, options).then(function (response) {
317
+ meeting.setLocus(response);
318
+ return _promise.default.resolve(response);
319
+ }).catch(function (err) {
320
+ // joining a claimed PMR that is not my own, scenario B
321
+ if (MeetingUtil.isPinOrGuest(err)) {
322
+ // @ts-ignore
323
+ webex.internal.newMetrics.submitClientEvent({
324
+ name: 'client.pin.prompt',
325
+ options: {
326
+ meetingId: meeting.id
327
+ }
328
+ });
265
329
 
266
- // request host pin or non host for unclaimed PMR, start of Scenario C
267
- // see https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-Lobby-and--IVR-Feature
268
- return _promise.default.reject(new _intentToJoin.default('Error Joining Meeting', err));
330
+ // request host pin or non host for unclaimed PMR, start of Scenario C
331
+ // see https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-Lobby-and--IVR-Feature
332
+ return _promise.default.reject(new _intentToJoin.default('Error Joining Meeting', err));
333
+ }
334
+ _loggerProxy.default.logger.error('Meeting:util#joinMeetingOptions --> Error joining the call, ', err);
335
+ return _promise.default.reject(new _joinMeeting.default(options, 'Error Joining Meeting', err));
336
+ });
337
+ },
338
+ /**
339
+ * Returns request options for leaving a meeting.
340
+ * @param {any} meeting
341
+ * @param {any} options
342
+ * @returns {any} request options
343
+ */
344
+ buildLeaveFetchRequestOptions: function buildLeaveFetchRequestOptions(meeting) {
345
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
346
+ var leaveOptions = MeetingUtil.prepareLeaveMeetingOptions(meeting, options);
347
+ return meeting.meetingRequest.buildLeaveMeetingRequestOptions(leaveOptions);
348
+ },
349
+ getTrack: function getTrack(stream) {
350
+ var audioTrack = null;
351
+ var videoTrack = null;
352
+ var audioTracks = null;
353
+ var videoTracks = null;
354
+ if (!stream) {
355
+ return {
356
+ audioTrack: null,
357
+ videoTrack: null
358
+ };
359
+ }
360
+ if (stream.getAudioTracks) {
361
+ audioTracks = stream.getAudioTracks();
362
+ }
363
+ if (stream.getVideoTracks) {
364
+ videoTracks = stream.getVideoTracks();
365
+ }
366
+ if (audioTracks && audioTracks.length > 0) {
367
+ var _audioTracks = audioTracks;
368
+ var _audioTracks2 = (0, _slicedToArray2.default)(_audioTracks, 1);
369
+ audioTrack = _audioTracks2[0];
370
+ }
371
+ if (videoTracks && videoTracks.length > 0) {
372
+ var _videoTracks = videoTracks;
373
+ var _videoTracks2 = (0, _slicedToArray2.default)(_videoTracks, 1);
374
+ videoTrack = _videoTracks2[0];
269
375
  }
270
- _loggerProxy.default.logger.error('Meeting:util#joinMeetingOptions --> Error joining the call, ', err);
271
- return _promise.default.reject(new _joinMeeting.default(options, 'Error Joining Meeting', err));
272
- });
273
- };
274
- MeetingUtil.validateOptions = function (options) {
275
- var sendVideo = options.sendVideo,
276
- sendAudio = options.sendAudio,
277
- sendShare = options.sendShare,
278
- localStream = options.localStream,
279
- localShare = options.localShare;
280
- if (sendVideo && !MeetingUtil.getTrack(localStream).videoTrack) {
281
- return _promise.default.reject(new _parameter.default('please pass valid video streams'));
282
- }
283
- if (sendAudio && !MeetingUtil.getTrack(localStream).audioTrack) {
284
- return _promise.default.reject(new _parameter.default('please pass valid audio streams'));
285
- }
286
- if (sendShare && !MeetingUtil.getTrack(localShare).videoTrack) {
287
- return _promise.default.reject(new _parameter.default('please pass valid share streams'));
288
- }
289
- return _promise.default.resolve();
290
- };
291
- MeetingUtil.getTrack = function (stream) {
292
- var audioTrack = null;
293
- var videoTrack = null;
294
- var audioTracks = null;
295
- var videoTracks = null;
296
- if (!stream) {
297
376
  return {
298
- audioTrack: null,
299
- videoTrack: null
377
+ audioTrack: audioTrack,
378
+ videoTrack: videoTrack
300
379
  };
301
- }
302
- if (stream.getAudioTracks) {
303
- audioTracks = stream.getAudioTracks();
304
- }
305
- if (stream.getVideoTracks) {
306
- videoTracks = stream.getVideoTracks();
307
- }
308
- if (audioTracks && audioTracks.length > 0) {
309
- var _audioTracks = audioTracks;
310
- var _audioTracks2 = (0, _slicedToArray2.default)(_audioTracks, 1);
311
- audioTrack = _audioTracks2[0];
312
- }
313
- if (videoTracks && videoTracks.length > 0) {
314
- var _videoTracks = videoTracks;
315
- var _videoTracks2 = (0, _slicedToArray2.default)(_videoTracks, 1);
316
- videoTrack = _videoTracks2[0];
317
- }
318
- return {
319
- audioTrack: audioTrack,
320
- videoTrack: videoTrack
321
- };
322
- };
323
- MeetingUtil.getModeratorFromLocusInfo = function (locusInfo) {
324
- return locusInfo && locusInfo.parsedLocus && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info.moderator;
325
- };
326
- MeetingUtil.getPolicyFromLocusInfo = function (locusInfo) {
327
- return locusInfo && locusInfo.parsedLocus && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info.policy;
328
- };
329
- MeetingUtil.getUserDisplayHintsFromLocusInfo = function (locusInfo) {
330
- var _locusInfo$parsedLocu7, _locusInfo$parsedLocu8;
331
- return (locusInfo === null || locusInfo === void 0 ? void 0 : (_locusInfo$parsedLocu7 = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu7 === void 0 ? void 0 : (_locusInfo$parsedLocu8 = _locusInfo$parsedLocu7.info) === null || _locusInfo$parsedLocu8 === void 0 ? void 0 : _locusInfo$parsedLocu8.userDisplayHints) || [];
332
- };
333
- MeetingUtil.canInviteNewParticipants = function (displayHints) {
334
- return displayHints.includes(_constants.DISPLAY_HINTS.ADD_GUEST);
335
- };
336
- MeetingUtil.canAdmitParticipant = function (displayHints) {
337
- return displayHints.includes(_constants.DISPLAY_HINTS.ROSTER_WAITING_TO_JOIN);
338
- };
339
- MeetingUtil.canUserLock = function (displayHints) {
340
- return displayHints.includes(_constants.DISPLAY_HINTS.LOCK_CONTROL_LOCK) && displayHints.includes(_constants.DISPLAY_HINTS.LOCK_STATUS_UNLOCKED);
341
- };
342
- MeetingUtil.canUserUnlock = function (displayHints) {
343
- return displayHints.includes(_constants.DISPLAY_HINTS.LOCK_CONTROL_UNLOCK) && displayHints.includes(_constants.DISPLAY_HINTS.LOCK_STATUS_LOCKED);
344
- };
345
- MeetingUtil.canUserRaiseHand = function (displayHints) {
346
- return displayHints.includes(_constants.DISPLAY_HINTS.RAISE_HAND);
347
- };
348
- MeetingUtil.canUserLowerAllHands = function (displayHints) {
349
- return displayHints.includes(_constants.DISPLAY_HINTS.LOWER_ALL_HANDS);
350
- };
351
- MeetingUtil.canUserLowerSomeoneElsesHand = function (displayHints) {
352
- return displayHints.includes(_constants.DISPLAY_HINTS.LOWER_SOMEONE_ELSES_HAND);
353
- };
354
- MeetingUtil.bothLeaveAndEndMeetingAvailable = function (displayHints) {
355
- return displayHints.includes(_constants.DISPLAY_HINTS.LEAVE_TRANSFER_HOST_END_MEETING) || displayHints.includes(_constants.DISPLAY_HINTS.LEAVE_END_MEETING);
356
- };
357
- MeetingUtil.lockMeeting = function (actions, request, locusUrl) {
358
- if (actions && actions.canLock) {
359
- return request.lockMeeting({
360
- locusUrl: locusUrl,
361
- lock: true
380
+ },
381
+ getModeratorFromLocusInfo: function getModeratorFromLocusInfo(locusInfo) {
382
+ return locusInfo && locusInfo.parsedLocus && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info.moderator;
383
+ },
384
+ getPolicyFromLocusInfo: function getPolicyFromLocusInfo(locusInfo) {
385
+ return locusInfo && locusInfo.parsedLocus && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info && locusInfo.parsedLocus.info.policy;
386
+ },
387
+ getUserDisplayHintsFromLocusInfo: function getUserDisplayHintsFromLocusInfo(locusInfo) {
388
+ var _locusInfo$parsedLocu7, _locusInfo$parsedLocu8;
389
+ return (locusInfo === null || locusInfo === void 0 ? void 0 : (_locusInfo$parsedLocu7 = locusInfo.parsedLocus) === null || _locusInfo$parsedLocu7 === void 0 ? void 0 : (_locusInfo$parsedLocu8 = _locusInfo$parsedLocu7.info) === null || _locusInfo$parsedLocu8 === void 0 ? void 0 : _locusInfo$parsedLocu8.userDisplayHints) || [];
390
+ },
391
+ canInviteNewParticipants: function canInviteNewParticipants(displayHints) {
392
+ return displayHints.includes(_constants.DISPLAY_HINTS.ADD_GUEST);
393
+ },
394
+ canAdmitParticipant: function canAdmitParticipant(displayHints) {
395
+ return displayHints.includes(_constants.DISPLAY_HINTS.ROSTER_WAITING_TO_JOIN);
396
+ },
397
+ canUserLock: function canUserLock(displayHints) {
398
+ return displayHints.includes(_constants.DISPLAY_HINTS.LOCK_CONTROL_LOCK) && displayHints.includes(_constants.DISPLAY_HINTS.LOCK_STATUS_UNLOCKED);
399
+ },
400
+ canUserUnlock: function canUserUnlock(displayHints) {
401
+ return displayHints.includes(_constants.DISPLAY_HINTS.LOCK_CONTROL_UNLOCK) && displayHints.includes(_constants.DISPLAY_HINTS.LOCK_STATUS_LOCKED);
402
+ },
403
+ canUserRaiseHand: function canUserRaiseHand(displayHints) {
404
+ return displayHints.includes(_constants.DISPLAY_HINTS.RAISE_HAND);
405
+ },
406
+ canUserLowerAllHands: function canUserLowerAllHands(displayHints) {
407
+ return displayHints.includes(_constants.DISPLAY_HINTS.LOWER_ALL_HANDS);
408
+ },
409
+ canUserLowerSomeoneElsesHand: function canUserLowerSomeoneElsesHand(displayHints) {
410
+ return displayHints.includes(_constants.DISPLAY_HINTS.LOWER_SOMEONE_ELSES_HAND);
411
+ },
412
+ bothLeaveAndEndMeetingAvailable: function bothLeaveAndEndMeetingAvailable(displayHints) {
413
+ return displayHints.includes(_constants.DISPLAY_HINTS.LEAVE_TRANSFER_HOST_END_MEETING) || displayHints.includes(_constants.DISPLAY_HINTS.LEAVE_END_MEETING);
414
+ },
415
+ canManageBreakout: function canManageBreakout(displayHints) {
416
+ return displayHints.includes(_constants.DISPLAY_HINTS.BREAKOUT_MANAGEMENT);
417
+ },
418
+ canBroadcastMessageToBreakout: function canBroadcastMessageToBreakout(displayHints) {
419
+ var policies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
420
+ return displayHints.includes(_constants.DISPLAY_HINTS.BROADCAST_MESSAGE_TO_BREAKOUT) && !!policies[_constants.SELF_POLICY.SUPPORT_BROADCAST_MESSAGE];
421
+ },
422
+ isSuppressBreakoutSupport: function isSuppressBreakoutSupport(displayHints) {
423
+ return displayHints.includes(_constants.DISPLAY_HINTS.UCF_SUPPRESS_BREAKOUTS_SUPPORT);
424
+ },
425
+ canAdmitLobbyToBreakout: function canAdmitLobbyToBreakout(displayHints) {
426
+ return !displayHints.includes(_constants.DISPLAY_HINTS.DISABLE_LOBBY_TO_BREAKOUT);
427
+ },
428
+ isBreakoutPreassignmentsEnabled: function isBreakoutPreassignmentsEnabled(displayHints) {
429
+ return !displayHints.includes(_constants.DISPLAY_HINTS.DISABLE_BREAKOUT_PREASSIGNMENTS);
430
+ },
431
+ canUserAskForHelp: function canUserAskForHelp(displayHints) {
432
+ return !displayHints.includes(_constants.DISPLAY_HINTS.DISABLE_ASK_FOR_HELP);
433
+ },
434
+ lockMeeting: function lockMeeting(actions, request, locusUrl) {
435
+ if (actions && actions.canLock) {
436
+ return request.lockMeeting({
437
+ locusUrl: locusUrl,
438
+ lock: true
439
+ });
440
+ }
441
+ return _promise.default.reject(new _permission.default('Lock not allowed, due to joined property.'));
442
+ },
443
+ unlockMeeting: function unlockMeeting(actions, request, locusUrl) {
444
+ if (actions && actions.canUnlock) {
445
+ return request.lockMeeting({
446
+ locusUrl: locusUrl,
447
+ lock: false
448
+ });
449
+ }
450
+ return _promise.default.reject(new _permission.default('Unlock not allowed, due to joined property.'));
451
+ },
452
+ handleAudioLogging: function handleAudioLogging(audioStream) {
453
+ var LOG_HEADER = 'MeetingUtil#handleAudioLogging -->';
454
+ if (audioStream) {
455
+ var settings = audioStream.getSettings();
456
+ var deviceId = settings.deviceId;
457
+ _loggerProxy.default.logger.log(LOG_HEADER, "deviceId = ".concat(deviceId));
458
+ _loggerProxy.default.logger.log(LOG_HEADER, 'settings =', (0, _stringify.default)(settings));
459
+ }
460
+ },
461
+ handleVideoLogging: function handleVideoLogging(videoStream) {
462
+ var LOG_HEADER = 'MeetingUtil#handleVideoLogging -->';
463
+ if (videoStream) {
464
+ var settings = videoStream.getSettings();
465
+ var deviceId = settings.deviceId;
466
+ _loggerProxy.default.logger.log(LOG_HEADER, "deviceId = ".concat(deviceId));
467
+ _loggerProxy.default.logger.log(LOG_HEADER, 'settings =', (0, _stringify.default)(settings));
468
+ }
469
+ },
470
+ handleDeviceLogging: function handleDeviceLogging() {
471
+ var devices = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
472
+ var LOG_HEADER = 'MeetingUtil#handleDeviceLogging -->';
473
+ devices.forEach(function (device) {
474
+ _loggerProxy.default.logger.log(LOG_HEADER, "deviceId = ".concat(device.deviceId));
475
+ _loggerProxy.default.logger.log(LOG_HEADER, 'settings', (0, _stringify.default)(device));
362
476
  });
363
- }
364
- return _promise.default.reject(new _permission.default('Lock not allowed, due to joined property.'));
365
- };
366
- MeetingUtil.unlockMeeting = function (actions, request, locusUrl) {
367
- if (actions && actions.canUnlock) {
368
- return request.lockMeeting({
369
- locusUrl: locusUrl,
370
- lock: false
477
+ },
478
+ endMeetingForAll: function endMeetingForAll(meeting) {
479
+ if (meeting.meetingState === _constants.FULL_STATE.INACTIVE) {
480
+ return _promise.default.reject(new _webexErrors.MeetingNotActiveError());
481
+ }
482
+ var endOptions = {
483
+ locusUrl: meeting.locusUrl
484
+ };
485
+ return meeting.meetingRequest.endMeetingForAll(endOptions).then(function () {
486
+ return MeetingUtil.cleanUp(meeting);
487
+ }).catch(function (err) {
488
+ _loggerProxy.default.logger.error("Meeting:util#endMeetingForAll An error occured while trying to end meeting for all with an id of ".concat(meeting.id, ", error: ").concat(err));
489
+ return _promise.default.reject(err);
371
490
  });
491
+ },
492
+ canEnableClosedCaption: function canEnableClosedCaption(displayHints) {
493
+ return displayHints.includes(_constants.DISPLAY_HINTS.CAPTION_START);
494
+ },
495
+ isSaveTranscriptsEnabled: function isSaveTranscriptsEnabled(displayHints) {
496
+ return displayHints.includes(_constants.DISPLAY_HINTS.SAVE_TRANSCRIPTS_ENABLED);
497
+ },
498
+ canStartTranscribing: function canStartTranscribing(displayHints) {
499
+ return displayHints.includes(_constants.DISPLAY_HINTS.TRANSCRIPTION_CONTROL_START);
500
+ },
501
+ canStopTranscribing: function canStopTranscribing(displayHints) {
502
+ return displayHints.includes(_constants.DISPLAY_HINTS.TRANSCRIPTION_CONTROL_STOP);
503
+ },
504
+ isClosedCaptionActive: function isClosedCaptionActive(displayHints) {
505
+ return displayHints.includes(_constants.DISPLAY_HINTS.CAPTION_STATUS_ACTIVE);
506
+ },
507
+ isWebexAssistantActive: function isWebexAssistantActive(displayHints) {
508
+ return displayHints.includes(_constants.DISPLAY_HINTS.WEBEX_ASSISTANT_STATUS_ACTIVE);
509
+ },
510
+ canViewCaptionPanel: function canViewCaptionPanel(displayHints) {
511
+ return displayHints.includes(_constants.DISPLAY_HINTS.ENABLE_CAPTION_PANEL);
512
+ },
513
+ isRealTimeTranslationEnabled: function isRealTimeTranslationEnabled(displayHints) {
514
+ return displayHints.includes(_constants.DISPLAY_HINTS.DISPLAY_REAL_TIME_TRANSLATION);
515
+ },
516
+ canSelectSpokenLanguages: function canSelectSpokenLanguages(displayHints) {
517
+ return displayHints.includes(_constants.DISPLAY_HINTS.DISPLAY_NON_ENGLISH_ASR);
518
+ },
519
+ waitingForOthersToJoin: function waitingForOthersToJoin(displayHints) {
520
+ return displayHints.includes(_constants.DISPLAY_HINTS.WAITING_FOR_OTHERS);
521
+ },
522
+ canSendReactions: function canSendReactions(originalValue, displayHints) {
523
+ if (displayHints.includes(_constants.DISPLAY_HINTS.REACTIONS_ACTIVE)) {
524
+ return true;
525
+ }
526
+ if (displayHints.includes(_constants.DISPLAY_HINTS.REACTIONS_INACTIVE)) {
527
+ return false;
528
+ }
529
+ return originalValue;
530
+ },
531
+ canUserRenameSelfAndObserved: function canUserRenameSelfAndObserved(displayHints) {
532
+ return displayHints.includes(_constants.DISPLAY_HINTS.CAN_RENAME_SELF_AND_OBSERVED);
533
+ },
534
+ canUserRenameOthers: function canUserRenameOthers(displayHints) {
535
+ return displayHints.includes(_constants.DISPLAY_HINTS.CAN_RENAME_OTHERS);
536
+ },
537
+ canShareWhiteBoard: function canShareWhiteBoard(displayHints) {
538
+ return displayHints.includes(_constants.DISPLAY_HINTS.SHARE_WHITEBOARD);
539
+ },
540
+ /**
541
+ * Adds the current locus sequence information to a request body
542
+ * @param {Object} meeting The meeting object
543
+ * @param {Object} requestBody The body of a request to locus
544
+ * @returns {void}
545
+ */
546
+ addSequence: function addSequence(meeting, requestBody) {
547
+ var _meeting$locusInfo;
548
+ var sequence = meeting === null || meeting === void 0 ? void 0 : (_meeting$locusInfo = meeting.locusInfo) === null || _meeting$locusInfo === void 0 ? void 0 : _meeting$locusInfo.sequence;
549
+ if (!sequence) {
550
+ return;
551
+ }
552
+ requestBody.sequence = sequence;
553
+ },
554
+ /**
555
+ * Updates the locus info for the meeting with the delta locus
556
+ * returned from requests that include the sequence information
557
+ * Returns the original response object
558
+ * @param {Object} meeting The meeting object
559
+ * @param {Object} response The response of the http request
560
+ * @returns {Object}
561
+ */
562
+ updateLocusWithDelta: function updateLocusWithDelta(meeting, response) {
563
+ var _response$body2;
564
+ if (!meeting) {
565
+ return response;
566
+ }
567
+ var locus = response === null || response === void 0 ? void 0 : (_response$body2 = response.body) === null || _response$body2 === void 0 ? void 0 : _response$body2.locus;
568
+ if (locus) {
569
+ meeting.locusInfo.handleLocusDelta(locus, meeting);
570
+ }
571
+ return response;
572
+ },
573
+ generateBuildLocusDeltaRequestOptions: function generateBuildLocusDeltaRequestOptions(originalMeeting) {
574
+ var meetingRef = new WeakRef(originalMeeting);
575
+ var buildLocusDeltaRequestOptions = function buildLocusDeltaRequestOptions(originalOptions) {
576
+ var meeting = meetingRef.deref();
577
+ if (!meeting) {
578
+ return originalOptions;
579
+ }
580
+ var options = (0, _cloneDeep2.default)(originalOptions);
581
+ if (!options.body) {
582
+ options.body = {};
583
+ }
584
+ MeetingUtil.addSequence(meeting, options.body);
585
+ return options;
586
+ };
587
+ return buildLocusDeltaRequestOptions;
588
+ },
589
+ generateLocusDeltaRequest: function generateLocusDeltaRequest(originalMeeting) {
590
+ var meetingRef = new WeakRef(originalMeeting);
591
+ var buildLocusDeltaRequestOptions = MeetingUtil.generateBuildLocusDeltaRequestOptions(originalMeeting);
592
+ var locusDeltaRequest = function locusDeltaRequest(originalOptions) {
593
+ var meeting = meetingRef.deref();
594
+ if (!meeting) {
595
+ return _promise.default.resolve();
596
+ }
597
+ var options = buildLocusDeltaRequestOptions(originalOptions);
598
+ return meeting.request(options).then(function (response) {
599
+ return MeetingUtil.updateLocusWithDelta(meeting, response);
600
+ });
601
+ };
602
+ return locusDeltaRequest;
603
+ },
604
+ selfSupportsFeature: function selfSupportsFeature(feature, userPolicies) {
605
+ if (!userPolicies) {
606
+ return true;
607
+ }
608
+ return userPolicies[feature];
609
+ },
610
+ parseInterpretationInfo: function parseInterpretationInfo(meeting, meetingInfo) {
611
+ var _meetingInfo$meetingS;
612
+ if (!meeting || !meetingInfo) {
613
+ return;
614
+ }
615
+ var siInfo = meetingInfo.simultaneousInterpretation;
616
+ meeting.simultaneousInterpretation.updateMeetingSIEnabled(!!meetingInfo.turnOnSimultaneousInterpretation, !!(siInfo !== null && siInfo !== void 0 && siInfo.currentSIInterpreter));
617
+ var hostSIEnabled = !!(meetingInfo.turnOnSimultaneousInterpretation && meetingInfo !== null && meetingInfo !== void 0 && (_meetingInfo$meetingS = meetingInfo.meetingSiteSetting) !== null && _meetingInfo$meetingS !== void 0 && _meetingInfo$meetingS.enableHostInterpreterControlSI);
618
+ meeting.simultaneousInterpretation.updateHostSIEnabled(hostSIEnabled);
619
+ function renameKey(obj, oldKey, newKey) {
620
+ if (oldKey in obj) {
621
+ obj[newKey] = obj[oldKey];
622
+ delete obj[oldKey];
623
+ }
624
+ }
625
+ if (siInfo) {
626
+ var _meeting$simultaneous, _meeting$simultaneous2;
627
+ var lanuagesInfo = (0, _cloneDeep2.default)(siInfo.siLanguages);
628
+ var _iterator = _createForOfIteratorHelper(lanuagesInfo),
629
+ _step;
630
+ try {
631
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
632
+ var language = _step.value;
633
+ renameKey(language, 'languageCode', 'languageName');
634
+ renameKey(language, 'languageGroupId', 'languageCode');
635
+ }
636
+ } catch (err) {
637
+ _iterator.e(err);
638
+ } finally {
639
+ _iterator.f();
640
+ }
641
+ if (!((_meeting$simultaneous = meeting.simultaneousInterpretation) !== null && _meeting$simultaneous !== void 0 && (_meeting$simultaneous2 = _meeting$simultaneous.siLanguages) !== null && _meeting$simultaneous2 !== void 0 && _meeting$simultaneous2.length)) {
642
+ meeting.simultaneousInterpretation.updateInterpretation({
643
+ siLanguages: lanuagesInfo
644
+ });
645
+ }
646
+ }
647
+ _triggerProxy.default.trigger(meeting, {
648
+ file: 'meeting/util',
649
+ function: 'parseInterpretationInfo'
650
+ }, _constants.EVENT_TRIGGERS.MEETING_INTERPRETATION_UPDATE);
651
+ },
652
+ /**
653
+ * Returns a CA-recognized error payload for the specified raw error message/reason.
654
+ *
655
+ * New errors can be added to this function for handling in the future
656
+ *
657
+ * @param {String} reason the raw error message
658
+ * @returns {Array<object>} an array of payload objects
659
+ */
660
+ getChangeMeetingFloorErrorPayload: function getChangeMeetingFloorErrorPayload(reason) {
661
+ var errorPayload = {
662
+ errorDescription: reason,
663
+ name: 'locus.response',
664
+ shownToUser: false
665
+ };
666
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.UNDEFINED)) {
667
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
668
+ fatal: true,
669
+ category: 'signaling',
670
+ errorCode: 1100
671
+ })];
672
+ }
673
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.DEVICE_NOT_JOINED)) {
674
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
675
+ fatal: true,
676
+ category: 'signaling',
677
+ errorCode: 4050
678
+ })];
679
+ }
680
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.NO_MEDIA_FOR_DEVICE)) {
681
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
682
+ fatal: true,
683
+ category: 'media',
684
+ errorCode: 2048
685
+ })];
686
+ }
687
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.NO_CONFLUENCE_ID)) {
688
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
689
+ fatal: true,
690
+ category: 'signaling',
691
+ errorCode: 4064
692
+ })];
693
+ }
694
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.CONTENT_SHARING_DISABLED)) {
695
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
696
+ fatal: true,
697
+ category: 'expected',
698
+ errorCode: 4065
699
+ })];
700
+ }
701
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.LOCUS_PARTICIPANT_DNE)) {
702
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
703
+ fatal: true,
704
+ category: 'signaling',
705
+ errorCode: 4066
706
+ })];
707
+ }
708
+ if (reason.includes(_constants.LOCAL_SHARE_ERRORS.CONTENT_REQUEST_WHILE_PENDING_WHITEBOARD)) {
709
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
710
+ fatal: true,
711
+ category: 'expected',
712
+ errorCode: 4067
713
+ })];
714
+ }
715
+
716
+ // return unknown error
717
+ return [_objectSpread(_objectSpread({}, errorPayload), {}, {
718
+ fatal: true,
719
+ category: 'signaling',
720
+ errorCode: 1100
721
+ })];
372
722
  }
373
- return _promise.default.reject(new _permission.default('Unlock not allowed, due to joined property.'));
374
- };
375
- MeetingUtil.handleAudioLogging = function (audioTrack) {
376
- var LOG_HEADER = 'MeetingUtil#handleAudioLogging -->';
377
- if (audioTrack) {
378
- var settings = audioTrack.underlyingTrack.getSettings();
379
- var deviceId = settings.deviceId;
380
- _loggerProxy.default.logger.log(LOG_HEADER, "deviceId = ".concat(deviceId));
381
- _loggerProxy.default.logger.log(LOG_HEADER, 'settings =', (0, _stringify.default)(settings));
382
- }
383
- };
384
- MeetingUtil.handleVideoLogging = function (videoTrack) {
385
- var LOG_HEADER = 'MeetingUtil#handleVideoLogging -->';
386
- if (videoTrack) {
387
- var settings = videoTrack.underlyingTrack.getSettings();
388
- var deviceId = settings.deviceId;
389
- _loggerProxy.default.logger.log(LOG_HEADER, "deviceId = ".concat(deviceId));
390
- _loggerProxy.default.logger.log(LOG_HEADER, 'settings =', (0, _stringify.default)(settings));
391
- }
392
- };
393
- MeetingUtil.handleDeviceLogging = function () {
394
- var devices = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
395
- var LOG_HEADER = 'MeetingUtil#handleDeviceLogging -->';
396
- devices.forEach(function (device) {
397
- _loggerProxy.default.logger.log(LOG_HEADER, "deviceId = ".concat(device.deviceId));
398
- _loggerProxy.default.logger.log(LOG_HEADER, 'settings', (0, _stringify.default)(device));
399
- });
400
- };
401
- MeetingUtil.endMeetingForAll = function (meeting) {
402
- if (meeting.meetingState === _constants.FULL_STATE.INACTIVE) {
403
- return _promise.default.reject(new _webexErrors.MeetingNotActiveError());
404
- }
405
- var endOptions = {
406
- locusUrl: meeting.locusUrl
407
- };
408
- return meeting.meetingRequest.endMeetingForAll(endOptions).then(function (response) {
409
- if (response && response.body && response.body.locus) {
410
- meeting.locusInfo.onFullLocus(response.body.locus);
411
- }
412
- return _promise.default.resolve();
413
- }).then(function () {
414
- return MeetingUtil.cleanUp(meeting);
415
- }).catch(function (err) {
416
- _loggerProxy.default.logger.error("Meeting:util#endMeetingForAll An error occured while trying to end meeting for all with an id of ".concat(meeting.id, ", error: ").concat(err));
417
- return _promise.default.reject(err);
418
- });
419
- };
420
- MeetingUtil.canEnableClosedCaption = function (displayHints) {
421
- return displayHints.includes(_constants.DISPLAY_HINTS.CAPTION_START);
422
- };
423
- MeetingUtil.canStartTranscribing = function (displayHints) {
424
- return displayHints.includes(_constants.DISPLAY_HINTS.TRANSCRIPTION_CONTROL_START);
425
- };
426
- MeetingUtil.canStopTranscribing = function (displayHints) {
427
- return displayHints.includes(_constants.DISPLAY_HINTS.TRANSCRIPTION_CONTROL_STOP);
428
- };
429
- MeetingUtil.isClosedCaptionActive = function (displayHints) {
430
- return displayHints.includes(_constants.DISPLAY_HINTS.CAPTION_STATUS_ACTIVE);
431
- };
432
- MeetingUtil.isWebexAssistantActive = function (displayHints) {
433
- return displayHints.includes(_constants.DISPLAY_HINTS.WEBEX_ASSISTANT_STATUS_ACTIVE);
434
- };
435
- MeetingUtil.canViewCaptionPanel = function (displayHints) {
436
- return displayHints.includes(_constants.DISPLAY_HINTS.ENABLE_CAPTION_PANEL);
437
- };
438
- MeetingUtil.isRealTimeTranslationEnabled = function (displayHints) {
439
- return displayHints.includes(_constants.DISPLAY_HINTS.DISPLAY_REAL_TIME_TRANSLATION);
440
- };
441
- MeetingUtil.canSelectSpokenLanguages = function (displayHints) {
442
- return displayHints.includes(_constants.DISPLAY_HINTS.DISPLAY_NON_ENGLISH_ASR);
443
- };
444
- MeetingUtil.waitingForOthersToJoin = function (displayHints) {
445
- return displayHints.includes(_constants.DISPLAY_HINTS.WAITING_FOR_OTHERS);
446
- };
447
- MeetingUtil.canEnableReactions = function (originalValue, displayHints) {
448
- if (displayHints.includes(_constants.DISPLAY_HINTS.ENABLE_REACTIONS)) {
449
- return true;
450
- }
451
- if (displayHints.includes(_constants.DISPLAY_HINTS.DISABLE_REACTIONS)) {
452
- return false;
453
- }
454
- return originalValue;
455
- };
456
- MeetingUtil.canSendReactions = function (originalValue, displayHints) {
457
- if (displayHints.includes(_constants.DISPLAY_HINTS.REACTIONS_ACTIVE)) {
458
- return true;
459
- }
460
- if (displayHints.includes(_constants.DISPLAY_HINTS.REACTIONS_INACTIVE)) {
461
- return false;
462
- }
463
- return originalValue;
464
723
  };
465
724
  var _default = MeetingUtil;
466
725
  exports.default = _default;