@webex/plugin-meetings 3.0.0-beta.7 → 3.0.0-beta.71

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 (506) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/breakouts/breakout.js +178 -0
  4. package/dist/breakouts/breakout.js.map +1 -0
  5. package/dist/breakouts/collection.js +23 -0
  6. package/dist/breakouts/collection.js.map +1 -0
  7. package/dist/breakouts/edit-lock-error.js +52 -0
  8. package/dist/breakouts/edit-lock-error.js.map +1 -0
  9. package/dist/breakouts/index.js +843 -0
  10. package/dist/breakouts/index.js.map +1 -0
  11. package/dist/breakouts/request.js +78 -0
  12. package/dist/breakouts/request.js.map +1 -0
  13. package/dist/breakouts/utils.js +56 -0
  14. package/dist/breakouts/utils.js.map +1 -0
  15. package/dist/common/browser-detection.js +1 -20
  16. package/dist/common/browser-detection.js.map +1 -1
  17. package/dist/common/collection.js +5 -20
  18. package/dist/common/collection.js.map +1 -1
  19. package/dist/common/config.js +0 -7
  20. package/dist/common/config.js.map +1 -1
  21. package/dist/common/errors/captcha-error.js +10 -24
  22. package/dist/common/errors/captcha-error.js.map +1 -1
  23. package/dist/common/errors/intent-to-join.js +11 -24
  24. package/dist/common/errors/intent-to-join.js.map +1 -1
  25. package/dist/common/errors/join-meeting.js +12 -25
  26. package/dist/common/errors/join-meeting.js.map +1 -1
  27. package/dist/common/errors/media.js +10 -24
  28. package/dist/common/errors/media.js.map +1 -1
  29. package/dist/common/errors/parameter.js +5 -33
  30. package/dist/common/errors/parameter.js.map +1 -1
  31. package/dist/common/errors/password-error.js +10 -24
  32. package/dist/common/errors/password-error.js.map +1 -1
  33. package/dist/common/errors/permission.js +9 -23
  34. package/dist/common/errors/permission.js.map +1 -1
  35. package/dist/common/errors/reconnection-in-progress.js +0 -17
  36. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  37. package/dist/common/errors/reconnection.js +10 -24
  38. package/dist/common/errors/reconnection.js.map +1 -1
  39. package/dist/common/errors/stats.js +10 -24
  40. package/dist/common/errors/stats.js.map +1 -1
  41. package/dist/common/errors/webex-errors.js +6 -41
  42. package/dist/common/errors/webex-errors.js.map +1 -1
  43. package/dist/common/errors/webex-meetings-error.js +5 -25
  44. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  45. package/dist/common/events/events-scope.js +0 -22
  46. package/dist/common/events/events-scope.js.map +1 -1
  47. package/dist/common/events/events.js +0 -23
  48. package/dist/common/events/events.js.map +1 -1
  49. package/dist/common/events/trigger-proxy.js +0 -12
  50. package/dist/common/events/trigger-proxy.js.map +1 -1
  51. package/dist/common/events/util.js +0 -15
  52. package/dist/common/events/util.js.map +1 -1
  53. package/dist/common/logs/logger-config.js +0 -4
  54. package/dist/common/logs/logger-config.js.map +1 -1
  55. package/dist/common/logs/logger-proxy.js +1 -8
  56. package/dist/common/logs/logger-proxy.js.map +1 -1
  57. package/dist/common/logs/request.js +37 -60
  58. package/dist/common/logs/request.js.map +1 -1
  59. package/dist/common/queue.js +4 -14
  60. package/dist/common/queue.js.map +1 -1
  61. package/dist/config.js +6 -6
  62. package/dist/config.js.map +1 -1
  63. package/dist/constants.js +143 -52
  64. package/dist/constants.js.map +1 -1
  65. package/dist/controls-options-manager/constants.js +14 -0
  66. package/dist/controls-options-manager/constants.js.map +1 -0
  67. package/dist/controls-options-manager/enums.js +16 -0
  68. package/dist/controls-options-manager/enums.js.map +1 -0
  69. package/dist/controls-options-manager/index.js +261 -0
  70. package/dist/controls-options-manager/index.js.map +1 -0
  71. package/dist/controls-options-manager/util.js +39 -0
  72. package/dist/controls-options-manager/util.js.map +1 -0
  73. package/dist/index.js +11 -18
  74. package/dist/index.js.map +1 -1
  75. package/dist/locus-info/controlsUtils.js +31 -29
  76. package/dist/locus-info/controlsUtils.js.map +1 -1
  77. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  78. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  79. package/dist/locus-info/fullState.js +0 -15
  80. package/dist/locus-info/fullState.js.map +1 -1
  81. package/dist/locus-info/hostUtils.js +4 -12
  82. package/dist/locus-info/hostUtils.js.map +1 -1
  83. package/dist/locus-info/index.js +237 -198
  84. package/dist/locus-info/index.js.map +1 -1
  85. package/dist/locus-info/infoUtils.js +3 -37
  86. package/dist/locus-info/infoUtils.js.map +1 -1
  87. package/dist/locus-info/mediaSharesUtils.js +12 -38
  88. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  89. package/dist/locus-info/parser.js +92 -118
  90. package/dist/locus-info/parser.js.map +1 -1
  91. package/dist/locus-info/selfUtils.js +80 -89
  92. package/dist/locus-info/selfUtils.js.map +1 -1
  93. package/dist/media/index.js +56 -146
  94. package/dist/media/index.js.map +1 -1
  95. package/dist/media/properties.js +83 -117
  96. package/dist/media/properties.js.map +1 -1
  97. package/dist/media/util.js +2 -9
  98. package/dist/media/util.js.map +1 -1
  99. package/dist/mediaQualityMetrics/config.js +505 -495
  100. package/dist/mediaQualityMetrics/config.js.map +1 -1
  101. package/dist/meeting/in-meeting-actions.js +31 -14
  102. package/dist/meeting/in-meeting-actions.js.map +1 -1
  103. package/dist/meeting/index.js +2225 -2244
  104. package/dist/meeting/index.js.map +1 -1
  105. package/dist/meeting/muteState.js +102 -100
  106. package/dist/meeting/muteState.js.map +1 -1
  107. package/dist/meeting/request.js +308 -264
  108. package/dist/meeting/request.js.map +1 -1
  109. package/dist/meeting/request.type.js +7 -0
  110. package/dist/meeting/request.type.js.map +1 -0
  111. package/dist/meeting/state.js +21 -31
  112. package/dist/meeting/state.js.map +1 -1
  113. package/dist/meeting/util.js +63 -217
  114. package/dist/meeting/util.js.map +1 -1
  115. package/dist/meeting-info/collection.js +6 -25
  116. package/dist/meeting-info/collection.js.map +1 -1
  117. package/dist/meeting-info/index.js +14 -32
  118. package/dist/meeting-info/index.js.map +1 -1
  119. package/dist/meeting-info/meeting-info-v2.js +193 -268
  120. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  121. package/dist/meeting-info/request.js +3 -15
  122. package/dist/meeting-info/request.js.map +1 -1
  123. package/dist/meeting-info/util.js +98 -183
  124. package/dist/meeting-info/util.js.map +1 -1
  125. package/dist/meeting-info/utilv2.js +137 -228
  126. package/dist/meeting-info/utilv2.js.map +1 -1
  127. package/dist/meetings/collection.js +26 -19
  128. package/dist/meetings/collection.js.map +1 -1
  129. package/dist/meetings/index.js +565 -552
  130. package/dist/meetings/index.js.map +1 -1
  131. package/dist/meetings/request.js +26 -41
  132. package/dist/meetings/request.js.map +1 -1
  133. package/dist/meetings/util.js +151 -155
  134. package/dist/meetings/util.js.map +1 -1
  135. package/dist/member/index.js +100 -85
  136. package/dist/member/index.js.map +1 -1
  137. package/dist/member/types.js +15 -0
  138. package/dist/member/types.js.map +1 -0
  139. package/dist/member/util.js +90 -68
  140. package/dist/member/util.js.map +1 -1
  141. package/dist/members/collection.js +13 -12
  142. package/dist/members/collection.js.map +1 -1
  143. package/dist/members/index.js +152 -204
  144. package/dist/members/index.js.map +1 -1
  145. package/dist/members/request.js +35 -39
  146. package/dist/members/request.js.map +1 -1
  147. package/dist/members/types.js +15 -0
  148. package/dist/members/types.js.map +1 -0
  149. package/dist/members/util.js +76 -46
  150. package/dist/members/util.js.map +1 -1
  151. package/dist/metrics/config.js +4 -14
  152. package/dist/metrics/config.js.map +1 -1
  153. package/dist/metrics/constants.js +1 -6
  154. package/dist/metrics/constants.js.map +1 -1
  155. package/dist/metrics/index.js +59 -156
  156. package/dist/metrics/index.js.map +1 -1
  157. package/dist/multistream/mediaRequestManager.js +116 -52
  158. package/dist/multistream/mediaRequestManager.js.map +1 -1
  159. package/dist/multistream/receiveSlot.js +58 -65
  160. package/dist/multistream/receiveSlot.js.map +1 -1
  161. package/dist/multistream/receiveSlotManager.js +58 -93
  162. package/dist/multistream/receiveSlotManager.js.map +1 -1
  163. package/dist/multistream/remoteMedia.js +55 -74
  164. package/dist/multistream/remoteMedia.js.map +1 -1
  165. package/dist/multistream/remoteMediaGroup.js +6 -40
  166. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  167. package/dist/multistream/remoteMediaManager.js +466 -442
  168. package/dist/multistream/remoteMediaManager.js.map +1 -1
  169. package/dist/networkQualityMonitor/index.js +40 -59
  170. package/dist/networkQualityMonitor/index.js.map +1 -1
  171. package/dist/personal-meeting-room/index.js +21 -45
  172. package/dist/personal-meeting-room/index.js.map +1 -1
  173. package/dist/personal-meeting-room/request.js +1 -31
  174. package/dist/personal-meeting-room/request.js.map +1 -1
  175. package/dist/personal-meeting-room/util.js +0 -13
  176. package/dist/personal-meeting-room/util.js.map +1 -1
  177. package/dist/reachability/index.js +192 -191
  178. package/dist/reachability/index.js.map +1 -1
  179. package/dist/reachability/request.js +15 -23
  180. package/dist/reachability/request.js.map +1 -1
  181. package/dist/reactions/constants.js +13 -0
  182. package/dist/reactions/constants.js.map +1 -0
  183. package/dist/reactions/reactions.js +109 -0
  184. package/dist/reactions/reactions.js.map +1 -0
  185. package/dist/reactions/reactions.type.js +36 -0
  186. package/dist/reactions/reactions.type.js.map +1 -0
  187. package/dist/reconnection-manager/index.js +342 -460
  188. package/dist/reconnection-manager/index.js.map +1 -1
  189. package/dist/recording-controller/enums.js +17 -0
  190. package/dist/recording-controller/enums.js.map +1 -0
  191. package/dist/recording-controller/index.js +343 -0
  192. package/dist/recording-controller/index.js.map +1 -0
  193. package/dist/recording-controller/util.js +63 -0
  194. package/dist/recording-controller/util.js.map +1 -0
  195. package/dist/roap/index.js +48 -70
  196. package/dist/roap/index.js.map +1 -1
  197. package/dist/roap/request.js +143 -131
  198. package/dist/roap/request.js.map +1 -1
  199. package/dist/roap/turnDiscovery.js +91 -98
  200. package/dist/roap/turnDiscovery.js.map +1 -1
  201. package/dist/statsAnalyzer/global.js +1 -95
  202. package/dist/statsAnalyzer/global.js.map +1 -1
  203. package/dist/statsAnalyzer/index.js +372 -455
  204. package/dist/statsAnalyzer/index.js.map +1 -1
  205. package/dist/statsAnalyzer/mqaUtil.js +143 -87
  206. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  207. package/dist/transcription/index.js +22 -47
  208. package/dist/transcription/index.js.map +1 -1
  209. package/dist/types/breakouts/breakout.d.ts +8 -0
  210. package/dist/types/breakouts/collection.d.ts +5 -0
  211. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  212. package/dist/types/breakouts/index.d.ts +5 -0
  213. package/dist/types/breakouts/request.d.ts +22 -0
  214. package/dist/types/breakouts/utils.d.ts +8 -0
  215. package/dist/types/common/browser-detection.d.ts +9 -0
  216. package/dist/types/common/collection.d.ts +48 -0
  217. package/dist/types/common/config.d.ts +2 -0
  218. package/dist/types/common/errors/captcha-error.d.ts +15 -0
  219. package/dist/types/common/errors/intent-to-join.d.ts +16 -0
  220. package/dist/types/common/errors/join-meeting.d.ts +17 -0
  221. package/dist/types/common/errors/media.d.ts +15 -0
  222. package/dist/types/common/errors/parameter.d.ts +15 -0
  223. package/dist/types/common/errors/password-error.d.ts +15 -0
  224. package/dist/types/common/errors/permission.d.ts +14 -0
  225. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  226. package/dist/types/common/errors/reconnection.d.ts +15 -0
  227. package/dist/types/common/errors/stats.d.ts +15 -0
  228. package/dist/types/common/errors/webex-errors.d.ts +69 -0
  229. package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
  230. package/dist/types/common/events/events-scope.d.ts +17 -0
  231. package/dist/types/common/events/events.d.ts +12 -0
  232. package/dist/types/common/events/trigger-proxy.d.ts +2 -0
  233. package/dist/types/common/events/util.d.ts +2 -0
  234. package/dist/types/common/logs/logger-config.d.ts +2 -0
  235. package/dist/types/common/logs/logger-proxy.d.ts +2 -0
  236. package/dist/types/common/logs/request.d.ts +34 -0
  237. package/dist/types/common/queue.d.ts +32 -0
  238. package/dist/types/config.d.ts +77 -0
  239. package/dist/types/constants.d.ts +944 -0
  240. package/dist/types/controls-options-manager/constants.d.ts +4 -0
  241. package/dist/types/controls-options-manager/enums.d.ts +6 -0
  242. package/dist/types/controls-options-manager/index.d.ts +128 -0
  243. package/dist/types/controls-options-manager/util.d.ts +9 -0
  244. package/dist/types/index.d.ts +6 -0
  245. package/dist/types/locus-info/controlsUtils.d.ts +2 -0
  246. package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
  247. package/dist/types/locus-info/fullState.d.ts +2 -0
  248. package/dist/types/locus-info/hostUtils.d.ts +2 -0
  249. package/dist/types/locus-info/index.d.ts +276 -0
  250. package/dist/types/locus-info/infoUtils.d.ts +2 -0
  251. package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
  252. package/dist/types/locus-info/parser.d.ts +212 -0
  253. package/dist/types/locus-info/selfUtils.d.ts +2 -0
  254. package/dist/types/media/index.d.ts +32 -0
  255. package/dist/types/media/properties.d.ts +108 -0
  256. package/dist/types/media/util.d.ts +2 -0
  257. package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
  258. package/dist/types/meeting/in-meeting-actions.d.ts +101 -0
  259. package/dist/types/meeting/index.d.ts +1720 -0
  260. package/dist/types/meeting/muteState.d.ts +132 -0
  261. package/dist/types/meeting/request.d.ts +271 -0
  262. package/dist/types/meeting/request.type.d.ts +11 -0
  263. package/dist/types/meeting/state.d.ts +9 -0
  264. package/dist/types/meeting/util.d.ts +2 -0
  265. package/dist/types/meeting-info/collection.d.ts +20 -0
  266. package/dist/types/meeting-info/index.d.ts +57 -0
  267. package/dist/types/meeting-info/meeting-info-v2.d.ts +93 -0
  268. package/dist/types/meeting-info/request.d.ts +22 -0
  269. package/dist/types/meeting-info/util.d.ts +2 -0
  270. package/dist/types/meeting-info/utilv2.d.ts +2 -0
  271. package/dist/types/meetings/collection.d.ts +31 -0
  272. package/dist/types/meetings/index.d.ts +315 -0
  273. package/dist/types/meetings/request.d.ts +27 -0
  274. package/dist/types/meetings/util.d.ts +18 -0
  275. package/dist/types/member/index.d.ts +156 -0
  276. package/dist/types/member/types.d.ts +21 -0
  277. package/dist/types/member/util.d.ts +2 -0
  278. package/dist/types/members/collection.d.ts +29 -0
  279. package/dist/types/members/index.d.ts +343 -0
  280. package/dist/types/members/request.d.ts +58 -0
  281. package/dist/types/members/types.d.ts +24 -0
  282. package/dist/types/members/util.d.ts +2 -0
  283. package/dist/types/metrics/config.d.ts +171 -0
  284. package/dist/types/metrics/constants.d.ts +53 -0
  285. package/dist/types/metrics/index.d.ts +152 -0
  286. package/dist/types/multistream/mediaRequestManager.d.ts +68 -0
  287. package/dist/types/multistream/receiveSlot.d.ts +68 -0
  288. package/dist/types/multistream/receiveSlotManager.d.ts +49 -0
  289. package/dist/types/multistream/remoteMedia.d.ts +100 -0
  290. package/dist/types/multistream/remoteMediaGroup.d.ts +56 -0
  291. package/dist/types/multistream/remoteMediaManager.d.ts +263 -0
  292. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  293. package/dist/types/personal-meeting-room/index.d.ts +47 -0
  294. package/dist/types/personal-meeting-room/request.d.ts +14 -0
  295. package/dist/types/personal-meeting-room/util.d.ts +2 -0
  296. package/dist/types/reachability/index.d.ts +152 -0
  297. package/dist/types/reachability/request.d.ts +37 -0
  298. package/dist/types/reactions/constants.d.ts +3 -0
  299. package/dist/types/reactions/reactions.d.ts +4 -0
  300. package/dist/types/reactions/reactions.type.d.ts +52 -0
  301. package/dist/types/reconnection-manager/index.d.ts +126 -0
  302. package/dist/types/recording-controller/enums.d.ts +7 -0
  303. package/dist/types/recording-controller/index.d.ts +193 -0
  304. package/dist/types/recording-controller/util.d.ts +13 -0
  305. package/dist/types/roap/index.d.ts +77 -0
  306. package/dist/types/roap/request.d.ts +38 -0
  307. package/dist/types/roap/turnDiscovery.d.ts +74 -0
  308. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  309. package/dist/types/statsAnalyzer/index.d.ts +195 -0
  310. package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
  311. package/dist/types/transcription/index.d.ts +64 -0
  312. package/internal-README.md +7 -6
  313. package/package.json +27 -21
  314. package/src/breakouts/README.md +219 -0
  315. package/src/breakouts/breakout.ts +153 -0
  316. package/src/breakouts/collection.ts +19 -0
  317. package/src/breakouts/edit-lock-error.ts +25 -0
  318. package/src/breakouts/index.ts +745 -0
  319. package/src/breakouts/request.ts +55 -0
  320. package/src/breakouts/utils.ts +44 -0
  321. package/src/common/{browser-detection.js → browser-detection.ts} +9 -6
  322. package/src/common/collection.ts +9 -7
  323. package/src/common/{config.js → config.ts} +1 -1
  324. package/src/common/errors/{captcha-error.js → captcha-error.ts} +11 -7
  325. package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +12 -7
  326. package/src/common/errors/{join-meeting.js → join-meeting.ts} +17 -8
  327. package/src/common/errors/{media.js → media.ts} +11 -7
  328. package/src/common/errors/parameter.ts +11 -7
  329. package/src/common/errors/{password-error.js → password-error.ts} +11 -7
  330. package/src/common/errors/{permission.js → permission.ts} +10 -6
  331. package/src/common/errors/{reconnection.js → reconnection.ts} +11 -7
  332. package/src/common/errors/{stats.js → stats.ts} +11 -7
  333. package/src/common/errors/{webex-errors.js → webex-errors.ts} +8 -7
  334. package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +4 -2
  335. package/src/common/events/{events-scope.js → events-scope.ts} +6 -2
  336. package/src/common/events/{events.js → events.ts} +5 -1
  337. package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +9 -5
  338. package/src/common/events/{util.js → util.ts} +2 -3
  339. package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
  340. package/src/common/logs/logger-proxy.ts +44 -0
  341. package/src/common/logs/{request.js → request.ts} +22 -9
  342. package/src/common/queue.ts +1 -2
  343. package/src/{config.js → config.ts} +17 -12
  344. package/src/constants.ts +92 -5
  345. package/src/controls-options-manager/constants.ts +5 -0
  346. package/src/controls-options-manager/enums.ts +7 -0
  347. package/src/controls-options-manager/index.ts +240 -0
  348. package/src/controls-options-manager/util.ts +30 -0
  349. package/src/index.js +4 -1
  350. package/src/locus-info/controlsUtils.ts +141 -0
  351. package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
  352. package/src/locus-info/{fullState.js → fullState.ts} +16 -12
  353. package/src/locus-info/{hostUtils.js → hostUtils.ts} +9 -8
  354. package/src/locus-info/{index.js → index.ts} +211 -71
  355. package/src/locus-info/{infoUtils.js → infoUtils.ts} +19 -8
  356. package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +17 -17
  357. package/src/locus-info/{parser.js → parser.ts} +67 -79
  358. package/src/locus-info/{selfUtils.js → selfUtils.ts} +183 -67
  359. package/src/media/{index.js → index.ts} +179 -176
  360. package/src/media/{properties.js → properties.ts} +60 -37
  361. package/src/media/{util.js → util.ts} +2 -2
  362. package/src/mediaQualityMetrics/config.ts +384 -0
  363. package/src/meeting/in-meeting-actions.ts +67 -3
  364. package/src/meeting/{index.js → index.ts} +2605 -1605
  365. package/src/meeting/{muteState.js → muteState.ts} +138 -73
  366. package/src/meeting/{request.js → request.ts} +326 -142
  367. package/src/meeting/request.type.ts +13 -0
  368. package/src/meeting/{state.js → state.ts} +50 -35
  369. package/src/meeting/{util.js → util.ts} +131 -115
  370. package/src/meeting-info/{collection.js → collection.ts} +6 -2
  371. package/src/meeting-info/{index.js → index.ts} +42 -36
  372. package/src/meeting-info/meeting-info-v2.ts +273 -0
  373. package/src/meeting-info/{request.js → request.ts} +14 -4
  374. package/src/meeting-info/{util.js → util.ts} +60 -51
  375. package/src/meeting-info/{utilv2.js → utilv2.ts} +65 -58
  376. package/src/meetings/{collection.js → collection.ts} +26 -3
  377. package/src/meetings/index.ts +1275 -0
  378. package/src/meetings/{request.js → request.ts} +34 -25
  379. package/src/meetings/{util.js → util.ts} +99 -33
  380. package/src/member/{index.js → index.ts} +124 -56
  381. package/src/member/types.ts +24 -0
  382. package/src/member/{util.js → util.ts} +105 -25
  383. package/src/members/{collection.js → collection.ts} +10 -2
  384. package/src/members/{index.js → index.ts} +281 -144
  385. package/src/members/{request.js → request.ts} +80 -16
  386. package/src/members/types.ts +28 -0
  387. package/src/members/{util.js → util.ts} +108 -55
  388. package/src/metrics/{config.js → config.ts} +255 -92
  389. package/src/metrics/{constants.js → constants.ts} +0 -6
  390. package/src/metrics/{index.js → index.ts} +110 -94
  391. package/src/multistream/mediaRequestManager.ts +144 -40
  392. package/src/multistream/receiveSlot.ts +69 -26
  393. package/src/multistream/receiveSlotManager.ts +50 -38
  394. package/src/multistream/remoteMedia.ts +30 -4
  395. package/src/multistream/remoteMediaGroup.ts +4 -3
  396. package/src/multistream/remoteMediaManager.ts +230 -66
  397. package/src/networkQualityMonitor/{index.js → index.ts} +41 -29
  398. package/src/personal-meeting-room/{index.js → index.ts} +28 -19
  399. package/src/personal-meeting-room/{request.js → request.ts} +13 -4
  400. package/src/personal-meeting-room/{util.js → util.ts} +4 -4
  401. package/src/reachability/{index.js → index.ts} +157 -94
  402. package/src/reachability/request.ts +46 -35
  403. package/src/reactions/constants.ts +4 -0
  404. package/src/reactions/reactions.ts +104 -0
  405. package/src/reactions/reactions.type.ts +62 -0
  406. package/src/reconnection-manager/{index.js → index.ts} +228 -120
  407. package/src/recording-controller/enums.ts +8 -0
  408. package/src/recording-controller/index.ts +315 -0
  409. package/src/recording-controller/util.ts +58 -0
  410. package/src/roap/{index.js → index.ts} +77 -60
  411. package/src/roap/request.ts +172 -0
  412. package/src/roap/turnDiscovery.ts +81 -41
  413. package/src/statsAnalyzer/global.ts +37 -0
  414. package/src/statsAnalyzer/index.ts +1242 -0
  415. package/src/statsAnalyzer/mqaUtil.ts +291 -0
  416. package/src/transcription/{index.js → index.ts} +46 -39
  417. package/test/integration/spec/converged-space-meetings.js +176 -0
  418. package/test/integration/spec/journey.js +665 -464
  419. package/test/integration/spec/space-meeting.js +320 -206
  420. package/test/integration/spec/transcription.js +7 -8
  421. package/test/unit/spec/breakouts/breakout.ts +178 -0
  422. package/test/unit/spec/breakouts/collection.ts +15 -0
  423. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  424. package/test/unit/spec/breakouts/index.ts +1252 -0
  425. package/test/unit/spec/breakouts/request.ts +104 -0
  426. package/test/unit/spec/breakouts/utils.js +54 -0
  427. package/test/unit/spec/common/browser-detection.js +9 -28
  428. package/test/unit/spec/controls-options-manager/index.js +204 -0
  429. package/test/unit/spec/controls-options-manager/util.js +86 -0
  430. package/test/unit/spec/fixture/locus.js +92 -90
  431. package/test/unit/spec/locus-info/controlsUtils.js +133 -34
  432. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  433. package/test/unit/spec/locus-info/index.js +303 -2
  434. package/test/unit/spec/locus-info/infoUtils.js +41 -32
  435. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  436. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  437. package/test/unit/spec/locus-info/parser.js +3 -9
  438. package/test/unit/spec/locus-info/selfConstant.js +101 -103
  439. package/test/unit/spec/locus-info/selfUtils.js +165 -12
  440. package/test/unit/spec/media/index.ts +72 -8
  441. package/test/unit/spec/media/properties.ts +9 -9
  442. package/test/unit/spec/meeting/in-meeting-actions.ts +29 -2
  443. package/test/unit/spec/meeting/index.js +2503 -802
  444. package/test/unit/spec/meeting/muteState.js +146 -61
  445. package/test/unit/spec/meeting/request.js +141 -43
  446. package/test/unit/spec/meeting/utils.js +135 -164
  447. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  448. package/test/unit/spec/meeting-info/request.js +7 -9
  449. package/test/unit/spec/meeting-info/util.js +11 -12
  450. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  451. package/test/unit/spec/meetings/collection.js +15 -1
  452. package/test/unit/spec/meetings/index.js +622 -263
  453. package/test/unit/spec/meetings/utils.js +65 -14
  454. package/test/unit/spec/member/index.js +24 -1
  455. package/test/unit/spec/member/util.js +359 -32
  456. package/test/unit/spec/members/index.js +294 -54
  457. package/test/unit/spec/members/request.js +50 -20
  458. package/test/unit/spec/members/utils.js +147 -4
  459. package/test/unit/spec/metrics/index.js +16 -21
  460. package/test/unit/spec/multistream/mediaRequestManager.ts +369 -68
  461. package/test/unit/spec/multistream/receiveSlot.ts +76 -17
  462. package/test/unit/spec/multistream/receiveSlotManager.ts +60 -38
  463. package/test/unit/spec/multistream/remoteMedia.ts +32 -2
  464. package/test/unit/spec/multistream/remoteMediaGroup.ts +5 -5
  465. package/test/unit/spec/multistream/remoteMediaManager.ts +549 -65
  466. package/test/unit/spec/networkQualityMonitor/index.js +24 -18
  467. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  468. package/test/unit/spec/reachability/index.ts +176 -27
  469. package/test/unit/spec/reachability/request.js +66 -0
  470. package/test/unit/spec/reconnection-manager/index.js +58 -30
  471. package/test/unit/spec/recording-controller/index.js +231 -0
  472. package/test/unit/spec/recording-controller/util.js +102 -0
  473. package/test/unit/spec/roap/index.ts +12 -8
  474. package/test/unit/spec/roap/request.ts +217 -0
  475. package/test/unit/spec/roap/turnDiscovery.ts +72 -49
  476. package/test/unit/spec/stats-analyzer/index.js +108 -57
  477. package/test/utils/cmr.js +44 -42
  478. package/test/utils/constants.js +9 -0
  479. package/test/utils/testUtils.js +98 -77
  480. package/test/utils/webex-config.js +22 -18
  481. package/test/utils/webex-test-users.js +57 -50
  482. package/tsconfig.json +6 -0
  483. package/dist/media/internal-media-core-wrapper.js +0 -22
  484. package/dist/media/internal-media-core-wrapper.js.map +0 -1
  485. package/dist/meeting/effectsState.js +0 -327
  486. package/dist/meeting/effectsState.js.map +0 -1
  487. package/dist/multistream/multistreamMedia.js +0 -116
  488. package/dist/multistream/multistreamMedia.js.map +0 -1
  489. package/dist/peer-connection-manager/util.js +0 -124
  490. package/dist/peer-connection-manager/util.js.map +0 -1
  491. package/src/common/logs/logger-proxy.js +0 -33
  492. package/src/locus-info/controlsUtils.js +0 -102
  493. package/src/media/internal-media-core-wrapper.ts +0 -9
  494. package/src/mediaQualityMetrics/config.js +0 -382
  495. package/src/meeting/effectsState.js +0 -205
  496. package/src/meeting-info/meeting-info-v2.js +0 -255
  497. package/src/meetings/index.js +0 -1015
  498. package/src/multistream/multistreamMedia.ts +0 -92
  499. package/src/peer-connection-manager/util.ts +0 -117
  500. package/src/roap/request.js +0 -127
  501. package/src/statsAnalyzer/global.js +0 -133
  502. package/src/statsAnalyzer/index.js +0 -1006
  503. package/src/statsAnalyzer/mqaUtil.js +0 -173
  504. package/test/unit/spec/meeting/effectsState.js +0 -291
  505. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
  506. /package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
