@webex/plugin-meetings 3.0.0-beta.16 → 3.0.0-beta.160

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 (408) hide show
  1. package/README.md +45 -1
  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 +359 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +212 -0
  9. package/dist/breakouts/breakout.js.map +1 -0
  10. package/dist/breakouts/collection.js +23 -0
  11. package/dist/breakouts/collection.js.map +1 -0
  12. package/dist/breakouts/edit-lock-error.js +52 -0
  13. package/dist/breakouts/edit-lock-error.js.map +1 -0
  14. package/dist/breakouts/events.js +43 -0
  15. package/dist/breakouts/events.js.map +1 -0
  16. package/dist/breakouts/index.js +1046 -0
  17. package/dist/breakouts/index.js.map +1 -0
  18. package/dist/breakouts/request.js +78 -0
  19. package/dist/breakouts/request.js.map +1 -0
  20. package/dist/breakouts/utils.js +67 -0
  21. package/dist/breakouts/utils.js.map +1 -0
  22. package/dist/common/errors/webex-errors.js +3 -2
  23. package/dist/common/errors/webex-errors.js.map +1 -1
  24. package/dist/common/logs/logger-proxy.js +1 -1
  25. package/dist/common/logs/logger-proxy.js.map +1 -1
  26. package/dist/config.js +6 -8
  27. package/dist/config.js.map +1 -1
  28. package/dist/constants.js +165 -26
  29. package/dist/constants.js.map +1 -1
  30. package/dist/controls-options-manager/constants.js +14 -0
  31. package/dist/controls-options-manager/constants.js.map +1 -0
  32. package/dist/controls-options-manager/enums.js +27 -0
  33. package/dist/controls-options-manager/enums.js.map +1 -0
  34. package/dist/controls-options-manager/index.js +297 -0
  35. package/dist/controls-options-manager/index.js.map +1 -0
  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 +300 -0
  39. package/dist/controls-options-manager/util.js.map +1 -0
  40. package/dist/index.js +77 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/locus-info/controlsUtils.js +91 -2
  43. package/dist/locus-info/controlsUtils.js.map +1 -1
  44. package/dist/locus-info/index.js +298 -24
  45. package/dist/locus-info/index.js.map +1 -1
  46. package/dist/locus-info/mediaSharesUtils.js +43 -1
  47. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  48. package/dist/locus-info/parser.js +2 -1
  49. package/dist/locus-info/parser.js.map +1 -1
  50. package/dist/locus-info/selfUtils.js +88 -14
  51. package/dist/locus-info/selfUtils.js.map +1 -1
  52. package/dist/media/index.js +39 -134
  53. package/dist/media/index.js.map +1 -1
  54. package/dist/media/properties.js +19 -97
  55. package/dist/media/properties.js.map +1 -1
  56. package/dist/mediaQualityMetrics/config.js +505 -493
  57. package/dist/mediaQualityMetrics/config.js.map +1 -1
  58. package/dist/meeting/in-meeting-actions.js +79 -1
  59. package/dist/meeting/in-meeting-actions.js.map +1 -1
  60. package/dist/meeting/index.js +2275 -2152
  61. package/dist/meeting/index.js.map +1 -1
  62. package/dist/meeting/locusMediaRequest.js +291 -0
  63. package/dist/meeting/locusMediaRequest.js.map +1 -0
  64. package/dist/meeting/muteState.js +229 -124
  65. package/dist/meeting/muteState.js.map +1 -1
  66. package/dist/meeting/request.js +191 -167
  67. package/dist/meeting/request.js.map +1 -1
  68. package/dist/meeting/request.type.js.map +1 -1
  69. package/dist/meeting/util.js +443 -443
  70. package/dist/meeting/util.js.map +1 -1
  71. package/dist/meeting-info/meeting-info-v2.js +157 -49
  72. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  73. package/dist/meeting-info/utilv2.js +20 -5
  74. package/dist/meeting-info/utilv2.js.map +1 -1
  75. package/dist/meetings/collection.js +22 -0
  76. package/dist/meetings/collection.js.map +1 -1
  77. package/dist/meetings/index.js +365 -73
  78. package/dist/meetings/index.js.map +1 -1
  79. package/dist/meetings/meetings.types.js +7 -0
  80. package/dist/meetings/meetings.types.js.map +1 -0
  81. package/dist/meetings/request.js +16 -12
  82. package/dist/meetings/request.js.map +1 -1
  83. package/dist/meetings/util.js +88 -1
  84. package/dist/meetings/util.js.map +1 -1
  85. package/dist/member/index.js +41 -0
  86. package/dist/member/index.js.map +1 -1
  87. package/dist/member/types.js +15 -0
  88. package/dist/member/types.js.map +1 -0
  89. package/dist/member/util.js +86 -3
  90. package/dist/member/util.js.map +1 -1
  91. package/dist/members/collection.js +10 -0
  92. package/dist/members/collection.js.map +1 -1
  93. package/dist/members/index.js +94 -11
  94. package/dist/members/index.js.map +1 -1
  95. package/dist/members/request.js +109 -39
  96. package/dist/members/request.js.map +1 -1
  97. package/dist/members/types.js +15 -0
  98. package/dist/members/types.js.map +1 -0
  99. package/dist/members/util.js +316 -233
  100. package/dist/members/util.js.map +1 -1
  101. package/dist/metrics/config.js +50 -14
  102. package/dist/metrics/config.js.map +1 -1
  103. package/dist/metrics/constants.js +3 -5
  104. package/dist/metrics/constants.js.map +1 -1
  105. package/dist/metrics/index.js +48 -29
  106. package/dist/metrics/index.js.map +1 -1
  107. package/dist/multistream/mediaRequestManager.js +265 -36
  108. package/dist/multistream/mediaRequestManager.js.map +1 -1
  109. package/dist/multistream/receiveSlot.js +52 -19
  110. package/dist/multistream/receiveSlot.js.map +1 -1
  111. package/dist/multistream/receiveSlotManager.js +53 -33
  112. package/dist/multistream/receiveSlotManager.js.map +1 -1
  113. package/dist/multistream/remoteMedia.js +44 -18
  114. package/dist/multistream/remoteMedia.js.map +1 -1
  115. package/dist/multistream/remoteMediaGroup.js +60 -3
  116. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  117. package/dist/multistream/remoteMediaManager.js +322 -103
  118. package/dist/multistream/remoteMediaManager.js.map +1 -1
  119. package/dist/networkQualityMonitor/index.js +4 -2
  120. package/dist/networkQualityMonitor/index.js.map +1 -1
  121. package/dist/reachability/index.js +117 -60
  122. package/dist/reachability/index.js.map +1 -1
  123. package/dist/reachability/request.js +12 -5
  124. package/dist/reachability/request.js.map +1 -1
  125. package/dist/reactions/constants.js +13 -0
  126. package/dist/reactions/constants.js.map +1 -0
  127. package/dist/reactions/reactions.js +2 -2
  128. package/dist/reactions/reactions.js.map +1 -1
  129. package/dist/reactions/reactions.type.js +18 -18
  130. package/dist/reactions/reactions.type.js.map +1 -1
  131. package/dist/reconnection-manager/index.js +190 -145
  132. package/dist/reconnection-manager/index.js.map +1 -1
  133. package/dist/recording-controller/enums.js +17 -0
  134. package/dist/recording-controller/enums.js.map +1 -0
  135. package/dist/recording-controller/index.js +343 -0
  136. package/dist/recording-controller/index.js.map +1 -0
  137. package/dist/recording-controller/util.js +63 -0
  138. package/dist/recording-controller/util.js.map +1 -0
  139. package/dist/roap/index.js +21 -29
  140. package/dist/roap/index.js.map +1 -1
  141. package/dist/roap/request.js +127 -92
  142. package/dist/roap/request.js.map +1 -1
  143. package/dist/roap/turnDiscovery.js +135 -53
  144. package/dist/roap/turnDiscovery.js.map +1 -1
  145. package/dist/statsAnalyzer/global.js +1 -93
  146. package/dist/statsAnalyzer/global.js.map +1 -1
  147. package/dist/statsAnalyzer/index.js +329 -314
  148. package/dist/statsAnalyzer/index.js.map +1 -1
  149. package/dist/statsAnalyzer/mqaUtil.js +103 -54
  150. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  151. package/dist/types/annotation/annotation.types.d.ts +43 -0
  152. package/dist/types/annotation/constants.d.ts +31 -0
  153. package/dist/types/annotation/index.d.ts +124 -0
  154. package/dist/types/breakouts/breakout.d.ts +8 -0
  155. package/dist/types/breakouts/collection.d.ts +5 -0
  156. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  157. package/dist/types/breakouts/events.d.ts +2 -0
  158. package/dist/types/breakouts/index.d.ts +5 -0
  159. package/dist/types/breakouts/request.d.ts +22 -0
  160. package/dist/types/breakouts/utils.d.ts +15 -0
  161. package/dist/types/common/browser-detection.d.ts +9 -0
  162. package/dist/types/common/collection.d.ts +48 -0
  163. package/dist/types/common/config.d.ts +2 -0
  164. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  165. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  166. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  167. package/dist/types/common/errors/media.d.ts +15 -0
  168. package/dist/types/common/errors/parameter.d.ts +15 -0
  169. package/dist/types/common/errors/password-error.d.ts +15 -0
  170. package/dist/types/common/errors/permission.d.ts +14 -0
  171. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  172. package/dist/types/common/errors/reconnection.d.ts +15 -0
  173. package/dist/types/common/errors/stats.d.ts +15 -0
  174. package/dist/types/common/errors/webex-errors.d.ts +69 -0
  175. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  176. package/dist/types/common/events/events-scope.d.ts +17 -0
  177. package/dist/types/common/events/events.d.ts +12 -0
  178. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  179. package/dist/types/common/events/util.d.ts +2 -0
  180. package/dist/types/common/logs/logger-config.d.ts +2 -0
  181. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  182. package/dist/types/common/logs/request.d.ts +34 -0
  183. package/dist/types/common/queue.d.ts +32 -0
  184. package/dist/types/config.d.ts +72 -0
  185. package/dist/types/constants.d.ts +978 -0
  186. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  187. package/dist/types/controls-options-manager/enums.d.ts +15 -0
  188. package/dist/types/controls-options-manager/index.d.ts +136 -0
  189. package/dist/types/controls-options-manager/types.d.ts +43 -0
  190. package/dist/types/controls-options-manager/util.d.ts +1 -0
  191. package/dist/types/index.d.ts +7 -0
  192. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  193. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  194. package/dist/types/locus-info/fullState.d.ts +2 -0
  195. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  196. package/dist/types/locus-info/index.d.ts +315 -0
  197. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  198. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  199. package/dist/types/locus-info/parser.d.ts +212 -0
  200. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  201. package/dist/types/media/index.d.ts +34 -0
  202. package/dist/types/media/properties.d.ts +86 -0
  203. package/dist/types/media/util.d.ts +2 -0
  204. package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
  205. package/dist/types/meeting/in-meeting-actions.d.ts +149 -0
  206. package/dist/types/meeting/index.d.ts +1516 -0
  207. package/dist/types/meeting/locusMediaRequest.d.ts +70 -0
  208. package/dist/types/meeting/muteState.d.ts +184 -0
  209. package/dist/types/meeting/request.d.ts +270 -0
  210. package/dist/types/meeting/request.type.d.ts +11 -0
  211. package/dist/types/meeting/state.d.ts +9 -0
  212. package/dist/types/meeting/util.d.ts +75 -0
  213. package/dist/types/meeting-info/collection.d.ts +20 -0
  214. package/dist/types/meeting-info/index.d.ts +57 -0
  215. package/dist/types/meeting-info/meeting-info-v2.d.ts +122 -0
  216. package/dist/types/meeting-info/request.d.ts +22 -0
  217. package/dist/types/meeting-info/util.d.ts +2 -0
  218. package/dist/types/meeting-info/utilv2.d.ts +2 -0
  219. package/dist/types/meetings/collection.d.ts +31 -0
  220. package/dist/types/meetings/index.d.ts +364 -0
  221. package/dist/types/meetings/meetings.types.d.ts +4 -0
  222. package/dist/types/meetings/request.d.ts +27 -0
  223. package/dist/types/meetings/util.d.ts +18 -0
  224. package/dist/types/member/index.d.ts +157 -0
  225. package/dist/types/member/types.d.ts +21 -0
  226. package/dist/types/member/util.d.ts +2 -0
  227. package/dist/types/members/collection.d.ts +29 -0
  228. package/dist/types/members/index.d.ts +353 -0
  229. package/dist/types/members/request.d.ts +114 -0
  230. package/dist/types/members/types.d.ts +24 -0
  231. package/dist/types/members/util.d.ts +210 -0
  232. package/dist/types/metrics/config.d.ts +195 -0
  233. package/dist/types/metrics/constants.d.ts +55 -0
  234. package/dist/types/metrics/index.d.ts +169 -0
  235. package/dist/types/multistream/mediaRequestManager.d.ts +118 -0
  236. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  237. package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
  238. package/dist/types/multistream/remoteMedia.d.ts +72 -0
  239. package/dist/types/multistream/remoteMediaGroup.d.ts +47 -0
  240. package/dist/types/multistream/remoteMediaManager.d.ts +277 -0
  241. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  242. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  243. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  244. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  245. package/dist/types/reachability/index.d.ts +152 -0
  246. package/dist/types/reachability/request.d.ts +37 -0
  247. package/dist/types/reactions/constants.d.ts +3 -0
  248. package/dist/types/reactions/reactions.d.ts +4 -0
  249. package/dist/types/reactions/reactions.type.d.ts +52 -0
  250. package/dist/types/reconnection-manager/index.d.ts +126 -0
  251. package/dist/types/recording-controller/enums.d.ts +7 -0
  252. package/dist/types/recording-controller/index.d.ts +193 -0
  253. package/dist/types/recording-controller/util.d.ts +13 -0
  254. package/dist/types/roap/index.d.ts +77 -0
  255. package/dist/types/roap/request.d.ts +36 -0
  256. package/dist/types/roap/turnDiscovery.d.ts +91 -0
  257. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  258. package/dist/types/statsAnalyzer/index.d.ts +200 -0
  259. package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
  260. package/dist/types/transcription/index.d.ts +64 -0
  261. package/package.json +28 -21
  262. package/src/annotation/annotation.types.ts +52 -0
  263. package/src/annotation/constants.ts +36 -0
  264. package/src/annotation/index.ts +343 -0
  265. package/src/breakouts/README.md +220 -0
  266. package/src/breakouts/breakout.ts +180 -0
  267. package/src/breakouts/collection.ts +19 -0
  268. package/src/breakouts/edit-lock-error.ts +25 -0
  269. package/src/breakouts/events.ts +37 -0
  270. package/src/breakouts/index.ts +921 -0
  271. package/src/breakouts/request.ts +55 -0
  272. package/src/breakouts/utils.ts +57 -0
  273. package/src/common/errors/webex-errors.ts +6 -2
  274. package/src/common/logs/logger-proxy.ts +1 -1
  275. package/src/config.ts +5 -7
  276. package/src/constants.ts +155 -20
  277. package/src/controls-options-manager/constants.ts +5 -0
  278. package/src/controls-options-manager/enums.ts +18 -0
  279. package/src/controls-options-manager/index.ts +278 -0
  280. package/src/controls-options-manager/types.ts +59 -0
  281. package/src/controls-options-manager/util.ts +286 -0
  282. package/src/index.ts +34 -0
  283. package/src/locus-info/controlsUtils.ts +108 -0
  284. package/src/locus-info/index.ts +310 -21
  285. package/src/locus-info/mediaSharesUtils.ts +48 -0
  286. package/src/locus-info/parser.ts +2 -1
  287. package/src/locus-info/selfUtils.ts +80 -2
  288. package/src/media/index.ts +70 -142
  289. package/src/media/properties.ts +41 -104
  290. package/src/mediaQualityMetrics/config.ts +379 -377
  291. package/src/meeting/in-meeting-actions.ts +156 -0
  292. package/src/meeting/index.ts +1744 -1767
  293. package/src/meeting/locusMediaRequest.ts +309 -0
  294. package/src/meeting/muteState.ts +228 -132
  295. package/src/meeting/request.ts +100 -91
  296. package/src/meeting/request.type.ts +2 -0
  297. package/src/meeting/util.ts +421 -421
  298. package/src/meeting-info/meeting-info-v2.ts +134 -13
  299. package/src/meeting-info/utilv2.ts +13 -3
  300. package/src/meetings/collection.ts +20 -0
  301. package/src/meetings/index.ts +385 -83
  302. package/src/meetings/meetings.types.ts +12 -0
  303. package/src/meetings/request.ts +3 -1
  304. package/src/meetings/util.ts +103 -4
  305. package/src/member/index.ts +40 -0
  306. package/src/member/types.ts +24 -0
  307. package/src/member/util.ts +81 -1
  308. package/src/members/collection.ts +8 -0
  309. package/src/members/index.ts +108 -6
  310. package/src/members/request.ts +98 -17
  311. package/src/members/types.ts +28 -0
  312. package/src/members/util.ts +319 -240
  313. package/src/metrics/config.ts +49 -10
  314. package/src/metrics/constants.ts +2 -4
  315. package/src/metrics/index.ts +43 -27
  316. package/src/multistream/mediaRequestManager.ts +337 -63
  317. package/src/multistream/receiveSlot.ts +68 -26
  318. package/src/multistream/receiveSlotManager.ts +61 -38
  319. package/src/multistream/remoteMedia.ts +29 -3
  320. package/src/multistream/remoteMediaGroup.ts +61 -2
  321. package/src/multistream/remoteMediaManager.ts +260 -66
  322. package/src/networkQualityMonitor/index.ts +6 -6
  323. package/src/reachability/index.ts +75 -25
  324. package/src/reachability/request.ts +10 -5
  325. package/src/reactions/constants.ts +4 -0
  326. package/src/reactions/reactions.ts +4 -4
  327. package/src/reactions/reactions.type.ts +28 -3
  328. package/src/reconnection-manager/index.ts +53 -32
  329. package/src/recording-controller/enums.ts +8 -0
  330. package/src/recording-controller/index.ts +315 -0
  331. package/src/recording-controller/util.ts +58 -0
  332. package/src/roap/index.ts +21 -30
  333. package/src/roap/request.ts +51 -52
  334. package/src/roap/turnDiscovery.ts +51 -27
  335. package/src/statsAnalyzer/global.ts +1 -94
  336. package/src/statsAnalyzer/index.ts +380 -390
  337. package/src/statsAnalyzer/mqaUtil.ts +106 -99
  338. package/test/integration/spec/converged-space-meetings.js +233 -0
  339. package/test/integration/spec/journey.js +331 -254
  340. package/test/integration/spec/space-meeting.js +77 -4
  341. package/test/unit/spec/annotation/index.ts +436 -0
  342. package/test/unit/spec/breakouts/breakout.ts +233 -0
  343. package/test/unit/spec/breakouts/collection.ts +15 -0
  344. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  345. package/test/unit/spec/breakouts/events.ts +77 -0
  346. package/test/unit/spec/breakouts/index.ts +1790 -0
  347. package/test/unit/spec/breakouts/request.ts +104 -0
  348. package/test/unit/spec/breakouts/utils.js +72 -0
  349. package/test/unit/spec/controls-options-manager/index.js +287 -0
  350. package/test/unit/spec/controls-options-manager/util.js +518 -0
  351. package/test/unit/spec/fixture/locus.js +1 -0
  352. package/test/unit/spec/locus-info/controlsUtils.js +303 -30
  353. package/test/unit/spec/locus-info/index.js +616 -4
  354. package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
  355. package/test/unit/spec/locus-info/selfConstant.js +38 -0
  356. package/test/unit/spec/locus-info/selfUtils.js +249 -0
  357. package/test/unit/spec/media/index.ts +118 -22
  358. package/test/unit/spec/media/properties.ts +9 -9
  359. package/test/unit/spec/meeting/in-meeting-actions.ts +76 -0
  360. package/test/unit/spec/meeting/index.js +2496 -1375
  361. package/test/unit/spec/meeting/locusMediaRequest.ts +436 -0
  362. package/test/unit/spec/meeting/muteState.js +370 -208
  363. package/test/unit/spec/meeting/request.js +354 -42
  364. package/test/unit/spec/meeting/utils.js +268 -156
  365. package/test/unit/spec/meeting-info/meetinginfov2.js +383 -5
  366. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  367. package/test/unit/spec/meetings/collection.js +14 -0
  368. package/test/unit/spec/meetings/index.js +866 -120
  369. package/test/unit/spec/meetings/utils.js +206 -2
  370. package/test/unit/spec/member/index.js +24 -0
  371. package/test/unit/spec/member/util.js +384 -32
  372. package/test/unit/spec/members/index.js +320 -1
  373. package/test/unit/spec/members/request.js +206 -27
  374. package/test/unit/spec/members/utils.js +184 -0
  375. package/test/unit/spec/metrics/index.js +98 -0
  376. package/test/unit/spec/multistream/mediaRequestManager.ts +1012 -109
  377. package/test/unit/spec/multistream/receiveSlot.ts +77 -18
  378. package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
  379. package/test/unit/spec/multistream/remoteMedia.ts +32 -2
  380. package/test/unit/spec/multistream/remoteMediaGroup.ts +271 -5
  381. package/test/unit/spec/multistream/remoteMediaManager.ts +672 -65
  382. package/test/unit/spec/networkQualityMonitor/index.js +4 -4
  383. package/test/unit/spec/reachability/index.ts +176 -25
  384. package/test/unit/spec/reachability/request.js +66 -0
  385. package/test/unit/spec/reconnection-manager/index.js +46 -13
  386. package/test/unit/spec/recording-controller/index.js +231 -0
  387. package/test/unit/spec/recording-controller/util.js +102 -0
  388. package/test/unit/spec/roap/index.ts +21 -51
  389. package/test/unit/spec/roap/request.ts +187 -0
  390. package/test/unit/spec/roap/turnDiscovery.ts +73 -34
  391. package/test/unit/spec/stats-analyzer/index.js +94 -43
  392. package/test/utils/constants.js +9 -0
  393. package/test/utils/integrationTestUtils.js +46 -0
  394. package/test/utils/testUtils.js +0 -45
  395. package/test/utils/webex-config.js +4 -0
  396. package/test/utils/webex-test-users.js +7 -3
  397. package/tsconfig.json +6 -0
  398. package/dist/media/internal-media-core-wrapper.js +0 -18
  399. package/dist/media/internal-media-core-wrapper.js.map +0 -1
  400. package/dist/meeting/effectsState.js +0 -262
  401. package/dist/meeting/effectsState.js.map +0 -1
  402. package/dist/multistream/multistreamMedia.js +0 -106
  403. package/dist/multistream/multistreamMedia.js.map +0 -1
  404. package/src/index.js +0 -15
  405. package/src/media/internal-media-core-wrapper.ts +0 -9
  406. package/src/meeting/effectsState.ts +0 -211
  407. package/src/multistream/multistreamMedia.ts +0 -93
  408. package/test/unit/spec/meeting/effectsState.js +0 -281
