@webex/plugin-meetings 3.0.0-beta.26 → 3.0.0-beta.261

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 (361) hide show
  1. package/README.md +46 -8
  2. package/dist/annotation/annotation.types.js +7 -0
  3. package/dist/annotation/annotation.types.js.map +1 -0
  4. package/dist/annotation/constants.js +49 -0
  5. package/dist/annotation/constants.js.map +1 -0
  6. package/dist/annotation/index.js +342 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +114 -14
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/edit-lock-error.js +52 -0
  11. package/dist/breakouts/edit-lock-error.js.map +1 -0
  12. package/dist/breakouts/events.js +45 -0
  13. package/dist/breakouts/events.js.map +1 -0
  14. package/dist/breakouts/index.js +841 -19
  15. package/dist/breakouts/index.js.map +1 -1
  16. package/dist/breakouts/request.js +78 -0
  17. package/dist/breakouts/request.js.map +1 -0
  18. package/dist/breakouts/utils.js +67 -0
  19. package/dist/breakouts/utils.js.map +1 -0
  20. package/dist/common/errors/webex-errors.js +28 -7
  21. package/dist/common/errors/webex-errors.js.map +1 -1
  22. package/dist/common/logs/logger-proxy.js +1 -1
  23. package/dist/common/logs/logger-proxy.js.map +1 -1
  24. package/dist/common/queue.js +24 -9
  25. package/dist/common/queue.js.map +1 -1
  26. package/dist/config.js +5 -10
  27. package/dist/config.js.map +1 -1
  28. package/dist/constants.js +196 -28
  29. package/dist/constants.js.map +1 -1
  30. package/dist/controls-options-manager/enums.js +14 -2
  31. package/dist/controls-options-manager/enums.js.map +1 -1
  32. package/dist/controls-options-manager/index.js +109 -15
  33. package/dist/controls-options-manager/index.js.map +1 -1
  34. package/dist/controls-options-manager/types.js +7 -0
  35. package/dist/controls-options-manager/types.js.map +1 -0
  36. package/dist/controls-options-manager/util.js +309 -18
  37. package/dist/controls-options-manager/util.js.map +1 -1
  38. package/dist/index.js +112 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/interpretation/collection.js +23 -0
  41. package/dist/interpretation/collection.js.map +1 -0
  42. package/dist/interpretation/index.js +366 -0
  43. package/dist/interpretation/index.js.map +1 -0
  44. package/dist/interpretation/siLanguage.js +25 -0
  45. package/dist/interpretation/siLanguage.js.map +1 -0
  46. package/dist/locus-info/controlsUtils.js +91 -2
  47. package/dist/locus-info/controlsUtils.js.map +1 -1
  48. package/dist/locus-info/index.js +381 -62
  49. package/dist/locus-info/index.js.map +1 -1
  50. package/dist/locus-info/infoUtils.js +7 -1
  51. package/dist/locus-info/infoUtils.js.map +1 -1
  52. package/dist/locus-info/mediaSharesUtils.js +43 -1
  53. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  54. package/dist/locus-info/parser.js +224 -63
  55. package/dist/locus-info/parser.js.map +1 -1
  56. package/dist/locus-info/selfUtils.js +89 -14
  57. package/dist/locus-info/selfUtils.js.map +1 -1
  58. package/dist/media/index.js +58 -116
  59. package/dist/media/index.js.map +1 -1
  60. package/dist/media/properties.js +60 -121
  61. package/dist/media/properties.js.map +1 -1
  62. package/dist/meeting/in-meeting-actions.js +82 -2
  63. package/dist/meeting/in-meeting-actions.js.map +1 -1
  64. package/dist/meeting/index.js +3022 -2795
  65. package/dist/meeting/index.js.map +1 -1
  66. package/dist/meeting/locusMediaRequest.js +292 -0
  67. package/dist/meeting/locusMediaRequest.js.map +1 -0
  68. package/dist/meeting/muteState.js +230 -124
  69. package/dist/meeting/muteState.js.map +1 -1
  70. package/dist/meeting/request.js +256 -196
  71. package/dist/meeting/request.js.map +1 -1
  72. package/dist/meeting/util.js +601 -417
  73. package/dist/meeting/util.js.map +1 -1
  74. package/dist/meeting-info/index.js +70 -7
  75. package/dist/meeting-info/index.js.map +1 -1
  76. package/dist/meeting-info/meeting-info-v2.js +189 -51
  77. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  78. package/dist/meeting-info/util.js +1 -1
  79. package/dist/meeting-info/util.js.map +1 -1
  80. package/dist/meeting-info/utilv2.js +36 -36
  81. package/dist/meeting-info/utilv2.js.map +1 -1
  82. package/dist/meetings/collection.js +22 -0
  83. package/dist/meetings/collection.js.map +1 -1
  84. package/dist/meetings/index.js +372 -90
  85. package/dist/meetings/index.js.map +1 -1
  86. package/dist/meetings/meetings.types.js +7 -0
  87. package/dist/meetings/meetings.types.js.map +1 -0
  88. package/dist/meetings/request.js +2 -0
  89. package/dist/meetings/request.js.map +1 -1
  90. package/dist/meetings/util.js +88 -1
  91. package/dist/meetings/util.js.map +1 -1
  92. package/dist/member/index.js +49 -0
  93. package/dist/member/index.js.map +1 -1
  94. package/dist/member/types.js +25 -0
  95. package/dist/member/types.js.map +1 -0
  96. package/dist/member/util.js +121 -25
  97. package/dist/member/util.js.map +1 -1
  98. package/dist/members/collection.js +10 -0
  99. package/dist/members/collection.js.map +1 -1
  100. package/dist/members/index.js +86 -5
  101. package/dist/members/index.js.map +1 -1
  102. package/dist/members/request.js +106 -38
  103. package/dist/members/request.js.map +1 -1
  104. package/dist/members/types.js +15 -0
  105. package/dist/members/types.js.map +1 -0
  106. package/dist/members/util.js +316 -233
  107. package/dist/members/util.js.map +1 -1
  108. package/dist/metrics/constants.js +10 -5
  109. package/dist/metrics/constants.js.map +1 -1
  110. package/dist/metrics/index.js +1 -468
  111. package/dist/metrics/index.js.map +1 -1
  112. package/dist/multistream/mediaRequestManager.js +238 -49
  113. package/dist/multistream/mediaRequestManager.js.map +1 -1
  114. package/dist/multistream/receiveSlot.js +49 -16
  115. package/dist/multistream/receiveSlot.js.map +1 -1
  116. package/dist/multistream/receiveSlotManager.js +52 -34
  117. package/dist/multistream/receiveSlotManager.js.map +1 -1
  118. package/dist/multistream/remoteMedia.js +44 -18
  119. package/dist/multistream/remoteMedia.js.map +1 -1
  120. package/dist/multistream/remoteMediaGroup.js +60 -3
  121. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  122. package/dist/multistream/remoteMediaManager.js +209 -59
  123. package/dist/multistream/remoteMediaManager.js.map +1 -1
  124. package/dist/multistream/sendSlotManager.js +233 -0
  125. package/dist/multistream/sendSlotManager.js.map +1 -0
  126. package/dist/reachability/index.js +161 -57
  127. package/dist/reachability/index.js.map +1 -1
  128. package/dist/reachability/request.js +17 -8
  129. package/dist/reachability/request.js.map +1 -1
  130. package/dist/reconnection-manager/index.js +199 -154
  131. package/dist/reconnection-manager/index.js.map +1 -1
  132. package/dist/recording-controller/index.js +21 -2
  133. package/dist/recording-controller/index.js.map +1 -1
  134. package/dist/recording-controller/util.js +9 -8
  135. package/dist/recording-controller/util.js.map +1 -1
  136. package/dist/roap/index.js +23 -29
  137. package/dist/roap/index.js.map +1 -1
  138. package/dist/roap/request.js +112 -97
  139. package/dist/roap/request.js.map +1 -1
  140. package/dist/roap/turnDiscovery.js +96 -36
  141. package/dist/roap/turnDiscovery.js.map +1 -1
  142. package/dist/rtcMetrics/constants.js +12 -0
  143. package/dist/rtcMetrics/constants.js.map +1 -0
  144. package/dist/rtcMetrics/index.js +117 -0
  145. package/dist/rtcMetrics/index.js.map +1 -0
  146. package/dist/statsAnalyzer/index.js +51 -34
  147. package/dist/statsAnalyzer/index.js.map +1 -1
  148. package/dist/statsAnalyzer/mqaUtil.js +6 -6
  149. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  150. package/dist/types/annotation/annotation.types.d.ts +42 -0
  151. package/dist/types/annotation/constants.d.ts +31 -0
  152. package/dist/types/annotation/index.d.ts +117 -0
  153. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  154. package/dist/types/breakouts/events.d.ts +8 -0
  155. package/dist/types/breakouts/request.d.ts +22 -0
  156. package/dist/types/breakouts/utils.d.ts +15 -0
  157. package/dist/types/common/errors/webex-errors.d.ts +13 -1
  158. package/dist/types/common/queue.d.ts +9 -7
  159. package/dist/types/config.d.ts +1 -6
  160. package/dist/types/constants.d.ts +155 -21
  161. package/dist/types/controls-options-manager/enums.d.ts +11 -1
  162. package/dist/types/controls-options-manager/index.d.ts +17 -1
  163. package/dist/types/controls-options-manager/types.d.ts +43 -0
  164. package/dist/types/controls-options-manager/util.d.ts +1 -7
  165. package/dist/types/index.d.ts +6 -4
  166. package/dist/types/interpretation/collection.d.ts +5 -0
  167. package/dist/types/interpretation/index.d.ts +5 -0
  168. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  169. package/dist/types/locus-info/index.d.ts +57 -4
  170. package/dist/types/locus-info/parser.d.ts +65 -6
  171. package/dist/types/media/index.d.ts +2 -0
  172. package/dist/types/media/properties.d.ts +34 -48
  173. package/dist/types/meeting/in-meeting-actions.d.ts +82 -2
  174. package/dist/types/meeting/index.d.ts +344 -506
  175. package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
  176. package/dist/types/meeting/muteState.d.ts +99 -23
  177. package/dist/types/meeting/request.d.ts +72 -43
  178. package/dist/types/meeting/util.d.ts +101 -1
  179. package/dist/types/meeting-info/index.d.ts +13 -1
  180. package/dist/types/meeting-info/meeting-info-v2.d.ts +31 -1
  181. package/dist/types/meetings/collection.d.ts +8 -0
  182. package/dist/types/meetings/index.d.ts +86 -12
  183. package/dist/types/meetings/meetings.types.d.ts +4 -0
  184. package/dist/types/member/index.d.ts +13 -0
  185. package/dist/types/member/types.d.ts +32 -0
  186. package/dist/types/members/collection.d.ts +5 -0
  187. package/dist/types/members/index.d.ts +35 -2
  188. package/dist/types/members/request.d.ts +73 -9
  189. package/dist/types/members/types.d.ts +24 -0
  190. package/dist/types/members/util.d.ts +209 -1
  191. package/dist/types/metrics/constants.d.ts +9 -4
  192. package/dist/types/metrics/index.d.ts +4 -119
  193. package/dist/types/multistream/mediaRequestManager.d.ts +73 -5
  194. package/dist/types/multistream/receiveSlot.d.ts +16 -12
  195. package/dist/types/multistream/receiveSlotManager.d.ts +19 -4
  196. package/dist/types/multistream/remoteMedia.d.ts +8 -29
  197. package/dist/types/multistream/remoteMediaGroup.d.ts +0 -9
  198. package/dist/types/multistream/remoteMediaManager.d.ts +46 -2
  199. package/dist/types/multistream/sendSlotManager.d.ts +61 -0
  200. package/dist/types/reachability/index.d.ts +44 -7
  201. package/dist/types/reachability/request.d.ts +7 -3
  202. package/dist/types/reconnection-manager/index.d.ts +9 -0
  203. package/dist/types/recording-controller/index.d.ts +15 -1
  204. package/dist/types/recording-controller/util.d.ts +5 -4
  205. package/dist/types/roap/request.d.ts +15 -11
  206. package/dist/types/roap/turnDiscovery.d.ts +18 -1
  207. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  208. package/dist/types/rtcMetrics/index.d.ts +47 -0
  209. package/dist/types/statsAnalyzer/index.d.ts +6 -1
  210. package/package.json +23 -20
  211. package/src/annotation/annotation.types.ts +50 -0
  212. package/src/annotation/constants.ts +36 -0
  213. package/src/annotation/index.ts +328 -0
  214. package/src/breakouts/README.md +44 -14
  215. package/src/breakouts/breakout.ts +87 -9
  216. package/src/breakouts/edit-lock-error.ts +25 -0
  217. package/src/breakouts/events.ts +56 -0
  218. package/src/breakouts/index.ts +710 -10
  219. package/src/breakouts/request.ts +55 -0
  220. package/src/breakouts/utils.ts +57 -0
  221. package/src/common/errors/webex-errors.ts +27 -2
  222. package/src/common/logs/logger-proxy.ts +1 -1
  223. package/src/common/queue.ts +22 -8
  224. package/src/config.ts +4 -9
  225. package/src/constants.ts +178 -18
  226. package/src/controls-options-manager/enums.ts +12 -0
  227. package/src/controls-options-manager/index.ts +116 -21
  228. package/src/controls-options-manager/types.ts +59 -0
  229. package/src/controls-options-manager/util.ts +294 -14
  230. package/src/index.ts +40 -0
  231. package/src/interpretation/README.md +60 -0
  232. package/src/interpretation/collection.ts +19 -0
  233. package/src/interpretation/index.ts +332 -0
  234. package/src/interpretation/siLanguage.ts +18 -0
  235. package/src/locus-info/controlsUtils.ts +108 -0
  236. package/src/locus-info/index.ts +412 -59
  237. package/src/locus-info/infoUtils.ts +10 -2
  238. package/src/locus-info/mediaSharesUtils.ts +48 -0
  239. package/src/locus-info/parser.ts +231 -39
  240. package/src/locus-info/selfUtils.ts +81 -5
  241. package/src/media/index.ts +100 -122
  242. package/src/media/properties.ts +70 -108
  243. package/src/meeting/in-meeting-actions.ts +163 -3
  244. package/src/meeting/index.ts +2471 -2306
  245. package/src/meeting/locusMediaRequest.ts +313 -0
  246. package/src/meeting/muteState.ts +229 -131
  247. package/src/meeting/request.ts +172 -121
  248. package/src/meeting/util.ts +588 -394
  249. package/src/meeting-info/index.ts +79 -8
  250. package/src/meeting-info/meeting-info-v2.ts +168 -14
  251. package/src/meeting-info/util.ts +1 -1
  252. package/src/meeting-info/utilv2.ts +23 -23
  253. package/src/meetings/collection.ts +20 -0
  254. package/src/meetings/index.ts +414 -108
  255. package/src/meetings/meetings.types.ts +12 -0
  256. package/src/meetings/request.ts +2 -0
  257. package/src/meetings/util.ts +103 -4
  258. package/src/member/index.ts +49 -0
  259. package/src/member/types.ts +38 -0
  260. package/src/member/util.ts +127 -25
  261. package/src/members/collection.ts +8 -0
  262. package/src/members/index.ts +107 -6
  263. package/src/members/request.ts +97 -17
  264. package/src/members/types.ts +28 -0
  265. package/src/members/util.ts +319 -240
  266. package/src/metrics/constants.ts +9 -4
  267. package/src/metrics/index.ts +1 -490
  268. package/src/multistream/mediaRequestManager.ts +289 -79
  269. package/src/multistream/receiveSlot.ts +55 -18
  270. package/src/multistream/receiveSlotManager.ts +46 -24
  271. package/src/multistream/remoteMedia.ts +27 -2
  272. package/src/multistream/remoteMediaGroup.ts +59 -0
  273. package/src/multistream/remoteMediaManager.ts +148 -30
  274. package/src/multistream/sendSlotManager.ts +170 -0
  275. package/src/reachability/index.ts +165 -37
  276. package/src/reachability/request.ts +17 -8
  277. package/src/reconnection-manager/index.ts +81 -54
  278. package/src/recording-controller/index.ts +20 -3
  279. package/src/recording-controller/util.ts +26 -9
  280. package/src/roap/index.ts +23 -30
  281. package/src/roap/request.ts +100 -104
  282. package/src/roap/turnDiscovery.ts +51 -25
  283. package/src/rtcMetrics/constants.ts +3 -0
  284. package/src/rtcMetrics/index.ts +100 -0
  285. package/src/statsAnalyzer/index.ts +73 -35
  286. package/src/statsAnalyzer/mqaUtil.ts +8 -10
  287. package/test/integration/spec/converged-space-meetings.js +233 -0
  288. package/test/integration/spec/journey.js +320 -261
  289. package/test/integration/spec/space-meeting.js +76 -3
  290. package/test/unit/spec/annotation/index.ts +418 -0
  291. package/test/unit/spec/breakouts/breakout.ts +142 -24
  292. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  293. package/test/unit/spec/breakouts/events.ts +89 -0
  294. package/test/unit/spec/breakouts/index.ts +1545 -48
  295. package/test/unit/spec/breakouts/request.ts +104 -0
  296. package/test/unit/spec/breakouts/utils.js +72 -0
  297. package/test/unit/spec/common/queue.js +31 -2
  298. package/test/unit/spec/controls-options-manager/index.js +163 -0
  299. package/test/unit/spec/controls-options-manager/util.js +576 -60
  300. package/test/unit/spec/fixture/locus.js +1 -0
  301. package/test/unit/spec/interpretation/collection.ts +15 -0
  302. package/test/unit/spec/interpretation/index.ts +589 -0
  303. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  304. package/test/unit/spec/locus-info/controlsUtils.js +316 -43
  305. package/test/unit/spec/locus-info/index.js +1283 -33
  306. package/test/unit/spec/locus-info/infoUtils.js +37 -15
  307. package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
  308. package/test/unit/spec/locus-info/parser.js +62 -22
  309. package/test/unit/spec/locus-info/selfConstant.js +27 -4
  310. package/test/unit/spec/locus-info/selfUtils.js +208 -17
  311. package/test/unit/spec/media/index.ts +104 -37
  312. package/test/unit/spec/meeting/in-meeting-actions.ts +81 -3
  313. package/test/unit/spec/meeting/index.js +4095 -1913
  314. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  315. package/test/unit/spec/meeting/muteState.js +408 -208
  316. package/test/unit/spec/meeting/request.js +440 -45
  317. package/test/unit/spec/meeting/utils.js +679 -64
  318. package/test/unit/spec/meeting-info/index.js +293 -0
  319. package/test/unit/spec/meeting-info/meetinginfov2.js +517 -5
  320. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  321. package/test/unit/spec/meetings/collection.js +14 -0
  322. package/test/unit/spec/meetings/index.js +941 -151
  323. package/test/unit/spec/meetings/utils.js +206 -2
  324. package/test/unit/spec/member/index.js +58 -4
  325. package/test/unit/spec/member/util.js +479 -35
  326. package/test/unit/spec/members/index.js +319 -1
  327. package/test/unit/spec/members/request.js +206 -27
  328. package/test/unit/spec/members/utils.js +184 -0
  329. package/test/unit/spec/metrics/index.js +1 -50
  330. package/test/unit/spec/multistream/mediaRequestManager.ts +803 -162
  331. package/test/unit/spec/multistream/receiveSlot.ts +72 -13
  332. package/test/unit/spec/multistream/receiveSlotManager.ts +58 -28
  333. package/test/unit/spec/multistream/remoteMedia.ts +30 -0
  334. package/test/unit/spec/multistream/remoteMediaGroup.ts +266 -0
  335. package/test/unit/spec/multistream/remoteMediaManager.ts +326 -0
  336. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  337. package/test/unit/spec/reachability/index.ts +343 -9
  338. package/test/unit/spec/reachability/request.js +68 -0
  339. package/test/unit/spec/reconnection-manager/index.js +84 -9
  340. package/test/unit/spec/recording-controller/index.js +294 -218
  341. package/test/unit/spec/recording-controller/util.js +223 -96
  342. package/test/unit/spec/roap/index.ts +31 -51
  343. package/test/unit/spec/roap/request.ts +203 -85
  344. package/test/unit/spec/roap/turnDiscovery.ts +48 -13
  345. package/test/unit/spec/rtcMetrics/index.ts +68 -0
  346. package/test/unit/spec/stats-analyzer/index.js +29 -2
  347. package/test/utils/constants.js +9 -0
  348. package/test/utils/integrationTestUtils.js +46 -0
  349. package/test/utils/testUtils.js +0 -45
  350. package/test/utils/webex-config.js +4 -0
  351. package/test/utils/webex-test-users.js +6 -3
  352. package/dist/meeting/effectsState.js +0 -262
  353. package/dist/meeting/effectsState.js.map +0 -1
  354. package/dist/metrics/config.js +0 -299
  355. package/dist/metrics/config.js.map +0 -1
  356. package/dist/types/meeting/effectsState.d.ts +0 -42
  357. package/dist/types/metrics/config.d.ts +0 -178
  358. package/src/index.js +0 -16
  359. package/src/meeting/effectsState.ts +0 -211
  360. package/src/metrics/config.ts +0 -495
  361. package/test/unit/spec/meeting/effectsState.js +0 -285