@@ -1,168 +1,112 @@
1
1
  "use strict";
2
2
 
3
3
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
4
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
7
5
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
6
  _Object$defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
-
13
9
  exports.default = void 0;
14
-
15
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
16
-
17
11
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
18
-
19
12
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
20
-
21
13
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
22
-
23
14
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
24
-
25
15
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
26
-
27
16
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
28
-
29
17
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
30
-
31
18
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
32
-
33
19
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
34
-
35
20
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
36
-
37
21
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
38
-
39
22
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
40
-
41
23
  require("@webex/internal-plugin-mercury");
42
-
43
24
  require("@webex/internal-plugin-conversation");
44
-
45
25
  var _webexCore = require("@webex/webex-core");
46
-
47
26
  var _internalMediaCore = require("@webex/internal-media-core");
48
-
49
27
  require("webrtc-adapter");
50
-
51
28
  var _metrics = _interopRequireDefault(require("../metrics"));
52
-
53
29
  var _config = require("../metrics/config");
54
-
55
30
  var _loggerConfig = _interopRequireDefault(require("../common/logs/logger-config"));
56
-
57
31
  var _config2 = _interopRequireDefault(require("../common/config"));
58
-
59
32
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
60
-
61
33
  var _request = _interopRequireDefault(require("../common/logs/request"));
