@webex/plugin-meetings 3.0.0-beta.3 → 3.0.0-beta.300

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 (601) hide show
  1. package/README.md +46 -8
  2. package/UPGRADING.md +9 -9
  3. package/browsers.js +19 -24
  4. package/dist/annotation/annotation.types.js +7 -0
  5. package/dist/annotation/annotation.types.js.map +1 -0
  6. package/dist/annotation/constants.js +49 -0
  7. package/dist/annotation/constants.js.map +1 -0
  8. package/dist/annotation/index.js +342 -0
  9. package/dist/annotation/index.js.map +1 -0
  10. package/dist/breakouts/breakout.js +216 -0
  11. package/dist/breakouts/breakout.js.map +1 -0
  12. package/dist/breakouts/collection.js +23 -0
  13. package/dist/breakouts/collection.js.map +1 -0
  14. package/dist/breakouts/edit-lock-error.js +52 -0
  15. package/dist/breakouts/edit-lock-error.js.map +1 -0
  16. package/dist/breakouts/events.js +45 -0
  17. package/dist/breakouts/events.js.map +1 -0
  18. package/dist/breakouts/index.js +1048 -0
  19. package/dist/breakouts/index.js.map +1 -0
  20. package/dist/breakouts/request.js +78 -0
  21. package/dist/breakouts/request.js.map +1 -0
  22. package/dist/breakouts/utils.js +67 -0
  23. package/dist/breakouts/utils.js.map +1 -0
  24. package/dist/common/browser-detection.js +1 -20
  25. package/dist/common/browser-detection.js.map +1 -1
  26. package/dist/common/collection.js +5 -20
  27. package/dist/common/collection.js.map +1 -1
  28. package/dist/common/config.js +0 -7
  29. package/dist/common/config.js.map +1 -1
  30. package/dist/common/errors/captcha-error.js +10 -24
  31. package/dist/common/errors/captcha-error.js.map +1 -1
  32. package/dist/common/errors/intent-to-join.js +11 -24
  33. package/dist/common/errors/intent-to-join.js.map +1 -1
  34. package/dist/common/errors/join-meeting.js +12 -25
  35. package/dist/common/errors/join-meeting.js.map +1 -1
  36. package/dist/common/errors/media.js +10 -24
  37. package/dist/common/errors/media.js.map +1 -1
  38. package/dist/common/errors/no-meeting-info.js +51 -0
  39. package/dist/common/errors/no-meeting-info.js.map +1 -0
  40. package/dist/common/errors/parameter.js +5 -33
  41. package/dist/common/errors/parameter.js.map +1 -1
  42. package/dist/common/errors/password-error.js +10 -24
  43. package/dist/common/errors/password-error.js.map +1 -1
  44. package/dist/common/errors/permission.js +9 -23
  45. package/dist/common/errors/permission.js.map +1 -1
  46. package/dist/common/errors/reclaim-host-role-errors.js +158 -0
  47. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
  48. package/dist/common/errors/reconnection-in-progress.js +0 -17
  49. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  50. package/dist/common/errors/reconnection.js +10 -24
  51. package/dist/common/errors/reconnection.js.map +1 -1
  52. package/dist/common/errors/stats.js +10 -24
  53. package/dist/common/errors/stats.js.map +1 -1
  54. package/dist/common/errors/webex-errors.js +54 -48
  55. package/dist/common/errors/webex-errors.js.map +1 -1
  56. package/dist/common/errors/webex-meetings-error.js +5 -25
  57. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  58. package/dist/common/events/events-scope.js +0 -22
  59. package/dist/common/events/events-scope.js.map +1 -1
  60. package/dist/common/events/events.js +0 -23
  61. package/dist/common/events/events.js.map +1 -1
  62. package/dist/common/events/trigger-proxy.js +0 -12
  63. package/dist/common/events/trigger-proxy.js.map +1 -1
  64. package/dist/common/events/util.js +0 -15
  65. package/dist/common/events/util.js.map +1 -1
  66. package/dist/common/logs/logger-config.js +0 -4
  67. package/dist/common/logs/logger-config.js.map +1 -1
  68. package/dist/common/logs/logger-proxy.js +1 -8
  69. package/dist/common/logs/logger-proxy.js.map +1 -1
  70. package/dist/common/logs/request.js +41 -60
  71. package/dist/common/logs/request.js.map +1 -1
  72. package/dist/common/queue.js +28 -23
  73. package/dist/common/queue.js.map +1 -1
  74. package/dist/config.js +9 -15
  75. package/dist/config.js.map +1 -1
  76. package/dist/constants.js +315 -68
  77. package/dist/constants.js.map +1 -1
  78. package/dist/controls-options-manager/constants.js +14 -0
  79. package/dist/controls-options-manager/constants.js.map +1 -0
  80. package/dist/controls-options-manager/enums.js +27 -0
  81. package/dist/controls-options-manager/enums.js.map +1 -0
  82. package/dist/controls-options-manager/index.js +297 -0
  83. package/dist/controls-options-manager/index.js.map +1 -0
  84. package/dist/controls-options-manager/types.js +7 -0
  85. package/dist/controls-options-manager/types.js.map +1 -0
  86. package/dist/controls-options-manager/util.js +319 -0
  87. package/dist/controls-options-manager/util.js.map +1 -0
  88. package/dist/index.js +114 -17
  89. package/dist/index.js.map +1 -1
  90. package/dist/interpretation/collection.js +23 -0
  91. package/dist/interpretation/collection.js.map +1 -0
  92. package/dist/interpretation/index.js +366 -0
  93. package/dist/interpretation/index.js.map +1 -0
  94. package/dist/interpretation/siLanguage.js +25 -0
  95. package/dist/interpretation/siLanguage.js.map +1 -0
  96. package/dist/locus-info/controlsUtils.js +101 -29
  97. package/dist/locus-info/controlsUtils.js.map +1 -1
  98. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  99. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  100. package/dist/locus-info/fullState.js +0 -15
  101. package/dist/locus-info/fullState.js.map +1 -1
  102. package/dist/locus-info/hostUtils.js +4 -12
  103. package/dist/locus-info/hostUtils.js.map +1 -1
  104. package/dist/locus-info/index.js +561 -246
  105. package/dist/locus-info/index.js.map +1 -1
  106. package/dist/locus-info/infoUtils.js +10 -38
  107. package/dist/locus-info/infoUtils.js.map +1 -1
  108. package/dist/locus-info/mediaSharesUtils.js +68 -38
  109. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  110. package/dist/locus-info/parser.js +314 -163
  111. package/dist/locus-info/parser.js.map +1 -1
  112. package/dist/locus-info/selfUtils.js +110 -92
  113. package/dist/locus-info/selfUtils.js.map +1 -1
  114. package/dist/media/index.js +103 -231
  115. package/dist/media/index.js.map +1 -1
  116. package/dist/media/properties.js +137 -222
  117. package/dist/media/properties.js.map +1 -1
  118. package/dist/media/util.js +2 -9
  119. package/dist/media/util.js.map +1 -1
  120. package/dist/mediaQualityMetrics/config.js +505 -495
  121. package/dist/mediaQualityMetrics/config.js.map +1 -1
  122. package/dist/meeting/in-meeting-actions.js +93 -14
  123. package/dist/meeting/in-meeting-actions.js.map +1 -1
  124. package/dist/meeting/index.js +4624 -3740
  125. package/dist/meeting/index.js.map +1 -1
  126. package/dist/meeting/locusMediaRequest.js +292 -0
  127. package/dist/meeting/locusMediaRequest.js.map +1 -0
  128. package/dist/meeting/muteState.js +249 -184
  129. package/dist/meeting/muteState.js.map +1 -1
  130. package/dist/meeting/request.js +400 -346
  131. package/dist/meeting/request.js.map +1 -1
  132. package/dist/meeting/request.type.js +7 -0
  133. package/dist/meeting/request.type.js.map +1 -0
  134. package/dist/meeting/state.js +21 -31
  135. package/dist/meeting/state.js.map +1 -1
  136. package/dist/meeting/util.js +598 -586
  137. package/dist/meeting/util.js.map +1 -1
  138. package/dist/meeting-info/collection.js +6 -25
  139. package/dist/meeting-info/collection.js.map +1 -1
  140. package/dist/meeting-info/index.js +87 -39
  141. package/dist/meeting-info/index.js.map +1 -1
  142. package/dist/meeting-info/meeting-info-v2.js +349 -283
  143. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  144. package/dist/meeting-info/request.js +3 -15
  145. package/dist/meeting-info/request.js.map +1 -1
  146. package/dist/meeting-info/util.js +98 -183
  147. package/dist/meeting-info/util.js.map +1 -1
  148. package/dist/meeting-info/utilv2.js +143 -234
  149. package/dist/meeting-info/utilv2.js.map +1 -1
  150. package/dist/meetings/collection.js +26 -19
  151. package/dist/meetings/collection.js.map +1 -1
  152. package/dist/meetings/index.js +813 -596
  153. package/dist/meetings/index.js.map +1 -1
  154. package/dist/meetings/meetings.types.js +7 -0
  155. package/dist/meetings/meetings.types.js.map +1 -0
  156. package/dist/meetings/request.js +26 -41
  157. package/dist/meetings/request.js.map +1 -1
  158. package/dist/meetings/util.js +183 -156
  159. package/dist/meetings/util.js.map +1 -1
  160. package/dist/member/index.js +135 -85
  161. package/dist/member/index.js.map +1 -1
  162. package/dist/member/types.js +25 -0
  163. package/dist/member/types.js.map +1 -0
  164. package/dist/member/util.js +158 -88
  165. package/dist/member/util.js.map +1 -1
  166. package/dist/members/collection.js +13 -12
  167. package/dist/members/collection.js.map +1 -1
  168. package/dist/members/index.js +194 -204
  169. package/dist/members/index.js.map +1 -1
  170. package/dist/members/request.js +113 -68
  171. package/dist/members/request.js.map +1 -1
  172. package/dist/members/types.js +15 -0
  173. package/dist/members/types.js.map +1 -0
  174. package/dist/members/util.js +324 -259
  175. package/dist/members/util.js.map +1 -1
  176. package/dist/metrics/constants.js +14 -7
  177. package/dist/metrics/constants.js.map +1 -1
  178. package/dist/metrics/index.js +11 -558
  179. package/dist/metrics/index.js.map +1 -1
  180. package/dist/multistream/mediaRequestManager.js +263 -50
  181. package/dist/multistream/mediaRequestManager.js.map +1 -1
  182. package/dist/multistream/receiveSlot.js +58 -65
  183. package/dist/multistream/receiveSlot.js.map +1 -1
  184. package/dist/multistream/receiveSlotManager.js +76 -95
  185. package/dist/multistream/receiveSlotManager.js.map +1 -1
  186. package/dist/multistream/remoteMedia.js +62 -76
  187. package/dist/multistream/remoteMedia.js.map +1 -1
  188. package/dist/multistream/remoteMediaGroup.js +66 -43
  189. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  190. package/dist/multistream/remoteMediaManager.js +536 -439
  191. package/dist/multistream/remoteMediaManager.js.map +1 -1
  192. package/dist/multistream/sendSlotManager.js +233 -0
  193. package/dist/multistream/sendSlotManager.js.map +1 -0
  194. package/dist/networkQualityMonitor/index.js +40 -59
  195. package/dist/networkQualityMonitor/index.js.map +1 -1
  196. package/dist/personal-meeting-room/index.js +21 -45
  197. package/dist/personal-meeting-room/index.js.map +1 -1
  198. package/dist/personal-meeting-room/request.js +1 -31
  199. package/dist/personal-meeting-room/request.js.map +1 -1
  200. package/dist/personal-meeting-room/util.js +0 -13
  201. package/dist/personal-meeting-room/util.js.map +1 -1
  202. package/dist/reachability/index.js +322 -200
  203. package/dist/reachability/index.js.map +1 -1
  204. package/dist/reachability/request.js +20 -26
  205. package/dist/reachability/request.js.map +1 -1
  206. package/dist/reactions/constants.js +13 -0
  207. package/dist/reactions/constants.js.map +1 -0
  208. package/dist/reactions/reactions.js +109 -0
  209. package/dist/reactions/reactions.js.map +1 -0
  210. package/dist/reactions/reactions.type.js +36 -0
  211. package/dist/reactions/reactions.type.js.map +1 -0
  212. package/dist/reconnection-manager/index.js +388 -476
  213. package/dist/reconnection-manager/index.js.map +1 -1
  214. package/dist/recording-controller/enums.js +17 -0
  215. package/dist/recording-controller/enums.js.map +1 -0
  216. package/dist/recording-controller/index.js +362 -0
  217. package/dist/recording-controller/index.js.map +1 -0
  218. package/dist/recording-controller/util.js +64 -0
  219. package/dist/recording-controller/util.js.map +1 -0
  220. package/dist/roap/index.js +99 -94
  221. package/dist/roap/index.js.map +1 -1
  222. package/dist/roap/request.js +131 -135
  223. package/dist/roap/request.js.map +1 -1
  224. package/dist/roap/turnDiscovery.js +151 -101
  225. package/dist/roap/turnDiscovery.js.map +1 -1
  226. package/dist/rtcMetrics/constants.js +12 -0
  227. package/dist/rtcMetrics/constants.js.map +1 -0
  228. package/dist/rtcMetrics/index.js +117 -0
  229. package/dist/rtcMetrics/index.js.map +1 -0
  230. package/dist/statsAnalyzer/global.js +1 -95
  231. package/dist/statsAnalyzer/global.js.map +1 -1
  232. package/dist/statsAnalyzer/index.js +416 -497
  233. package/dist/statsAnalyzer/index.js.map +1 -1
  234. package/dist/statsAnalyzer/mqaUtil.js +145 -88
  235. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  236. package/dist/transcription/index.js +22 -47
  237. package/dist/transcription/index.js.map +1 -1
  238. package/dist/types/annotation/annotation.types.d.ts +42 -0
  239. package/dist/types/annotation/constants.d.ts +31 -0
  240. package/dist/types/annotation/index.d.ts +117 -0
  241. package/dist/types/breakouts/breakout.d.ts +8 -0
  242. package/dist/types/breakouts/collection.d.ts +5 -0
  243. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  244. package/dist/types/breakouts/events.d.ts +8 -0
  245. package/dist/types/breakouts/index.d.ts +5 -0
  246. package/dist/types/breakouts/request.d.ts +22 -0
  247. package/dist/types/breakouts/utils.d.ts +15 -0
  248. package/dist/types/common/browser-detection.d.ts +9 -0
  249. package/dist/types/common/collection.d.ts +48 -0
  250. package/dist/types/common/config.d.ts +2 -0
  251. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  252. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  253. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  254. package/dist/types/common/errors/media.d.ts +15 -0
  255. package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
  256. package/dist/types/common/errors/parameter.d.ts +15 -0
  257. package/dist/types/common/errors/password-error.d.ts +15 -0
  258. package/dist/types/common/errors/permission.d.ts +14 -0
  259. package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
  260. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  261. package/dist/types/common/errors/reconnection.d.ts +15 -0
  262. package/dist/types/common/errors/stats.d.ts +15 -0
  263. package/dist/types/common/errors/webex-errors.d.ts +93 -0
  264. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  265. package/dist/types/common/events/events-scope.d.ts +17 -0
  266. package/dist/types/common/events/events.d.ts +12 -0
  267. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  268. package/dist/types/common/events/util.d.ts +2 -0
  269. package/dist/types/common/logs/logger-config.d.ts +2 -0
  270. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  271. package/dist/types/common/logs/request.d.ts +36 -0
  272. package/dist/types/common/queue.d.ts +34 -0
  273. package/dist/types/config.d.ts +71 -0
  274. package/dist/types/constants.d.ts +1066 -0
  275. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  276. package/dist/types/controls-options-manager/enums.d.ts +15 -0
  277. package/dist/types/controls-options-manager/index.d.ts +136 -0
  278. package/dist/types/controls-options-manager/types.d.ts +43 -0
  279. package/dist/types/controls-options-manager/util.d.ts +1 -0
  280. package/dist/types/index.d.ts +7 -0
  281. package/dist/types/interpretation/collection.d.ts +5 -0
  282. package/dist/types/interpretation/index.d.ts +5 -0
  283. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  284. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  285. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  286. package/dist/types/locus-info/fullState.d.ts +2 -0
  287. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  288. package/dist/types/locus-info/index.d.ts +322 -0
  289. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  290. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  291. package/dist/types/locus-info/parser.d.ts +273 -0
  292. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  293. package/dist/types/media/index.d.ts +34 -0
  294. package/dist/types/media/properties.d.ts +93 -0
  295. package/dist/types/media/util.d.ts +2 -0
  296. package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
  297. package/dist/types/meeting/in-meeting-actions.d.ts +163 -0
  298. package/dist/types/meeting/index.d.ts +1676 -0
  299. package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
  300. package/dist/types/meeting/muteState.d.ts +184 -0
  301. package/dist/types/meeting/request.d.ts +290 -0
  302. package/dist/types/meeting/request.type.d.ts +11 -0
  303. package/dist/types/meeting/state.d.ts +9 -0
  304. package/dist/types/meeting/util.d.ts +102 -0
  305. package/dist/types/meeting-info/collection.d.ts +20 -0
  306. package/dist/types/meeting-info/index.d.ts +69 -0
  307. package/dist/types/meeting-info/meeting-info-v2.d.ts +123 -0
  308. package/dist/types/meeting-info/request.d.ts +22 -0
  309. package/dist/types/meeting-info/util.d.ts +2 -0
  310. package/dist/types/meeting-info/utilv2.d.ts +2 -0
  311. package/dist/types/meetings/collection.d.ts +31 -0
  312. package/dist/types/meetings/index.d.ts +367 -0
  313. package/dist/types/meetings/meetings.types.d.ts +4 -0
  314. package/dist/types/meetings/request.d.ts +27 -0
  315. package/dist/types/meetings/util.d.ts +18 -0
  316. package/dist/types/member/index.d.ts +160 -0
  317. package/dist/types/member/types.d.ts +32 -0
  318. package/dist/types/member/util.d.ts +2 -0
  319. package/dist/types/members/collection.d.ts +29 -0
  320. package/dist/types/members/index.d.ts +353 -0
  321. package/dist/types/members/request.d.ts +114 -0
  322. package/dist/types/members/types.d.ts +25 -0
  323. package/dist/types/members/util.d.ts +215 -0
  324. package/dist/types/metrics/constants.d.ts +65 -0
  325. package/dist/types/metrics/index.d.ts +45 -0
  326. package/dist/types/multistream/mediaRequestManager.d.ts +118 -0
  327. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  328. package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
  329. package/dist/types/multistream/remoteMedia.d.ts +72 -0
  330. package/dist/types/multistream/remoteMediaGroup.d.ts +47 -0
  331. package/dist/types/multistream/remoteMediaManager.d.ts +285 -0
  332. package/dist/types/multistream/sendSlotManager.d.ts +61 -0
  333. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  334. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  335. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  336. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  337. package/dist/types/reachability/index.d.ts +194 -0
  338. package/dist/types/reachability/request.d.ts +39 -0
  339. package/dist/types/reactions/constants.d.ts +3 -0
  340. package/dist/types/reactions/reactions.d.ts +4 -0
  341. package/dist/types/reactions/reactions.type.d.ts +52 -0
  342. package/dist/types/reconnection-manager/index.d.ts +126 -0
  343. package/dist/types/recording-controller/enums.d.ts +7 -0
  344. package/dist/types/recording-controller/index.d.ts +207 -0
  345. package/dist/types/recording-controller/util.d.ts +14 -0
  346. package/dist/types/roap/index.d.ts +78 -0
  347. package/dist/types/roap/request.d.ts +39 -0
  348. package/dist/types/roap/turnDiscovery.d.ts +92 -0
  349. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  350. package/dist/types/rtcMetrics/index.d.ts +47 -0
  351. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  352. package/dist/types/statsAnalyzer/index.d.ts +201 -0
  353. package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
  354. package/dist/types/transcription/index.d.ts +64 -0
  355. package/dist/types/webinar/collection.d.ts +16 -0
  356. package/dist/types/webinar/index.d.ts +5 -0
  357. package/dist/webinar/collection.js +44 -0
  358. package/dist/webinar/collection.js.map +1 -0
  359. package/dist/webinar/index.js +69 -0
  360. package/dist/webinar/index.js.map +1 -0
  361. package/internal-README.md +7 -6
  362. package/package.json +29 -21
  363. package/src/annotation/annotation.types.ts +50 -0
  364. package/src/annotation/constants.ts +36 -0
  365. package/src/annotation/index.ts +328 -0
  366. package/src/breakouts/README.md +220 -0
  367. package/src/breakouts/breakout.ts +188 -0
  368. package/src/breakouts/collection.ts +19 -0
  369. package/src/breakouts/edit-lock-error.ts +25 -0
  370. package/src/breakouts/events.ts +56 -0
  371. package/src/breakouts/index.ts +925 -0
  372. package/src/breakouts/request.ts +55 -0
  373. package/src/breakouts/utils.ts +57 -0
  374. package/src/common/{browser-detection.js → browser-detection.ts} +9 -6
  375. package/src/common/collection.ts +9 -7
  376. package/src/common/{config.js → config.ts} +1 -1
  377. package/src/common/errors/{captcha-error.js → captcha-error.ts} +11 -7
  378. package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +12 -7
  379. package/src/common/errors/{join-meeting.js → join-meeting.ts} +17 -8
  380. package/src/common/errors/{media.js → media.ts} +11 -7
  381. package/src/common/errors/no-meeting-info.ts +24 -0
  382. package/src/common/errors/parameter.ts +11 -7
  383. package/src/common/errors/{password-error.js → password-error.ts} +11 -7
  384. package/src/common/errors/{permission.js → permission.ts} +10 -6
  385. package/src/common/errors/reclaim-host-role-errors.ts +134 -0
  386. package/src/common/errors/{reconnection.js → reconnection.ts} +11 -7
  387. package/src/common/errors/{stats.js → stats.ts} +11 -7
  388. package/src/common/errors/{webex-errors.js → webex-errors.ts} +51 -8
  389. package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +4 -2
  390. package/src/common/events/{events-scope.js → events-scope.ts} +6 -2
  391. package/src/common/events/{events.js → events.ts} +5 -1
  392. package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +9 -5
  393. package/src/common/events/{util.js → util.ts} +2 -3
  394. package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
  395. package/src/common/logs/logger-proxy.ts +44 -0
  396. package/src/common/logs/{request.js → request.ts} +26 -9
  397. package/src/common/queue.ts +22 -9
  398. package/src/{config.js → config.ts} +18 -19
  399. package/src/constants.ts +260 -22
  400. package/src/controls-options-manager/constants.ts +5 -0
  401. package/src/controls-options-manager/enums.ts +18 -0
  402. package/src/controls-options-manager/index.ts +278 -0
  403. package/src/controls-options-manager/types.ts +59 -0
  404. package/src/controls-options-manager/util.ts +300 -0
  405. package/src/index.ts +40 -0
  406. package/src/interpretation/README.md +60 -0
  407. package/src/interpretation/collection.ts +19 -0
  408. package/src/interpretation/index.ts +332 -0
  409. package/src/interpretation/siLanguage.ts +18 -0
  410. package/src/locus-info/controlsUtils.ts +222 -0
  411. package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
  412. package/src/locus-info/{fullState.js → fullState.ts} +16 -12
  413. package/src/locus-info/{hostUtils.js → hostUtils.ts} +9 -8
  414. package/src/locus-info/{index.js → index.ts} +557 -119
  415. package/src/locus-info/{infoUtils.js → infoUtils.ts} +29 -10
  416. package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +81 -17
  417. package/src/locus-info/{parser.js → parser.ts} +303 -104
  418. package/src/locus-info/{selfUtils.js → selfUtils.ts} +199 -68
  419. package/src/media/index.ts +458 -0
  420. package/src/media/properties.ts +283 -0
  421. package/src/media/{util.js → util.ts} +2 -2
  422. package/src/mediaQualityMetrics/config.ts +384 -0
  423. package/src/meeting/in-meeting-actions.ts +191 -3
  424. package/src/meeting/index.ts +7882 -0
  425. package/src/meeting/locusMediaRequest.ts +313 -0
  426. package/src/meeting/muteState.ts +451 -0
  427. package/src/meeting/{request.js → request.ts} +421 -220
  428. package/src/meeting/request.type.ts +13 -0
  429. package/src/meeting/{state.js → state.ts} +50 -35
  430. package/src/meeting/util.ts +697 -0
  431. package/src/meeting-info/{collection.js → collection.ts} +6 -2
  432. package/src/meeting-info/index.ts +210 -0
  433. package/src/meeting-info/meeting-info-v2.ts +429 -0
  434. package/src/meeting-info/{request.js → request.ts} +14 -4
  435. package/src/meeting-info/{util.js → util.ts} +60 -51
  436. package/src/meeting-info/{utilv2.js → utilv2.ts} +78 -71
  437. package/src/meetings/{collection.js → collection.ts} +26 -3
  438. package/src/meetings/index.ts +1470 -0
  439. package/src/meetings/meetings.types.ts +12 -0
  440. package/src/meetings/{request.js → request.ts} +34 -25
  441. package/src/meetings/{util.js → util.ts} +132 -37
  442. package/src/member/{index.js → index.ts} +160 -56
  443. package/src/member/types.ts +38 -0
  444. package/src/member/util.ts +397 -0
  445. package/src/members/{collection.js → collection.ts} +10 -2
  446. package/src/members/{index.js → index.ts} +351 -146
  447. package/src/members/request.ts +255 -0
  448. package/src/members/types.ts +29 -0
  449. package/src/members/util.ts +353 -0
  450. package/src/metrics/{constants.js → constants.ts} +12 -6
  451. package/src/metrics/index.ts +73 -0
  452. package/src/multistream/mediaRequestManager.ts +337 -63
  453. package/src/multistream/receiveSlot.ts +69 -26
  454. package/src/multistream/receiveSlotManager.ts +66 -42
  455. package/src/multistream/remoteMedia.ts +40 -5
  456. package/src/multistream/remoteMediaGroup.ts +63 -3
  457. package/src/multistream/remoteMediaManager.ts +300 -66
  458. package/src/multistream/sendSlotManager.ts +170 -0
  459. package/src/networkQualityMonitor/{index.js → index.ts} +41 -29
  460. package/src/personal-meeting-room/{index.js → index.ts} +28 -19
  461. package/src/personal-meeting-room/{request.js → request.ts} +13 -4
  462. package/src/personal-meeting-room/{util.js → util.ts} +4 -4
  463. package/src/reachability/index.ts +671 -0
  464. package/src/reachability/request.ts +50 -35
  465. package/src/reactions/constants.ts +4 -0
  466. package/src/reactions/reactions.ts +104 -0
  467. package/src/reactions/reactions.type.ts +62 -0
  468. package/src/reconnection-manager/{index.js → index.ts} +258 -138
  469. package/src/recording-controller/enums.ts +8 -0
  470. package/src/recording-controller/index.ts +332 -0
  471. package/src/recording-controller/util.ts +75 -0
  472. package/src/roap/{index.js → index.ts} +127 -79
  473. package/src/roap/request.ts +153 -0
  474. package/src/roap/turnDiscovery.ts +109 -47
  475. package/src/rtcMetrics/constants.ts +3 -0
  476. package/src/rtcMetrics/index.ts +100 -0
  477. package/src/statsAnalyzer/global.ts +37 -0
  478. package/src/statsAnalyzer/index.ts +1250 -0
  479. package/src/statsAnalyzer/mqaUtil.ts +292 -0
  480. package/src/transcription/{index.js → index.ts} +46 -39
  481. package/src/webinar/collection.ts +31 -0
  482. package/src/webinar/index.ts +62 -0
  483. package/test/integration/spec/converged-space-meetings.js +233 -0
  484. package/test/integration/spec/journey.js +790 -530
  485. package/test/integration/spec/space-meeting.js +391 -204
  486. package/test/integration/spec/transcription.js +7 -8
  487. package/test/unit/spec/annotation/index.ts +418 -0
  488. package/test/unit/spec/breakouts/breakout.ts +237 -0
  489. package/test/unit/spec/breakouts/collection.ts +15 -0
  490. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  491. package/test/unit/spec/breakouts/events.ts +89 -0
  492. package/test/unit/spec/breakouts/index.ts +1790 -0
  493. package/test/unit/spec/breakouts/request.ts +104 -0
  494. package/test/unit/spec/breakouts/utils.js +72 -0
  495. package/test/unit/spec/common/browser-detection.js +9 -28
  496. package/test/unit/spec/common/queue.js +31 -2
  497. package/test/unit/spec/controls-options-manager/index.js +287 -0
  498. package/test/unit/spec/controls-options-manager/util.js +582 -0
  499. package/test/unit/spec/fixture/locus.js +93 -90
  500. package/test/unit/spec/interpretation/collection.ts +15 -0
  501. package/test/unit/spec/interpretation/index.ts +589 -0
  502. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  503. package/test/unit/spec/locus-info/controlsUtils.js +325 -32
  504. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  505. package/test/unit/spec/locus-info/index.js +1390 -17
  506. package/test/unit/spec/locus-info/infoUtils.js +71 -40
  507. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  508. package/test/unit/spec/locus-info/lib/SeqCmp.json +529 -685
  509. package/test/unit/spec/locus-info/mediaSharesUtils.ts +32 -0
  510. package/test/unit/spec/locus-info/parser.js +119 -44
  511. package/test/unit/spec/locus-info/selfConstant.js +120 -103
  512. package/test/unit/spec/locus-info/selfUtils.js +296 -12
  513. package/test/unit/spec/media/index.ts +128 -77
  514. package/test/unit/spec/media/properties.ts +11 -11
  515. package/test/unit/spec/meeting/in-meeting-actions.ts +92 -3
  516. package/test/unit/spec/meeting/index.js +7433 -2752
  517. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  518. package/test/unit/spec/meeting/muteState.js +420 -211
  519. package/test/unit/spec/meeting/request.js +545 -79
  520. package/test/unit/spec/meeting/utils.js +722 -174
  521. package/test/unit/spec/meeting-info/index.js +300 -0
  522. package/test/unit/spec/meeting-info/meetinginfov2.js +624 -76
  523. package/test/unit/spec/meeting-info/request.js +7 -9
  524. package/test/unit/spec/meeting-info/util.js +11 -12
  525. package/test/unit/spec/meeting-info/utilv2.js +131 -74
  526. package/test/unit/spec/meetings/collection.js +15 -1
  527. package/test/unit/spec/meetings/index.js +1365 -377
  528. package/test/unit/spec/meetings/utils.js +216 -14
  529. package/test/unit/spec/member/index.js +61 -7
  530. package/test/unit/spec/member/util.js +526 -26
  531. package/test/unit/spec/members/index.js +536 -55
  532. package/test/unit/spec/members/request.js +228 -40
  533. package/test/unit/spec/members/utils.js +217 -4
  534. package/test/unit/spec/metrics/index.js +12 -66
  535. package/test/unit/spec/multistream/mediaRequestManager.ts +1012 -109
  536. package/test/unit/spec/multistream/receiveSlot.ts +77 -18
  537. package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
  538. package/test/unit/spec/multistream/remoteMedia.ts +40 -2
  539. package/test/unit/spec/multistream/remoteMediaGroup.ts +271 -5
  540. package/test/unit/spec/multistream/remoteMediaManager.ts +738 -65
  541. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  542. package/test/unit/spec/networkQualityMonitor/index.js +24 -18
  543. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  544. package/test/unit/spec/reachability/index.ts +598 -26
  545. package/test/unit/spec/reachability/request.js +68 -0
  546. package/test/unit/spec/reconnection-manager/index.js +181 -12
  547. package/test/unit/spec/recording-controller/index.js +307 -0
  548. package/test/unit/spec/recording-controller/util.js +229 -0
  549. package/test/unit/spec/roap/index.ts +179 -64
  550. package/test/unit/spec/roap/request.ts +232 -0
  551. package/test/unit/spec/roap/turnDiscovery.ts +123 -58
  552. package/test/unit/spec/rtcMetrics/index.ts +73 -0
  553. package/test/unit/spec/stats-analyzer/index.js +199 -60
  554. package/test/unit/spec/webinar/collection.ts +13 -0
  555. package/test/unit/spec/webinar/index.ts +60 -0
  556. package/test/utils/cmr.js +44 -42
  557. package/test/utils/constants.js +9 -0
  558. package/test/utils/integrationTestUtils.js +46 -0
  559. package/test/utils/testUtils.js +63 -99
  560. package/test/utils/webex-config.js +22 -18
  561. package/test/utils/webex-test-users.js +57 -50
  562. package/tsconfig.json +6 -0
  563. package/dist/media/internal-media-core-wrapper.js +0 -22
  564. package/dist/media/internal-media-core-wrapper.js.map +0 -1
  565. package/dist/meeting/effectsState.js +0 -327
  566. package/dist/meeting/effectsState.js.map +0 -1
  567. package/dist/metrics/config.js +0 -301
  568. package/dist/metrics/config.js.map +0 -1
  569. package/dist/multistream/multistreamMedia.js +0 -116
  570. package/dist/multistream/multistreamMedia.js.map +0 -1
  571. package/dist/peer-connection-manager/util.js +0 -124
  572. package/dist/peer-connection-manager/util.js.map +0 -1
  573. package/src/common/logs/logger-proxy.js +0 -33
  574. package/src/index.js +0 -15
  575. package/src/locus-info/controlsUtils.js +0 -102
  576. package/src/media/index.js +0 -459
  577. package/src/media/internal-media-core-wrapper.ts +0 -9
  578. package/src/media/properties.js +0 -289
  579. package/src/mediaQualityMetrics/config.js +0 -382
  580. package/src/meeting/effectsState.js +0 -205
  581. package/src/meeting/index.js +0 -6284
  582. package/src/meeting/muteState.js +0 -318
  583. package/src/meeting/util.js +0 -506
  584. package/src/meeting-info/index.js +0 -131
  585. package/src/meeting-info/meeting-info-v2.js +0 -255
  586. package/src/meetings/index.js +0 -1015
  587. package/src/member/util.js +0 -254
  588. package/src/members/request.js +0 -131
  589. package/src/members/util.js +0 -258
  590. package/src/metrics/config.js +0 -324
  591. package/src/metrics/index.js +0 -530
  592. package/src/multistream/multistreamMedia.ts +0 -92
  593. package/src/peer-connection-manager/util.ts +0 -117
  594. package/src/reachability/index.js +0 -464
  595. package/src/roap/request.js +0 -127
  596. package/src/statsAnalyzer/global.js +0 -133
  597. package/src/statsAnalyzer/index.js +0 -1006
  598. package/src/statsAnalyzer/mqaUtil.js +0 -173
  599. package/test/unit/spec/meeting/effectsState.js +0 -291
  600. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
  601. /package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
