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

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