62
-
63
34
  var _triggerProxy = _interopRequireDefault(require("../common/events/trigger-proxy"));
64
-
65
35
  var _media = _interopRequireDefault(require("../media"));
66
-
67
36
  var _util = _interopRequireDefault(require("../meeting/util"));
68
-
69
37
  var _constants = require("../constants");
70
-
71
38
  var _constants2 = _interopRequireDefault(require("../metrics/constants"));
72
-
73
39
  var _meetingInfo = _interopRequireDefault(require("../meeting-info"));
74
-
75
40
  var _meetingInfoV = _interopRequireDefault(require("../meeting-info/meeting-info-v2"));
76
-
77
41
  var _meeting = _interopRequireDefault(require("../meeting"));
78
-
79
42
  var _personalMeetingRoom = _interopRequireDefault(require("../personal-meeting-room"));
80
-
81
43
  var _reachability = _interopRequireDefault(require("../reachability"));
82
-
83
- var _request2 = _interopRequireDefault(require("../meetings/request"));
84
-
44
+ var _request2 = _interopRequireDefault(require("./request"));
85
45
  var _passwordError = _interopRequireDefault(require("../common/errors/password-error"));
86
-
87
46
  var _captchaError = _interopRequireDefault(require("../common/errors/captcha-error"));
