@webex/plugin-meetings 3.0.0-beta.4 → 3.0.0-beta.400

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 (629) hide show
  1. package/README.md +58 -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 +11 -15
  75. package/dist/config.js.map +1 -1
  76. package/dist/constants.js +347 -74
  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 +125 -18
  89. package/dist/index.js.map +1 -1
  90. package/dist/interceptors/index.js +15 -0
  91. package/dist/interceptors/index.js.map +1 -0
  92. package/dist/interceptors/locusRetry.js +93 -0
  93. package/dist/interceptors/locusRetry.js.map +1 -0
  94. package/dist/interpretation/collection.js +23 -0
  95. package/dist/interpretation/collection.js.map +1 -0
  96. package/dist/interpretation/index.js +380 -0
  97. package/dist/interpretation/index.js.map +1 -0
  98. package/dist/interpretation/siLanguage.js +25 -0
  99. package/dist/interpretation/siLanguage.js.map +1 -0
  100. package/dist/locus-info/controlsUtils.js +101 -29
  101. package/dist/locus-info/controlsUtils.js.map +1 -1
  102. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  103. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  104. package/dist/locus-info/fullState.js +0 -15
  105. package/dist/locus-info/fullState.js.map +1 -1
  106. package/dist/locus-info/hostUtils.js +4 -12
  107. package/dist/locus-info/hostUtils.js.map +1 -1
  108. package/dist/locus-info/index.js +564 -246
  109. package/dist/locus-info/index.js.map +1 -1
  110. package/dist/locus-info/infoUtils.js +10 -38
  111. package/dist/locus-info/infoUtils.js.map +1 -1
  112. package/dist/locus-info/mediaSharesUtils.js +82 -38
  113. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  114. package/dist/locus-info/parser.js +314 -163
  115. package/dist/locus-info/parser.js.map +1 -1
  116. package/dist/locus-info/selfUtils.js +110 -92
  117. package/dist/locus-info/selfUtils.js.map +1 -1
  118. package/dist/media/index.js +107 -231
  119. package/dist/media/index.js.map +1 -1
  120. package/dist/media/properties.js +137 -222
  121. package/dist/media/properties.js.map +1 -1
  122. package/dist/media/util.js +2 -9
  123. package/dist/media/util.js.map +1 -1
  124. package/dist/mediaQualityMetrics/config.js +316 -501
  125. package/dist/mediaQualityMetrics/config.js.map +1 -1
  126. package/dist/meeting/in-meeting-actions.js +97 -14
  127. package/dist/meeting/in-meeting-actions.js.map +1 -1
  128. package/dist/meeting/index.js +5311 -3871
  129. package/dist/meeting/index.js.map +1 -1
  130. package/dist/meeting/locusMediaRequest.js +292 -0
  131. package/dist/meeting/locusMediaRequest.js.map +1 -0
  132. package/dist/meeting/muteState.js +260 -183
  133. package/dist/meeting/muteState.js.map +1 -1
  134. package/dist/meeting/request.js +421 -347
  135. package/dist/meeting/request.js.map +1 -1
  136. package/dist/meeting/request.type.js +7 -0
  137. package/dist/meeting/request.type.js.map +1 -0
  138. package/dist/meeting/state.js +21 -31
  139. package/dist/meeting/state.js.map +1 -1
  140. package/dist/meeting/util.js +672 -585
  141. package/dist/meeting/util.js.map +1 -1
  142. package/dist/meeting/voicea-meeting.js +172 -0
  143. package/dist/meeting/voicea-meeting.js.map +1 -0
  144. package/dist/meeting-info/collection.js +6 -25
  145. package/dist/meeting-info/collection.js.map +1 -1
  146. package/dist/meeting-info/index.js +87 -39
  147. package/dist/meeting-info/index.js.map +1 -1
  148. package/dist/meeting-info/meeting-info-v2.js +352 -283
  149. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  150. package/dist/meeting-info/request.js +3 -15
  151. package/dist/meeting-info/request.js.map +1 -1
  152. package/dist/meeting-info/util.js +99 -183
  153. package/dist/meeting-info/util.js.map +1 -1
  154. package/dist/meeting-info/utilv2.js +147 -234
  155. package/dist/meeting-info/utilv2.js.map +1 -1
  156. package/dist/meetings/collection.js +43 -19
  157. package/dist/meetings/collection.js.map +1 -1
  158. package/dist/meetings/index.js +895 -600
  159. package/dist/meetings/index.js.map +1 -1
  160. package/dist/meetings/meetings.types.js +7 -0
  161. package/dist/meetings/meetings.types.js.map +1 -0
  162. package/dist/meetings/request.js +26 -41
  163. package/dist/meetings/request.js.map +1 -1
  164. package/dist/meetings/util.js +184 -157
  165. package/dist/meetings/util.js.map +1 -1
  166. package/dist/member/index.js +134 -85
  167. package/dist/member/index.js.map +1 -1
  168. package/dist/member/types.js +25 -0
  169. package/dist/member/types.js.map +1 -0
  170. package/dist/member/util.js +158 -88
  171. package/dist/member/util.js.map +1 -1
  172. package/dist/members/collection.js +13 -12
  173. package/dist/members/collection.js.map +1 -1
  174. package/dist/members/index.js +194 -204
  175. package/dist/members/index.js.map +1 -1
  176. package/dist/members/request.js +113 -68
  177. package/dist/members/request.js.map +1 -1
  178. package/dist/members/types.js +15 -0
  179. package/dist/members/types.js.map +1 -0
  180. package/dist/members/util.js +324 -259
  181. package/dist/members/util.js.map +1 -1
  182. package/dist/metrics/constants.js +19 -7
  183. package/dist/metrics/constants.js.map +1 -1
  184. package/dist/metrics/index.js +11 -558
  185. package/dist/metrics/index.js.map +1 -1
  186. package/dist/multistream/mediaRequestManager.js +263 -50
  187. package/dist/multistream/mediaRequestManager.js.map +1 -1
  188. package/dist/multistream/receiveSlot.js +58 -65
  189. package/dist/multistream/receiveSlot.js.map +1 -1
  190. package/dist/multistream/receiveSlotManager.js +76 -95
  191. package/dist/multistream/receiveSlotManager.js.map +1 -1
  192. package/dist/multistream/remoteMedia.js +62 -76
  193. package/dist/multistream/remoteMedia.js.map +1 -1
  194. package/dist/multistream/remoteMediaGroup.js +82 -45
  195. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  196. package/dist/multistream/remoteMediaManager.js +657 -448
  197. package/dist/multistream/remoteMediaManager.js.map +1 -1
  198. package/dist/multistream/sendSlotManager.js +255 -0
  199. package/dist/multistream/sendSlotManager.js.map +1 -0
  200. package/dist/networkQualityMonitor/index.js +40 -59
  201. package/dist/networkQualityMonitor/index.js.map +1 -1
  202. package/dist/personal-meeting-room/index.js +21 -45
  203. package/dist/personal-meeting-room/index.js.map +1 -1
  204. package/dist/personal-meeting-room/request.js +1 -31
  205. package/dist/personal-meeting-room/request.js.map +1 -1
  206. package/dist/personal-meeting-room/util.js +0 -13
  207. package/dist/personal-meeting-room/util.js.map +1 -1
  208. package/dist/reachability/clusterReachability.js +356 -0
  209. package/dist/reachability/clusterReachability.js.map +1 -0
  210. package/dist/reachability/index.js +297 -460
  211. package/dist/reachability/index.js.map +1 -1
  212. package/dist/reachability/request.js +20 -26
  213. package/dist/reachability/request.js.map +1 -1
  214. package/dist/reachability/util.js +29 -0
  215. package/dist/reachability/util.js.map +1 -0
  216. package/dist/reactions/constants.js +13 -0
  217. package/dist/reactions/constants.js.map +1 -0
  218. package/dist/reactions/reactions.js +109 -0
  219. package/dist/reactions/reactions.js.map +1 -0
  220. package/dist/reactions/reactions.type.js +36 -0
  221. package/dist/reactions/reactions.type.js.map +1 -0
  222. package/dist/reconnection-manager/index.js +413 -483
  223. package/dist/reconnection-manager/index.js.map +1 -1
  224. package/dist/recording-controller/enums.js +17 -0
  225. package/dist/recording-controller/enums.js.map +1 -0
  226. package/dist/recording-controller/index.js +362 -0
  227. package/dist/recording-controller/index.js.map +1 -0
  228. package/dist/recording-controller/util.js +64 -0
  229. package/dist/recording-controller/util.js.map +1 -0
  230. package/dist/roap/index.js +102 -86
  231. package/dist/roap/index.js.map +1 -1
  232. package/dist/roap/request.js +131 -135
  233. package/dist/roap/request.js.map +1 -1
  234. package/dist/roap/turnDiscovery.js +437 -116
  235. package/dist/roap/turnDiscovery.js.map +1 -1
  236. package/dist/rtcMetrics/constants.js +12 -0
  237. package/dist/rtcMetrics/constants.js.map +1 -0
  238. package/dist/rtcMetrics/index.js +179 -0
  239. package/dist/rtcMetrics/index.js.map +1 -0
  240. package/dist/statsAnalyzer/global.js +1 -95
  241. package/dist/statsAnalyzer/global.js.map +1 -1
  242. package/dist/statsAnalyzer/index.js +557 -583
  243. package/dist/statsAnalyzer/index.js.map +1 -1
  244. package/dist/statsAnalyzer/mqaUtil.js +326 -130
  245. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  246. package/dist/transcription/index.js +22 -47
  247. package/dist/transcription/index.js.map +1 -1
  248. package/dist/types/annotation/annotation.types.d.ts +42 -0
  249. package/dist/types/annotation/constants.d.ts +31 -0
  250. package/dist/types/annotation/index.d.ts +117 -0
  251. package/dist/types/breakouts/breakout.d.ts +8 -0
  252. package/dist/types/breakouts/collection.d.ts +5 -0
  253. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  254. package/dist/types/breakouts/events.d.ts +8 -0
  255. package/dist/types/breakouts/index.d.ts +5 -0
  256. package/dist/types/breakouts/request.d.ts +22 -0
  257. package/dist/types/breakouts/utils.d.ts +15 -0
  258. package/dist/types/common/browser-detection.d.ts +9 -0
  259. package/dist/types/common/collection.d.ts +48 -0
  260. package/dist/types/common/config.d.ts +2 -0
  261. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  262. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  263. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  264. package/dist/types/common/errors/media.d.ts +15 -0
  265. package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
  266. package/dist/types/common/errors/parameter.d.ts +15 -0
  267. package/dist/types/common/errors/password-error.d.ts +15 -0
  268. package/dist/types/common/errors/permission.d.ts +14 -0
  269. package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
  270. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  271. package/dist/types/common/errors/reconnection.d.ts +15 -0
  272. package/dist/types/common/errors/stats.d.ts +15 -0
  273. package/dist/types/common/errors/webex-errors.d.ts +93 -0
  274. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  275. package/dist/types/common/events/events-scope.d.ts +17 -0
  276. package/dist/types/common/events/events.d.ts +12 -0
  277. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  278. package/dist/types/common/events/util.d.ts +2 -0
  279. package/dist/types/common/logs/logger-config.d.ts +2 -0
  280. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  281. package/dist/types/common/logs/request.d.ts +36 -0
  282. package/dist/types/common/queue.d.ts +34 -0
  283. package/dist/types/config.d.ts +72 -0
  284. package/dist/types/constants.d.ts +1088 -0
  285. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  286. package/dist/types/controls-options-manager/enums.d.ts +15 -0
  287. package/dist/types/controls-options-manager/index.d.ts +136 -0
  288. package/dist/types/controls-options-manager/types.d.ts +43 -0
  289. package/dist/types/controls-options-manager/util.d.ts +1 -0
  290. package/dist/types/index.d.ts +7 -0
  291. package/dist/types/interceptors/index.d.ts +2 -0
  292. package/dist/types/interceptors/locusRetry.d.ts +27 -0
  293. package/dist/types/interpretation/collection.d.ts +5 -0
  294. package/dist/types/interpretation/index.d.ts +5 -0
  295. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  296. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  297. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  298. package/dist/types/locus-info/fullState.d.ts +2 -0
  299. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  300. package/dist/types/locus-info/index.d.ts +322 -0
  301. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  302. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  303. package/dist/types/locus-info/parser.d.ts +272 -0
  304. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  305. package/dist/types/media/index.d.ts +34 -0
  306. package/dist/types/media/properties.d.ts +93 -0
  307. package/dist/types/media/util.d.ts +2 -0
  308. package/dist/types/mediaQualityMetrics/config.d.ts +241 -0
  309. package/dist/types/meeting/in-meeting-actions.d.ts +167 -0
  310. package/dist/types/meeting/index.d.ts +1824 -0
  311. package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
  312. package/dist/types/meeting/muteState.d.ts +178 -0
  313. package/dist/types/meeting/request.d.ts +293 -0
  314. package/dist/types/meeting/request.type.d.ts +11 -0
  315. package/dist/types/meeting/state.d.ts +9 -0
  316. package/dist/types/meeting/util.d.ts +118 -0
  317. package/dist/types/meeting/voicea-meeting.d.ts +16 -0
  318. package/dist/types/meeting-info/collection.d.ts +20 -0
  319. package/dist/types/meeting-info/index.d.ts +69 -0
  320. package/dist/types/meeting-info/meeting-info-v2.d.ts +123 -0
  321. package/dist/types/meeting-info/request.d.ts +22 -0
  322. package/dist/types/meeting-info/util.d.ts +2 -0
  323. package/dist/types/meeting-info/utilv2.d.ts +2 -0
  324. package/dist/types/meetings/collection.d.ts +40 -0
  325. package/dist/types/meetings/index.d.ts +389 -0
  326. package/dist/types/meetings/meetings.types.d.ts +4 -0
  327. package/dist/types/meetings/request.d.ts +27 -0
  328. package/dist/types/meetings/util.d.ts +18 -0
  329. package/dist/types/member/index.d.ts +160 -0
  330. package/dist/types/member/types.d.ts +32 -0
  331. package/dist/types/member/util.d.ts +2 -0
  332. package/dist/types/members/collection.d.ts +29 -0
  333. package/dist/types/members/index.d.ts +353 -0
  334. package/dist/types/members/request.d.ts +114 -0
  335. package/dist/types/members/types.d.ts +25 -0
  336. package/dist/types/members/util.d.ts +215 -0
  337. package/dist/types/metrics/constants.d.ts +70 -0
  338. package/dist/types/metrics/index.d.ts +45 -0
  339. package/dist/types/multistream/mediaRequestManager.d.ts +120 -0
  340. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  341. package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
  342. package/dist/types/multistream/remoteMedia.d.ts +72 -0
  343. package/dist/types/multistream/remoteMediaGroup.d.ts +49 -0
  344. package/dist/types/multistream/remoteMediaManager.d.ts +301 -0
  345. package/dist/types/multistream/sendSlotManager.d.ts +70 -0
  346. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  347. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  348. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  349. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  350. package/dist/types/reachability/clusterReachability.d.ts +109 -0
  351. package/dist/types/reachability/index.d.ts +105 -0
  352. package/dist/types/reachability/request.d.ts +39 -0
  353. package/dist/types/reachability/util.d.ts +8 -0
  354. package/dist/types/reactions/constants.d.ts +3 -0
  355. package/dist/types/reactions/reactions.d.ts +4 -0
  356. package/dist/types/reactions/reactions.type.d.ts +52 -0
  357. package/dist/types/reconnection-manager/index.d.ts +136 -0
  358. package/dist/types/recording-controller/enums.d.ts +7 -0
  359. package/dist/types/recording-controller/index.d.ts +207 -0
  360. package/dist/types/recording-controller/util.d.ts +14 -0
  361. package/dist/types/roap/index.d.ts +86 -0
  362. package/dist/types/roap/request.d.ts +39 -0
  363. package/dist/types/roap/turnDiscovery.d.ts +155 -0
  364. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  365. package/dist/types/rtcMetrics/index.d.ts +61 -0
  366. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  367. package/dist/types/statsAnalyzer/index.d.ts +217 -0
  368. package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
  369. package/dist/types/transcription/index.d.ts +64 -0
  370. package/dist/types/webinar/collection.d.ts +16 -0
  371. package/dist/types/webinar/index.d.ts +5 -0
  372. package/dist/webinar/collection.js +44 -0
  373. package/dist/webinar/collection.js.map +1 -0
  374. package/dist/webinar/index.js +69 -0
  375. package/dist/webinar/index.js.map +1 -0
  376. package/internal-README.md +7 -6
  377. package/package.json +30 -21
  378. package/src/annotation/annotation.types.ts +50 -0
  379. package/src/annotation/constants.ts +36 -0
  380. package/src/annotation/index.ts +328 -0
  381. package/src/breakouts/README.md +220 -0
  382. package/src/breakouts/breakout.ts +188 -0
  383. package/src/breakouts/collection.ts +19 -0
  384. package/src/breakouts/edit-lock-error.ts +25 -0
  385. package/src/breakouts/events.ts +56 -0
  386. package/src/breakouts/index.ts +925 -0
  387. package/src/breakouts/request.ts +55 -0
  388. package/src/breakouts/utils.ts +57 -0
  389. package/src/common/{browser-detection.js → browser-detection.ts} +9 -6
  390. package/src/common/collection.ts +9 -7
  391. package/src/common/{config.js → config.ts} +1 -1
  392. package/src/common/errors/{captcha-error.js → captcha-error.ts} +11 -7
  393. package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +12 -7
  394. package/src/common/errors/{join-meeting.js → join-meeting.ts} +17 -8
  395. package/src/common/errors/{media.js → media.ts} +11 -7
  396. package/src/common/errors/no-meeting-info.ts +24 -0
  397. package/src/common/errors/parameter.ts +11 -7
  398. package/src/common/errors/{password-error.js → password-error.ts} +11 -7
  399. package/src/common/errors/{permission.js → permission.ts} +10 -6
  400. package/src/common/errors/reclaim-host-role-errors.ts +134 -0
  401. package/src/common/errors/{reconnection.js → reconnection.ts} +11 -7
  402. package/src/common/errors/{stats.js → stats.ts} +11 -7
  403. package/src/common/errors/{webex-errors.js → webex-errors.ts} +51 -8
  404. package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +4 -2
  405. package/src/common/events/{events-scope.js → events-scope.ts} +6 -2
  406. package/src/common/events/{events.js → events.ts} +5 -1
  407. package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +9 -5
  408. package/src/common/events/{util.js → util.ts} +2 -3
  409. package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
  410. package/src/common/logs/logger-proxy.ts +44 -0
  411. package/src/common/logs/{request.js → request.ts} +26 -9
  412. package/src/common/queue.ts +22 -9
  413. package/src/{config.js → config.ts} +19 -21
  414. package/src/constants.ts +296 -27
  415. package/src/controls-options-manager/constants.ts +5 -0
  416. package/src/controls-options-manager/enums.ts +18 -0
  417. package/src/controls-options-manager/index.ts +278 -0
  418. package/src/controls-options-manager/types.ts +59 -0
  419. package/src/controls-options-manager/util.ts +300 -0
  420. package/src/index.ts +45 -0
  421. package/src/interceptors/index.ts +3 -0
  422. package/src/interceptors/locusRetry.ts +67 -0
  423. package/src/interpretation/README.md +60 -0
  424. package/src/interpretation/collection.ts +19 -0
  425. package/src/interpretation/index.ts +349 -0
  426. package/src/interpretation/siLanguage.ts +18 -0
  427. package/src/locus-info/controlsUtils.ts +222 -0
  428. package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
  429. package/src/locus-info/{fullState.js → fullState.ts} +16 -12
  430. package/src/locus-info/{hostUtils.js → hostUtils.ts} +9 -8
  431. package/src/locus-info/{index.js → index.ts} +561 -119
  432. package/src/locus-info/{infoUtils.js → infoUtils.ts} +29 -10
  433. package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +97 -17
  434. package/src/locus-info/{parser.js → parser.ts} +303 -104
  435. package/src/locus-info/{selfUtils.js → selfUtils.ts} +199 -68
  436. package/src/media/index.ts +460 -0
  437. package/src/media/properties.ts +283 -0
  438. package/src/media/{util.js → util.ts} +2 -2
  439. package/src/mediaQualityMetrics/config.ts +249 -0
  440. package/src/meeting/in-meeting-actions.ts +199 -3
  441. package/src/meeting/index.ts +8494 -0
  442. package/src/meeting/locusMediaRequest.ts +313 -0
  443. package/src/meeting/muteState.ts +465 -0
  444. package/src/meeting/request.ts +912 -0
  445. package/src/meeting/request.type.ts +13 -0
  446. package/src/meeting/{state.js → state.ts} +50 -35
  447. package/src/meeting/util.ts +799 -0
  448. package/src/meeting/voicea-meeting.ts +122 -0
  449. package/src/meeting-info/{collection.js → collection.ts} +6 -2
  450. package/src/meeting-info/index.ts +210 -0
  451. package/src/meeting-info/meeting-info-v2.ts +423 -0
  452. package/src/meeting-info/{request.js → request.ts} +14 -4
  453. package/src/meeting-info/{util.js → util.ts} +70 -58
  454. package/src/meeting-info/{utilv2.js → utilv2.ts} +99 -82
  455. package/src/meetings/collection.ts +76 -0
  456. package/src/meetings/index.ts +1539 -0
  457. package/src/meetings/meetings.types.ts +12 -0
  458. package/src/meetings/{request.js → request.ts} +34 -25
  459. package/src/meetings/{util.js → util.ts} +133 -38
  460. package/src/member/{index.js → index.ts} +159 -56
  461. package/src/member/types.ts +38 -0
  462. package/src/member/util.ts +397 -0
  463. package/src/members/{collection.js → collection.ts} +10 -2
  464. package/src/members/{index.js → index.ts} +351 -146
  465. package/src/members/request.ts +255 -0
  466. package/src/members/types.ts +29 -0
  467. package/src/members/util.ts +353 -0
  468. package/src/metrics/{constants.js → constants.ts} +17 -6
  469. package/src/metrics/index.ts +73 -0
  470. package/src/multistream/mediaRequestManager.ts +341 -64
  471. package/src/multistream/receiveSlot.ts +69 -26
  472. package/src/multistream/receiveSlotManager.ts +66 -42
  473. package/src/multistream/remoteMedia.ts +40 -5
  474. package/src/multistream/remoteMediaGroup.ts +82 -3
  475. package/src/multistream/remoteMediaManager.ts +401 -81
  476. package/src/multistream/sendSlotManager.ts +199 -0
  477. package/src/networkQualityMonitor/{index.js → index.ts} +41 -29
  478. package/src/personal-meeting-room/{index.js → index.ts} +28 -19
  479. package/src/personal-meeting-room/{request.js → request.ts} +13 -4
  480. package/src/personal-meeting-room/{util.js → util.ts} +4 -4
  481. package/src/reachability/clusterReachability.ts +320 -0
  482. package/src/reachability/index.ts +371 -0
  483. package/src/reachability/request.ts +50 -35
  484. package/src/reachability/util.ts +24 -0
  485. package/src/reactions/constants.ts +4 -0
  486. package/src/reactions/reactions.ts +104 -0
  487. package/src/reactions/reactions.type.ts +62 -0
  488. package/src/reconnection-manager/index.ts +643 -0
  489. package/src/recording-controller/enums.ts +8 -0
  490. package/src/recording-controller/index.ts +332 -0
  491. package/src/recording-controller/util.ts +75 -0
  492. package/src/roap/index.ts +288 -0
  493. package/src/roap/request.ts +153 -0
  494. package/src/roap/turnDiscovery.ts +374 -70
  495. package/src/rtcMetrics/constants.ts +3 -0
  496. package/src/rtcMetrics/index.ts +166 -0
  497. package/src/statsAnalyzer/global.ts +37 -0
  498. package/src/statsAnalyzer/index.ts +1275 -0
  499. package/src/statsAnalyzer/mqaUtil.ts +440 -0
  500. package/src/transcription/{index.js → index.ts} +46 -39
  501. package/src/webinar/collection.ts +31 -0
  502. package/src/webinar/index.ts +62 -0
  503. package/test/integration/spec/converged-space-meetings.js +233 -0
  504. package/test/integration/spec/journey.js +791 -531
  505. package/test/integration/spec/space-meeting.js +391 -204
  506. package/test/integration/spec/transcription.js +7 -8
  507. package/test/unit/spec/annotation/index.ts +418 -0
  508. package/test/unit/spec/breakouts/breakout.ts +238 -0
  509. package/test/unit/spec/breakouts/collection.ts +15 -0
  510. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  511. package/test/unit/spec/breakouts/events.ts +89 -0
  512. package/test/unit/spec/breakouts/index.ts +1793 -0
  513. package/test/unit/spec/breakouts/request.ts +104 -0
  514. package/test/unit/spec/breakouts/utils.js +72 -0
  515. package/test/unit/spec/common/browser-detection.js +9 -28
  516. package/test/unit/spec/common/queue.js +31 -2
  517. package/test/unit/spec/controls-options-manager/index.js +287 -0
  518. package/test/unit/spec/controls-options-manager/util.js +582 -0
  519. package/test/unit/spec/fixture/locus.js +93 -90
  520. package/test/unit/spec/interceptors/locusRetry.ts +131 -0
  521. package/test/unit/spec/interpretation/collection.ts +15 -0
  522. package/test/unit/spec/interpretation/index.ts +625 -0
  523. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  524. package/test/unit/spec/locus-info/controlsUtils.js +325 -32
  525. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  526. package/test/unit/spec/locus-info/index.js +1458 -21
  527. package/test/unit/spec/locus-info/infoUtils.js +71 -40
  528. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  529. package/test/unit/spec/locus-info/lib/SeqCmp.json +529 -685
  530. package/test/unit/spec/locus-info/mediaSharesUtils.ts +41 -0
  531. package/test/unit/spec/locus-info/parser.js +119 -44
  532. package/test/unit/spec/locus-info/selfConstant.js +120 -103
  533. package/test/unit/spec/locus-info/selfUtils.js +291 -12
  534. package/test/unit/spec/media/index.ts +194 -111
  535. package/test/unit/spec/media/properties.ts +11 -11
  536. package/test/unit/spec/meeting/in-meeting-actions.ts +96 -3
  537. package/test/unit/spec/meeting/index.js +8616 -1921
  538. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  539. package/test/unit/spec/meeting/muteState.js +568 -207
  540. package/test/unit/spec/meeting/request.js +602 -82
  541. package/test/unit/spec/meeting/utils.js +867 -179
  542. package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
  543. package/test/unit/spec/meeting-info/index.js +300 -0
  544. package/test/unit/spec/meeting-info/meetinginfov2.js +631 -78
  545. package/test/unit/spec/meeting-info/request.js +7 -9
  546. package/test/unit/spec/meeting-info/util.js +11 -12
  547. package/test/unit/spec/meeting-info/utilv2.js +131 -74
  548. package/test/unit/spec/meetings/collection.js +27 -1
  549. package/test/unit/spec/meetings/index.js +1826 -374
  550. package/test/unit/spec/meetings/utils.js +243 -14
  551. package/test/unit/spec/member/index.js +61 -7
  552. package/test/unit/spec/member/util.js +526 -26
  553. package/test/unit/spec/members/index.js +536 -55
  554. package/test/unit/spec/members/request.js +228 -40
  555. package/test/unit/spec/members/utils.js +217 -4
  556. package/test/unit/spec/metrics/index.js +13 -68
  557. package/test/unit/spec/multistream/mediaRequestManager.ts +1032 -110
  558. package/test/unit/spec/multistream/receiveSlot.ts +77 -18
  559. package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
  560. package/test/unit/spec/multistream/remoteMedia.ts +40 -2
  561. package/test/unit/spec/multistream/remoteMediaGroup.ts +350 -5
  562. package/test/unit/spec/multistream/remoteMediaManager.ts +937 -65
  563. package/test/unit/spec/multistream/sendSlotManager.ts +274 -0
  564. package/test/unit/spec/networkQualityMonitor/index.js +24 -18
  565. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  566. package/test/unit/spec/reachability/clusterReachability.ts +279 -0
  567. package/test/unit/spec/reachability/index.ts +606 -26
  568. package/test/unit/spec/reachability/request.js +68 -0
  569. package/test/unit/spec/reachability/util.ts +40 -0
  570. package/test/unit/spec/reconnection-manager/index.js +222 -34
  571. package/test/unit/spec/recording-controller/index.js +306 -0
  572. package/test/unit/spec/recording-controller/util.js +229 -0
  573. package/test/unit/spec/roap/index.ts +238 -82
  574. package/test/unit/spec/roap/request.ts +255 -0
  575. package/test/unit/spec/roap/turnDiscovery.ts +707 -110
  576. package/test/unit/spec/rtcMetrics/index.ts +122 -0
  577. package/test/unit/spec/stats-analyzer/index.js +1331 -62
  578. package/test/unit/spec/webinar/collection.ts +13 -0
  579. package/test/unit/spec/webinar/index.ts +60 -0
  580. package/test/utils/cmr.js +44 -42
  581. package/test/utils/constants.js +9 -0
  582. package/test/utils/integrationTestUtils.js +46 -0
  583. package/test/utils/testUtils.js +63 -99
  584. package/test/utils/webex-config.js +22 -18
  585. package/test/utils/webex-test-users.js +65 -50
  586. package/tsconfig.json +6 -0
  587. package/dist/media/internal-media-core-wrapper.js +0 -22
  588. package/dist/media/internal-media-core-wrapper.js.map +0 -1
  589. package/dist/meeting/effectsState.js +0 -327
  590. package/dist/meeting/effectsState.js.map +0 -1
  591. package/dist/metrics/config.js +0 -301
  592. package/dist/metrics/config.js.map +0 -1
  593. package/dist/multistream/multistreamMedia.js +0 -116
  594. package/dist/multistream/multistreamMedia.js.map +0 -1
  595. package/dist/peer-connection-manager/util.js +0 -124
  596. package/dist/peer-connection-manager/util.js.map +0 -1
  597. package/src/common/logs/logger-proxy.js +0 -33
  598. package/src/index.js +0 -15
  599. package/src/locus-info/controlsUtils.js +0 -102
  600. package/src/media/index.js +0 -459
  601. package/src/media/internal-media-core-wrapper.ts +0 -9
  602. package/src/media/properties.js +0 -289
  603. package/src/mediaQualityMetrics/config.js +0 -382
  604. package/src/meeting/effectsState.js +0 -205
  605. package/src/meeting/index.js +0 -6284
  606. package/src/meeting/muteState.js +0 -318
  607. package/src/meeting/request.js +0 -684
  608. package/src/meeting/util.js +0 -506
  609. package/src/meeting-info/index.js +0 -131
  610. package/src/meeting-info/meeting-info-v2.js +0 -255
  611. package/src/meetings/collection.js +0 -40
  612. package/src/meetings/index.js +0 -1015
  613. package/src/member/util.js +0 -254
  614. package/src/members/request.js +0 -131
  615. package/src/members/util.js +0 -258
  616. package/src/metrics/config.js +0 -324
  617. package/src/metrics/index.js +0 -530
  618. package/src/multistream/multistreamMedia.ts +0 -92
  619. package/src/peer-connection-manager/util.ts +0 -117
  620. package/src/reachability/index.js +0 -464
  621. package/src/reconnection-manager/index.js +0 -519
  622. package/src/roap/index.js +0 -220
  623. package/src/roap/request.js +0 -127
  624. package/src/statsAnalyzer/global.js +0 -133
  625. package/src/statsAnalyzer/index.js +0 -1006
  626. package/src/statsAnalyzer/mqaUtil.js +0 -173
  627. package/test/unit/spec/meeting/effectsState.js +0 -291
  628. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
  629. /package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