@@ -1,61 +1,39 @@
1
1
  "use strict";
2
2
 
3
3
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
4
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
7
5
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
6
  _Object$defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
-
13
9
  exports.default = void 0;
14
-
15
10
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
16
-
17
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
18
-
19
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
20
-
13
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
21
14
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
22
-
23
15
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
24
-
25
16
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
26
-
17
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
18
+ var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
19
+ var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
20
+ var _assignWith2 = _interopRequireDefault(require("lodash/assignWith"));
27
21
  var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
28
-
29
22
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
30
-
31
23
  var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
32
-
33
24
  var _constants = require("../constants");
34
-
25
+ var _infoUtils = _interopRequireDefault(require("./infoUtils"));
26
+ var _fullState = _interopRequireDefault(require("./fullState"));
27
+ var _selfUtils = _interopRequireDefault(require("./selfUtils"));
28
+ var _hostUtils = _interopRequireDefault(require("./hostUtils"));
29
+ var _controlsUtils = _interopRequireDefault(require("./controlsUtils"));
30
+ var _embeddedAppsUtils = _interopRequireDefault(require("./embeddedAppsUtils"));
31
+ var _mediaSharesUtils = _interopRequireDefault(require("./mediaSharesUtils"));
32
+ var _parser = _interopRequireDefault(require("./parser"));
35
33
  var _metrics = _interopRequireDefault(require("../metrics"));
