@webex/plugin-meetings 3.0.0-beta.71 → 3.0.0-beta.72
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/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/locus-info/index.js +5 -3
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +17 -12
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/meeting/index.js +3 -1
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -10
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +5 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/locus-info/index.d.ts +1 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +2 -1
- package/package.json +18 -18
- package/src/config.ts +1 -0
- package/src/locus-info/index.ts +7 -2
- package/src/locus-info/selfUtils.ts +6 -4
- package/src/meeting/index.ts +3 -1
- package/src/meeting-info/meeting-info-v2.ts +9 -2
- package/src/meeting-info/utilv2.ts +5 -1
- package/test/unit/spec/locus-info/index.js +31 -2
- package/test/unit/spec/locus-info/selfUtils.js +28 -2
- package/test/unit/spec/meeting/index.js +4 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +27 -0
|
@@ -245,6 +245,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
245
245
|
* @param {Object} captchaInfo
|
|
246
246
|
* @param {String} captchaInfo.code
|
|
247
247
|
* @param {String} captchaInfo.id
|
|
248
|
+
* @param {String} installedOrgID
|
|
248
249
|
* @returns {Promise} returns a meeting info object
|
|
249
250
|
* @public
|
|
250
251
|
* @memberof MeetingInfo
|
|
@@ -256,6 +257,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
256
257
|
var type,
|
|
257
258
|
password,
|
|
258
259
|
captchaInfo,
|
|
260
|
+
installedOrgID,
|
|
259
261
|
destinationType,
|
|
260
262
|
body,
|
|
261
263
|
options,
|
|
@@ -267,34 +269,36 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
267
269
|
type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
268
270
|
password = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
|
|
269
271
|
captchaInfo = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : null;
|
|
270
|
-
|
|
272
|
+
installedOrgID = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : null;
|
|
273
|
+
_context2.next = 6;
|
|
271
274
|
return _utilv.default.getDestinationType({
|
|
272
275
|
destination: destination,
|
|
273
276
|
type: type,
|
|
274
277
|
webex: this.webex
|
|
275
278
|
});
|
|
276
|
-
case
|
|
279
|
+
case 6:
|
|
277
280
|
destinationType = _context2.sent;
|
|
278
281
|
if (!(destinationType.type === _constants._CONVERSATION_URL_ && this.webex.config.meetings.experimental.enableAdhocMeetings && this.webex.meetings.preferredWebexSite)) {
|
|
279
|
-
_context2.next =
|
|
282
|
+
_context2.next = 9;
|
|
280
283
|
break;
|
|
281
284
|
}
|
|
282
285
|
return _context2.abrupt("return", this.createAdhocSpaceMeeting(destinationType.destination));
|
|
283
|
-
case
|
|
284
|
-
_context2.next =
|
|
286
|
+
case 9:
|
|
287
|
+
_context2.next = 11;
|
|
285
288
|
return _utilv.default.getRequestBody(_objectSpread(_objectSpread({}, destinationType), {}, {
|
|
286
289
|
password: password,
|
|
287
|
-
captchaInfo: captchaInfo
|
|
290
|
+
captchaInfo: captchaInfo,
|
|
291
|
+
installedOrgID: installedOrgID
|
|
288
292
|
}));
|
|
289
|
-
case
|
|
293
|
+
case 11:
|
|
290
294
|
body = _context2.sent;
|
|
291
295
|
options = {
|
|
292
296
|
method: _constants.HTTP_VERBS.POST,
|
|
293
297
|
body: body
|
|
294
298
|
};
|
|
295
|
-
_context2.next =
|
|
299
|
+
_context2.next = 15;
|
|
296
300
|
return _utilv.default.getDirectMeetingInfoURI(destinationType);
|
|
297
|
-
case
|
|
301
|
+
case 15:
|
|
298
302
|
directURI = _context2.sent;
|
|
299
303
|
if (directURI) {
|
|
300
304
|
options.uri = directURI;
|
|
@@ -333,7 +337,7 @@ var MeetingInfoV2 = /*#__PURE__*/function () {
|
|
|
333
337
|
});
|
|
334
338
|
throw err;
|
|
335
339
|
}));
|
|
336
|
-
case
|
|
340
|
+
case 18:
|
|
337
341
|
case "end":
|
|
338
342
|
return _context2.stop();
|
|
339
343
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PASSWORD_ERROR_DEFAULT_MESSAGE","CAPTCHA_ERROR_DEFAULT_MESSAGE","ADHOC_MEETING_DEFAULT_ERROR","CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","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","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","getDirectMeetingInfoURI","directURI","service","WBXAPPAPI_SERVICE","resource","response","FETCH_MEETING_INFO_V1_SUCCESS","statusCode","VERIFY_PASSWORD_ERROR","data","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL","FETCH_MEETING_INFO_V1_FAILURE"],"sources":["meeting-info-v2.ts"],"sourcesContent":["import {HTTP_VERBS, _CONVERSATION_URL_, WBXAPPAPI_SERVICE} from '../constants';\nimport Metrics from '../metrics';\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];\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 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 * @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 ) {\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({...destinationType, password, captchaInfo});\n\n const options: any = {\n method: HTTP_VERBS.POST,\n body,\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) {\n options.uri = directURI;\n } else {\n options.service = WBXAPPAPI_SERVICE;\n options.resource = 'meetingInfo';\n }\n\n return this.webex\n .request(options)\n .then((response) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);\n\n return response;\n })\n .catch((err) => {\n if (err?.statusCode === 403) {\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":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;;AAE9D;AACA;AACA;AAFA,IAGaC,0BAA0B;EAAA;EAAA;EAMrC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCACEC,kBAA2B,EAC3BC,WAAoB,EAEpB;IAAA;IAAA,IADAC,OAAe,uEAAGP,8BAA8B;IAAA;IAEhD,oCAASO,OAAO,oBAAUF,kBAAkB;IAAI;IAAA;IAAA;IAAA;IAChD,MAAKG,IAAI,GAAG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AC;gBACF,MAAMsD,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","MeetingInfoV2PasswordError","wbxAppApiErrorCode","meetingInfo","message","name","sdkMessage","stack","Error","wbxAppApiCode","MeetingInfoV2AdhocMeetingError","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","destinationType","_CONVERSATION_URL_","config","experimental","enableAdhocMeetings","createAdhocSpaceMeeting","getRequestBody","options","getDirectMeetingInfoURI","directURI","service","WBXAPPAPI_SERVICE","resource","response","FETCH_MEETING_INFO_V1_SUCCESS","statusCode","VERIFY_PASSWORD_ERROR","data","VERIFY_CAPTCHA_ERROR","captchaId","captchaID","verificationImageURL","verificationAudioURL","refreshURL","FETCH_MEETING_INFO_V1_FAILURE"],"sources":["meeting-info-v2.ts"],"sourcesContent":["import {HTTP_VERBS, _CONVERSATION_URL_, WBXAPPAPI_SERVICE} from '../constants';\nimport Metrics from '../metrics';\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];\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 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 * @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 ) {\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 });\n\n const options: any = {\n method: HTTP_VERBS.POST,\n body,\n };\n\n const directURI = await MeetingInfoUtil.getDirectMeetingInfoURI(destinationType);\n\n if (directURI) {\n options.uri = directURI;\n } else {\n options.service = WBXAPPAPI_SERVICE;\n options.resource = 'meetingInfo';\n }\n\n return this.webex\n .request(options)\n .then((response) => {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);\n\n return response;\n })\n .catch((err) => {\n if (err?.statusCode === 403) {\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":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;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;;AAE9D;AACA;AACA;AAFA,IAGaC,0BAA0B;EAAA;EAAA;EAMrC;AACF;AACA;AACA;AACA;AACA;AACA;EACE,oCACEC,kBAA2B,EAC3BC,WAAoB,EAEpB;IAAA;IAAA,IADAC,OAAe,uEAAGP,8BAA8B;IAAA;IAEhD,oCAASO,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,KA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
@@ -251,7 +251,8 @@ MeetingInfoUtil.getRequestBody = function (options) {
|
|
|
251
251
|
var type = options.type,
|
|
252
252
|
destination = options.destination,
|
|
253
253
|
password = options.password,
|
|
254
|
-
captchaInfo = options.captchaInfo
|
|
254
|
+
captchaInfo = options.captchaInfo,
|
|
255
|
+
installedOrgID = options.installedOrgID;
|
|
255
256
|
var body = {
|
|
256
257
|
supportHostKey: true,
|
|
257
258
|
supportCountryList: true
|
|
@@ -295,6 +296,9 @@ MeetingInfoUtil.getRequestBody = function (options) {
|
|
|
295
296
|
body.captchaID = captchaInfo.id;
|
|
296
297
|
body.captchaVerifyCode = captchaInfo.code;
|
|
297
298
|
}
|
|
299
|
+
if (installedOrgID) {
|
|
300
|
+
body.installedOrgID = installedOrgID;
|
|
301
|
+
}
|
|
298
302
|
return body;
|
|
299
303
|
};
|
|
300
304
|
|
|
@@ -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","body","supportHostKey","supportCountryList","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} 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} = options;\n const body: any = {\n supportHostKey: true,\n supportCountryList: true,\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 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;AAoBA;AACA;AAEA,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,QAAQ,CAACH,QAAQ,YAAKK,iBAAM,E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OL","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","body","supportHostKey","supportCountryList","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} 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} = options;\n const body: any = {\n supportHostKey: true,\n supportCountryList: true,\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 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;AAoBA;AACA;AAEA,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,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AAK,CAAC,2BAA2B,CAAC,+CAAvC,WAA0C,CAAC,CAAC;EAEzD,OAAOF,eAAe,CAACxF,QAAQ,CAACyF,IAAI,CAAC,GAAG,IAAI,GAAGA,IAAI;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACAzG,eAAe,CAAC2G,uBAAuB,GAAG,UAACvC,OAAyC,EAAK;EAAA;EACvF,IAAOvB,IAAI,GAAiBuB,OAAO,CAA5BvB,IAAI;IAAEF,WAAW,GAAIyB,OAAO,CAAtBzB,WAAW;EAExB,IAAIiE,kBAAkB,GAAG,IAAI;EAE7B,QAAQ/D,IAAI;IACV,KAAK8B,oBAAS;MACZiC,kBAAkB,GAAG5G,eAAe,CAACsG,YAAY,CAAC3D,WAAW,CAAC;MAC9D;IACF,KAAKkD,qBAAU;MACbe,kBAAkB,yBAAGjE,WAAW,CAACmD,IAAI,uDAAhB,mBAAkBe,SAAS;MAChD;IACF;EAAQ;EAGV,OAAOD,kBAAkB,qBAAcA,kBAAkB,iCAA8B,IAAI;AAC7F,CAAC;AAAC,eAEa5G,eAAe;AAAA"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export default class MeetingInfoV2 {
|
|
|
82
82
|
* @param {Object} captchaInfo
|
|
83
83
|
* @param {String} captchaInfo.code
|
|
84
84
|
* @param {String} captchaInfo.id
|
|
85
|
+
* @param {String} installedOrgID
|
|
85
86
|
* @returns {Promise} returns a meeting info object
|
|
86
87
|
* @public
|
|
87
88
|
* @memberof MeetingInfo
|
|
@@ -89,5 +90,5 @@ export default class MeetingInfoV2 {
|
|
|
89
90
|
fetchMeetingInfo(destination: string, type?: string, password?: string, captchaInfo?: {
|
|
90
91
|
code: string;
|
|
91
92
|
id: string;
|
|
92
|
-
}): Promise<any>;
|
|
93
|
+
}, installedOrgID?: any): Promise<any>;
|
|
93
94
|
}
|
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.72",
|
|
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.72",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.72",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.72",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.72",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.72",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.72",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,18 +46,18 @@
|
|
|
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.72",
|
|
50
50
|
"@webex/internal-media-core": "1.35.7",
|
|
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/plugin-people": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
60
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.72",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.72",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.72",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.72",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.72",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.72",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.72",
|
|
58
|
+
"@webex/plugin-people": "3.0.0-beta.72",
|
|
59
|
+
"@webex/plugin-rooms": "3.0.0-beta.72",
|
|
60
|
+
"@webex/webex-core": "3.0.0-beta.72",
|
|
61
61
|
"ampersand-collection": "^2.0.2",
|
|
62
62
|
"bowser": "^2.11.0",
|
|
63
63
|
"btoa": "^1.2.1",
|
package/src/config.ts
CHANGED
package/src/locus-info/index.ts
CHANGED
|
@@ -59,6 +59,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
59
59
|
fullState: any;
|
|
60
60
|
host: any;
|
|
61
61
|
info: any;
|
|
62
|
+
roles: any;
|
|
62
63
|
mediaShares: any;
|
|
63
64
|
replace: any;
|
|
64
65
|
url: any;
|
|
@@ -949,8 +950,11 @@ export default class LocusInfo extends EventsScope {
|
|
|
949
950
|
* @memberof LocusInfo
|
|
950
951
|
*/
|
|
951
952
|
updateMeetingInfo(info: object, self?: object) {
|
|
952
|
-
|
|
953
|
-
|
|
953
|
+
const roles = self ? SelfUtils.getRoles(self) : this.parsedLocus.self?.roles || [];
|
|
954
|
+
if (
|
|
955
|
+
(info && !isEqual(this.info, info)) ||
|
|
956
|
+
(roles.length && !isEqual(this.roles, roles) && info)
|
|
957
|
+
) {
|
|
954
958
|
const isJoined = SelfUtils.isJoined(self || this.parsedLocus.self);
|
|
955
959
|
const parsedInfo = InfoUtils.getInfos(this.parsedLocus.info, info, roles, isJoined);
|
|
956
960
|
|
|
@@ -989,6 +993,7 @@ export default class LocusInfo extends EventsScope {
|
|
|
989
993
|
// Parses the info and adds necessary values
|
|
990
994
|
this.updateMeeting(parsedInfo.current);
|
|
991
995
|
}
|
|
996
|
+
this.roles = roles;
|
|
992
997
|
}
|
|
993
998
|
|
|
994
999
|
/**
|
|
@@ -63,14 +63,16 @@ SelfUtils.parse = (self: any, deviceId: string) => {
|
|
|
63
63
|
layout: SelfUtils.getLayout(self),
|
|
64
64
|
canNotViewTheParticipantList: SelfUtils.canNotViewTheParticipantList(self),
|
|
65
65
|
isSharingBlocked: SelfUtils.isSharingBlocked(self),
|
|
66
|
-
breakoutSessions: SelfUtils.
|
|
66
|
+
breakoutSessions: SelfUtils.getBreakoutSessions(self),
|
|
67
|
+
breakout: SelfUtils.getBreakout(self),
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
return null;
|
|
71
72
|
};
|
|
72
73
|
|
|
73
|
-
SelfUtils.
|
|
74
|
+
SelfUtils.getBreakoutSessions = (self) => self?.controls?.breakout?.sessions;
|
|
75
|
+
SelfUtils.getBreakout = (self) => self?.controls?.breakout;
|
|
74
76
|
|
|
75
77
|
SelfUtils.getLayout = (self) =>
|
|
76
78
|
Array.isArray(self?.controls?.layouts) ? self.controls.layouts[0].type : undefined;
|
|
@@ -143,13 +145,13 @@ SelfUtils.isJoined = (self: any) => self?.state === _JOINED_;
|
|
|
143
145
|
*
|
|
144
146
|
* @param {Self} previous - Previous self state
|
|
145
147
|
* @param {Self} current - Current self state [per event]
|
|
146
|
-
* @returns {boolean} - If the
|
|
148
|
+
* @returns {boolean} - If the Meeting Layout Controls Layout has changed.
|
|
147
149
|
*/
|
|
148
150
|
SelfUtils.layoutChanged = (previous: any, current: any) =>
|
|
149
151
|
current?.layout && previous?.layout !== current?.layout;
|
|
150
152
|
|
|
151
153
|
SelfUtils.breakoutsChanged = (previous, current) =>
|
|
152
|
-
!isEqual(previous?.breakoutSessions, current?.breakoutSessions);
|
|
154
|
+
!isEqual(previous?.breakoutSessions, current?.breakoutSessions) && !!current?.breakout;
|
|
153
155
|
|
|
154
156
|
SelfUtils.isMediaInactive = (previous, current) => {
|
|
155
157
|
if (
|
package/src/meeting/index.ts
CHANGED
|
@@ -1174,7 +1174,9 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1174
1174
|
this.destination,
|
|
1175
1175
|
this.destinationType,
|
|
1176
1176
|
password,
|
|
1177
|
-
captchaInfo
|
|
1177
|
+
captchaInfo,
|
|
1178
|
+
// @ts-ignore - config coming from registerPlugin
|
|
1179
|
+
this.config.installedOrgID
|
|
1178
1180
|
);
|
|
1179
1181
|
|
|
1180
1182
|
this.parseMeetingInfo(info, this.destination);
|
|
@@ -190,6 +190,7 @@ export default class MeetingInfoV2 {
|
|
|
190
190
|
* @param {Object} captchaInfo
|
|
191
191
|
* @param {String} captchaInfo.code
|
|
192
192
|
* @param {String} captchaInfo.id
|
|
193
|
+
* @param {String} installedOrgID
|
|
193
194
|
* @returns {Promise} returns a meeting info object
|
|
194
195
|
* @public
|
|
195
196
|
* @memberof MeetingInfo
|
|
@@ -201,7 +202,8 @@ export default class MeetingInfoV2 {
|
|
|
201
202
|
captchaInfo: {
|
|
202
203
|
code: string;
|
|
203
204
|
id: string;
|
|
204
|
-
} = null
|
|
205
|
+
} = null,
|
|
206
|
+
installedOrgID = null
|
|
205
207
|
) {
|
|
206
208
|
const destinationType = await MeetingInfoUtil.getDestinationType({
|
|
207
209
|
destination,
|
|
@@ -217,7 +219,12 @@ export default class MeetingInfoV2 {
|
|
|
217
219
|
return this.createAdhocSpaceMeeting(destinationType.destination);
|
|
218
220
|
}
|
|
219
221
|
|
|
220
|
-
const body = await MeetingInfoUtil.getRequestBody({
|
|
222
|
+
const body = await MeetingInfoUtil.getRequestBody({
|
|
223
|
+
...destinationType,
|
|
224
|
+
password,
|
|
225
|
+
captchaInfo,
|
|
226
|
+
installedOrgID,
|
|
227
|
+
});
|
|
221
228
|
|
|
222
229
|
const options: any = {
|
|
223
230
|
method: HTTP_VERBS.POST,
|
|
@@ -224,7 +224,7 @@ MeetingInfoUtil.getDestinationType = async (from) => {
|
|
|
224
224
|
* @returns {Object} returns an object with {resource, method}
|
|
225
225
|
*/
|
|
226
226
|
MeetingInfoUtil.getRequestBody = (options: {type: string; destination: object} | any) => {
|
|
227
|
-
const {type, destination, password, captchaInfo} = options;
|
|
227
|
+
const {type, destination, password, captchaInfo, installedOrgID} = options;
|
|
228
228
|
const body: any = {
|
|
229
229
|
supportHostKey: true,
|
|
230
230
|
supportCountryList: true,
|
|
@@ -271,6 +271,10 @@ MeetingInfoUtil.getRequestBody = (options: {type: string; destination: object} |
|
|
|
271
271
|
body.captchaVerifyCode = captchaInfo.code;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
if (installedOrgID) {
|
|
275
|
+
body.installedOrgID = installedOrgID;
|
|
276
|
+
}
|
|
277
|
+
|
|
274
278
|
return body;
|
|
275
279
|
};
|
|
276
280
|
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
DISPLAY_HINTS,
|
|
19
19
|
} from '../../../../src/constants';
|
|
20
20
|
|
|
21
|
-
import {self, selfWithInactivity} from
|
|
21
|
+
import { self, selfWithInactivity } from "./selfConstant";
|
|
22
22
|
|
|
23
23
|
describe('plugin-meetings', () => {
|
|
24
24
|
describe('LocusInfo index', () => {
|
|
@@ -1190,7 +1190,7 @@ describe('plugin-meetings', () => {
|
|
|
1190
1190
|
function: 'updateMeetingInfo',
|
|
1191
1191
|
},
|
|
1192
1192
|
LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
|
|
1193
|
-
|
|
1193
|
+
{info: locusInfo.parsedLocus.info, self},
|
|
1194
1194
|
];
|
|
1195
1195
|
|
|
1196
1196
|
if (expected) {
|
|
@@ -1201,6 +1201,25 @@ describe('plugin-meetings', () => {
|
|
|
1201
1201
|
locusInfo.emitScoped.resetHistory();
|
|
1202
1202
|
};
|
|
1203
1203
|
|
|
1204
|
+
const checkMeetingInfoUpdatedCalledForRoles = (expected) => {
|
|
1205
|
+
const expectedArgs = [
|
|
1206
|
+
locusInfo.emitScoped,
|
|
1207
|
+
{
|
|
1208
|
+
file: 'locus-info',
|
|
1209
|
+
function: 'updateMeetingInfo',
|
|
1210
|
+
},
|
|
1211
|
+
LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
|
|
1212
|
+
];
|
|
1213
|
+
|
|
1214
|
+
if (expected) {
|
|
1215
|
+
assert.calledWith(...expectedArgs);
|
|
1216
|
+
} else {
|
|
1217
|
+
assert.neverCalledWith(...expectedArgs);
|
|
1218
|
+
}
|
|
1219
|
+
locusInfo.emitScoped.resetHistory();
|
|
1220
|
+
};
|
|
1221
|
+
|
|
1222
|
+
|
|
1204
1223
|
it('emits MEETING_INFO_UPDATED if the info changes', () => {
|
|
1205
1224
|
const initialInfo = cloneDeep(meetingInfo);
|
|
1206
1225
|
|
|
@@ -1226,6 +1245,16 @@ describe('plugin-meetings', () => {
|
|
|
1226
1245
|
|
|
1227
1246
|
// since the info is the same it should not call trigger the event
|
|
1228
1247
|
checkMeetingInfoUpdatedCalled(false);
|
|
1248
|
+
|
|
1249
|
+
// update it with the same info, but roles changed
|
|
1250
|
+
const updateSelf = cloneDeep(self);
|
|
1251
|
+
updateSelf?.controls?.role?.roles.push({
|
|
1252
|
+
type: 'COHOST',
|
|
1253
|
+
hasRole: true,
|
|
1254
|
+
});
|
|
1255
|
+
locusInfo.updateMeetingInfo(newInfo, updateSelf);
|
|
1256
|
+
// since the info is the same but roles changed, it should call trigger the event
|
|
1257
|
+
checkMeetingInfoUpdatedCalledForRoles(true);
|
|
1229
1258
|
});
|
|
1230
1259
|
|
|
1231
1260
|
it('gets roles from self if available', () => {
|
|
@@ -76,10 +76,10 @@ describe('plugin-meetings', () => {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
describe('
|
|
79
|
+
describe('getBreakoutSessions', () => {
|
|
80
80
|
it('should return breakout sessions', () => {
|
|
81
81
|
assert.deepEqual(
|
|
82
|
-
SelfUtils.
|
|
82
|
+
SelfUtils.getBreakoutSessions({controls: {breakout: {sessions: 'SESSIONS'}}}),
|
|
83
83
|
'SESSIONS'
|
|
84
84
|
);
|
|
85
85
|
});
|
|
@@ -98,6 +98,7 @@ describe('plugin-meetings', () => {
|
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
100
|
},
|
|
101
|
+
breakout: {},
|
|
101
102
|
};
|
|
102
103
|
const previous = {
|
|
103
104
|
breakoutSessions: {
|
|
@@ -110,6 +111,7 @@ describe('plugin-meetings', () => {
|
|
|
110
111
|
},
|
|
111
112
|
],
|
|
112
113
|
},
|
|
114
|
+
breakout: {},
|
|
113
115
|
};
|
|
114
116
|
|
|
115
117
|
assert.isTrue(SelfUtils.breakoutsChanged(previous, current));
|
|
@@ -127,6 +129,7 @@ describe('plugin-meetings', () => {
|
|
|
127
129
|
},
|
|
128
130
|
],
|
|
129
131
|
},
|
|
132
|
+
breakout: {},
|
|
130
133
|
};
|
|
131
134
|
const previous = {
|
|
132
135
|
breakoutSessions: {
|
|
@@ -139,6 +142,29 @@ describe('plugin-meetings', () => {
|
|
|
139
142
|
},
|
|
140
143
|
],
|
|
141
144
|
},
|
|
145
|
+
breakout: {},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
assert.isFalse(SelfUtils.breakoutsChanged(previous, current));
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('should return false if no breakouts in current', () => {
|
|
152
|
+
const current = {
|
|
153
|
+
breakoutSessions: {
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
const previous = {
|
|
157
|
+
breakoutSessions: {
|
|
158
|
+
active: [
|
|
159
|
+
{
|
|
160
|
+
name: 'Breakout session 2',
|
|
161
|
+
groupId: '0e73abb8-5584-49d8-be8d-806d2a8247ca',
|
|
162
|
+
sessionId: '1cf41ab1-2e57-4d95-b7e9-5613acddfb0f',
|
|
163
|
+
sessionType: 'BREAKOUT',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
breakout: {},
|
|
142
168
|
};
|
|
143
169
|
|
|
144
170
|
assert.isFalse(SelfUtils.breakoutsChanged(previous, current));
|