@webex/plugin-meetings 2.59.8-next.2 → 2.60.0-next.1

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 (433) hide show
  1. package/README.md +46 -8
  2. package/dist/annotation/annotation.types.js +7 -0
  3. package/dist/annotation/annotation.types.js.map +1 -0
  4. package/dist/annotation/constants.js +41 -0
  5. package/dist/annotation/constants.js.map +1 -0
  6. package/dist/annotation/index.js +357 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +215 -0
  9. package/dist/breakouts/breakout.js.map +1 -0
  10. package/dist/breakouts/collection.js +22 -0
  11. package/dist/breakouts/collection.js.map +1 -0
  12. package/dist/breakouts/edit-lock-error.js +51 -0
  13. package/dist/breakouts/edit-lock-error.js.map +1 -0
  14. package/dist/breakouts/events.js +44 -0
  15. package/dist/breakouts/events.js.map +1 -0
  16. package/dist/breakouts/index.js +1047 -0
  17. package/dist/breakouts/index.js.map +1 -0
  18. package/dist/breakouts/request.js +77 -0
  19. package/dist/breakouts/request.js.map +1 -0
  20. package/dist/breakouts/utils.js +64 -0
  21. package/dist/breakouts/utils.js.map +1 -0
  22. package/dist/common/browser-detection.js +1 -2
  23. package/dist/common/browser-detection.js.map +1 -1
  24. package/dist/common/collection.js +1 -2
  25. package/dist/common/collection.js.map +1 -1
  26. package/dist/common/config.js +1 -2
  27. package/dist/common/config.js.map +1 -1
  28. package/dist/common/errors/captcha-error.js +1 -2
  29. package/dist/common/errors/captcha-error.js.map +1 -1
  30. package/dist/common/errors/intent-to-join.js +1 -2
  31. package/dist/common/errors/intent-to-join.js.map +1 -1
  32. package/dist/common/errors/join-meeting.js +1 -2
  33. package/dist/common/errors/join-meeting.js.map +1 -1
  34. package/dist/common/errors/media.js +1 -2
  35. package/dist/common/errors/media.js.map +1 -1
  36. package/dist/common/errors/no-meeting-info.js +50 -0
  37. package/dist/common/errors/no-meeting-info.js.map +1 -0
  38. package/dist/common/errors/parameter.js +3 -4
  39. package/dist/common/errors/parameter.js.map +1 -1
  40. package/dist/common/errors/password-error.js +1 -2
  41. package/dist/common/errors/password-error.js.map +1 -1
  42. package/dist/common/errors/permission.js +1 -2
  43. package/dist/common/errors/permission.js.map +1 -1
  44. package/dist/common/errors/reclaim-host-role-errors.js +154 -0
  45. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
  46. package/dist/common/errors/reconnection-in-progress.js +1 -2
  47. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  48. package/dist/common/errors/reconnection.js +1 -2
  49. package/dist/common/errors/reconnection.js.map +1 -1
  50. package/dist/common/errors/stats.js +1 -2
  51. package/dist/common/errors/stats.js.map +1 -1
  52. package/dist/common/errors/webex-errors.js +48 -28
  53. package/dist/common/errors/webex-errors.js.map +1 -1
  54. package/dist/common/errors/webex-meetings-error.js +1 -2
  55. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  56. package/dist/common/events/events-scope.js +1 -2
  57. package/dist/common/events/events-scope.js.map +1 -1
  58. package/dist/common/events/events.js +1 -2
  59. package/dist/common/events/events.js.map +1 -1
  60. package/dist/common/events/trigger-proxy.js +1 -2
  61. package/dist/common/events/trigger-proxy.js.map +1 -1
  62. package/dist/common/events/util.js +1 -2
  63. package/dist/common/events/util.js.map +1 -1
  64. package/dist/common/logs/logger-config.js +1 -2
  65. package/dist/common/logs/logger-config.js.map +1 -1
  66. package/dist/common/logs/logger-proxy.js +2 -3
  67. package/dist/common/logs/logger-proxy.js.map +1 -1
  68. package/dist/common/logs/request.js +8 -5
  69. package/dist/common/logs/request.js.map +1 -1
  70. package/dist/common/queue.js +22 -9
  71. package/dist/common/queue.js.map +1 -1
  72. package/dist/config.js +9 -12
  73. package/dist/config.js.map +1 -1
  74. package/dist/constants.js +437 -433
  75. package/dist/constants.js.map +1 -1
  76. package/dist/controls-options-manager/constants.js +3 -6
  77. package/dist/controls-options-manager/constants.js.map +1 -1
  78. package/dist/controls-options-manager/enums.js +14 -6
  79. package/dist/controls-options-manager/enums.js.map +1 -1
  80. package/dist/controls-options-manager/index.js +126 -37
  81. package/dist/controls-options-manager/index.js.map +1 -1
  82. package/dist/controls-options-manager/types.js +7 -0
  83. package/dist/controls-options-manager/types.js.map +1 -0
  84. package/dist/controls-options-manager/util.js +309 -19
  85. package/dist/controls-options-manager/util.js.map +1 -1
  86. package/dist/index.js +116 -4
  87. package/dist/index.js.map +1 -1
  88. package/dist/interpretation/collection.js +22 -0
  89. package/dist/interpretation/collection.js.map +1 -0
  90. package/dist/interpretation/index.js +365 -0
  91. package/dist/interpretation/index.js.map +1 -0
  92. package/dist/interpretation/siLanguage.js +24 -0
  93. package/dist/interpretation/siLanguage.js.map +1 -0
  94. package/dist/locus-info/controlsUtils.js +95 -6
  95. package/dist/locus-info/controlsUtils.js.map +1 -1
  96. package/dist/locus-info/embeddedAppsUtils.js +3 -4
  97. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  98. package/dist/locus-info/fullState.js +1 -2
  99. package/dist/locus-info/fullState.js.map +1 -1
  100. package/dist/locus-info/hostUtils.js +1 -2
  101. package/dist/locus-info/hostUtils.js.map +1 -1
  102. package/dist/locus-info/index.js +408 -67
  103. package/dist/locus-info/index.js.map +1 -1
  104. package/dist/locus-info/infoUtils.js +13 -5
  105. package/dist/locus-info/infoUtils.js.map +1 -1
  106. package/dist/locus-info/mediaSharesUtils.js +58 -3
  107. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  108. package/dist/locus-info/parser.js +251 -78
  109. package/dist/locus-info/parser.js.map +1 -1
  110. package/dist/locus-info/selfUtils.js +97 -13
  111. package/dist/locus-info/selfUtils.js.map +1 -1
  112. package/dist/media/index.js +106 -319
  113. package/dist/media/index.js.map +1 -1
  114. package/dist/media/properties.js +96 -153
  115. package/dist/media/properties.js.map +1 -1
  116. package/dist/media/util.js +1 -22
  117. package/dist/media/util.js.map +1 -1
  118. package/dist/mediaQualityMetrics/config.js +498 -493
  119. package/dist/mediaQualityMetrics/config.js.map +1 -1
  120. package/dist/meeting/in-meeting-actions.js +90 -3
  121. package/dist/meeting/in-meeting-actions.js.map +1 -1
  122. package/dist/meeting/index.js +4579 -2951
  123. package/dist/meeting/index.js.map +1 -1
  124. package/dist/meeting/locusMediaRequest.js +291 -0
  125. package/dist/meeting/locusMediaRequest.js.map +1 -0
  126. package/dist/meeting/muteState.js +224 -133
  127. package/dist/meeting/muteState.js.map +1 -1
  128. package/dist/meeting/request.js +295 -197
  129. package/dist/meeting/request.js.map +1 -1
  130. package/dist/meeting/request.type.js +7 -0
  131. package/dist/meeting/request.type.js.map +1 -0
  132. package/dist/meeting/state.js +1 -2
  133. package/dist/meeting/state.js.map +1 -1
  134. package/dist/meeting/util.js +602 -432
  135. package/dist/meeting/util.js.map +1 -1
  136. package/dist/meeting-info/collection.js +1 -2
  137. package/dist/meeting-info/collection.js.map +1 -1
  138. package/dist/meeting-info/index.js +74 -7
  139. package/dist/meeting-info/index.js.map +1 -1
  140. package/dist/meeting-info/meeting-info-v2.js +197 -63
  141. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  142. package/dist/meeting-info/request.js +1 -2
  143. package/dist/meeting-info/request.js.map +1 -1
  144. package/dist/meeting-info/util.js +2 -3
  145. package/dist/meeting-info/util.js.map +1 -1
  146. package/dist/meeting-info/utilv2.js +25 -12
  147. package/dist/meeting-info/utilv2.js.map +1 -1
  148. package/dist/meetings/collection.js +23 -2
  149. package/dist/meetings/collection.js.map +1 -1
  150. package/dist/meetings/index.js +464 -123
  151. package/dist/meetings/index.js.map +1 -1
  152. package/dist/meetings/meetings.types.js +7 -0
  153. package/dist/meetings/meetings.types.js.map +1 -0
  154. package/dist/meetings/request.js +4 -3
  155. package/dist/meetings/request.js.map +1 -1
  156. package/dist/meetings/util.js +107 -6
  157. package/dist/meetings/util.js.map +1 -1
  158. package/dist/member/index.js +54 -2
  159. package/dist/member/index.js.map +1 -1
  160. package/dist/member/member.types.js +3 -4
  161. package/dist/member/member.types.js.map +1 -1
  162. package/dist/member/types.js +23 -0
  163. package/dist/member/types.js.map +1 -0
  164. package/dist/member/util.js +131 -29
  165. package/dist/member/util.js.map +1 -1
  166. package/dist/members/collection.js +11 -2
  167. package/dist/members/collection.js.map +1 -1
  168. package/dist/members/index.js +172 -8
  169. package/dist/members/index.js.map +1 -1
  170. package/dist/members/request.js +108 -41
  171. package/dist/members/request.js.map +1 -1
  172. package/dist/members/types.js +14 -0
  173. package/dist/members/types.js.map +1 -0
  174. package/dist/members/util.js +327 -234
  175. package/dist/members/util.js.map +1 -1
  176. package/dist/metrics/constants.js +14 -7
  177. package/dist/metrics/constants.js.map +1 -1
  178. package/dist/metrics/index.js +4 -452
  179. package/dist/metrics/index.js.map +1 -1
  180. package/dist/multistream/mediaRequestManager.js +344 -0
  181. package/dist/multistream/mediaRequestManager.js.map +1 -0
  182. package/dist/multistream/receiveSlot.js +200 -0
  183. package/dist/multistream/receiveSlot.js.map +1 -0
  184. package/dist/multistream/receiveSlotManager.js +174 -0
  185. package/dist/multistream/receiveSlotManager.js.map +1 -0
  186. package/dist/multistream/remoteMedia.js +268 -0
  187. package/dist/multistream/remoteMedia.js.map +1 -0
  188. package/dist/multistream/remoteMediaGroup.js +267 -0
  189. package/dist/multistream/remoteMediaGroup.js.map +1 -0
  190. package/dist/multistream/remoteMediaManager.js +1211 -0
  191. package/dist/multistream/remoteMediaManager.js.map +1 -0
  192. package/dist/multistream/sendSlotManager.js +236 -0
  193. package/dist/multistream/sendSlotManager.js.map +1 -0
  194. package/dist/networkQualityMonitor/index.js +5 -4
  195. package/dist/networkQualityMonitor/index.js.map +1 -1
  196. package/dist/personal-meeting-room/index.js +2 -3
  197. package/dist/personal-meeting-room/index.js.map +1 -1
  198. package/dist/personal-meeting-room/request.js +2 -3
  199. package/dist/personal-meeting-room/request.js.map +1 -1
  200. package/dist/personal-meeting-room/util.js +1 -2
  201. package/dist/personal-meeting-room/util.js.map +1 -1
  202. package/dist/reachability/index.js +258 -72
  203. package/dist/reachability/index.js.map +1 -1
  204. package/dist/reachability/request.js +18 -10
  205. package/dist/reachability/request.js.map +1 -1
  206. package/dist/reactions/constants.js +12 -0
  207. package/dist/reactions/constants.js.map +1 -0
  208. package/dist/reactions/reactions.js +4 -6
  209. package/dist/reactions/reactions.js.map +1 -1
  210. package/dist/reactions/reactions.type.js +21 -23
  211. package/dist/reactions/reactions.type.js.map +1 -1
  212. package/dist/reconnection-manager/index.js +272 -220
  213. package/dist/reconnection-manager/index.js.map +1 -1
  214. package/dist/recording-controller/enums.js +4 -5
  215. package/dist/recording-controller/enums.js.map +1 -1
  216. package/dist/recording-controller/index.js +57 -46
  217. package/dist/recording-controller/index.js.map +1 -1
  218. package/dist/recording-controller/util.js +10 -10
  219. package/dist/recording-controller/util.js.map +1 -1
  220. package/dist/roap/index.js +101 -235
  221. package/dist/roap/index.js.map +1 -1
  222. package/dist/roap/request.js +126 -180
  223. package/dist/roap/request.js.map +1 -1
  224. package/dist/roap/turnDiscovery.js +115 -105
  225. package/dist/roap/turnDiscovery.js.map +1 -1
  226. package/dist/rtcMetrics/constants.js +11 -0
  227. package/dist/rtcMetrics/constants.js.map +1 -0
  228. package/dist/rtcMetrics/index.js +115 -0
  229. package/dist/rtcMetrics/index.js.map +1 -0
  230. package/dist/statsAnalyzer/global.js +2 -93
  231. package/dist/statsAnalyzer/global.js.map +1 -1
  232. package/dist/statsAnalyzer/index.js +374 -374
  233. package/dist/statsAnalyzer/index.js.map +1 -1
  234. package/dist/statsAnalyzer/mqaUtil.js +100 -66
  235. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  236. package/dist/transcription/index.js +1 -2
  237. package/dist/transcription/index.js.map +1 -1
  238. package/dist/webinar/collection.js +43 -0
  239. package/dist/webinar/collection.js.map +1 -0
  240. package/dist/webinar/index.js +68 -0
  241. package/dist/webinar/index.js.map +1 -0
  242. package/package.json +27 -18
  243. package/src/annotation/annotation.types.ts +50 -0
  244. package/src/annotation/constants.ts +36 -0
  245. package/src/annotation/index.ts +328 -0
  246. package/src/breakouts/README.md +220 -0
  247. package/src/breakouts/breakout.ts +188 -0
  248. package/src/breakouts/collection.ts +19 -0
  249. package/src/breakouts/edit-lock-error.ts +25 -0
  250. package/src/breakouts/events.ts +56 -0
  251. package/src/breakouts/index.ts +925 -0
  252. package/src/breakouts/request.ts +55 -0
  253. package/src/breakouts/utils.ts +57 -0
  254. package/src/common/errors/no-meeting-info.ts +24 -0
  255. package/src/common/errors/reclaim-host-role-errors.ts +134 -0
  256. package/src/common/errors/webex-errors.ts +36 -12
  257. package/src/common/logs/logger-proxy.ts +1 -1
  258. package/src/common/logs/request.ts +5 -1
  259. package/src/common/queue.ts +22 -8
  260. package/src/config.ts +7 -9
  261. package/src/constants.ts +263 -89
  262. package/src/controls-options-manager/enums.ts +11 -1
  263. package/src/controls-options-manager/index.ts +116 -21
  264. package/src/controls-options-manager/types.ts +59 -0
  265. package/src/controls-options-manager/util.ts +294 -14
  266. package/src/index.ts +40 -0
  267. package/src/interpretation/README.md +60 -0
  268. package/src/interpretation/collection.ts +19 -0
  269. package/src/interpretation/index.ts +332 -0
  270. package/src/interpretation/siLanguage.ts +18 -0
  271. package/src/locus-info/controlsUtils.ts +110 -0
  272. package/src/locus-info/index.ts +449 -61
  273. package/src/locus-info/infoUtils.ts +14 -2
  274. package/src/locus-info/mediaSharesUtils.ts +64 -0
  275. package/src/locus-info/parser.ts +258 -47
  276. package/src/locus-info/selfUtils.ts +85 -2
  277. package/src/media/index.ts +153 -370
  278. package/src/media/properties.ts +106 -136
  279. package/src/media/util.ts +0 -21
  280. package/src/mediaQualityMetrics/config.ts +379 -377
  281. package/src/meeting/in-meeting-actions.ts +168 -0
  282. package/src/meeting/index.ts +3801 -2457
  283. package/src/meeting/locusMediaRequest.ts +313 -0
  284. package/src/meeting/muteState.ts +224 -138
  285. package/src/meeting/request.ts +207 -127
  286. package/src/meeting/request.type.ts +13 -0
  287. package/src/meeting/util.ts +590 -423
  288. package/src/meeting-info/index.ts +81 -8
  289. package/src/meeting-info/meeting-info-v2.ts +159 -13
  290. package/src/meeting-info/util.ts +1 -1
  291. package/src/meeting-info/utilv2.ts +22 -9
  292. package/src/meetings/collection.ts +20 -0
  293. package/src/meetings/index.ts +466 -124
  294. package/src/meetings/meetings.types.ts +12 -0
  295. package/src/meetings/request.ts +2 -0
  296. package/src/meetings/util.ts +116 -5
  297. package/src/member/index.ts +52 -1
  298. package/src/member/types.ts +38 -0
  299. package/src/member/util.ts +139 -28
  300. package/src/members/collection.ts +8 -0
  301. package/src/members/index.ts +196 -7
  302. package/src/members/request.ts +97 -17
  303. package/src/members/types.ts +29 -0
  304. package/src/members/util.ts +333 -240
  305. package/src/metrics/constants.ts +12 -4
  306. package/src/metrics/index.ts +1 -471
  307. package/src/multistream/mediaRequestManager.ts +440 -0
  308. package/src/multistream/receiveSlot.ts +184 -0
  309. package/src/multistream/receiveSlotManager.ts +166 -0
  310. package/src/multistream/remoteMedia.ts +254 -0
  311. package/src/multistream/remoteMediaGroup.ts +284 -0
  312. package/src/multistream/remoteMediaManager.ts +1145 -0
  313. package/src/multistream/sendSlotManager.ts +170 -0
  314. package/src/networkQualityMonitor/index.ts +6 -6
  315. package/src/reachability/index.ts +238 -45
  316. package/src/reachability/request.ts +17 -8
  317. package/src/reactions/constants.ts +4 -0
  318. package/src/reactions/reactions.ts +4 -4
  319. package/src/reactions/reactions.type.ts +30 -4
  320. package/src/reconnection-manager/index.ts +124 -107
  321. package/src/recording-controller/index.ts +20 -3
  322. package/src/recording-controller/util.ts +26 -9
  323. package/src/roap/index.ts +98 -240
  324. package/src/roap/request.ts +74 -148
  325. package/src/roap/turnDiscovery.ts +62 -56
  326. package/src/rtcMetrics/constants.ts +3 -0
  327. package/src/rtcMetrics/index.ts +100 -0
  328. package/src/statsAnalyzer/global.ts +1 -92
  329. package/src/statsAnalyzer/index.ts +429 -447
  330. package/src/statsAnalyzer/mqaUtil.ts +105 -103
  331. package/src/webinar/collection.ts +31 -0
  332. package/src/webinar/index.ts +62 -0
  333. package/test/integration/spec/converged-space-meetings.js +233 -0
  334. package/test/integration/spec/journey.js +320 -264
  335. package/test/integration/spec/space-meeting.js +77 -4
  336. package/test/unit/spec/annotation/index.ts +418 -0
  337. package/test/unit/spec/breakouts/breakout.ts +237 -0
  338. package/test/unit/spec/breakouts/collection.ts +15 -0
  339. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  340. package/test/unit/spec/breakouts/events.ts +89 -0
  341. package/test/unit/spec/breakouts/index.ts +1790 -0
  342. package/test/unit/spec/breakouts/request.ts +104 -0
  343. package/test/unit/spec/breakouts/utils.js +72 -0
  344. package/test/unit/spec/common/queue.js +31 -2
  345. package/test/unit/spec/controls-options-manager/index.js +163 -0
  346. package/test/unit/spec/controls-options-manager/util.js +576 -60
  347. package/test/unit/spec/fixture/locus.js +1 -0
  348. package/test/unit/spec/interpretation/collection.ts +15 -0
  349. package/test/unit/spec/interpretation/index.ts +589 -0
  350. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  351. package/test/unit/spec/locus-info/controlsUtils.js +323 -30
  352. package/test/unit/spec/locus-info/index.js +1390 -16
  353. package/test/unit/spec/locus-info/infoUtils.js +54 -16
  354. package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
  355. package/test/unit/spec/locus-info/lib/selfConstant.js +48 -0
  356. package/test/unit/spec/locus-info/mediaSharesUtils.ts +32 -0
  357. package/test/unit/spec/locus-info/parser.js +116 -35
  358. package/test/unit/spec/locus-info/selfUtils.js +275 -0
  359. package/test/unit/spec/media/index.ts +274 -0
  360. package/test/unit/spec/media/properties.ts +75 -84
  361. package/test/unit/spec/meeting/in-meeting-actions.ts +82 -0
  362. package/test/unit/spec/meeting/index.js +7420 -3125
  363. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  364. package/test/unit/spec/meeting/muteState.js +407 -212
  365. package/test/unit/spec/meeting/request.js +512 -42
  366. package/test/unit/spec/meeting/utils.js +741 -24
  367. package/test/unit/spec/meeting-info/index.js +300 -0
  368. package/test/unit/spec/meeting-info/meetinginfov2.js +500 -6
  369. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  370. package/test/unit/spec/meetings/collection.js +14 -0
  371. package/test/unit/spec/meetings/index.js +1012 -209
  372. package/test/unit/spec/meetings/utils.js +202 -2
  373. package/test/unit/spec/member/index.js +38 -8
  374. package/test/unit/spec/member/util.js +528 -27
  375. package/test/unit/spec/members/index.js +597 -3
  376. package/test/unit/spec/members/request.js +206 -27
  377. package/test/unit/spec/members/utils.js +210 -0
  378. package/test/unit/spec/metrics/index.js +1 -50
  379. package/test/unit/spec/multistream/mediaRequestManager.ts +1418 -0
  380. package/test/unit/spec/multistream/receiveSlot.ts +163 -0
  381. package/test/unit/spec/multistream/receiveSlotManager.ts +203 -0
  382. package/test/unit/spec/multistream/remoteMedia.ts +255 -0
  383. package/test/unit/spec/multistream/remoteMediaGroup.ts +662 -0
  384. package/test/unit/spec/multistream/remoteMediaManager.ts +1924 -0
  385. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  386. package/test/unit/spec/networkQualityMonitor/index.js +4 -4
  387. package/test/unit/spec/reachability/index.ts +598 -24
  388. package/test/unit/spec/reachability/request.js +68 -0
  389. package/test/unit/spec/reconnection-manager/index.js +130 -22
  390. package/test/unit/spec/recording-controller/index.js +293 -218
  391. package/test/unit/spec/recording-controller/util.js +223 -96
  392. package/test/unit/spec/roap/index.ts +200 -77
  393. package/test/unit/spec/roap/request.ts +232 -0
  394. package/test/unit/spec/roap/turnDiscovery.ts +86 -48
  395. package/test/unit/spec/rtcMetrics/index.ts +73 -0
  396. package/test/unit/spec/stats-analyzer/index.js +205 -50
  397. package/test/unit/spec/webinar/collection.ts +13 -0
  398. package/test/unit/spec/webinar/index.ts +60 -0
  399. package/test/utils/constants.js +9 -0
  400. package/test/utils/integrationTestUtils.js +46 -0
  401. package/test/utils/testUtils.js +0 -45
  402. package/test/utils/webex-config.js +4 -0
  403. package/test/utils/webex-test-users.js +7 -3
  404. package/dist/meeting/effectsState.js +0 -260
  405. package/dist/meeting/effectsState.js.map +0 -1
  406. package/dist/metrics/config.js +0 -289
  407. package/dist/metrics/config.js.map +0 -1
  408. package/dist/peer-connection-manager/index.js +0 -671
  409. package/dist/peer-connection-manager/index.js.map +0 -1
  410. package/dist/peer-connection-manager/util.js +0 -110
  411. package/dist/peer-connection-manager/util.js.map +0 -1
  412. package/dist/roap/collection.js +0 -63
  413. package/dist/roap/collection.js.map +0 -1
  414. package/dist/roap/handler.js +0 -279
  415. package/dist/roap/handler.js.map +0 -1
  416. package/dist/roap/state.js +0 -127
  417. package/dist/roap/state.js.map +0 -1
  418. package/dist/roap/util.js +0 -76
  419. package/dist/roap/util.js.map +0 -1
  420. package/src/index.js +0 -15
  421. package/src/meeting/effectsState.ts +0 -209
  422. package/src/metrics/config.ts +0 -485
  423. package/src/peer-connection-manager/index.ts +0 -847
  424. package/src/peer-connection-manager/util.ts +0 -119
  425. package/src/roap/collection.ts +0 -62
  426. package/src/roap/handler.ts +0 -294
  427. package/src/roap/state.ts +0 -156
  428. package/src/roap/util.ts +0 -100
  429. package/test/unit/spec/meeting/effectsState.js +0 -281
  430. package/test/unit/spec/peerconnection-manager/index.js +0 -218
  431. package/test/unit/spec/peerconnection-manager/utils.js +0 -49
  432. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -388
  433. package/test/unit/spec/roap/util.js +0 -30
