@webex/plugin-meetings 3.0.0-beta.14 → 3.0.0-beta.16

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