88
-
89
47
  var _collection = _interopRequireDefault(require("./collection"));
90
-
91
48
  var _util2 = _interopRequireDefault(require("./util"));
92
-
93
49
  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
50
  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
51
  var mediaLogger;
98
-
99
52
  var MediaLogger = /*#__PURE__*/function () {
100
53
  function MediaLogger() {
101
54
  (0, _classCallCheck2.default)(this, MediaLogger);
102
55
  }
103
-
104
56
  (0, _createClass2.default)(MediaLogger, [{
105
57
  key: "info",
106
58
  value: function info() {
107
59
  var _LoggerProxy$logger;
108
-
109
60
  (_LoggerProxy$logger = _loggerProxy.default.logger).info.apply(_LoggerProxy$logger, arguments);
110
61
  }
111
62
  }, {
112
63
  key: "log",
113
64
  value: function log() {
114
65
  var _LoggerProxy$logger2;
115
-
116
66
  (_LoggerProxy$logger2 = _loggerProxy.default.logger).log.apply(_LoggerProxy$logger2, arguments);
117
67
  }
118
68
  }, {
119
69
  key: "error",
120
70
  value: function error() {
121
71
  var _LoggerProxy$logger3;
122
-
123
72
  (_LoggerProxy$logger3 = _loggerProxy.default.logger).error.apply(_LoggerProxy$logger3, arguments);
124
73
  }
125
74
  }, {
126
75
  key: "warn",
127
76
  value: function warn() {
128
77
  var _LoggerProxy$logger4;
129
-
130
78
  (_LoggerProxy$logger4 = _loggerProxy.default.logger).warn.apply(_LoggerProxy$logger4, arguments);
131
79
  }
132
80
  }, {
133
81
  key: "trace",
134
82
  value: function trace() {
135
83
  var _LoggerProxy$logger5;
136
-
137
84
  (_LoggerProxy$logger5 = _loggerProxy.default.logger).trace.apply(_LoggerProxy$logger5, arguments);
138
85
  }
139
86
  }, {
140
87
  key: "debug",
141
88
  value: function debug() {
142
89
  var _LoggerProxy$logger6;
143
-
144
90
  (_LoggerProxy$logger6 = _loggerProxy.default.logger).debug.apply(_LoggerProxy$logger6, arguments);
145
91
  }
146
92
  }]);
147
93
  return MediaLogger;
148
94
  }();
149
95
  /**
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
-
96
+ * Meetings Ready Event
97
+ * Emitted when the meetings instance on webex is ready
98
+ * @event meetings:ready
99
+ * @instance
100
+ * @memberof Meetings
101
+ */
157
102
  /**
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
-
103
+ * Meetings Network Disconnected Event
104
+ * Emitted when the meetings instance is disconnected from
105
+ * the internal mercury server
106
+ * @event network:disconnected
107
+ * @instance
108
+ * @memberof Meetings
109
+ */
166
110
  /**
167
111
  * Meetings Registered Event
168
112
  * Emitted when the meetings instance has been registered and listening
@@ -170,137 +114,210 @@ var MediaLogger = /*#__PURE__*/function () {
170
114
  * @instance
171
115
  * @memberof Meetings
172
116
  */
173
-
174
117
  /**
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
-
118
+ * Meeting Removed Event
119
+ * Emitted when a meeting was removed from the cache of meetings
120
+ * @event meeting:removed
121
+ * @instance
122
+ * @type {Object}
123
+ * @property {String} meetingId the removed meeting
124
+ * @property {Object} response the server response
125
+ * @property {String} type what type of meeting it was
126
+ * @memberof Meetings
127
+ */
186
128
  /**
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
-
129
+ * Meeting Added Event
130
+ * Emitted when a meeting was added to the cache of meetings
131
+ * @event meeting:added
132
+ * @instance
133
+ * @type {Object}
134
+ * @property {String} meetingId the added meeting
135
+ * @property {String} type what type of meeting it was
136
+ * @memberof Meetings
137
+ */
197
138
  /**
198
- * Maintain a cache of meetings and sync with services.
199
- * @class
200
- */
201
-
202
-
139
+ * Maintain a cache of meetings and sync with services.
140
+ * @class
141
+ */
203
142
  var Meetings = /*#__PURE__*/function (_WebexPlugin) {
204
143
  (0, _inherits2.default)(Meetings, _WebexPlugin);
205
-
206
144
  var _super = _createSuper(Meetings);
207
-
208
145
  /**
209
- * Initializes the Meetings Plugin
210
- * @constructor
211
- * @public
212
- * @memberof Meetings
213
- */
146
+ * Initializes the Meetings Plugin
147
+ * @constructor
148
+ * @public
149
+ * @memberof Meetings
150
+ */
214
151
  function Meetings() {
215
152
  var _this;
216
-
217
153
  (0, _classCallCheck2.default)(this, Meetings);
218
-
219
154
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
220
155
  args[_key] = arguments[_key];
221
156
  }
222
-
223
157
  _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
158
 
159
+ /**
160
+ * The Meetings request to interact with server
161
+ * @instance
162
+ * @type {Object}
163
+ * @private
164
+ * @memberof Meetings
165
+ */
166
+ // @ts-ignore
167
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loggerRequest", void 0);
168
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "media", void 0);
169
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingCollection", void 0);
170
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "personalMeetingRoom", void 0);
171
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "preferredWebexSite", void 0);
172
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "reachability", void 0);
173
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "registered", void 0);
174
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "request", void 0);
175
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "geoHintInfo", void 0);
176
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingInfo", void 0);
232
177
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.MEETINGS);
233
178
  _this.request = new _request2.default({}, {
234
179
  parent: _this.webex
235
180
  });
236
181
  /**
237
- * Log upload request helper
238
- * @instance
239
- * @type {Object}
240
- * @private
241
- * @memberof Meetings
242
- */
243
-
182
+ * Log upload request helper
183
+ * @instance
184
+ * @type {Object}
185
+ * @private
186
+ * @memberof Meetings
187
+ */
188
+ // @ts-ignore
244
189
  _this.loggerRequest = new _request.default({
245
190
  webex: _this.webex
246
191
  });
247
192
  _this.meetingCollection = new _collection.default();
248
193
  /**
249
- * The PersonalMeetingRoom object to interact with server
250
- * @instance
251
- * @type {Object}
252
- * @public
253
- * @memberof Meetings
254
- */
255
-
194
+ * The PersonalMeetingRoom object to interact with server
195
+ * @instance
196
+ * @type {Object}
197
+ * @public
198
+ * @memberof Meetings
199
+ */
256
200
  _this.personalMeetingRoom = null;
257
201
  /**
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
-
202
+ * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
203
+ * starts as null
204
+ * @instance
205
+ * @type {Object}
206
+ * @private
207
+ * @memberof Meetings
208
+ */
266
209
  _this.reachability = null;
267
- /**
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
210
 
275
- _this.registered = false;
276
211
  /**
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
- */
212
+ * If the meetings plugin has been registered and listening via {@link Meetings#register}
213
+ * @instance
214
+ * @type {Boolean}
215
+ * @public
216
+ * @memberof Meetings
217
+ */
218
+ _this.registered = false;
283
219
 
284
- _this.preferredWebexSite = '';
285
220
  /**
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
- */
221
+ * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}
222
+ * @instance
223
+ * @type {String}
224
+ * @private
225
+ * @memberof Meetings
226
+ */
227
+ _this.preferredWebexSite = '';
293
228
 
229
+ /**
230
+ * The public interface for the internal Media util files. These are helpful to expose outside the context
231
+ * of a meeting so that a user can access media without creating a meeting instance.
232
+ * @instance
233
+ * @type {Object}
234
+ * @private
235
+ * @memberof Meetings
236
+ */
294
237
  _this.media = {
295
238
  getUserMedia: _media.default.getUserMedia,
296
239
  getSupportedDevice: _media.default.getSupportedDevice
297
240
  };
298
-
299
241
  _this.onReady();
300
-
301
242
  return _this;
302
243
  }
