@webex/plugin-meetings 2.60.0 → 2.60.1-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 (535) hide show
  1. package/README.md +46 -8
  2. package/dist/annotation/annotation.types.d.ts +42 -0
  3. package/dist/annotation/annotation.types.js +7 -0
  4. package/dist/annotation/annotation.types.js.map +1 -0
  5. package/dist/annotation/constants.d.ts +31 -0
  6. package/dist/annotation/constants.js +41 -0
  7. package/dist/annotation/constants.js.map +1 -0
  8. package/dist/annotation/index.d.ts +117 -0
  9. package/dist/annotation/index.js +357 -0
  10. package/dist/annotation/index.js.map +1 -0
  11. package/dist/breakouts/breakout.d.ts +8 -0
  12. package/dist/breakouts/breakout.js +215 -0
  13. package/dist/breakouts/breakout.js.map +1 -0
  14. package/dist/breakouts/collection.d.ts +5 -0
  15. package/dist/breakouts/collection.js +22 -0
  16. package/dist/breakouts/collection.js.map +1 -0
  17. package/dist/breakouts/edit-lock-error.d.ts +15 -0
  18. package/dist/breakouts/edit-lock-error.js +51 -0
  19. package/dist/breakouts/edit-lock-error.js.map +1 -0
  20. package/dist/breakouts/events.d.ts +8 -0
  21. package/dist/breakouts/events.js +44 -0
  22. package/dist/breakouts/events.js.map +1 -0
  23. package/dist/breakouts/index.d.ts +5 -0
  24. package/dist/breakouts/index.js +1047 -0
  25. package/dist/breakouts/index.js.map +1 -0
  26. package/dist/breakouts/request.d.ts +22 -0
  27. package/dist/breakouts/request.js +77 -0
  28. package/dist/breakouts/request.js.map +1 -0
  29. package/dist/breakouts/utils.d.ts +15 -0
  30. package/dist/breakouts/utils.js +64 -0
  31. package/dist/breakouts/utils.js.map +1 -0
  32. package/dist/common/browser-detection.js +2 -3
  33. package/dist/common/browser-detection.js.map +1 -1
  34. package/dist/common/collection.js +3 -4
  35. package/dist/common/collection.js.map +1 -1
  36. package/dist/common/config.js +1 -2
  37. package/dist/common/config.js.map +1 -1
  38. package/dist/common/errors/captcha-error.js +1 -2
  39. package/dist/common/errors/captcha-error.js.map +1 -1
  40. package/dist/common/errors/intent-to-join.js +1 -2
  41. package/dist/common/errors/intent-to-join.js.map +1 -1
  42. package/dist/common/errors/join-meeting.js +1 -2
  43. package/dist/common/errors/join-meeting.js.map +1 -1
  44. package/dist/common/errors/media.js +1 -2
  45. package/dist/common/errors/media.js.map +1 -1
  46. package/dist/common/errors/no-meeting-info.d.ts +14 -0
  47. package/dist/common/errors/no-meeting-info.js +50 -0
  48. package/dist/common/errors/no-meeting-info.js.map +1 -0
  49. package/dist/common/errors/parameter.js +3 -4
  50. package/dist/common/errors/parameter.js.map +1 -1
  51. package/dist/common/errors/password-error.js +1 -2
  52. package/dist/common/errors/password-error.js.map +1 -1
  53. package/dist/common/errors/permission.js +1 -2
  54. package/dist/common/errors/permission.js.map +1 -1
  55. package/dist/common/errors/{reclaim-host-role-error.js → reclaim-host-role-errors.js} +7 -11
  56. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
  57. package/dist/common/errors/reconnection-in-progress.js +1 -2
  58. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  59. package/dist/common/errors/reconnection.js +1 -2
  60. package/dist/common/errors/reconnection.js.map +1 -1
  61. package/dist/common/errors/stats.js +1 -2
  62. package/dist/common/errors/stats.js.map +1 -1
  63. package/dist/common/errors/webex-errors.d.ts +20 -8
  64. package/dist/common/errors/webex-errors.js +48 -28
  65. package/dist/common/errors/webex-errors.js.map +1 -1
  66. package/dist/common/errors/webex-meetings-error.js +1 -2
  67. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  68. package/dist/common/events/events-scope.js +1 -2
  69. package/dist/common/events/events-scope.js.map +1 -1
  70. package/dist/common/events/events.js +1 -2
  71. package/dist/common/events/events.js.map +1 -1
  72. package/dist/common/events/trigger-proxy.js +1 -2
  73. package/dist/common/events/trigger-proxy.js.map +1 -1
  74. package/dist/common/events/util.js +1 -2
  75. package/dist/common/events/util.js.map +1 -1
  76. package/dist/common/logs/logger-config.js +1 -2
  77. package/dist/common/logs/logger-config.js.map +1 -1
  78. package/dist/common/logs/logger-proxy.js +2 -3
  79. package/dist/common/logs/logger-proxy.js.map +1 -1
  80. package/dist/common/logs/request.d.ts +3 -1
  81. package/dist/common/logs/request.js +8 -5
  82. package/dist/common/logs/request.js.map +1 -1
  83. package/dist/common/queue.d.ts +9 -7
  84. package/dist/common/queue.js +22 -9
  85. package/dist/common/queue.js.map +1 -1
  86. package/dist/config.d.ts +6 -7
  87. package/dist/config.js +8 -10
  88. package/dist/config.js.map +1 -1
  89. package/dist/constants.d.ts +217 -97
  90. package/dist/constants.js +416 -441
  91. package/dist/constants.js.map +1 -1
  92. package/dist/controls-options-manager/constants.js +3 -6
  93. package/dist/controls-options-manager/constants.js.map +1 -1
  94. package/dist/controls-options-manager/enums.d.ts +11 -1
  95. package/dist/controls-options-manager/enums.js +15 -6
  96. package/dist/controls-options-manager/enums.js.map +1 -1
  97. package/dist/controls-options-manager/index.d.ts +17 -1
  98. package/dist/controls-options-manager/index.js +127 -38
  99. package/dist/controls-options-manager/index.js.map +1 -1
  100. package/dist/controls-options-manager/types.d.ts +43 -0
  101. package/dist/controls-options-manager/types.js +7 -0
  102. package/dist/controls-options-manager/types.js.map +1 -0
  103. package/dist/controls-options-manager/util.d.ts +1 -7
  104. package/dist/controls-options-manager/util.js +309 -19
  105. package/dist/controls-options-manager/util.js.map +1 -1
  106. package/dist/index.d.ts +6 -3
  107. package/dist/index.js +121 -5
  108. package/dist/index.js.map +1 -1
  109. package/dist/interceptors/index.d.ts +2 -0
  110. package/dist/interceptors/index.js +15 -0
  111. package/dist/interceptors/index.js.map +1 -0
  112. package/dist/interceptors/locusRetry.d.ts +27 -0
  113. package/dist/interceptors/locusRetry.js +94 -0
  114. package/dist/interceptors/locusRetry.js.map +1 -0
  115. package/dist/interpretation/collection.d.ts +5 -0
  116. package/dist/interpretation/collection.js +22 -0
  117. package/dist/interpretation/collection.js.map +1 -0
  118. package/dist/interpretation/index.d.ts +5 -0
  119. package/dist/interpretation/index.js +365 -0
  120. package/dist/interpretation/index.js.map +1 -0
  121. package/dist/interpretation/siLanguage.d.ts +5 -0
  122. package/dist/interpretation/siLanguage.js +24 -0
  123. package/dist/interpretation/siLanguage.js.map +1 -0
  124. package/dist/locus-info/controlsUtils.js +100 -11
  125. package/dist/locus-info/controlsUtils.js.map +1 -1
  126. package/dist/locus-info/embeddedAppsUtils.js +3 -4
  127. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  128. package/dist/locus-info/fullState.js +1 -2
  129. package/dist/locus-info/fullState.js.map +1 -1
  130. package/dist/locus-info/hostUtils.js +1 -2
  131. package/dist/locus-info/hostUtils.js.map +1 -1
  132. package/dist/locus-info/index.d.ts +57 -4
  133. package/dist/locus-info/index.js +425 -84
  134. package/dist/locus-info/index.js.map +1 -1
  135. package/dist/locus-info/infoUtils.js +13 -5
  136. package/dist/locus-info/infoUtils.js.map +1 -1
  137. package/dist/locus-info/mediaSharesUtils.js +58 -3
  138. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  139. package/dist/locus-info/parser.d.ts +66 -6
  140. package/dist/locus-info/parser.js +253 -80
  141. package/dist/locus-info/parser.js.map +1 -1
  142. package/dist/locus-info/selfUtils.js +97 -13
  143. package/dist/locus-info/selfUtils.js.map +1 -1
  144. package/dist/media/index.d.ts +2 -0
  145. package/dist/media/index.js +107 -319
  146. package/dist/media/index.js.map +1 -1
  147. package/dist/media/properties.d.ts +38 -53
  148. package/dist/media/properties.js +96 -153
  149. package/dist/media/properties.js.map +1 -1
  150. package/dist/media/util.js +1 -22
  151. package/dist/media/util.js.map +1 -1
  152. package/dist/mediaQualityMetrics/config.d.ts +234 -230
  153. package/dist/mediaQualityMetrics/config.js +302 -498
  154. package/dist/mediaQualityMetrics/config.js.map +1 -1
  155. package/dist/meeting/in-meeting-actions.d.ts +88 -0
  156. package/dist/meeting/in-meeting-actions.js +94 -3
  157. package/dist/meeting/in-meeting-actions.js.map +1 -1
  158. package/dist/meeting/index.d.ts +591 -494
  159. package/dist/meeting/index.js +4732 -2990
  160. package/dist/meeting/index.js.map +1 -1
  161. package/dist/meeting/locusMediaRequest.d.ts +74 -0
  162. package/dist/meeting/locusMediaRequest.js +291 -0
  163. package/dist/meeting/locusMediaRequest.js.map +1 -0
  164. package/dist/meeting/muteState.d.ts +93 -25
  165. package/dist/meeting/muteState.js +224 -133
  166. package/dist/meeting/muteState.js.map +1 -1
  167. package/dist/meeting/request.d.ts +82 -47
  168. package/dist/meeting/request.js +297 -199
  169. package/dist/meeting/request.js.map +1 -1
  170. package/dist/meeting/request.type.d.ts +11 -0
  171. package/dist/meeting/request.type.js +7 -0
  172. package/dist/meeting/request.type.js.map +1 -0
  173. package/dist/meeting/state.js +1 -2
  174. package/dist/meeting/state.js.map +1 -1
  175. package/dist/meeting/util.d.ts +102 -1
  176. package/dist/meeting/util.js +605 -435
  177. package/dist/meeting/util.js.map +1 -1
  178. package/dist/meeting-info/collection.js +3 -4
  179. package/dist/meeting-info/collection.js.map +1 -1
  180. package/dist/meeting-info/index.d.ts +13 -1
  181. package/dist/meeting-info/index.js +74 -7
  182. package/dist/meeting-info/index.js.map +1 -1
  183. package/dist/meeting-info/meeting-info-v2.d.ts +31 -1
  184. package/dist/meeting-info/meeting-info-v2.js +200 -63
  185. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  186. package/dist/meeting-info/request.js +1 -2
  187. package/dist/meeting-info/request.js.map +1 -1
  188. package/dist/meeting-info/util.js +2 -3
  189. package/dist/meeting-info/util.js.map +1 -1
  190. package/dist/meeting-info/utilv2.js +39 -41
  191. package/dist/meeting-info/utilv2.js.map +1 -1
  192. package/dist/meetings/collection.d.ts +17 -0
  193. package/dist/meetings/collection.js +42 -4
  194. package/dist/meetings/collection.js.map +1 -1
  195. package/dist/meetings/index.d.ts +93 -21
  196. package/dist/meetings/index.js +490 -127
  197. package/dist/meetings/index.js.map +1 -1
  198. package/dist/meetings/meetings.types.d.ts +4 -0
  199. package/dist/meetings/meetings.types.js +7 -0
  200. package/dist/meetings/meetings.types.js.map +1 -0
  201. package/dist/meetings/request.js +4 -3
  202. package/dist/meetings/request.js.map +1 -1
  203. package/dist/meetings/util.js +107 -6
  204. package/dist/meetings/util.js.map +1 -1
  205. package/dist/member/index.d.ts +13 -1
  206. package/dist/member/index.js +45 -2
  207. package/dist/member/index.js.map +1 -1
  208. package/dist/member/member.types.js +3 -4
  209. package/dist/member/member.types.js.map +1 -1
  210. package/dist/member/types.d.ts +32 -0
  211. package/dist/member/types.js +23 -0
  212. package/dist/member/types.js.map +1 -0
  213. package/dist/member/util.js +120 -29
  214. package/dist/member/util.js.map +1 -1
  215. package/dist/members/collection.d.ts +5 -0
  216. package/dist/members/collection.js +11 -2
  217. package/dist/members/collection.js.map +1 -1
  218. package/dist/members/index.d.ts +56 -11
  219. package/dist/members/index.js +174 -47
  220. package/dist/members/index.js.map +1 -1
  221. package/dist/members/request.d.ts +67 -11
  222. package/dist/members/request.js +102 -54
  223. package/dist/members/request.js.map +1 -1
  224. package/dist/members/types.js +3 -4
  225. package/dist/members/types.js.map +1 -1
  226. package/dist/members/util.d.ts +214 -1
  227. package/dist/members/util.js +327 -284
  228. package/dist/members/util.js.map +1 -1
  229. package/dist/metrics/constants.d.ts +15 -6
  230. package/dist/metrics/constants.js +17 -9
  231. package/dist/metrics/constants.js.map +1 -1
  232. package/dist/metrics/index.d.ts +4 -111
  233. package/dist/metrics/index.js +4 -452
  234. package/dist/metrics/index.js.map +1 -1
  235. package/dist/multistream/mediaRequestManager.d.ts +118 -0
  236. package/dist/multistream/mediaRequestManager.js +344 -0
  237. package/dist/multistream/mediaRequestManager.js.map +1 -0
  238. package/dist/multistream/receiveSlot.d.ts +68 -0
  239. package/dist/multistream/receiveSlot.js +200 -0
  240. package/dist/multistream/receiveSlot.js.map +1 -0
  241. package/dist/multistream/receiveSlotManager.d.ts +56 -0
  242. package/dist/multistream/receiveSlotManager.js +174 -0
  243. package/dist/multistream/receiveSlotManager.js.map +1 -0
  244. package/dist/multistream/remoteMedia.d.ts +72 -0
  245. package/dist/multistream/remoteMedia.js +268 -0
  246. package/dist/multistream/remoteMedia.js.map +1 -0
  247. package/dist/multistream/remoteMediaGroup.d.ts +47 -0
  248. package/dist/multistream/remoteMediaGroup.js +267 -0
  249. package/dist/multistream/remoteMediaGroup.js.map +1 -0
  250. package/dist/multistream/remoteMediaManager.d.ts +285 -0
  251. package/dist/multistream/remoteMediaManager.js +1211 -0
  252. package/dist/multistream/remoteMediaManager.js.map +1 -0
  253. package/dist/multistream/sendSlotManager.d.ts +61 -0
  254. package/dist/multistream/sendSlotManager.js +236 -0
  255. package/dist/multistream/sendSlotManager.js.map +1 -0
  256. package/dist/networkQualityMonitor/index.js +5 -4
  257. package/dist/networkQualityMonitor/index.js.map +1 -1
  258. package/dist/personal-meeting-room/index.js +2 -3
  259. package/dist/personal-meeting-room/index.js.map +1 -1
  260. package/dist/personal-meeting-room/request.js +2 -3
  261. package/dist/personal-meeting-room/request.js.map +1 -1
  262. package/dist/personal-meeting-room/util.js +1 -2
  263. package/dist/personal-meeting-room/util.js.map +1 -1
  264. package/dist/reachability/clusterReachability.d.ts +109 -0
  265. package/dist/reachability/clusterReachability.js +357 -0
  266. package/dist/reachability/clusterReachability.js.map +1 -0
  267. package/dist/reachability/index.d.ts +61 -95
  268. package/dist/reachability/index.js +300 -393
  269. package/dist/reachability/index.js.map +1 -1
  270. package/dist/reachability/request.d.ts +7 -3
  271. package/dist/reachability/request.js +18 -10
  272. package/dist/reachability/request.js.map +1 -1
  273. package/dist/reachability/util.d.ts +8 -0
  274. package/dist/reachability/util.js +29 -0
  275. package/dist/reachability/util.js.map +1 -0
  276. package/dist/reactions/constants.d.ts +3 -0
  277. package/dist/reactions/constants.js +12 -0
  278. package/dist/reactions/constants.js.map +1 -0
  279. package/dist/reactions/reactions.d.ts +2 -2
  280. package/dist/reactions/reactions.js +4 -6
  281. package/dist/reactions/reactions.js.map +1 -1
  282. package/dist/reactions/reactions.type.d.ts +23 -3
  283. package/dist/reactions/reactions.type.js +21 -23
  284. package/dist/reactions/reactions.type.js.map +1 -1
  285. package/dist/reconnection-manager/index.d.ts +32 -8
  286. package/dist/reconnection-manager/index.js +282 -231
  287. package/dist/reconnection-manager/index.js.map +1 -1
  288. package/dist/recording-controller/enums.js +4 -5
  289. package/dist/recording-controller/enums.js.map +1 -1
  290. package/dist/recording-controller/index.d.ts +15 -1
  291. package/dist/recording-controller/index.js +57 -46
  292. package/dist/recording-controller/index.js.map +1 -1
  293. package/dist/recording-controller/util.d.ts +5 -4
  294. package/dist/recording-controller/util.js +10 -10
  295. package/dist/recording-controller/util.js.map +1 -1
  296. package/dist/roap/index.d.ts +9 -47
  297. package/dist/roap/index.js +101 -235
  298. package/dist/roap/index.js.map +1 -1
  299. package/dist/roap/request.d.ts +18 -12
  300. package/dist/roap/request.js +126 -180
  301. package/dist/roap/request.js.map +1 -1
  302. package/dist/roap/turnDiscovery.d.ts +27 -16
  303. package/dist/roap/turnDiscovery.js +115 -105
  304. package/dist/roap/turnDiscovery.js.map +1 -1
  305. package/dist/rtcMetrics/constants.d.ts +4 -0
  306. package/dist/rtcMetrics/constants.js +11 -0
  307. package/dist/rtcMetrics/constants.js.map +1 -0
  308. package/dist/rtcMetrics/index.d.ts +54 -0
  309. package/dist/rtcMetrics/index.js +140 -0
  310. package/dist/rtcMetrics/index.js.map +1 -0
  311. package/dist/statsAnalyzer/global.d.ts +1 -83
  312. package/dist/statsAnalyzer/global.js +2 -85
  313. package/dist/statsAnalyzer/global.js.map +1 -1
  314. package/dist/statsAnalyzer/index.d.ts +50 -30
  315. package/dist/statsAnalyzer/index.js +435 -510
  316. package/dist/statsAnalyzer/index.js.map +1 -1
  317. package/dist/statsAnalyzer/mqaUtil.d.ts +8 -6
  318. package/dist/statsAnalyzer/mqaUtil.js +120 -83
  319. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  320. package/dist/transcription/index.js +1 -2
  321. package/dist/transcription/index.js.map +1 -1
  322. package/dist/webinar/collection.d.ts +16 -0
  323. package/dist/webinar/collection.js +43 -0
  324. package/dist/webinar/collection.js.map +1 -0
  325. package/dist/webinar/index.d.ts +5 -0
  326. package/dist/webinar/index.js +68 -0
  327. package/dist/webinar/index.js.map +1 -0
  328. package/package.json +38 -26
  329. package/src/annotation/annotation.types.ts +50 -0
  330. package/src/annotation/constants.ts +36 -0
  331. package/src/annotation/index.ts +328 -0
  332. package/src/breakouts/README.md +220 -0
  333. package/src/breakouts/breakout.ts +188 -0
  334. package/src/breakouts/collection.ts +19 -0
  335. package/src/breakouts/edit-lock-error.ts +25 -0
  336. package/src/breakouts/events.ts +56 -0
  337. package/src/breakouts/index.ts +925 -0
  338. package/src/breakouts/request.ts +55 -0
  339. package/src/breakouts/utils.ts +57 -0
  340. package/src/common/errors/no-meeting-info.ts +24 -0
  341. package/src/common/errors/webex-errors.ts +36 -12
  342. package/src/common/logs/logger-proxy.ts +1 -1
  343. package/src/common/logs/request.ts +5 -1
  344. package/src/common/queue.ts +22 -8
  345. package/src/config.ts +6 -7
  346. package/src/constants.ts +244 -97
  347. package/src/controls-options-manager/enums.ts +12 -0
  348. package/src/controls-options-manager/index.ts +116 -21
  349. package/src/controls-options-manager/types.ts +59 -0
  350. package/src/controls-options-manager/util.ts +294 -14
  351. package/src/index.ts +44 -0
  352. package/src/interceptors/index.ts +3 -0
  353. package/src/interceptors/locusRetry.ts +67 -0
  354. package/src/interpretation/README.md +60 -0
  355. package/src/interpretation/collection.ts +19 -0
  356. package/src/interpretation/index.ts +332 -0
  357. package/src/interpretation/siLanguage.ts +18 -0
  358. package/src/locus-info/controlsUtils.ts +110 -0
  359. package/src/locus-info/index.ts +449 -61
  360. package/src/locus-info/infoUtils.ts +14 -2
  361. package/src/locus-info/mediaSharesUtils.ts +64 -0
  362. package/src/locus-info/parser.ts +258 -47
  363. package/src/locus-info/selfUtils.ts +85 -2
  364. package/src/media/index.ts +153 -370
  365. package/src/media/properties.ts +106 -136
  366. package/src/media/util.ts +0 -21
  367. package/src/mediaQualityMetrics/config.ts +244 -377
  368. package/src/meeting/in-meeting-actions.ts +176 -0
  369. package/src/meeting/index.ts +3944 -2489
  370. package/src/meeting/locusMediaRequest.ts +313 -0
  371. package/src/meeting/muteState.ts +224 -138
  372. package/src/meeting/request.ts +207 -127
  373. package/src/meeting/request.type.ts +13 -0
  374. package/src/meeting/util.ts +590 -423
  375. package/src/meeting-info/index.ts +81 -8
  376. package/src/meeting-info/meeting-info-v2.ts +163 -13
  377. package/src/meeting-info/util.ts +1 -1
  378. package/src/meeting-info/utilv2.ts +28 -28
  379. package/src/meetings/collection.ts +33 -0
  380. package/src/meetings/index.ts +487 -126
  381. package/src/meetings/meetings.types.ts +12 -0
  382. package/src/meetings/request.ts +2 -0
  383. package/src/meetings/util.ts +116 -5
  384. package/src/member/index.ts +43 -1
  385. package/src/member/types.ts +38 -0
  386. package/src/member/util.ts +125 -28
  387. package/src/members/collection.ts +8 -0
  388. package/src/members/index.ts +187 -52
  389. package/src/members/request.ts +87 -27
  390. package/src/members/util.ts +332 -291
  391. package/src/metrics/constants.ts +15 -6
  392. package/src/metrics/index.ts +1 -471
  393. package/src/multistream/mediaRequestManager.ts +440 -0
  394. package/src/multistream/receiveSlot.ts +184 -0
  395. package/src/multistream/receiveSlotManager.ts +166 -0
  396. package/src/multistream/remoteMedia.ts +254 -0
  397. package/src/multistream/remoteMediaGroup.ts +284 -0
  398. package/src/multistream/remoteMediaManager.ts +1145 -0
  399. package/src/multistream/sendSlotManager.ts +170 -0
  400. package/src/networkQualityMonitor/index.ts +6 -6
  401. package/src/reachability/clusterReachability.ts +320 -0
  402. package/src/reachability/index.ts +243 -347
  403. package/src/reachability/request.ts +17 -8
  404. package/src/reachability/util.ts +24 -0
  405. package/src/reactions/constants.ts +4 -0
  406. package/src/reactions/reactions.ts +4 -4
  407. package/src/reactions/reactions.type.ts +30 -4
  408. package/src/reconnection-manager/index.ts +168 -156
  409. package/src/recording-controller/index.ts +20 -3
  410. package/src/recording-controller/util.ts +26 -9
  411. package/src/roap/index.ts +98 -241
  412. package/src/roap/request.ts +74 -148
  413. package/src/roap/turnDiscovery.ts +62 -56
  414. package/src/rtcMetrics/constants.ts +3 -0
  415. package/src/rtcMetrics/index.ts +124 -0
  416. package/src/statsAnalyzer/global.ts +1 -84
  417. package/src/statsAnalyzer/index.ts +477 -643
  418. package/src/statsAnalyzer/mqaUtil.ts +115 -114
  419. package/src/webinar/collection.ts +31 -0
  420. package/src/webinar/index.ts +62 -0
  421. package/test/integration/spec/converged-space-meetings.js +233 -0
  422. package/test/integration/spec/journey.js +320 -264
  423. package/test/integration/spec/space-meeting.js +77 -4
  424. package/test/unit/spec/annotation/index.ts +418 -0
  425. package/test/unit/spec/breakouts/breakout.ts +237 -0
  426. package/test/unit/spec/breakouts/collection.ts +15 -0
  427. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  428. package/test/unit/spec/breakouts/events.ts +89 -0
  429. package/test/unit/spec/breakouts/index.ts +1790 -0
  430. package/test/unit/spec/breakouts/request.ts +104 -0
  431. package/test/unit/spec/breakouts/utils.js +72 -0
  432. package/test/unit/spec/common/queue.js +31 -2
  433. package/test/unit/spec/controls-options-manager/index.js +163 -0
  434. package/test/unit/spec/controls-options-manager/util.js +576 -60
  435. package/test/unit/spec/fixture/locus.js +1 -0
  436. package/test/unit/spec/interceptors/locusRetry.ts +131 -0
  437. package/test/unit/spec/interpretation/collection.ts +15 -0
  438. package/test/unit/spec/interpretation/index.ts +589 -0
  439. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  440. package/test/unit/spec/locus-info/controlsUtils.js +323 -30
  441. package/test/unit/spec/locus-info/index.js +1390 -16
  442. package/test/unit/spec/locus-info/infoUtils.js +54 -16
  443. package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
  444. package/test/unit/spec/locus-info/lib/selfConstant.js +48 -0
  445. package/test/unit/spec/locus-info/mediaSharesUtils.ts +32 -0
  446. package/test/unit/spec/locus-info/parser.js +116 -35
  447. package/test/unit/spec/locus-info/selfUtils.js +275 -0
  448. package/test/unit/spec/media/index.ts +290 -0
  449. package/test/unit/spec/media/properties.ts +75 -84
  450. package/test/unit/spec/meeting/in-meeting-actions.ts +86 -0
  451. package/test/unit/spec/meeting/index.js +8187 -2769
  452. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  453. package/test/unit/spec/meeting/muteState.js +409 -213
  454. package/test/unit/spec/meeting/request.js +512 -42
  455. package/test/unit/spec/meeting/utils.js +741 -24
  456. package/test/unit/spec/meeting-info/index.js +300 -0
  457. package/test/unit/spec/meeting-info/meetinginfov2.js +527 -5
  458. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  459. package/test/unit/spec/meetings/collection.js +26 -0
  460. package/test/unit/spec/meetings/index.js +1313 -243
  461. package/test/unit/spec/meetings/utils.js +202 -2
  462. package/test/unit/spec/member/index.js +32 -9
  463. package/test/unit/spec/member/util.js +499 -61
  464. package/test/unit/spec/members/index.js +394 -5
  465. package/test/unit/spec/members/request.js +206 -27
  466. package/test/unit/spec/members/utils.js +173 -38
  467. package/test/unit/spec/metrics/index.js +1 -50
  468. package/test/unit/spec/multistream/mediaRequestManager.ts +1418 -0
  469. package/test/unit/spec/multistream/receiveSlot.ts +163 -0
  470. package/test/unit/spec/multistream/receiveSlotManager.ts +203 -0
  471. package/test/unit/spec/multistream/remoteMedia.ts +255 -0
  472. package/test/unit/spec/multistream/remoteMediaGroup.ts +662 -0
  473. package/test/unit/spec/multistream/remoteMediaManager.ts +1924 -0
  474. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  475. package/test/unit/spec/networkQualityMonitor/index.js +4 -4
  476. package/test/unit/spec/reachability/clusterReachability.ts +279 -0
  477. package/test/unit/spec/reachability/index.ts +531 -24
  478. package/test/unit/spec/reachability/request.js +68 -0
  479. package/test/unit/spec/reachability/util.ts +40 -0
  480. package/test/unit/spec/reconnection-manager/index.js +162 -24
  481. package/test/unit/spec/recording-controller/index.js +293 -218
  482. package/test/unit/spec/recording-controller/util.js +223 -96
  483. package/test/unit/spec/roap/index.ts +200 -76
  484. package/test/unit/spec/roap/request.ts +255 -0
  485. package/test/unit/spec/roap/turnDiscovery.ts +86 -48
  486. package/test/unit/spec/rtcMetrics/index.ts +93 -0
  487. package/test/unit/spec/stats-analyzer/index.js +261 -167
  488. package/test/unit/spec/webinar/collection.ts +13 -0
  489. package/test/unit/spec/webinar/index.ts +60 -0
  490. package/test/utils/constants.js +9 -0
  491. package/test/utils/integrationTestUtils.js +46 -0
  492. package/test/utils/testUtils.js +0 -45
  493. package/test/utils/webex-config.js +4 -0
  494. package/test/utils/webex-test-users.js +7 -3
  495. package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
  496. package/dist/meeting/effectsState.d.ts +0 -42
  497. package/dist/meeting/effectsState.js +0 -260
  498. package/dist/meeting/effectsState.js.map +0 -1
  499. package/dist/metrics/config.d.ts +0 -169
  500. package/dist/metrics/config.js +0 -289
  501. package/dist/metrics/config.js.map +0 -1
  502. package/dist/peer-connection-manager/index.d.ts +0 -6
  503. package/dist/peer-connection-manager/index.js +0 -671
  504. package/dist/peer-connection-manager/index.js.map +0 -1
  505. package/dist/peer-connection-manager/util.d.ts +0 -6
  506. package/dist/peer-connection-manager/util.js +0 -110
  507. package/dist/peer-connection-manager/util.js.map +0 -1
  508. package/dist/roap/collection.d.ts +0 -10
  509. package/dist/roap/collection.js +0 -63
  510. package/dist/roap/collection.js.map +0 -1
  511. package/dist/roap/handler.d.ts +0 -47
  512. package/dist/roap/handler.js +0 -279
  513. package/dist/roap/handler.js.map +0 -1
  514. package/dist/roap/state.d.ts +0 -9
  515. package/dist/roap/state.js +0 -127
  516. package/dist/roap/state.js.map +0 -1
  517. package/dist/roap/util.d.ts +0 -2
  518. package/dist/roap/util.js +0 -76
  519. package/dist/roap/util.js.map +0 -1
  520. package/src/index.js +0 -15
  521. package/src/meeting/effectsState.ts +0 -209
  522. package/src/metrics/config.ts +0 -485
  523. package/src/peer-connection-manager/index.ts +0 -847
  524. package/src/peer-connection-manager/util.ts +0 -119
  525. package/src/roap/collection.ts +0 -62
  526. package/src/roap/handler.ts +0 -294
  527. package/src/roap/state.ts +0 -156
  528. package/src/roap/util.ts +0 -100
  529. package/test/unit/spec/meeting/effectsState.js +0 -281
  530. package/test/unit/spec/peerconnection-manager/index.js +0 -218
  531. package/test/unit/spec/peerconnection-manager/utils.js +0 -49
  532. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -388
  533. package/test/unit/spec/roap/util.js +0 -30
  534. /package/dist/common/errors/{reclaim-host-role-error.d.ts → reclaim-host-role-errors.d.ts} +0 -0
  535. /package/src/common/errors/{reclaim-host-role-error.ts → reclaim-host-role-errors.ts} +0 -0