36
-
37
- var _config = require("../metrics/config");
38
-
39
- var _infoUtils = _interopRequireDefault(require("../locus-info/infoUtils"));
40
-
41
- var _fullState = _interopRequireDefault(require("../locus-info/fullState"));
42
-
43
- var _selfUtils = _interopRequireDefault(require("../locus-info/selfUtils"));
44
-
45
- var _hostUtils = _interopRequireDefault(require("../locus-info/hostUtils"));
46
-
47
- var _controlsUtils = _interopRequireDefault(require("../locus-info/controlsUtils"));
48
-
49
- var _embeddedAppsUtils = _interopRequireDefault(require("../locus-info/embeddedAppsUtils"));
50
-
51
- var _mediaSharesUtils = _interopRequireDefault(require("../locus-info/mediaSharesUtils"));
52
-
53
- var _parser = _interopRequireDefault(require("../locus-info/parser"));
54
-
34
+ var _constants2 = _interopRequireDefault(require("../metrics/constants"));
55
35
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
56
-
57
36
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
58
-
59
37
  /**
60
38
  * @description LocusInfo extends ChildEmitter to convert locusInfo info a private emitter to parent object
61
39
  * @export
@@ -64,14 +42,48 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
64
42
  */
65
43
  var LocusInfo = /*#__PURE__*/function (_EventsScope) {
66
44
  (0, _inherits2.default)(LocusInfo, _EventsScope);
67
-
68
45
  var _super = _createSuper(LocusInfo);
69
-
46
+ /**
47
+ * Constructor
48
+ * @param {function} updateMeeting callback to update the meeting object from an object
49
+ * @param {object} webex
50
+ * @param {string} meetingId
51
+ * @returns {undefined}
52
+ */
70
53
  function LocusInfo(updateMeeting, webex, meetingId) {
71
54
  var _this;
72
-
73
55
  (0, _classCallCheck2.default)(this, LocusInfo);
74
56
  _this = _super.call(this);
57
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "compareAndUpdateFlags", void 0);
58
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "emitChange", void 0);
59
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "locusParser", void 0);
60
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingId", void 0);
61
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "parsedLocus", void 0);
62
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateMeeting", void 0);
63
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "webex", void 0);
64
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "aclUrl", void 0);
65
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "baseSequence", void 0);
66
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "created", void 0);
67
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deltaParticipants", void 0);
68
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "identities", void 0);
69
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "membership", void 0);
70
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "participants", void 0);
71
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "participantsUrl", void 0);
72
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "replaces", void 0);
73
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scheduledMeeting", void 0);
74
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sequence", void 0);
75
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "controls", void 0);
76
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "conversationUrl", void 0);
77
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "embeddedApps", void 0);
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fullState", void 0);
79
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "host", void 0);
80
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "info", void 0);
81
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roles", void 0);
82
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaShares", void 0);
83
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "replace", void 0);
84
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "url", void 0);
85
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "services", void 0);
86
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mainSessionLocusCache", void 0);
75
87
  _this.parsedLocus = {
76
88
  states: []
77
89
  };