@@ -1,32 +1,43 @@
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");
5
+ var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
6
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
7
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
8
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
9
+ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
4
10
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
11
+ var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
5
12
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
13
  _Object$defineProperty(exports, "__esModule", {
7
14
  value: true
8
15
  });
9
16
  exports.default = void 0;
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
11
17
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
12
18
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
13
19
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
14
20
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
21
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
22
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
15
23
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
16
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
17
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
18
24
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
19
25
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
20
26
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
21
27
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
22
28
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
29
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
30
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
23
31
  require("@webex/internal-plugin-mercury");
32
+ require("@webex/internal-plugin-conversation");
33
+ require("@webex/internal-plugin-metrics");
24
34
  var _webexCore = require("@webex/webex-core");
35
+ var _internalMediaCore = require("@webex/internal-media-core");
36
+ var mediaHelpersModule = _interopRequireWildcard(require("@webex/media-helpers"));
25
37
  require("webrtc-adapter");
26
38
  var _metrics = _interopRequireDefault(require("../metrics"));
27
- var _config = require("../metrics/config");
28
39
  var _loggerConfig = _interopRequireDefault(require("../common/logs/logger-config"));
29
- var _config2 = _interopRequireDefault(require("../common/config"));
40
+ var _config = _interopRequireDefault(require("../common/config"));
30
41
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
31
42
  var _request = _interopRequireDefault(require("../common/logs/request"));