@@ -1,168 +1,128 @@
1
1
  "use strict";
2
2
 
3
+ var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
3
4
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
+ var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
6
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
7
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
8
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
9
+ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
5
10
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
11
+ var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
7
12
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
13
  _Object$defineProperty(exports, "__esModule", {
10
14
  value: true
11
15
  });
12
-
13
16
  exports.default = void 0;
14
-
15
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
16
-
17
17
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
18
-
19
18
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
20
-
21
19
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
22
-
23
20
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
24
-
21
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
22
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
25
23
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
26
-
27
24
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
28
-
29
25
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
30
-
31
26
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
32
-
33
27
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
34
-
35
28
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
36
-
37
29
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
38
-
39
30
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
40
-
41
31
  require("@webex/internal-plugin-mercury");
42
-
43
32
  require("@webex/internal-plugin-conversation");
44
-
33
+ require("@webex/internal-plugin-metrics");
45
34
  var _webexCore = require("@webex/webex-core");
46
-
47
35
  var _internalMediaCore = require("@webex/internal-media-core");
48
-
36
+ var mediaHelpersModule = _interopRequireWildcard(require("@webex/media-helpers"));
49
37
  require("webrtc-adapter");
50
-
51
38
  var _metrics = _interopRequireDefault(require("../metrics"));