@@ -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
+ }
219
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
+ }
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
 
@@ -737,10 +963,14 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
737
963
  }
738
964
 
739
965
  /**
740
- * Create a meeting.
741
- * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}
966
+ * Create a meeting or return an existing meeting.
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 (callStateForMetrics.correlationId can be provided instead)
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)
973
+ * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
744
974
  * @returns {Promise<Meeting>} A new Meeting.
745
975
  * @public
746
976
  * @memberof Meetings
@@ -751,16 +981,28 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
751
981
  var _this10 = this;
752
982
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
753
983
  var useRandomDelayForInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
984
+ var infoExtraParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
985
+ var correlationId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
986
+ var failOnMissingMeetingInfo = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
987
+ var callStateForMetrics = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : undefined;
754
988
  // TODO: type should be from a dictionary
755
989
 
756
990
  // Validate meeting information based on the provided destination and
757
991
  // type. This must be performed prior to determining if the meeting is
758
992
  // found in the collection, as we mutate the destination for hydra person
759
993
  // id values.
994
+ if (correlationId) {
995
+ callStateForMetrics = _objectSpread(_objectSpread({}, callStateForMetrics || {}), {}, {
996
+ correlationId: correlationId
997
+ });
998
+ }
760
999
  return this.meetingInfo.fetchInfoOptions(destination, type)
761
1000
  // Catch a failure to fetch info options.
762
1001
  .catch(function (error) {
763
- _loggerProxy.default.logger.info("Meetings:index#create --> INFO, unable to determine info options: ".concat(error.message));
1002
+ _loggerProxy.default.logger.error("Meetings:index#create --> ERROR, unable to determine info options: ".concat(error.message));
1003
+ if (error instanceof _webexErrors.SpaceIDDeprecatedError) {
1004
+ throw new _webexErrors.SpaceIDDeprecatedError();
1005
+ }
764
1006
  }).then(function () {
765
1007
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
766
1008
  // Normalize the destination.
@@ -789,20 +1031,22 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
789
1031
  // Validate if a meeting was found.
790
1032
  if (!meeting) {
791
1033
  // Create a meeting based on the normalized destination and type.
792
- return _this10.createMeeting(targetDest, type, useRandomDelayForInfo).then(function (createdMeeting) {
1034
+ return _this10.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo).then(function (createdMeeting) {
793
1035
  // If the meeting was successfully created.
794
1036
  if (createdMeeting && createdMeeting.on) {
795
1037
  // Create a destruction event for the meeting.
796
1038
  createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
797
1039
  // @ts-ignore
798
1040
  if (_this10.config.autoUploadLogs) {
799
- var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4;
1041
+ var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4, _createdMeeting$locus5, _createdMeeting$locus6;
800
1042
  _this10.uploadLogs({
801
1043
  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,
1044
+ 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
1045
  correlationId: createdMeeting.correlationId,
803
1046
  feedbackId: createdMeeting.correlationId,
804
1047
  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
1048
+ 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,
1049
+ autoupload: true
806
1050
  }).then(function () {
807
1051
  return _this10.destroy(createdMeeting, payload.reason);
808
1052
  });
@@ -813,13 +1057,15 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
813
1057
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
814
1058
  // @ts-ignore
815
1059
  if (_this10.config.autoUploadLogs) {
816
- var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4;
1060
+ var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4, _meetingInstance$locu5, _meetingInstance$locu6;
817
1061
  _this10.uploadLogs({
818
1062
  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,
1063
+ 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
1064
  correlationId: meetingInstance.correlationId,
820
1065
  feedbackId: meetingInstance.correlationId,
821
1066
  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
1067
+ 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,
1068
+ autoupload: true
823
1069
  });
824
1070
  }
825
1071
  });
@@ -831,6 +1077,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
831
1077
  return _promise.default.resolve(createdMeeting);
832
1078
  });
833
1079
  }
1080
+ meeting.setCallStateForMetrics(callStateForMetrics);
834
1081
 
835
1082
  // Return the existing meeting.
836
1083
  return _promise.default.resolve(meeting);
@@ -841,16 +1088,22 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
841
1088
  * @param {String} destination see create()
842
1089
  * @param {String} type see create()
843
1090
  * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
1091
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
1092
+ * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
1093
+ * @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
1094
  * @returns {Promise} a new meeting instance complete with meeting info and destination
845
1095
  * @private
846
1096
  * @memberof Meetings
847
1097
  */