32
43
  var _triggerProxy = _interopRequireDefault(require("../common/events/trigger-proxy"));
@@ -44,8 +55,59 @@ var _passwordError = _interopRequireDefault(require("../common/errors/password-e
44
55
  var _captchaError = _interopRequireDefault(require("../common/errors/captcha-error"));
45
56
  var _collection = _interopRequireDefault(require("./collection"));
46
57
  var _util2 = _interopRequireDefault(require("./util"));
58
+ var _permission = _interopRequireDefault(require("../common/errors/permission"));
59
+ var _webexErrors = require("../common/errors/webex-errors");
60
+ var _noMeetingInfo = _interopRequireDefault(require("../common/errors/no-meeting-info"));
61
+ function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
62
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
63
+ function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
64
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
47
65
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
48
- 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; } }
66
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint no-shadow: ["error", { "allow": ["eventType"] }] */ // @ts-ignore
67
+ var mediaLogger;
68
+ var MediaLogger = /*#__PURE__*/function () {
69
+ function MediaLogger() {
70
+ (0, _classCallCheck2.default)(this, MediaLogger);
71
+ }
72
+ (0, _createClass2.default)(MediaLogger, [{
73
+ key: "info",
74
+ value: function info() {
75
+ var _LoggerProxy$logger;
76
+ (_LoggerProxy$logger = _loggerProxy.default.logger).info.apply(_LoggerProxy$logger, arguments);
77
+ }
78
+ }, {
79
+ key: "log",
80
+ value: function log() {
81
+ var _LoggerProxy$logger2;
82
+ (_LoggerProxy$logger2 = _loggerProxy.default.logger).log.apply(_LoggerProxy$logger2, arguments);
83
+ }
84
+ }, {
85
+ key: "error",
86
+ value: function error() {
87
+ var _LoggerProxy$logger3;
88
+ (_LoggerProxy$logger3 = _loggerProxy.default.logger).error.apply(_LoggerProxy$logger3, arguments);
89
+ }
90
+ }, {
91
+ key: "warn",
92
+ value: function warn() {
93
+ var _LoggerProxy$logger4;
94
+ (_LoggerProxy$logger4 = _loggerProxy.default.logger).warn.apply(_LoggerProxy$logger4, arguments);
95
+ }
96
+ }, {
97
+ key: "trace",
98
+ value: function trace() {
99
+ var _LoggerProxy$logger5;
100
+ (_LoggerProxy$logger5 = _loggerProxy.default.logger).trace.apply(_LoggerProxy$logger5, arguments);
101
+ }
102
+ }, {
103
+ key: "debug",
104
+ value: function debug() {
105
+ var _LoggerProxy$logger6;
106
+ (_LoggerProxy$logger6 = _loggerProxy.default.logger).debug.apply(_LoggerProxy$logger6, arguments);
107
+ }
108
+ }]);
109
+ return MediaLogger;
110
+ }();
49
111
  /**
50
112
  * Meetings Ready Event
51
113
  * Emitted when the meetings instance on webex is ready
@@ -93,7 +155,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
93
155
  * Maintain a cache of meetings and sync with services.
94
156
  * @class
95
157
  */