@@ -83,52 +95,103 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
83
95
  _this.locusParser = new _parser.default();
84
96
  return _this;
85
97
  }
98
+
86
99
  /**
87
- * Apply locus delta data to meeting
88
- * @param {string} action Locus delta action
89
- * @param {Locus} locus
100
+ * Does a Locus sync. It tries to get the latest delta DTO or if it can't, it falls back to getting the full Locus DTO.
101
+ *
90
102
  * @param {Meeting} meeting
91
103
  * @returns {undefined}
92
104
  */
93
-
94
-
95
105
  (0, _createClass2.default)(LocusInfo, [{
96
- key: "applyLocusDeltaData",
97
- value: function applyLocusDeltaData(action, locus, meeting) {
106
+ key: "doLocusSync",
107
+ value: function doLocusSync(meeting) {
98
108
  var _this2 = this;
109
+ var isDelta;
110
+ var url;
111
+ if (this.locusParser.workingCopy.syncUrl) {
112
+ url = this.locusParser.workingCopy.syncUrl;
113
+ isDelta = true;
114
+ } else {
115
+ url = meeting.locusUrl;
116
+ isDelta = false;
117
+ }
118
+ _loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> doing Locus sync (getting ".concat(isDelta ? 'delta' : 'full', " DTO)"));
119
+
120
+ // return value ignored on purpose
121
+ meeting.meetingRequest.getLocusDTO({
122
+ url: url
123
+ }).catch(function (e) {
124
+ if (isDelta) {
125
+ _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> delta sync failed, falling back to full sync');
126
+ _metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_DELTA_SYNC_FAILED, {
127
+ correlationId: meeting.correlationId,
128
+ url: url,
129
+ reason: e.message,
130
+ errorName: e.name,
131
+ stack: e.stack,
132
+ code: e.code
133
+ });
134
+ isDelta = false;
135
+ return meeting.meetingRequest.getLocusDTO({
136
+ url: meeting.locusUrl
137
+ }).catch(function (err) {
138
+ _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting');
139
+ _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
140
+ throw err;
141
+ });
142
+ }
143
+ _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> fallback full sync failed, destroying the meeting');
144
+ _this2.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
145
+ throw e;
146
+ }).then(function (res) {
147
+ if (isDelta) {
148
+ if (!(0, _isEmpty2.default)(res.body)) {
149
+ meeting.locusInfo.handleLocusDelta(res.body, meeting);
150
+ } else {
151
+ _loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> received empty body from syncUrl, so we already have latest Locus DTO');
152
+ }
153
+ } else {
154
+ meeting.locusInfo.onFullLocus(res.body);
155
+ }
156
+ // Notify parser to resume processing delta events.
157
+ // Any deltas in the queue that have now been superseded by this sync will simply be ignored
158
+ _this2.locusParser.resume();
159
+ });
160
+ }
99
161
 
162
+ /**
163
+ * Apply locus delta data to meeting
164
+ * @param {string} action Locus delta action
165
+ * @param {Locus} locus
166
+ * @param {Meeting} meeting
167
+ * @returns {undefined}
168
+ */
169
+ }, {
170
+ key: "applyLocusDeltaData",
171
+ value: function applyLocusDeltaData(action, locus, meeting) {
100
172
  var _LocusDeltaParser$loc = _parser.default.loci,
101
- DESYNC = _LocusDeltaParser$loc.DESYNC,
102
- USE_CURRENT = _LocusDeltaParser$loc.USE_CURRENT,
103
- USE_INCOMING = _LocusDeltaParser$loc.USE_INCOMING;
104
-
173
+ DESYNC = _LocusDeltaParser$loc.DESYNC,
174
+ USE_CURRENT = _LocusDeltaParser$loc.USE_CURRENT,
175
+ USE_INCOMING = _LocusDeltaParser$loc.USE_INCOMING,
176
+ WAIT = _LocusDeltaParser$loc.WAIT,
177
+ LOCUS_URL_CHANGED = _LocusDeltaParser$loc.LOCUS_URL_CHANGED;
105
178
  switch (action) {
106
179
  case USE_INCOMING:
107
180
  meeting.locusInfo.onDeltaLocus(locus);
108
181
  break;
109
-
110
182
  case USE_CURRENT:
111
- meeting.locusDesync = false;
112
- meeting.needToGetFullLocus = false;
183
+ case WAIT:
184
+ // do nothing
113
185
  break;
114
-
115
186
  case DESYNC:
116
- meeting.meetingRequest.getFullLocus({
117
- desync: true,
118
- locusUrl: meeting.locusUrl
119
- }).then(function (res) {
120
- meeting.locusInfo.onFullLocus(res.body); // Notify parser to resume processing delta events
121
- // now that we have full locus from DESYNC.
122
-
123
- _this2.locusParser.resume();
124
- });
187
+ case LOCUS_URL_CHANGED:
188
+ this.doLocusSync(meeting);
125
189
  break;
126
-
127
190
  default:
128
191
  _loggerProxy.default.logger.info("Locus-info:index#applyLocusDeltaData --> Unknown locus delta action: ".concat(action));
129
-
130
192
  }
131
193
  }
194
+
132
195
  /**
133
196
  * Adds locus delta to parser's queue
134
197
  * and registers a function handler
@@ -137,12 +200,10 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
137
200
  * @param {Meeting} meeting
138
201
  * @returns {undefined}
139
202
  */
140
-
141
203
  }, {
142
204
  key: "handleLocusDelta",
143
205
  value: function handleLocusDelta(locus, meeting) {
144
206
  var _this3 = this;
145
-
146
207
  // register a function to process delta actions
147
208
  if (!this.locusParser.onDeltaAction) {
148
209
  // delta action, along with associated loci
@@ -150,20 +211,20 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
150
211
  this.locusParser.onDeltaAction = function (action, parsedLoci) {
151
212
  _this3.applyLocusDeltaData(action, parsedLoci, meeting);
152
213
  };
153
- } // queue delta event with parser
154
-
155
-
214
+ }
215
+ // queue delta event with parser
156
216
  this.locusParser.onDeltaEvent(locus);
157
217
  }
218
+
158
219
  /**
159
220
  * @param {Locus} locus
160
221
  * @returns {undefined}
161
222
  * @memberof LocusInfo
162
223
  */
163
-
164
224
  }, {
165
225
  key: "init",
166
226
  value: function init() {
227
+ var _locus$links;
167
228
  var locus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
168
229
  this.created = locus.created || null;
169
230
  this.scheduledMeeting = locus.meeting || null;
@@ -175,6 +236,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
175
236
  this.membership = locus.membership || null;
176
237
  this.identities = locus.identities || null;
177
238
  this.participants = locus.participants || null;
239
+
178
240
  /**
179
241
  * Stores the delta values for a changed participant.
180
242
  *
@@ -192,50 +254,53 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
192
254
  * @private
193
255
  * @member LocusInfo
194
256
  */
195
-
196
- this.deltaParticipants = []; // above section only updates the locusInfo object
257
+ this.deltaParticipants = [];
258
+ this.updateLocusCache(locus);
259
+ // above section only updates the locusInfo object
197
260
  // The below section makes sure it updates the locusInfo as well as updates the meeting object
198
-
199
- this.updateParticipants(locus.participants); // For 1:1 space meeting the conversation Url does not exist in locus.conversation
200
-
261
+ this.updateParticipants(locus.participants);
262
+ // For 1:1 space meeting the conversation Url does not exist in locus.conversation
201
263
  this.updateConversationUrl(locus.conversationUrl, locus.info);
202
- this.updateControls(locus.controls);
264
+ this.updateControls(locus.controls, locus.self);
203
265
  this.updateLocusUrl(locus.url);
204
266
  this.updateFullState(locus.fullState);
205
267
  this.updateMeetingInfo(locus.info);
206
- this.updateEmbeddedApps(locus.embeddedApps); // self and participants generate sipUrl for 1:1 meeting
207
-
268
+ this.updateEmbeddedApps(locus.embeddedApps);
269
+ // self and participants generate sipUrl for 1:1 meeting
208
270
  this.updateSelf(locus.self, locus.participants);
209
271
  this.updateHostInfo(locus.host);
210
272
  this.updateMediaShares(locus.mediaShares);
273
+ this.updateServices((_locus$links = locus.links) === null || _locus$links === void 0 ? void 0 : _locus$links.services);
211
274
  }
275
+
212
276
  /**
213
277
  * @param {Object} locus
214
278
  * @returns {undefined}
215
279
  * @memberof LocusInfo
216
280
  */
217
-
218
281
  }, {
219
282
  key: "initialSetup",
220
283
  value: function initialSetup(locus) {
221
- this.onFullLocus(locus); // Change it to true after it receives it first locus object
284
+ this.updateLocusCache(locus);
285
+ this.onFullLocus(locus);
222
286
 
287
+ // Change it to true after it receives it first locus object
223
288
  this.emitChange = true;
224
289
  }
290
+
225
291
  /**
226
292
  * @param {Meeting} meeting
227
293
  * @param {Object} data
228
294
  * @returns {undefined}
229
295
  * @memberof LocusInfo
230
296
  */
231
-
232
297
  }, {
233
298
  key: "parse",
234
299
  value: function parse(meeting, data) {
300
+ // eslint-disable-next-line @typescript-eslint/no-shadow
235
301
  var eventType = data.eventType;
236
-
302
+ var locus = this.getTheLocusToUpdate(data.locus);
237
303
  _loggerProxy.default.logger.info("Locus-info:index#parse --> received locus data: ".concat(eventType));
238
-
239
304
  switch (eventType) {
240
305
  case _constants.LOCUSEVENT.PARTICIPANT_JOIN:
241
306
  case _constants.LOCUSEVENT.PARTICIPANT_LEFT:
@@ -251,19 +316,18 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
251
316
  case _constants.LOCUSEVENT.PARTICIPANT_DECLINED:
252
317
  case _constants.LOCUSEVENT.FLOOR_GRANTED:
253
318
  case _constants.LOCUSEVENT.FLOOR_RELEASED:
254
- this.onFullLocus(data.locus, eventType);
319
+ this.onFullLocus(locus, eventType);
255
320
  break;
256
-
257
321
  case _constants.LOCUSEVENT.DIFFERENCE:
258
- this.handleLocusDelta(data.locus, meeting);
322
+ this.handleLocusDelta(locus, meeting);
259
323
  break;
260
-
261
324
  default:
262
325
  // Why will there be a event with no eventType ????
263
326
  // we may not need this, we can get full locus
264
- this.handleLocusDelta(data.locus, meeting);
327
+ this.handleLocusDelta(locus, meeting);
265
328
  }
266
329
  }
330
+
267
331
  /**
268
332
  * @param {String} scope
269
333
  * @param {String} eventName
@@ -271,45 +335,49 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
271
335
  * @returns {undefined}
272
336
  * @memberof LocusInfo
273
337
  */
274
-
275
338
  }, {
276
339
  key: "emitScoped",
277
340
  value: function emitScoped(scope, eventName, args) {
278
341
  return this.emit(scope, eventName, args);
279
342
  }
343
+
280
344
  /**
281
345
  * updates the locus with full locus object
282
346
  * @param {object} locus locus object
283
- * @param {sting} eventType particulat locus event
347
+ * @param {string} eventType particulat locus event
284
348
  * @returns {object} null
285
349
  * @memberof LocusInfo
286
350
  */
287
-
288
351
  }, {
289
352
  key: "onFullLocus",
290
353
  value: function onFullLocus(locus, eventType) {
291
354
  if (!locus) {
292
355
  _loggerProxy.default.logger.error('Locus-info:index#onFullLocus --> object passed as argument was invalid, continuing.');
293
356
  }
294
-
357
+ if (!this.locusParser.isNewFullLocus(locus)) {
358
+ _loggerProxy.default.logger.info("Locus-info:index#onFullLocus --> ignoring old full locus DTO, eventType=".concat(eventType));
359
+ return;
360
+ }
295
361
  this.updateParticipantDeltas(locus.participants);
296
362
  this.scheduledMeeting = locus.meeting || null;
297
363
  this.participants = locus.participants;
364
+ var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
298
365
  this.updateLocusInfo(locus);
299
- this.updateParticipants(locus.participants);
366
+ this.updateParticipants(locus.participants, isReplaceMembers);
300
367
  this.isMeetingActive();
301
368
  this.handleOneOnOneEvent(eventType);
302
- this.updateEmbeddedApps(locus.embeddedApps); // set current (working copy) for parser
303
-
369
+ this.updateEmbeddedApps(locus.embeddedApps);
370
+ // set current (working copy) for parser
304
371
  this.locusParser.workingCopy = locus;
305
- } // used for ringing stops on one on one
372
+ }
306
373
 
374
+ // used for ringing stops on one on one
307
375
  /**
308
376
  * @param {String} eventType
309
377
  * @returns {undefined}
310
378
  * @memberof LocusInfo
311
379
  */
312
-
380
+ // eslint-disable-next-line @typescript-eslint/no-shadow
313
381
  }, {
314
382
  key: "handleOneOnOneEvent",
315
383
  value: function handleOneOnOneEvent(eventType) {
@@ -324,9 +392,8 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
324
392
  remoteDeclined: true,
325
393
  remoteAnswered: false
326
394
  });