52
-
53
- var _config = require("../metrics/config");
54
-
55
39
  var _loggerConfig = _interopRequireDefault(require("../common/logs/logger-config"));
56
-
57
- var _config2 = _interopRequireDefault(require("../common/config"));
58
-
40
+ var _config = _interopRequireDefault(require("../common/config"));
59
41
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
60
-
61
42
  var _request = _interopRequireDefault(require("../common/logs/request"));
62
-
63
43
  var _triggerProxy = _interopRequireDefault(require("../common/events/trigger-proxy"));
64
-
65
44
  var _media = _interopRequireDefault(require("../media"));
66
-
67
45
  var _util = _interopRequireDefault(require("../meeting/util"));
68
-
69
46
  var _constants = require("../constants");
70
-
71
47
  var _constants2 = _interopRequireDefault(require("../metrics/constants"));
72
-
73
48
  var _meetingInfo = _interopRequireDefault(require("../meeting-info"));
74
-
75
49
  var _meetingInfoV = _interopRequireDefault(require("../meeting-info/meeting-info-v2"));
76
-
77
50
  var _meeting = _interopRequireDefault(require("../meeting"));
78
-
79
51
  var _personalMeetingRoom = _interopRequireDefault(require("../personal-meeting-room"));
80
-
81
52
  var _reachability = _interopRequireDefault(require("../reachability"));
82
-
83
- var _request2 = _interopRequireDefault(require("../meetings/request"));
84
-
53
+ var _request2 = _interopRequireDefault(require("./request"));
85
54
  var _passwordError = _interopRequireDefault(require("../common/errors/password-error"));
86
-
87
55
  var _captchaError = _interopRequireDefault(require("../common/errors/captcha-error"));
88
-
89
56
  var _collection = _interopRequireDefault(require("./collection"));
90
-
91
57
  var _util2 = _interopRequireDefault(require("./util"));
92
-
58
+ var _permission = _interopRequireDefault(require("../common/errors/permission"));
59
+ var _webexErrors = require("../common/errors/webex-errors");
60
+ var _noMeetingInfo = _interopRequireDefault(require("../common/errors/no-meeting-info"));
61
+ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
62
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
63
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
64
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
93
65
  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); }; }
94
-
95
66
  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; } }
96
-
97
67
  var mediaLogger;
98
-
99
68
  var MediaLogger = /*#__PURE__*/function () {
100
69
  function MediaLogger() {
101
70
  (0, _classCallCheck2.default)(this, MediaLogger);
102
71
  }
103
-
104
72
  (0, _createClass2.default)(MediaLogger, [{
105
73
  key: "info",
106
74
  value: function info() {
107
75
  var _LoggerProxy$logger;
108
-
109
76
  (_LoggerProxy$logger = _loggerProxy.default.logger).info.apply(_LoggerProxy$logger, arguments);
110
77
  }
111
78
  }, {
112
79
  key: "log",
113
80
  value: function log() {
114
81
  var _LoggerProxy$logger2;
115
-
116
82
  (_LoggerProxy$logger2 = _loggerProxy.default.logger).log.apply(_LoggerProxy$logger2, arguments);
117
83
  }
118
84
  }, {
119
85
  key: "error",
120
86
  value: function error() {
121
87
  var _LoggerProxy$logger3;
122
-
123
88
  (_LoggerProxy$logger3 = _loggerProxy.default.logger).error.apply(_LoggerProxy$logger3, arguments);
124
89
  }
125
90
  }, {
126
91
  key: "warn",
127
92
  value: function warn() {
128
93
  var _LoggerProxy$logger4;
129
-
130
94
  (_LoggerProxy$logger4 = _loggerProxy.default.logger).warn.apply(_LoggerProxy$logger4, arguments);
131
95
  }
132
96
  }, {
133
97
  key: "trace",
134
98
  value: function trace() {
135
99
  var _LoggerProxy$logger5;
136
-
137
100
  (_LoggerProxy$logger5 = _loggerProxy.default.logger).trace.apply(_LoggerProxy$logger5, arguments);
138
101
  }
139
102
  }, {
140
103
  key: "debug",
141
104
  value: function debug() {
142
105
  var _LoggerProxy$logger6;
143
-
144
106
  (_LoggerProxy$logger6 = _loggerProxy.default.logger).debug.apply(_LoggerProxy$logger6, arguments);
145
107
  }
146
108
  }]);
147
109
  return MediaLogger;
148
110
  }();
149
111
  /**
150
- * Meetings Ready Event
151
- * Emitted when the meetings instance on webex is ready
152
- * @event meetings:ready
153
- * @instance
154
- * @memberof Meetings
155
- */
156
-
112
+ * Meetings Ready Event
113
+ * Emitted when the meetings instance on webex is ready
114
+ * @event meetings:ready
115
+ * @instance
116
+ * @memberof Meetings
117
+ */
157
118
  /**
158
- * Meetings Network Disconnected Event
159
- * Emitted when the meetings instance is disconnected from
160
- * the internal mercury server
161
- * @event network:disconnected
162
- * @instance
163
- * @memberof Meetings
164
- */
165
-
119
+ * Meetings Network Disconnected Event
120
+ * Emitted when the meetings instance is disconnected from
121
+ * the internal mercury server
122
+ * @event network:disconnected
123
+ * @instance
124
+ * @memberof Meetings
125
+ */
166
126
  /**
167
127
  * Meetings Registered Event
168
128
  * Emitted when the meetings instance has been registered and listening
@@ -170,137 +130,297 @@ var MediaLogger = /*#__PURE__*/function () {
170
130
  * @instance
171
131
  * @memberof Meetings
172
132
  */
173
-
174
133
  /**
175
- * Meeting Removed Event
176
- * Emitted when a meeting was removed from the cache of meetings
177
- * @event meeting:removed
178
- * @instance
179
- * @type {Object}
180
- * @property {String} meetingId the removed meeting
181
- * @property {Object} response the server response
182
- * @property {String} type what type of meeting it was
183
- * @memberof Meetings
184
- */
185
-
134
+ * Meeting Removed Event
135
+ * Emitted when a meeting was removed from the cache of meetings
136
+ * @event meeting:removed
137
+ * @instance
138
+ * @type {Object}
139
+ * @property {String} meetingId the removed meeting
140
+ * @property {Object} response the server response
141
+ * @property {String} type what type of meeting it was
142
+ * @memberof Meetings
143
+ */
186
144
  /**
187
- * Meeting Added Event
188
- * Emitted when a meeting was added to the cache of meetings
189
- * @event meeting:added
190
- * @instance
191
- * @type {Object}
192
- * @property {String} meetingId the added meeting
193
- * @property {String} type what type of meeting it was
194
- * @memberof Meetings
195
- */
196
-
145
+ * Meeting Added Event
146
+ * Emitted when a meeting was added to the cache of meetings
147
+ * @event meeting:added
148
+ * @instance
149
+ * @type {Object}
150
+ * @property {String} meetingId the added meeting
151
+ * @property {String} type what type of meeting it was
152
+ * @memberof Meetings
153
+ */
197
154
  /**
198
- * Maintain a cache of meetings and sync with services.
199
- * @class
200
- */
201
-
202
-
155
+ * Maintain a cache of meetings and sync with services.
156
+ * @class
157
+ */
203
158
  var Meetings = /*#__PURE__*/function (_WebexPlugin) {
204
159
  (0, _inherits2.default)(Meetings, _WebexPlugin);
205
-
206
160
  var _super = _createSuper(Meetings);
207
-
208
161
  /**
209
- * Initializes the Meetings Plugin
210
- * @constructor
211
- * @public
212
- * @memberof Meetings
213
- */
162
+ * Initializes the Meetings Plugin
163
+ * @constructor
164
+ * @public
165
+ * @memberof Meetings
166
+ */
214
167
  function Meetings() {
215
168
  var _this;
216
-
217
169
  (0, _classCallCheck2.default)(this, Meetings);
218
-
219
170
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
220
171
  args[_key] = arguments[_key];
221
172
  }
222
-
223
173
  _this = _super.call.apply(_super, [this].concat(args));
224
- /**
225
- * The Meetings request to interact with server
226
- * @instance
227
- * @type {Object}
228
- * @private
229
- * @memberof Meetings
230
- */
231
174
 
175
+ /**
176
+ * The webrtc-core media helpers. This is a temporary solution required for the SDK sample app
177
+ * to be able to call media helper functions.
178
+ *
179
+ * @instance
180
+ * @type {Object}
181
+ * @private
182
+ * @memberof Meetings
183
+ */
184
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loggerRequest", void 0);
185
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "media", void 0);
186
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingCollection", void 0);
187
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "personalMeetingRoom", void 0);
188
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "preferredWebexSite", void 0);
189
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "reachability", void 0);
190
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "registered", void 0);
191
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "request", void 0);
192
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "geoHintInfo", void 0);
193
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingInfo", void 0);
194
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaHelpers", void 0);
195
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "breakoutLocusForHandleLater", void 0);
232
196
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.MEETINGS);
197
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createNoiseReductionEffect", /*#__PURE__*/function () {
198
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options) {
199
+ var authToken;
200
+ return _regenerator.default.wrap(function _callee$(_context) {
201
+ while (1) switch (_context.prev = _context.next) {
202
+ case 0:
203
+ // @ts-ignore
204
+ authToken = _this.webex.credentials.supertoken.access_token;
205
+ return _context.abrupt("return", new mediaHelpersModule.NoiseReductionEffect(_objectSpread({
206
+ authToken: authToken
207
+ }, options)));
208
+ case 2:
209
+ case "end":
210
+ return _context.stop();
211
+ }
212
+ }, _callee);
213
+ }));
214
+ return function (_x) {
215
+ return _ref.apply(this, arguments);
216
+ };
217
+ }());
218
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createVirtualBackgroundEffect", /*#__PURE__*/function () {
219
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
220
+ var authToken;
221
+ return _regenerator.default.wrap(function _callee2$(_context2) {
222
+ while (1) switch (_context2.prev = _context2.next) {
223
+ case 0:
224
+ // @ts-ignore
225
+ authToken = _this.webex.credentials.supertoken.access_token;
226
+ return _context2.abrupt("return", new mediaHelpersModule.VirtualBackgroundEffect(_objectSpread({
227
+ authToken: authToken
228
+ }, options)));
229
+ case 2:
230
+ case "end":
231
+ return _context2.stop();
232
+ }
233
+ }, _callee2);
234
+ }));
235
+ return function (_x2) {
236
+ return _ref2.apply(this, arguments);
237
+ };
238
+ }());
239
+ _this.mediaHelpers = mediaHelpersModule;
240
+
241
+ /**
242
+ * The Meetings request to interact with server
243
+ * @instance
244
+ * @type {Object}
245
+ * @private
246
+ * @memberof Meetings
247
+ */
248
+ // @ts-ignore
233
249
  _this.request = new _request2.default({}, {
234
250
  parent: _this.webex
235
251
  });