96
- var Meetings = /*#__PURE__*/function (_WebexPlugin) {
158
+ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
97
159
  (0, _inherits2.default)(Meetings, _WebexPlugin);
98
160
  var _super = _createSuper(Meetings);
99
161
  /**
@@ -111,13 +173,14 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
111
173
  _this = _super.call.apply(_super, [this].concat(args));
112
174
 
113
175
  /**
114
- * The Meetings request to interact with server
176
+ * The webrtc-core media helpers. This is a temporary solution required for the SDK sample app
177
+ * to be able to call media helper functions.
178
+ *
115
179
  * @instance
116
180
  * @type {Object}
117
181
  * @private
118
182
  * @memberof Meetings
119
183
  */
120
- // @ts-ignore
121
184
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loggerRequest", void 0);
122
185
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "media", void 0);
123
186
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingCollection", void 0);
@@ -128,7 +191,77 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
128
191
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "request", void 0);
129
192
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "geoHintInfo", void 0);
130
193
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingInfo", void 0);
194
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaHelpers", void 0);
195
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "breakoutLocusForHandleLater", void 0);
131
196
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.MEETINGS);
197
+ /**
198
+ * Creates a noise reduction effect
199
+ *
200
+ * @param {INoiseReductionEffect} options optional custom effect options
201
+ * @returns {Promise<effect>} noise reduction effect.
202
+ * @public
203
+ * @memberof Meetings
204
+ */
205
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createNoiseReductionEffect", /*#__PURE__*/function () {
206
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options) {
207
+ var authToken;
208
+ return _regenerator.default.wrap(function _callee$(_context) {
209
+ while (1) switch (_context.prev = _context.next) {
210
+ case 0:
211
+ // @ts-ignore
212
+ authToken = _this.webex.credentials.supertoken.access_token;
213
+ return _context.abrupt("return", new mediaHelpersModule.NoiseReductionEffect(_objectSpread({
214
+ authToken: authToken
215
+ }, options)));
216
+ case 2:
217
+ case "end":
218
+ return _context.stop();
219
+ }
220
+ }, _callee);
221
+ }));
222
+ return function (_x) {
223
+ return _ref.apply(this, arguments);
224
+ };
225
+ }());
226
+ /**
227
+ * Creates a virtual background effect
228
+ *
229
+ * @param {IVirtualBackgroundEffect} options optional custom effect options
230
+ * @returns {Promise<effect>} virtual background effect.
231
+ * @public
232
+ * @memberof Meetings
233
+ */
234
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createVirtualBackgroundEffect", /*#__PURE__*/function () {
235
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
236
+ var authToken;
237
+ return _regenerator.default.wrap(function _callee2$(_context2) {
238
+ while (1) switch (_context2.prev = _context2.next) {
239
+ case 0:
240
+ // @ts-ignore
241
+ authToken = _this.webex.credentials.supertoken.access_token;
242
+ return _context2.abrupt("return", new mediaHelpersModule.VirtualBackgroundEffect(_objectSpread({
243
+ authToken: authToken
244
+ }, options)));
245
+ case 2:
246
+ case "end":
247
+ return _context2.stop();
248
+ }
249
+ }, _callee2);
250
+ }));
251
+ return function (_x2) {
252
+ return _ref2.apply(this, arguments);
253
+ };
254
+ }());
255
+ _this.mediaHelpers = mediaHelpersModule;
256
+
257
+ /**
258
+ * The Meetings request to interact with server
259
+ * @instance
260
+ * @type {Object}
261
+ * @private
262
+ * @memberof Meetings
263
+ */
264
+ // @ts-ignore
132
265
  _this.request = new _request2.default({}, {
133
266
  parent: _this.webex
134
267
  });
