@webex/plugin-meetings 3.0.0-beta.112 → 3.0.0-beta.114
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/README.md +45 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/meeting/request.js +12 -8
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +3 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +40 -19
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +1 -0
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/types/meeting/request.d.ts +4 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +9 -2
- package/package.json +19 -19
- package/src/meeting/request.ts +15 -5
- package/src/meeting/util.ts +2 -0
- package/src/meeting-info/meeting-info-v2.ts +47 -17
- package/src/meeting-info/utilv2.ts +1 -0
- package/test/unit/spec/meeting/request.js +19 -0
- package/test/unit/spec/meeting/utils.js +20 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +112 -4
|
@@ -174,6 +174,19 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
174
174
|
function MeetingInfoV2(webex) {
|
|
175
175
|
(0, _classCallCheck2.default)(this, MeetingInfoV2);
|
|
176
176
|
(0, _defineProperty2.default)(this, "webex", void 0);
|
|
177
|
+
(0, _defineProperty2.default)(this, "handlePolicyError", function (err) {
|
|
178
|
+
var _err$body;
|
|
179
|
+
if (!err.body) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (POLICY_ERROR_CODES.includes((_err$body = err.body) === null || _err$body === void 0 ? void 0 : _err$body.code)) {
|
|
183
|
+
var _err$body2, _err$body3, _err$body4, _err$body4$data, _err$body5;
|
|
184
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.MEETING_INFO_POLICY_ERROR, {
|
|
185
|
+
code: (_err$body2 = err.body) === null || _err$body2 === void 0 ? void 0 : _err$body2.code
|
|
186
|
+
});
|
|
187
|
+
throw new MeetingInfoV2PolicyError((_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, (_err$body5 = err.body) === null || _err$body5 === void 0 ? void 0 : _err$body5.message);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
177
190
|
this.webex = webex;
|
|
178
191
|
}
|
|
179
192
|
|
|
@@ -196,17 +209,24 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
196
209
|
});
|
|
197
210
|
}
|
|
198
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Raises a MeetingInfoV2PolicyError for policy error codes
|
|
214
|
+
* @param {any} err the error from the request
|
|
215
|
+
* @returns {void}
|
|
216
|
+
*/
|
|
217
|
+
}, {
|
|
218
|
+
key: "createAdhocSpaceMeeting",
|
|
219
|
+
value:
|
|
199
220
|
/**
|
|
200
221
|
* Creates adhoc space meetings for a space by fetching the conversation infomation
|
|
201
222
|
* @param {String} conversationUrl conversationUrl to start adhoc meeting on
|
|
223
|
+
* @param {String} installedOrgID org ID of user's machine
|
|
202
224
|
* @returns {Promise} returns a meeting info object
|
|
203
225
|
* @public
|
|
204
226
|
* @memberof MeetingInfo
|
|
205
227
|
*/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
value: function () {
|
|
209
|
-
var _createAdhocSpaceMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(conversationUrl) {
|
|
228
|
+
function () {
|
|
229
|
+
var _createAdhocSpaceMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(conversationUrl, installedOrgID) {
|
|
210
230
|
var _this5 = this;
|
|
211
231
|
var getInvitees;
|
|
212
232
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -245,20 +265,26 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
245
265
|
kroUrl: conversation.kmsResourceObjectUrl,
|
|
246
266
|
invitees: getInvitees((_conversation$partici = conversation.participants) === null || _conversation$partici === void 0 ? void 0 : _conversation$partici.items)
|
|
247
267
|
};
|
|
268
|
+
if (installedOrgID) {
|
|
269
|
+
body.installedOrgID = installedOrgID;
|
|
270
|
+
}
|
|
248
271
|
var uri = _this5.webex.meetings.preferredWebexSite ? "https://".concat(_this5.webex.meetings.preferredWebexSite, "/wbxappapi/v2/meetings/spaceInstant") : '';
|
|
249
|
-
_metrics.default.sendBehavioralMetric(_constants2.default.ADHOC_MEETING_SUCCESS);
|
|
250
272
|
return _this5.webex.request({
|
|
251
273
|
method: _constants.HTTP_VERBS.POST,
|
|
252
274
|
uri: uri,
|
|
253
275
|
body: body
|
|
254
276
|
});
|
|
277
|
+
}).then(function (requestResult) {
|
|
278
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.ADHOC_MEETING_SUCCESS);
|
|
279
|
+
return requestResult;
|
|
255
280
|
}).catch(function (err) {
|
|
256
|
-
var _err$
|
|
281
|
+
var _err$body6, _err$body7;
|
|
282
|
+
_this5.handlePolicyError(err);
|
|
257
283
|
_metrics.default.sendBehavioralMetric(_constants2.default.ADHOC_MEETING_FAILURE, {
|
|
258
284
|
reason: err.message,
|
|
259
285
|
stack: err.stack
|
|
260
286
|
});
|
|
261
|
-
throw new MeetingInfoV2AdhocMeetingError((_err$
|
|
287
|
+
throw new MeetingInfoV2AdhocMeetingError((_err$body6 = err.body) === null || _err$body6 === void 0 ? void 0 : _err$body6.code, (_err$body7 = err.body) === null || _err$body7 === void 0 ? void 0 : _err$body7.message);
|
|
262
288
|
}));
|
|
263
289
|
case 4:
|
|
264
290
|
case "end":
|
|
@@ -266,7 +292,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
266
292
|
}
|
|
267
293
|
}, _callee, this);
|
|
268
294
|
}));
|
|
269
|
-
function createAdhocSpaceMeeting(_x) {
|
|
295
|
+
function createAdhocSpaceMeeting(_x, _x2) {
|
|
270
296
|
return _createAdhocSpaceMeeting.apply(this, arguments);
|
|
271
297
|
}
|
|
272
298
|
return createAdhocSpaceMeeting;
|
|
@@ -279,7 +305,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
279
305
|
* @param {Object} captchaInfo
|
|
280
306
|
* @param {String} captchaInfo.code
|
|
281
307
|
* @param {String} captchaInfo.id
|
|
282
|
-
* @param {String} installedOrgID
|
|
308
|
+
* @param {String} installedOrgID org ID of user's machine
|
|
283
309
|
* @param {String} locusId
|
|
284
310
|
* @param {Object} extraParams
|
|
285
311
|
* @param {Object} options
|
|
@@ -291,6 +317,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
291
317
|
key: "fetchMeetingInfo",
|
|
292
318
|
value: function () {
|
|
293
319
|
var _fetchMeetingInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(destination) {
|
|
320
|
+
var _this6 = this;
|
|
294
321
|
var type,
|
|
295
322
|
password,
|
|
296
323
|
captchaInfo,
|
|
@@ -330,7 +357,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
330
357
|
_context2.next = 13;
|
|
331
358
|
break;
|
|
332
359
|
}
|
|
333
|
-
return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination));
|
|
360
|
+
return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination, installedOrgID));
|
|
334
361
|
case 13:
|
|
335
362
|
_context2.next = 15;
|
|
336
363
|
return _utilv.default.getRequestBody(_objectSpread(_objectSpread({}, destinationType), {}, {
|
|
@@ -384,14 +411,8 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
384
411
|
});
|
|
385
412
|
}
|
|
386
413
|
if ((err === null || err === void 0 ? void 0 : err.statusCode) === 403) {
|
|
387
|
-
var _err$
|
|
388
|
-
|
|
389
|
-
var _err$body4, _err$body5, _err$body6, _err$body6$data, _err$body7;
|
|
390
|
-
_metrics.default.sendBehavioralMetric(_constants2.default.MEETING_INFO_POLICY_ERROR, {
|
|
391
|
-
code: (_err$body4 = err.body) === null || _err$body4 === void 0 ? void 0 : _err$body4.code
|
|
392
|
-
});
|
|
393
|
-
throw new MeetingInfoV2PolicyError((_err$body5 = err.body) === null || _err$body5 === void 0 ? void 0 : _err$body5.code, (_err$body6 = err.body) === null || _err$body6 === void 0 ? void 0 : (_err$body6$data = _err$body6.data) === null || _err$body6$data === void 0 ? void 0 : _err$body6$data.meetingInfo, (_err$body7 = err.body) === null || _err$body7 === void 0 ? void 0 : _err$body7.message);
|
|
394
|
-
}
|
|
414
|
+
var _err$body8, _err$body9, _err$body9$data;
|
|
415
|
+
_this6.handlePolicyError(err);
|
|
395
416
|
_metrics.default.sendBehavioralMetric(_constants2.default.VERIFY_PASSWORD_ERROR, {
|
|
396
417
|
reason: err.message,
|
|
397
418
|
stack: err.stack
|
|
@@ -423,7 +444,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
423
444
|
}
|
|
424
445
|
}, _callee2, this);
|
|
425
446
|
}));
|
|
426
|
-
function fetchMeetingInfo(
|
|
447
|
+
function fetchMeetingInfo(_x3) {
|
|
427
448
|
return _fetchMeetingInfo.apply(this, arguments);
|
|
428
449
|
}
|
|
429
450
|
return fetchMeetingInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","POLICY_ERROR_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2PolicyError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","includes","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","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ADHOC_MEETING_SUCCESS","request","method","HTTP_VERBS","POST","catch","err","ADHOC_MEETING_FAILURE","reason","code","password","installedOrgID","locusId","extraParams","options","meetingId","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","DEFAULT_MEETING_INFO_REQUEST_BODY","length","FETCH_MEETING_INFO_V1_FAILURE","webExMeetingId","info","sipUri","requestOptions","getDirectMeetingInfoURI","directURI","service","WBXAPPAPI_SERVICE","resource","response","FETCH_MEETING_INFO_V1_SUCCESS","postEvent","event","eventType","MEETING_INFO_RESPONSE","data","errors","parseWebexApiError","meetingLookupUrl","statusCode","MEETING_INFO_POLICY_ERROR","VERIFY_PASSWORD_ERROR","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL"],"sources":["meeting-info-v2.ts"],"sourcesContent":["import lodash from 'lodash';\nimport {\n HTTP_VERBS,\n _CONVERSATION_URL_,\n WBXAPPAPI_SERVICE,\n DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport Metrics from '../metrics';\nimport {eventType} from '../metrics/config';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE =\n 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE =\n 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR =\n 'Failed starting the adhoc meeting, Please contact support team ';\nconst CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];\nconst POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n meetingInfo: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n meetingInfo?: object,\n message: string = PASSWORD_ERROR_DEFAULT_MESSAGE\n ) {\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 sdkMessage: any;\n wbxAppApiCode: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, message: string = 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 * Error preventing join because of a meeting policy\n */\nexport class MeetingInfoV2PolicyError extends Error {\n meetingInfo: object;\n sdkMessage: string;\n wbxAppApiCode: number;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, meetingInfo?: object, message?: string) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\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 preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n captchaInfo: any;\n isPasswordRequired: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n captchaInfo?: object,\n message: string = CAPTCHA_ERROR_DEFAULT_MESSAGE\n ) {\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 = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n webex: any;\n\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: string, type: string = 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: string) {\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\n .get({url: conversationUrl}, {includeParticipants: true, disableTransform: true})\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\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body,\n });\n })\n .catch((err) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\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 * @param {String} installedOrgID\n * @param {String} locusId\n * @param {Object} extraParams\n * @param {Object} options\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(\n destination: string,\n type: string = null,\n password: string = null,\n captchaInfo: {\n code: string;\n id: string;\n } = null,\n installedOrgID = null,\n locusId = null,\n extraParams: object = {},\n options: {meetingId?: string} = {}\n ) {\n const {meetingId} = options;\n\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n\n if (\n destinationType.type === _CONVERSATION_URL_ &&\n this.webex.config.meetings.experimental.enableAdhocMeetings &&\n this.webex.meetings.preferredWebexSite\n ) {\n return this.createAdhocSpaceMeeting(destinationType.destination);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({\n ...destinationType,\n password,\n captchaInfo,\n installedOrgID,\n locusId,\n extraParams,\n });\n\n // If the body only contains the default properties, we don't have enough to\n // fetch the meeting info so don't bother trying.\n if (\n !lodash.difference(Object.keys(body), Object.keys(DEFAULT_MEETING_INFO_REQUEST_BODY)).length\n ) {\n const err = new Error('Not enough information to fetch meeting info');\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n destinationType: destinationType?.type,\n webExMeetingId: destinationType?.info?.webExMeetingId,\n sipUri: destinationType?.info?.sipUri,\n });\n\n throw err;\n }\n\n const requestOptions: any = {\n method: HTTP_VERBS.POST,\n body,\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) {\n requestOptions.uri = directURI;\n } else {\n requestOptions.service = WBXAPPAPI_SERVICE;\n requestOptions.resource = 'meetingInfo';\n }\n\n return this.webex\n .request(requestOptions)\n .then((response) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);\n\n return response;\n })\n .catch((err) => {\n if (meetingId) {\n Metrics.postEvent({\n event: eventType.MEETING_INFO_RESPONSE,\n meetingId,\n data: {\n errors: [Metrics.parseWebexApiError(err, true)],\n meetingLookupUrl: err?.url,\n },\n });\n }\n\n if (err?.statusCode === 403) {\n if (POLICY_ERROR_CODES.includes(err.body?.code)) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_INFO_POLICY_ERROR, {\n code: err.body?.code,\n });\n\n throw new MeetingInfoV2PolicyError(\n err.body?.code,\n err.body?.data?.meetingInfo,\n err.body?.message\n );\n }\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_CAPTCHA_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\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\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw err;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAMA;AACA;AACA;AAEA;AAAuC;AAAA;AAAA;AAAA;AAEvC,IAAMA,8BAA8B,GAClC,mEAAmE;AACrE,IAAMC,6BAA6B,GACjC,qEAAqE;AACvE,IAAMC,2BAA2B,GAC/B,iEAAiE;AACnE,IAAMC,qCAAqC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;AAC9D,IAAMC,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;;AAE3E;AACA;AACA;AAFA,IAGaC,0BAA0B;EAAA;EAAA;EAMrC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCACEC,kBAA2B,EAC3BC,WAAoB,EAEpB;IAAA;IAAA,IADAC,OAAe,uEAAGR,8BAA8B;IAAA;IAEhD,oCAASQ,OAAO,oBAAUF,kBAAkB;IAAI;IAAA;IAAA;IAAA;IAChD,MAAKG,IAAI,GAAG,4BAA4B;IACxC,MAAKC,UAAU,GAAGF,OAAO;IACzB,MAAKG,KAAK,GAAG,IAAIC,KAAK,EAAE,CAACD,KAAK;IAC9B,MAAKE,aAAa,GAAGP,kBAAkB;IACvC,MAAKC,WAAW,GAAGA,WAAW;IAAC;EACjC;EAAC;AAAA,+CAxB6CK,KAAK;AA2BrD;AACA;AACA;AAFA;AAAA,IAGaE,8BAA8B;EAAA;EAAA;EAGzC;AACF;AAC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,CAACC,mBAAkB,CAACiD,oBAAoB,EAAE;oBACpExC,MAAM,EAAEF,GAAG,CAAC1D,OAAO;oBACnBG,KAAK,EAAEuD,GAAG,CAACvD;kBACb,CAAC,CAAC;kBAEF,MAAM,IAAIK,yBAAyB,gBAACkD,GAAG,CAACpB,IAAI,gDAAR,YAAUuB,IAAI,EAAE;oBAClDwC,SAAS,EAAE3C,GAAG,CAACpB,IAAI,CAACgE,SAAS;oBAC7BC,oBAAoB,EAAE7C,GAAG,CAACpB,IAAI,CAACiE,oBAAoB;oBACnDC,oBAAoB,EAAE9C,GAAG,CAACpB,IAAI,CAACkE,oBAAoB;oBACnDC,UAAU,EAAE/C,GAAG,CAACpB,IAAI,CAACmE;kBACvB,CAAC,CAAC;gBACJ;gBAEAxD,gBAAO,CAACC,oBAAoB,CAACC,mBAAkB,CAAC0B,6BAA6B,EAAE;kBAC7EjB,MAAM,EAAEF,GAAG,CAAC1D,OAAO;kBACnBG,KAAK,EAAEuD,GAAG,CAACvD;gBACb,CAAC,CAAC;gBACF,MAAMuD,GAAG;cACX,CAAC,CAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CACL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","POLICY_ERROR_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","MeetingInfoV2PolicyError","MeetingInfoV2CaptchaError","captchaInfo","isPasswordRequired","includes","MeetingInfoV2","webex","err","body","code","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_INFO_POLICY_ERROR","data","destination","type","MeetingInfoUtil","getDestinationType","conversationUrl","installedOrgID","meetings","preferredWebexSite","getInvitees","particpants","invitees","forEach","participant","push","email","emailAddress","ciUserUuid","entryUUID","internal","conversation","get","url","includeParticipants","disableTransform","then","title","displayName","spaceUrl","keyUrl","encryptionKeyUrl","kroUrl","kmsResourceObjectUrl","participants","items","uri","request","method","HTTP_VERBS","POST","requestResult","ADHOC_MEETING_SUCCESS","catch","handlePolicyError","ADHOC_MEETING_FAILURE","reason","password","locusId","extraParams","options","meetingId","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","DEFAULT_MEETING_INFO_REQUEST_BODY","length","FETCH_MEETING_INFO_V1_FAILURE","webExMeetingId","info","sipUri","requestOptions","getDirectMeetingInfoURI","directURI","service","WBXAPPAPI_SERVICE","resource","response","FETCH_MEETING_INFO_V1_SUCCESS","postEvent","event","eventType","MEETING_INFO_RESPONSE","errors","parseWebexApiError","meetingLookupUrl","statusCode","VERIFY_PASSWORD_ERROR","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL"],"sources":["meeting-info-v2.ts"],"sourcesContent":["import lodash from 'lodash';\nimport {\n HTTP_VERBS,\n _CONVERSATION_URL_,\n WBXAPPAPI_SERVICE,\n DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport Metrics from '../metrics';\nimport {eventType} from '../metrics/config';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nimport MeetingInfoUtil from './utilv2';\n\nconst PASSWORD_ERROR_DEFAULT_MESSAGE =\n 'Password required. Call fetchMeetingInfo() with password argument';\nconst CAPTCHA_ERROR_DEFAULT_MESSAGE =\n 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';\nconst ADHOC_MEETING_DEFAULT_ERROR =\n 'Failed starting the adhoc meeting, Please contact support team ';\nconst CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];\nconst POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];\n\n/**\n * Error to indicate that wbxappapi requires a password\n */\nexport class MeetingInfoV2PasswordError extends Error {\n meetingInfo: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n meetingInfo?: object,\n message: string = PASSWORD_ERROR_DEFAULT_MESSAGE\n ) {\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 sdkMessage: any;\n wbxAppApiCode: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, message: string = 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 * Error preventing join because of a meeting policy\n */\nexport class MeetingInfoV2PolicyError extends Error {\n meetingInfo: object;\n sdkMessage: string;\n wbxAppApiCode: number;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [meetingInfo]\n * @param {String} [message]\n */\n constructor(wbxAppApiErrorCode?: number, meetingInfo?: object, message?: string) {\n super(`${message}, code=${wbxAppApiErrorCode}`);\n this.name = 'MeetingInfoV2AdhocMeetingError';\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 preferred webex site not present to start adhoc meeting\n */\nexport class MeetingInfoV2CaptchaError extends Error {\n captchaInfo: any;\n isPasswordRequired: any;\n sdkMessage: any;\n wbxAppApiCode: any;\n body: any;\n /**\n *\n * @constructor\n * @param {Number} [wbxAppApiErrorCode]\n * @param {Object} [captchaInfo]\n * @param {String} [message]\n */\n constructor(\n wbxAppApiErrorCode?: number,\n captchaInfo?: object,\n message: string = CAPTCHA_ERROR_DEFAULT_MESSAGE\n ) {\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 = CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES.includes(wbxAppApiErrorCode);\n this.captchaInfo = captchaInfo;\n }\n}\n\n/**\n * @class MeetingInfo\n */\nexport default class MeetingInfoV2 {\n webex: any;\n\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: string, type: string = null) {\n return MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n }\n\n /**\n * Raises a MeetingInfoV2PolicyError for policy error codes\n * @param {any} err the error from the request\n * @returns {void}\n */\n handlePolicyError = (err) => {\n if (!err.body) {\n return;\n }\n\n if (POLICY_ERROR_CODES.includes(err.body?.code)) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_INFO_POLICY_ERROR, {\n code: err.body?.code,\n });\n\n throw new MeetingInfoV2PolicyError(\n err.body?.code,\n err.body?.data?.meetingInfo,\n err.body?.message\n );\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 * @param {String} installedOrgID org ID of user's machine\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async createAdhocSpaceMeeting(conversationUrl: string, installedOrgID?: string) {\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\n .get({url: conversationUrl}, {includeParticipants: true, disableTransform: true})\n .then((conversation) => {\n const body: {\n title: string;\n spaceUrl: string;\n keyUrl: string;\n kroUrl: string;\n invitees: any[];\n installedOrgID?: string;\n } = {\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 if (installedOrgID) {\n body.installedOrgID = installedOrgID;\n }\n\n const uri = this.webex.meetings.preferredWebexSite\n ? `https://${this.webex.meetings.preferredWebexSite}/wbxappapi/v2/meetings/spaceInstant`\n : '';\n\n return this.webex.request({\n method: HTTP_VERBS.POST,\n uri,\n body,\n });\n })\n .then((requestResult) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_SUCCESS);\n\n return requestResult;\n })\n .catch((err) => {\n this.handlePolicyError(err);\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ADHOC_MEETING_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw new MeetingInfoV2AdhocMeetingError(err.body?.code, err.body?.message);\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 * @param {String} installedOrgID org ID of user's machine\n * @param {String} locusId\n * @param {Object} extraParams\n * @param {Object} options\n * @returns {Promise} returns a meeting info object\n * @public\n * @memberof MeetingInfo\n */\n async fetchMeetingInfo(\n destination: string,\n type: string = null,\n password: string = null,\n captchaInfo: {\n code: string;\n id: string;\n } = null,\n installedOrgID = null,\n locusId = null,\n extraParams: object = {},\n options: {meetingId?: string} = {}\n ) {\n const {meetingId} = options;\n\n const destinationType = await MeetingInfoUtil.getDestinationType({\n destination,\n type,\n webex: this.webex,\n });\n\n if (\n destinationType.type === _CONVERSATION_URL_ &&\n this.webex.config.meetings.experimental.enableAdhocMeetings &&\n this.webex.meetings.preferredWebexSite\n ) {\n return this.createAdhocSpaceMeeting(destinationType.destination, installedOrgID);\n }\n\n const body = await MeetingInfoUtil.getRequestBody({\n ...destinationType,\n password,\n captchaInfo,\n installedOrgID,\n locusId,\n extraParams,\n });\n\n // If the body only contains the default properties, we don't have enough to\n // fetch the meeting info so don't bother trying.\n if (\n !lodash.difference(Object.keys(body), Object.keys(DEFAULT_MEETING_INFO_REQUEST_BODY)).length\n ) {\n const err = new Error('Not enough information to fetch meeting info');\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n destinationType: destinationType?.type,\n webExMeetingId: destinationType?.info?.webExMeetingId,\n sipUri: destinationType?.info?.sipUri,\n });\n\n throw err;\n }\n\n const requestOptions: any = {\n method: HTTP_VERBS.POST,\n body,\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) {\n requestOptions.uri = directURI;\n } else {\n requestOptions.service = WBXAPPAPI_SERVICE;\n requestOptions.resource = 'meetingInfo';\n }\n\n return this.webex\n .request(requestOptions)\n .then((response) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);\n\n return response;\n })\n .catch((err) => {\n if (meetingId) {\n Metrics.postEvent({\n event: eventType.MEETING_INFO_RESPONSE,\n meetingId,\n data: {\n errors: [Metrics.parseWebexApiError(err, true)],\n meetingLookupUrl: err?.url,\n },\n });\n }\n\n if (err?.statusCode === 403) {\n this.handlePolicyError(err);\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_PASSWORD_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\n throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);\n }\n if (err?.statusCode === 423) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.VERIFY_CAPTCHA_ERROR, {\n reason: err.message,\n stack: err.stack,\n });\n\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\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_FAILURE, {\n reason: err.message,\n stack: err.stack,\n });\n throw err;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAMA;AACA;AACA;AAEA;AAAuC;AAAA;AAAA;AAAA;AAEvC,IAAMA,8BAA8B,GAClC,mEAAmE;AACrE,IAAMC,6BAA6B,GACjC,qEAAqE;AACvE,IAAMC,2BAA2B,GAC/B,iEAAiE;AACnE,IAAMC,qCAAqC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;AAC9D,IAAMC,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;;AAE3E;AACA;AACA;AAFA,IAGaC,0BAA0B;EAAA;EAAA;EAMrC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCACEC,kBAA2B,EAC3BC,WAAoB,EAEpB;IAAA;IAAA,IADAC,OAAe,uEAAGR,8BAA8B;IAAA;IAEhD,oCAASQ,OAAO,oBAAUF,kBAAkB;IAAI;IAAA;IAAA;IAAA;IAChD,MAAKG,IAAI,GAAG,4BAA4B;IACxC,MAAKC,UAAU,GAAGF,OAAO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AAEW,GAAG,CAACX;gBACb,CAAC,CAAC;gBACF,MAAMW,GAAG;cACX,CAAC,CAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CACL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
|
|
@@ -251,6 +251,7 @@ MeetingInfoUtil.getDestinationType = /*#__PURE__*/function () {
|
|
|
251
251
|
* Helper function to build up a correct locus url depending on the value passed
|
|
252
252
|
* @param {Object} options type and value to fetch meeting info
|
|
253
253
|
* @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]
|
|
254
|
+
* @param {String} options.installedOrgID org ID of user's machine
|
|
254
255
|
* @param {Object} options.destination ?? value.value
|
|
255
256
|
* @returns {Object} returns an object with {resource, method}
|
|
256
257
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeetingInfoUtil","getParsedUrl","link","parsedUrl","url","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","destination","deconstructHydraId","type","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","ParameterError","catch","err","getDestinationType","from","_PERSONAL_ROOM_","userId","device","orgId","options","VALID_EMAIL_ADDRESS","email","list","items","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getRequestBody","password","captchaInfo","installedOrgID","locusId","extraParams","body","DEFAULT_MEETING_INFO_REQUEST_BODY","sipUrl","_MEETING_ID_","meetingKey","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingInfoURI","preferredWebexSite","webExSite"],"sources":["utilv2.ts"],"sourcesContent":["import url from 'url';\n\nimport {\n // @ts-ignore\n deconstructHydraId,\n} from '@webex/common';\n\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n _MEETING_UUID_,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS,\n DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nconst MeetingInfoUtil: any = {};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) {\n // this case checks if your type is personal room\n if (!destination) {\n // if we are not getting anything in desination we fetch org and user ids from webex instance\n destination = {\n userId: webex.internal.device.userId,\n orgId: webex.internal.device.orgId,\n };\n } else {\n const options = VALID_EMAIL_ADDRESS.test(destination)\n ? {email: destination}\n : {id: destination}; // we are assuming userId as default\n const res = await webex.people.list(options);\n\n let {orgId, id: userId} = res.items[0];\n\n userId = deconstructHydraId(userId).id;\n orgId = deconstructHydraId(orgId).id;\n destination = {userId, orgId};\n }\n }\n if (type) {\n return {\n destination,\n type,\n };\n }\n const options: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination,\n });\n\n options.destination = conversationUrl;\n } catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#getDestinationType --> ${e}`);\n throw e;\n }\n } else {\n LoggerProxy.logger.warn(\n \"Meeting-info:util#getDestinationType --> ('MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.\"\n );\n throw new ParameterError(\n 'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.'\n );\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options: {type: string; destination: object} | any) => {\n const {type, destination, password, captchaInfo, installedOrgID, locusId, extraParams} = options;\n const body: any = {\n ...DEFAULT_MEETING_INFO_REQUEST_BODY,\n ...extraParams,\n };\n\n switch (type) {\n case _SIP_URI_:\n body.sipUrl = destination;\n break;\n case _PERSONAL_ROOM_:\n body.userId = destination.userId;\n body.orgId = destination.orgId;\n break;\n case _MEETING_ID_:\n body.meetingKey = destination;\n break;\n case _CONVERSATION_URL_:\n body.conversationUrl = destination;\n break;\n case _LOCUS_ID_:\n // use meetingID for the completer meeting info for the already started meeting\n if (destination.info?.webExMeetingId) {\n body.meetingKey = destination.info.webExMeetingId;\n } else if (destination.info?.sipUri) {\n body.sipUrl = destination.info.sipUri;\n }\n break;\n case _MEETING_LINK_:\n body.meetingUrl = destination;\n break;\n case _MEETING_UUID_: {\n body.meetingUUID = destination;\n break;\n }\n default:\n }\n\n if (password) {\n body.password = password;\n }\n\n if (captchaInfo) {\n body.captchaID = captchaInfo.id;\n body.captchaVerifyCode = captchaInfo.code;\n }\n\n if (installedOrgID) {\n body.installedOrgID = installedOrgID;\n }\n\n if (locusId) {\n body.locusId = locusId;\n }\n\n return body;\n};\n\n/**\n * Helper function to parse the webex site/host from a URI string.\n * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')\n * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')\n */\nMeetingInfoUtil.getWebexSite = (uri: string) => {\n const exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];\n const site = uri?.match(/.+@([^.]+\\.[^.]+\\.[^.]+)$/)?.[1];\n\n return exceptedDomains.includes(site) ? null : site;\n};\n\n/**\n * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {String} returns a URI string or null of there is no direct URI\n */\nMeetingInfoUtil.getDirectMeetingInfoURI = (options: {type: string; destination: any}) => {\n const {type, destination} = options;\n\n let preferredWebexSite = null;\n\n switch (type) {\n case _SIP_URI_:\n preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);\n break;\n case _LOCUS_ID_:\n preferredWebexSite = destination.info?.webExSite;\n break;\n default:\n }\n\n return preferredWebexSite ? `https://${preferredWebexSite}/wbxappapi/v1/meetingInfo` : null;\n};\n\nexport default MeetingInfoUtil;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAEA;AAKA;AAqBA;AACA;AAAsD;AAAA;AAEtD,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAE/BA,eAAe,CAACC,YAAY,GAAG,UAACC,IAAI,EAAK;EACvC,IAAI;IACF,IAAIC,SAAS,GAAGC,YAAG,CAACC,KAAK,CAACH,IAAI,CAAC;IAE/B,IAAI,CAACC,SAAS,EAAE;MACd,OAAO,KAAK;IACd;IACA;IACA,IAAI,CAACA,SAAS,CAACG,QAAQ,EAAE;MACvBH,SAAS,GAAGC,YAAG,CAACC,KAAK,WAAIE,yBAAc,SAAGL,IAAI,EAAG;IACnD;IAEA,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdC,oBAAW,CAACC,MAAM,CAACC,IAAI,8EACiDH,KAAK,EAC5E;IAED,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACAR,eAAe,CAACY,aAAa,GAAG,UAACC,KAAa,EAAK;EACjD,IAAMV,SAAS,GAAGH,eAAe,CAACC,YAAY,CAACY,KAAK,CAAC;EACrD,IAAMC,YAAY,GAAGX,SAAS,CAACY,QAAQ,IAAIZ,SAAS,CAACY,QAAQ,C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B,WAAW;EAExB,IAAIkE,kBAAkB,GAAG,IAAI;EAE7B,QAAQhE,IAAI;IACV,KAAK8B,oBAAS;MACZkC,kBAAkB,GAAG7G,eAAe,CAACuG,YAAY,CAAC5D,WAAW,CAAC;MAC9D;IACF,KAAKmD,qBAAU;MACbe,kBAAkB,yBAAGlE,WAAW,CAACoD,IAAI,uDAAhB,mBAAkBe,SAAS;MAChD;IACF;EAAQ;EAGV,OAAOD,kBAAkB,qBAAcA,kBAAkB,iCAA8B,IAAI;AAC7F,CAAC;AAAC,eAEa7G,eAAe;AAAA"}
|
|
1
|
+
{"version":3,"names":["MeetingInfoUtil","getParsedUrl","link","parsedUrl","url","parse","protocol","HTTPS_PROTOCOL","error","LoggerProxy","logger","warn","isMeetingLink","value","hostNameBool","hostname","includes","WEBEX_DOT_COM","pathNameBool","pathname","MEET","MEET_M","JOIN","isConversationUrl","webex","clusterId","internal","services","getClusterId","endsWith","CONVERSATION_SERVICE","isSipUri","sipString","sipUri","DIALER_REGEX","SIP_ADDRESS","exec","isPhoneNumber","phoneNumber","isValidNumber","PHONE_NUMBER","test","getHydraId","destination","deconstructHydraId","type","id","cluster","UUID_REG","_ROOM_","room","_PEOPLE_","people","getSipUriFromHydraPersonId","get","then","res","emails","length","ParameterError","catch","err","getDestinationType","from","_PERSONAL_ROOM_","userId","device","orgId","options","VALID_EMAIL_ADDRESS","email","list","items","hydraId","_MEETING_LINK_","_SIP_URI_","_CONVERSATION_URL_","wasHydraPerson","resolve","waitForCatalog","conversationUrl","conversation","getUrlFromClusterId","getRequestBody","password","captchaInfo","installedOrgID","locusId","extraParams","body","DEFAULT_MEETING_INFO_REQUEST_BODY","sipUrl","_MEETING_ID_","meetingKey","_LOCUS_ID_","info","webExMeetingId","meetingUrl","_MEETING_UUID_","meetingUUID","captchaID","captchaVerifyCode","code","getWebexSite","uri","exceptedDomains","site","match","getDirectMeetingInfoURI","preferredWebexSite","webExSite"],"sources":["utilv2.ts"],"sourcesContent":["import url from 'url';\n\nimport {\n // @ts-ignore\n deconstructHydraId,\n} from '@webex/common';\n\nimport {\n _SIP_URI_,\n _PERSONAL_ROOM_,\n _MEETING_ID_,\n _CONVERSATION_URL_,\n _LOCUS_ID_,\n _MEETING_LINK_,\n _PEOPLE_,\n _ROOM_,\n _MEETING_UUID_,\n DIALER_REGEX,\n WEBEX_DOT_COM,\n CONVERSATION_SERVICE,\n JOIN,\n MEET,\n MEET_M,\n HTTPS_PROTOCOL,\n UUID_REG,\n VALID_EMAIL_ADDRESS,\n DEFAULT_MEETING_INFO_REQUEST_BODY,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nconst MeetingInfoUtil: any = {};\n\nMeetingInfoUtil.getParsedUrl = (link) => {\n try {\n let parsedUrl = url.parse(link);\n\n if (!parsedUrl) {\n return false;\n }\n // hack for links such as <company>.webex.com/meet/<user> without a protocol\n if (!parsedUrl.protocol) {\n parsedUrl = url.parse(`${HTTPS_PROTOCOL}${link}`);\n }\n\n return parsedUrl;\n } catch (error) {\n LoggerProxy.logger.warn(\n `Meeting-info:util#getParsedUrl --> unable to parse the URL, error: ${error}`\n );\n\n return null;\n }\n};\n\n/**\n * Helper function to check if a string matches a known meeting link pattern\n * @param {String} value string to parse and see if it matches a meeting link\n * @returns {Boolean}\n */\nMeetingInfoUtil.isMeetingLink = (value: string) => {\n const parsedUrl = MeetingInfoUtil.getParsedUrl(value);\n const hostNameBool = parsedUrl.hostname && parsedUrl.hostname.includes(WEBEX_DOT_COM);\n const pathNameBool =\n parsedUrl.pathname &&\n (parsedUrl.pathname.includes(`/${MEET}`) ||\n parsedUrl.pathname.includes(`/${MEET_M}`) ||\n parsedUrl.pathname.includes(`/${JOIN}`));\n\n return hostNameBool && pathNameBool;\n};\n\nMeetingInfoUtil.isConversationUrl = (value, webex) => {\n const clusterId = webex.internal.services.getClusterId(value);\n\n if (clusterId) {\n return clusterId.endsWith(CONVERSATION_SERVICE);\n }\n\n return false;\n};\n\nMeetingInfoUtil.isSipUri = (sipString) => {\n // TODO: lets remove regex from this equation and user URI matchers and such\n // have not found a great sip uri parser library as of now\n const sipUri = DIALER_REGEX.SIP_ADDRESS.exec(sipString);\n\n return sipUri;\n};\n\nMeetingInfoUtil.isPhoneNumber = (phoneNumber) => {\n const isValidNumber = DIALER_REGEX.PHONE_NUMBER.test(phoneNumber);\n\n return isValidNumber;\n};\n\nMeetingInfoUtil.getHydraId = (destination) => {\n const {type, id, cluster} = deconstructHydraId(destination);\n\n if (id && UUID_REG.test(id)) {\n if (type === _ROOM_) {\n return {room: true, destination: id, cluster};\n }\n if (type === _PEOPLE_) {\n return {people: true, destination: id, cluster};\n }\n\n return {};\n }\n\n return {};\n};\n\nMeetingInfoUtil.getSipUriFromHydraPersonId = (destination, webex) =>\n webex.people\n .get(destination)\n .then((res) => {\n if (res.emails && res.emails.length) {\n return res.emails[0];\n }\n throw new ParameterError('Hydra Id Lookup was an invalid hydra person id.');\n })\n .catch((err) => {\n LoggerProxy.logger.error(\n `Meeting-info:util#MeetingInfoUtil.getSipUriFromHydraPersonId --> getSipUriFromHydraPersonId ${err} `\n );\n throw err;\n });\n\nMeetingInfoUtil.getDestinationType = async (from) => {\n const {type, webex} = from;\n let {destination} = from;\n\n if (type === _PERSONAL_ROOM_) {\n // this case checks if your type is personal room\n if (!destination) {\n // if we are not getting anything in desination we fetch org and user ids from webex instance\n destination = {\n userId: webex.internal.device.userId,\n orgId: webex.internal.device.orgId,\n };\n } else {\n const options = VALID_EMAIL_ADDRESS.test(destination)\n ? {email: destination}\n : {id: destination}; // we are assuming userId as default\n const res = await webex.people.list(options);\n\n let {orgId, id: userId} = res.items[0];\n\n userId = deconstructHydraId(userId).id;\n orgId = deconstructHydraId(orgId).id;\n destination = {userId, orgId};\n }\n }\n if (type) {\n return {\n destination,\n type,\n };\n }\n const options: any = {};\n const hydraId = MeetingInfoUtil.getHydraId(destination);\n\n if (MeetingInfoUtil.isMeetingLink(destination)) {\n LoggerProxy.logger.warn(\n 'Meeting-info:util#generateOptions --> WARN, use of Meeting Link is deprecated, please use a SIP URI instead'\n );\n\n options.type = _MEETING_LINK_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isSipUri(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isPhoneNumber(destination)) {\n options.type = _SIP_URI_;\n options.destination = destination;\n } else if (MeetingInfoUtil.isConversationUrl(destination, webex)) {\n options.type = _CONVERSATION_URL_;\n options.destination = destination;\n } else if (hydraId.people) {\n options.type = _SIP_URI_;\n\n return MeetingInfoUtil.getSipUriFromHydraPersonId(hydraId.destination, webex).then((res) => {\n options.destination = res;\n\n // Since hydra person ids require a unique case in which they are\n // entirely converted to a SIP URI, we need to set a flag for detecting\n // this type of destination.\n options.wasHydraPerson = true;\n\n return Promise.resolve(options);\n });\n } else if (hydraId.room) {\n options.type = _CONVERSATION_URL_;\n try {\n await webex.internal.services.waitForCatalog('postauth');\n\n const conversationUrl = webex.internal.conversation.getUrlFromClusterId({\n cluster: hydraId.cluster,\n id: hydraId.destination,\n });\n\n options.destination = conversationUrl;\n } catch (e) {\n LoggerProxy.logger.error(`Meeting-info:util#getDestinationType --> ${e}`);\n throw e;\n }\n } else {\n LoggerProxy.logger.warn(\n \"Meeting-info:util#getDestinationType --> ('MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.\"\n );\n throw new ParameterError(\n 'MeetingInfo is fetched with meeting link, sip uri, phone number, hydra room id, hydra people id, or a conversation url.'\n );\n }\n\n return Promise.resolve(options);\n};\n\n/**\n * Helper function to build up a correct locus url depending on the value passed\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {String} options.installedOrgID org ID of user's machine\n * @param {Object} options.destination ?? value.value\n * @returns {Object} returns an object with {resource, method}\n */\nMeetingInfoUtil.getRequestBody = (options: {type: string; destination: object} | any) => {\n const {type, destination, password, captchaInfo, installedOrgID, locusId, extraParams} = options;\n const body: any = {\n ...DEFAULT_MEETING_INFO_REQUEST_BODY,\n ...extraParams,\n };\n\n switch (type) {\n case _SIP_URI_:\n body.sipUrl = destination;\n break;\n case _PERSONAL_ROOM_:\n body.userId = destination.userId;\n body.orgId = destination.orgId;\n break;\n case _MEETING_ID_:\n body.meetingKey = destination;\n break;\n case _CONVERSATION_URL_:\n body.conversationUrl = destination;\n break;\n case _LOCUS_ID_:\n // use meetingID for the completer meeting info for the already started meeting\n if (destination.info?.webExMeetingId) {\n body.meetingKey = destination.info.webExMeetingId;\n } else if (destination.info?.sipUri) {\n body.sipUrl = destination.info.sipUri;\n }\n break;\n case _MEETING_LINK_:\n body.meetingUrl = destination;\n break;\n case _MEETING_UUID_: {\n body.meetingUUID = destination;\n break;\n }\n default:\n }\n\n if (password) {\n body.password = password;\n }\n\n if (captchaInfo) {\n body.captchaID = captchaInfo.id;\n body.captchaVerifyCode = captchaInfo.code;\n }\n\n if (installedOrgID) {\n body.installedOrgID = installedOrgID;\n }\n\n if (locusId) {\n body.locusId = locusId;\n }\n\n return body;\n};\n\n/**\n * Helper function to parse the webex site/host from a URI string.\n * @param {String} uri string (e.g. '10019857020@convergedats.webex.com')\n * @returns {String} the site/host part of the URI string (e.g. 'convergedats.webex.com')\n */\nMeetingInfoUtil.getWebexSite = (uri: string) => {\n const exceptedDomains = ['meet.webex.com', 'meetup.webex.com', 'ciscospark.com'];\n const site = uri?.match(/.+@([^.]+\\.[^.]+\\.[^.]+)$/)?.[1];\n\n return exceptedDomains.includes(site) ? null : site;\n};\n\n/**\n * Helper function to return the direct URI for fetching meeting info (to avoid a redirect).\n * @param {Object} options type and value to fetch meeting info\n * @param {String} options.type One of [SIP_URI, PERSONAL_ROOM, MEETING_ID, CONVERSATION_URL, LOCUS_ID, MEETING_LINK]\n * @param {Object} options.destination ?? value.value\n * @returns {String} returns a URI string or null of there is no direct URI\n */\nMeetingInfoUtil.getDirectMeetingInfoURI = (options: {type: string; destination: any}) => {\n const {type, destination} = options;\n\n let preferredWebexSite = null;\n\n switch (type) {\n case _SIP_URI_:\n preferredWebexSite = MeetingInfoUtil.getWebexSite(destination);\n break;\n case _LOCUS_ID_:\n preferredWebexSite = destination.info?.webExSite;\n break;\n default:\n }\n\n return preferredWebexSite ? `https://${preferredWebexSite}/wbxappapi/v1/meetingInfo` : null;\n};\n\nexport default MeetingInfoUtil;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAEA;AAKA;AAqBA;AACA;AAAsD;AAAA;AAEtD,IAAMA,eAAoB,GAAG,CAAC,CAAC;AAE/BA,eAAe,CAACC,YAAY,GAAG,UAACC,IAAI,EAAK;EACvC,IAAI;IACF,IAAIC,SAAS,GAAGC,YAAG,CAACC,KAAK,CAACH,IAAI,CAAC;IAE/B,IAAI,CAACC,SAAS,EAAE;MACd,OAAO,KAAK;IACd;IACA;IACA,IAAI,CAACA,SAAS,CAACG,QAAQ,EAAE;MACvBH,SAAS,GAAGC,YAAG,CAACC,KAAK,WAAIE,yBAAc,SAAGL,IAAI,EAAG;IACnD;IAEA,OAAOC,SAAS;EAClB,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdC,oBAAW,CAACC,MAAM,CAACC,IAAI,8EACiDH,KAAK,EAC5E;IAED,OAAO,IAAI;EACb;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACAR,eAAe,CAACY,aAAa,GAAG,UAACC,KAAa,EAAK;EACjD,IAAMV,SAAS,GAAGH,eAAe,CAACC,YAAY,CAACY,KAAK,CAAC;EACrD,IAAMC,YAAY,GAAGX,SAAS,CAACY,QAAQ,IAAIZ,SAAS,CAACY,QAAQ,CAACC,QAAQ,CAACC,wBAAa,CAAC;EACrF,IAAMC,YAAY,GAChBf,SAAS,CAACgB,QAAQ,KACjBhB,SAAS,CAACgB,QAAQ,CAACH,QAAQ,YAAKI,eAAI,EAAG,IACtCjB,SAAS,CAACgB,QAA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,KAAKmD,qBAAU;MACbe,kBAAkB,yBAAGlE,WAAW,CAACoD,IAAI,uDAAhB,mBAAkBe,SAAS;MAChD;IACF;EAAQ;EAGV,OAAOD,kBAAkB,qBAAcA,kBAAkB,iCAA8B,IAAI;AAC7F,CAAC;AAAC,eAEa7G,eAAe;AAAA"}
|
|
@@ -30,6 +30,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
30
30
|
* @param {boolean} options.moveToResource
|
|
31
31
|
* @param {Object} options.roapMessage
|
|
32
32
|
* @param {boolean} options.breakoutsSupported
|
|
33
|
+
* @param {String} options.locale,
|
|
34
|
+
* @param {Array} options.deviceCapabilities
|
|
33
35
|
* @param {boolean} options.liveAnnotationSupported
|
|
34
36
|
* @returns {Promise}
|
|
35
37
|
*/
|
|
@@ -50,6 +52,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
50
52
|
permissionToken: any;
|
|
51
53
|
preferTranscoding: any;
|
|
52
54
|
breakoutsSupported: boolean;
|
|
55
|
+
locale?: string;
|
|
56
|
+
deviceCapabilities?: Array<string>;
|
|
53
57
|
liveAnnotationSupported: boolean;
|
|
54
58
|
}): Promise<any>;
|
|
55
59
|
/**
|
|
@@ -82,14 +82,21 @@ export default class MeetingInfoV2 {
|
|
|
82
82
|
* @memberof MeetingInfo
|
|
83
83
|
*/
|
|
84
84
|
fetchInfoOptions(destination: string, type?: string): any;
|
|
85
|
+
/**
|
|
86
|
+
* Raises a MeetingInfoV2PolicyError for policy error codes
|
|
87
|
+
* @param {any} err the error from the request
|
|
88
|
+
* @returns {void}
|
|
89
|
+
*/
|
|
90
|
+
handlePolicyError: (err: any) => void;
|
|
85
91
|
/**
|
|
86
92
|
* Creates adhoc space meetings for a space by fetching the conversation infomation
|
|
87
93
|
* @param {String} conversationUrl conversationUrl to start adhoc meeting on
|
|
94
|
+
* @param {String} installedOrgID org ID of user's machine
|
|
88
95
|
* @returns {Promise} returns a meeting info object
|
|
89
96
|
* @public
|
|
90
97
|
* @memberof MeetingInfo
|
|
91
98
|
*/
|
|
92
|
-
createAdhocSpaceMeeting(conversationUrl: string): Promise<any>;
|
|
99
|
+
createAdhocSpaceMeeting(conversationUrl: string, installedOrgID?: string): Promise<any>;
|
|
93
100
|
/**
|
|
94
101
|
* Fetches meeting info from the server
|
|
95
102
|
* @param {String} destination one of many different types of destinations to look up info for
|
|
@@ -98,7 +105,7 @@ export default class MeetingInfoV2 {
|
|
|
98
105
|
* @param {Object} captchaInfo
|
|
99
106
|
* @param {String} captchaInfo.code
|
|
100
107
|
* @param {String} captchaInfo.id
|
|
101
|
-
* @param {String} installedOrgID
|
|
108
|
+
* @param {String} installedOrgID org ID of user's machine
|
|
102
109
|
* @param {String} locusId
|
|
103
110
|
* @param {Object} extraParams
|
|
104
111
|
* @param {Object} options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.114",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"contributors": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@webex/plugin-meetings": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mocha": "3.0.0-beta.
|
|
38
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
39
|
-
"@webex/test-helper-retry": "3.0.0-beta.
|
|
40
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
35
|
+
"@webex/plugin-meetings": "3.0.0-beta.114",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.114",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.114",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.114",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.114",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.114",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@webex/common": "3.0.0-beta.
|
|
49
|
+
"@webex/common": "3.0.0-beta.114",
|
|
50
50
|
"@webex/internal-media-core": "1.38.0",
|
|
51
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
52
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
53
|
-
"@webex/internal-plugin-llm": "3.0.0-beta.
|
|
54
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
55
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
56
|
-
"@webex/internal-plugin-support": "3.0.0-beta.
|
|
57
|
-
"@webex/internal-plugin-user": "3.0.0-beta.
|
|
58
|
-
"@webex/media-helpers": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-people": "3.0.0-beta.
|
|
60
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
61
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.114",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.114",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.114",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.114",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.114",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.114",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.114",
|
|
58
|
+
"@webex/media-helpers": "3.0.0-beta.114",
|
|
59
|
+
"@webex/plugin-people": "3.0.0-beta.114",
|
|
60
|
+
"@webex/plugin-rooms": "3.0.0-beta.114",
|
|
61
|
+
"@webex/webex-core": "3.0.0-beta.114",
|
|
62
62
|
"ampersand-collection": "^2.0.2",
|
|
63
63
|
"bowser": "^2.11.0",
|
|
64
64
|
"btoa": "^1.2.1",
|
package/src/meeting/request.ts
CHANGED
|
@@ -89,6 +89,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
89
89
|
* @param {boolean} options.moveToResource
|
|
90
90
|
* @param {Object} options.roapMessage
|
|
91
91
|
* @param {boolean} options.breakoutsSupported
|
|
92
|
+
* @param {String} options.locale,
|
|
93
|
+
* @param {Array} options.deviceCapabilities
|
|
92
94
|
* @param {boolean} options.liveAnnotationSupported
|
|
93
95
|
* @returns {Promise}
|
|
94
96
|
*/
|
|
@@ -109,6 +111,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
109
111
|
permissionToken: any;
|
|
110
112
|
preferTranscoding: any;
|
|
111
113
|
breakoutsSupported: boolean;
|
|
114
|
+
locale?: string;
|
|
115
|
+
deviceCapabilities?: Array<string>;
|
|
112
116
|
liveAnnotationSupported: boolean;
|
|
113
117
|
}) {
|
|
114
118
|
const {
|
|
@@ -127,6 +131,8 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
127
131
|
roapMessage,
|
|
128
132
|
preferTranscoding,
|
|
129
133
|
breakoutsSupported,
|
|
134
|
+
locale,
|
|
135
|
+
deviceCapabilities = [],
|
|
130
136
|
liveAnnotationSupported,
|
|
131
137
|
} = options;
|
|
132
138
|
|
|
@@ -156,17 +162,21 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
156
162
|
},
|
|
157
163
|
};
|
|
158
164
|
|
|
159
|
-
let deviceCapabilities = [];
|
|
160
165
|
if (breakoutsSupported) {
|
|
161
|
-
deviceCapabilities
|
|
166
|
+
deviceCapabilities.push(BREAKOUTS.BREAKOUTS_SUPPORTED);
|
|
162
167
|
}
|
|
163
168
|
if (liveAnnotationSupported) {
|
|
164
|
-
deviceCapabilities
|
|
169
|
+
deviceCapabilities.push(ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);
|
|
165
170
|
}
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
|
|
172
|
+
if (locale) {
|
|
173
|
+
body.locale = locale;
|
|
168
174
|
}
|
|
169
175
|
|
|
176
|
+
// add deviceCapabilities prop
|
|
177
|
+
if (deviceCapabilities.length) {
|
|
178
|
+
body.deviceCapabilities = deviceCapabilities;
|
|
179
|
+
}
|
|
170
180
|
// @ts-ignore
|
|
171
181
|
if (this.webex.meetings.clientRegion) {
|
|
172
182
|
// @ts-ignore
|
package/src/meeting/util.ts
CHANGED
|
@@ -109,6 +109,8 @@ MeetingUtil.joinMeeting = (meeting, options) => {
|
|
|
109
109
|
preferTranscoding: !meeting.isMultistream,
|
|
110
110
|
asResourceOccupant: options.asResourceOccupant,
|
|
111
111
|
breakoutsSupported: options.breakoutsSupported,
|
|
112
|
+
locale: options.locale,
|
|
113
|
+
deviceCapabilities: options.deviceCapabilities,
|
|
112
114
|
})
|
|
113
115
|
.then((res) => {
|
|
114
116
|
Metrics.postEvent({
|