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