@webex/plugin-meetings 3.0.0-beta.2 → 3.0.0-beta.20

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