848
1098
  }, {
849
1099
  key: "createMeeting",
850
- value: function () {
851
- var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(destination) {
1100
+ value: (function () {
1101
+ var _createMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(destination) {
852
1102
  var type,
853
1103
  useRandomDelayForInfo,
1104
+ infoExtraParams,
1105
+ callStateForMetrics,
1106
+ failOnMissingMeetingInfo,
854
1107
  meeting,
855
1108
  _destination$fullStat,
856
1109
  waitingTime,
@@ -862,12 +1115,15 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
862
1115
  isMeetingActive,
863
1116
  enableUnifiedMeetings,
864
1117
  meetingAddedType,
865
- _args = arguments;
866
- return _regenerator.default.wrap(function _callee$(_context) {
867
- while (1) switch (_context.prev = _context.next) {
1118
+ _args3 = arguments;
1119
+ return _regenerator.default.wrap(function _callee3$(_context3) {
1120
+ while (1) switch (_context3.prev = _context3.next) {
868
1121
  case 0:
869
- type = _args.length > 1 && _args[1] !== undefined ? _args[1] : null;
870
- useRandomDelayForInfo = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
1122
+ type = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;
1123
+ useRandomDelayForInfo = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : false;
1124
+ infoExtraParams = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : {};
1125
+ callStateForMetrics = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : undefined;
1126
+ failOnMissingMeetingInfo = _args3.length > 5 && _args3[5] !== undefined ? _args3[5] : false;
871
1127
  meeting = new _meeting.default({
872
1128
  // @ts-ignore
873
1129
  userId: this.webex.internal.device.userId,
@@ -875,18 +1131,18 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
875
1131
  deviceUrl: this.webex.internal.device.url,
876
1132
  // @ts-ignore
877
1133
  orgId: this.webex.internal.device.orgId,
878
- roapSeq: 0,
879
1134
  locus: type === _constants._LOCUS_ID_ ? destination : null,
880
1135
  // pass the locus object if present
881
1136
  meetingInfoProvider: this.meetingInfo,
882
1137
  destination: destination,
883
- destinationType: type
1138
+ destinationType: type,
1139
+ callStateForMetrics: callStateForMetrics
884
1140
  }, {
885
1141
  // @ts-ignore
886
1142
  parent: this.webex
887
1143
  });
888
1144
  this.meetingCollection.set(meeting);
889
- _context.prev = 4;
1145
+ _context3.prev = 7;
890
1146
  // if no participant has joined the scheduled meeting (meaning meeting is not active) and we get a locusEvent,
891
1147
  // it means the meeting will start in 5-6 min. In that case, we want to fetchMeetingInfo
892
1148
  // between 5 and 2 min (random between 3 minutes) before the meeting starts
@@ -903,32 +1159,50 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
903
1159
  isMeetingActive = !!((_destination$fullStat = destination.fullState) !== null && _destination$fullStat !== void 0 && _destination$fullStat.active); // @ts-ignore
904
1160
  enableUnifiedMeetings = this.config.experimental.enableUnifiedMeetings;
905
1161
  if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
906
- _context.next = 14;
1162
+ _context3.next = 17;
907
1163
  break;
908
1164
  }
909
1165
  meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
910
- return meeting.fetchMeetingInfo({});
1166
+ return meeting.fetchMeetingInfo({
1167
+ extraParams: infoExtraParams,
1168
+ sendCAevents: !!(callStateForMetrics !== null && callStateForMetrics !== void 0 && callStateForMetrics.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
1169
+ });
911
1170
  }, waitingTime);
912
1171
  meeting.parseMeetingInfo(undefined, destination);
913
- _context.next = 16;
1172
+ _context3.next = 19;
914
1173
  break;
915
- case 14:
916
- _context.next = 16;
917
- return meeting.fetchMeetingInfo({});
918
- case 16:
919
- _context.next = 22;
1174
+ case 17:
1175
+ _context3.next = 19;
1176
+ return meeting.fetchMeetingInfo({
1177
+ extraParams: infoExtraParams,
1178
+ sendCAevents: !!(callStateForMetrics !== null && callStateForMetrics !== void 0 && callStateForMetrics.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
1179
+ });
1180
+ case 19:
1181
+ _context3.next = 31;
920
1182
  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');
1183
+ case 21:
1184
+ _context3.prev = 21;
1185
+ _context3.t0 = _context3["catch"](7);
1186
+ if (!(!(_context3.t0 instanceof _captchaError.default) && !(_context3.t0 instanceof _passwordError.default) && !(_context3.t0 instanceof _permission.default))) {
1187
+ _context3.next = 30;
1188
+ break;
1189
+ }
1190
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1191
+ if (!failOnMissingMeetingInfo) {
1192
+ _context3.next = 29;
1193
+ break;
928
1194
  }
929
- _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
930
- case 22:
931
- _context.prev = 22;
1195
+ _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Destroying meeting due to missing meeting info.");
1196
+ // @ts-ignore
1197
+ this.destroy(meeting, _constants.MEETING_REMOVED_REASON.MISSING_MEETING_INFO);
1198
+ throw new _noMeetingInfo.default();
1199
+ case 29:
1200
+ // if there is no meeting info and no error should be thrown then we assume its a 1:1 call or wireless share
1201
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1202
+ case 30:
1203
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context3.t0, " fetching /meetingInfo for creation."));
1204
+ case 31:
1205
+ _context3.prev = 31;
932
1206
  // For type LOCUS_ID we need to parse the locus object to get the information
933
1207
  // about the caller and callee
934
1208
  // Meeting Added event will be created in `handleLocusEvent`
@@ -948,16 +1222,16 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
948
1222
  type: meetingAddedType
949
1223
  });
950
1224
  }
951
- return _context.finish(22);
952
- case 25:
953
- return _context.abrupt("return", meeting);
954
- case 26:
1225
+ return _context3.finish(31);
1226
+ case 34:
1227
+ return _context3.abrupt("return", meeting);
1228
+ case 35:
955
1229
  case "end":
956
- return _context.stop();
1230
+ return _context3.stop();
957
1231
  }
958
- }, _callee, this, [[4, 18, 22, 25]]);
1232
+ }, _callee3, this, [[7, 21, 31, 34]]);
959
1233
  }));