@@ -15,12 +15,13 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/
15
15
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
16
16
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
17
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"));
18
21
  var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
19
22
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
20
23
  var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
21
24
  var _constants = require("../constants");
22
- var _metrics = _interopRequireDefault(require("../metrics"));
23
- var _config = require("../metrics/config");
24
25
  var _infoUtils = _interopRequireDefault(require("./infoUtils"));
25
26
  var _fullState = _interopRequireDefault(require("./fullState"));
26
27
  var _selfUtils = _interopRequireDefault(require("./selfUtils"));
@@ -29,6 +30,8 @@ var _controlsUtils = _interopRequireDefault(require("./controlsUtils"));
29
30
  var _embeddedAppsUtils = _interopRequireDefault(require("./embeddedAppsUtils"));
30
31
  var _mediaSharesUtils = _interopRequireDefault(require("./mediaSharesUtils"));
31
32
  var _parser = _interopRequireDefault(require("./parser"));
33
+ var _metrics = _interopRequireDefault(require("../metrics"));
34
+ var _constants2 = _interopRequireDefault(require("../metrics/constants"));
32
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); }; }
33
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; } }
34
37
  /**
@@ -40,6 +43,13 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
40
43
  var LocusInfo = /*#__PURE__*/function (_EventsScope) {
41
44
  (0, _inherits2.default)(LocusInfo, _EventsScope);
42
45
  var _super = _createSuper(LocusInfo);
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
+ */
43
53
  function LocusInfo(updateMeeting, webex, meetingId) {
44
54
  var _this;
45
55
  (0, _classCallCheck2.default)(this, LocusInfo);
@@ -68,10 +78,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
68
78
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fullState", void 0);
69
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "host", void 0);
70
80
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "info", void 0);
81
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roles", void 0);
71
82
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaShares", void 0);
72
83
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "replace", void 0);
73
84
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "url", void 0);
74
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
  };
