@webex/plugin-meetings 3.0.0-beta.8 → 3.0.0-beta.80

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