960
- function createMeeting(_x) {
1234
+ function createMeeting(_x3) {
961
1235
  return _createMeeting.apply(this, arguments);
962
1236
  }
963
1237
  return createMeeting;
@@ -970,6 +1244,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
970
1244
  * @public
971
1245
  * @memberof Meetings
972
1246
  */
1247
+ )
973
1248
  }, {
974
1249
  key: "getMeetingByType",
975
1250
  value: function getMeetingByType(type, value) {
@@ -1007,7 +1282,8 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1007
1282
  return this.request.getActiveMeetings().then(function (locusArray) {
1008
1283
  var activeLocusUrl = [];
1009
1284
  if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1010
- locusArray.loci.forEach(function (locus) {
1285
+ var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1286
+ lociToUpdate.forEach(function (locus) {
1011
1287
  activeLocusUrl.push(locus.url);
1012
1288
  _this11.handleLocusEvent({
1013
1289
  locus: locus,
@@ -1017,19 +1293,94 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1017
1293
  }
1018
1294
  var meetingsCollection = _this11.meetingCollection.getAll();
1019
1295
  if ((0, _keys.default)(meetingsCollection).length > 0) {
1020
- // Some time the mercury event is missed after mercury reconnect
1021
- // if sync returns no locus then clear all the meetings
1296
+ // Sometimes the mercury events are lost after mercury reconnect
1297
+ // Remove any Locus meetings that are not returned by Locus
1298
+ // (they had a locusUrl previously but are no longer active) in the sync
1022
1299
  for (var _i = 0, _Object$values = (0, _values.default)(meetingsCollection); _i < _Object$values.length; _i++) {
1023
1300
  var meeting = _Object$values[_i];
1024
1301
  // @ts-ignore
1025
- if (!activeLocusUrl.includes(meeting.locusUrl)) {
1302
+ if (meeting.locusUrl && !activeLocusUrl.includes(meeting.locusUrl)) {
1026
1303
  // destroy function also uploads logs
1027
1304
  // @ts-ignore
1028
1305
  _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1029
1306
  }
1030
1307
  }
1031
1308
  }
1309
+ }).catch(function (error) {
1310
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1311
+ throw new Error(error);
1312
+ });
1313
+ }
1314
+
1315
+ /**
1316
+ * sort out locus array for initial creating
1317
+ * @param {Array} loci original locus array
1318
+ * @returns {undefined}
1319
+ * @public
1320
+ * @memberof Meetings
1321
+ */
1322
+ }, {
1323
+ key: "sortLocusArrayToUpdate",
1324
+ value: function sortLocusArrayToUpdate(loci) {
1325
+ var _this12 = this;
1326
+ var mainLoci = loci.filter(function (locus) {
1327
+ return !_util2.default.isBreakoutLocusDTO(locus);
1328
+ });
1329
+ var breakoutLoci = loci.filter(function (locus) {
1330
+ return _util2.default.isValidBreakoutLocus(locus);
1331
+ });
1332
+ this.breakoutLocusForHandleLater = [];
1333
+ var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1334
+ breakoutLoci.forEach(function (breakoutLocus) {
1335
+ var associateMainLocus = mainLoci.find(function (mainLocus) {
1336
+ var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1337
+ 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);
1338
+ });
1339
+ var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1340
+ locus: breakoutLocus,
1341
+ locusUrl: breakoutLocus.url
1342
+ });
1343
+ if (associateMainLocus && !existCorrespondingMeeting) {
1344
+ // if exists both main session and breakout session locus of the same non-exist meeting, handle main locus first,
1345
+ // after meeting create with main locus, then handle the associate breakout locus.
1346
+ // if only handle breakout locus, will miss some date
1347
+ _this12.breakoutLocusForHandleLater.push(breakoutLocus);
1348
+ } else {
1349
+ lociToUpdate.push(breakoutLocus);
1350
+ }
1032
1351
  });
1352
+ return lociToUpdate;
1353
+ }
1354
+
1355
+ /**
1356
+ * check breakout locus which waiting for main locus's meeting to be created, then handle the breakout locus
1357
+ * @param {Object} newCreatedLocus the locus which just create meeting object of it
1358
+ * @returns {undefined}
1359
+ * @public
1360
+ * @memberof Meetings
1361
+ */
1362
+ }, {
1363
+ key: "checkHandleBreakoutLocus",
1364
+ value: function checkHandleBreakoutLocus(newCreatedLocus) {
1365
+ if (!newCreatedLocus || !this.breakoutLocusForHandleLater || !this.breakoutLocusForHandleLater.length) {
1366
+ return;
1367
+ }
1368
+ if (_util2.default.isBreakoutLocusDTO(newCreatedLocus)) {
1369
+ return;
1370
+ }
1371
+ var existIndex = this.breakoutLocusForHandleLater.findIndex(function (breakoutLocus) {
1372
+ var _breakoutLocus$contro3, _breakoutLocus$contro4, _newCreatedLocus$cont, _newCreatedLocus$cont2;
1373
+ 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);
1374
+ });
1375
+ if (existIndex < 0) {
1376
+ return;
1377
+ }
1378
+ var associateBreakoutLocus = this.breakoutLocusForHandleLater[existIndex];
1379
+ this.handleLocusEvent({
1380
+ locus: associateBreakoutLocus,
1381
+ locusUrl: associateBreakoutLocus.url
1382
+ });
1383
+ this.breakoutLocusForHandleLater.splice(existIndex, 1);
1033
1384
  }
1034
1385
 
1035
1386
  /**
@@ -1057,8 +1408,20 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
1057
1408
  value: function getLogger() {
1058
1409
  return _loggerProxy.default.get();
1059
1410
  }
1411
+
1412
+ /**
1413
+ * Returns the first meeting it finds that has the webrtc media connection created.
1414
+ * Useful for debugging in the console.
1415
+ *
1416
+ * @private
1417
+ * @returns {Meeting} Meeting object that has a webrtc media connection, else undefined
1418
+ */
1419
+ }, {
1420
+ key: "getActiveWebrtcMeeting",
1421
+ value: function getActiveWebrtcMeeting() {
1422
+ return this.meetingCollection.getActiveWebrtcMeeting();
1423
+ }
1060
1424
  }]);
1061
1425
  return Meetings;
1062
1426
  }(_webexCore.WebexPlugin);
1063
- exports.default = Meetings;
1064
1427
  //# sourceMappingURL=index.js.map