@@ -152,15 +285,17 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
152
285
  * @memberof Meetings
153
286
  */
154
287
  _this.personalMeetingRoom = null;
288
+
155
289
  /**
156
- * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
290
+ * The Reachability object to interact with server
157
291
  * starts as null
158
292
  * @instance
159
293
  * @type {Object}
160
294
  * @private
161
295
  * @memberof Meetings
162
296
  */
163
- _this.reachability = null;
297
+ // @ts-ignore
298
+ _this.reachability = new _reachability.default(_this.webex);
164
299
 
165
300
  /**
166
301
  * If the meetings plugin has been registered and listening via {@link Meetings#register}
@@ -189,50 +324,152 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
189
324
  * @memberof Meetings
190
325
  */
191
326
  _this.media = {
192
- getUserMedia: _media.default.getUserMedia,
193
- getSupportedDevice: _media.default.getSupportedDevice
327
+ getUserMedia: _media.default.getUserMedia
194
328
  };
195
329
  _this.onReady();
196
330
  return _this;
197
331
  }
198
332
 
199
333
  /**
200
- * handle locus events and takes meeting actions with them as they come in
201
- * @param {Object} data a locus event
202
- * @param {String} data.locusUrl
203
- * @param {Object} data.locus
204
- * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
205
- * @param {String} data.eventType
206
- * @returns {undefined}
334
+ * check whether you need to handle this main session's locus data or not
335
+ * @param {Object} meeting current meeting data
336
+ * @param {Object} newLocus new locus data
337
+ * @returns {boolean}
207
338
  * @private
208
339
  * @memberof Meetings
209
340
  */
210
341
  (0, _createClass2.default)(Meetings, [{
211
- key: "handleLocusEvent",
212
- value: function handleLocusEvent(data) {
213
- var _data$locus$info,
214
- _data$locus,
215
- _data$locus$replaces,
216
- _this2 = this;
217
- var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
218
- var meeting = null;
342
+ key: "isNeedHandleMainLocus",
343
+ value: function isNeedHandleMainLocus(meeting, newLocus) {
344
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
345
+ 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;
346
+ var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
347
+ 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_;
348
+ 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_;
349
+ // @ts-ignore
350
+ var deviceFromNewLocus = _util2.default.getThisDevice(newLocus, this.webex.internal.device.url);
351
+ var isResourceMovedOnThisDevice = (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.state) === _constants._LEFT_ && (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.reason) === _constants._MOVED_;
352
+ var isNewLocusJoinThisDevice = _util2.default.joinedOnThisDevice(meeting, newLocus,
353
+ // @ts-ignore
354
+ this.webex.internal.device.url);
355
+ 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);
356
+ if (isSelfJoined && isNewLocusJoinThisDevice) {
357
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self this device shown as JOINED in the main session');
358
+ if (breakoutLocus !== null && breakoutLocus !== void 0 && breakoutLocus.joinedWith && deviceFromNewLocus) {
359
+ var _breakoutLocus$joined2, _deviceFromNewLocus$r;
360
+ var breakoutReplaceAt = ((_breakoutLocus$joined2 = breakoutLocus.joinedWith.replaces) === null || _breakoutLocus$joined2 === void 0 ? void 0 : _breakoutLocus$joined2.length) > 0 ? breakoutLocus.joinedWith.replaces[0].replaceAt : '';
361
+ var newLocusReplaceAt = ((_deviceFromNewLocus$r = deviceFromNewLocus.replaces) === null || _deviceFromNewLocus$r === void 0 ? void 0 : _deviceFromNewLocus$r.length) > 0 ? deviceFromNewLocus.replaces[0].replaceAt : '';
362
+ if (breakoutReplaceAt && newLocusReplaceAt && breakoutReplaceAt > newLocusReplaceAt) {
363
+ _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> this is expired main joined status locus_dto replacedAt ".concat(newLocusReplaceAt, " bo replacedAt ").concat(breakoutReplaceAt));
364
+ return false;
365
+ }
366
+ }
367
+ return true;
368
+ }
369
+ if (isBreakoutLocusJoinThisDevice) {
370
+ _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));
371
+ return false;
372
+ }
373
+ if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed || isResourceMovedOnThisDevice)) {
374
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle');
375
+ return false;
376
+ }
377
+ if (isSelfJoined && isResourceMovedOnThisDevice) {
378
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle');
379
+ return false;
380
+ }
381
+ _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> this is a normal main session locusDTO update case');
382
+ return true;
383
+ }
384
+
385
+ /**
386
+ * check whether you need to handle this locus data or not
387
+ * @param {Object} meeting old locus data
388
+ * @param {Object} newLocus new locus data
389
+ * @returns {boolean}
390
+ * @private
391
+ * @memberof Meetings
392
+ */
393
+ }, {
394
+ key: "isNeedHandleLocusDTO",
395
+ value: function isNeedHandleLocusDTO(meeting, newLocus) {
396
+ if (newLocus) {
397
+ var _newLocus$self5, _newLocus$self6;
398
+ var isNewLocusAsBreakout = _util2.default.isBreakoutLocusDTO(newLocus);
399
+ 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_;
400
+ if (!meeting) {
401
+ if (isNewLocusAsBreakout) {
402
+ var _newLocus$fullState, _newLocus$self7;
403
+ _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));
404
+ return ((_newLocus$self7 = newLocus.self) === null || _newLocus$self7 === void 0 ? void 0 : _newLocus$self7.state) === _constants._JOINED_;
405
+ }
406
+ return this.isNeedHandleMainLocus(meeting, newLocus);
407
+ }
408
+ if (!isNewLocusAsBreakout) {
409
+ return this.isNeedHandleMainLocus(meeting, newLocus);
410
+ }
411
+ return !isSelfMoved;
412
+ }
413
+ return true;
414
+ }
219
415
 
416
+ /**
417
+ * get corresponding meeting object by locus data
418
+ * @param {Object} data a locus event
419
+ * @param {String} data.locusUrl
420
+ * @param {Object} data.locus
421
+ * @returns {Object}
422
+ * @private
423
+ * @memberof Meetings
424
+ */
425
+ }, {
426
+ key: "getCorrespondingMeetingByLocus",
427
+ value: function getCorrespondingMeetingByLocus(data) {
428
+ var _data$locus$info, _data$locus, _data$locus$info2;
220
429
  // getting meeting by correlationId. This will happen for the new event
221
430
  // Either the locus
222
431
  // TODO : Add check for the callBack Address
223
- meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) ||
432
+ return this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locusUrl) ||
224
433
  // @ts-ignore
