@webex/plugin-meetings 2.37.0 → 2.37.2

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