236
252
  /**
237
- * Log upload request helper
238
- * @instance
239
- * @type {Object}
240
- * @private
241
- * @memberof Meetings
242
- */
243
-
253
+ * Log upload request helper
254
+ * @instance
255
+ * @type {Object}
256
+ * @private
257
+ * @memberof Meetings
258
+ */
259
+ // @ts-ignore
244
260
  _this.loggerRequest = new _request.default({
245
261
  webex: _this.webex
246
262
  });
247
263
  _this.meetingCollection = new _collection.default();
248
264
  /**
249
- * The PersonalMeetingRoom object to interact with server
250
- * @instance
251
- * @type {Object}
252
- * @public
253
- * @memberof Meetings
254
- */
255
-
265
+ * The PersonalMeetingRoom object to interact with server
266
+ * @instance
267
+ * @type {Object}
268
+ * @public
269
+ * @memberof Meetings
270
+ */
256
271
  _this.personalMeetingRoom = null;
257
- /**
258
- * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
259
- * starts as null
260
- * @instance
261
- * @type {Object}
262
- * @private
263
- * @memberof Meetings
264
- */
265
272
 
266
- _this.reachability = null;
267
273
  /**
268
- * If the meetings plugin has been registered and listening via {@link Meetings#register}
269
- * @instance
270
- * @type {Boolean}
271
- * @public
272
- * @memberof Meetings
273
- */
274
+ * The Reachability object to interact with server
275
+ * starts as null
276
+ * @instance
277
+ * @type {Object}
278
+ * @private
279
+ * @memberof Meetings
280
+ */
281
+ // @ts-ignore
282
+ _this.reachability = new _reachability.default(_this.webex);
274
283
 
275
- _this.registered = false;
276
284
  /**
277
- * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}
278
- * @instance
279
- * @type {String}
280
- * @private
281
- * @memberof Meetings
282
- */
285
+ * If the meetings plugin has been registered and listening via {@link Meetings#register}
286
+ * @instance
287
+ * @type {Boolean}
288
+ * @public
289
+ * @memberof Meetings
290
+ */
291
+ _this.registered = false;
283
292
 
284
- _this.preferredWebexSite = '';
285
293
  /**
286
- * The public interface for the internal Media util files. These are helpful to expose outside the context
287
- * of a meeting so that a user can access media without creating a meeting instance.
288
- * @instance
289
- * @type {Object}
290
- * @private
291
- * @memberof Meetings
292
- */
294
+ * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}
295
+ * @instance
296
+ * @type {String}
297
+ * @private
298
+ * @memberof Meetings
299
+ */
300
+ _this.preferredWebexSite = '';
293
301
 
302
+ /**
303
+ * The public interface for the internal Media util files. These are helpful to expose outside the context
304
+ * of a meeting so that a user can access media without creating a meeting instance.
305
+ * @instance
306
+ * @type {Object}
307
+ * @private
308
+ * @memberof Meetings
309
+ */
294
310
  _this.media = {
295
- getUserMedia: _media.default.getUserMedia,
296
- getSupportedDevice: _media.default.getSupportedDevice
311
+ getUserMedia: _media.default.getUserMedia
297
312
  };
298
-
299
313
  _this.onReady();
300
-
301
314
  return _this;
302
315
  }
316
+
303
317
  /**
318
+ * check whether you need to handle this main session's locus data or not
319
+ * @param {Object} meeting current meeting data
320
+ * @param {Object} newLocus new locus data
321
+ * @returns {boolean}
322
+ * @private
323
+ * @memberof Meetings
324
+ */
325
+ (0, _createClass2.default)(Meetings, [{
326
+ key: "isNeedHandleMainLocus",
327
+ value: function isNeedHandleMainLocus(meeting, newLocus) {
328
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
329
+ var breakoutUrl = (_newLocus$controls = newLocus.controls) === null || _newLocus$controls === void 0 ? void 0 : (_newLocus$controls$br = _newLocus$controls.breakout) === null || _newLocus$controls$br === void 0 ? void 0 : _newLocus$controls$br.url;
330
+ var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
331
+ var isSelfJoined = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self = newLocus.self) === null || _newLocus$self === void 0 ? void 0 : _newLocus$self.state) === _constants._JOINED_;
332
+ var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self2 = newLocus.self) === null || _newLocus$self2 === void 0 ? void 0 : _newLocus$self2.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : _newLocus$self3.reason) === _constants._MOVED_;
333
+ // @ts-ignore
334
+ var deviceFromNewLocus = _util2.default.getThisDevice(newLocus, this.webex.internal.device.url);
335
+ var isResourceMovedOnThisDevice = (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.state) === _constants._LEFT_ && (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.reason) === _constants._MOVED_;
336
+ var isNewLocusJoinThisDevice = _util2.default.joinedOnThisDevice(meeting, newLocus,
337
+ // @ts-ignore
338
+ this.webex.internal.device.url);
339
+ var isBreakoutLocusJoinThisDevice = (breakoutLocus === null || breakoutLocus === void 0 ? void 0 : (_breakoutLocus$joined = breakoutLocus.joinedWith) === null || _breakoutLocus$joined === void 0 ? void 0 : _breakoutLocus$joined.correlationId) && breakoutLocus.joinedWith.correlationId === (meeting === null || meeting === void 0 ? void 0 : meeting.correlationId);
340
+ if (isSelfJoined && isNewLocusJoinThisDevice) {
341
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self this device shown as JOINED in the main session');
342
+ if (breakoutLocus !== null && breakoutLocus !== void 0 && breakoutLocus.joinedWith && deviceFromNewLocus) {
343
+ var _breakoutLocus$joined2, _deviceFromNewLocus$r;
344
+ var breakoutReplaceAt = ((_breakoutLocus$joined2 = breakoutLocus.joinedWith.replaces) === null || _breakoutLocus$joined2 === void 0 ? void 0 : _breakoutLocus$joined2.length) > 0 ? breakoutLocus.joinedWith.replaces[0].replaceAt : '';
345
+ var newLocusReplaceAt = ((_deviceFromNewLocus$r = deviceFromNewLocus.replaces) === null || _deviceFromNewLocus$r === void 0 ? void 0 : _deviceFromNewLocus$r.length) > 0 ? deviceFromNewLocus.replaces[0].replaceAt : '';
346
+ if (breakoutReplaceAt && newLocusReplaceAt && breakoutReplaceAt > newLocusReplaceAt) {
347
+ _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> this is expired main joined status locus_dto replacedAt ".concat(newLocusReplaceAt, " bo replacedAt ").concat(breakoutReplaceAt));
348
+ return false;
349
+ }
350
+ }
351
+ return true;
352
+ }
353
+ if (isBreakoutLocusJoinThisDevice) {
354
+ _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> there is active breakout session and joined on this device, and don't need to handle main session: ".concat(breakoutUrl));
355
+ return false;
356
+ }
357
+ if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed || isResourceMovedOnThisDevice)) {
358
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle');
359
+ return false;
360
+ }
361
+ if (isSelfJoined && isResourceMovedOnThisDevice) {
362
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle');
363
+ return false;
364
+ }
365
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> this is a normal main session locusDTO update case');
366
+ return true;
367
+ }
368
+
369
+ /**
370
+ * check whether you need to handle this locus data or not
371
+ * @param {Object} meeting old locus data
372
+ * @param {Object} newLocus new locus data
373
+ * @returns {boolean}
374
+ * @private
375
+ * @memberof Meetings
376
+ */
377
+ }, {
378
+ key: "isNeedHandleLocusDTO",
379
+ value: function isNeedHandleLocusDTO(meeting, newLocus) {
380
+ if (newLocus) {
381
+ var _newLocus$self5, _newLocus$self6;
382
+ var isNewLocusAsBreakout = _util2.default.isBreakoutLocusDTO(newLocus);
383
+ var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self6 = newLocus.self) === null || _newLocus$self6 === void 0 ? void 0 : _newLocus$self6.reason) === _constants._MOVED_;
384
+ if (!meeting) {
385
+ if (isNewLocusAsBreakout) {
386
+ var _newLocus$fullState, _newLocus$self7;
387
+ _loggerProxy.default.logger.log("Meetings:index#isNeedHandleLocusDTO --> the first breakout session locusDTO active status: ".concat((_newLocus$fullState = newLocus.fullState) === null || _newLocus$fullState === void 0 ? void 0 : _newLocus$fullState.active));
388
+ return ((_newLocus$self7 = newLocus.self) === null || _newLocus$self7 === void 0 ? void 0 : _newLocus$self7.state) === _constants._JOINED_;
389
+ }
390
+ return this.isNeedHandleMainLocus(meeting, newLocus);
391
+ }
392
+ if (!isNewLocusAsBreakout) {
393
+ return this.isNeedHandleMainLocus(meeting, newLocus);
394
+ }
395
+ return !isSelfMoved;
396
+ }
397
+ return true;
398
+ }
399
+
400
+ /**
401
+ * get corresponding meeting object by locus data
402
+ * @param {Object} data a locus event
403
+ * @param {String} data.locusUrl
404
+ * @param {Object} data.locus
405
+ * @returns {Object}
406
+ * @private
407
+ * @memberof Meetings
408
+ */
409
+ }, {
410
+ key: "getCorrespondingMeetingByLocus",
411
+ value: function getCorrespondingMeetingByLocus(data) {
412
+ var _data$locus$info, _data$locus, _data$locus$info2;
413
+ // getting meeting by correlationId. This will happen for the new event
414
+ // Either the locus
415
+ // TODO : Add check for the callBack Address
416
+ return this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) ||
417
+ // @ts-ignore
418
+ this.meetingCollection.getByKey(_constants.CORRELATION_ID,
419
+ // @ts-ignore
420
+ _util2.default.checkForCorrelationId(this.webex.internal.device.url, data.locus)) || this.meetingCollection.getByKey(_constants.SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) || ((_data$locus$info = data.locus.info) !== null && _data$locus$info !== void 0 && _data$locus$info.isUnifiedSpaceMeeting ? undefined : this.meetingCollection.getByKey(_constants.CONVERSATION_URL, data.locus.conversationUrl)) || this.meetingCollection.getByKey(_constants.MEETINGNUMBER, (_data$locus = data.locus) === null || _data$locus === void 0 ? void 0 : (_data$locus$info2 = _data$locus.info) === null || _data$locus$info2 === void 0 ? void 0 : _data$locus$info2.webExMeetingId);
421
+ }
422
+
423
+ /**
304
424
  * handle locus events and takes meeting actions with them as they come in
305
425
  * @param {Object} data a locus event
306
426
  * @param {String} data.locusUrl
@@ -311,79 +431,86 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
311
431
  * @private
312
432
  * @memberof Meetings
313
433
  */
