@webex/plugin-meetings 3.0.0-beta.1 → 3.0.0-beta.104

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