@@ -85,38 +97,93 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
85
97
  }
86
98
 
87
99
  /**
88
- * Apply locus delta data to meeting
89
- * @param {string} action Locus delta action
90
- * @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
+ *
91
102
  * @param {Meeting} meeting
92
103
  * @returns {undefined}
93
104
  */
94
105
  (0, _createClass2.default)(LocusInfo, [{
106
+ key: "doLocusSync",
107
+ value: function doLocusSync(meeting) {
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
+ }
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
+ }, {
95
170
  key: "applyLocusDeltaData",
96
171
  value: function applyLocusDeltaData(action, locus, meeting) {
97
- var _this2 = this;
98
172
  var _LocusDeltaParser$loc = _parser.default.loci,
99
173
  DESYNC = _LocusDeltaParser$loc.DESYNC,
100
174
  USE_CURRENT = _LocusDeltaParser$loc.USE_CURRENT,
101
- USE_INCOMING = _LocusDeltaParser$loc.USE_INCOMING;
175
+ USE_INCOMING = _LocusDeltaParser$loc.USE_INCOMING,
176
+ WAIT = _LocusDeltaParser$loc.WAIT;
102
177
  switch (action) {
103
178
  case USE_INCOMING:
104
179
  meeting.locusInfo.onDeltaLocus(locus);
105
180
  break;
106
181
  case USE_CURRENT:
107
- meeting.locusDesync = false;
108
- meeting.needToGetFullLocus = false;
182
+ case WAIT:
183
+ // do nothing
109
184
  break;
110
185
  case DESYNC:
111
- meeting.meetingRequest.getFullLocus({
112
- desync: true,
113
- locusUrl: meeting.locusUrl
114
- }).then(function (res) {
115
- meeting.locusInfo.onFullLocus(res.body);
116
- // Notify parser to resume processing delta events
117
- // now that we have full locus from DESYNC.
118
- _this2.locusParser.resume();
119
- });
186
+ this.doLocusSync(meeting);
120
187
  break;
121
188
  default:
122
189
  _loggerProxy.default.logger.info("Locus-info:index#applyLocusDeltaData --> Unknown locus delta action: ".concat(action));
@@ -186,13 +253,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
186
253
  * @member LocusInfo
187
254
  */
188
255
  this.deltaParticipants = [];
189
-
256
+ this.updateLocusCache(locus);
190
257
  // above section only updates the locusInfo object
191
258
  // The below section makes sure it updates the locusInfo as well as updates the meeting object
192
259
  this.updateParticipants(locus.participants);
193
260
  // For 1:1 space meeting the conversation Url does not exist in locus.conversation
194
261
  this.updateConversationUrl(locus.conversationUrl, locus.info);
195
- this.updateControls(locus.controls);
262
+ this.updateControls(locus.controls, locus.self);
196
263
  this.updateLocusUrl(locus.url);
197
264
  this.updateFullState(locus.fullState);
198
265
  this.updateMeetingInfo(locus.info);
@@ -212,6 +279,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
212
279
  }, {
213
280
  key: "initialSetup",
214
281
  value: function initialSetup(locus) {
282
+ this.updateLocusCache(locus);
215
283
  this.onFullLocus(locus);
216
284
 
217
285
  // Change it to true after it receives it first locus object
@@ -229,6 +297,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
229
297
  value: function parse(meeting, data) {
230
298
  // eslint-disable-next-line @typescript-eslint/no-shadow
231
299
  var eventType = data.eventType;
300
+ var locus = this.getTheLocusToUpdate(data.locus);
232
301
  _loggerProxy.default.logger.info("Locus-info:index#parse --> received locus data: ".concat(eventType));
233
302
  switch (eventType) {
234
303
  case _constants.LOCUSEVENT.PARTICIPANT_JOIN:
@@ -245,15 +314,15 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
245
314
  case _constants.LOCUSEVENT.PARTICIPANT_DECLINED:
246
315
  case _constants.LOCUSEVENT.FLOOR_GRANTED:
247
316
  case _constants.LOCUSEVENT.FLOOR_RELEASED:
248
- this.onFullLocus(data.locus, eventType);
317
+ this.onFullLocus(locus, eventType);
249
318
  break;
250
319
  case _constants.LOCUSEVENT.DIFFERENCE:
251
- this.handleLocusDelta(data.locus, meeting);
320
+ this.handleLocusDelta(locus, meeting);
252
321
  break;
253
322
  default:
254
323
  // Why will there be a event with no eventType ????
255
324
  // we may not need this, we can get full locus
256
- this.handleLocusDelta(data.locus, meeting);
325
+ this.handleLocusDelta(locus, meeting);
257
326
  }
258
327
  }
259
328
 
@@ -277,18 +346,22 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
277
346
  * @returns {object} null
278
347
  * @memberof LocusInfo
279
348
  */
280
- // eslint-disable-next-line @typescript-eslint/no-shadow
281
349
  }, {
282
350
  key: "onFullLocus",
283
351
  value: function onFullLocus(locus, eventType) {
284
352
  if (!locus) {
285
353
  _loggerProxy.default.logger.error('Locus-info:index#onFullLocus --> object passed as argument was invalid, continuing.');
286
354
  }
355
+ if (!this.locusParser.isNewFullLocus(locus)) {
356
+ _loggerProxy.default.logger.info("Locus-info:index#onFullLocus --> ignoring old full locus DTO, eventType=".concat(eventType));
357
+ return;
358
+ }
287
359
  this.updateParticipantDeltas(locus.participants);
288
360
  this.scheduledMeeting = locus.meeting || null;
289
361
  this.participants = locus.participants;
362
+ var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
290
363
  this.updateLocusInfo(locus);
291
- this.updateParticipants(locus.participants);
364
+ this.updateParticipants(locus.participants, isReplaceMembers);
292
365
  this.isMeetingActive();
293
366
  this.handleOneOnOneEvent(eventType);
294
367
  this.updateEmbeddedApps(locus.embeddedApps);
@@ -340,8 +413,9 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
340
413
  }, {
341
414
  key: "onDeltaLocus",
342
415
  value: function onDeltaLocus(locus) {
416
+ var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
343
417
  this.updateLocusInfo(locus);
344
- this.updateParticipants(locus.participants);
418
+ this.updateParticipants(locus.participants, isReplaceMembers);
345
419
  this.isMeetingActive();
346
420
  }
347
421
 
@@ -360,7 +434,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
360
434
  // as it gets interpreted as if we have left the call
361
435
  return;
362
436
  }
363
- this.updateControls(locus.controls);
437
+ this.updateControls(locus.controls, locus.self);
364
438
  this.updateConversationUrl(locus.conversationUrl, locus.info);
365
439
  this.updateCreated(locus.created);
366
440
  this.updateFullState(locus.fullState);
@@ -426,9 +500,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
426
500
  if (this.fullState && this.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
427
501
  // TODO: update the meeting state
428
502
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Call Ended, locus state is inactive.');
429
- _metrics.default.postEvent({
430
- event: _config.eventType.REMOTE_ENDED,
431
- meetingId: this.meetingId
503
+
504
+ // @ts-ignore
505
+ this.webex.internal.newMetrics.submitClientEvent({
506
+ name: 'client.call.remote-ended',
507
+ options: {
508
+ meetingId: this.meetingId
509
+ }
432
510
  });
433
511
  this.emitScoped({
434
512
  file: 'locus-info',
@@ -438,9 +516,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
438
516
  shouldLeave: false
439
517
  });
440
518
  } 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)) {
441
- _metrics.default.postEvent({
442
- event: _config.eventType.REMOTE_ENDED,
443
- meetingId: this.meetingId
519
+ // @ts-ignore
520
+ this.webex.internal.newMetrics.submitClientEvent({
521
+ name: 'client.call.remote-ended',
522
+ options: {
523
+ meetingId: this.meetingId
524
+ }
444
525
  });
445
526
  this.emitScoped({
446
527
  file: 'locus-info',
@@ -451,9 +532,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
451
532
  });
452
533
  } 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
453
534
  ) {
454
- _metrics.default.postEvent({
455
- event: _config.eventType.REMOTE_ENDED,
456
- meetingId: this.meetingId
535
+ // @ts-ignore
536
+ this.webex.internal.newMetrics.submitClientEvent({
537
+ name: 'client.call.remote-ended',
538
+ options: {
539
+ meetingId: this.meetingId
540
+ }
457
541
  });
458
542
  this.emitScoped({
459
543
  file: 'locus-info',
@@ -468,9 +552,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
468
552
  // @ts-ignore
469
553
  this.fullState.state === _constants.LOCUS.STATE.TERMINATING)) {
470
554
  _loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting is ending due to inactive or terminating');
471
- _metrics.default.postEvent({
472
- event: _config.eventType.REMOTE_ENDED,
473
- meetingId: this.meetingId
555
+
556
+ // @ts-ignore
557
+ this.webex.internal.newMetrics.submitClientEvent({
558
+ name: 'client.call.remote-ended',
559
+ options: {
560
+ meetingId: this.meetingId
561
+ }
474
562
  });
475
563
  this.emitScoped({
476
564
  file: 'locus-info',
@@ -481,9 +569,13 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
481
569
  });
482
570
  } else if (this.fullState && this.fullState.removed) {
483
571
  // user has been dropped from a meeting
484
- _metrics.default.postEvent({
485
- event: _config.eventType.REMOTE_ENDED,
486
- meetingId: this.meetingId
572
+
573
+ // @ts-ignore
574
+ this.webex.internal.newMetrics.submitClientEvent({
575
+ name: 'client.call.remote-ended',
576
+ options: {
577
+ meetingId: this.meetingId
578
+ }
487
579
  });
488
580
  this.emitScoped({
489
581
  file: 'locus-info',
@@ -606,15 +698,15 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
606
698
  }
607
699
 
608
700
  /**
609
- *
701
+ * update meeting's members
610
702
  * @param {Object} participants new participants object
611
- * @param {boolen} deltaParticpantFlag delta event
703
+ * @param {Boolean} isReplace is replace the whole members
612
704
  * @returns {Array} updatedParticipants
613
705
  * @memberof LocusInfo
614
706
  */
615
707
  }, {
616
708
  key: "updateParticipants",
617
- value: function updateParticipants(participants) {
709
+ value: function updateParticipants(participants, isReplace) {
618
710
  var _this$parsedLocus$con;
619
711
  this.emitScoped({
620
712
  file: 'locus-info',
@@ -624,18 +716,20 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
624
716
  recordingId: this.parsedLocus.controls && ((_this$parsedLocus$con = this.parsedLocus.controls.record) === null || _this$parsedLocus$con === void 0 ? void 0 : _this$parsedLocus$con.modifiedBy),
625
717
  selfIdentity: this.parsedLocus.self && this.parsedLocus.self.selfIdentity,
626
718
  selfId: this.parsedLocus.self && this.parsedLocus.self.selfId,
627
- hostId: this.parsedLocus.host && this.parsedLocus.host.hostId
719
+ hostId: this.parsedLocus.host && this.parsedLocus.host.hostId,
720
+ isReplace: isReplace
628
721
  });
629
722
  }
630
723
 
631
724
  /**
632
725
  * @param {Object} controls
726
+ * @param {Object} self
633
727
  * @returns {undefined}
634
728
  * @memberof LocusInfo
635
729
  */
636
730
  }, {
637
731
  key: "updateControls",
638
- value: function updateControls(controls) {
732
+ value: function updateControls(controls, self) {
639
733
  if (controls && !(0, _isEqual2.default)(this.controls, controls)) {
640
734
  this.parsedLocus.controls = _controlsUtils.default.parse(controls);
641
735
  var _ControlsUtils$getCon = _controlsUtils.default.getControls(this.controls, controls),
@@ -646,7 +740,73 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
646
740
  hasTranscribeChanged = _ControlsUtils$getCon2.hasTranscribeChanged,
647
741
  hasEntryExitToneChanged = _ControlsUtils$getCon2.hasEntryExitToneChanged,
648
742
  hasBreakoutChanged = _ControlsUtils$getCon2.hasBreakoutChanged,
743
+ hasVideoEnabledChanged = _ControlsUtils$getCon2.hasVideoEnabledChanged,
744
+ hasMuteOnEntryChanged = _ControlsUtils$getCon2.hasMuteOnEntryChanged,
745
+ hasShareControlChanged = _ControlsUtils$getCon2.hasShareControlChanged,
746
+ hasDisallowUnmuteChanged = _ControlsUtils$getCon2.hasDisallowUnmuteChanged,
747
+ hasReactionsChanged = _ControlsUtils$getCon2.hasReactionsChanged,
748
+ hasReactionDisplayNamesChanged = _ControlsUtils$getCon2.hasReactionDisplayNamesChanged,
749
+ hasViewTheParticipantListChanged = _ControlsUtils$getCon2.hasViewTheParticipantListChanged,
750
+ hasRaiseHandChanged = _ControlsUtils$getCon2.hasRaiseHandChanged,
751
+ hasVideoChanged = _ControlsUtils$getCon2.hasVideoChanged,
752
+ hasInterpretationChanged = _ControlsUtils$getCon2.hasInterpretationChanged,
649
753
  current = _ControlsUtils$getCon.current;
754
+ if (hasMuteOnEntryChanged) {
755
+ this.emitScoped({
756
+ file: 'locus-info',
757
+ function: 'updateControls'
758
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_MUTE_ON_ENTRY_CHANGED, {
759
+ state: current.muteOnEntry
760
+ });
761
+ }
762
+ if (hasShareControlChanged) {
763
+ this.emitScoped({
764
+ file: 'locus-info',
765
+ function: 'updateControls'
766
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_SHARE_CONTROL_CHANGED, {
767
+ state: current.shareControl
768
+ });
769
+ }
770
+ if (hasDisallowUnmuteChanged) {
771
+ this.emitScoped({
772
+ file: 'locus-info',
773
+ function: 'updateControls'
774
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_DISALLOW_UNMUTE_CHANGED, {
775
+ state: current.disallowUnmute
776
+ });
777
+ }
778
+ if (hasReactionsChanged || hasReactionDisplayNamesChanged) {
779
+ this.emitScoped({
780
+ file: 'locus-info',
781
+ function: 'updateControls'
782
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_REACTIONS_CHANGED, {
783
+ state: current.reactions
784
+ });
785
+ }
786
+ if (hasViewTheParticipantListChanged) {
787
+ this.emitScoped({
788
+ file: 'locus-info',
789
+ function: 'updateControls'
790
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED, {
791
+ state: current.viewTheParticipantList
792
+ });
793
+ }
794
+ if (hasRaiseHandChanged) {
795
+ this.emitScoped({
796
+ file: 'locus-info',
797
+ function: 'updateControls'
798
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_RAISE_HAND_CHANGED, {
799
+ state: current.raiseHand
800
+ });
801
+ }
802
+ if (hasVideoChanged) {
803
+ this.emitScoped({
804
+ file: 'locus-info',
805
+ function: 'updateControls'
806
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_VIDEO_CHANGED, {
807
+ state: current.video
808
+ });
809
+ }
650
810
  if (hasRecordingChanged || hasRecordingPausedChanged) {
651
811
  var state = null;
652
812
  if (hasRecordingPausedChanged) {
@@ -691,6 +851,7 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
691
851
  }
692
852
  if (hasBreakoutChanged) {
693
853
  var breakout = current.breakout;
854
+ breakout.breakoutMoveId = _selfUtils.default.getReplacedBreakoutMoveId(self, this.webex.internal.device.url);
694
855
  this.emitScoped({
695
856
  file: 'locus-info',
696
857
  function: 'updateControls'
@@ -698,16 +859,41 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
698
859
  breakout: breakout
699
860
  });
700
861
  }
862
+ if (hasInterpretationChanged) {
863
+ var interpretation = current.interpretation;
864
+ this.emitScoped({
865
+ file: 'locus-info',
866
+ function: 'updateControls'
867
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_INTERPRETATION_UPDATED, {
868
+ interpretation: interpretation
869
+ });
870
+ }
701
871
  if (hasEntryExitToneChanged) {
702
872
  var entryExitTone = current.entryExitTone;
873
+ this.updateMeeting({
874
+ entryExitTone: entryExitTone
875
+ });
703
876
  this.emitScoped({
704
877
  file: 'locus-info',
705
878
  function: 'updateControls'
706
879
  }, _constants.LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED, {
707
880
  entryExitTone: entryExitTone
708
881
  });
882
+ }
883
+
884
+ // videoEnabled is handled differently than other controls,
885
+ // to fit with audio mute status logic
886
+ if (hasVideoEnabledChanged) {
887
+ var videoEnabled = current.videoEnabled;
709
888
  this.updateMeeting({
710
- entryExitTone: entryExitTone
889
+ unmuteVideoAllowed: videoEnabled
890
+ });
891
+ this.emitScoped({
892
+ file: 'locus-info',
893
+ function: 'updateControls'
894
+ }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED, {
895
+ // muted: not part of locus.controls
896
+ unmuteAllowed: videoEnabled
711
897
  });
712
898
  }
713
899
  this.controls = controls;
@@ -840,18 +1026,11 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
840
1026
  }, {
841
1027
  key: "updateMeetingInfo",
842
1028
  value: function updateMeetingInfo(info, self) {
843
- if (info && !(0, _isEqual2.default)(this.info, info)) {
844
- var _this$parsedLocus$sel;
845
- 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) || [];
1029
+ var _this$parsedLocus$sel;
1030
+ 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) || [];
1031
+ if (info && !(0, _isEqual2.default)(this.info, info) || roles.length && !(0, _isEqual2.default)(this.roles, roles) && info) {
846
1032
  var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
847
1033
  var parsedInfo = _infoUtils.default.getInfos(this.parsedLocus.info, info, roles, isJoined);
848
- this.emitScoped({
849
- file: 'locus-info',
850
- function: 'updateMeetingInfo'
851
- }, _constants.LOCUSINFO.EVENTS.MEETING_INFO_UPDATED, {
852
- info: parsedInfo.current,
853
- self: self
854
- });
855
1034
  if (parsedInfo.updates.isLocked) {
856
1035
  this.emitScoped({
857
1036
  file: 'locus-info',
@@ -868,7 +1047,12 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
868
1047
  this.parsedLocus.info = parsedInfo.current;
869
1048
  // Parses the info and adds necessary values
870
1049
  this.updateMeeting(parsedInfo.current);
1050
+ this.emitScoped({
1051
+ file: 'locus-info',
1052
+ function: 'updateMeetingInfo'
1053
+ }, _constants.LOCUSINFO.EVENTS.MEETING_INFO_UPDATED);
871
1054
  }
1055
+ this.roles = roles;
872
1056
  }
873
1057
 
874
1058
  /**
@@ -994,6 +1178,15 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
994
1178
  breakoutSessions: parsedSelves.current.breakoutSessions
995
1179
  });
996
1180
  }
1181
+ if (parsedSelves.updates.interpretationChanged) {
1182
+ this.emitScoped({
1183
+ file: 'locus-info',
1184
+ function: 'updateSelf'
1185
+ }, _constants.LOCUSINFO.EVENTS.SELF_MEETING_INTERPRETATION_CHANGED, {
1186
+ interpretation: parsedSelves.current.interpretation,
1187
+ selfParticipantId: parsedSelves.current.selfId
1188
+ });
1189
+ }
997
1190
  if (parsedSelves.updates.isMediaInactiveOrReleased) {
998
1191
  this.emitScoped({
999
1192
  file: 'locus-info',
@@ -1008,6 +1201,26 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1008
1201
  function: 'updateSelf'
1009
1202
  }, _constants.LOCUSINFO.EVENTS.SELF_MODERATOR_CHANGED, self);
1010
1203
  }
1204
+ if (parsedSelves.updates.isRolesChanged) {
1205
+ var _parsedSelves$previou, _parsedSelves$current;
1206
+ this.emitScoped({
1207
+ file: 'locus-info',
1208
+ function: 'updateSelf'
1209
+ }, _constants.LOCUSINFO.EVENTS.SELF_ROLES_CHANGED, {
1210
+ oldRoles: (_parsedSelves$previou = parsedSelves.previous) === null || _parsedSelves$previou === void 0 ? void 0 : _parsedSelves$previou.roles,
1211
+ newRoles: (_parsedSelves$current = parsedSelves.current) === null || _parsedSelves$current === void 0 ? void 0 : _parsedSelves$current.roles
1212
+ });
1213
+ }
1214
+ if (parsedSelves.updates.isVideoMutedByOthersChanged) {
1215
+ this.emitScoped({
1216
+ file: 'locus-info',
1217
+ function: 'updateSelf'
1218
+ }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED, {
1219
+ muted: parsedSelves.current.remoteVideoMuted
1220
+ // unmuteAllowed: not part of .self
1221
+ });
1222
+ }
1223
+
1011
1224
  if (parsedSelves.updates.localAudioUnmuteRequiredByServer) {
1012
1225
  this.emitScoped({
1013
1226
  file: 'locus-info',
@@ -1053,14 +1266,14 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1053
1266
  _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
1054
1267
  }
1055
1268
  if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
1056
- var _parsedSelves$current, _parsedSelves$current2, _parsedSelves$current3;
1269
+ var _parsedSelves$current2, _parsedSelves$current3, _parsedSelves$current4;
1057
1270
  this.emitScoped({
1058
1271
  file: 'locus-info',
1059
1272
  function: 'updateSelf'
1060
1273
  }, _constants.LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, {
1061
- audioStatus: (_parsedSelves$current = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current === void 0 ? void 0 : _parsedSelves$current.audio,
1062
- videoStatus: (_parsedSelves$current2 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current2 === void 0 ? void 0 : _parsedSelves$current2.video,
1063
- shareStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.share
1274
+ audioStatus: (_parsedSelves$current2 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current2 === void 0 ? void 0 : _parsedSelves$current2.audio,
1275
+ videoStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.video,
1276
+ shareStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.share
1064
1277
  });
1065
1278
  }
1066
1279
  if (parsedSelves.updates.isUserObserving) {
@@ -1185,6 +1398,112 @@ var LocusInfo = /*#__PURE__*/function (_EventsScope) {
1185
1398
  this.identities = identities;
1186
1399
  }
1187
1400
  }
1401
+
1402
+ /**
1403
+ * check the locus is main session's one or not, if is main session's, update main session cache
1404
+ * @param {Object} locus
1405
+ * @returns {undefined}
1406
+ * @memberof LocusInfo
1407
+ */
1408
+ }, {
1409
+ key: "updateLocusCache",
1410
+ value: function updateLocusCache(locus) {
1411
+ var isMainSessionDTO = _controlsUtils.default.isMainSessionDTO(locus);
1412
+ if (isMainSessionDTO) {
1413
+ this.updateMainSessionLocusCache(locus);
1414
+ }
1415
+ }
1416
+
1417
+ /**
1418
+ * if return from breakout to main session, need to use cached main session DTO since locus won't send the full locus (participants)
1419
+ * if join breakout from main session, need to query main locus url (if response with 403 means no privilege, need to clear the cache)
1420
+ * @param {Object} newLocus
1421
+ * @returns {Object}
1422
+ * @memberof LocusInfo
1423
+ */
1424
+ }, {
1425
+ key: "getTheLocusToUpdate",
1426
+ value: function getTheLocusToUpdate(newLocus) {
1427
+ var switchStatus = _controlsUtils.default.getSessionSwitchStatus(this.controls, newLocus === null || newLocus === void 0 ? void 0 : newLocus.controls);
1428
+ if (switchStatus.isReturnToMain && this.mainSessionLocusCache) {
1429
+ return (0, _cloneDeep2.default)(this.mainSessionLocusCache);
1430
+ }
1431
+ if (switchStatus.isJoinToBreakout) {
1432
+ this.emitScoped({
1433
+ file: 'locus-info',
1434
+ function: 'updateControls'
1435
+ }, _constants.LOCUSINFO.EVENTS.CONTROLS_JOIN_BREAKOUT_FROM_MAIN, {
1436
+ mainLocusUrl: this.url
1437
+ });
1438
+ }
1439
+ return newLocus;
1440
+ }
1441
+
1442
+ /**
1443
+ * merge participants by participant id
1444
+ * @param {Array} participants
1445
+ * @param {Array} sourceParticipants
1446
+ * @returns {Array} merged participants
1447
+ * @memberof LocusInfo
1448
+ */
1449
+ // eslint-disable-next-line class-methods-use-this
1450
+ }, {
1451
+ key: "mergeParticipants",
1452
+ value: function mergeParticipants(participants, sourceParticipants) {
1453
+ if (!sourceParticipants || !sourceParticipants.length) return participants;
1454
+ if (!participants || !participants.length) {
1455
+ return sourceParticipants;
1456
+ }
1457
+ sourceParticipants.forEach(function (participant) {
1458
+ var existIndex = participants.findIndex(function (p) {
1459
+ return p.id === participant.id;
1460
+ });
1461
+ if (existIndex > -1) {
1462
+ participants.splice(existIndex, 1, participant);
1463
+ } else {
1464
+ participants.push(participant);
1465
+ }
1466
+ });
1467
+ return participants;
1468
+ }
1469
+
1470
+ /**
1471
+ * need cache main sessions' participants since locus will not send the full list when cohost/host leave breakout
1472
+ * @param {Object} mainLocus
1473
+ * @returns {undefined}
1474
+ * @memberof LocusInfo
1475
+ */
1476
+ }, {
1477
+ key: "updateMainSessionLocusCache",
1478
+ value: function updateMainSessionLocusCache(mainLocus) {
1479
+ var _this5 = this;
1480
+ if (!mainLocus) {
1481
+ return;
1482
+ }
1483
+ var locusClone = (0, _cloneDeep2.default)(mainLocus);
1484
+ if (this.mainSessionLocusCache) {
1485
+ // shallow merge and do special merge for participants
1486
+ (0, _assignWith2.default)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
1487
+ if (key === 'participants') {
1488
+ return _this5.mergeParticipants(objValue, srcValue);
1489
+ }
1490
+ return srcValue || objValue;
1491
+ });
1492
+ } else {
1493
+ this.mainSessionLocusCache = locusClone;
1494
+ }
1495
+ }
1496
+
1497
+ /**
1498
+ * clear main session cache
1499
+ * @returns {undefined}
1500
+ * @memberof LocusInfo
1501
+ */
1502
+ }, {
1503
+ key: "clearMainSessionLocusCache",
1504
+ value: function clearMainSessionLocusCache() {
1505
+ this.mainSessionLocusCache = null;
1506
+ }
1188
1507
  }]);
1189
1508
  return LocusInfo;
1190
1509
  }(_eventsScope.default);