314
-
315
-
316
- (0, _createClass2.default)(Meetings, [{
434
+ }, {
317
435
  key: "handleLocusEvent",
318
436
  value: function handleLocusEvent(data) {
319
- var _data$locus$info,
320
- _data$locus,
321
- _data$locus$replaces,
322
- _this2 = this;
323
-
437
+ var _data$locus2,
438
+ _data$locus2$replaces,
439
+ _this2 = this;
324
440
  var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
325
- var meeting = null; // getting meeting by correlationId. This will happen for the new event
326
- // Either the locus
327
- // TODO : Add check for the callBack Address
441
+ var meeting = this.getCorrespondingMeetingByLocus(data);
328
442
 
329
- meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) || this.meetingCollection.getByKey(_constants.CORRELATION_ID, _util2.default.checkForCorrelationId(this.webex.internal.device.url, data.locus)) || this.meetingCollection.getByKey(_constants.SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) || ((_data$locus$info = data.locus.info) !== null && _data$locus$info !== void 0 && _data$locus$info.isUnifiedSpaceMeeting ? undefined : this.meetingCollection.getByKey(_constants.CONVERSATION_URL, data.locus.conversationUrl)); // Special case when locus has got replaced, This only happend once if a replace locus exists
443
+ // Special case when locus has got replaced, This only happend once if a replace locus exists
330
444
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
331
445
 
332
- if (!meeting && ((_data$locus = data.locus) === null || _data$locus === void 0 ? void 0 : (_data$locus$replaces = _data$locus.replaces) === null || _data$locus$replaces === void 0 ? void 0 : _data$locus$replaces.length) > 0) {
446
+ if (!meeting && ((_data$locus2 = data.locus) === null || _data$locus2 === void 0 ? void 0 : (_data$locus2$replaces = _data$locus2.replaces) === null || _data$locus2$replaces === void 0 ? void 0 : _data$locus2$replaces.length) > 0) {
333
447
  // Always the last element in the replace is the active one
334
448
  meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);
335
449
  }
336
-
450
+ if (meeting && !_util2.default.isBreakoutLocusDTO(data.locus)) {
451
+ meeting.locusInfo.updateMainSessionLocusCache(data.locus);
452
+ }
453
+ if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
454
+ _loggerProxy.default.logger.log("Meetings:index#handleLocusEvent --> doesn't need to process locus event");
455
+ return;
456
+ }
337
457
  if (!meeting) {
338
458
  // TODO: create meeting when we get a meeting object
339
459
  // const checkForEnded = (locus) => {
340
460
  // TODO: you already ended the meeting but you got an event later
341
461
  // Mainly for 1:1 Callsor meeting
342
462
  // Happens mainly after refresh
463
+
343
464
  // 1:1 Meeting
344
465
  // 1) You ended a call before but you got a mercury event
345
466
  // Make sure end the call and cleanup the meeting only if the mercury
346
467
  // event says so
347
468
  // 2) Maintain lastSync time in the meetings object which helps to compare
348
469
  // If the meeting came befor or after the sync . ANy meeting start time before the sync time is invalid
470
+
349
471
  // For space Meeting
350
472
  // Check the locus object and see who has joined
473
+
351
474
  // };
352
475
  // rather then locus object change to locus url
476
+
353
477
  if (data.locus && data.locus.fullState && data.locus.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
354
478
  // just ignore the event as its already ended and not active
355
479
  _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
356
-
357
480
  return;
358
- } // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
359
- // Any future events will be neglected
481
+ }
360
482
 
483
+ // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
484
+ // Any future events will be neglected
361
485
 
362
486
  if (data.locus && data.locus.self && data.locus.self.state === _constants._LEFT_ && data.locus.self.removed === true) {
363
487
  // just ignore the event as its already ended and not active
364
488
  _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
365
-
366
489
  return;
367
490
  }
368
-
369
491
  this.create(data.locus, _constants._LOCUS_ID_, useRandomDelayForInfo).then(function (newMeeting) {
370
- meeting = newMeeting; // It's a new meeting so initialize the locus data
492
+ meeting = newMeeting;
371
493
 
494
+ // It's a new meeting so initialize the locus data
372
495
  meeting.locusInfo.initialSetup(data.locus);
496
+ _this2.checkHandleBreakoutLocus(data.locus);
373
497
  }).catch(function (e) {
374
- console.log(e);
498
+ _loggerProxy.default.logger.error(e);
375
499
  }).finally(function () {
376
500
  // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted
377
501
  // because the other user left so before sending 'added' event make sure it exists in the collection
502
+
378
503
  if (_this2.getMeetingByType(_constants._ID_, meeting.id)) {
379
- _metrics.default.postEvent({
380
- event: _config.eventType.REMOTE_STARTED,
381
- meeting: meeting,
382
- data: {
383
- trigger: _config.trigger.MERCURY_EVENT
504
+ // @ts-ignore
505
+ _this2.webex.internal.newMetrics.submitClientEvent({
506
+ name: 'client.call.remote-started',
507
+ payload: {
508
+ trigger: 'mercury-event'
509
+ },
510
+ options: {
511
+ meetingId: meeting.id
384
512
  }
385
513
  });
386
-
387
514
  _triggerProxy.default.trigger(_this2, {
388
515
  file: 'meetings',
389
516
  function: 'handleLocusEvent'
@@ -400,33 +527,33 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
400
527
  meeting.locusInfo.parse(meeting, data);
401
528
  }
402
529
  }
403
- /**
404
- * handles locus events through mercury that are not roap
405
- * @param {Object} envelope
406
- * @param {Object} envelope.data
407
- * @param {String} envelope.data.eventType
408
- * @returns {undefined}
409
- * @private
410
- * @memberof Meetings
411
- */
412
530
 
531
+ /**
532
+ * handles locus events through mercury that are not roap
533
+ * @param {Object} envelope
534
+ * @param {Object} envelope.data
535
+ * @param {String} envelope.data.eventType
536
+ * @returns {undefined}
537
+ * @private
538
+ * @memberof Meetings
539
+ */
413
540
  }, {
414
541
  key: "handleLocusMercury",
415
542
  value: function handleLocusMercury(envelope) {
416
543
  var data = envelope.data;
544
+ // eslint-disable-next-line @typescript-eslint/no-shadow
417
545
  var eventType = data.eventType;
418
-
419
546
  if (eventType && eventType !== _constants.LOCUSEVENT.MESSAGE_ROAP) {
420
547
  this.handleLocusEvent(data, true);
421
548
  }
422
549
  }
423
- /**
424
- * handles mecury offline event
425
- * @returns {undefined}
426
- * @private
427
- * @memberof Meetings
428
- */
429
550
 
551
+ /**
552
+ * handles mecury offline event
553
+ * @returns {undefined}
554
+ * @private
555
+ * @memberof Meetings
556
+ */
430
557
  }, {
431
558
  key: "handleMercuryOffline",
432
559
  value: function handleMercuryOffline() {
@@ -435,66 +562,76 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
435
562
  function: 'handleMercuryOffline'
436
563
  }, _constants.EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED);
437
564
  }
438
- /**
439
- * registers for locus and roap mercury events
440
- * @returns {undefined}
441
- * @private
442
- * @memberof Meetings
443
- */
444
565
 
566
+ /**
567
+ * registers for locus and roap mercury events
568
+ * @returns {undefined}
569
+ * @private
570
+ * @memberof Meetings
571
+ */
445
572
  }, {
446
573
  key: "listenForEvents",
447
574
  value: function listenForEvents() {
448
575
  var _this3 = this;
449
-
576
+ // @ts-ignore
450
577
  this.webex.internal.mercury.on(_constants.LOCUSEVENT.LOCUS_MERCURY, function (envelope) {
451
578
  _this3.handleLocusMercury(envelope);
452
579
  });
580
+ // @ts-ignore
453
581
  this.webex.internal.mercury.on(_constants.ROAP.ROAP_MERCURY, function (envelope) {
454
582
  _util2.default.handleRoapMercury(envelope, _this3.meetingCollection);
455
583
  });
584
+
585
+ // @ts-ignore
456
586
  this.webex.internal.mercury.on(_constants.ONLINE, function () {
457
- _this3.syncMeetings();
587
+ _this3.syncMeetings({
588
+ keepOnlyLocusMeetings: false
589
+ });
458
590
  });
591
+
592
+ // @ts-ignore
459
593
  this.webex.internal.mercury.on(_constants.OFFLINE, function () {
460
594
  _this3.handleMercuryOffline();
461
595
  });
462
596
  }
463
- /**
464
- * stops listening for locus and roap mercury events
465
- * @returns {undefined}
466
- * @private
467
- * @memberof Meetings
468
- */
469
597
 
598
+ /**
599
+ * stops listening for locus and roap mercury events
600
+ * @returns {undefined}
601
+ * @private
602
+ * @memberof Meetings
603
+ */
470
604
  }, {
471
605
  key: "stopListeningForEvents",
472
606
  value: function stopListeningForEvents() {
607
+ // @ts-ignore
473
608
  this.webex.internal.mercury.off(_constants.LOCUSEVENT.LOCUS_MERCURY);
609
+ // @ts-ignore
474
610
  this.webex.internal.mercury.off(_constants.ROAP.ROAP_MERCURY);
611
+ // @ts-ignore
475
612
  this.webex.internal.mercury.off(_constants.ONLINE);
476
613
  }
477
- /**
478
- * @returns {undefined}
479
- * @private
480
- * @memberof Meetings
481
- */
482
614
 
615
+ /**
616
+ * @returns {undefined}
617
+ * @private
618
+ * @memberof Meetings
619
+ */
483
620
  }, {
484
621
  key: "onReady",
485
622
  value: function onReady() {
486
623
  var _this4 = this;
487
-
624
+ // @ts-ignore
488
625
  this.webex.once(_constants.READY, function () {
489
- _config2.default.set(_this4.config);
490
-
626
+ // @ts-ignore
627
+ _config.default.set(_this4.config);
628
+ // @ts-ignore
491
629
  _loggerConfig.default.set(_this4.config.logging);
492
-
630
+ // @ts-ignore
493
631
  _loggerProxy.default.set(_this4.webex.logger);
494
-
495
632
  mediaLogger = new MediaLogger();
633
+ (0, _internalMediaCore.setLogger)(mediaLogger);
496
634
 
497
- _internalMediaCore.MediaConnection.setLogger(mediaLogger);
498
635
  /**
499
636
  * The MeetingInfo object to interact with server
500
637
  * @instance
@@ -502,198 +639,211 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
502
639
  * @private
503
640
  * @memberof Meetings
504
641
  */
505
-
506
-
507
- _this4.meetingInfo = _this4.config.experimental.enableUnifiedMeetings ? new _meetingInfoV.default(_this4.webex) : new _meetingInfo.default(_this4.webex);
642
+ // @ts-ignore
643
+ _this4.meetingInfo = _this4.config.experimental.enableUnifiedMeetings ?
644
+ // @ts-ignore
645
+ new _meetingInfoV.default(_this4.webex) :
646
+ // @ts-ignore
647
+ new _meetingInfo.default(_this4.webex);
648
+ // @ts-ignore
508
649
  _this4.personalMeetingRoom = new _personalMeetingRoom.default({
509
650
  meetingInfo: _this4.meetingInfo
510
- }, {
651
+ },
652
+ // @ts-ignore
653
+ {
511
654
  parent: _this4.webex
512
655
  });
513
-
514
656
  _triggerProxy.default.trigger(_this4, {
515
657
  file: 'meetings',
516
658
  function: 'onReady'
517
659
  }, _constants.EVENT_TRIGGERS.MEETINGS_READY);
518
-
519
660
  _util2.default.checkH264Support({
520
661
  disableNotifications: true
521
662
  });
522
-
523
- _metrics.default.initialSetup(_this4.meetingCollection, _this4.webex);
663
+ // @ts-ignore
664
+ _metrics.default.initialSetup(_this4.webex);
524
665
  });
525
666
  }
526
- /**
527
- * API to toggle unified meetings
528
- * @param {Boolean} changeState
529
- * @private
530
- * @memberof Meetings
531
- * @returns {undefined}
532
- */
533
667
 
668
+ /**
669
+ * API to toggle unified meetings
670
+ * @param {Boolean} changeState
671
+ * @private
672
+ * @memberof Meetings
673
+ * @returns {undefined}
674
+ */
534
675
  }, {
535
676
  key: "_toggleUnifiedMeetings",
536
677
  value: function _toggleUnifiedMeetings(changeState) {
537
678
  var _this$config, _this$config$experime;
538
-
539
679
  if (typeof changeState !== 'boolean') {
540
680
  return;
541
681
  }
542
-
682
+ // @ts-ignore
543
683
  if (((_this$config = this.config) === null || _this$config === void 0 ? void 0 : (_this$config$experime = _this$config.experimental) === null || _this$config$experime === void 0 ? void 0 : _this$config$experime.enableUnifiedMeetings) !== changeState) {
684
+ // @ts-ignore
544
685
  this.config.experimental.enableUnifiedMeetings = changeState;
686
+ // @ts-ignore
545
687
  this.meetingInfo = changeState ? new _meetingInfoV.default(this.webex) : new _meetingInfo.default(this.webex);
546
688
  }
547
689
  }
548
- /**
549
- * API to enable or disable TURN discovery
550
- * @param {Boolean} enable
551
- * @private
552
- * @memberof Meetings
553
- * @returns {undefined}
554
- */
555
-
556
- }, {
557
- key: "_toggleTurnDiscovery",
558
- value: function _toggleTurnDiscovery(enable) {
559
- if (typeof enable !== 'boolean') {
560
- return;
561
- }
562
690
 
563
- this.config.experimental.enableTurnDiscovery = enable;
564
- }
565
691
  /**
566
- * API to toggle starting adhoc meeting
567
- * @param {Boolean} changeState
568
- * @private
569
- * @memberof Meetings
570
- * @returns {undefined}
571
- */
572
-
692
+ * API to toggle starting adhoc meeting
693
+ * @param {Boolean} changeState
694
+ * @private
695
+ * @memberof Meetings
696
+ * @returns {undefined}
697
+ */
573
698
  }, {
574
699
  key: "_toggleAdhocMeetings",
575
700
  value: function _toggleAdhocMeetings(changeState) {
576
701
  var _this$config2, _this$config2$experim;
577
-
578
702
  if (typeof changeState !== 'boolean') {
579
703
  return;
580
704
  }
581
-
705
+ // @ts-ignore
582
706
  if (((_this$config2 = this.config) === null || _this$config2 === void 0 ? void 0 : (_this$config2$experim = _this$config2.experimental) === null || _this$config2$experim === void 0 ? void 0 : _this$config2$experim.enableAdhocMeetings) !== changeState) {
707
+ // @ts-ignore
583
708
  this.config.experimental.enableAdhocMeetings = changeState;
584
709
  }
585
710
  }
711
+
586
712
  /**
587
- * Explicitly sets up the meetings plugin by registering
588
- * the device, connecting to mercury, and listening for locus events.
589
- *
590
- * @returns {Promise}
591
- * @public
592
- * @memberof Meetings
593
- */
713
+ * API to toggle TCP reachability, needs to be called before webex.meetings.register()
714
+ * @param {Boolean} newValue
715
+ * @private
716
+ * @memberof Meetings
717
+ * @returns {undefined}
718
+ */
719
+ }, {
720
+ key: "_toggleTcpReachability",
721
+ value: function _toggleTcpReachability(newValue) {
722
+ if (typeof newValue !== 'boolean') {
723
+ return;
724
+ }
725
+ // @ts-ignore
726
+ if (this.config.experimental.enableTcpReachability !== newValue) {
727
+ // @ts-ignore
728
+ this.config.experimental.enableTcpReachability = newValue;
729
+ }
730
+ }
594
731
 
732
+ /**
733
+ * Explicitly sets up the meetings plugin by registering
734
+ * the device, connecting to mercury, and listening for locus events.
735
+ *
736
+ * @returns {Promise}
737
+ * @public
738
+ * @memberof Meetings
739
+ */
595
740
  }, {
596
741
  key: "register",
597
742
  value: function register() {
598
743
  var _this5 = this;
599
-
744
+ // @ts-ignore
600
745
  if (!this.webex.canAuthorize) {
601
746
  _loggerProxy.default.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');
602
-
603
747
  return _promise.default.reject(new Error('SDK cannot authorize'));
604
748
  }
605
-
606
749
  if (this.registered) {
607
750
  _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');
608
-
609
751
  return _promise.default.resolve();
610
752
  }
611
-
612
753
  return _promise.default.all([this.fetchUserPreferredWebexSite(), this.getGeoHint(), this.startReachability().catch(function (error) {
613
754
  _loggerProxy.default.logger.error("Meetings:index#register --> GDM error, ".concat(error.message));
614
- }), this.webex.internal.device.register().then(function () {
615
- return _loggerProxy.default.logger.info("Meetings:index#register --> INFO, Device registered ".concat(_this5.webex.internal.device.url));
616
- }).then(function () {
755
+ }),
756
+ // @ts-ignore
757
+ this.webex.internal.device.register()
758
+ // @ts-ignore
759
+ .then(function () {
760
+ return _loggerProxy.default.logger.info( // @ts-ignore
761
+ "Meetings:index#register --> INFO, Device registered ".concat(_this5.webex.internal.device.url));
762
+ })
763
+ // @ts-ignore
764
+ .then(function () {
617
765
  return _this5.webex.internal.mercury.connect();
618
766
  }), _util2.default.checkH264Support.call(this)]).then(function () {
619
767
  _this5.listenForEvents();
620
-
621
768
  _triggerProxy.default.trigger(_this5, {
622
769
  file: 'meetings',
623
770
  function: 'register'
624
771
  }, _constants.EVENT_TRIGGERS.MEETINGS_REGISTERED);
625
-
626
772
  _this5.registered = true;
627
-
628
773
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETINGS_REGISTRATION_SUCCESS);
629
774
  }).catch(function (error) {
630
775
  _loggerProxy.default.logger.error("Meetings:index#register --> ERROR, Unable to register, ".concat(error.message));
631
-
632
776
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETINGS_REGISTRATION_FAILED, {
633
777
  reason: error.message,
634
778
  stack: error.stack
635
779
  });
636
-
637
780
  return _promise.default.reject(error);
638
781
  });
639
782
  }
640
- /**
641
- * Explicitly tears down the meetings plugin by deregistering
642
- * the device, disconnecting from mercury, and stops listening to locus events
643
- *
644
- * @returns {Promise}
645
- * @public
646
- * @memberof Meetings
647
- */
648
783
 
784
+ /**
785
+ * Explicitly tears down the meetings plugin by deregistering
786
+ * the device, disconnecting from mercury, and stops listening to locus events
787
+ *
788
+ * @returns {Promise}
789
+ * @public
790
+ * @memberof Meetings
791
+ */
649
792
  }, {
650
793
  key: "unregister",
651
794
  value: function unregister() {
652
795
  var _this6 = this;
653
-
654
796
  if (!this.registered) {
655
797
  _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
656
-
657
798
  return _promise.default.resolve();
658
799
  }
659
-
660
800
  this.stopListeningForEvents();
661
- return this.webex.internal.mercury.disconnect().then(function () {
662
- return _this6.webex.internal.device.unregister();
663
- }).then(function () {
664
- _triggerProxy.default.trigger(_this6, {
665
- file: 'meetings',
666
- function: 'unregister'
667
- }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
668
-
669
- _this6.registered = false;
670
- });
801
+ return (
802
+ // @ts-ignore
803
+ this.webex.internal.mercury.disconnect()
804
+ // @ts-ignore
805
+ .then(function () {
806
+ return _this6.webex.internal.device.unregister();
807
+ }).then(function () {
808
+ _triggerProxy.default.trigger(_this6, {
809
+ file: 'meetings',
810
+ function: 'unregister'
811
+ }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
812
+ _this6.registered = false;
813
+ })
814
+ );
671
815
  }
672
- /**
673
- * Uploads logs to the webex services for tracking
674
- * @param {Object} [options={}]
675
- * @param {String} [options.callStart] Call Start Time
676
- * @param {String} [options.feedbackId] ID used for tracking
677
- * @param {String} [options.locusId]
678
- * @param {String} [options.correlationId]
679
- * @param {String} [options.meetingId] webex meeting ID
680
- * @param {String} [options.userId] userId
681
- * @param {String} [options.orgId] org id
682
- * @returns {String} feedback ID logs were submitted under
683
- */
684
816
 
817
+ /**
818
+ * Creates a noise reduction effect
819
+ *
820
+ * @param {INoiseReductionEffect} options optional custom effect options
821
+ * @returns {Promise<effect>} noise reduction effect.
822
+ * @public
823
+ * @memberof Meetings
824
+ */
685
825
  }, {
686
826
  key: "uploadLogs",
687
- value: function uploadLogs() {
827
+ value:
828
+ /**
829
+ * Uploads logs to the webex services for tracking
830
+ * @param {Object} [options={}]
831
+ * @param {String} [options.callStart] Call Start Time
832
+ * @param {String} [options.feedbackId] ID used for tracking
833
+ * @param {String} [options.locusId]
834
+ * @param {String} [options.correlationId]
835
+ * @param {String} [options.meetingId] webex meeting ID
836
+ * @param {String} [options.userId] userId
837
+ * @param {String} [options.orgId] org id
838
+ * @returns {String} feedback ID logs were submitted under
839
+ */
840
+ function uploadLogs() {
688
841
  var _this7 = this;
689
-
690
842
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
691
-
692
843
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> uploading logs');
693
-
694
844
  return this.loggerRequest.uploadLogs(options).then(function (uploadResult) {
695
845
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);
696
-
846
+ _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_SUCCESS, options);
697
847
  _triggerProxy.default.trigger(_this7, {
698
848
  file: 'meetings',
699
849
  function: 'uploadLogs'
@@ -701,9 +851,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
701
851
  meetingId: options.meetingId,
702
852
  details: uploadResult
703
853
  });
854
+ return uploadResult;
704
855
  }).catch(function (uploadError) {
705
856
  _loggerProxy.default.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);
706
-
707
857
  _triggerProxy.default.trigger(_this7, {
708
858
  file: 'meetings',
709
859
  function: 'uploadLogs'
@@ -711,118 +861,113 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
711
861
  meetingId: options.meetingId,
712
862
  reason: uploadError
713
863
  });
714
-
715
- _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_FAILURE, {
716
- meetingId: options.meetingsId,
864
+ _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_FAILURE, _objectSpread(_objectSpread({}, options), {}, {
717
865
  reason: uploadError.message,
718
866
  stack: uploadError.stack,
719
867
  code: uploadError.code
720
- });
868
+ }));
721
869
  });
722
870
  }
723
- /**
724
- * initializes the reachability instance for Meetings
725
- * @returns {undefined}
726
- * @public
727
- * @memberof Meetings
728
- */
729
871
 
730
- }, {
731
- key: "setReachability",
732
- value: function setReachability() {
733
- this.reachability = new _reachability.default(this.webex);
734
- }
735
872
  /**
736
- * gets the reachability instance for Meetings
737
- * @returns {Reachability}
738
- * @public
739
- * @memberof Meetings
740
- */
741
-
873
+ * gets the reachability instance for Meetings
874
+ * @returns {Reachability}
875
+ * @public
876
+ * @memberof Meetings
877
+ */
742
878
  }, {
743
879
  key: "getReachability",
744
880
  value: function getReachability() {
745
881
  return this.reachability;
746
882
  }
747
- /**
748
- * initializes and starts gathering reachability for Meetings
749
- * @returns {Promise}
750
- * @public
751
- * @memberof Meetings
752
- */
753
883
 
884
+ /**
885
+ * initializes and starts gathering reachability for Meetings
886
+ * @returns {Promise}
887
+ * @public
888
+ * @memberof Meetings
889
+ */
754
890
  }, {
755
891
  key: "startReachability",
756
892
  value: function startReachability() {
757
- if (!this.reachability) {
758
- this.setReachability();
759
- }
760
-
761
893
  return this.getReachability().gatherReachability();
762
894
  }
763
- /**
764
- * Get geoHint for info for meetings
765
- * @returns {Promise}
766
- * @private
767
- * @memberof Meetings
768
- */
769
895
 
896
+ /**
897
+ * Get geoHint for info for meetings
898
+ * @returns {Promise}
899
+ * @private
900
+ * @memberof Meetings
901
+ */
770
902
  }, {
771
903
  key: "getGeoHint",
772
904
  value: function getGeoHint() {
773
905
  var _this8 = this;
774
-
775
906
  return this.request.fetchGeoHint().then(function (res) {
776
907
  _this8.geoHintInfo = res;
777
908
  });
778
909
  }
779
- /**
780
- * Fetch user preferred webex site information
781
- * This also has other infomation about the user
782
- * @returns {Promise}
783
- * @private
784
- * @memberof Meetings
785
- */
786
910
 
911
+ /**
912
+ * Fetch user preferred webex site information
913
+ * This also has other infomation about the user
914
+ * @returns {Promise}
915
+ * @private
916
+ * @memberof Meetings
917
+ */
787
918
  }, {
788
919
  key: "fetchUserPreferredWebexSite",
789
920
  value: function fetchUserPreferredWebexSite() {
790
921
  var _this9 = this;
791
-
792
922
  return this.request.getMeetingPreferences().then(function (res) {
793
923
  if (res) {
794
924
  _this9.preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
795
925
  }
926
+
927
+ // fall back to getting the preferred site from the user information
928
+ if (!_this9.preferredWebexSite) {
929
+ // @ts-ignore
930
+ return _this9.webex.internal.user.get().then(function (user) {
931
+ var _user$userPreferences, _user$userPreferences2;
932
+ var preferredWebexSite = user === null || user === void 0 ? void 0 : (_user$userPreferences = user.userPreferences) === null || _user$userPreferences === void 0 ? void 0 : (_user$userPreferences2 = _user$userPreferences.userPreferencesItems) === null || _user$userPreferences2 === void 0 ? void 0 : _user$userPreferences2.preferredWebExSite;
933
+ if (preferredWebexSite) {
934
+ _this9.preferredWebexSite = preferredWebexSite;
935
+ } else {
936
+ throw new Error('site not found');
937
+ }
938
+ }).catch(function () {
939
+ _loggerProxy.default.logger.error('Failed to fetch preferred site from user - no site will be set');
940
+ });
941
+ }
942
+ return _promise.default.resolve();
796
943
  });
797
944
  }
798
- /**
799
- * gets the personal meeting room instance, for saved PMR values for this user
800
- * @returns {PersonalMeetingRoom}
801
- * @public
802
- * @memberof Meetings
803
- */
804
945
 
946
+ /**
947
+ * gets the personal meeting room instance, for saved PMR values for this user
948
+ * @returns {PersonalMeetingRoom}
949
+ * @public
950
+ * @memberof Meetings
951
+ */
805
952
  }, {
806
953
  key: "getPersonalMeetingRoom",
807
954
  value: function getPersonalMeetingRoom() {
808
955
  return this.personalMeetingRoom;
809
956
  }
810
- /**
811
- * @param {Meeting} meeting
812
- * @param {Object} reason
813
- * @param {String} type
814
- * @returns {Undefined}
815
- * @private
816
- * @memberof Meetings
817
- */
818
957
 
958
+ /**
959
+ * @param {Meeting} meeting
960
+ * @param {Object} reason
961
+ * @param {String} type
962
+ * @returns {Undefined}
963
+ * @private
964
+ * @memberof Meetings
965
+ */
819
966
  }, {
820
967
  key: "destroy",
821
968
  value: function destroy(meeting, reason) {
822
969
  _util.default.cleanUp(meeting);
823
-
824
970
  this.meetingCollection.delete(meeting.id);
825
-
826
971
  _triggerProxy.default.trigger(this, {
827
972
  file: 'meetings',
828
973
  function: 'destroy'
@@ -831,73 +976,99 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
831
976
  reason: reason
832
977
  });
833
978
  }
834
- /**
835
- * Create a meeting.
836
- * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}
837
- * @param {string} [type] - the optional specified type, such as locusId
838
- * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
839
- * @returns {Promise<Meeting>} A new Meeting.
840
- * @public
841
- * @memberof Meetings
842
- */
843
979
 
980
+ /**
981
+ * Create a meeting or return an existing meeting.
982
+ *
983
+ * When meeting info passed it should be complete, e.g.: fetched after password or captcha provided
984
+ *
985
+ * @param {string} destination - sipURL, phonenumber, or locus object}
986
+ * @param {string} [type] - the optional specified type, such as locusId
987
+ * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
988
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
989
+ * @param {string} correlationId - the optional specified correlationId (callStateForMetrics.correlationId can be provided instead)
990
+ * @param {Boolean} failOnMissingMeetingInfo - whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
991
+ * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
992
+ * @param {Object} [meetingInfo] - Pre-fetched complete meeting info
993
+ * @param {String} [meetingLookupUrl] - meeting info prefetch url
994
+ * @returns {Promise<Meeting>} A new Meeting.
995
+ * @public
996
+ * @memberof Meetings
997
+ */
844
998
  }, {
845
999
  key: "create",
846
1000
  value: function create(destination) {
847
1001
  var _this10 = this;
848
-
849
1002
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
850
1003
  var useRandomDelayForInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1004
+ var infoExtraParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1005
+ var correlationId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
1006
+ var failOnMissingMeetingInfo = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1007
+ var callStateForMetrics = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : undefined;
1008
+ var meetingInfo = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : undefined;
1009
+ var meetingLookupUrl = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : undefined;
851
1010
  // TODO: type should be from a dictionary
1011
+
852
1012
  // Validate meeting information based on the provided destination and
853
1013
  // type. This must be performed prior to determining if the meeting is
854
1014
  // found in the collection, as we mutate the destination for hydra person
855
1015
  // id values.
856
- return this.meetingInfo.fetchInfoOptions(destination, type) // Catch a failure to fetch info options.
1016
+ if (correlationId) {
1017
+ callStateForMetrics = _objectSpread(_objectSpread({}, callStateForMetrics || {}), {}, {
1018
+ correlationId: correlationId
1019
+ });
1020
+ }
1021
+ return this.meetingInfo.fetchInfoOptions(destination, type)
1022
+ // Catch a failure to fetch info options.
857
1023
  .catch(function (error) {
858
- _loggerProxy.default.logger.info("Meetings:index#create --> INFO, unable to determine info options: ".concat(error.message));
1024
+ _loggerProxy.default.logger.error("Meetings:index#create --> ERROR, unable to determine info options: ".concat(error.message));
1025
+ if (error instanceof _webexErrors.SpaceIDDeprecatedError) {
1026
+ throw new _webexErrors.SpaceIDDeprecatedError();
1027
+ }
859
1028
  }).then(function () {
860
1029
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
861
1030
  // Normalize the destination.
862
- var targetDest = options.destination || destination; // check for the conversation URL then sip Url
1031
+ var targetDest = options.destination || destination;
863
1032
 
1033
+ // check for the conversation URL then sip Url
864
1034
  var meeting = null;
865
-
866
1035
  if (type === _constants._CONVERSATION_URL_ || options.type === _constants._CONVERSATION_URL_) {
867
1036
  var foundMeeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
868
-
869
1037
  if (foundMeeting) {
870
- var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting; // If the found meeting is not a calendar meeting, return that meeting.
871
- // This allows for the creation of instant-meetings when calendar meetings are present.
1038
+ var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
872
1039
 
1040
+ // If the found meeting is not a calendar meeting, return that meeting.
1041
+ // This allows for the creation of instant-meetings when calendar meetings are present.
873
1042
  if (foundMeetingIsNotCalendarMeeting) {
874
1043
  meeting = foundMeeting;
875
1044
  }
876
1045
  }
877
- } // Attempt to collect the meeting if it exists.
878
-
1046
+ }
879
1047
 
1048
+ // Attempt to collect the meeting if it exists.
880
1049
  if (!meeting) {
881
1050
  meeting = _this10.meetingCollection.getByKey(_constants.SIP_URI, targetDest);
882
- } // Validate if a meeting was found.
883
-
1051
+ }
884
1052
 
1053
+ // Validate if a meeting was found.
885
1054
  if (!meeting) {
886
1055
  // Create a meeting based on the normalized destination and type.
887
- return _this10.createMeeting(targetDest, type, useRandomDelayForInfo).then(function (createdMeeting) {
1056
+ return _this10.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo, meetingInfo, meetingLookupUrl).then(function (createdMeeting) {
888
1057
  // If the meeting was successfully created.
889
1058
  if (createdMeeting && createdMeeting.on) {
890
1059
  // Create a destruction event for the meeting.
891
1060
  createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
1061
+ // @ts-ignore
892
1062
  if (_this10.config.autoUploadLogs) {
893
- var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4;
894
-
1063
+ var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4, _createdMeeting$locus5, _createdMeeting$locus6;
895
1064
  _this10.uploadLogs({
896
1065
  callStart: (_createdMeeting$locus = createdMeeting.locusInfo) === null || _createdMeeting$locus === void 0 ? void 0 : (_createdMeeting$locus2 = _createdMeeting$locus.fullState) === null || _createdMeeting$locus2 === void 0 ? void 0 : _createdMeeting$locus2.lastActive,
1066
+ locussessionid: (_createdMeeting$locus3 = createdMeeting.locusInfo) === null || _createdMeeting$locus3 === void 0 ? void 0 : (_createdMeeting$locus4 = _createdMeeting$locus3.fullState) === null || _createdMeeting$locus4 === void 0 ? void 0 : _createdMeeting$locus4.sessionId,
897
1067
  correlationId: createdMeeting.correlationId,
898
1068
  feedbackId: createdMeeting.correlationId,
899
1069
  locusId: createdMeeting.locusId,
900
- meetingId: (_createdMeeting$locus3 = createdMeeting.locusInfo) === null || _createdMeeting$locus3 === void 0 ? void 0 : (_createdMeeting$locus4 = _createdMeeting$locus3.info) === null || _createdMeeting$locus4 === void 0 ? void 0 : _createdMeeting$locus4.webExMeetingId
1070
+ meetingId: (_createdMeeting$locus5 = createdMeeting.locusInfo) === null || _createdMeeting$locus5 === void 0 ? void 0 : (_createdMeeting$locus6 = _createdMeeting$locus5.info) === null || _createdMeeting$locus6 === void 0 ? void 0 : _createdMeeting$locus6.webExMeetingId,
1071
+ autoupload: true
901
1072
  }).then(function () {
902
1073
  return _this10.destroy(createdMeeting, payload.reason);
903
1074
  });
@@ -906,197 +1077,227 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
906
1077
  }
907
1078
  });
908
1079
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
1080
+ // @ts-ignore
909
1081
  if (_this10.config.autoUploadLogs) {
910
- var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4;
911
-
1082
+ var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4, _meetingInstance$locu5, _meetingInstance$locu6;
912
1083
  _this10.uploadLogs({
913
1084
  callStart: meetingInstance === null || meetingInstance === void 0 ? void 0 : (_meetingInstance$locu = meetingInstance.locusInfo) === null || _meetingInstance$locu === void 0 ? void 0 : (_meetingInstance$locu2 = _meetingInstance$locu.fullState) === null || _meetingInstance$locu2 === void 0 ? void 0 : _meetingInstance$locu2.lastActive,
1085
+ locussessionid: meetingInstance === null || meetingInstance === void 0 ? void 0 : (_meetingInstance$locu3 = meetingInstance.locusInfo) === null || _meetingInstance$locu3 === void 0 ? void 0 : (_meetingInstance$locu4 = _meetingInstance$locu3.fullState) === null || _meetingInstance$locu4 === void 0 ? void 0 : _meetingInstance$locu4.sessionId,
914
1086
  correlationId: meetingInstance.correlationId,
915
1087
  feedbackId: meetingInstance.correlationId,
916
1088
  locusId: meetingInstance.locusId,
917
- meetingId: (_meetingInstance$locu3 = meetingInstance.locusInfo) === null || _meetingInstance$locu3 === void 0 ? void 0 : (_meetingInstance$locu4 = _meetingInstance$locu3.info) === null || _meetingInstance$locu4 === void 0 ? void 0 : _meetingInstance$locu4.webExMeetingId
1089
+ meetingId: (_meetingInstance$locu5 = meetingInstance.locusInfo) === null || _meetingInstance$locu5 === void 0 ? void 0 : (_meetingInstance$locu6 = _meetingInstance$locu5.info) === null || _meetingInstance$locu6 === void 0 ? void 0 : _meetingInstance$locu6.webExMeetingId,
1090
+ autoupload: true
918
1091
  });
919
1092
  }
920
1093
  });
921
1094
  } else {
922
1095
  _loggerProxy.default.logger.error("Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ".concat(meeting));
923
- } // Return the newly created meeting.
924
-
1096
+ }
925
1097
 
1098
+ // Return the newly created meeting.
926
1099
  return _promise.default.resolve(createdMeeting);
927
1100
  });