244
+
303
245
  /**
246
+ * check whether you need to handle this main session's locus data or not
247
+ * @param {Object} meeting current meeting data
248
+ * @param {Object} newLocus new locus data
249
+ * @returns {boolean}
250
+ * @private
251
+ * @memberof Meetings
252
+ */
253
+ (0, _createClass2.default)(Meetings, [{
254
+ key: "isNeedHandleMainLocus",
255
+ value: function isNeedHandleMainLocus(meeting, newLocus) {
256
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
257
+ 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;
258
+ var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
259
+ 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_;
260
+ 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_;
261
+ var deviceFromNewLocus = _util2.default.getThisDevice(newLocus);
262
+ var isNewLocusJoinThisDevice = _util2.default.joinedOnThisDevice(meeting, newLocus);
263
+ 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);
264
+ if (isSelfJoined && isNewLocusJoinThisDevice) {
265
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self this device shown as JOINED in the main session');
266
+ if (breakoutLocus !== null && breakoutLocus !== void 0 && breakoutLocus.joinedWith && deviceFromNewLocus) {
267
+ var _breakoutLocus$joined2, _deviceFromNewLocus$r;
268
+ var breakoutReplaceAt = ((_breakoutLocus$joined2 = breakoutLocus.joinedWith.replaces) === null || _breakoutLocus$joined2 === void 0 ? void 0 : _breakoutLocus$joined2.length) > 0 ? breakoutLocus.joinedWith.replaces[0].replaceAt : '';
269
+ var newLocusReplaceAt = ((_deviceFromNewLocus$r = deviceFromNewLocus.replaces) === null || _deviceFromNewLocus$r === void 0 ? void 0 : _deviceFromNewLocus$r.length) > 0 ? deviceFromNewLocus.replaces[0].replaceAt : '';
270
+ if (breakoutReplaceAt && newLocusReplaceAt && breakoutReplaceAt > newLocusReplaceAt) {
271
+ _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> this is expired main joined status locus_dto replacedAt ".concat(newLocusReplaceAt, " bo replacedAt ").concat(breakoutReplaceAt));
272
+ return false;
273
+ }
274
+ }
275
+ return true;
276
+ }
277
+ if (isBreakoutLocusJoinThisDevice) {
278
+ _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));
279
+ return false;
280
+ }
281
+ if (isSelfMoved && newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed) {
282
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status, not need to handle');
283
+ return false;
284
+ }
285
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> this is a normal main session locusDTO update case');
286
+ return true;
287
+ }
288
+
289
+ /**
290
+ * check whether you need to handle this locus data or not
291
+ * @param {Object} meeting old locus data
292
+ * @param {Object} newLocus new locus data
293
+ * @returns {boolean}
294
+ * @private
295
+ * @memberof Meetings
296
+ */
297
+ }, {
298
+ key: "isNeedHandleLocusDTO",
299
+ value: function isNeedHandleLocusDTO(meeting, newLocus) {
300
+ if (newLocus) {
301
+ var _newLocus$controls2, _newLocus$controls2$b, _newLocus$self5, _newLocus$self6;
302
+ var isNewLocusAsBreakout = ((_newLocus$controls2 = newLocus.controls) === null || _newLocus$controls2 === void 0 ? void 0 : (_newLocus$controls2$b = _newLocus$controls2.breakout) === null || _newLocus$controls2$b === void 0 ? void 0 : _newLocus$controls2$b.sessionType) === _constants.BREAKOUTS.SESSION_TYPES.BREAKOUT;
303
+ 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_;
304
+ if (!meeting) {
305
+ if (isNewLocusAsBreakout) {
306
+ var _newLocus$fullState, _newLocus$self7;
307
+ _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));
308
+ return ((_newLocus$self7 = newLocus.self) === null || _newLocus$self7 === void 0 ? void 0 : _newLocus$self7.state) === _constants._JOINED_;
309
+ }
310
+ return this.isNeedHandleMainLocus(meeting, newLocus);
311
+ }
312
+ if (!isNewLocusAsBreakout) {
313
+ return this.isNeedHandleMainLocus(meeting, newLocus);
314
+ }
315
+ return !isSelfMoved;
316
+ }
317
+ return true;
318
+ }
319
+
320
+ /**
304
321
  * handle locus events and takes meeting actions with them as they come in
305
322
  * @param {Object} data a locus event
306
323
  * @param {String} data.locusUrl
@@ -311,70 +328,82 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
311
328
  * @private
312
329
  * @memberof Meetings
313
330
  */
314
-
315
-
316
- (0, _createClass2.default)(Meetings, [{
331
+ }, {
317
332
  key: "handleLocusEvent",
318
333
  value: function handleLocusEvent(data) {
319
334
  var _data$locus$info,
320
- _data$locus,
321
- _data$locus$replaces,
322
- _this2 = this;
323
-
335
+ _data$locus,
336
+ _data$locus$info2,
337
+ _data$locus2,
338
+ _data$locus2$replaces,
339
+ _this2 = this;
324
340
  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
341
+ var meeting = null;
342
+ // getting meeting by correlationId. This will happen for the new event
326
343
  // Either the locus
327
344
  // TODO : Add check for the callBack Address
345
+ meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) ||
346
+ // @ts-ignore
347
+ this.meetingCollection.getByKey(_constants.CORRELATION_ID,
348
+ // @ts-ignore
349
+ _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);
328
350
 
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
351
+ // Special case when locus has got replaced, This only happend once if a replace locus exists
330
352
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
331
353
 
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) {
354
+ 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
355
  // Always the last element in the replace is the active one
334
356
  meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);
335
357
  }
336
-
358
+ if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
359
+ _loggerProxy.default.logger.log("Meetings:index#handleLocusEvent --> doesn't need to process locus event");
360
+ return;
361
+ }
337
362
  if (!meeting) {
338
363
  // TODO: create meeting when we get a meeting object
339
364
  // const checkForEnded = (locus) => {
340
365
  // TODO: you already ended the meeting but you got an event later
341
366
  // Mainly for 1:1 Callsor meeting
342
367
  // Happens mainly after refresh
368
+
343
369
  // 1:1 Meeting
344
370
  // 1) You ended a call before but you got a mercury event
345
371
  // Make sure end the call and cleanup the meeting only if the mercury
346
372
  // event says so
347
373
  // 2) Maintain lastSync time in the meetings object which helps to compare
348
374
  // If the meeting came befor or after the sync . ANy meeting start time before the sync time is invalid
375
+
349
376
  // For space Meeting
350
377
  // Check the locus object and see who has joined
378
+
351
379
  // };
352
380
  // rather then locus object change to locus url
381
+
353
382
  if (data.locus && data.locus.fullState && data.locus.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
354
383
  // just ignore the event as its already ended and not active
355
384
  _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
356
-
357
385
  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
386
+ }
360
387
 
388
+ // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
389
+ // Any future events will be neglected
361
390
 
362
391
  if (data.locus && data.locus.self && data.locus.self.state === _constants._LEFT_ && data.locus.self.removed === true) {
363
392
  // just ignore the event as its already ended and not active
364
393
  _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
365
-
366
394
  return;
367
395
  }
368
-
369
396
  this.create(data.locus, _constants._LOCUS_ID_, useRandomDelayForInfo).then(function (newMeeting) {
370
- meeting = newMeeting; // It's a new meeting so initialize the locus data
397
+ meeting = newMeeting;
371
398
 
399
+ // It's a new meeting so initialize the locus data
372
400
  meeting.locusInfo.initialSetup(data.locus);
373
401
  }).catch(function (e) {
374
- console.log(e);
402
+ _loggerProxy.default.logger.error(e);
375
403
  }).finally(function () {
376
404
  // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted
377
405
  // because the other user left so before sending 'added' event make sure it exists in the collection
406
+
378
407
  if (_this2.getMeetingByType(_constants._ID_, meeting.id)) {
379
408
  _metrics.default.postEvent({
380
409
  event: _config.eventType.REMOTE_STARTED,
@@ -383,7 +412,6 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
383
412
  trigger: _config.trigger.MERCURY_EVENT
384
413
  }
385
414
  });
386
-
387
415
  _triggerProxy.default.trigger(_this2, {
388
416
  file: 'meetings',
389
417
  function: 'handleLocusEvent'
@@ -400,33 +428,33 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
400
428
  meeting.locusInfo.parse(meeting, data);
401
429
  }
402
430
  }
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
431
 
432
+ /**
433
+ * handles locus events through mercury that are not roap
434
+ * @param {Object} envelope
435
+ * @param {Object} envelope.data
436
+ * @param {String} envelope.data.eventType
437
+ * @returns {undefined}
438
+ * @private
439
+ * @memberof Meetings
440
+ */
413
441
  }, {
414
442
  key: "handleLocusMercury",
415
443
  value: function handleLocusMercury(envelope) {
416
444
  var data = envelope.data;
445
+ // eslint-disable-next-line @typescript-eslint/no-shadow
417
446
  var eventType = data.eventType;
418
-
419
447
  if (eventType && eventType !== _constants.LOCUSEVENT.MESSAGE_ROAP) {
420
448
  this.handleLocusEvent(data, true);
421
449
  }
422
450
  }
423
- /**
424
- * handles mecury offline event
425
- * @returns {undefined}
426
- * @private
427
- * @memberof Meetings
428
- */
429
451
 
452
+ /**
453
+ * handles mecury offline event
454
+ * @returns {undefined}
455
+ * @private
456
+ * @memberof Meetings
457
+ */
430
458
  }, {
431
459
  key: "handleMercuryOffline",
432
460
  value: function handleMercuryOffline() {
@@ -435,66 +463,74 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
435
463
  function: 'handleMercuryOffline'
436
464
  }, _constants.EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED);
437
465
  }
438
- /**
439
- * registers for locus and roap mercury events
440
- * @returns {undefined}
441
- * @private
442
- * @memberof Meetings
443
- */
444
466
 
467
+ /**
468
+ * registers for locus and roap mercury events
469
+ * @returns {undefined}
470
+ * @private
471
+ * @memberof Meetings
472
+ */
445
473
  }, {
446
474
  key: "listenForEvents",
447
475
  value: function listenForEvents() {
448
476
  var _this3 = this;
449
-
477
+ // @ts-ignore
450
478
  this.webex.internal.mercury.on(_constants.LOCUSEVENT.LOCUS_MERCURY, function (envelope) {
451
479
  _this3.handleLocusMercury(envelope);
452
480
  });
481
+ // @ts-ignore
453
482
  this.webex.internal.mercury.on(_constants.ROAP.ROAP_MERCURY, function (envelope) {
454
483
  _util2.default.handleRoapMercury(envelope, _this3.meetingCollection);
455
484
  });
485
+
486
+ // @ts-ignore
456
487
  this.webex.internal.mercury.on(_constants.ONLINE, function () {
457
488
  _this3.syncMeetings();
458
489
  });
490
+
491
+ // @ts-ignore
459
492
  this.webex.internal.mercury.on(_constants.OFFLINE, function () {
460
493
  _this3.handleMercuryOffline();
461
494
  });
462
495
  }
463
- /**
464
- * stops listening for locus and roap mercury events
465
- * @returns {undefined}
466
- * @private
467
- * @memberof Meetings
468
- */
469
496
 
497
+ /**
498
+ * stops listening for locus and roap mercury events
499
+ * @returns {undefined}
500
+ * @private
501
+ * @memberof Meetings
502
+ */
470
503
  }, {
471
504
  key: "stopListeningForEvents",
472
505
  value: function stopListeningForEvents() {
506
+ // @ts-ignore
473
507
  this.webex.internal.mercury.off(_constants.LOCUSEVENT.LOCUS_MERCURY);
508
+ // @ts-ignore
474
509
  this.webex.internal.mercury.off(_constants.ROAP.ROAP_MERCURY);
510
+ // @ts-ignore
475
511
  this.webex.internal.mercury.off(_constants.ONLINE);
476
512
  }
477
- /**
478
- * @returns {undefined}
479
- * @private
480
- * @memberof Meetings
481
- */
482
513
 
514
+ /**
515
+ * @returns {undefined}
516
+ * @private
517
+ * @memberof Meetings
518
+ */
483
519
  }, {
484
520
  key: "onReady",
485
521
  value: function onReady() {
486
522
  var _this4 = this;
487
-
523
+ // @ts-ignore
488
524
  this.webex.once(_constants.READY, function () {
525
+ // @ts-ignore
489
526
  _config2.default.set(_this4.config);
490
-
527
+ // @ts-ignore
491
528
  _loggerConfig.default.set(_this4.config.logging);
492
-
529
+ // @ts-ignore
493
530
  _loggerProxy.default.set(_this4.webex.logger);
494
-
495
531
  mediaLogger = new MediaLogger();
532
+ (0, _internalMediaCore.setLogger)(mediaLogger);
496
533
 
497
- _internalMediaCore.MediaConnection.setLogger(mediaLogger);
498
534
  /**
499
535
  * The MeetingInfo object to interact with server
500
536
  * @instance
@@ -502,198 +538,198 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
502
538
  * @private
503
539
  * @memberof Meetings
504
540
  */
505
-
506
-
507
- _this4.meetingInfo = _this4.config.experimental.enableUnifiedMeetings ? new _meetingInfoV.default(_this4.webex) : new _meetingInfo.default(_this4.webex);
541
+ // @ts-ignore
542
+ _this4.meetingInfo = _this4.config.experimental.enableUnifiedMeetings ?
543
+ // @ts-ignore
544
+ new _meetingInfoV.default(_this4.webex) :
545
+ // @ts-ignore
546
+ new _meetingInfo.default(_this4.webex);
547
+ // @ts-ignore
508
548
  _this4.personalMeetingRoom = new _personalMeetingRoom.default({
509
549
  meetingInfo: _this4.meetingInfo
510
- }, {
550
+ },
551
+ // @ts-ignore
552
+ {
511
553
  parent: _this4.webex
512
554
  });
513
-
514
555
  _triggerProxy.default.trigger(_this4, {
515
556
  file: 'meetings',
516
557
  function: 'onReady'
517
558
  }, _constants.EVENT_TRIGGERS.MEETINGS_READY);
518
-
519
559
  _util2.default.checkH264Support({
520
560
  disableNotifications: true
521
561
  });
522
-
562
+ // @ts-ignore
523
563
  _metrics.default.initialSetup(_this4.meetingCollection, _this4.webex);
524
564
  });
525
565
  }
526
- /**
527
- * API to toggle unified meetings
528
- * @param {Boolean} changeState
529
- * @private
530
- * @memberof Meetings
531
- * @returns {undefined}
532
- */
533
566
 
567
+ /**
568
+ * API to toggle unified meetings
569
+ * @param {Boolean} changeState
570
+ * @private
571
+ * @memberof Meetings
572
+ * @returns {undefined}
573
+ */
534
574
  }, {
535
575
  key: "_toggleUnifiedMeetings",
536
576
  value: function _toggleUnifiedMeetings(changeState) {
537
577
  var _this$config, _this$config$experime;
538
-
539
578
  if (typeof changeState !== 'boolean') {
540
579
  return;
541
580
  }
542
-
581
+ // @ts-ignore
543
582
  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) {
583
+ // @ts-ignore
544
584
  this.config.experimental.enableUnifiedMeetings = changeState;
585
+ // @ts-ignore
545
586
  this.meetingInfo = changeState ? new _meetingInfoV.default(this.webex) : new _meetingInfo.default(this.webex);
546
587
  }
547
588
  }
