@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.131

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