928
- } // Return the existing meeting.
929
-
1101
+ }
1102
+ meeting.setCallStateForMetrics(callStateForMetrics);
930
1103
 
1104
+ // Return the existing meeting.
931
1105
  return _promise.default.resolve(meeting);
932
1106
  });
933
1107
  }
934
- /**
935
- * @param {String} destination see create()
936
- * @param {String} type see create()
937
- * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
938
- * @returns {Promise} a new meeting instance complete with meeting info and destination
939
- * @private
940
- * @memberof Meetings
941
- */
942
1108
 
1109
+ /**
1110
+ * Create meeting
1111
+ *
1112
+ * When meeting info passed it should be complete, e.g.: fetched after password or captcha provided
1113
+ *
1114
+ * @param {String} destination see create()
1115
+ * @param {String} type see create()
1116
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
1117
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
1118
+ * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
1119
+ * @param {Boolean} failOnMissingMeetingInfo - whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
1120
+ * @param {Object} [meetingInfo] - Pre-fetched complete meeting info
1121
+ * @param {String} [meetingLookupUrl] - meeting info prefetch url
1122
+ * @returns {Promise} a new meeting instance complete with meeting info and destination
1123
+ * @private
1124
+ * @memberof Meetings
1125
+ */
943
1126
  }, {
944
1127
  key: "createMeeting",
945
1128
  value: function () {
946
- var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(destination) {
1129
+ var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(destination) {
947
1130
  var type,
948
- useRandomDelayForInfo,
949
- meeting,
950
- _destination$fullStat,
951
- waitingTime,
952
- startTime,
953
- startTimeDate,
954
- startTimeDatestamp,
955
- timeToStart,
956
- maxWaitingTime,
957
- isMeetingActive,
958
- enableUnifiedMeetings,
959
- meetingAddedType,
960
- _args = arguments;
961
-
962
- return _regenerator.default.wrap(function _callee$(_context) {
963
- while (1) {
964
- switch (_context.prev = _context.next) {
965
- case 0:
966
- type = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
967
- useRandomDelayForInfo = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
968
- meeting = new _meeting.default({
969
- userId: this.webex.internal.device.userId,
970
- deviceUrl: this.webex.internal.device.url,
971
- orgId: this.webex.internal.device.orgId,
972
- locus: type === _constants._LOCUS_ID_ ? destination : null,
973
- // pass the locus object if present
974
- meetingInfoProvider: this.meetingInfo,
975
- destination: destination,
976
- destinationType: type
977
- }, {
978
- parent: this.webex
979
- });
980
- this.meetingCollection.set(meeting);
981
- _context.prev = 4;
982
- // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
983
- // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
984
- // between 5 and 2 min (random between 3 minutes) before the meeting starts
985
- // to avoid a spike in traffic to the wbxappi service
986
- waitingTime = 0;
987
-
988
- if (destination.meeting) {
989
- startTime = destination.meeting.startTime;
990
- startTimeDate = new Date(startTime);
991
- startTimeDatestamp = startTimeDate.getTime();
992
- timeToStart = startTimeDatestamp - (0, _now.default)();
993
- maxWaitingTime = Math.max(Math.min(timeToStart, _constants.MAX_RANDOM_DELAY_FOR_MEETING_INFO), 0);
994
- waitingTime = Math.round(Math.random() * maxWaitingTime);
995
- }
996
-
997
- isMeetingActive = !!((_destination$fullStat = destination.fullState) !== null && _destination$fullStat !== void 0 && _destination$fullStat.active);
998
- enableUnifiedMeetings = this.config.experimental.enableUnifiedMeetings;
999
-
1000
- if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
1001
- _context.next = 14;
1002
- break;
1003
- }
1004
-
1005
- meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
1006
- return meeting.fetchMeetingInfo({});
1007
- }, waitingTime);
1008
- meeting.parseMeetingInfo(undefined, destination);
1009
- _context.next = 16;
1131
+ useRandomDelayForInfo,
1132
+ infoExtraParams,
1133
+ callStateForMetrics,
1134
+ failOnMissingMeetingInfo,
1135
+ meetingInfo,
1136
+ meetingLookupUrl,
1137
+ meeting,
1138
+ _destination$fullStat,
1139
+ waitingTime,
1140
+ startTime,
1141
+ startTimeDate,
1142
+ startTimeDatestamp,
1143
+ timeToStart,
1144
+ maxWaitingTime,
1145
+ isMeetingActive,
1146
+ enableUnifiedMeetings,
1147
+ meetingInfoOptions,
1148
+ meetingAddedType,
1149
+ _args3 = arguments;
1150
+ return _regenerator.default.wrap(function _callee3$(_context3) {
1151
+ while (1) switch (_context3.prev = _context3.next) {
1152
+ case 0:
1153
+ type = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;
1154
+ useRandomDelayForInfo = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : false;
1155
+ infoExtraParams = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : {};
1156
+ callStateForMetrics = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : undefined;
1157
+ failOnMissingMeetingInfo = _args3.length > 5 && _args3[5] !== undefined ? _args3[5] : false;
1158
+ meetingInfo = _args3.length > 6 && _args3[6] !== undefined ? _args3[6] : undefined;
1159
+ meetingLookupUrl = _args3.length > 7 && _args3[7] !== undefined ? _args3[7] : undefined;
1160
+ meeting = new _meeting.default({
1161
+ // @ts-ignore
1162
+ userId: this.webex.internal.device.userId,
1163
+ // @ts-ignore
1164
+ deviceUrl: this.webex.internal.device.url,
1165
+ // @ts-ignore
1166
+ orgId: this.webex.internal.device.orgId,
1167
+ locus: type === _constants._LOCUS_ID_ ? destination : null,
1168
+ // pass the locus object if present
1169
+ meetingInfoProvider: this.meetingInfo,
1170
+ destination: destination,
1171
+ destinationType: type,
1172
+ callStateForMetrics: callStateForMetrics
1173
+ }, {
1174
+ // @ts-ignore
1175
+ parent: this.webex
1176
+ });
1177
+ this.meetingCollection.set(meeting);
1178
+ _context3.prev = 9;
1179
+ // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
1180
+ // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
1181
+ // between 5 and 2 min (random between 3 minutes) before the meeting starts
1182
+ // to avoid a spike in traffic to the wbxappi service
1183
+ waitingTime = 0;
1184
+ if (destination.meeting) {
1185
+ startTime = destination.meeting.startTime;
1186
+ startTimeDate = new Date(startTime);
1187
+ startTimeDatestamp = startTimeDate.getTime();
1188
+ timeToStart = startTimeDatestamp - (0, _now.default)();
1189
+ maxWaitingTime = Math.max(Math.min(timeToStart, _constants.MAX_RANDOM_DELAY_FOR_MEETING_INFO), 0);
1190
+ waitingTime = Math.round(Math.random() * maxWaitingTime);
1191
+ }
1192
+ isMeetingActive = !!((_destination$fullStat = destination.fullState) !== null && _destination$fullStat !== void 0 && _destination$fullStat.active); // @ts-ignore
1193
+ enableUnifiedMeetings = this.config.experimental.enableUnifiedMeetings;
1194
+ meetingInfoOptions = {
1195
+ extraParams: infoExtraParams,
1196
+ sendCAevents: !!(callStateForMetrics !== null && callStateForMetrics !== void 0 && callStateForMetrics.correlationId) // if client sends correlation id as argument of public create(), then it means that this meeting creation is part of a pre-join intent from user
1197
+ };
1198
+ if (!meetingInfo) {
1199
+ _context3.next = 19;
1010
1200
  break;
1011
-
1012
- case 14:
1013
- _context.next = 16;
1014
- return meeting.fetchMeetingInfo({});
1015
-
1016
- case 16:
1017
- _context.next = 22;
1201
+ }
1202
+ meeting.injectMeetingInfo(meetingInfo, meetingInfoOptions, meetingLookupUrl);
1203
+ _context3.next = 26;
1204
+ break;
1205
+ case 19:
1206
+ if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
1207
+ _context3.next = 24;
1018
1208
  break;
1019
-
1020
- case 18:
1021
- _context.prev = 18;
1022
- _context.t0 = _context["catch"](4);
1023
-
1024
- if (!(_context.t0 instanceof _captchaError.default) && !(_context.t0 instanceof _passwordError.default)) {
1025
- // if there is no meeting info we assume its a 1:1 call or wireless share
1026
- _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1027
-
1028
- _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1029
- }
1030
-
1031
- _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
1032
-
1033
- case 22:
1034
- _context.prev = 22;
1035
-
1036
- // For type LOCUS_ID we need to parse the locus object to get the information
1037
- // about the caller and callee
1038
- // Meeting Added event will be created in `handleLocusEvent`
1039
- if (type !== _constants._LOCUS_ID_) {
1040
- if (!meeting.sipUri) {
1041
- meeting.setSipUri(destination);
1042
- } // TODO: check if we have to move this to parser
1043
-
1044
-
1045
- meetingAddedType = _util2.default.getMeetingAddedType(type); // We typically shouldn't need to trigger both and event and return a promise.
1046
- // Is this a special case? We want to make the public API usage as simple as possible.
1047
-
1048
- _triggerProxy.default.trigger(this, {
1049
- file: 'meetings',
1050
- function: 'createMeeting'
1051
- }, _constants.EVENT_TRIGGERS.MEETING_ADDED, {
1052
- meeting: meeting,
1053
- type: meetingAddedType
1054
- });
1209
+ }
1210
+ meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
1211
+ return meeting.fetchMeetingInfo(meetingInfoOptions);
1212
+ }, waitingTime);
1213
+ meeting.parseMeetingInfo(undefined, destination);
1214
+ _context3.next = 26;
1215
+ break;
1216
+ case 24:
1217
+ _context3.next = 26;
1218
+ return meeting.fetchMeetingInfo(meetingInfoOptions);
1219
+ case 26:
1220
+ _context3.next = 38;
1221
+ break;
1222
+ case 28:
1223
+ _context3.prev = 28;
1224
+ _context3.t0 = _context3["catch"](9);
1225
+ if (!(!(_context3.t0 instanceof _captchaError.default) && !(_context3.t0 instanceof _passwordError.default) && !(_context3.t0 instanceof _permission.default))) {
1226
+ _context3.next = 37;
1227
+ break;
1228
+ }
1229
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1230
+ if (!failOnMissingMeetingInfo) {
1231
+ _context3.next = 36;
1232
+ break;
1233
+ }
1234
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Destroying meeting due to missing meeting info.");
1235
+ // @ts-ignore
1236
+ this.destroy(meeting, _constants.MEETING_REMOVED_REASON.MISSING_MEETING_INFO);
1237
+ throw new _noMeetingInfo.default();
1238
+ case 36:
1239
+ // if there is no meeting info and no error should be thrown then we assume its a 1:1 call or wireless share
1240
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1241
+ case 37:
1242
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context3.t0, " fetching /meetingInfo for creation."));
1243
+ case 38:
1244
+ _context3.prev = 38;
1245
+ // For type LOCUS_ID we need to parse the locus object to get the information
1246
+ // about the caller and callee
1247
+ // Meeting Added event will be created in `handleLocusEvent`
1248
+ if (type !== _constants._LOCUS_ID_) {
1249
+ if (!meeting.sipUri) {
1250
+ meeting.setSipUri(destination);
1055
1251
  }
1056
1252
 
1057
- return _context.finish(22);
1058
-
1059
- case 25:
1060
- return _context.abrupt("return", meeting);
1061
-
1062
- case 26:
1063
- case "end":
1064
- return _context.stop();
1065
- }
1253
+ // TODO: check if we have to move this to parser
1254
+ meetingAddedType = _util2.default.getMeetingAddedType(type); // We typically shouldn't need to trigger both and event and return a promise.
1255
+ // Is this a special case? We want to make the public API usage as simple as possible.
1256
+ _triggerProxy.default.trigger(this, {
1257
+ file: 'meetings',
1258
+ function: 'createMeeting'
1259
+ }, _constants.EVENT_TRIGGERS.MEETING_ADDED, {
1260
+ meeting: meeting,
1261
+ type: meetingAddedType
1262
+ });
1263
+ }
1264
+ return _context3.finish(38);
1265
+ case 41:
1266
+ return _context3.abrupt("return", meeting);
1267
+ case 42:
1268
+ case "end":
1269
+ return _context3.stop();
1066
1270
  }
1067
- }, _callee, this, [[4, 18, 22, 25]]);
1271
+ }, _callee3, this, [[9, 28, 38, 41]]);
1068
1272
  }));