327
- } // for 1:1 bob calls alice and alice answers, notify the meeting state
328
-
329
-
395
+ }
396
+ // for 1:1 bob calls alice and alice answers, notify the meeting state
330
397
  if (eventType === _constants.LOCUSEVENT.PARTICIPANT_JOIN) {
331
398
  // trigger the event for stop ringing
332
399
  this.emitScoped({
@@ -339,29 +406,37 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
339
406
  }
340
407
  }
341
408
  }
409
+
342
410
  /**
343
411
  * @param {Object} locus
344
412
  * @returns {undefined}
345
413
  * @memberof LocusInfo
346
414
  */
347
-
348
415
  }, {
349
416
  key: "onDeltaLocus",
350
417
  value: function onDeltaLocus(locus) {
418
+ var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
351
419
  this.updateLocusInfo(locus);
352
- this.updateParticipants(locus.participants);
420
+ this.updateParticipants(locus.participants, isReplaceMembers);
353
421
  this.isMeetingActive();
354
422
  }
423
+
355
424
  /**
356
425
  * @param {Object} locus
357
426
  * @returns {undefined}
358
427
  * @memberof LocusInfo
359
428
  */
360
-
361
429
  }, {
362
430
  key: "updateLocusInfo",
363
431
  value: function updateLocusInfo(locus) {
364
- this.updateControls(locus.controls);
432
+ var _locus$self, _locus$self2, _locus$links2;
433
+ if (((_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.reason) === 'MOVED' && ((_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.state) === 'LEFT') {
434
+ // When moved to a breakout session locus sends a message for the previous locus
435
+ // indicating that we have been moved. It isn't helpful to continue parsing this
436
+ // as it gets interpreted as if we have left the call
437
+ return;
438
+ }
439
+ this.updateControls(locus.controls, locus.self);
365
440
  this.updateConversationUrl(locus.conversationUrl, locus.info);
366
441
  this.updateCreated(locus.created);
367
442
  this.updateFullState(locus.fullState);
@@ -378,53 +453,63 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
378
453
  this.updateMemberShip(locus.membership);
379
454
  this.updateIdentifiers(locus.identities);
380
455
  this.updateEmbeddedApps(locus.embeddedApps);
381
- this.compareAndUpdate(); // update which required to compare different objects from locus
456
+ this.updateServices((_locus$links2 = locus.links) === null || _locus$links2 === void 0 ? void 0 : _locus$links2.services);
457
+ this.compareAndUpdate();
458
+ // update which required to compare different objects from locus
382
459
  }
460
+
383
461
  /**
384
462
  * @param {Array} participants
385
463
  * @param {Object} self
386
464
  * @returns {Array}
387
465
  * @memberof LocusInfo
388
466
  */
389
-
390
467
  }, {
391
468
  key: "getLocusPartner",
392
469
  value: function getLocusPartner(participants, self) {
393
470
  if (!participants || participants.length === 0) {
394
471
  return null;
395
472
  }
396
-
397
473
  return participants.find(function (participant) {
398
474
  return self && participant.identity !== self.identity && (participants.length <= 2 || participant.type === _constants._USER_ && !participant.removed);
399
- }) || this.partner;
400
- } // TODO: all the leave states need to be checked
475
+ }
476
+ // @ts-ignore
477
+ ) || this.partner;
478
+ }
401
479
 
480
+ // TODO: all the leave states need to be checked
402
481
  /**
403
482
  * @returns {undefined}
404
483
  * @memberof LocusInfo
405
484
  */