548
- /**
549
- * API to enable or disable TURN discovery
550
- * @param {Boolean} enable
551
- * @private
552
- * @memberof Meetings
553
- * @returns {undefined}
554
- */
555
589
 
590
+ /**
591
+ * API to enable or disable TURN discovery
592
+ * @param {Boolean} enable
593
+ * @private
594
+ * @memberof Meetings
595
+ * @returns {undefined}
596
+ */
556
597
  }, {
557
598
  key: "_toggleTurnDiscovery",
558
599
  value: function _toggleTurnDiscovery(enable) {
559
600
  if (typeof enable !== 'boolean') {
560
601
  return;
561
602
  }
562
-
603
+ // @ts-ignore
563
604
  this.config.experimental.enableTurnDiscovery = enable;
564
605
  }
565
- /**
566
- * API to toggle starting adhoc meeting
567
- * @param {Boolean} changeState
568
- * @private
569
- * @memberof Meetings
570
- * @returns {undefined}
571
- */
572
606
 
607
+ /**
608
+ * API to toggle starting adhoc meeting
609
+ * @param {Boolean} changeState
610
+ * @private
611
+ * @memberof Meetings
612
+ * @returns {undefined}
613
+ */
573
614
  }, {
574
615
  key: "_toggleAdhocMeetings",
575
616
  value: function _toggleAdhocMeetings(changeState) {
576
617
  var _this$config2, _this$config2$experim;
577
-
578
618
  if (typeof changeState !== 'boolean') {
579
619
  return;
580
620
  }
581
-
621
+ // @ts-ignore
582
622
  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) {
623
+ // @ts-ignore
583
624
  this.config.experimental.enableAdhocMeetings = changeState;
584
625
  }
585
626
  }
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
627
 
628
+ /**
629
+ * Explicitly sets up the meetings plugin by registering
630
+ * the device, connecting to mercury, and listening for locus events.
631
+ *
632
+ * @returns {Promise}
633
+ * @public
634
+ * @memberof Meetings
635
+ */
595
636
  }, {
596
637
  key: "register",
597
638
  value: function register() {
598
639
  var _this5 = this;
599
-
640
+ // @ts-ignore
600
641
  if (!this.webex.canAuthorize) {
601
642
  _loggerProxy.default.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');
602
-
603
643
  return _promise.default.reject(new Error('SDK cannot authorize'));
604
644
  }
605
-
606
645
  if (this.registered) {
607
646
  _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');
608
-
609
647
  return _promise.default.resolve();
610
648
  }
611
-
612
649
  return _promise.default.all([this.fetchUserPreferredWebexSite(), this.getGeoHint(), this.startReachability().catch(function (error) {
613
650
  _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 () {
651
+ }),
652
+ // @ts-ignore
653
+ this.webex.internal.device.register()
654
+ // @ts-ignore
655
+ .then(function () {
656
+ return _loggerProxy.default.logger.info( // @ts-ignore
657
+ "Meetings:index#register --> INFO, Device registered ".concat(_this5.webex.internal.device.url));
658
+ })
659
+ // @ts-ignore
660
+ .then(function () {
617
661
  return _this5.webex.internal.mercury.connect();
618
662
  }), _util2.default.checkH264Support.call(this)]).then(function () {
619
663
  _this5.listenForEvents();
620
-
621
664
  _triggerProxy.default.trigger(_this5, {
622
665
  file: 'meetings',
623
666
  function: 'register'
624
667
  }, _constants.EVENT_TRIGGERS.MEETINGS_REGISTERED);
625
-
626
668
  _this5.registered = true;
627
-
628
669
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETINGS_REGISTRATION_SUCCESS);
629
670
  }).catch(function (error) {
630
671
  _loggerProxy.default.logger.error("Meetings:index#register --> ERROR, Unable to register, ".concat(error.message));
631
-
632
672
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETINGS_REGISTRATION_FAILED, {
633
673
  reason: error.message,
634
674
  stack: error.stack
635
675
  });
636
-
637
676
  return _promise.default.reject(error);
638
677
  });
639
678
  }
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
679
 
680
+ /**
681
+ * Explicitly tears down the meetings plugin by deregistering
682
+ * the device, disconnecting from mercury, and stops listening to locus events
683
+ *
684
+ * @returns {Promise}
685
+ * @public
686
+ * @memberof Meetings
687
+ */
649
688
  }, {
650
689
  key: "unregister",
651
690
  value: function unregister() {
652
691
  var _this6 = this;
653
-
654
692
  if (!this.registered) {
655
693
  _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
656
-
657
694
  return _promise.default.resolve();
658
695
  }
659
-
660
696
  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
- });
697
+ return (
698
+ // @ts-ignore
699
+ this.webex.internal.mercury.disconnect()
700
+ // @ts-ignore
701
+ .then(function () {
702
+ return _this6.webex.internal.device.unregister();
703
+ }).then(function () {
704
+ _triggerProxy.default.trigger(_this6, {
705
+ file: 'meetings',
706
+ function: 'unregister'
707
+ }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
708
+ _this6.registered = false;
709
+ })
710
+ );
671
711
  }
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
712
 