225
434
  this.meetingCollection.getByKey(_constants.CORRELATION_ID,
226
435
  // @ts-ignore
227
- _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));
436
+ _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);
437
+ }
438
+
439
+ /**
440
+ * handle locus events and takes meeting actions with them as they come in
441
+ * @param {Object} data a locus event
442
+ * @param {String} data.locusUrl
443
+ * @param {Object} data.locus
444
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
445
+ * @param {String} data.eventType
446
+ * @returns {undefined}
447
+ * @private
448
+ * @memberof Meetings
449
+ */
450
+ }, {
451
+ key: "handleLocusEvent",
452
+ value: function handleLocusEvent(data) {
453
+ var _data$locus2,
454
+ _data$locus2$replaces,
455
+ _this2 = this;
456
+ var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
457
+ var meeting = this.getCorrespondingMeetingByLocus(data);
228
458
 
229
459
  // Special case when locus has got replaced, This only happend once if a replace locus exists
230
460
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
231
461
 
232
- 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) {
462
+ 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) {
233
463
  // Always the last element in the replace is the active one
234
464
  meeting = this.meetingCollection.getByKey(_constants.LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);
235
465
  }
466
+ if (meeting && !_util2.default.isBreakoutLocusDTO(data.locus)) {
467
+ meeting.locusInfo.updateMainSessionLocusCache(data.locus);
468
+ }
469
+ if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
470
+ _loggerProxy.default.logger.log("Meetings:index#handleLocusEvent --> doesn't need to process locus event");
471
+ return;
472
+ }
236
473
  if (!meeting) {
237
474
  // TODO: create meeting when we get a meeting object
238
475
  // const checkForEnded = (locus) => {
@@ -272,6 +509,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
272
509
 
273
510
  // It's a new meeting so initialize the locus data
274
511
  meeting.locusInfo.initialSetup(data.locus);
512
+ _this2.checkHandleBreakoutLocus(data.locus);
275
513
  }).catch(function (e) {
276
514
  _loggerProxy.default.logger.error(e);
277
515
  }).finally(function () {
@@ -279,11 +517,14 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
279
517
  // because the other user left so before sending 'added' event make sure it exists in the collection
280
518
 
281
519
  if (_this2.getMeetingByType(_constants._ID_, meeting.id)) {
282
- _metrics.default.postEvent({
283
- event: _config.eventType.REMOTE_STARTED,
284
- meeting: meeting,
285
- data: {
286
- trigger: _config.trigger.MERCURY_EVENT
520
+ // @ts-ignore
521
+ _this2.webex.internal.newMetrics.submitClientEvent({
522
+ name: 'client.call.remote-started',
523
+ payload: {
524
+ trigger: 'mercury-event'
525
+ },
526
+ options: {
527
+ meetingId: meeting.id
287
528
  }
288
529
  });
289
530
  _triggerProxy.default.trigger(_this2, {
@@ -397,11 +638,13 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
397
638
  // @ts-ignore
398
639
  this.webex.once(_constants.READY, function () {
399
640
  // @ts-ignore
400
- _config2.default.set(_this4.config);
641
+ _config.default.set(_this4.config);
401
642
  // @ts-ignore
402
643
  _loggerConfig.default.set(_this4.config.logging);
403
644
  // @ts-ignore
404
645
  _loggerProxy.default.set(_this4.webex.logger);
646
+ mediaLogger = new MediaLogger();
647
+ (0, _internalMediaCore.setLogger)(mediaLogger);
405
648
 
406
649
  /**
407
650
  * The MeetingInfo object to interact with server
@@ -432,7 +675,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
432
675
  disableNotifications: true
433
676
  });
434
677
  // @ts-ignore
435
- _metrics.default.initialSetup(_this4.meetingCollection, _this4.webex);
678
+ _metrics.default.initialSetup(_this4.webex);
436
679
  });
437
680
  }
438
681
 
@@ -459,23 +702,6 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
459
702
  }
460
703
  }
461
704
 
462
- /**
463
- * API to enable or disable TURN discovery
464
- * @param {Boolean} enable
465
- * @private
466
- * @memberof Meetings
467
- * @returns {undefined}
468
- */
469
- }, {
470
- key: "_toggleTurnDiscovery",
471
- value: function _toggleTurnDiscovery(enable) {
472
- if (typeof enable !== 'boolean') {
473
- return;
474
- }
475
- // @ts-ignore
476
- this.config.experimental.enableTurnDiscovery = enable;
477
- }
478
-
479
705
  /**
480
706
  * API to toggle starting adhoc meeting
481
707
  * @param {Boolean} changeState
@@ -581,7 +807,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
581
807
  })
582
808
  );
583
809
  }
584
-
810
+ }, {
811
+ key: "uploadLogs",
812
+ value:
585
813
  /**
586
814
  * Uploads logs to the webex services for tracking
587
815
  * @param {Object} [options={}]
@@ -594,14 +822,13 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
594
822
  * @param {String} [options.orgId] org id
595
823
  * @returns {String} feedback ID logs were submitted under
596
824
  */
597
- }, {
598
- key: "uploadLogs",
599
- value: function uploadLogs() {
825
+ function uploadLogs() {
600
826
  var _this7 = this;
601
827
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
602
828
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> uploading logs');
603
829
  return this.loggerRequest.uploadLogs(options).then(function (uploadResult) {
604
830
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);
831
+ _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_SUCCESS, options);
605
832
  _triggerProxy.default.trigger(_this7, {
606
833
  file: 'meetings',
607
834
  function: 'uploadLogs'
@@ -619,29 +846,14 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
619
846
  meetingId: options.meetingId,
620
847
  reason: uploadError
621
848
  });
622
- _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_FAILURE, {
623
- // @ts-ignore - seems like typo
624
- meetingId: options.meetingsId,
849
+ _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_FAILURE, _objectSpread(_objectSpread({}, options), {}, {
625
850
  reason: uploadError.message,
626
851
  stack: uploadError.stack,
627
852
  code: uploadError.code
628
- });
853
+ }));
629
854
  });
630
855
  }
631
856
 
632
- /**
633
- * initializes the reachability instance for Meetings
634
- * @returns {undefined}
635
- * @public
636
- * @memberof Meetings
637
- */
638
- }, {
639
- key: "setReachability",
640
- value: function setReachability() {
641
- // @ts-ignore
642
- this.reachability = new _reachability.default(this.webex);
643
- }
644
-
645
857
  /**
646
858
  * gets the reachability instance for Meetings
647
859
  * @returns {Reachability}
@@ -663,9 +875,6 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
663
875
  }, {
664
876
  key: "startReachability",
665
877
  value: function startReachability() {
666
- if (!this.reachability) {
667
- this.setReachability();
668
- }
669
878
  return this.getReachability().gatherReachability();
670
879
  }
671
880
 
@@ -699,6 +908,23 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
699
908
  if (res) {
700
909
  _this9.preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
701
910
  }
911
+
912
+ // fall back to getting the preferred site from the user information
913
+ if (!_this9.preferredWebexSite) {
914
+ // @ts-ignore
915
+ return _this9.webex.internal.user.get().then(function (user) {
916
+ var _user$userPreferences, _user$userPreferences2;
917
+ 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;
918
+ if (preferredWebexSite) {
919
+ _this9.preferredWebexSite = preferredWebexSite;
920
+ } else {
921
+ throw new Error('site not found');
922
+ }
923
+ }).catch(function () {
924
+ _loggerProxy.default.logger.error('Failed to fetch preferred site from user - no site will be set');
925
+ });
926
+ }
927
+ return _promise.default.resolve();
702
928
  });
703
929
  }
704
930
 
@@ -738,9 +964,12 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
738
964
 
739
965
  /**
740
966
  * Create a meeting.
741
- * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}
967
+ * @param {string} destination - sipURL, phonenumber, or locus object}
742
968
  * @param {string} [type] - the optional specified type, such as locusId
743
969
  * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
970
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
971
+ * @param {string} correlationId - the optional specified correlationId
972
+ * @param {Boolean} failOnMissingMeetingInfo - whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
744
973
  * @returns {Promise<Meeting>} A new Meeting.
745
974
  * @public
746
975
  * @memberof Meetings
@@ -751,6 +980,9 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
751
980
  var _this10 = this;
752
981
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
753
982
  var useRandomDelayForInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
983
+ var infoExtraParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
984
+ var correlationId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
985
+ var failOnMissingMeetingInfo = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
754
986
  // TODO: type should be from a dictionary
755
987
 
756
988
  // Validate meeting information based on the provided destination and
@@ -760,7 +992,10 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
760
992
  return this.meetingInfo.fetchInfoOptions(destination, type)
761
993
  // Catch a failure to fetch info options.
762
994
  .catch(function (error) {
763
- _loggerProxy.default.logger.info("Meetings:index#create --> INFO, unable to determine info options: ".concat(error.message));
995
+ _loggerProxy.default.logger.error("Meetings:index#create --> ERROR, unable to determine info options: ".concat(error.message));
996
+ if (error instanceof _webexErrors.SpaceIDDeprecatedError) {
997
+ throw new _webexErrors.SpaceIDDeprecatedError();
998
+ }
764
999
  }).then(function () {
765
1000
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
766
1001
  // Normalize the destination.
@@ -789,20 +1024,22 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
789
1024
  // Validate if a meeting was found.
790
1025
  if (!meeting) {
791
1026
  // Create a meeting based on the normalized destination and type.
792
- return _this10.createMeeting(targetDest, type, useRandomDelayForInfo).then(function (createdMeeting) {
1027
+ return _this10.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, correlationId, failOnMissingMeetingInfo).then(function (createdMeeting) {
793
1028
  // If the meeting was successfully created.
794
1029
  if (createdMeeting && createdMeeting.on) {
795
1030
  // Create a destruction event for the meeting.
796
1031
  createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
797
1032
  // @ts-ignore
798
1033
  if (_this10.config.autoUploadLogs) {
799
- var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4;
1034
+ var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4, _createdMeeting$locus5, _createdMeeting$locus6;
800
1035
  _this10.uploadLogs({
801
1036
  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,
1037
+ locussessionid: (_createdMeeting$locus3 = createdMeeting.locusInfo) === null || _createdMeeting$locus3 === void 0 ? void 0 : (_createdMeeting$locus4 = _createdMeeting$locus3.fullState) === null || _createdMeeting$locus4 === void 0 ? void 0 : _createdMeeting$locus4.sessionId,
802
1038
  correlationId: createdMeeting.correlationId,
803
1039
  feedbackId: createdMeeting.correlationId,
804
1040
  locusId: createdMeeting.locusId,
805
- meetingId: (_createdMeeting$locus3 = createdMeeting.locusInfo) === null || _createdMeeting$locus3 === void 0 ? void 0 : (_createdMeeting$locus4 = _createdMeeting$locus3.info) === null || _createdMeeting$locus4 === void 0 ? void 0 : _createdMeeting$locus4.webExMeetingId
1041
+ meetingId: (_createdMeeting$locus5 = createdMeeting.locusInfo) === null || _createdMeeting$locus5 === void 0 ? void 0 : (_createdMeeting$locus6 = _createdMeeting$locus5.info) === null || _createdMeeting$locus6 === void 0 ? void 0 : _createdMeeting$locus6.webExMeetingId,
1042
+ autoupload: true
806
1043
  }).then(function () {
807
1044
  return _this10.destroy(createdMeeting, payload.reason);
808
1045
  });
@@ -813,13 +1050,15 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
813
1050
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
814
1051
  // @ts-ignore
815
1052
  if (_this10.config.autoUploadLogs) {
816
- var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4;
1053
+ var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4, _meetingInstance$locu5, _meetingInstance$locu6;
817
1054
  _this10.uploadLogs({
818
1055
  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,
1056
+ locussessionid: meetingInstance === null || meetingInstance === void 0 ? void 0 : (_meetingInstance$locu3 = meetingInstance.locusInfo) === null || _meetingInstance$locu3 === void 0 ? void 0 : (_meetingInstance$locu4 = _meetingInstance$locu3.fullState) === null || _meetingInstance$locu4 === void 0 ? void 0 : _meetingInstance$locu4.sessionId,
819
1057
  correlationId: meetingInstance.correlationId,
820
1058
  feedbackId: meetingInstance.correlationId,
821
1059
  locusId: meetingInstance.locusId,
822
- meetingId: (_meetingInstance$locu3 = meetingInstance.locusInfo) === null || _meetingInstance$locu3 === void 0 ? void 0 : (_meetingInstance$locu4 = _meetingInstance$locu3.info) === null || _meetingInstance$locu4 === void 0 ? void 0 : _meetingInstance$locu4.webExMeetingId
1060
+ meetingId: (_meetingInstance$locu5 = meetingInstance.locusInfo) === null || _meetingInstance$locu5 === void 0 ? void 0 : (_meetingInstance$locu6 = _meetingInstance$locu5.info) === null || _meetingInstance$locu6 === void 0 ? void 0 : _meetingInstance$locu6.webExMeetingId,
1061
+ autoupload: true
823
1062
  });
824
1063
  }
825
1064
  });
@@ -841,16 +1080,22 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
841
1080
  * @param {String} destination see create()
842
1081
  * @param {String} type see create()
843
1082
  * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
1083
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
1084
+ * @param {String} correlationId the optional specified correlationId
1085
+ * @param {Boolean} failOnMissingMeetingInfo - whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
844
1086
  * @returns {Promise} a new meeting instance complete with meeting info and destination
845
1087
  * @private
846
1088
  * @memberof Meetings
847
1089
  */
848
1090
  }, {
849
1091
  key: "createMeeting",
850
- value: function () {
851
- var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(destination) {
1092
+ value: (function () {
1093
+ var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(destination) {
852
1094
  var type,
853
1095
  useRandomDelayForInfo,
1096
+ infoExtraParams,
1097
+ correlationId,
1098
+ failOnMissingMeetingInfo,
854
1099
  meeting,
855
1100
  _destination$fullStat,
856
1101
  waitingTime,
@@ -862,12 +1107,15 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
862
1107
  isMeetingActive,
863
1108
  enableUnifiedMeetings,
864
1109
  meetingAddedType,
865
- _args = arguments;
866
- return _regenerator.default.wrap(function _callee$(_context) {
867
- while (1) switch (_context.prev = _context.next) {
1110
+ _args3 = arguments;
1111
+ return _regenerator.default.wrap(function _callee3$(_context3) {
1112
+ while (1) switch (_context3.prev = _context3.next) {
868
1113
  case 0:
869
- type = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
870
- useRandomDelayForInfo = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
1114
+ type = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;
1115
+ useRandomDelayForInfo = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : false;
1116
+ infoExtraParams = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : {};
1117
+ correlationId = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : undefined;
1118
+ failOnMissingMeetingInfo = _args3.length > 5 && _args3[5] !== undefined ? _args3[5] : false;
871
1119
  meeting = new _meeting.default({
872
1120
  // @ts-ignore
873
1121
  userId: this.webex.internal.device.userId,
@@ -875,18 +1123,18 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
875
1123
  deviceUrl: this.webex.internal.device.url,
876
1124
  // @ts-ignore
877
1125
  orgId: this.webex.internal.device.orgId,
878
- roapSeq: 0,
879
1126
  locus: type === _constants._LOCUS_ID_ ? destination : null,
880
1127
  // pass the locus object if present
881
1128
  meetingInfoProvider: this.meetingInfo,
882
1129
  destination: destination,
883
- destinationType: type
1130
+ destinationType: type,
1131
+ correlationId: correlationId
884
1132
  }, {
885
1133
  // @ts-ignore
886
1134
  parent: this.webex
887
1135
  });
888
1136
  this.meetingCollection.set(meeting);
889
- _context.prev = 4;
1137
+ _context3.prev = 7;
890
1138
  // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
891
1139
  // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
892
1140
  // between 5 and 2 min (random between 3 minutes) before the meeting starts
@@ -903,32 +1151,50 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
903
1151
  isMeetingActive = !!((_destination$fullStat = destination.fullState) !== null && _destination$fullStat !== void 0 && _destination$fullStat.active); // @ts-ignore
904
1152
  enableUnifiedMeetings = this.config.experimental.enableUnifiedMeetings;
905
1153
  if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
906
- _context.next = 14;
1154
+ _context3.next = 17;
907
1155
  break;
908
1156
  }
909
1157
  meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
910
- return meeting.fetchMeetingInfo({});
1158
+ return meeting.fetchMeetingInfo({
1159
+ extraParams: infoExtraParams,
1160
+ sendCAevents: !!correlationId // if client sends correlation id as argument of public create(), then it means that this meeting creation is part of a pre-join intent from user
1161
+ });
911
1162
  }, waitingTime);
912
1163
  meeting.parseMeetingInfo(undefined, destination);
913
- _context.next = 16;
1164
+ _context3.next = 19;
914
1165
  break;
915
- case 14:
916
- _context.next = 16;
917
- return meeting.fetchMeetingInfo({});
918
- case 16:
919
- _context.next = 22;
1166
+ case 17:
1167
+ _context3.next = 19;
1168
+ return meeting.fetchMeetingInfo({
1169
+ extraParams: infoExtraParams,
1170
+ sendCAevents: !!correlationId // if client sends correlation id as argument of public create(), then it means that this meeting creation is part of a pre-join intent from user
1171
+ });
1172
+ case 19:
1173
+ _context3.next = 31;
920
1174
  break;
921
- case 18:
922
- _context.prev = 18;
923
- _context.t0 = _context["catch"](4);
924
- if (!(_context.t0 instanceof _captchaError.default) && !(_context.t0 instanceof _passwordError.default)) {
925
- // if there is no meeting info we assume its a 1:1 call or wireless share
926
- _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
927
- _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1175
+ case 21:
1176
+ _context3.prev = 21;
1177
+ _context3.t0 = _context3["catch"](7);
1178
+ if (!(!(_context3.t0 instanceof _captchaError.default) && !(_context3.t0 instanceof _passwordError.default) && !(_context3.t0 instanceof _permission.default))) {
1179
+ _context3.next = 30;
1180
+ break;
1181
+ }
1182
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1183
+ if (!failOnMissingMeetingInfo) {
1184
+ _context3.next = 29;
1185
+ break;
928
1186
  }
929
- _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
930
- case 22:
931
- _context.prev = 22;
1187
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Destroying meeting due to missing meeting info.");
1188
+ // @ts-ignore
1189
+ this.destroy(meeting, _constants.MEETING_REMOVED_REASON.MISSING_MEETING_INFO);
1190
+ throw new _noMeetingInfo.default();
1191
+ case 29:
1192
+ // if there is no meeting info and no error should be thrown then we assume its a 1:1 call or wireless share
1193
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1194
+ case 30:
1195
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context3.t0, " fetching /meetingInfo for creation."));
1196
+ case 31:
1197
+ _context3.prev = 31;
932
1198
  // For type LOCUS_ID we need to parse the locus object to get the information
933
1199
  // about the caller and callee
934
1200
  // Meeting Added event will be created in `handleLocusEvent`
@@ -948,16 +1214,16 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
948
1214
  type: meetingAddedType
949
1215
  });
950
1216
  }
951
- return _context.finish(22);
952
- case 25:
953
- return _context.abrupt("return", meeting);
954
- case 26:
1217
+ return _context3.finish(31);
1218
+ case 34:
1219
+ return _context3.abrupt("return", meeting);
1220
+ case 35:
955
1221
  case "end":
956
- return _context.stop();
1222
+ return _context3.stop();
957
1223
  }
958
- }, _callee, this, [[4, 18, 22, 25]]);
1224
+ }, _callee3, this, [[7, 21, 31, 34]]);
959
1225
  }));
960
- function createMeeting(_x) {
1226
+ function createMeeting(_x3) {
961
1227
  return _createMeeting.apply(this, arguments);
962
1228
  }
963
1229
  return createMeeting;
@@ -970,6 +1236,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
970
1236
  * @public
971
1237
  * @memberof Meetings
972
1238
  */
1239
+ )
973
1240
  }, {
974
1241
  key: "getMeetingByType",
975
1242
  value: function getMeetingByType(type, value) {
@@ -1007,7 +1274,8 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1007
1274
  return this.request.getActiveMeetings().then(function (locusArray) {
1008
1275
  var activeLocusUrl = [];
1009
1276
  if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1010
- locusArray.loci.forEach(function (locus) {
1277
+ var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1278
+ lociToUpdate.forEach(function (locus) {
1011
1279
  activeLocusUrl.push(locus.url);
1012
1280
  _this11.handleLocusEvent({
1013
1281
  locus: locus,
@@ -1029,7 +1297,81 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1029
1297
  }
1030
1298
  }
1031
1299
  }
1300
+ }).catch(function (error) {
1301
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1302
+ throw new Error(error);
1303
+ });
1304
+ }
1305
+
1306
+ /**
1307
+ * sort out locus array for initial creating
1308
+ * @param {Array} loci original locus array
1309
+ * @returns {undefined}
1310
+ * @public
1311
+ * @memberof Meetings
1312
+ */
1313
+ }, {
1314
+ key: "sortLocusArrayToUpdate",
1315
+ value: function sortLocusArrayToUpdate(loci) {
1316
+ var _this12 = this;
1317
+ var mainLoci = loci.filter(function (locus) {
1318
+ return !_util2.default.isBreakoutLocusDTO(locus);
1319
+ });
1320
+ var breakoutLoci = loci.filter(function (locus) {
1321
+ return _util2.default.isValidBreakoutLocus(locus);
1322
+ });
1323
+ this.breakoutLocusForHandleLater = [];
1324
+ var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1325
+ breakoutLoci.forEach(function (breakoutLocus) {
1326
+ var associateMainLocus = mainLoci.find(function (mainLocus) {
1327
+ var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1328
+ 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);
1329
+ });
1330
+ var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1331
+ locus: breakoutLocus,
1332
+ locusUrl: breakoutLocus.url
1333
+ });
1334
+ if (associateMainLocus && !existCorrespondingMeeting) {
1335
+ // if exists both main session and breakout session locus of the same non-exist meeting, handle main locus first,
1336
+ // after meeting create with main locus, then handle the associate breakout locus.
1337
+ // if only handle breakout locus, will miss some date
1338
+ _this12.breakoutLocusForHandleLater.push(breakoutLocus);
1339
+ } else {
1340
+ lociToUpdate.push(breakoutLocus);
1341
+ }
1342
+ });
1343
+ return lociToUpdate;
1344
+ }
1345
+
1346
+ /**
1347
+ * check breakout locus which waiting for main locus's meeting to be created, then handle the breakout locus
1348
+ * @param {Object} newCreatedLocus the locus which just create meeting object of it
1349
+ * @returns {undefined}
1350
+ * @public
1351
+ * @memberof Meetings
1352
+ */
1353
+ }, {
1354
+ key: "checkHandleBreakoutLocus",
1355
+ value: function checkHandleBreakoutLocus(newCreatedLocus) {
1356
+ if (!newCreatedLocus || !this.breakoutLocusForHandleLater || !this.breakoutLocusForHandleLater.length) {
1357
+ return;
1358
+ }
1359
+ if (_util2.default.isBreakoutLocusDTO(newCreatedLocus)) {
1360
+ return;
1361
+ }
1362
+ var existIndex = this.breakoutLocusForHandleLater.findIndex(function (breakoutLocus) {
1363
+ var _breakoutLocus$contro3, _breakoutLocus$contro4, _newCreatedLocus$cont, _newCreatedLocus$cont2;
1364
+ 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);
1365
+ });
1366
+ if (existIndex < 0) {
1367
+ return;
1368
+ }
1369
+ var associateBreakoutLocus = this.breakoutLocusForHandleLater[existIndex];
1370
+ this.handleLocusEvent({
1371
+ locus: associateBreakoutLocus,
1372
+ locusUrl: associateBreakoutLocus.url
1032
1373
  });
1374
+ this.breakoutLocusForHandleLater.splice(existIndex, 1);
1033
1375
  }
1034
1376
 
1035
1377
  /**
@@ -1060,5 +1402,4 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1060
1402
  }]);
1061
1403
  return Meetings;
1062
1404
  }(_webexCore.WebexPlugin);
1063
- exports.default = Meetings;
1064
1405
  //# sourceMappingURL=index.js.map