406
-
407
485
  }, {
408
486
  key: "isMeetingActive",
409
487
  value: function isMeetingActive() {
410
488
  if (this.parsedLocus.fullState.type === _constants._CALL_ || this.parsedLocus.fullState.type === _constants._SIP_BRIDGE_) {
489
+ // @ts-ignore
411
490
  var partner = this.getLocusPartner(this.participants, this.self);
412
491
  this.updateMeeting({
413
492
  partner: partner
414
- }); // Check if guest user needs to be checked here
493
+ });
494
+
495
+ // Check if guest user needs to be checked here
496
+
415
497
  // 1) when bob declines call from bob, (bob='DECLINED')
416
498
  // 2) When alice rejects call to bob , (bob='NOTIFIED')
499
+
417
500
  // When we dont add MEDIA for condition 2. The state of bob='IDLE'
418
501
 
419
502
  if (this.fullState && this.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
420
503
  // TODO: update the meeting state
421
504
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Call Ended, locus state is inactive.');
422
505
 
423
- _metrics.default.postEvent({
424
- event: _config.eventType.REMOTE_ENDED,
425
- meetingId: this.meetingId
506
+ // @ts-ignore
507
+ this.webex.internal.newMetrics.submitClientEvent({
508
+ name: 'client.call.remote-ended',
509
+ options: {
510
+ meetingId: this.meetingId
511
+ }
426
512
  });
427
-
428
513
  this.emitScoped({
429
514
  file: 'locus-info',
430
515
  function: 'isMeetingActive'
@@ -433,11 +518,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
433
518
  shouldLeave: false
434
519
  });
435
520
  } else if (partner.state === _constants.MEETING_STATE.STATES.LEFT && this.parsedLocus.self && (this.parsedLocus.self.state === _constants.MEETING_STATE.STATES.DECLINED || this.parsedLocus.self.state === _constants.MEETING_STATE.STATES.NOTIFIED || this.parsedLocus.self.state === _constants.MEETING_STATE.STATES.JOINED)) {
436
- _metrics.default.postEvent({
437
- event: _config.eventType.REMOTE_ENDED,
438
- meetingId: this.meetingId
521
+ // @ts-ignore
522
+ this.webex.internal.newMetrics.submitClientEvent({
523
+ name: 'client.call.remote-ended',
524
+ options: {
525
+ meetingId: this.meetingId
526
+ }
439
527
  });
440
-
441
528
  this.emitScoped({
442
529
  file: 'locus-info',
443
530
  function: 'isMeetingActive'
@@ -447,11 +534,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
447
534
  });
448
535
  } else if (this.parsedLocus.self && this.parsedLocus.self.state === _constants.MEETING_STATE.STATES.LEFT && (partner.state === _constants.MEETING_STATE.STATES.LEFT || partner.state === _constants.MEETING_STATE.STATES.DECLINED || partner.state === _constants.MEETING_STATE.STATES.NOTIFIED || partner.state === _constants.MEETING_STATE.STATES.IDLE) // Happens when user just joins and adds no Media
449
536
  ) {
450
- _metrics.default.postEvent({
451
- event: _config.eventType.REMOTE_ENDED,
452
- meetingId: this.meetingId
537
+ // @ts-ignore
538
+ this.webex.internal.newMetrics.submitClientEvent({
539
+ name: 'client.call.remote-ended',
540
+ options: {
541
+ meetingId: this.meetingId
542
+ }
453
543
  });
454
-
455
544
  this.emitScoped({
456
545
  file: 'locus-info',
457
546
  function: 'isMeetingActive'
@@ -461,14 +550,18 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
461
550
  });
462
551
  }
463
552
  } else if (this.parsedLocus.fullState.type === _constants._MEETING_) {
464
- if (this.fullState && (this.fullState.state === _constants.LOCUS.STATE.INACTIVE || this.fullState.state === _constants.LOCUS.STATE.TERMINATING)) {
553
+ if (this.fullState && (this.fullState.state === _constants.LOCUS.STATE.INACTIVE ||
554
+ // @ts-ignore
555
+ this.fullState.state === _constants.LOCUS.STATE.TERMINATING)) {
465
556
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting is ending due to inactive or terminating');
466
557
 
467
- _metrics.default.postEvent({
468
- event: _config.eventType.REMOTE_ENDED,
469
- meetingId: this.meetingId
558
+ // @ts-ignore
559
+ this.webex.internal.newMetrics.submitClientEvent({
560
+ name: 'client.call.remote-ended',
561
+ options: {
562
+ meetingId: this.meetingId
563
+ }
470
564
  });
471
-
472
565
  this.emitScoped({
473
566
  file: 'locus-info',
474
567
  function: 'isMeetingActive'
@@ -478,11 +571,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
478
571
  });
479
572
  } else if (this.fullState && this.fullState.removed) {
480
573
  // user has been dropped from a meeting
481
- _metrics.default.postEvent({
482
- event: _config.eventType.REMOTE_ENDED,
483
- meetingId: this.meetingId
484
- });
485
574
 
575
+ // @ts-ignore
576
+ this.webex.internal.newMetrics.submitClientEvent({
577
+ name: 'client.call.remote-ended',
578
+ options: {
579
+ meetingId: this.meetingId
580
+ }
581
+ });
486
582
  this.emitScoped({
487
583
  file: 'locus-info',
488
584
  function: 'isMeetingActive'
@@ -490,7 +586,8 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
490
586
  reason: _constants.MEETING_REMOVED_REASON.FULLSTATE_REMOVED,
491
587
  shouldLeave: false
492
588
  });
493
- } // If you are guest and you are removed from the meeting
589
+ }
590
+ // If you are guest and you are removed from the meeting
494
591
  // You wont get any further events
495
592
  else if (this.parsedLocus.self && this.parsedLocus.self.removed) {
496
593
  // Check if we need to send an event
@@ -506,13 +603,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
506
603
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting Type is unknown.');
507
604
  }
508
605
  }
606
+
509
607
  /**
510
608
  * checks if the host permissions have changed while in the meeting
511
609
  * This would be the case if your role as host or moderator has been updated
512
610
  * @returns {undefined}
513
611
  * @memberof LocusInfo
514
612
  */
515
-
516
613
  }, {
517
614
  key: "compareAndUpdate",
518
615
  value: function compareAndUpdate() {
@@ -522,17 +619,16 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
522
619
  this.compareSelfAndHost();
523
620
  }
524
621
  }
622
+
525
623
  /**
526
624
  * compared the self object to check if the user has host permissions
527
625
  * @returns {undefined}
528
626
  * @memberof LocusInfo
529
627
  */
530
-
531
628
  }, {
532
629
  key: "compareSelfAndHost",
533
630
  value: function compareSelfAndHost() {
534
631
  var _this$parsedLocus$hos;
535
-
536
632
  // In some cases the host info is not present but the moderator values changes from null to false so it triggers an update
537
633
  if (this.parsedLocus.self.selfIdentity === ((_this$parsedLocus$hos = this.parsedLocus.host) === null || _this$parsedLocus$hos === void 0 ? void 0 : _this$parsedLocus$hos.hostId) && this.parsedLocus.self.moderator) {
538
634
  this.emitScoped({
@@ -550,6 +646,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
550
646
  });
551
647
  }
552
648
  }
649
+
553
650
  /**
554
651
  * Update the deltaParticipants property of this object based on a list of
555
652
  * provided participants.
@@ -557,22 +654,19 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
557
654
  * @param {Array} [participants] - The participants to update against.
558
655
  * @returns {void}
559
656
  */
560
-
561
657
  }, {
562
658
  key: "updateParticipantDeltas",
563
659
  value: function updateParticipantDeltas() {
564
660
  var _this4 = this;
565
-
566
661
  var participants = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
567
-
568
662
  // Used to find a participant within a participants collection.
569
663
  var findParticipant = function findParticipant(participant, collection) {
570
664
  return collection.find(function (item) {
571
665
  return item.person.id === participant.person.id;
572
666
  });
573
- }; // Generates an object that indicates which state properties have changed.
574
-
667
+ };
575
668
 
669
+ // Generates an object that indicates which state properties have changed.
576
670
  var generateDelta = function generateDelta() {
577
671
  var prevState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
578
672
  var newState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -581,8 +675,9 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
581
675
  audioStatus: prevState.audioStatus !== newState.audioStatus,
582
676
  videoSlidesStatus: prevState.videoSlidesStatus !== newState.videoSlidesStatus,
583
677
  videoStatus: prevState.videoStatus !== newState.videoStatus
584
- }; // Clean the object
678
+ };
585
679
 
680
+ // Clean the object
586
681
  (0, _keys.default)(deltas).forEach(function (key) {
587
682
  if (deltas[key] !== true) {
588
683
  delete deltas[key];
@@ -590,35 +685,31 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
590
685
  });
591
686
  return deltas;
592
687
  };
593
-
594
688
  this.deltaParticipants = participants.reduce(function (collection, participant) {
595
689
  var existingParticipant = findParticipant(participant, _this4.participants || []) || {};
596
690
  var delta = generateDelta(existingParticipant.status, participant.status);
597
691
  var changed = (0, _keys.default)(delta).length > 0;
598
-
599
692
  if (changed) {
600
693
  collection.push({
601
694
  person: participant.person,
602
695
  delta: delta
603
696
  });
604
697
  }
605
-
606
698
  return collection;
607
699
  }, []);
608
700
  }
701
+
609
702
  /**
610
- *
703
+ * update meeting's members
611
704
  * @param {Object} participants new participants object
612
- * @param {boolen} deltaParticpantFlag delta event
705
+ * @param {Boolean} isReplace is replace the whole members
613
706
  * @returns {Array} updatedParticipants
614
707
  * @memberof LocusInfo
615
708
  */
616
-
617
709
  }, {
618
710
  key: "updateParticipants",
619
- value: function updateParticipants(participants) {
711
+ value: function updateParticipants(participants, isReplace) {
620
712
  var _this$parsedLocus$con;
621
-
622
713
  this.emitScoped({
623
714
  file: 'locus-info',
624
715
  function: 'updateParticipants'
@@ -627,33 +718,99 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
627
718
  recordingId: this.parsedLocus.controls && ((_this$parsedLocus$con = this.parsedLocus.controls.record) === null || _this$parsedLocus$con === void 0 ? void 0 : _this$parsedLocus$con.modifiedBy),
628
719
  selfIdentity: this.parsedLocus.self && this.parsedLocus.self.selfIdentity,
629
720
  selfId: this.parsedLocus.self && this.parsedLocus.self.selfId,
630
- hostId: this.parsedLocus.host && this.parsedLocus.host.hostId
721
+ hostId: this.parsedLocus.host && this.parsedLocus.host.hostId,
722
+ isReplace: isReplace
631
723
  });
632
724
  }
725
+
633
726
  /**
634
727
  * @param {Object} controls
728
+ * @param {Object} self
635
729
  * @returns {undefined}
636
730
  * @memberof LocusInfo
637
731
  */
638
-
639
732
  }, {
640
733
  key: "updateControls",
641
- value: function updateControls(controls) {
734
+ value: function updateControls(controls, self) {
642
735
  if (controls && !(0, _isEqual2.default)(this.controls, controls)) {
643
736
  this.parsedLocus.controls = _controlsUtils.default.parse(controls);
644
-
645
737
  var _ControlsUtils$getCon = _controlsUtils.default.getControls(this.controls, controls),
646
- _ControlsUtils$getCon2 = _ControlsUtils$getCon.updates,
647
- hasRecordingChanged = _ControlsUtils$getCon2.hasRecordingChanged,
648
- hasRecordingPausedChanged = _ControlsUtils$getCon2.hasRecordingPausedChanged,
649
- hasMeetingContainerChanged = _ControlsUtils$getCon2.hasMeetingContainerChanged,
650
- hasTranscribeChanged = _ControlsUtils$getCon2.hasTranscribeChanged,
651
- hasEntryExitToneChanged = _ControlsUtils$getCon2.hasEntryExitToneChanged,
652
- current = _ControlsUtils$getCon.current;
653
-
738
+ _ControlsUtils$getCon2 = _ControlsUtils$getCon.updates,
739
+ hasRecordingChanged = _ControlsUtils$getCon2.hasRecordingChanged,
740
+ hasRecordingPausedChanged = _ControlsUtils$getCon2.hasRecordingPausedChanged,
741
+ hasMeetingContainerChanged = _ControlsUtils$getCon2.hasMeetingContainerChanged,
742
+ hasTranscribeChanged = _ControlsUtils$getCon2.hasTranscribeChanged,
743
+ hasEntryExitToneChanged = _ControlsUtils$getCon2.hasEntryExitToneChanged,
744
+ hasBreakoutChanged = _ControlsUtils$getCon2.hasBreakoutChanged,
745
+ hasVideoEnabledChanged = _ControlsUtils$getCon2.hasVideoEnabledChanged,
746
+ hasMuteOnEntryChanged = _ControlsUtils$getCon2.hasMuteOnEntryChanged,
747
+ hasShareControlChanged = _ControlsUtils$getCon2.hasShareControlChanged,
748
+ hasDisallowUnmuteChanged = _ControlsUtils$getCon2.hasDisallowUnmuteChanged,
749
+ hasReactionsChanged = _ControlsUtils$getCon2.hasReactionsChanged,
750
+ hasReactionDisplayNamesChanged = _ControlsUtils$getCon2.hasReactionDisplayNamesChanged,
751
+ hasViewTheParticipantListChanged = _ControlsUtils$getCon2.hasViewTheParticipantListChanged,
752
+ hasRaiseHandChanged = _ControlsUtils$getCon2.hasRaiseHandChanged,
753
+ hasVideoChanged = _ControlsUtils$getCon2.hasVideoChanged,
754
+ hasInterpretationChanged = _ControlsUtils$getCon2.hasInterpretationChanged,
755
+ current = _ControlsUtils$getCon.current;
756
+ if (hasMuteOnEntryChanged) {
757
+ this.emitScoped({
758
+ file: 'locus-info',
759
+ function: 'updateControls'
760
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_MUTE_ON_ENTRY_CHANGED, {
761
+ state: current.muteOnEntry
762
+ });
763
+ }
764
+ if (hasShareControlChanged) {
765
+ this.emitScoped({
766
+ file: 'locus-info',
767
+ function: 'updateControls'
768
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_SHARE_CONTROL_CHANGED, {
769
+ state: current.shareControl
770
+ });
771
+ }
772
+ if (hasDisallowUnmuteChanged) {
773
+ this.emitScoped({
774
+ file: 'locus-info',
775
+ function: 'updateControls'
776
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_DISALLOW_UNMUTE_CHANGED, {
777
+ state: current.disallowUnmute
778
+ });
779
+ }
780
+ if (hasReactionsChanged || hasReactionDisplayNamesChanged) {
781
+ this.emitScoped({
782
+ file: 'locus-info',
783
+ function: 'updateControls'
784
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_REACTIONS_CHANGED, {
785
+ state: current.reactions
786
+ });
787
+ }
788
+ if (hasViewTheParticipantListChanged) {
789
+ this.emitScoped({
790
+ file: 'locus-info',
791
+ function: 'updateControls'
792
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED, {
793
+ state: current.viewTheParticipantList
794
+ });
795
+ }
796
+ if (hasRaiseHandChanged) {
797
+ this.emitScoped({
798
+ file: 'locus-info',
799
+ function: 'updateControls'
800
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_RAISE_HAND_CHANGED, {
801
+ state: current.raiseHand
802
+ });
803
+ }
804
+ if (hasVideoChanged) {
805
+ this.emitScoped({
806
+ file: 'locus-info',
807
+ function: 'updateControls'
808
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_VIDEO_CHANGED, {
809
+ state: current.video
810
+ });
811
+ }
654
812
  if (hasRecordingChanged || hasRecordingPausedChanged) {
655
813
  var state = null;
656
-
657
814
  if (hasRecordingPausedChanged) {
658
815
  if (current.record.paused) {
659
816
  state = _constants.RECORDING_STATE.PAUSED;
@@ -664,7 +821,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
664
821
  } else if (hasRecordingChanged) {
665
822
  state = current.record.recording ? _constants.RECORDING_STATE.RECORDING : _constants.RECORDING_STATE.IDLE;
666
823
  }
667
-
668
824
  this.emitScoped({
669
825
  file: 'locus-info',
670
826
  function: 'updateControls'
@@ -674,7 +830,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
674
830
  lastModified: current.record.lastModified
675
831
  });
676
832
  }
677
-
678
833
  if (hasMeetingContainerChanged) {
679
834
  var meetingContainerUrl = current.meetingContainer.meetingContainerUrl;
680
835
  this.emitScoped({
@@ -684,11 +839,10 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
684
839
  meetingContainerUrl: meetingContainerUrl
685
840
  });
686
841
  }
687
-
688
842
  if (hasTranscribeChanged) {
689
843
  var _current$transcribe = current.transcribe,
690
- transcribing = _current$transcribe.transcribing,
691
- caption = _current$transcribe.caption;
844
+ transcribing = _current$transcribe.transcribing,
845
+ caption = _current$transcribe.caption;
692
846
  this.emitScoped({
693
847
  file: 'locus-info',
694
848
  function: 'updateControls'
@@ -697,30 +851,63 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
697
851
  caption: caption
698
852
  });
699
853
  }
700
-
854
+ if (hasBreakoutChanged) {
855
+ var breakout = current.breakout;
856
+ breakout.breakoutMoveId = _selfUtils.default.getReplacedBreakoutMoveId(self, this.webex.internal.device.url);
857
+ this.emitScoped({
858
+ file: 'locus-info',
859
+ function: 'updateControls'
860
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_BREAKOUT_UPDATED, {
861
+ breakout: breakout
862
+ });
863
+ }
864
+ if (hasInterpretationChanged) {
865
+ var interpretation = current.interpretation;
866
+ this.emitScoped({
867
+ file: 'locus-info',
868
+ function: 'updateControls'
869
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_INTERPRETATION_UPDATED, {
870
+ interpretation: interpretation
871
+ });
872
+ }
701
873
  if (hasEntryExitToneChanged) {
702
874
  var entryExitTone = current.entryExitTone;
875
+ this.updateMeeting({
876
+ entryExitTone: entryExitTone
877
+ });
703
878
  this.emitScoped({
704
879
  file: 'locus-info',
705
880
  function: 'updateControls'
706
881
  }, _constants.LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED, {
707
882
  entryExitTone: entryExitTone
708
883
  });
884
+ }
885
+
886
+ // videoEnabled is handled differently than other controls,
887
+ // to fit with audio mute status logic
888
+ if (hasVideoEnabledChanged) {
889
+ var videoEnabled = current.videoEnabled;
709
890
  this.updateMeeting({
710
- entryExitTone: entryExitTone
891
+ unmuteVideoAllowed: videoEnabled
892
+ });
893
+ this.emitScoped({
894
+ file: 'locus-info',
895
+ function: 'updateControls'
896
+ }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED, {
897
+ // muted: not part of locus.controls
898
+ unmuteAllowed: videoEnabled
711
899
  });
712
900
  }
713
-
714
901
  this.controls = controls;
715
902
  }
716
903
  }
904
+
717
905
  /**
718
906
  * @param {String} conversationUrl
719
907
  * @param {Object} info
720
908
  * @returns {undefined}
721
909
  * @memberof LocusInfo
722
910
  */
723
-
724
911
  }, {
725
912
  key: "updateConversationUrl",
726
913
  value: function updateConversationUrl(conversationUrl, info) {
@@ -736,12 +923,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
736
923
  });
737
924
  }
738
925
  }
926
+
739
927
  /**
740
928
  * @param {Object} created
741
929
  * @returns {undefined}
742
930
  * @memberof LocusInfo
743
931
  */
744
-
745
932
  }, {
746
933
  key: "updateCreated",
747
934
  value: function updateCreated(created) {
@@ -749,20 +936,37 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
749
936
  this.created = created;
750
937
  }
751
938
  }
939
+
752
940
  /**
753
- * @param {Object} fullState
941
+ * @param {Object} services
754
942
  * @returns {undefined}
755
943
  * @memberof LocusInfo
756
944
  */
945
+ }, {
946
+ key: "updateServices",
947
+ value: function updateServices(services) {
948
+ if (services && !(0, _isEqual2.default)(this.services, services)) {
949
+ this.services = services;
950
+ this.emitScoped({
951
+ file: 'locus-info',
952
+ function: 'updateServices'
953
+ }, _constants.LOCUSINFO.EVENTS.LINKS_SERVICES, {
954
+ services: services
955
+ });
956
+ }
957
+ }
757
958
 
959
+ /**
960
+ * @param {Object} fullState
961
+ * @returns {undefined}
962
+ * @memberof LocusInfo
963
+ */
758
964
  }, {
759
965
  key: "updateFullState",
760
966
  value: function updateFullState(fullState) {
761
967
  if (fullState && !(0, _isEqual2.default)(this.fullState, fullState)) {
762
968
  var result = _fullState.default.getFullState(this.fullState, fullState);
763
-
764
969
  this.updateMeeting(result.current);
765
-
766
970
  if (result.updates.meetingStateChangedTo) {
767
971
  this.emitScoped({
768
972
  file: 'locus-info',
@@ -772,7 +976,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
772
976
  currentState: result.current.meetingState
773
977
  });
774
978
  }
775
-
776
979
  if (result.updates.meetingTypeChangedTo) {
777
980
  this.emitScoped({
778
981
  file: 'locus-info',
@@ -781,11 +984,11 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
781
984
  type: result.current.type
782
985
  });
783
986
  }
784
-
785
987
  this.parsedLocus.fullState = result.current;
786
988
  this.fullState = fullState;
787
989
  }
788
990
  }
991
+
789
992
  /**
790
993
  * handles when the locus.host is updated
791
994
  * @param {Object} host the locus.host property
@@ -793,16 +996,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
793
996
  * @memberof LocusInfo
794
997
  * emits internal event locus_info_update_host
795
998
  */
796
-
797
999
  }, {
798
1000
  key: "updateHostInfo",
799
1001
  value: function updateHostInfo(host) {
800
1002
  if (host && !(0, _isEqual2.default)(this.host, host)) {
801
1003
  var parsedHosts = _hostUtils.default.getHosts(this.host, host);
802
-
803
1004
  this.updateMeeting(parsedHosts.current);
804
1005
  this.parsedLocus.host = parsedHosts.current;
805
-
806
1006
  if (parsedHosts.updates.isNewHost) {
807
1007
  this.compareAndUpdateFlags.compareSelfAndHost = true;
808
1008
  this.emitScoped({
@@ -813,65 +1013,55 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
813
1013
  oldHost: parsedHosts.previous
814
1014
  });
815
1015
  }
816
-
817
1016
  this.host = host;
818
1017
  } else {
819
1018
  this.compareAndUpdateFlags.compareSelfAndHost = false;
820
1019
  }
821
1020
  }
1021
+
822
1022
  /**
823
1023
  * @param {Object} info
824
1024
  * @param {Object} self
825
1025
  * @returns {undefined}
826
1026
  * @memberof LocusInfo
827
1027
  */
828
-
829
1028
  }, {
830
1029
  key: "updateMeetingInfo",
831
1030
  value: function updateMeetingInfo(info, self) {
832
- if (info && !(0, _isEqual2.default)(this.info, info)) {
833
- var _this$parsedLocus$sel;
834
-
835
- var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : _this$parsedLocus$sel.roles) || [];
836
-
1031
+ var _this$parsedLocus$sel;
1032
+ var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : _this$parsedLocus$sel.roles) || [];
1033
+ if (info && !(0, _isEqual2.default)(this.info, info) || roles.length && !(0, _isEqual2.default)(this.roles, roles) && info) {
837
1034
  var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
838
-
839
1035
  var parsedInfo = _infoUtils.default.getInfos(this.parsedLocus.info, info, roles, isJoined);
840
-
841
- this.emitScoped({
842
- file: 'locus-info',
843
- function: 'updateMeetingInfo'
844
- }, _constants.LOCUSINFO.EVENTS.MEETING_INFO_UPDATED, {
845
- info: parsedInfo.current,
846
- self: self
847
- });
848
-
849
1036
  if (parsedInfo.updates.isLocked) {
850
1037
  this.emitScoped({
851
1038
  file: 'locus-info',
852
1039
  function: 'updateMeetingInfo'
853
1040
  }, _constants.LOCUSINFO.EVENTS.MEETING_LOCKED, info);
854
1041
  }
855
-
856
1042
  if (parsedInfo.updates.isUnlocked) {
857
1043
  this.emitScoped({
858
1044
  file: 'locus-info',
859
1045
  function: 'updateMeetingInfo'
860
1046
  }, _constants.LOCUSINFO.EVENTS.MEETING_UNLOCKED, info);
861
1047
  }
862
-
863
1048
  this.info = info;
864
- this.parsedLocus.info = parsedInfo.current; // Parses the info and adds necessary values
865
-
1049
+ this.parsedLocus.info = parsedInfo.current;
1050
+ // Parses the info and adds necessary values
866
1051
  this.updateMeeting(parsedInfo.current);
1052
+ this.emitScoped({
1053
+ file: 'locus-info',
1054
+ function: 'updateMeetingInfo'
1055
+ }, _constants.LOCUSINFO.EVENTS.MEETING_INFO_UPDATED);
867
1056
  }
1057
+ this.roles = roles;
868
1058
  }
1059
+
869
1060
  /**
870
1061
  * @param {Object} embeddedApps
871
1062
  * @returns {undefined}
872
1063
  * @memberof LocusInfo
873
1064
  */
874
-
875
1065
  }, {
876
1066
  key: "updateEmbeddedApps",
877
1067
  value: function updateEmbeddedApps(embeddedApps) {
@@ -879,9 +1069,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
879
1069
  if (_embeddedAppsUtils.default.areSimilar(this.embeddedApps, embeddedApps)) {
880
1070
  return;
881
1071
  }
882
-
883
1072
  var parsedEmbeddedApps = _embeddedAppsUtils.default.parse(embeddedApps);
884
-
885
1073
  this.updateMeeting({
886
1074
  embeddedApps: parsedEmbeddedApps
887
1075
  });
@@ -891,6 +1079,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
891
1079
  }, _constants.LOCUSINFO.EVENTS.EMBEDDED_APPS_UPDATED, parsedEmbeddedApps);
892
1080
  this.embeddedApps = embeddedApps;
893
1081
  }
1082
+
894
1083
  /**
895
1084
  * handles when the locus.mediaShares is updated
896
1085
  * @param {Object} mediaShares the locus.mediaShares property
@@ -898,14 +1087,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
898
1087
  * @memberof LocusInfo
899
1088
  * emits internal event locus_info_update_media_shares
900
1089
  */
901
-
902
1090
  }, {
903
1091
  key: "updateMediaShares",
904
1092
  value: function updateMediaShares(mediaShares) {
905
1093
  if (mediaShares && !(0, _isEqual2.default)(this.mediaShares, mediaShares)) {
906
1094
  var parsedMediaShares = _mediaSharesUtils.default.getMediaShares(this.mediaShares, mediaShares);
907
-
908
1095
  this.updateMeeting(parsedMediaShares.current);
1096
+ this.parsedLocus.mediaShares = parsedMediaShares.current;
1097
+ this.mediaShares = mediaShares;
909
1098
  this.emitScoped({
910
1099
  file: 'locus-info',
911
1100
  function: 'updateMediaShares'
@@ -913,16 +1102,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
913
1102
  current: parsedMediaShares.current,
914
1103
  previous: parsedMediaShares.previous
915
1104
  });
916
- this.parsedLocus.mediaShares = parsedMediaShares.current;
917
- this.mediaShares = mediaShares;
918
1105
  }
919
1106
  }
1107
+
920
1108
  /**
921
1109
  * @param {String} participantsUrl
922
1110
  * @returns {undefined}
923
1111
  * @memberof LocusInfo
924
1112
  */
925
-
926
1113
  }, {
927
1114
  key: "updateParticipantsUrl",
928
1115
  value: function updateParticipantsUrl(participantsUrl) {
@@ -930,12 +1117,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
930
1117
  this.participantsUrl = participantsUrl;
931
1118
  }
932
1119
  }
1120
+
933
1121
  /**
934
1122
  * @param {Object} replace
935
1123
  * @returns {undefined}
936
1124
  * @memberof LocusInfo
937
1125
  */
938
-
939
1126
  }, {
940
1127
  key: "updateReplace",
941
1128
  value: function updateReplace(replace) {
@@ -943,6 +1130,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
943
1130
  this.replace = replace;
944
1131
  }
945
1132
  }
1133
+
946
1134
  /**
947
1135
  * handles when the locus.self is updated
948
1136
  * @param {Object} self the locus.mediaShares property
@@ -951,35 +1139,31 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
951
1139
  * @memberof LocusInfo
952
1140
  * emits internal events self_admitted_guest, self_unadmitted_guest, locus_info_update_self
953
1141
  */
954
-
955
1142
  }, {
956
1143
  key: "updateSelf",
957
1144
  value: function updateSelf(self, participants) {
1145
+ // @ts-ignore - check where this.self come from
958
1146
  if (self && !(0, _isEqual2.default)(this.self, self)) {
1147
+ // @ts-ignore
959
1148
  var parsedSelves = _selfUtils.default.getSelves(this.self, self, this.webex.internal.device.url);
960
-
961
1149
  this.updateMeeting(parsedSelves.current);
962
1150
  this.parsedLocus.self = parsedSelves.current;
963
1151
  var element = this.parsedLocus.states[this.parsedLocus.states.length - 1];
964
-
965
1152
  if (element !== parsedSelves.current.state) {
966
1153
  this.parsedLocus.states.push(parsedSelves.current.state);
967
- } // TODO: check if we need to save the sipUri here as well
968
- // this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri));
969
-
1154
+ }
970
1155
 
1156
+ // TODO: check if we need to save the sipUri here as well
1157
+ // this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri));
971
1158
  var result = _selfUtils.default.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri);
972
-
973
1159
  if (result.sipUri) {
974
1160
  this.updateMeeting(result);
975
1161
  }
976
-
977
1162
  if (parsedSelves.updates.moderatorChanged) {
978
1163
  this.compareAndUpdateFlags.compareHostAndSelf = true;
979
1164
  } else {
980
1165
  this.compareAndUpdateFlags.compareHostAndSelf = false;
981
1166
  }
982
-
983
1167
  if (parsedSelves.updates.layoutChanged) {
984
1168
  this.emitScoped({
985
1169
  file: 'locus-info',
@@ -988,7 +1172,23 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
988
1172
  layout: parsedSelves.current.layout
989
1173
  });
990
1174
  }
991
-
1175
+ if (parsedSelves.updates.breakoutsChanged) {
1176
+ this.emitScoped({
1177
+ file: 'locus-info',
1178
+ function: 'updateSelf'
1179
+ }, _constants.LOCUSINFO.EVENTS.SELF_MEETING_BREAKOUTS_CHANGED, {
1180
+ breakoutSessions: parsedSelves.current.breakoutSessions
1181
+ });
1182
+ }
1183
+ if (parsedSelves.updates.interpretationChanged) {
1184
+ this.emitScoped({
1185
+ file: 'locus-info',
1186
+ function: 'updateSelf'
1187
+ }, _constants.LOCUSINFO.EVENTS.SELF_MEETING_INTERPRETATION_CHANGED, {
1188
+ interpretation: parsedSelves.current.interpretation,
1189
+ selfParticipantId: parsedSelves.current.selfId
1190
+ });
1191
+ }
992
1192
  if (parsedSelves.updates.isMediaInactiveOrReleased) {
993
1193
  this.emitScoped({
994
1194
  file: 'locus-info',
@@ -997,13 +1197,31 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
997
1197
  reason: self.reason
998
1198
  });
999
1199
  }
1000
-
1001
1200
  if (parsedSelves.updates.moderatorChanged) {
1002
1201
  this.emitScoped({
1003
1202
  file: 'locus-info',
1004
1203
  function: 'updateSelf'
1005
1204
  }, _constants.LOCUSINFO.EVENTS.SELF_MODERATOR_CHANGED, self);
1006
1205
  }
1206
+ if (parsedSelves.updates.isRolesChanged) {
1207
+ var _parsedSelves$previou, _parsedSelves$current;
1208
+ this.emitScoped({
1209
+ file: 'locus-info',
1210
+ function: 'updateSelf'
1211
+ }, _constants.LOCUSINFO.EVENTS.SELF_ROLES_CHANGED, {
1212
+ oldRoles: (_parsedSelves$previou = parsedSelves.previous) === null || _parsedSelves$previou === void 0 ? void 0 : _parsedSelves$previou.roles,
1213
+ newRoles: (_parsedSelves$current = parsedSelves.current) === null || _parsedSelves$current === void 0 ? void 0 : _parsedSelves$current.roles
1214
+ });
1215
+ }
1216
+ if (parsedSelves.updates.isVideoMutedByOthersChanged) {
1217
+ this.emitScoped({
1218
+ file: 'locus-info',
1219
+ function: 'updateSelf'
1220
+ }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED, {
1221
+ muted: parsedSelves.current.remoteVideoMuted
1222
+ // unmuteAllowed: not part of .self
1223
+ });
1224
+ }
1007
1225
 
1008
1226
  if (parsedSelves.updates.localAudioUnmuteRequiredByServer) {
1009
1227
  this.emitScoped({
@@ -1014,7 +1232,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1014
1232
  unmuteAllowed: parsedSelves.current.unmuteAllowed
1015
1233
  });
1016
1234
  }
1017
-
1018
1235
  if (parsedSelves.updates.isMutedByOthersChanged) {
1019
1236
  this.emitScoped({
1020
1237
  file: 'locus-info',
@@ -1024,55 +1241,49 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1024
1241
  unmuteAllowed: parsedSelves.current.unmuteAllowed
1025
1242
  });
1026
1243
  }
1027
-
1028
1244
  if (parsedSelves.updates.localAudioUnmuteRequestedByServer) {
1029
1245
  this.emitScoped({
1030
1246
  file: 'locus-info',
1031
1247
  function: 'updateSelf'
1032
1248
  }, _constants.LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUESTED, {});
1033
1249
  }
1034
-
1035
1250
  if (parsedSelves.updates.isUserUnadmitted) {
1036
1251
  this.emitScoped({
1037
1252
  file: 'locus-info',
1038
1253
  function: 'updateSelf'
1039
1254
  }, _constants.LOCUSINFO.EVENTS.SELF_UNADMITTED_GUEST, self);
1040
1255
  }
1041
-
1042
1256
  if (parsedSelves.updates.isUserAdmitted) {
1043
1257
  this.emitScoped({
1044
1258
  file: 'locus-info',
1045
1259
  function: 'updateSelf'
1046
1260
  }, _constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, self);
1047
1261
  }
1048
-
1049
1262
  if (parsedSelves.updates.isMediaInactive) {
1050
1263
  this.emitScoped({
1051
1264
  file: 'locus-info',
1052
1265
  function: 'updateSelf'
1053
- }, _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
1266
+ },
1267
+ // @ts-ignore
1268
+ _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
1054
1269
  }
1055
-
1056
1270
  if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
1057
- var _parsedSelves$current, _parsedSelves$current2, _parsedSelves$current3;
1058
-
1271
+ var _parsedSelves$current2, _parsedSelves$current3, _parsedSelves$current4;
1059
1272
  this.emitScoped({
1060
1273
  file: 'locus-info',
1061
1274
  function: 'updateSelf'
1062
1275
  }, _constants.LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, {
1063
- audioStatus: (_parsedSelves$current = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current === void 0 ? void 0 : _parsedSelves$current.audio,
1064
- videoStatus: (_parsedSelves$current2 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current2 === void 0 ? void 0 : _parsedSelves$current2.video,
1065
- shareStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.share
1276
+ audioStatus: (_parsedSelves$current2 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current2 === void 0 ? void 0 : _parsedSelves$current2.audio,
1277
+ videoStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.video,
1278
+ shareStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.share
1066
1279
  });
1067
1280
  }
1068
-
1069
1281
  if (parsedSelves.updates.isUserObserving) {
1070
1282
  this.emitScoped({
1071
1283
  file: 'locus-info',
1072
1284
  function: 'updateSelf'
1073
1285
  }, _constants.LOCUSINFO.EVENTS.SELF_OBSERVING);
1074
1286
  }
1075
-
1076
1287
  if (parsedSelves.updates.canNotViewTheParticipantListChanged) {
1077
1288
  this.emitScoped({
1078
1289
  file: 'locus-info',
@@ -1081,7 +1292,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1081
1292
  canNotViewTheParticipantList: parsedSelves.current.canNotViewTheParticipantList
1082
1293
  });
1083
1294
  }
1084
-
1085
1295
  if (parsedSelves.updates.isSharingBlockedChanged) {
1086
1296
  this.emitScoped({
1087
1297
  file: 'locus-info',
@@ -1090,7 +1300,6 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1090
1300
  isSharingBlocked: parsedSelves.current.isSharingBlocked
1091
1301
  });
1092
1302
  }
1093
-
1094
1303
  this.emitScoped({
1095
1304
  file: 'locus-info',
1096
1305
  function: 'updateSelf'
@@ -1099,18 +1308,19 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1099
1308
  newSelf: parsedSelves.current
1100
1309
  });
1101
1310
  this.parsedLocus.self = parsedSelves.current;
1311
+ // @ts-ignore
1102
1312
  this.self = self;
1103
1313
  } else {
1104
1314
  this.compareAndUpdateFlags.compareHostAndSelf = false;
1105
1315
  }
1106
1316
  }
1317
+
1107
1318
  /**
1108
1319
  * handles when the locus.url is updated
1109
1320
  * @param {String} url
1110
1321
  * @returns {undefined}
1111
1322
  * emits internal event locus_info_update_url
1112
1323
  */
1113
-
1114
1324
  }, {
1115
1325
  key: "updateLocusUrl",
1116
1326
  value: function updateLocusUrl(url) {
@@ -1125,12 +1335,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1125
1335
  }, _constants.EVENTS.LOCUS_INFO_UPDATE_URL, url);
1126
1336
  }
1127
1337
  }
1338
+
1128
1339
  /**
1129
1340
  * @param {String} aclUrl
1130
1341
  * @returns {undefined}
1131
1342
  * @memberof LocusInfo
1132
1343
  */
1133
-
1134
1344
  }, {
1135
1345
  key: "updateAclUrl",
1136
1346
  value: function updateAclUrl(aclUrl) {
@@ -1138,12 +1348,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1138
1348
  this.aclUrl = aclUrl;
1139
1349
  }
1140
1350
  }
1351
+
1141
1352
  /**
1142
1353
  * @param {Number} baseSequence
1143
1354
  * @returns {undefined}
1144
1355
  * @memberof LocusInfo
1145
1356
  */
1146
-
1147
1357
  }, {
1148
1358
  key: "updateBasequence",
1149
1359
  value: function updateBasequence(baseSequence) {
@@ -1151,12 +1361,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1151
1361
  this.baseSequence = baseSequence;
1152
1362
  }
1153
1363
  }
1364
+
1154
1365
  /**
1155
1366
  * @param {Number} sequence
1156
1367
  * @returns {undefined}
1157
1368
  * @memberof LocusInfo
1158
1369
  */
1159
-
1160
1370
  }, {
1161
1371
  key: "updateSequence",
1162
1372
  value: function updateSequence(sequence) {
@@ -1164,12 +1374,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1164
1374
  this.sequence = sequence;
1165
1375
  }
1166
1376
  }
1377
+
1167
1378
  /**
1168
1379
  * @param {Object} membership
1169
1380
  * @returns {undefined}
1170
1381
  * @memberof LocusInfo
1171
1382
  */
1172
-
1173
1383
  }, {
1174
1384
  key: "updateMemberShip",
1175
1385
  value: function updateMemberShip(membership) {
@@ -1177,12 +1387,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1177
1387
  this.membership = membership;
1178
1388
  }
1179
1389
  }
1390
+
1180
1391
  /**
1181
1392
  * @param {Array} identities
1182
1393
  * @returns {undefined}
1183
1394
  * @memberof LocusInfo
1184
1395
  */
1185
-
1186
1396
  }, {
1187
1397
  key: "updateIdentifiers",
1188
1398
  value: function updateIdentifiers(identities) {
@@ -1190,9 +1400,114 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1190
1400
  this.identities = identities;
1191
1401
  }
1192
1402
  }