1069
-
1070
- function createMeeting(_x) {
1273
+ function createMeeting(_x3) {
1071
1274
  return _createMeeting.apply(this, arguments);
1072
1275
  }
1073
-
1074
1276
  return createMeeting;
1075
1277
  }()
1076
1278
  /**
1077
- * get a specifc meeting given it's type matched to the value, i.e., locus url
1078
- * @param {String} type
1079
- * @param {Object} value
1080
- * @returns {Meeting}
1081
- * @public
1082
- * @memberof Meetings
1083
- */
1084
-
1279
+ * get a specifc meeting given it's type matched to the value, i.e., locus url
1280
+ * @param {String} type
1281
+ * @param {Object} value
1282
+ * @returns {Meeting}
1283
+ * @public
1284
+ * @memberof Meetings
1285
+ */
1085
1286
  }, {
1086
1287
  key: "getMeetingByType",
1087
1288
  value: function getMeetingByType(type, value) {
1088
1289
  return this.meetingCollection.getByKey(type, value);
1089
1290
  }
1090
- /**
1091
- * Get all meetings.
1092
- * @param {object} options
1093
- * @param {object} options.startDate - get meetings after this start date
1094
- * @param {object} options.endDate - get meetings before this end date
1095
- * @returns {Object} All currently active meetings.
1096
- * @public
1097
- * @memberof Meetings
1098
- */
1099
1291
 
1292
+ /**
1293
+ * Get all meetings.
1294
+ * @param {object} options
1295
+ * @param {object} options.startDate - get meetings after this start date
1296
+ * @param {object} options.endDate - get meetings before this end date
1297
+ * @returns {Object} All currently active meetings.
1298
+ * @public
1299
+ * @memberof Meetings
1300
+ */
1100
1301
  }, {
1101
1302
  key: "getAllMeetings",
1102
1303
  value: function getAllMeetings() {
@@ -1105,57 +1306,139 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1105
1306
  // of meetings.
1106
1307
  return this.meetingCollection.getAll(options);
1107
1308
  }
1108
- /**
1109
- * syncs all the meeting from server
1110
- * @returns {undefined}
1111
- * @public
1112
- * @memberof Meetings
1113
- */
1114
1309
 
1310
+ /**
1311
+ * Syncs all the meetings from server. Does nothing and returns immediately if unverified guest.
1312
+ * @param {boolean} keepOnlyLocusMeetings - whether the sync should keep only locus meetings or any other meeting in meetingCollection
1313
+ * @returns {Promise<void>}
1314
+ * @public
1315
+ * @memberof Meetings
1316
+ */
1115
1317
  }, {
1116
1318
  key: "syncMeetings",
1117
1319
  value: function syncMeetings() {
1118
1320
  var _this11 = this;
1119
-
1321
+ var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1322
+ _ref3$keepOnlyLocusMe = _ref3.keepOnlyLocusMeetings,
1323
+ keepOnlyLocusMeetings = _ref3$keepOnlyLocusMe === void 0 ? true : _ref3$keepOnlyLocusMe;
1324
+ // @ts-ignore
1325
+ if (this.webex.credentials.isUnverifiedGuest) {
1326
+ _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> skipping meeting sync as unverified guest');
1327
+ return _promise.default.resolve();
1328
+ }
1120
1329
  return this.request.getActiveMeetings().then(function (locusArray) {
1121
1330
  var activeLocusUrl = [];
1122
-
1123
1331
  if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1124
- locusArray.loci.forEach(function (locus) {
1332
+ var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1333
+ lociToUpdate.forEach(function (locus) {
1125
1334
  activeLocusUrl.push(locus.url);
1126
-
1127
1335
  _this11.handleLocusEvent({
1128
1336
  locus: locus,
1129
1337
  locusUrl: locus.url
1130
1338
  });
1131
1339
  });
1132
1340
  }
1133
-
1134
1341
  var meetingsCollection = _this11.meetingCollection.getAll();
1135
-
1136
1342
  if ((0, _keys.default)(meetingsCollection).length > 0) {
1137
- // Some time the mercury event is missed after mercury reconnect
1138
- // if sync returns no locus then clear all the meetings
1343
+ // Sometimes the mercury events are lost after mercury reconnect
1344
+ // Remove any Locus meetings that are not returned by Locus
1345
+ // (they had a locusUrl previously but are no longer active) in the sync
1139
1346
  for (var _i = 0, _Object$values = (0, _values.default)(meetingsCollection); _i < _Object$values.length; _i++) {
1140
1347
  var meeting = _Object$values[_i];
1141
-
1142
- if (!activeLocusUrl.includes(meeting.locusUrl)) {
1348
+ // @ts-ignore
1349
+ var locusUrl = meeting.locusUrl;
1350
+ if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1143
1351
  // destroy function also uploads logs
1352
+ // @ts-ignore
1144
1353
  _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1145
1354
  }
1146
1355
  }
1147
1356
  }
1357
+ }).catch(function (error) {
1358
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1359
+ throw new Error(error);
1360
+ });
1361
+ }
1362
+
1363
+ /**
1364
+ * sort out locus array for initial creating
1365
+ * @param {Array} loci original locus array
1366
+ * @returns {undefined}
1367
+ * @public
1368
+ * @memberof Meetings
1369
+ */
1370
+ }, {
1371
+ key: "sortLocusArrayToUpdate",
1372
+ value: function sortLocusArrayToUpdate(loci) {
1373
+ var _this12 = this;
1374
+ var mainLoci = loci.filter(function (locus) {
1375
+ return !_util2.default.isBreakoutLocusDTO(locus);
1376
+ });
1377
+ var breakoutLoci = loci.filter(function (locus) {
1378
+ return _util2.default.isValidBreakoutLocus(locus);
1379
+ });
1380
+ this.breakoutLocusForHandleLater = [];
1381
+ var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1382
+ breakoutLoci.forEach(function (breakoutLocus) {
1383
+ var associateMainLocus = mainLoci.find(function (mainLocus) {
1384
+ var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1385
+ return ((_mainLocus$controls = mainLocus.controls) === null || _mainLocus$controls === void 0 ? void 0 : (_mainLocus$controls$b = _mainLocus$controls.breakout) === null || _mainLocus$controls$b === void 0 ? void 0 : _mainLocus$controls$b.url) === ((_breakoutLocus$contro = breakoutLocus.controls) === null || _breakoutLocus$contro === void 0 ? void 0 : (_breakoutLocus$contro2 = _breakoutLocus$contro.breakout) === null || _breakoutLocus$contro2 === void 0 ? void 0 : _breakoutLocus$contro2.url);
1386
+ });
1387
+ var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1388
+ locus: breakoutLocus,
1389
+ locusUrl: breakoutLocus.url
1390
+ });
1391
+ if (associateMainLocus && !existCorrespondingMeeting) {
1392
+ // if exists both main session and breakout session locus of the same non-exist meeting, handle main locus first,
1393
+ // after meeting create with main locus, then handle the associate breakout locus.
1394
+ // if only handle breakout locus, will miss some date
1395
+ _this12.breakoutLocusForHandleLater.push(breakoutLocus);
1396
+ } else {
1397
+ lociToUpdate.push(breakoutLocus);
1398
+ }
1148
1399
  });
1400
+ return lociToUpdate;
1149
1401
  }
