@webex/plugin-meetings 1.158.0 → 1.159.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.
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/meeting/index.js +23 -7
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +165 -38
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +78 -31
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +16 -6
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +17 -0
- package/dist/meetings/util.js.map +1 -1
- package/package.json +6 -5
- package/src/config.js +2 -1
- package/src/meeting/index.js +21 -6
- package/src/meeting-info/meeting-info-v2.js +82 -3
- package/src/meetings/index.js +48 -4
- package/src/meetings/request.js +15 -6
- package/src/meetings/util.js +19 -0
- package/test/unit/spec/meeting/index.js +41 -13
- package/test/unit/spec/meeting-info/meetinginfov2.js +99 -2
- package/test/unit/spec/meetings/index.js +90 -29
- package/test/unit/spec/meetings/utils.js +18 -0
|
@@ -20,7 +20,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
20
20
|
value: true
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
exports.default = exports.MeetingInfoV2CaptchaError = exports.MeetingInfoV2PasswordError = void 0;
|
|
23
|
+
exports.default = exports.MeetingInfoV2CaptchaError = exports.MeetingInfoV2AdhocMeetingError = exports.MeetingInfoV2PasswordError = void 0;
|
|
24
24
|
|
|
25
25
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
26
26
|
|
|
@@ -54,6 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
|
|
|
54
54
|
|
|
55
55
|
var PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';
|
|
56
56
|
var CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';
|
|
57
|
+
var ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';
|
|
57
58
|
/**
|
|
58
59
|
* Error to indicate that wbxappapi requires a password
|
|
59
60
|
*/
|
|
@@ -87,39 +88,72 @@ var MeetingInfoV2PasswordError = /*#__PURE__*/function (_Error) {
|
|
|
87
88
|
return MeetingInfoV2PasswordError;
|
|
88
89
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
89
90
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
* Error generating a adhoc space meeting
|
|
92
|
+
*/
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
exports.MeetingInfoV2PasswordError = MeetingInfoV2PasswordError;
|
|
95
96
|
|
|
96
|
-
var
|
|
97
|
-
(0, _inherits2.default)(
|
|
97
|
+
var MeetingInfoV2AdhocMeetingError = /*#__PURE__*/function (_Error2) {
|
|
98
|
+
(0, _inherits2.default)(MeetingInfoV2AdhocMeetingError, _Error2);
|
|
98
99
|
|
|
99
|
-
var _super2 = _createSuper(
|
|
100
|
+
var _super2 = _createSuper(MeetingInfoV2AdhocMeetingError);
|
|
100
101
|
|
|
101
102
|
/**
|
|
102
103
|
*
|
|
103
104
|
* @constructor
|
|
104
105
|
* @param {Number} [wbxAppApiErrorCode]
|
|
105
|
-
* @param {Object} [captchaInfo]
|
|
106
106
|
* @param {String} [message]
|
|
107
107
|
*/
|
|
108
|
-
function
|
|
108
|
+
function MeetingInfoV2AdhocMeetingError(wbxAppApiErrorCode) {
|
|
109
109
|
var _this2;
|
|
110
110
|
|
|
111
|
-
var message = arguments.length >
|
|
112
|
-
(0, _classCallCheck2.default)(this,
|
|
111
|
+
var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ADHOC_MEETING_DEFAULT_ERROR;
|
|
112
|
+
(0, _classCallCheck2.default)(this, MeetingInfoV2AdhocMeetingError);
|
|
113
113
|
_this2 = _super2.call(this, "".concat(message, ", code=").concat(wbxAppApiErrorCode));
|
|
114
|
-
_this2.name = '
|
|
114
|
+
_this2.name = 'MeetingInfoV2AdhocMeetingError';
|
|
115
115
|
_this2.sdkMessage = message;
|
|
116
116
|
_this2.stack = new Error().stack;
|
|
117
117
|
_this2.wbxAppApiCode = wbxAppApiErrorCode;
|
|
118
|
-
_this2.isPasswordRequired = wbxAppApiErrorCode === 423005;
|
|
119
|
-
_this2.captchaInfo = captchaInfo;
|
|
120
118
|
return _this2;
|
|
121
119
|
}
|
|
122
120
|
|
|
121
|
+
return MeetingInfoV2AdhocMeetingError;
|
|
122
|
+
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
123
|
+
/**
|
|
124
|
+
* Error to indicate that preferred webex site not present to start adhoc meeting
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
exports.MeetingInfoV2AdhocMeetingError = MeetingInfoV2AdhocMeetingError;
|
|
129
|
+
|
|
130
|
+
var MeetingInfoV2CaptchaError = /*#__PURE__*/function (_Error3) {
|
|
131
|
+
(0, _inherits2.default)(MeetingInfoV2CaptchaError, _Error3);
|
|
132
|
+
|
|
133
|
+
var _super3 = _createSuper(MeetingInfoV2CaptchaError);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @constructor
|
|
138
|
+
* @param {Number} [wbxAppApiErrorCode]
|
|
139
|
+
* @param {Object} [captchaInfo]
|
|
140
|
+
* @param {String} [message]
|
|
141
|
+
*/
|
|
142
|
+
function MeetingInfoV2CaptchaError(wbxAppApiErrorCode, captchaInfo) {
|
|
143
|
+
var _this3;
|
|
144
|
+
|
|
145
|
+
var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CAPTCHA_ERROR_DEFAULT_MESSAGE;
|
|
146
|
+
(0, _classCallCheck2.default)(this, MeetingInfoV2CaptchaError);
|
|
147
|
+
_this3 = _super3.call(this, "".concat(message, ", code=").concat(wbxAppApiErrorCode));
|
|
148
|
+
_this3.name = 'MeetingInfoV2PasswordError';
|
|
149
|
+
_this3.sdkMessage = message;
|
|
150
|
+
_this3.stack = new Error().stack;
|
|
151
|
+
_this3.wbxAppApiCode = wbxAppApiErrorCode;
|
|
152
|
+
_this3.isPasswordRequired = wbxAppApiErrorCode === 423005;
|
|
153
|
+
_this3.captchaInfo = captchaInfo;
|
|
154
|
+
return _this3;
|
|
155
|
+
}
|
|
156
|
+
|
|
123
157
|
return MeetingInfoV2CaptchaError;
|
|
124
158
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
125
159
|
/**
|
|
@@ -142,7 +176,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
142
176
|
* converts hydra id into conversation url and persons Id
|
|
143
177
|
* @param {String} destination one of many different types of destinations to look up info for
|
|
144
178
|
* @param {String} [type] to match up with the destination value
|
|
145
|
-
* @returns {Promise}
|
|
179
|
+
* @returns {Promise} destination and type
|
|
146
180
|
* @public
|
|
147
181
|
* @memberof MeetingInfo
|
|
148
182
|
*/
|
|
@@ -158,6 +192,90 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
158
192
|
webex: this.webex
|
|
159
193
|
});
|
|
160
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Creates adhoc space meetings for a space by fetching the conversation infomation
|
|
197
|
+
* @param {String} conversationUrl conversationUrl to start adhoc meeting on
|
|
198
|
+
* @returns {Promise} returns a meeting info object
|
|
199
|
+
* @public
|
|
200
|
+
* @memberof MeetingInfo
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
}, {
|
|
204
|
+
key: "createAdhocSpaceMeeting",
|
|
205
|
+
value: function () {
|
|
206
|
+
var _createAdhocSpaceMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(conversationUrl) {
|
|
207
|
+
var _this4 = this;
|
|
208
|
+
|
|
209
|
+
var getInvitees;
|
|
210
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
211
|
+
while (1) {
|
|
212
|
+
switch (_context.prev = _context.next) {
|
|
213
|
+
case 0:
|
|
214
|
+
if (this.webex.meetings.preferredWebexSite) {
|
|
215
|
+
_context.next = 2;
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
throw Error('No preferred webex site found');
|
|
220
|
+
|
|
221
|
+
case 2:
|
|
222
|
+
getInvitees = function getInvitees() {
|
|
223
|
+
var particpants = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
224
|
+
var invitees = [];
|
|
225
|
+
|
|
226
|
+
if (particpants) {
|
|
227
|
+
particpants.forEach(function (participant) {
|
|
228
|
+
invitees.push({
|
|
229
|
+
email: participant.emailAddress,
|
|
230
|
+
ciUserUuid: participant.entryUUID
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return invitees;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
return _context.abrupt("return", this.webex.internal.conversation.get({
|
|
239
|
+
url: conversationUrl
|
|
240
|
+
}, {
|
|
241
|
+
includeParticipants: true,
|
|
242
|
+
disableTransform: true
|
|
243
|
+
}).then(function (conversation) {
|
|
244
|
+
var _conversation$partici;
|
|
245
|
+
|
|
246
|
+
var body = {
|
|
247
|
+
title: conversation.displayName,
|
|
248
|
+
spaceUrl: conversation.url,
|
|
249
|
+
keyUrl: conversation.encryptionKeyUrl,
|
|
250
|
+
kroUrl: conversation.kmsResourceObjectUrl,
|
|
251
|
+
invitees: getInvitees((_conversation$partici = conversation.participants) === null || _conversation$partici === void 0 ? void 0 : _conversation$partici.items)
|
|
252
|
+
};
|
|
253
|
+
var uri = _this4.webex.meetings.preferredWebexSite ? "https://".concat(_this4.webex.meetings.preferredWebexSite, "/wbxappapi/v2/meetings/spaceInstant") : '';
|
|
254
|
+
return _this4.webex.request({
|
|
255
|
+
method: _constants.HTTP_VERBS.POST,
|
|
256
|
+
uri: uri,
|
|
257
|
+
body: body
|
|
258
|
+
}).catch(function (err) {
|
|
259
|
+
var _err$body, _err$body2;
|
|
260
|
+
|
|
261
|
+
throw new MeetingInfoV2AdhocMeetingError((_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.code, (_err$body2 = err.body) === null || _err$body2 === void 0 ? void 0 : _err$body2.message);
|
|
262
|
+
});
|
|
263
|
+
}));
|
|
264
|
+
|
|
265
|
+
case 4:
|
|
266
|
+
case "end":
|
|
267
|
+
return _context.stop();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}, _callee, this);
|
|
271
|
+
}));
|
|
272
|
+
|
|
273
|
+
function createAdhocSpaceMeeting(_x) {
|
|
274
|
+
return _createAdhocSpaceMeeting.apply(this, arguments);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return createAdhocSpaceMeeting;
|
|
278
|
+
}()
|
|
161
279
|
/**
|
|
162
280
|
* Fetches meeting info from the server
|
|
163
281
|
* @param {String} destination one of many different types of destinations to look up info for
|
|
@@ -174,7 +292,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
174
292
|
}, {
|
|
175
293
|
key: "fetchMeetingInfo",
|
|
176
294
|
value: function () {
|
|
177
|
-
var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
295
|
+
var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(destination) {
|
|
178
296
|
var type,
|
|
179
297
|
password,
|
|
180
298
|
captchaInfo,
|
|
@@ -182,15 +300,15 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
182
300
|
body,
|
|
183
301
|
options,
|
|
184
302
|
directURI,
|
|
185
|
-
|
|
186
|
-
return _regenerator.default.wrap(function
|
|
303
|
+
_args2 = arguments;
|
|
304
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
187
305
|
while (1) {
|
|
188
|
-
switch (
|
|
306
|
+
switch (_context2.prev = _context2.next) {
|
|
189
307
|
case 0:
|
|
190
|
-
type =
|
|
191
|
-
password =
|
|
192
|
-
captchaInfo =
|
|
193
|
-
|
|
308
|
+
type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
309
|
+
password = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
|
|
310
|
+
captchaInfo = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;
|
|
311
|
+
_context2.next = 5;
|
|
194
312
|
return _utilv.default.getDestinationType({
|
|
195
313
|
destination: destination,
|
|
196
314
|
type: type,
|
|
@@ -198,38 +316,47 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
198
316
|
});
|
|
199
317
|
|
|
200
318
|
case 5:
|
|
201
|
-
destinationType =
|
|
202
|
-
|
|
319
|
+
destinationType = _context2.sent;
|
|
320
|
+
|
|
321
|
+
if (!(destinationType.type === _constants._CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings)) {
|
|
322
|
+
_context2.next = 8;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination));
|
|
327
|
+
|
|
328
|
+
case 8:
|
|
329
|
+
_context2.next = 10;
|
|
203
330
|
return _utilv.default.getRequestBody(_objectSpread(_objectSpread({}, destinationType), {}, {
|
|
204
331
|
password: password,
|
|
205
332
|
captchaInfo: captchaInfo
|
|
206
333
|
}));
|
|
207
334
|
|
|
208
|
-
case
|
|
209
|
-
body =
|
|
335
|
+
case 10:
|
|
336
|
+
body = _context2.sent;
|
|
210
337
|
options = {
|
|
211
338
|
method: _constants.HTTP_VERBS.POST,
|
|
212
339
|
service: 'webex-appapi-service',
|
|
213
340
|
resource: 'meetingInfo',
|
|
214
341
|
body: body
|
|
215
342
|
};
|
|
216
|
-
|
|
343
|
+
_context2.next = 14;
|
|
217
344
|
return _utilv.default.getDirectMeetingInfoURI(destinationType);
|
|
218
345
|
|
|
219
|
-
case
|
|
220
|
-
directURI =
|
|
346
|
+
case 14:
|
|
347
|
+
directURI = _context2.sent;
|
|
221
348
|
if (directURI) options.directURI = directURI;
|
|
222
|
-
return
|
|
349
|
+
return _context2.abrupt("return", this.webex.request(options).catch(function (err) {
|
|
223
350
|
if ((err === null || err === void 0 ? void 0 : err.statusCode) === 403) {
|
|
224
|
-
var _err$
|
|
351
|
+
var _err$body3, _err$body4, _err$body4$data;
|
|
225
352
|
|
|
226
|
-
throw new MeetingInfoV2PasswordError((_err$
|
|
353
|
+
throw new MeetingInfoV2PasswordError((_err$body3 = err.body) === null || _err$body3 === void 0 ? void 0 : _err$body3.code, (_err$body4 = err.body) === null || _err$body4 === void 0 ? void 0 : (_err$body4$data = _err$body4.data) === null || _err$body4$data === void 0 ? void 0 : _err$body4$data.meetingInfo);
|
|
227
354
|
}
|
|
228
355
|
|
|
229
356
|
if ((err === null || err === void 0 ? void 0 : err.statusCode) === 423) {
|
|
230
|
-
var _err$
|
|
357
|
+
var _err$body5;
|
|
231
358
|
|
|
232
|
-
throw new MeetingInfoV2CaptchaError((_err$
|
|
359
|
+
throw new MeetingInfoV2CaptchaError((_err$body5 = err.body) === null || _err$body5 === void 0 ? void 0 : _err$body5.code, {
|
|
233
360
|
captchaId: err.body.captchaID,
|
|
234
361
|
verificationImageURL: err.body.verificationImageURL,
|
|
235
362
|
verificationAudioURL: err.body.verificationAudioURL,
|
|
@@ -240,15 +367,15 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
240
367
|
throw err;
|
|
241
368
|
}));
|
|
242
369
|
|
|
243
|
-
case
|
|
370
|
+
case 17:
|
|
244
371
|
case "end":
|
|
245
|
-
return
|
|
372
|
+
return _context2.stop();
|
|
246
373
|
}
|
|
247
374
|
}
|
|
248
|
-
},
|
|
375
|
+
}, _callee2, this);
|
|
249
376
|
}));
|
|
250
377
|
|
|
251
|
-
function fetchMeetingInfo(
|
|
378
|
+
function fetchMeetingInfo(_x2) {
|
|
252
379
|
return _fetchMeetingInfo.apply(this, arguments);
|
|
253
380
|
}
|
|
254
381
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["meeting-info-v2.js"],"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","MeetingInfoV2","webex","destination","type","MeetingInfoUtil","getDestinationType","password","destinationType","getRequestBody","body","options","method","HTTP_VERBS","POST","service","resource","getDirectMeetingInfoURI","directURI","request","catch","err","statusCode","code","data","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,8BAA8B,GAAG,mEAAvC;AACA,IAAMC,6BAA6B,GAAG,qEAAtC;AAEA;AACA;AACA;;IACaC,0B;;;;;AACX;AACF;AACA;AACA;AACA;AACA;AACA;AACE,sCAAYC,kBAAZ,EAAgCC,WAAhC,EAAuF;AAAA;;AAAA,QAA1CC,OAA0C,uEAAhCL,8BAAgC;AAAA;AACrF,wCAASK,OAAT,oBAA0BF,kBAA1B;AACA,UAAKG,IAAL,GAAY,4BAAZ;AACA,UAAKC,UAAL,GAAkBF,OAAlB;AACA,UAAKG,KAAL,GAAc,IAAIC,KAAJ,EAAD,CAAcD,KAA3B;AACA,UAAKE,aAAL,GAAqBP,kBAArB;AACA,UAAKC,WAAL,GAAmBA,WAAnB;AANqF;AAOtF;;;+CAf6CK,K;AAkBhD;AACA;AACA;;;;;IACaE,yB;;;;;AACX;AACF;AACA;AACA;AACA;AACA;AACA;AACE,qCAAYR,kBAAZ,EAAgCS,WAAhC,EAAsF;AAAA;;AAAA,QAAzCP,OAAyC,uEAA/BJ,6BAA+B;AAAA;AACpF,0C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AER,GAAG,CAACX,IAAJ,CAASmB;AAJ6B,qBAA9C,CAAN;AAMD;;AACD,wBAAMR,GAAN;AACD,iBAdI,CAnBT;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O","sourcesContent":["\nimport {HTTP_VERBS} from '../constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error to indicate that wbxappapi requires a captcha\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.isPasswordRequired = wbxAppApiErrorCode === 423005;\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n /**\n *\n * @param {WebexSDK} webex\n */\n constructor(webex) {\n this.webex = webex;\n }\n\n /**\n * converts hydra id into conversation url and persons Id\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @returns {Promise} returns destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination, type = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n }\n\n /**\n * Fetches meeting info from the server\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @param {String} password\n * @param {Object} captchaInfo\n * @param {String} captchaInfo.code\n * @param {String} captchaInfo.id\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(destination, type = null, password = null, captchaInfo = null) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n const options = {\n method: HTTP_VERBS.POST,\n service: 'webex-appapi-service',\n resource: 'meetingInfo',\n body\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) options.directURI = directURI;\n\n return this.webex.request(options)\n .catch((err) => {\n if (err?.statusCode === 403) {\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n throw new MeetingInfoV2CaptchaError(err.body?.code, {\n captchaId: err.body.captchaID,\n verificationImageURL: err.body.verificationImageURL,\n verificationAudioURL: err.body.verificationAudioURL,\n refreshURL: err.body.refreshURL\n });\n }\n throw err;\n });\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"sources":["meeting-info-v2.js"],"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","MeetingInfoV2","webex","destination","type","MeetingInfoUtil","getDestinationType","conversationUrl","meetings","preferredWebexSite","getInvitees","particpants","invitees","forEach","participant","push","email","emailAddress","ciUserUuid","entryUUID","internal","conversation","get","url","includeParticipants","disableTransform","then","body","title","displayName","spaceUrl","keyUrl","encryptionKeyUrl","kroUrl","kmsResourceObjectUrl","participants","items","uri","request","method","HTTP_VERBS","POST","catch","err","code","password","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","service","resource","getDirectMeetingInfoURI","directURI","statusCode","data","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,8BAA8B,GAAG,mEAAvC;AACA,IAAMC,6BAA6B,GAAG,qEAAtC;AACA,IAAMC,2BAA2B,GAAG,iEAApC;AAEA;AACA;AACA;;IACaC,0B;;;;;AACX;AACF;AACA;AACA;AACA;AACA;AACA;AACE,sCAAYC,kBAAZ,EAAgCC,WAAhC,EAAuF;AAAA;;AAAA,QAA1CC,OAA0C,uEAAhCN,8BAAgC;AAAA;AACrF,wCAASM,OAAT,oBAA0BF,kBAA1B;AACA,UAAKG,IAAL,GAAY,4BAAZ;AACA,UAAKC,UAAL,GAAkBF,OAAlB;AACA,UAAKG,KAAL,GAAc,IAAIC,KAAJ,EAAD,CAAcD,KAA3B;AACA,UAAKE,aAAL,GAAqBP,kBAArB;AACA,UAAKC,WAAL,GAAmBA,WAAnB;AANqF;AAOtF;;;+CAf6CK,K;AAkBhD;AACA;AACA;;;;;IACaE,8B;;;;;AACX;AACF;AACA;AACA;AACA;AACA;AACE,0CAAYR,kBAAZ,EAAuE;AAAA;;AAAA,QAAvCE,OAAuC,uEAA7BJ,2BAA6B;AAAA;AACrE,0CAASI,OAAT,oBAA0BF,kBAA1B;AACA,WAAKG,IAAL,GAAY,g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ACD,wBAAMrB,GAAN;AACD,iBAdI,CAxBT;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O","sourcesContent":["\nimport {HTTP_VERBS, _CONVERSATION_URL_} from '../constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR = 'Failed starting the adhoc meeting, Please contact support team ';\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.meetingInfo = meetingInfo;\n }\n}\n\n/**\n * Error generating a adhoc space meeting\n */\nexport class MeetingInfoV2AdhocMeetingError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, message = ADHOC_MEETING_DEFAULT_ERROR) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n }\n}\n\n\n/**\n * Error to indicate that preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2PasswordError';\n this.sdkMessage = message;\n this.stack = (new Error()).stack;\n this.wbxAppApiCode = wbxAppApiErrorCode;\n this.isPasswordRequired = wbxAppApiErrorCode === 423005;\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n /**\n *\n * @param {WebexSDK} webex\n */\n constructor(webex) {\n this.webex = webex;\n }\n\n /**\n * converts hydra id into conversation url and persons Id\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @returns {Promise} destination and type\n * @public\n * @memberof MeetingInfo\n */\n fetchInfoOptions(destination, type = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n }\n\n /**\n * Creates adhoc space meetings for a space by fetching the conversation infomation\n * @param {String} conversationUrl conversationUrl to start adhoc meeting on\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async createAdhocSpaceMeeting(conversationUrl) {\n if (!this.webex.meetings.preferredWebexSite) {\n throw Error('No preferred webex site found');\n }\n const getInvitees = (particpants = []) => {\n const invitees = [];\n\n if (particpants) {\n particpants.forEach((participant) => {\n invitees.push({\n email: participant.emailAddress,\n ciUserUuid: participant.entryUUID\n });\n });\n }\n\n return invitees;\n };\n\n return this.webex.internal.conversation.get(\n {url: conversationUrl},\n {includeParticipants: true, disableTransform: true}\n )\n .then((conversation) => {\n const body = {\n title: conversation.displayName,\n spaceUrl: conversation.url,\n keyUrl: conversation.encryptionKeyUrl,\n kroUrl: conversation.kmsResourceObjectUrl,\n invitees: getInvitees(conversation.participants?.items)\n };\n\n const uri = this.webex.meetings.preferredWebexSite ?\n `https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant` : '';\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body\n })\n .catch((err) => {\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\n });\n });\n }\n\n /**\n * Fetches meeting info from the server\n * @param {String} destination one of many different types of destinations to look up info for\n * @param {String} [type] to match up with the destination value\n * @param {String} password\n * @param {Object} captchaInfo\n * @param {String} captchaInfo.code\n * @param {String} captchaInfo.id\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(destination, type = null, password = null, captchaInfo = null) {\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex\n });\n\n if (destinationType.type === _CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings) {\n return this.createAdhocSpaceMeeting(destinationType.destination);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});\n\n const options = {\n method: HTTP_VERBS.POST,\n service: 'webex-appapi-service',\n resource: 'meetingInfo',\n body\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) options.directURI = directURI;\n\n return this.webex.request(options)\n .catch((err) => {\n if (err?.statusCode === 403) {\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n throw new MeetingInfoV2CaptchaError(err.body?.code, {\n captchaId: err.body.captchaID,\n verificationImageURL: err.body.verificationImageURL,\n verificationAudioURL: err.body.verificationAudioURL,\n refreshURL: err.body.refreshURL\n });\n }\n throw err;\n });\n }\n}\n\n"]}
|
package/dist/meetings/index.js
CHANGED
|
@@ -38,6 +38,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
|
|
|
38
38
|
|
|
39
39
|
require("@webex/internal-plugin-mercury");
|
|
40
40
|
|
|
41
|
+
require("@webex/internal-plugin-conversation");
|
|
42
|
+
|
|
41
43
|
var _webexCore = require("@webex/webex-core");
|
|
42
44
|
|
|
43
45
|
require("webrtc-adapter");
|
|
@@ -217,6 +219,15 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
217
219
|
*/
|
|
218
220
|
|
|
219
221
|
_this.registered = false;
|
|
222
|
+
/**
|
|
223
|
+
* This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}
|
|
224
|
+
* @instance
|
|
225
|
+
* @type {String}
|
|
226
|
+
* @private
|
|
227
|
+
* @memberof Meetings
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
_this.preferredWebexSite = '';
|
|
220
231
|
/**
|
|
221
232
|
* The public interface for the internal Media util files. These are helpful to expose outside the context
|
|
222
233
|
* of a meeting so that a user can access media without creating a meeting instance.
|
|
@@ -473,6 +484,27 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
473
484
|
this.meetingInfo = changeState ? new _meetingInfoV.default(this.webex) : new _meetingInfo.default(this.webex);
|
|
474
485
|
}
|
|
475
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* API to toggle starting adhoc meeting
|
|
489
|
+
* @param {Boolean} changeState
|
|
490
|
+
* @private
|
|
491
|
+
* @memberof Meetings
|
|
492
|
+
* @returns {undefined}
|
|
493
|
+
*/
|
|
494
|
+
|
|
495
|
+
}, {
|
|
496
|
+
key: "_toggleAdhocMeetings",
|
|
497
|
+
value: function _toggleAdhocMeetings(changeState) {
|
|
498
|
+
var _this$config2, _this$config2$experim;
|
|
499
|
+
|
|
500
|
+
if (typeof changeState !== 'boolean') {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
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) {
|
|
505
|
+
this.config.experimental.enableAdhocMeetings = changeState;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
476
508
|
/**
|
|
477
509
|
* Explicitly sets up the meetings plugin by registering
|
|
478
510
|
* the device, connecting to mercury, and listening for locus events.
|
|
@@ -499,7 +531,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
499
531
|
return _promise.default.resolve();
|
|
500
532
|
}
|
|
501
533
|
|
|
502
|
-
return _promise.default.all([this.getGeoHint(), this.startReachability().catch(function (error) {
|
|
534
|
+
return _promise.default.all([this.fetchUserPreferredWebexSite(), this.getGeoHint(), this.startReachability().catch(function (error) {
|
|
503
535
|
_loggerProxy.default.logger.error("Meetings:index#register --> GDM error, ".concat(error.message));
|
|
504
536
|
}), this.webex.internal.device.register().then(function () {
|
|
505
537
|
return _loggerProxy.default.logger.info("Meetings:index#register --> INFO, Device registered ".concat(_this5.webex.internal.device.url));
|
|
@@ -666,6 +698,25 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
666
698
|
_this8.geoHintInfo = res;
|
|
667
699
|
});
|
|
668
700
|
}
|
|
701
|
+
/**
|
|
702
|
+
* Fetch user preferred webex site information
|
|
703
|
+
* This also has other infomation about the user
|
|
704
|
+
* @returns {Promise}
|
|
705
|
+
* @private
|
|
706
|
+
* @memberof Meetings
|
|
707
|
+
*/
|
|
708
|
+
|
|
709
|
+
}, {
|
|
710
|
+
key: "fetchUserPreferredWebexSite",
|
|
711
|
+
value: function fetchUserPreferredWebexSite() {
|
|
712
|
+
var _this9 = this;
|
|
713
|
+
|
|
714
|
+
return this.request.fetchLoginUserInformation().then(function (res) {
|
|
715
|
+
if (res && res.userPreferences) {
|
|
716
|
+
_this9.preferredWebexSite = _util2.default.parseUserPreferences(res === null || res === void 0 ? void 0 : res.userPreferences);
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
}
|
|
669
720
|
/**
|
|
670
721
|
* gets the personal meeting room instance, for saved PMR values for this user
|
|
671
722
|
* @returns {PersonalMeetingRoom}
|
|
@@ -714,7 +765,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
714
765
|
}, {
|
|
715
766
|
key: "create",
|
|
716
767
|
value: function create(destination) {
|
|
717
|
-
var
|
|
768
|
+
var _this10 = this;
|
|
718
769
|
|
|
719
770
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
720
771
|
// TODO: type should be from a dictionary
|
|
@@ -733,43 +784,43 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
733
784
|
var meeting = null;
|
|
734
785
|
|
|
735
786
|
if (type === _constants._CONVERSATION_URL_ || options.type === _constants._CONVERSATION_URL_) {
|
|
736
|
-
meeting =
|
|
787
|
+
meeting = _this10.meetingCollection.getByKey(_constants.CONVERSATION_URL, targetDest);
|
|
737
788
|
} // Attempt to collect the meeting if it exists.
|
|
738
789
|
|
|
739
790
|
|
|
740
791
|
if (!meeting) {
|
|
741
|
-
meeting =
|
|
792
|
+
meeting = _this10.meetingCollection.getByKey(_constants.SIP_URI, targetDest);
|
|
742
793
|
} // Validate if a meeting was found.
|
|
743
794
|
|
|
744
795
|
|
|
745
796
|
if (!meeting) {
|
|
746
797
|
// Create a meeting based on the normalized destination and type.
|
|
747
|
-
return
|
|
798
|
+
return _this10.createMeeting(targetDest, type).then(function (createdMeeting) {
|
|
748
799
|
// If the meeting was successfully created.
|
|
749
800
|
if (createdMeeting && createdMeeting.on) {
|
|
750
801
|
// Create a destruction event for the meeting.
|
|
751
802
|
createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
|
|
752
|
-
if (
|
|
803
|
+
if (_this10.config.autoUploadLogs) {
|
|
753
804
|
var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4;
|
|
754
805
|
|
|
755
|
-
|
|
806
|
+
_this10.uploadLogs({
|
|
756
807
|
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,
|
|
757
808
|
correlationId: createdMeeting.correlationId,
|
|
758
809
|
feedbackId: createdMeeting.correlationId,
|
|
759
810
|
locusId: createdMeeting.locusId,
|
|
760
811
|
meetingId: (_createdMeeting$locus3 = createdMeeting.locusInfo) === null || _createdMeeting$locus3 === void 0 ? void 0 : (_createdMeeting$locus4 = _createdMeeting$locus3.info) === null || _createdMeeting$locus4 === void 0 ? void 0 : _createdMeeting$locus4.webExMeetingId
|
|
761
812
|
}).then(function () {
|
|
762
|
-
return
|
|
813
|
+
return _this10.destroy(createdMeeting, payload.reason);
|
|
763
814
|
});
|
|
764
815
|
} else {
|
|
765
|
-
|
|
816
|
+
_this10.destroy(createdMeeting, payload.reason);
|
|
766
817
|
}
|
|
767
818
|
});
|
|
768
819
|
createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
|
|
769
|
-
if (
|
|
820
|
+
if (_this10.config.autoUploadLogs) {
|
|
770
821
|
var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4;
|
|
771
822
|
|
|
772
|
-
|
|
823
|
+
_this10.uploadLogs({
|
|
773
824
|
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,
|
|
774
825
|
correlationId: meetingInstance.correlationId,
|
|
775
826
|
feedbackId: meetingInstance.correlationId,
|
|
@@ -819,20 +870,19 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
819
870
|
roapSeq: 0,
|
|
820
871
|
locus: type === _constants._LOCUS_ID_ ? destination : null,
|
|
821
872
|
// pass the locus object if present
|
|
822
|
-
meetingInfoProvider: this.meetingInfo
|
|
873
|
+
meetingInfoProvider: this.meetingInfo,
|
|
874
|
+
destination: destination,
|
|
875
|
+
destinationType: type
|
|
823
876
|
}, {
|
|
824
877
|
parent: this.webex
|
|
825
878
|
});
|
|
826
879
|
this.meetingCollection.set(meeting);
|
|
827
880
|
_context.prev = 3;
|
|
828
881
|
_context.next = 6;
|
|
829
|
-
return meeting.fetchMeetingInfo({
|
|
830
|
-
destination: destination,
|
|
831
|
-
type: type
|
|
832
|
-
});
|
|
882
|
+
return meeting.fetchMeetingInfo({});
|
|
833
883
|
|
|
834
884
|
case 6:
|
|
835
|
-
_context.next =
|
|
885
|
+
_context.next = 12;
|
|
836
886
|
break;
|
|
837
887
|
|
|
838
888
|
case 8:
|
|
@@ -846,13 +896,10 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
846
896
|
_loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
|
|
847
897
|
}
|
|
848
898
|
|
|
849
|
-
_loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
|
|
899
|
+
_loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_context.t0, " fetching /meetingInfo for creation."));
|
|
850
900
|
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
case 13:
|
|
855
|
-
_context.prev = 13;
|
|
901
|
+
case 12:
|
|
902
|
+
_context.prev = 12;
|
|
856
903
|
|
|
857
904
|
// For type LOCUS_ID we need to parse the locus object to get the information
|
|
858
905
|
// about the caller and callee
|
|
@@ -875,17 +922,17 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
875
922
|
});
|
|
876
923
|
}
|
|
877
924
|
|
|
878
|
-
return _context.finish(
|
|
925
|
+
return _context.finish(12);
|
|
879
926
|
|
|
880
|
-
case
|
|
927
|
+
case 15:
|
|
881
928
|
return _context.abrupt("return", meeting);
|
|
882
929
|
|
|
883
|
-
case
|
|
930
|
+
case 16:
|
|
884
931
|
case "end":
|
|
885
932
|
return _context.stop();
|
|
886
933
|
}
|
|
887
934
|
}
|
|
888
|
-
}, _callee, this, [[3, 8,
|
|
935
|
+
}, _callee, this, [[3, 8, 12, 15]]);
|
|
889
936
|
}));
|
|
890
937
|
|
|
891
938
|
function createMeeting(_x) {
|
|
@@ -936,7 +983,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
936
983
|
}, {
|
|
937
984
|
key: "syncMeetings",
|
|
938
985
|
value: function syncMeetings() {
|
|
939
|
-
var
|
|
986
|
+
var _this11 = this;
|
|
940
987
|
|
|
941
988
|
return this.request.getActiveMeetings().then(function (locusArray) {
|
|
942
989
|
var activeLocusUrl = [];
|
|
@@ -945,14 +992,14 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
945
992
|
locusArray.loci.forEach(function (locus) {
|
|
946
993
|
activeLocusUrl.push(locus.url);
|
|
947
994
|
|
|
948
|
-
|
|
995
|
+
_this11.handleLocusEvent({
|
|
949
996
|
locus: locus,
|
|
950
997
|
locusUrl: locus.url
|
|
951
998
|
});
|
|
952
999
|
});
|
|
953
1000
|
}
|
|
954
1001
|
|
|
955
|
-
var meetingsCollection =
|
|
1002
|
+
var meetingsCollection = _this11.meetingCollection.getAll();
|
|
956
1003
|
|
|
957
1004
|
if ((0, _keys.default)(meetingsCollection).length > 0) {
|
|
958
1005
|
// Some time the mercury event is missed after mercury reconnect
|
|
@@ -962,7 +1009,7 @@ var Meetings = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
962
1009
|
|
|
963
1010
|
if (!activeLocusUrl.includes(meeting.locusUrl)) {
|
|
964
1011
|
// destroy function also uploads logs
|
|
965
|
-
|
|
1012
|
+
_this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
|
|
966
1013
|
}
|
|
967
1014
|
}
|
|
968
1015
|
}
|