713
+ /**
714
+ * Uploads logs to the webex services for tracking
715
+ * @param {Object} [options={}]
716
+ * @param {String} [options.callStart] Call Start Time
717
+ * @param {String} [options.feedbackId] ID used for tracking
718
+ * @param {String} [options.locusId]
719
+ * @param {String} [options.correlationId]
720
+ * @param {String} [options.meetingId] webex meeting ID
721
+ * @param {String} [options.userId] userId
722
+ * @param {String} [options.orgId] org id
723
+ * @returns {String} feedback ID logs were submitted under
724
+ */
685
725
  }, {
686
726
  key: "uploadLogs",
687
727
  value: function uploadLogs() {
688
728
  var _this7 = this;
689
-
690
729
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
691
-
692
730
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> uploading logs');
693
-
694
731
  return this.loggerRequest.uploadLogs(options).then(function (uploadResult) {
695
732
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);
696
-
697
733
  _triggerProxy.default.trigger(_this7, {
698
734
  file: 'meetings',
699
735
  function: 'uploadLogs'
@@ -701,9 +737,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
701
737
  meetingId: options.meetingId,
702
738
  details: uploadResult
703
739
  });
740
+ return uploadResult;
704
741
  }).catch(function (uploadError) {
705
742
  _loggerProxy.default.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);
706
-
707
743
  _triggerProxy.default.trigger(_this7, {
708
744
  file: 'meetings',
709
745
  function: 'uploadLogs'
@@ -711,8 +747,8 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
711
747
  meetingId: options.meetingId,
712
748
  reason: uploadError
713
749
  });
714
-
715
750
  _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_FAILURE, {
751
+ // @ts-ignore - seems like typo
716
752
  meetingId: options.meetingsId,
717
753
  reason: uploadError.message,
718
754
  stack: uploadError.stack,
@@ -720,109 +756,105 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
720
756
  });
721
757
  });
722
758
  }
723
- /**
724
- * initializes the reachability instance for Meetings
725
- * @returns {undefined}
726
- * @public
727
- * @memberof Meetings
728
- */
729
759
 
760
+ /**
761
+ * initializes the reachability instance for Meetings
762
+ * @returns {undefined}
763
+ * @public
764
+ * @memberof Meetings
765
+ */
730
766
  }, {
731
767
  key: "setReachability",
732
768
  value: function setReachability() {
769
+ // @ts-ignore
733
770
  this.reachability = new _reachability.default(this.webex);
734
771
  }
735
- /**
736
- * gets the reachability instance for Meetings
737
- * @returns {Reachability}
738
- * @public
739
- * @memberof Meetings
740
- */
741
772
 
773
+ /**
774
+ * gets the reachability instance for Meetings
775
+ * @returns {Reachability}
776
+ * @public
777
+ * @memberof Meetings
778
+ */
742
779
  }, {
743
780
  key: "getReachability",
744
781
  value: function getReachability() {
745
782
  return this.reachability;
746
783
  }
747
- /**
748
- * initializes and starts gathering reachability for Meetings
749
- * @returns {Promise}
750
- * @public
751
- * @memberof Meetings
752
- */
753
784
 
785
+ /**
786
+ * initializes and starts gathering reachability for Meetings
787
+ * @returns {Promise}
788
+ * @public
789
+ * @memberof Meetings
790
+ */
754
791
  }, {
755
792
  key: "startReachability",
756
793
  value: function startReachability() {
757
794
  if (!this.reachability) {
758
795
  this.setReachability();
759
796
  }
760
-
761
797
  return this.getReachability().gatherReachability();
762
798
  }
763
- /**
764
- * Get geoHint for info for meetings
765
- * @returns {Promise}
766
- * @private
767
- * @memberof Meetings
768
- */
769
799
 
800
+ /**
801
+ * Get geoHint for info for meetings
802
+ * @returns {Promise}
803
+ * @private
804
+ * @memberof Meetings
805
+ */
770
806
  }, {
771
807
  key: "getGeoHint",
772
808
  value: function getGeoHint() {
773
809
  var _this8 = this;
774
-
775
810
  return this.request.fetchGeoHint().then(function (res) {
776
811
  _this8.geoHintInfo = res;
777
812
  });
778
813
  }
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
814
 
815
+ /**
816
+ * Fetch user preferred webex site information
817
+ * This also has other infomation about the user
818
+ * @returns {Promise}
819
+ * @private
820
+ * @memberof Meetings
821
+ */
787
822
  }, {
788
823
  key: "fetchUserPreferredWebexSite",
789
824
  value: function fetchUserPreferredWebexSite() {
790
825
  var _this9 = this;
791
-
792
826
  return this.request.getMeetingPreferences().then(function (res) {
793
827
  if (res) {
794
828
  _this9.preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
795
829
  }
796
830
  });
797
831
  }
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
832
 
833
+ /**
834
+ * gets the personal meeting room instance, for saved PMR values for this user
835
+ * @returns {PersonalMeetingRoom}
836
+ * @public
837
+ * @memberof Meetings
838
+ */
805
839
  }, {
806
840
  key: "getPersonalMeetingRoom",
807
841
  value: function getPersonalMeetingRoom() {
808
842
  return this.personalMeetingRoom;
809
843
  }
810
- /**
811
- * @param {Meeting} meeting
812
- * @param {Object} reason
813
- * @param {String} type
814
- * @returns {Undefined}
815
- * @private
816
- * @memberof Meetings
817
- */
818
844
 
845
+ /**
846
+ * @param {Meeting} meeting
847
+ * @param {Object} reason
848
+ * @param {String} type
849
+ * @returns {Undefined}
850
+ * @private
851
+ * @memberof Meetings
852
+ */
819
853
  }, {
820
854
  key: "destroy",
821
855
  value: function destroy(meeting, reason) {
822
856
  _util.default.cleanUp(meeting);
823
-
824
857
  this.meetingCollection.delete(meeting.id);
825
-
826
858
  _triggerProxy.default.trigger(this, {
827
859
  file: 'meetings',
828
860
  function: 'destroy'
@@ -831,57 +863,58 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
831
863
  reason: reason
832
864
  });
833
865
  }
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
866
 
867
+ /**
868
+ * Create a meeting.
869
+ * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}
870
+ * @param {string} [type] - the optional specified type, such as locusId
871
+ * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
872
+ * @returns {Promise<Meeting>} A new Meeting.
873
+ * @public
874
+ * @memberof Meetings
875
+ */
844
876
  }, {
845
877
  key: "create",
846
878
  value: function create(destination) {
847
879
  var _this10 = this;
848
-
849
880
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
850
881
  var useRandomDelayForInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
851
882
  // TODO: type should be from a dictionary
883
+
852
884
  // Validate meeting information based on the provided destination and
853
885
  // type. This must be performed prior to determining if the meeting is
854
886
  // found in the collection, as we mutate the destination for hydra person
855
887
  // id values.
856
- return this.meetingInfo.fetchInfoOptions(destination, type) // Catch a failure to fetch info options.
888
+ return this.meetingInfo.fetchInfoOptions(destination, type)
889
+ // Catch a failure to fetch info options.
857
890
  .catch(function (error) {
858
891
  _loggerProxy.default.logger.info("Meetings:index#create --> INFO, unable to determine info options: ".concat(error.message));
859
892
  }).then(function () {
860
893
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
861
894
  // Normalize the destination.
862
- var targetDest = options.destination || destination; // check for the conversation URL then sip Url
895
+ var targetDest = options.destination || destination;
863
896
 
897
+ // check for the conversation URL then sip Url
864
898
  var meeting = null;
865
-
866
899
  if (type === _constants._CONVERSATION_URL_ || options.type === _constants._CONVERSATION_URL_) {
867
900
  var foundMeeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
868
-
869
901
  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.
902
+ var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
872
903
 
904
+ // If the found meeting is not a calendar meeting, return that meeting.
905
+ // This allows for the creation of instant-meetings when calendar meetings are present.
873
906
  if (foundMeetingIsNotCalendarMeeting) {
874
907
  meeting = foundMeeting;
875
908
  }
876
909
  }
877
- } // Attempt to collect the meeting if it exists.
878
-
910
+ }
879
911
 
912
+ // Attempt to collect the meeting if it exists.
880
913
  if (!meeting) {
881
914
  meeting = _this10.meetingCollection.getByKey(_constants.SIP_URI, targetDest);
882
- } // Validate if a meeting was found.
883
-
915
+ }
884
916
 
917
+ // Validate if a meeting was found.
885
918
  if (!meeting) {
886
919
  // Create a meeting based on the normalized destination and type.
887
920
  return _this10.createMeeting(targetDest, type, useRandomDelayForInfo).then(function (createdMeeting) {
@@ -889,9 +922,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
889
922
  if (createdMeeting && createdMeeting.on) {
890
923
  // Create a destruction event for the meeting.
891
924
  createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
925
+ // @ts-ignore
892
926
  if (_this10.config.autoUploadLogs) {
893
927
  var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4;
894
-
895
928
  _this10.uploadLogs({
896
929
  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,
897
930
  correlationId: createdMeeting.correlationId,
@@ -906,9 +939,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
906
939
  }
907
940
  });
908
941
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
942
+ // @ts-ignore
909
943
  if (_this10.config.autoUploadLogs) {
910
944
  var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4;
911
-
912
945
  _this10.uploadLogs({
913
946
  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,
914
947
  correlationId: meetingInstance.correlationId,
@@ -920,183 +953,165 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
920
953
  });
921
954
  } else {
922
955
  _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
-
956
+ }
925
957
 
958
+ // Return the newly created meeting.
926
959
  return _promise.default.resolve(createdMeeting);
927
960
  });
928
- } // Return the existing meeting.
929
-
961
+ }
930
962
 
963
+ // Return the existing meeting.
931
964
  return _promise.default.resolve(meeting);
932
965
  });
933
966
  }
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
967
 