1402
+
1150
1403
  /**
1151
- * Get all scheduled meetings.
1152
- * @param {object} options
1153
- * @param {object} options.startDate - get meetings after this start date
1154
- * @param {object} options.endDate - get meetings before this end date
1155
- * @returns {Object} All scheduled meetings.
1156
- * @memberof Meetings
1157
- */
1404
+ * check breakout locus which waiting for main locus's meeting to be created, then handle the breakout locus
1405
+ * @param {Object} newCreatedLocus the locus which just create meeting object of it
1406
+ * @returns {undefined}
1407
+ * @public
1408
+ * @memberof Meetings
1409
+ */
1410
+ }, {
1411
+ key: "checkHandleBreakoutLocus",
1412
+ value: function checkHandleBreakoutLocus(newCreatedLocus) {
1413
+ if (!newCreatedLocus || !this.breakoutLocusForHandleLater || !this.breakoutLocusForHandleLater.length) {
1414
+ return;
1415
+ }
1416
+ if (_util2.default.isBreakoutLocusDTO(newCreatedLocus)) {
1417
+ return;
1418
+ }
1419
+ var existIndex = this.breakoutLocusForHandleLater.findIndex(function (breakoutLocus) {
1420
+ var _breakoutLocus$contro3, _breakoutLocus$contro4, _newCreatedLocus$cont, _newCreatedLocus$cont2;
1421
+ return ((_breakoutLocus$contro3 = breakoutLocus.controls) === null || _breakoutLocus$contro3 === void 0 ? void 0 : (_breakoutLocus$contro4 = _breakoutLocus$contro3.breakout) === null || _breakoutLocus$contro4 === void 0 ? void 0 : _breakoutLocus$contro4.url) === ((_newCreatedLocus$cont = newCreatedLocus.controls) === null || _newCreatedLocus$cont === void 0 ? void 0 : (_newCreatedLocus$cont2 = _newCreatedLocus$cont.breakout) === null || _newCreatedLocus$cont2 === void 0 ? void 0 : _newCreatedLocus$cont2.url);
1422
+ });
1423
+ if (existIndex < 0) {
1424
+ return;
1425
+ }
1426
+ var associateBreakoutLocus = this.breakoutLocusForHandleLater[existIndex];
1427
+ this.handleLocusEvent({
1428
+ locus: associateBreakoutLocus,
1429
+ locusUrl: associateBreakoutLocus.url
1430
+ });
1431
+ this.breakoutLocusForHandleLater.splice(existIndex, 1);
1432
+ }
1158
1433
 
1434
+ /**
1435
+ * Get all scheduled meetings.
1436
+ * @param {object} options
1437
+ * @param {object} options.startDate - get meetings after this start date
1438
+ * @param {object} options.endDate - get meetings before this end date
1439
+ * @returns {Object} All scheduled meetings.
1440
+ * @memberof Meetings
1441
+ */
1159
1442
  }, {
1160
1443
  key: "getScheduledMeetings",
1161
1444
  value: function getScheduledMeetings() {
@@ -1163,19 +1446,31 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1163
1446
  scheduled: true
1164
1447
  });
1165
1448
  }
1166
- /**
1167
- * Get the logger instance for plugin-meetings
1168
- * @returns {Logger}
1169
- */
1170
1449
 
1450
+ /**
1451
+ * Get the logger instance for plugin-meetings
1452
+ * @returns {Logger}
1453
+ */
1171
1454
  }, {
1172
1455
  key: "getLogger",
1173
1456
  value: function getLogger() {
1174
1457
  return _loggerProxy.default.get();
1175
1458
  }
1459
+
1460
+ /**
1461
+ * Returns the first meeting it finds that has the webrtc media connection created.
1462
+ * Useful for debugging in the console.
1463
+ *
1464
+ * @private
1465
+ * @returns {Meeting} Meeting object that has a webrtc media connection, else undefined
1466
+ */
1467
+ }, {
1468
+ key: "getActiveWebrtcMeeting",
1469
+ value: function getActiveWebrtcMeeting() {
1470
+ return this.meetingCollection.getActiveWebrtcMeeting();
1471
+ }
1176
1472
  }]);
1177
1473
  return Meetings;
1178
1474
  }(_webexCore.WebexPlugin);
1179
-
1180
1475
  exports.default = Meetings;
1181
1476
  //# sourceMappingURL=index.js.map