1403
+
1404
+ /**
1405
+ * check the locus is main session's one or not, if is main session's, update main session cache
1406
+ * @param {Object} locus
1407
+ * @returns {undefined}
1408
+ * @memberof LocusInfo
1409
+ */
1410
+ }, {
1411
+ key: "updateLocusCache",
1412
+ value: function updateLocusCache(locus) {
1413
+ var isMainSessionDTO = _controlsUtils.default.isMainSessionDTO(locus);
1414
+ if (isMainSessionDTO) {
1415
+ this.updateMainSessionLocusCache(locus);
1416
+ }
1417
+ }
1418
+
1419
+ /**
1420
+ * if return from breakout to main session, need to use cached main session DTO since locus won't send the full locus (participants)
1421
+ * if join breakout from main session, need to query main locus url (if response with 403 means no privilege, need to clear the cache)
1422
+ * @param {Object} newLocus
1423
+ * @returns {Object}
1424
+ * @memberof LocusInfo
1425
+ */
1426
+ }, {
1427
+ key: "getTheLocusToUpdate",
1428
+ value: function getTheLocusToUpdate(newLocus) {
1429
+ var switchStatus = _controlsUtils.default.getSessionSwitchStatus(this.controls, newLocus === null || newLocus === void 0 ? void 0 : newLocus.controls);
1430
+ if (switchStatus.isReturnToMain && this.mainSessionLocusCache) {
1431
+ return (0, _cloneDeep2.default)(this.mainSessionLocusCache);
1432
+ }
1433
+ if (switchStatus.isJoinToBreakout) {
1434
+ this.emitScoped({
1435
+ file: 'locus-info',
1436
+ function: 'updateControls'
1437
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_JOIN_BREAKOUT_FROM_MAIN, {
1438
+ mainLocusUrl: this.url
1439
+ });
1440
+ }
1441
+ return newLocus;
1442
+ }
1443
+
1444
+ /**
1445
+ * merge participants by participant id
1446
+ * @param {Array} participants
1447
+ * @param {Array} sourceParticipants
1448
+ * @returns {Array} merged participants
1449
+ * @memberof LocusInfo
1450
+ */
1451
+ // eslint-disable-next-line class-methods-use-this
1452
+ }, {
1453
+ key: "mergeParticipants",
1454
+ value: function mergeParticipants(participants, sourceParticipants) {
1455
+ if (!sourceParticipants || !sourceParticipants.length) return participants;
1456
+ if (!participants || !participants.length) {
1457
+ return sourceParticipants;
1458
+ }
1459
+ sourceParticipants.forEach(function (participant) {
1460
+ var existIndex = participants.findIndex(function (p) {
1461
+ return p.id === participant.id;
1462
+ });
1463
+ if (existIndex > -1) {
1464
+ participants.splice(existIndex, 1, participant);
1465
+ } else {
1466
+ participants.push(participant);
1467
+ }
1468
+ });
1469
+ return participants;
1470
+ }
1471
+
1472
+ /**
1473
+ * need cache main sessions' participants since locus will not send the full list when cohost/host leave breakout
1474
+ * @param {Object} mainLocus
1475
+ * @returns {undefined}
1476
+ * @memberof LocusInfo
1477
+ */
1478
+ }, {
1479
+ key: "updateMainSessionLocusCache",
1480
+ value: function updateMainSessionLocusCache(mainLocus) {
1481
+ var _this5 = this;
1482
+ if (!mainLocus) {
1483
+ return;
1484
+ }
1485
+ var locusClone = (0, _cloneDeep2.default)(mainLocus);
1486
+ if (this.mainSessionLocusCache) {
1487
+ // shallow merge and do special merge for participants
1488
+ (0, _assignWith2.default)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
1489
+ if (key === 'participants') {
1490
+ return _this5.mergeParticipants(objValue, srcValue);
1491
+ }
1492
+ return srcValue || objValue;
1493
+ });
1494
+ } else {
1495
+ this.mainSessionLocusCache = locusClone;
1496
+ }
1497
+ }
1498
+
1499
+ /**
1500
+ * clear main session cache
1501
+ * @returns {undefined}
1502
+ * @memberof LocusInfo
1503
+ */
1504
+ }, {
1505
+ key: "clearMainSessionLocusCache",
1506
+ value: function clearMainSessionLocusCache() {
1507
+ this.mainSessionLocusCache = null;
1508
+ }
1193
1509
  }]);
1194
1510
  return LocusInfo;
1195
1511
  }(_eventsScope.default);
1196
-
1197
1512
  exports.default = LocusInfo;
1198
1513
  //# sourceMappingURL=index.js.map