@@ -18,7 +18,8 @@ import {
18
18
  DISPLAY_HINTS,
19
19
  } from '../../../../src/constants';
20
20
 
21
- import {self, selfWithInactivity} from './selfConstant';
21
+ import { self, selfWithInactivity } from "./selfConstant";
22
+ import uuid from "uuid";
22
23
 
23
24
  describe('plugin-meetings', () => {
24
25
  describe('LocusInfo index', () => {
@@ -66,8 +67,12 @@ describe('plugin-meetings', () => {
66
67
 
67
68
  beforeEach('setup new controls', () => {
68
69
  newControls = {
70
+ disallowUnmute: {enabled: true},
69
71
  lock: {},
70
72
  meetingFull: {},
73
+ muteOnEntry: {enabled: true},
74
+ raiseHand: {enabled: true},
75
+ reactions: {enabled: true, showDisplayNameWithReactions: true},
71
76
  record: {
72
77
  recording: false,
73
78
  paused: false,
@@ -76,12 +81,14 @@ describe('plugin-meetings', () => {
76
81
  modifiedBy: 'George Kittle',
77
82
  },
78
83
  },
79
- shareControl: {},
84
+ shareControl: {control: 'example-value'},
80
85
  transcribe: {},
86
+ viewTheParticipantList: {enabled: true},
81
87
  meetingContainer: {
82
88
  meetingContainerUrl: 'http://new-url.com',
83
89
  },
84
90
  entryExitTone: {enabled: true, mode: 'foo'},
91
+ video: {enabled: true},
85
92
  };
86
93
  });
87
94
 
@@ -95,6 +102,97 @@ describe('plugin-meetings', () => {
95
102
  assert.equal(locusInfo.controls, newControls);
96
103
  });
97
104
 
105
+ it('should trigger the CONTROLS_MUTE_ON_ENTRY_CHANGED event when necessary', () => {
106
+ locusInfo.controls = {};
107
+ locusInfo.emitScoped = sinon.stub();
108
+ locusInfo.updateControls(newControls);
109
+
110
+ assert.calledWith(
111
+ locusInfo.emitScoped,
112
+ {file: 'locus-info', function: 'updateControls'},
113
+ LOCUSINFO.EVENTS.CONTROLS_MUTE_ON_ENTRY_CHANGED,
114
+ {state: newControls.muteOnEntry},
115
+ );
116
+ });
117
+
118
+ it('should trigger the CONTROLS_SHARE_CONTROL_CHANGED event when necessary', () => {
119
+ locusInfo.controls = {};
120
+ locusInfo.emitScoped = sinon.stub();
121
+ locusInfo.updateControls(newControls);
122
+
123
+ assert.calledWith(
124
+ locusInfo.emitScoped,
125
+ {file: 'locus-info', function: 'updateControls'},
126
+ LOCUSINFO.EVENTS.CONTROLS_SHARE_CONTROL_CHANGED,
127
+ {state: newControls.shareControl},
128
+ );
129
+ });
130
+
131
+ it('should trigger the CONTROLS_DISALLOW_UNMUTE_CHANGED event when necessary', () => {
132
+ locusInfo.controls = {};
133
+ locusInfo.emitScoped = sinon.stub();
134
+ locusInfo.updateControls(newControls);
135
+
136
+ assert.calledWith(
137
+ locusInfo.emitScoped,
138
+ {file: 'locus-info', function: 'updateControls'},
139
+ LOCUSINFO.EVENTS.CONTROLS_DISALLOW_UNMUTE_CHANGED,
140
+ {state: newControls.disallowUnmute},
141
+ );
142
+ });
143
+
144
+ it('should trigger the CONTROLS_REACTIONS_CHANGED event when necessary', () => {
145
+ locusInfo.controls = {};
146
+ locusInfo.emitScoped = sinon.stub();
147
+ locusInfo.updateControls(newControls);
148
+
149
+ assert.calledWith(
150
+ locusInfo.emitScoped,
151
+ {file: 'locus-info', function: 'updateControls'},
152
+ LOCUSINFO.EVENTS.CONTROLS_REACTIONS_CHANGED,
153
+ {state: newControls.reactions},
154
+ );
155
+ });
156
+
157
+ it('should trigger the CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED event when necessary', () => {
158
+ locusInfo.controls = {};
159
+ locusInfo.emitScoped = sinon.stub();
160
+ locusInfo.updateControls(newControls);
161
+
162
+ assert.calledWith(
163
+ locusInfo.emitScoped,
164
+ {file: 'locus-info', function: 'updateControls'},
165
+ LOCUSINFO.EVENTS.CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED,
166
+ {state: newControls.viewTheParticipantList},
167
+ );
168
+ });
169
+
170
+ it('should trigger the CONTROLS_RAISE_HAND_CHANGED event when necessary', () => {
171
+ locusInfo.controls = {};
172
+ locusInfo.emitScoped = sinon.stub();
173
+ locusInfo.updateControls(newControls);
174
+
175
+ assert.calledWith(
176
+ locusInfo.emitScoped,
177
+ {file: 'locus-info', function: 'updateControls'},
178
+ LOCUSINFO.EVENTS.CONTROLS_RAISE_HAND_CHANGED,
179
+ {state: newControls.raiseHand},
180
+ );
181
+ });
182
+
183
+ it('should trigger the CONTROLS_VIDEO_CHANGED event when necessary', () => {
184
+ locusInfo.controls = {};
185
+ locusInfo.emitScoped = sinon.stub();
186
+ locusInfo.updateControls(newControls);
187
+
188
+ assert.calledWith(
189
+ locusInfo.emitScoped,
190
+ {file: 'locus-info', function: 'updateControls'},
191
+ LOCUSINFO.EVENTS.CONTROLS_VIDEO_CHANGED,
192
+ {state: newControls.video},
193
+ );
194
+ });
195
+
98
196
  it('should not trigger the CONTROLS_RECORDING_UPDATED event', () => {
99
197
  locusInfo.controls = {};
100
198
  locusInfo.emitScoped = sinon.stub();
@@ -277,6 +375,28 @@ describe('plugin-meetings', () => {
277
375
  );
278
376
  });
279
377
 
378
+ it('should update the breakout state', () => {
379
+ locusInfo.emitScoped = sinon.stub();
380
+ let tmpStub = sinon.stub(SelfUtils, 'getReplacedBreakoutMoveId').returns('breakoutMoveId');
381
+ newControls.breakout = { 'breakout': {} };
382
+ let selfInfo = {};
383
+
384
+ locusInfo.updateControls(newControls, selfInfo);
385
+
386
+ assert.calledWith(
387
+ locusInfo.emitScoped,
388
+ {
389
+ file: 'locus-info',
390
+ function: 'updateControls',
391
+ },
392
+ LOCUSINFO.EVENTS.CONTROLS_MEETING_BREAKOUT_UPDATED,
393
+ {
394
+ breakout: newControls.breakout,
395
+ }
396
+ );
397
+ tmpStub.restore();
398
+ });
399
+
280
400
  it('should update the transcript state', () => {
281
401
  locusInfo.emitScoped = sinon.stub();
282
402
  locusInfo.controls = {
@@ -398,6 +518,39 @@ describe('plugin-meetings', () => {
398
518
  assert.notEqual(x.args[1], LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED);
399
519
  });
400
520
  });
521
+
522
+ it('should update videoEnabled when changed', () => {
523
+ locusInfo.controls = {};
524
+
525
+ locusInfo.emitScoped = sinon.stub();
526
+ locusInfo.updateControls(newControls);
527
+
528
+ assert.calledWith(
529
+ locusInfo.emitScoped,
530
+ {
531
+ file: 'locus-info',
532
+ function: 'updateControls',
533
+ },
534
+ LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
535
+ {unmuteAllowed: true}
536
+ );
537
+
538
+ assert.equal(mockMeeting.unmuteVideoAllowed, true);
539
+ });
540
+
541
+ it('should not update videoEnabled when unchanged', () => {
542
+ locusInfo.controls = {videoEnabled: true};
543
+
544
+ locusInfo.emitScoped = sinon.stub();
545
+ locusInfo.updateControls(newControls);
546
+
547
+ locusInfo.emitScoped.getCalls().forEach((x) => {
548
+ // check that no calls in emitScoped are for SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED
549
+ assert.notEqual(x.args[1], LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED);
550
+ });
551
+
552
+ assert.equal(mockMeeting.unmuteVideoAllowed, undefined);
553
+ });
401
554
  });
402
555
 
403
556
  describe('#updateParticipants()', () => {
@@ -451,6 +604,7 @@ describe('plugin-meetings', () => {
451
604
  selfIdentity: '123',
452
605
  selfId: '2',
453
606
  hostId: '3',
607
+ isReplace: undefined,
454
608
  }
455
609
  );
456
610
  // note: in a real use case, recordingId, selfId, and hostId would all be the same
@@ -458,6 +612,43 @@ describe('plugin-meetings', () => {
458
612
  // are being correctly grabbed from locusInfo.parsedLocus within updateParticipants
459
613
  });
460
614
 
615
+ it('should call with breakout control info', () => {
616
+ locusInfo.parsedLocus = {
617
+ controls: {
618
+ record: {
619
+ modifiedBy: '1',
620
+ },
621
+ },
622
+ self: {
623
+ selfIdentity: '123',
624
+ selfId: '2',
625
+ },
626
+ host: {
627
+ hostId: '3',
628
+ },
629
+ };
630
+
631
+ locusInfo.emitScoped = sinon.stub();
632
+ locusInfo.updateParticipants({}, true);
633
+
634
+ assert.calledWith(
635
+ locusInfo.emitScoped,
636
+ {
637
+ file: 'locus-info',
638
+ function: 'updateParticipants',
639
+ },
640
+ EVENTS.LOCUS_INFO_UPDATE_PARTICIPANTS,
641
+ {
642
+ participants: {},
643
+ recordingId: '1',
644
+ selfIdentity: '123',
645
+ selfId: '2',
646
+ hostId: '3',
647
+ isReplace: true,
648
+ }
649
+ );
650
+ });
651
+
461
652
  it('should update the deltaParticipants object', () => {
462
653
  const prev = locusInfo.deltaParticipants;
463
654
 
@@ -664,6 +855,122 @@ describe('plugin-meetings', () => {
664
855
  );
665
856
  });
666
857
 
858
+ describe('SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED', () => {
859
+ it('should emit event when video muted on entry', () => {
860
+ // usually "previous self" is just undefined when we get first self from locus
861
+ locusInfo.self = undefined;
862
+ const selfWithMutedByOthers = cloneDeep(self);
863
+
864
+ // remoteVideoMuted
865
+ selfWithMutedByOthers.controls.video.muted = true;
866
+
867
+ locusInfo.webex.internal.device.url = self.deviceUrl;
868
+ locusInfo.emitScoped = sinon.stub();
869
+ locusInfo.updateSelf(selfWithMutedByOthers, []);
870
+
871
+ assert.calledWith(
872
+ locusInfo.emitScoped,
873
+ {
874
+ file: 'locus-info',
875
+ function: 'updateSelf',
876
+ },
877
+ LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
878
+ {muted: true}
879
+ );
880
+
881
+ // but sometimes "previous self" is defined, but without controls.audio.muted, so we test this here:
882
+ locusInfo.self = cloneDeep(self);
883
+ locusInfo.self.controls.video = {};
884
+
885
+ locusInfo.updateSelf(selfWithMutedByOthers, []);
886
+ assert.calledWith(
887
+ locusInfo.emitScoped,
888
+ {
889
+ file: 'locus-info',
890
+ function: 'updateSelf',
891
+ },
892
+ LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
893
+ {muted: true}
894
+ );
895
+ });
896
+
897
+ it('should not emit event when not muted on entry', () => {
898
+ locusInfo.self = undefined;
899
+ const selfWithMutedByOthersFalse = cloneDeep(self);
900
+
901
+ selfWithMutedByOthersFalse.controls.video.muted = false;
902
+
903
+ locusInfo.webex.internal.device.url = self.deviceUrl;
904
+ locusInfo.emitScoped = sinon.stub();
905
+ locusInfo.updateSelf(selfWithMutedByOthersFalse, []);
906
+
907
+ // we might get some calls to emitScoped, but we need to check that none of them are for SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED
908
+ locusInfo.emitScoped.getCalls().forEach((x) => {
909
+ assert.notEqual(x.args[1], LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED);
910
+ });
911
+ });
912
+
913
+ it('should emit event when remoteVideoMuted changed', () => {
914
+ locusInfo.self = self;
915
+ const selfWithMutedByOthers = cloneDeep(self);
916
+
917
+ selfWithMutedByOthers.controls.video.muted = true;
918
+
919
+ locusInfo.webex.internal.device.url = self.deviceUrl;
920
+ locusInfo.emitScoped = sinon.stub();
921
+ locusInfo.updateSelf(selfWithMutedByOthers, []);
922
+
923
+ assert.calledWith(
924
+ locusInfo.emitScoped,
925
+ {
926
+ file: 'locus-info',
927
+ function: 'updateSelf',
928
+ },
929
+ LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
930
+ {muted: true}
931
+ );
932
+ });
933
+ });
934
+
935
+ it('should trigger SELF_MEETING_BREAKOUTS_CHANGED when breakouts changed', () => {
936
+ locusInfo.self = self;
937
+ const selfWithBreakoutsChanged = cloneDeep(self);
938
+
939
+ selfWithBreakoutsChanged.controls.breakout.sessions.active[0].name = 'new name';
940
+
941
+ locusInfo.emitScoped = sinon.stub();
942
+ locusInfo.updateSelf(selfWithBreakoutsChanged, []);
943
+
944
+ assert.calledWith(
945
+ locusInfo.emitScoped,
946
+ {
947
+ file: 'locus-info',
948
+ function: 'updateSelf',
949
+ },
950
+ LOCUSINFO.EVENTS.SELF_MEETING_BREAKOUTS_CHANGED,
951
+ {
952
+ breakoutSessions: {
953
+ active: [
954
+ {
955
+ name: 'new name',
956
+ groupId: '0e73abb8-5584-49d8-be8d-806d2a8247ca',
957
+ sessionId: '1cf41ab1-2e57-4d95-b7e9-5613acddfb0f',
958
+ sessionType: 'BREAKOUT',
959
+ },
960
+ ],
961
+ allowed: [
962
+ {
963
+ name: 'Breakout session 2',
964
+ groupId: '0e73abb8-5584-49d8-be8d-806d2a8247ca',
965
+ sessionId: '1cf41ab1-2e57-4d95-b7e9-5613acddfb0f',
966
+ sessionType: 'BREAKOUT',
967
+ },
968
+ ],
969
+ },
970
+ }
971
+ );
972
+ });
973
+
667
974
  it('should trigger SELF_REMOTE_MUTE_STATUS_UPDATED if muted and disallowUnmute changed', () => {
668
975
  locusInfo.self = self;
669
976
  const selfWithMutedByOthersAndDissalowUnmute = cloneDeep(self);
@@ -735,6 +1042,7 @@ describe('plugin-meetings', () => {
735
1042
  const selfWithRequestedToUnmute = cloneDeep(self);
736
1043
 
737
1044
  selfWithRequestedToUnmute.controls.audio.requestedToUnmute = true;
1045
+ selfWithRequestedToUnmute.controls.audio.lastModifiedRequestedToUnmute = '2023-06-16T19:25:04.369Z';
738
1046
 
739
1047
  locusInfo.webex.internal.device.url = self.deviceUrl;
740
1048
  locusInfo.emitScoped = sinon.stub();
@@ -889,6 +1197,44 @@ describe('plugin-meetings', () => {
889
1197
  {isSharingBlocked: true}
890
1198
  );
891
1199
  });
1200
+
1201
+ it('should trigger SELF_ROLES_CHANGED if self roles changed', () => {
1202
+ locusInfo.self = self;
1203
+ locusInfo.emitScoped = sinon.stub();
1204
+ const sampleNewSelf = cloneDeep(self);
1205
+ sampleNewSelf.controls.role.roles = [{type: 'COHOST', hasRole: true}];
1206
+
1207
+ locusInfo.updateSelf(sampleNewSelf, []);
1208
+
1209
+ assert.calledWith(
1210
+ locusInfo.emitScoped,
1211
+ {
1212
+ file: 'locus-info',
1213
+ function: 'updateSelf',
1214
+ },
1215
+ LOCUSINFO.EVENTS.SELF_ROLES_CHANGED,
1216
+ {oldRoles: ['PRESENTER'], newRoles: ['COHOST']}
1217
+ );
1218
+ });
1219
+
1220
+ it('should not trigger SELF_ROLES_CHANGED if self roles not changed', () => {
1221
+ locusInfo.self = self;
1222
+ locusInfo.emitScoped = sinon.stub();
1223
+ const sampleNewSelf = cloneDeep(self);
1224
+ sampleNewSelf.controls.role.roles = [{type: 'PRESENTER', hasRole: true}];
1225
+
1226
+ locusInfo.updateSelf(sampleNewSelf, []);
1227
+
1228
+ assert.neverCalledWith(
1229
+ locusInfo.emitScoped,
1230
+ {
1231
+ file: 'locus-info',
1232
+ function: 'updateSelf',
1233
+ },
1234
+ LOCUSINFO.EVENTS.SELF_ROLES_CHANGED,
1235
+ {oldRoles: ['PRESENTER'], newRoles: ['PRESENTER']}
1236
+ );
1237
+ });
892
1238
  });
893
1239
 
894
1240
  describe('#updateMeetingInfo', () => {
@@ -962,7 +1308,25 @@ describe('plugin-meetings', () => {
962
1308
  function: 'updateMeetingInfo',
963
1309
  },
964
1310
  LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
965
- {info: locusInfo.parsedLocus.info, self},
1311
+ {info: locusInfo.parsedLocus.info, self},
1312
+ ];
1313
+
1314
+ if (expected) {
1315
+ assert.calledWith(...expectedArgs);
1316
+ } else {
1317
+ assert.neverCalledWith(...expectedArgs);
1318
+ }
1319
+ locusInfo.emitScoped.resetHistory();
1320
+ };
1321
+
1322
+ const checkMeetingInfoUpdatedCalledForRoles = (expected) => {
1323
+ const expectedArgs = [
1324
+ locusInfo.emitScoped,
1325
+ {
1326
+ file: 'locus-info',
1327
+ function: 'updateMeetingInfo',
1328
+ },
1329
+ LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
966
1330
  ];
967
1331
 
968
1332
  if (expected) {
@@ -973,6 +1337,7 @@ describe('plugin-meetings', () => {
973
1337
  locusInfo.emitScoped.resetHistory();
974
1338
  };
975
1339
 
1340
+
976
1341
  it('emits MEETING_INFO_UPDATED if the info changes', () => {
977
1342
  const initialInfo = cloneDeep(meetingInfo);
978
1343
 
@@ -998,6 +1363,16 @@ describe('plugin-meetings', () => {
998
1363
 
999
1364
  // since the info is the same it should not call trigger the event
1000
1365
  checkMeetingInfoUpdatedCalled(false);
1366
+
1367
+ // update it with the same info, but roles changed
1368
+ const updateSelf = cloneDeep(self);
1369
+ updateSelf?.controls?.role?.roles.push({
1370
+ type: 'COHOST',
1371
+ hasRole: true,
1372
+ });
1373
+ locusInfo.updateMeetingInfo(newInfo, updateSelf);
1374
+ // since the info is the same but roles changed, it should call trigger the event
1375
+ checkMeetingInfoUpdatedCalledForRoles(true);
1001
1376
  });
1002
1377
 
1003
1378
  it('gets roles from self if available', () => {
@@ -1103,6 +1478,7 @@ describe('plugin-meetings', () => {
1103
1478
  fakeLocus = {
1104
1479
  meeting: true,
1105
1480
  participants: true,
1481
+ url: 'newLocusUrl',
1106
1482
  };
1107
1483
  });
1108
1484
 
@@ -1147,6 +1523,55 @@ describe('plugin-meetings', () => {
1147
1523
  assert.isFunction(locusParser.onDeltaAction);
1148
1524
  });
1149
1525
 
1526
+ it('#updateLocusInfo ignores breakout LEFT message', () => {
1527
+ const newLocus = {
1528
+ self: {
1529
+ reason: 'MOVED',
1530
+ state: 'LEFT',
1531
+ },
1532
+ };
1533
+
1534
+ locusInfo.updateControls = sinon.stub();
1535
+ locusInfo.updateConversationUrl = sinon.stub();
1536
+ locusInfo.updateCreated = sinon.stub();
1537
+ locusInfo.updateFullState = sinon.stub();
1538
+ locusInfo.updateHostInfo = sinon.stub();
1539
+ locusInfo.updateMeetingInfo = sinon.stub();
1540
+ locusInfo.updateMediaShares = sinon.stub();
1541
+ locusInfo.updateParticipantsUrl = sinon.stub();
1542
+ locusInfo.updateReplace = sinon.stub();
1543
+ locusInfo.updateSelf = sinon.stub();
1544
+ locusInfo.updateLocusUrl = sinon.stub();
1545
+ locusInfo.updateAclUrl = sinon.stub();
1546
+ locusInfo.updateBasequence = sinon.stub();
1547
+ locusInfo.updateSequence = sinon.stub();
1548
+ locusInfo.updateMemberShip = sinon.stub();
1549
+ locusInfo.updateIdentifiers = sinon.stub();
1550
+ locusInfo.updateEmbeddedApps = sinon.stub();
1551
+ locusInfo.compareAndUpdate = sinon.stub();
1552
+
1553
+ locusInfo.updateLocusInfo(newLocus);
1554
+
1555
+ assert.notCalled(locusInfo.updateControls);
1556
+ assert.notCalled(locusInfo.updateConversationUrl);
1557
+ assert.notCalled(locusInfo.updateCreated);
1558
+ assert.notCalled(locusInfo.updateFullState);
1559
+ assert.notCalled(locusInfo.updateHostInfo);
1560
+ assert.notCalled(locusInfo.updateMeetingInfo);
1561
+ assert.notCalled(locusInfo.updateMediaShares);
1562
+ assert.notCalled(locusInfo.updateParticipantsUrl);
1563
+ assert.notCalled(locusInfo.updateReplace);
1564
+ assert.notCalled(locusInfo.updateSelf);
1565
+ assert.notCalled(locusInfo.updateLocusUrl);
1566
+ assert.notCalled(locusInfo.updateAclUrl);
1567
+ assert.notCalled(locusInfo.updateBasequence);
1568
+ assert.notCalled(locusInfo.updateSequence);
1569
+ assert.notCalled(locusInfo.updateMemberShip);
1570
+ assert.notCalled(locusInfo.updateIdentifiers);
1571
+ assert.notCalled(locusInfo.updateEmbeddedApps);
1572
+ assert.notCalled(locusInfo.compareAndUpdate);
1573
+ });
1574
+
1150
1575
  it('onFullLocus() updates the working-copy of locus parser', () => {
1151
1576
  const eventType = 'fakeEvent';
1152
1577
 
@@ -1196,12 +1621,18 @@ describe('plugin-meetings', () => {
1196
1621
  locusInfo: {
1197
1622
  onFullLocus: sandbox.stub(),
1198
1623
  },
1624
+ locusUrl: 'oldLocusUrl',
1199
1625
  };
1200
1626
 
1201
1627
  locusInfo.locusParser.resume = sandbox.stub();
1202
1628
  locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1203
1629
 
1204
- assert.calledOnce(meeting.meetingRequest.getFullLocus);
1630
+ assert.calledOnceWithExactly(meeting.meetingRequest.getFullLocus,
1631
+ {
1632
+ desync: true,
1633
+ locusUrl: 'newLocusUrl',
1634
+ }
1635
+ );
1205
1636
  });
1206
1637
 
1207
1638
  it('getFullLocus handles DESYNC action correctly', () => {
@@ -1226,6 +1657,187 @@ describe('plugin-meetings', () => {
1226
1657
  assert.calledOnce(locusInfo.locusParser.resume);
1227
1658
  });
1228
1659
  });
1660
+
1661
+ it('onDeltaLocus handle delta data', () => {
1662
+ fakeLocus.participants = {};
1663
+ const fakeBreakout = {
1664
+ sessionId: 'sessionId',
1665
+ groupId: 'groupId',
1666
+ };
1667
+
1668
+ fakeLocus.controls = {
1669
+ breakout: fakeBreakout
1670
+ };
1671
+ locusInfo.controls = {
1672
+ breakout: {
1673
+ sessionId: 'sessionId',
1674
+ groupId: 'groupId',
1675
+ }
1676
+ }
1677
+ locusInfo.updateParticipants = sinon.stub();
1678
+ locusInfo.onDeltaLocus(fakeLocus);
1679
+ assert.calledWith(locusInfo.updateParticipants, {}, false);
1680
+
1681
+ fakeLocus.controls.breakout.sessionId = 'sessionId2';
1682
+ locusInfo.onDeltaLocus(fakeLocus);
1683
+ assert.calledWith(locusInfo.updateParticipants, {}, true);
1684
+ });
1685
+ });
1686
+
1687
+ describe('#updateLocusCache', () => {
1688
+ it('cache it if income locus is main session locus', () => {
1689
+ const locus = {url: 'url'};
1690
+ locusInfo.mainSessionLocusCache = null;
1691
+ locusInfo.updateLocusCache(locus);
1692
+
1693
+ assert.deepEqual(locusInfo.mainSessionLocusCache, locus);
1694
+ });
1695
+
1696
+ it('not cache it if income locus is breakout session locus', () => {
1697
+ const locus = {url: 'url', controls: {breakout: {sessionType: 'BREAKOUT'}}};
1698
+ locusInfo.mainSessionLocusCache = null;
1699
+ locusInfo.updateLocusCache(locus);
1700
+
1701
+ assert.isNull(locusInfo.mainSessionLocusCache);
1702
+ });
1703
+ });
1704
+
1705
+ describe('#getTheLocusToUpdate', () => {
1706
+ it('return the cache locus if return to main session', () => {
1707
+ locusInfo.mainSessionLocusCache = {url: 'url'};
1708
+ locusInfo.controls = {
1709
+ breakout: {
1710
+ sessionType: 'BREAKOUT'
1711
+ }
1712
+ }
1713
+ const newLocus = {
1714
+ controls: {
1715
+ breakout: {
1716
+ sessionType: 'MAIN',
1717
+ },
1718
+ },
1719
+ };
1720
+
1721
+ assert.deepEqual(locusInfo.getTheLocusToUpdate(newLocus), {url: 'url'});
1722
+ });
1723
+
1724
+ it('return the new locus if return to main session but no cache', () => {
1725
+ locusInfo.mainSessionLocusCache = null;
1726
+ locusInfo.controls = {
1727
+ breakout: {
1728
+ sessionType: 'BREAKOUT'
1729
+ }
1730
+ }
1731
+ const newLocus = {
1732
+ controls: {
1733
+ breakout: {
1734
+ sessionType: 'MAIN',
1735
+ },
1736
+ },
1737
+ };
1738
+
1739
+ assert.deepEqual(locusInfo.getTheLocusToUpdate(newLocus), newLocus);
1740
+ });
1741
+
1742
+ it('return the new locus if not return to main session', () => {
1743
+ locusInfo.mainSessionLocusCache = {url: 'url'};
1744
+ locusInfo.controls = {
1745
+ breakout: {
1746
+ sessionType: 'MAIN'
1747
+ }
1748
+ }
1749
+ const newLocus = {
1750
+ controls: {
1751
+ breakout: {
1752
+ sessionType: 'BREAKOUT',
1753
+ },
1754
+ },
1755
+ };
1756
+
1757
+ assert.deepEqual(locusInfo.getTheLocusToUpdate(newLocus), newLocus);
1758
+ });
1759
+ });
1760
+
1761
+ describe('#mergeParticipants', () => {
1762
+ let participants;
1763
+ let sourceParticipants;
1764
+ beforeEach(() => {
1765
+ participants = [{id: '111', status: 'JOINED'}, {id: '222'}];
1766
+ sourceParticipants = [{id: '111', status: 'LEFT'}, {id: '333'}];
1767
+ });
1768
+
1769
+ it('merge the participants, replace it by id if exist in old array', () => {
1770
+ const result = locusInfo.mergeParticipants(participants, sourceParticipants);
1771
+ assert.deepEqual(result, [{id: '111', status: 'LEFT'}, {id: '222'}, {id: '333'}]);
1772
+ });
1773
+
1774
+ it('return new participants if previous participants is empty', () => {
1775
+ const result = locusInfo.mergeParticipants([], sourceParticipants);
1776
+ assert.deepEqual(result, sourceParticipants);
1777
+ });
1778
+
1779
+ it('return new participants if previous participants is null/undefined', () => {
1780
+ let result = locusInfo.mergeParticipants(null, sourceParticipants);
1781
+ assert.deepEqual(result, sourceParticipants);
1782
+
1783
+ result = locusInfo.mergeParticipants(undefined, sourceParticipants);
1784
+ assert.deepEqual(result, sourceParticipants);
1785
+ });
1786
+
1787
+ it('return previous participants if new participants is empty', () => {
1788
+ const result = locusInfo.mergeParticipants(participants, []);
1789
+ assert.deepEqual(result, participants);
1790
+ });
1791
+
1792
+ it('return previous participants if new participants is null/undefined', () => {
1793
+ let result = locusInfo.mergeParticipants(participants, null);
1794
+ assert.deepEqual(result, participants);
1795
+
1796
+ result = locusInfo.mergeParticipants(participants, undefined);
1797
+ assert.deepEqual(result, participants);
1798
+ });
1799
+ });
1800
+
1801
+ describe('#updateMainSessionLocusCache', () => {
1802
+ let cachedLocus;
1803
+ let newLocus;
1804
+ beforeEach(() => {
1805
+ cachedLocus = {controls: {}, participants: [], info: {webExMeetingId: 'testId1', topic: 'test'}};
1806
+ newLocus = {self: {}, participants: [{id: '111'}], info: {testId: 'testId2', webExMeetingName: 'hello'}};
1807
+ });
1808
+ it('shallow merge new locus into cache', () => {
1809
+ locusInfo.mainSessionLocusCache = cachedLocus;
1810
+ locusInfo.updateMainSessionLocusCache(newLocus);
1811
+
1812
+ assert.deepEqual(locusInfo.mainSessionLocusCache, {
1813
+ controls: {},
1814
+ participants: [{id: '111'}],
1815
+ info: {testId: 'testId2', webExMeetingName: 'hello'},
1816
+ self: {},
1817
+ });
1818
+ });
1819
+
1820
+ it('cache new locus if no cache before', () => {
1821
+ locusInfo.mainSessionLocusCache = null;
1822
+ locusInfo.updateMainSessionLocusCache(newLocus);
1823
+
1824
+ assert.deepEqual(locusInfo.mainSessionLocusCache, newLocus);
1825
+ });
1826
+
1827
+ it('do nothing if new locus is null', () => {
1828
+ locusInfo.mainSessionLocusCache = cachedLocus;
1829
+ locusInfo.updateMainSessionLocusCache(null);
1830
+
1831
+ assert.deepEqual(locusInfo.mainSessionLocusCache, cachedLocus);
1832
+ });
1833
+ });
1834
+
1835
+ describe('#clearMainSessionLocusCache', () => {
1836
+ it('clear main session locus cache', () => {
1837
+ locusInfo.mainSessionLocusCache = {controls: {}};
1838
+ locusInfo.clearMainSessionLocusCache();
1839
+ assert.isNull(locusInfo.mainSessionLocusCache);
1840
+ })
1229
1841
  });
1230
1842
 
1231
1843
  describe('#handleOneonOneEvent', () => {