968
+ /**
969
+ * @param {String} destination see create()
970
+ * @param {String} type see create()
971
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
972
+ * @returns {Promise} a new meeting instance complete with meeting info and destination
973
+ * @private
974
+ * @memberof Meetings
975
+ */
943
976
  }, {
944
977
  key: "createMeeting",
945
978
  value: function () {
946
979
  var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(destination) {
947
980
  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
-
981
+ useRandomDelayForInfo,
982
+ meeting,
983
+ _destination$fullStat,
984
+ waitingTime,
985
+ startTime,
986
+ startTimeDate,
987
+ startTimeDatestamp,
988
+ timeToStart,
989
+ maxWaitingTime,
990
+ isMeetingActive,
991
+ enableUnifiedMeetings,
992
+ meetingAddedType,
993
+ _args = arguments;
962
994
  return _regenerator.default.wrap(function _callee$(_context) {
963
- while (1) {
964
- switch (_context.prev = _context.next) {
965
- case 0:
966
- type = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
967
- useRandomDelayForInfo = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
968
- meeting = new _meeting.default({
969
- userId: this.webex.internal.device.userId,
970
- deviceUrl: this.webex.internal.device.url,
971
- orgId: this.webex.internal.device.orgId,
972
- locus: type === _constants._LOCUS_ID_ ? destination : null,
973
- // pass the locus object if present
974
- meetingInfoProvider: this.meetingInfo,
975
- destination: destination,
976
- destinationType: type
977
- }, {
978
- parent: this.webex
979
- });
980
- this.meetingCollection.set(meeting);
981
- _context.prev = 4;
982
- // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
983
- // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
984
- // between 5 and 2 min (random between 3 minutes) before the meeting starts
985
- // to avoid a spike in traffic to the wbxappi service
986
- waitingTime = 0;
987
-
988
- if (destination.meeting) {
989
- startTime = destination.meeting.startTime;
990
- startTimeDate = new Date(startTime);
991
- startTimeDatestamp = startTimeDate.getTime();
992
- timeToStart = startTimeDatestamp - (0, _now.default)();
993
- maxWaitingTime = Math.max(Math.min(timeToStart, _constants.MAX_RANDOM_DELAY_FOR_MEETING_INFO), 0);
994
- waitingTime = Math.round(Math.random() * maxWaitingTime);
995
- }
996
-
997
- isMeetingActive = !!((_destination$fullStat = destination.fullState) !== null && _destination$fullStat !== void 0 && _destination$fullStat.active);
998
- enableUnifiedMeetings = this.config.experimental.enableUnifiedMeetings;
999
-
1000
- if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
1001
- _context.next = 14;
1002
- break;
1003
- }
1004
-
1005
- meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
1006
- return meeting.fetchMeetingInfo({});
1007
- }, waitingTime);
1008
- meeting.parseMeetingInfo(undefined, destination);
1009
- _context.next = 16;
995
+ while (1) switch (_context.prev = _context.next) {
996
+ case 0:
997
+ type = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
998
+ useRandomDelayForInfo = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
999
+ meeting = new _meeting.default({
1000
+ // @ts-ignore
1001
+ userId: this.webex.internal.device.userId,
1002
+ // @ts-ignore
1003
+ deviceUrl: this.webex.internal.device.url,
1004
+ // @ts-ignore
1005
+ orgId: this.webex.internal.device.orgId,
1006
+ locus: type === _constants._LOCUS_ID_ ? destination : null,
1007
+ // pass the locus object if present
1008
+ meetingInfoProvider: this.meetingInfo,
1009
+ destination: destination,
1010
+ destinationType: type
1011
+ }, {
1012
+ // @ts-ignore
1013
+ parent: this.webex
1014
+ });
1015
+ this.meetingCollection.set(meeting);
1016
+ _context.prev = 4;
1017
+ // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
1018
+ // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
1019
+ // between 5 and 2 min (random between 3 minutes) before the meeting starts
1020
+ // to avoid a spike in traffic to the wbxappi service
1021
+ waitingTime = 0;
1022
+ if (destination.meeting) {
1023
+ startTime = destination.meeting.startTime;
1024
+ startTimeDate = new Date(startTime);
1025
+ startTimeDatestamp = startTimeDate.getTime();
1026
+ timeToStart = startTimeDatestamp - (0, _now.default)();
1027
+ maxWaitingTime = Math.max(Math.min(timeToStart, _constants.MAX_RANDOM_DELAY_FOR_MEETING_INFO), 0);
1028
+ waitingTime = Math.round(Math.random() * maxWaitingTime);
1029
+ }
1030
+ isMeetingActive = !!((_destination$fullStat = destination.fullState) !== null && _destination$fullStat !== void 0 && _destination$fullStat.active); // @ts-ignore
1031
+ enableUnifiedMeetings = this.config.experimental.enableUnifiedMeetings;
1032
+ if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
1033
+ _context.next = 14;
1010
1034
  break;
1011
-
1012
- case 14:
1013
- _context.next = 16;
1035
+ }
1036
+ meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
1014
1037
  return meeting.fetchMeetingInfo({});
1015
-
1016
- case 16:
1017
- _context.next = 22;
1018
- 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
- });
1038
+ }, waitingTime);
1039
+ meeting.parseMeetingInfo(undefined, destination);
1040
+ _context.next = 16;
1041
+ break;
1042
+ case 14:
1043
+ _context.next = 16;
1044
+ return meeting.fetchMeetingInfo({});
1045
+ case 16:
1046
+ _context.next = 22;
1047
+ break;
1048
+ case 18:
1049
+ _context.prev = 18;
1050
+ _context.t0 = _context["catch"](4);
1051
+ if (!(_context.t0 instanceof _captchaError.default) && !(_context.t0 instanceof _passwordError.default)) {
1052
+ // if there is no meeting info we assume its a 1:1 call or wireless share
1053
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1054
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1055
+ }
1056
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
1057
+ case 22:
1058
+ _context.prev = 22;
1059
+ // For type LOCUS_ID we need to parse the locus object to get the information
1060
+ // about the caller and callee
1061
+ // Meeting Added event will be created in `handleLocusEvent`
1062
+ if (type !== _constants._LOCUS_ID_) {
1063
+ if (!meeting.sipUri) {
1064
+ meeting.setSipUri(destination);
1055
1065
  }
1056
1066
 
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
- }
1067
+ // TODO: check if we have to move this to parser
1068
+ meetingAddedType = _util2.default.getMeetingAddedType(type); // We typically shouldn't need to trigger both and event and return a promise.
1069
+ // Is this a special case? We want to make the public API usage as simple as possible.
1070
+ _triggerProxy.default.trigger(this, {
1071
+ file: 'meetings',
1072
+ function: 'createMeeting'
1073
+ }, _constants.EVENT_TRIGGERS.MEETING_ADDED, {
1074
+ meeting: meeting,
1075
+ type: meetingAddedType
1076
+ });
1077
+ }
1078
+ return _context.finish(22);
1079
+ case 25:
1080
+ return _context.abrupt("return", meeting);
1081
+ case 26:
1082
+ case "end":
1083
+ return _context.stop();
1066
1084
  }
1067
1085
  }, _callee, this, [[4, 18, 22, 25]]);
1068
1086
  }));
1069
-
1070
1087
  function createMeeting(_x) {
1071
1088
  return _createMeeting.apply(this, arguments);
1072
1089
  }
1073
-
1074
1090
  return createMeeting;
1075
1091
  }()
1076
1092
  /**
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
-
1093
+ * get a specifc meeting given it's type matched to the value, i.e., locus url
1094
+ * @param {String} type
1095
+ * @param {Object} value
1096
+ * @returns {Meeting}
1097
+ * @public
1098
+ * @memberof Meetings
1099
+ */
1085
1100
  }, {
1086
1101
  key: "getMeetingByType",
1087
1102
  value: function getMeetingByType(type, value) {
1088
1103
  return this.meetingCollection.getByKey(type, value);
1089
1104
  }
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
1105
 
1106
+ /**
1107
+ * Get all meetings.
1108
+ * @param {object} options
1109
+ * @param {object} options.startDate - get meetings after this start date
1110
+ * @param {object} options.endDate - get meetings before this end date
1111
+ * @returns {Object} All currently active meetings.
1112
+ * @public
1113
+ * @memberof Meetings
1114
+ */
1100
1115
  }, {
1101
1116
  key: "getAllMeetings",
1102
1117
  value: function getAllMeetings() {
@@ -1105,57 +1120,56 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1105
1120
  // of meetings.
1106
1121
  return this.meetingCollection.getAll(options);
1107
1122
  }
1108
- /**
1109
- * syncs all the meeting from server
1110
- * @returns {undefined}
1111
- * @public
1112
- * @memberof Meetings
1113
- */
1114
1123
 
1124
+ /**
1125
+ * syncs all the meeting from server
1126
+ * @returns {undefined}
1127
+ * @public
1128
+ * @memberof Meetings
1129
+ */
1115
1130
  }, {
1116
1131
  key: "syncMeetings",
1117
1132
  value: function syncMeetings() {
1118
1133
  var _this11 = this;
1119
-
1120
1134
  return this.request.getActiveMeetings().then(function (locusArray) {
1121
1135
  var activeLocusUrl = [];
1122
-
1123
1136
  if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1124
1137
  locusArray.loci.forEach(function (locus) {
1125
1138
  activeLocusUrl.push(locus.url);
1126
-
1127
1139
  _this11.handleLocusEvent({
1128
1140
  locus: locus,
1129
1141
  locusUrl: locus.url
1130
1142
  });
1131
1143
  });
1132
1144
  }
1133
-
1134
1145
  var meetingsCollection = _this11.meetingCollection.getAll();
1135
-
1136
1146
  if ((0, _keys.default)(meetingsCollection).length > 0) {
1137
1147
  // Some time the mercury event is missed after mercury reconnect
1138
1148
  // if sync returns no locus then clear all the meetings
1139
1149
  for (var _i = 0, _Object$values = (0, _values.default)(meetingsCollection); _i < _Object$values.length; _i++) {
1140
1150
  var meeting = _Object$values[_i];
1141
-
1151
+ // @ts-ignore
1142
1152
  if (!activeLocusUrl.includes(meeting.locusUrl)) {
1143
1153
  // destroy function also uploads logs
1154
+ // @ts-ignore
1144
1155
  _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1145
1156
  }
1146
1157
  }
1147
1158
  }
1159
+ }).catch(function (error) {
1160
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1161
+ throw new Error(error);
1148
1162
  });
1149
1163
  }
1150
- /**
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
- */
1158
1164
 
1165
+ /**
1166
+ * Get all scheduled meetings.
1167
+ * @param {object} options
1168
+ * @param {object} options.startDate - get meetings after this start date
1169
+ * @param {object} options.endDate - get meetings before this end date
1170
+ * @returns {Object} All scheduled meetings.
1171
+ * @memberof Meetings
1172
+ */
1159
1173
  }, {
1160
1174
  key: "getScheduledMeetings",
1161
1175
  value: function getScheduledMeetings() {
@@ -1163,11 +1177,11 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1163
1177
  scheduled: true
1164
1178
  });
1165
1179
  }
1166
- /**
1167
- * Get the logger instance for plugin-meetings
1168
- * @returns {Logger}
1169
- */
1170
1180
 
1181
+ /**
1182
+ * Get the logger instance for plugin-meetings
1183
+ * @returns {Logger}
1184
+ */
1171
1185
  }, {
1172
1186
  key: "getLogger",
1173
1187
  value: function getLogger() {
@@ -1176,6 +1190,5 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1176
1190
  }]);
1177
1191
  return Meetings;
1178
1192
  }(_webexCore.WebexPlugin);
1179
-
1180
1193
  exports.default = Meetings;
1181
1194
  //# sourceMappingURL=index.js.map