@webex/plugin-meetings 3.0.0-beta.171 → 3.0.0-beta.172
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/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/member/index.js +15 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +11 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +15 -0
- package/dist/member/util.js.map +1 -1
- package/dist/types/member/index.d.ts +2 -1
- package/dist/types/member/types.d.ts +11 -0
- package/package.json +19 -19
- package/src/member/index.ts +17 -1
- package/src/member/types.ts +14 -0
- package/src/member/util.ts +23 -1
- package/test/unit/spec/member/index.js +36 -13
- package/test/unit/spec/member/util.js +31 -0
package/dist/breakouts/index.js
CHANGED
|
@@ -1041,7 +1041,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1041
1041
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1042
1042
|
}
|
|
1043
1043
|
},
|
|
1044
|
-
version: "3.0.0-beta.
|
|
1044
|
+
version: "3.0.0-beta.172"
|
|
1045
1045
|
});
|
|
1046
1046
|
var _default = Breakouts;
|
|
1047
1047
|
exports.default = _default;
|
package/dist/member/index.js
CHANGED
|
@@ -51,6 +51,7 @@ var Member = /*#__PURE__*/function () {
|
|
|
51
51
|
(0, _defineProperty2.default)(this, "isUser", void 0);
|
|
52
52
|
(0, _defineProperty2.default)(this, "isVideoMuted", void 0);
|
|
53
53
|
(0, _defineProperty2.default)(this, "roles", void 0);
|
|
54
|
+
(0, _defineProperty2.default)(this, "mediaStatus", void 0);
|
|
54
55
|
(0, _defineProperty2.default)(this, "name", void 0);
|
|
55
56
|
(0, _defineProperty2.default)(this, "participant", void 0);
|
|
56
57
|
(0, _defineProperty2.default)(this, "status", void 0);
|
|
@@ -246,6 +247,19 @@ var Member = /*#__PURE__*/function () {
|
|
|
246
247
|
* @memberof Member
|
|
247
248
|
*/
|
|
248
249
|
this.roles = null;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @instance
|
|
253
|
+
* @type {IMediaStatus}
|
|
254
|
+
* @public
|
|
255
|
+
* @memberof Member
|
|
256
|
+
* @example {audio: MediaStatus.RECVONLY, video: MediaStatus.SENDRECV}
|
|
257
|
+
*/
|
|
258
|
+
this.mediaStatus = {
|
|
259
|
+
audio: null,
|
|
260
|
+
video: null
|
|
261
|
+
};
|
|
262
|
+
|
|
249
263
|
// TODO: more participant types
|
|
250
264
|
// such as native client, web client, is a device, what type of phone, etc
|
|
251
265
|
this.processParticipant(participant);
|
|
@@ -318,6 +332,7 @@ var Member = /*#__PURE__*/function () {
|
|
|
318
332
|
this.isRemovable = _util.default.isRemovable(this.isSelf, this.isGuest, this.isInMeeting, this.type);
|
|
319
333
|
// must occur after self, device, meeting, mute status, and type properties are calculated
|
|
320
334
|
this.isMutable = _util.default.isMutable(this.isSelf, this.isDevice, this.isInMeeting, this.isAudioMuted, this.type);
|
|
335
|
+
this.mediaStatus = _util.default.extractMediaStatus(this.participant);
|
|
321
336
|
}
|
|
322
337
|
|
|
323
338
|
/**
|
package/dist/member/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Member","participant","options","MEETINGS","id","name","isAudioMuted","isVideoMuted","isHandRaised","supportsBreakouts","supportLiveAnnotation","isSelf","isHost","isGuest","isInLobby","isInMeeting","isNotAdmitted","isContentSharing","status","isDevice","isUser","associatedUser","isRecording","isMutable","isRemovable","type","isModerator","isModeratorAssignmentProhibited","roles","processParticipant","processParticipantOptions","processMember","MemberUtil","extractId","extractName","isBreakoutsSupported","supportsInterpretation","isInterpretationSupported","isLiveAnnotationSupported","processStatus","processRoles","processIsSelf","selfId","processIsHost","hostId","processIsContentSharing","contentSharingId","processType","processIsRecording","recordingId","extractStatus","_IN_LOBBY_","_IN_MEETING_","_NOT_IN_MEETING_","flag","sharingId","isSame","isAssociatedSame","extractControlRoles"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {MEETINGS, _IN_LOBBY_, _NOT_IN_MEETING_, _IN_MEETING_} from '../constants';\nimport {IExternalRoles, ParticipantWithRoles} from './types';\n\nimport MemberUtil from './util';\n\n/**\n * @class Member\n */\nexport default class Member {\n associatedUser: any;\n id: any;\n isAudioMuted: any;\n isContentSharing: any;\n isDevice: any;\n isGuest: any;\n isHandRaised: any;\n isHost: any;\n isInLobby: any;\n isInMeeting: any;\n isModerator: any;\n isModeratorAssignmentProhibited: any;\n isMutable: any;\n isNotAdmitted: any;\n isRecording: any;\n isRemovable: any;\n isSelf: any;\n isUser: any;\n isVideoMuted: any;\n roles: IExternalRoles;\n name: any;\n participant: any;\n status: any;\n supportsBreakouts: boolean;\n supportsInterpretation: boolean;\n supportLiveAnnotation: boolean;\n type: any;\n namespace = MEETINGS;\n\n /**\n * @param {Object} participant - the locus participant\n * @param {Object} [options] - constructor params\n * @param {String} options.selfId\n * @param {String} options.hostId\n * @param {String} options.contentSharingId\n * @param {String} options.type\n * @returns {Member}\n * @memberof Member\n */\n constructor(\n participant: object,\n options:\n | {\n selfId: string;\n hostId: string;\n contentSharingId: string;\n type: string;\n }\n | any = {}\n ) {\n /**\n * The server participant object\n * @instance\n * @type {Object}\n * @private\n * @memberof Member\n */\n this.participant = null;\n /**\n * The member id\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.id = null;\n /**\n * The member name\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.name = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isAudioMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isVideoMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHandRaised = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportsBreakouts = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportLiveAnnotation = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isSelf = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHost = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isGuest = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInLobby = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInMeeting = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isNotAdmitted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isContentSharing = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.status = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isDevice = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isUser = null;\n /**\n * Is this member associated to another user by way of pairing (typical of devices)\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.associatedUser = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRecording = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isMutable = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRemovable = null;\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof Member\n */\n this.type = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModerator = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModeratorAssignmentProhibited = null;\n\n /**\n * @instance\n * @type {IExternalRoles}\n * @public\n * @memberof Member\n */\n this.roles = null;\n // TODO: more participant types\n // such as native client, web client, is a device, what type of phone, etc\n this.processParticipant(participant);\n this.processParticipantOptions(participant, options);\n this.processMember();\n }\n\n /**\n * set all the participant values extracted directly from locus participant\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipant(participant: object) {\n this.participant = participant;\n if (participant) {\n this.id = MemberUtil.extractId(participant);\n this.name = MemberUtil.extractName(participant);\n this.isAudioMuted = MemberUtil.isAudioMuted(participant);\n this.isVideoMuted = MemberUtil.isVideoMuted(participant);\n this.isHandRaised = MemberUtil.isHandRaised(participant);\n this.supportsBreakouts = MemberUtil.isBreakoutsSupported(participant);\n this.supportsInterpretation = MemberUtil.isInterpretationSupported(participant);\n this.supportLiveAnnotation = MemberUtil.isLiveAnnotationSupported(participant);\n this.isGuest = MemberUtil.isGuest(participant);\n this.isUser = MemberUtil.isUser(participant);\n this.isDevice = MemberUtil.isDevice(participant);\n this.isModerator = MemberUtil.isModerator(participant);\n this.isModeratorAssignmentProhibited =\n MemberUtil.isModeratorAssignmentProhibited(participant);\n this.processStatus(participant);\n this.processRoles(participant as ParticipantWithRoles);\n // must be done last\n this.isNotAdmitted = MemberUtil.isNotAdmitted(participant, this.isGuest, this.status);\n }\n }\n\n /**\n * Use the members options and participant values to set on the member\n * @param {Object} participant the locus participant object\n * @param {Object} options the passed in options, what was set on members\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipantOptions(participant: object, options: any) {\n if (participant && options) {\n this.processIsSelf(participant, options.selfId);\n this.processIsHost(participant, options.hostId);\n this.processIsContentSharing(participant, options.contentSharingId);\n this.processType(options.type);\n this.processIsRecording(participant, options.recordingId);\n }\n }\n\n /**\n * processes what already exists on the member to determine other info about the member\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processMember() {\n // must occur after self, guest, meeting, and type properties are calculated\n this.isRemovable = MemberUtil.isRemovable(\n this.isSelf,\n this.isGuest,\n this.isInMeeting,\n this.type\n );\n // must occur after self, device, meeting, mute status, and type properties are calculated\n this.isMutable = MemberUtil.isMutable(\n this.isSelf,\n this.isDevice,\n this.isInMeeting,\n this.isAudioMuted,\n this.type\n );\n }\n\n /**\n * set the status on member object\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processStatus(participant: object) {\n this.status = MemberUtil.extractStatus(participant);\n switch (this.status) {\n case _IN_LOBBY_:\n this.isInLobby = true;\n this.isInMeeting = false;\n break;\n case _IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = true;\n break;\n case _NOT_IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = false;\n break;\n default:\n this.isInLobby = false;\n this.isInMeeting = false;\n }\n }\n\n /**\n * set the isContentSharing on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsContentSharing(flag: boolean) {\n this.isContentSharing = flag;\n }\n\n /**\n * set the isHost on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsHost(flag: boolean) {\n this.isHost = flag;\n }\n\n /**\n * set the isSelf on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsSelf(flag: boolean) {\n this.isSelf = flag;\n }\n\n /**\n * determine if this member is content sharing\n * @param {Object} participant\n * @param {String} sharingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsContentSharing(participant: object, sharingId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isContentSharing = MemberUtil.isSame(participant, sharingId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isContentSharing = MemberUtil.isAssociatedSame(participant, sharingId);\n }\n }\n\n /**\n * Determine if this member is recording\n * @param {Object} participant\n * @param {String} recordingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsRecording(participant: object, recordingId: string) {\n this.isRecording = MemberUtil.isSame(participant, recordingId);\n }\n\n /**\n * determine if this member is the self\n * @param {Object} participant\n * @param {String} selfId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsSelf(participant: object, selfId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isSelf = MemberUtil.isSame(participant, selfId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isSelf = MemberUtil.isAssociatedSame(participant, selfId);\n this.associatedUser = selfId;\n }\n }\n\n /**\n * determine if this member is the host\n * @param {Object} participant\n * @param {String} hostId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsHost(participant: object, hostId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isHost = MemberUtil.isSame(participant, hostId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isHost = MemberUtil.isAssociatedSame(participant, hostId);\n }\n }\n\n /**\n * process the roles that have been applied to this member\n * @param {Object} participant\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processRoles(participant: ParticipantWithRoles) {\n this.roles = MemberUtil.extractControlRoles(participant);\n }\n\n /**\n * set the type for the member, could be MEETING or CALL\n * @param {String} type\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processType(type: string) {\n this.type = type;\n }\n}\n"],"mappings":";;;;;;;;;;;AAGA;AAGA;AANA;AACA;AACA;AAMA;AACA;AACA;AAFA,IAGqBA,MAAM;EA8BzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,gBACEC,WAAmB,EASnB;IAAA,IARAC,OAOO,uEAAG,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,iDArBFC,mBAAQ;IAuBlB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACF,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACG,EAAE,GAAG,IAAI;IACd;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,iBAAiB,GAAG,IAAI;IAC7B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,qBAAqB,GAAG,IAAI;IACjC;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,OAAO,GAAG,IAAI;IACnB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAG,IAAI;IACrB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,aAAa,GAAG,IAAI;IACzB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,gBAAgB,GAAG,IAAI;IAC5B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,cAAc,GAAG,IAAI;IAC1B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,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ACnB,WAAW,CAAC,EAAE;QAClC,IAAI,CAACW,MAAM,GAAGoB,aAAU,CAACwB,MAAM,CAACvD,WAAW,EAAE2C,MAAM,CAAC;MACtD,CAAC,MAAM,IAAIZ,aAAU,CAACb,QAAQ,CAAClB,WAAW,CAAC,EAAE;QAC3C,IAAI,CAACW,MAAM,GAAGoB,aAAU,CAACyB,gBAAgB,CAACxD,WAAW,EAAE2C,MAAM,CAAC;MAChE;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,sBAAqB3C,WAAiC,EAAE;MACtD,IAAI,CAAC2B,KAAK,GAAGI,aAAU,CAAC0B,mBAAmB,CAACzD,WAAW,CAAC;IAC1D;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,qBAAoBwB,IAAY,EAAE;MAChC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAClB;EAAC;EAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["Member","participant","options","MEETINGS","id","name","isAudioMuted","isVideoMuted","isHandRaised","supportsBreakouts","supportLiveAnnotation","isSelf","isHost","isGuest","isInLobby","isInMeeting","isNotAdmitted","isContentSharing","status","isDevice","isUser","associatedUser","isRecording","isMutable","isRemovable","type","isModerator","isModeratorAssignmentProhibited","roles","mediaStatus","audio","video","processParticipant","processParticipantOptions","processMember","MemberUtil","extractId","extractName","isBreakoutsSupported","supportsInterpretation","isInterpretationSupported","isLiveAnnotationSupported","processStatus","processRoles","processIsSelf","selfId","processIsHost","hostId","processIsContentSharing","contentSharingId","processType","processIsRecording","recordingId","extractMediaStatus","extractStatus","_IN_LOBBY_","_IN_MEETING_","_NOT_IN_MEETING_","flag","sharingId","isSame","isAssociatedSame","extractControlRoles"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {MEETINGS, _IN_LOBBY_, _NOT_IN_MEETING_, _IN_MEETING_} from '../constants';\nimport {IExternalRoles, IMediaStatus, ParticipantWithRoles} from './types';\n\nimport MemberUtil from './util';\n\n/**\n * @class Member\n */\nexport default class Member {\n associatedUser: any;\n id: any;\n isAudioMuted: any;\n isContentSharing: any;\n isDevice: any;\n isGuest: any;\n isHandRaised: any;\n isHost: any;\n isInLobby: any;\n isInMeeting: any;\n isModerator: any;\n isModeratorAssignmentProhibited: any;\n isMutable: any;\n isNotAdmitted: any;\n isRecording: any;\n isRemovable: any;\n isSelf: any;\n isUser: any;\n isVideoMuted: any;\n roles: IExternalRoles;\n mediaStatus: IMediaStatus;\n name: any;\n participant: any;\n status: any;\n supportsBreakouts: boolean;\n supportsInterpretation: boolean;\n supportLiveAnnotation: boolean;\n type: any;\n namespace = MEETINGS;\n\n /**\n * @param {Object} participant - the locus participant\n * @param {Object} [options] - constructor params\n * @param {String} options.selfId\n * @param {String} options.hostId\n * @param {String} options.contentSharingId\n * @param {String} options.type\n * @returns {Member}\n * @memberof Member\n */\n constructor(\n participant: object,\n options:\n | {\n selfId: string;\n hostId: string;\n contentSharingId: string;\n type: string;\n }\n | any = {}\n ) {\n /**\n * The server participant object\n * @instance\n * @type {Object}\n * @private\n * @memberof Member\n */\n this.participant = null;\n /**\n * The member id\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.id = null;\n /**\n * The member name\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.name = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isAudioMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isVideoMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHandRaised = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportsBreakouts = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.supportLiveAnnotation = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isSelf = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHost = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isGuest = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInLobby = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInMeeting = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isNotAdmitted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isContentSharing = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.status = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isDevice = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isUser = null;\n /**\n * Is this member associated to another user by way of pairing (typical of devices)\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.associatedUser = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRecording = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isMutable = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRemovable = null;\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof Member\n */\n this.type = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModerator = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModeratorAssignmentProhibited = null;\n\n /**\n * @instance\n * @type {IExternalRoles}\n * @public\n * @memberof Member\n */\n this.roles = null;\n\n /**\n * @instance\n * @type {IMediaStatus}\n * @public\n * @memberof Member\n * @example {audio: MediaStatus.RECVONLY, video: MediaStatus.SENDRECV}\n */\n this.mediaStatus = {\n audio: null,\n video: null,\n };\n\n // TODO: more participant types\n // such as native client, web client, is a device, what type of phone, etc\n this.processParticipant(participant);\n this.processParticipantOptions(participant, options);\n this.processMember();\n }\n\n /**\n * set all the participant values extracted directly from locus participant\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipant(participant: object) {\n this.participant = participant;\n if (participant) {\n this.id = MemberUtil.extractId(participant);\n this.name = MemberUtil.extractName(participant);\n this.isAudioMuted = MemberUtil.isAudioMuted(participant);\n this.isVideoMuted = MemberUtil.isVideoMuted(participant);\n this.isHandRaised = MemberUtil.isHandRaised(participant);\n this.supportsBreakouts = MemberUtil.isBreakoutsSupported(participant);\n this.supportsInterpretation = MemberUtil.isInterpretationSupported(participant);\n this.supportLiveAnnotation = MemberUtil.isLiveAnnotationSupported(participant);\n this.isGuest = MemberUtil.isGuest(participant);\n this.isUser = MemberUtil.isUser(participant);\n this.isDevice = MemberUtil.isDevice(participant);\n this.isModerator = MemberUtil.isModerator(participant);\n this.isModeratorAssignmentProhibited =\n MemberUtil.isModeratorAssignmentProhibited(participant);\n this.processStatus(participant);\n this.processRoles(participant as ParticipantWithRoles);\n // must be done last\n this.isNotAdmitted = MemberUtil.isNotAdmitted(participant, this.isGuest, this.status);\n }\n }\n\n /**\n * Use the members options and participant values to set on the member\n * @param {Object} participant the locus participant object\n * @param {Object} options the passed in options, what was set on members\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processParticipantOptions(participant: object, options: any) {\n if (participant && options) {\n this.processIsSelf(participant, options.selfId);\n this.processIsHost(participant, options.hostId);\n this.processIsContentSharing(participant, options.contentSharingId);\n this.processType(options.type);\n this.processIsRecording(participant, options.recordingId);\n }\n }\n\n /**\n * processes what already exists on the member to determine other info about the member\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processMember() {\n // must occur after self, guest, meeting, and type properties are calculated\n this.isRemovable = MemberUtil.isRemovable(\n this.isSelf,\n this.isGuest,\n this.isInMeeting,\n this.type\n );\n // must occur after self, device, meeting, mute status, and type properties are calculated\n this.isMutable = MemberUtil.isMutable(\n this.isSelf,\n this.isDevice,\n this.isInMeeting,\n this.isAudioMuted,\n this.type\n );\n\n this.mediaStatus = MemberUtil.extractMediaStatus(this.participant);\n }\n\n /**\n * set the status on member object\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processStatus(participant: object) {\n this.status = MemberUtil.extractStatus(participant);\n switch (this.status) {\n case _IN_LOBBY_:\n this.isInLobby = true;\n this.isInMeeting = false;\n break;\n case _IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = true;\n break;\n case _NOT_IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = false;\n break;\n default:\n this.isInLobby = false;\n this.isInMeeting = false;\n }\n }\n\n /**\n * set the isContentSharing on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsContentSharing(flag: boolean) {\n this.isContentSharing = flag;\n }\n\n /**\n * set the isHost on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsHost(flag: boolean) {\n this.isHost = flag;\n }\n\n /**\n * set the isSelf on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public setIsSelf(flag: boolean) {\n this.isSelf = flag;\n }\n\n /**\n * determine if this member is content sharing\n * @param {Object} participant\n * @param {String} sharingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsContentSharing(participant: object, sharingId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isContentSharing = MemberUtil.isSame(participant, sharingId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isContentSharing = MemberUtil.isAssociatedSame(participant, sharingId);\n }\n }\n\n /**\n * Determine if this member is recording\n * @param {Object} participant\n * @param {String} recordingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n public processIsRecording(participant: object, recordingId: string) {\n this.isRecording = MemberUtil.isSame(participant, recordingId);\n }\n\n /**\n * determine if this member is the self\n * @param {Object} participant\n * @param {String} selfId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsSelf(participant: object, selfId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isSelf = MemberUtil.isSame(participant, selfId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isSelf = MemberUtil.isAssociatedSame(participant, selfId);\n this.associatedUser = selfId;\n }\n }\n\n /**\n * determine if this member is the host\n * @param {Object} participant\n * @param {String} hostId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processIsHost(participant: object, hostId: string) {\n if (MemberUtil.isUser(participant)) {\n this.isHost = MemberUtil.isSame(participant, hostId);\n } else if (MemberUtil.isDevice(participant)) {\n this.isHost = MemberUtil.isAssociatedSame(participant, hostId);\n }\n }\n\n /**\n * process the roles that have been applied to this member\n * @param {Object} participant\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processRoles(participant: ParticipantWithRoles) {\n this.roles = MemberUtil.extractControlRoles(participant);\n }\n\n /**\n * set the type for the member, could be MEETING or CALL\n * @param {String} type\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n private processType(type: string) {\n this.type = type;\n }\n}\n"],"mappings":";;;;;;;;;;;AAGA;AAGA;AANA;AACA;AACA;AAMA;AACA;AACA;AAFA,IAGqBA,MAAM;EA+BzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,gBACEC,WAAmB,EASnB;IAAA,IARAC,OAOO,uEAAG,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,iDArBFC,mBAAQ;IAuBlB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACF,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACG,EAAE,GAAG,IAAI;IACd;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,iBAAiB,GAAG,IAAI;IAC7B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,qBAAqB,GAAG,IAAI;IACjC;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,OAAO,GAAG,IAAI;IACnB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,SAAS,GAAG,IAAI;IACrB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,aAAa,GAAG,IAAI;IACzB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,gBAAgB,GAAG,IAAI;IAC5B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,cAAc,GAAG,IAAI;IAC1B;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,WAAW,GAAG,IAAI;IACvB;AACJ;AACA;AACA;AACA;AACA;IACI,IAAI,CAACC,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AC5D,WAAW,EAAE4C,MAAM,CAAC;QAC9D,IAAI,CAACxB,cAAc,GAAGwB,MAAM;MAC9B;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA;IAAA,OAQA,uBAAsB5C,WAAmB,EAAE8C,MAAc,EAAE;MACzD,IAAIZ,aAAU,CAACf,MAAM,CAACnB,WAAW,CAAC,EAAE;QAClC,IAAI,CAACW,MAAM,GAAGuB,aAAU,CAACyB,MAAM,CAAC3D,WAAW,EAAE8C,MAAM,CAAC;MACtD,CAAC,MAAM,IAAIZ,aAAU,CAAChB,QAAQ,CAAClB,WAAW,CAAC,EAAE;QAC3C,IAAI,CAACW,MAAM,GAAGuB,aAAU,CAAC0B,gBAAgB,CAAC5D,WAAW,EAAE8C,MAAM,CAAC;MAChE;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,sBAAqB9C,WAAiC,EAAE;MACtD,IAAI,CAAC2B,KAAK,GAAGO,aAAU,CAAC2B,mBAAmB,CAAC7D,WAAW,CAAC;IAC1D;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,qBAAoBwB,IAAY,EAAE;MAChC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAClB;EAAC;EAAA;AAAA;AAAA"}
|
package/dist/member/types.js
CHANGED
|
@@ -4,7 +4,7 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.ServerRoles = void 0;
|
|
7
|
+
exports.ServerRoles = exports.MediaStatus = void 0;
|
|
8
8
|
var ServerRoles;
|
|
9
9
|
exports.ServerRoles = ServerRoles;
|
|
10
10
|
(function (ServerRoles) {
|
|
@@ -12,4 +12,14 @@ exports.ServerRoles = ServerRoles;
|
|
|
12
12
|
ServerRoles["Moderator"] = "MODERATOR";
|
|
13
13
|
ServerRoles["Presenter"] = "PRESENTER";
|
|
14
14
|
})(ServerRoles || (exports.ServerRoles = ServerRoles = {}));
|
|
15
|
+
// values are inherited from locus so don't update these
|
|
16
|
+
var MediaStatus; // participant has not added media in the meeting
|
|
17
|
+
exports.MediaStatus = MediaStatus;
|
|
18
|
+
(function (MediaStatus) {
|
|
19
|
+
MediaStatus["RECVONLY"] = "RECVONLY";
|
|
20
|
+
MediaStatus["SENDONLY"] = "SENDONLY";
|
|
21
|
+
MediaStatus["SENDRECV"] = "SENDRECV";
|
|
22
|
+
MediaStatus["INACTIVE"] = "INACTIVE";
|
|
23
|
+
MediaStatus["UNKNOWN"] = "UNKNOWN";
|
|
24
|
+
})(MediaStatus || (exports.MediaStatus = MediaStatus = {}));
|
|
15
25
|
//# sourceMappingURL=types.js.map
|
package/dist/member/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ServerRoles"],"sources":["types.ts"],"sourcesContent":["export interface IExternalRoles {\n cohost: boolean;\n moderator: boolean;\n presenter: boolean;\n}\n\nexport enum ServerRoles {\n Cohost = 'COHOST',\n Moderator = 'MODERATOR',\n Presenter = 'PRESENTER',\n}\n\nexport type ServerRoleShape = {\n type: ServerRoles;\n hasRole: boolean;\n};\n\nexport type ParticipantWithRoles = {\n controls: {\n role: {\n roles: Array<ServerRoleShape>;\n };\n };\n};\n"],"mappings":";;;;;;;IAMYA,WAAW;AAAA;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,2BAAXA,WAAW"}
|
|
1
|
+
{"version":3,"names":["ServerRoles","MediaStatus"],"sources":["types.ts"],"sourcesContent":["export interface IExternalRoles {\n cohost: boolean;\n moderator: boolean;\n presenter: boolean;\n}\n\nexport enum ServerRoles {\n Cohost = 'COHOST',\n Moderator = 'MODERATOR',\n Presenter = 'PRESENTER',\n}\n\nexport type ServerRoleShape = {\n type: ServerRoles;\n hasRole: boolean;\n};\n\nexport type ParticipantWithRoles = {\n controls: {\n role: {\n roles: Array<ServerRoleShape>;\n };\n };\n};\n\n// values are inherited from locus so don't update these\nexport enum MediaStatus {\n RECVONLY = 'RECVONLY', // participant only receiving and not sending\n SENDONLY = 'SENDONLY', // participant only sending and not receiving\n SENDRECV = 'SENDRECV', // participant both sending and receiving\n INACTIVE = 'INACTIVE', // participant is not connected to media source\n UNKNOWN = 'UNKNOWN', // participant has not added media in the meeting\n}\n\nexport interface IMediaStatus {\n audio: MediaStatus;\n video: MediaStatus;\n}\n"],"mappings":";;;;;;;IAMYA,WAAW;AAAA;AAAA,WAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,2BAAXA,WAAW;AAmBvB;AAAA,IACYC,WAAW,EAKA;AAAA;AAAA,WALXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,2BAAXA,WAAW"}
|
package/dist/member/util.js
CHANGED
|
@@ -324,6 +324,21 @@ MemberUtil.extractId = function (participant) {
|
|
|
324
324
|
return null;
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
+
/**
|
|
328
|
+
* extracts the media status from nested participant object
|
|
329
|
+
* @param {Object} participant the locus participant
|
|
330
|
+
* @returns {Object}
|
|
331
|
+
*/
|
|
332
|
+
MemberUtil.extractMediaStatus = function (participant) {
|
|
333
|
+
if (!participant) {
|
|
334
|
+
throw new _parameter.default('Media status could not be extracted, participant is undefined.');
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
audio: participant.status.audioStatus,
|
|
338
|
+
video: participant.status.videoStatus
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
|
|
327
342
|
/**
|
|
328
343
|
* @param {Object} participant the locus participant
|
|
329
344
|
* @returns {String}
|
package/dist/member/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MemberUtil","getControlsRoles","participant","controls","role","roles","hasRole","controlRole","some","type","hasCohost","ServerRoles","Cohost","hasModerator","Moderator","hasPresenter","Presenter","extractControlRoles","cohost","moderator","presenter","isUser","_USER_","isModerator","isGuest","guest","isDevice","_RESOURCE_ROOM_","isModeratorAssignmentProhibited","moderatorAssignmentNotAllowed","isSame","id","person","isAssociatedSame","associatedUsers","user","isNotAdmitted","status","devices","intent","_WAIT_","_IN_LOBBY_","_IN_MEETING_","isAudioMuted","ParameterError","mutedStatus","isMuted","AUDIO_STATUS","audio","muted","isVideoMuted","VIDEO_STATUS","isHandRaised","hand","raised","isBreakoutsSupported","doesNotSupportBreakouts","isInterpretationSupported","doesNotSupportSiInterpreter","isLiveAnnotationSupported","annotatorAssignmentNotAllowed","accessor","_RECEIVE_ONLY_","_SEND_RECEIVE_","getRecordingMember","record","recording","meta","modifiedBy","isRecording","localRecord","isRemovable","isSelf","isInMeeting","_CALL_","isMutable","extractStatus","length","_NOT_IN_MEETING_","state","_JOINED_","_IDLE_","foundDevice","find","device","_OBSERVE_","_LEFT_","extractId","extractName","name"],"sources":["util.ts"],"sourcesContent":["import {IExternalRoles, ParticipantWithRoles, ServerRoles, ServerRoleShape} from './types';\nimport {\n _USER_,\n _RESOURCE_ROOM_,\n _OBSERVE_,\n _WAIT_,\n _LEFT_,\n _JOINED_,\n _IDLE_,\n _IN_LOBBY_,\n _NOT_IN_MEETING_,\n _IN_MEETING_,\n AUDIO_STATUS,\n VIDEO_STATUS,\n _SEND_RECEIVE_,\n _RECEIVE_ONLY_,\n _CALL_,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nconst MemberUtil: any = {};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {[ServerRoleShape]}\n */\nMemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array<ServerRoleShape> =>\n participant?.controls?.role?.roles;\n\n/**\n * @param {Object} participant the locus participant\n * @param {ServerRoles} controlRole the search role\n * @returns {Boolean}\n */\nMemberUtil.hasRole = (participant: any, controlRole: ServerRoles): boolean =>\n MemberUtil.getControlsRoles(participant)?.some(\n (role) => role.type === controlRole && role.hasRole\n );\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.hasCohost = (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Cohost) || false;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.hasModerator = (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Moderator) || false;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.hasPresenter = (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Presenter) || false;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {IExternalRoles}\n */\nMemberUtil.extractControlRoles = (participant: ParticipantWithRoles): IExternalRoles => {\n const roles = {\n cohost: MemberUtil.hasCohost(participant),\n moderator: MemberUtil.hasModerator(participant),\n presenter: MemberUtil.hasPresenter(participant),\n };\n\n return roles;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isUser = (participant: any) => participant && participant.type === _USER_;\n\nMemberUtil.isModerator = (participant) => participant && participant.moderator;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isGuest = (participant: any) => participant && participant.guest;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isDevice = (participant: any) => participant && participant.type === _RESOURCE_ROOM_;\n\nMemberUtil.isModeratorAssignmentProhibited = (participant) =>\n participant && participant.moderatorAssignmentNotAllowed;\n\n/**\n * checks to see if the participant id is the same as the passed id\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isSame = (participant: any, id: string) =>\n participant && (participant.id === id || (participant.person && participant.person.id === id));\n\n/**\n * checks to see if the participant id is the same as the passed id for associated devices\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isAssociatedSame = (participant: any, id: string) =>\n participant &&\n participant.associatedUsers &&\n participant.associatedUsers.some(\n (user) => user.id === id || (user.person && user.person.id === id)\n );\n\n/**\n * @param {Object} participant the locus participant\n * @param {Boolean} isGuest\n * @param {String} status\n * @returns {Boolean}\n */\nMemberUtil.isNotAdmitted = (participant: any, isGuest: boolean, status: string): boolean =>\n participant &&\n participant.guest &&\n ((participant.devices &&\n participant.devices[0] &&\n participant.devices[0].intent &&\n participant.devices[0].intent.type === _WAIT_ &&\n // @ts-ignore\n isGuest &&\n status === _IN_LOBBY_) ||\n // @ts-ignore\n !status === _IN_MEETING_);\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isAudioMuted = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Audio could not be processed, participant is undefined.');\n }\n const mutedStatus = MemberUtil.isMuted(participant.status, AUDIO_STATUS);\n\n if (participant.controls && participant.controls.audio) {\n if (participant.controls.audio.muted) {\n return true;\n }\n if (mutedStatus) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isVideoMuted = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Video could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant.status, VIDEO_STATUS);\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isHandRaised = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Raise hand could not be processed, participant is undefined.');\n }\n\n return participant.controls?.hand?.raised || false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isBreakoutsSupported = (participant) => {\n if (!participant) {\n throw new ParameterError('Breakout support could not be processed, participant is undefined.');\n }\n\n return !participant.doesNotSupportBreakouts;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isInterpretationSupported = (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'Interpretation support could not be processed, participant is undefined.'\n );\n }\n\n return !participant.doesNotSupportSiInterpreter;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isLiveAnnotationSupported = (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'LiveAnnotation support could not be processed, participant is undefined.'\n );\n }\n\n return !participant.annotatorAssignmentNotAllowed;\n};\n\n/**\n * utility method for audio/video muted status\n * @param {String} status\n * @param {String} accessor\n * @returns {Boolean}\n */\nMemberUtil.isMuted = (status: string, accessor: string) => {\n if (status) {\n if (status[accessor] === _RECEIVE_ONLY_) {\n return true;\n }\n if (status[accessor] === _SEND_RECEIVE_) {\n return false;\n }\n }\n\n return null;\n};\n\n/**\n * utility method for getting the recording member for later comparison\n * @param {Object} controls\n * @returns {String|null}\n */\nMemberUtil.getRecordingMember = (controls: any) => {\n if (!controls) {\n return null;\n }\n if (controls.record && controls.record.recording && controls.record.meta) {\n return controls.record.meta.modifiedBy;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isRecording = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Recording could not be processed, participant is undefined.');\n }\n if (participant.controls && participant.controls.localRecord) {\n return participant.controls.localRecord.recording;\n }\n\n return false;\n};\n\nMemberUtil.isRemovable = (isSelf, isGuest, isInMeeting, type) => {\n if (isGuest || isSelf) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isInMeeting) {\n return true;\n }\n\n return false;\n};\n\nMemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => {\n if (!isInMeeting) {\n return false;\n }\n if (isMuted) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isSelf || isDevice) {\n return true;\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractStatus = (participant: any) => {\n if (!(participant && participant.devices && participant.devices.length)) {\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _JOINED_) {\n return _IN_MEETING_;\n }\n if (participant.state === _IDLE_) {\n if (participant.devices && participant.devices.length > 0) {\n const foundDevice = participant.devices.find(\n (device) =>\n device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_)\n );\n\n return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _LEFT_) {\n return _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractId = (participant: any) => {\n if (participant) {\n return participant.id;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractName = (participant: any) => {\n if (participant && participant.person) {\n return participant.person.name;\n }\n\n return null;\n};\n\nexport default MemberUtil;\n"],"mappings":";;;;;;;;AAAA;AACA;AAiBA;AAEA,IAAMA,UAAe,GAAG,CAAC,CAAC;;AAE1B;AACA;AACA;AACA;AACAA,UAAU,CAACC,gBAAgB,GAAG,UAACC,WAAiC;EAAA;EAAA,OAC9DA,WAAW,aAAXA,WAAW,gDAAXA,WAAW,CAAEC,QAAQ,oFAArB,sBAAuBC,IAAI,2DAA3B,uBAA6BC,KAAK;AAAA;;AAEpC;AACA;AACA;AACA;AACA;AACAL,UAAU,CAACM,OAAO,GAAG,UAACJ,WAAgB,EAAEK,WAAwB;EAAA;EAAA,gCAC9DP,UAAU,CAACC,gBAAgB,CAACC,WAAW,CAAC,0DAAxC,sBAA0CM,IAAI,CAC5C,UAACJ,IAAI;IAAA,OAAKA,IAAI,CAACK,IAAI,KAAKF,WAAW,IAAIH,IAAI,CAACE,OAAO;EAAA,EACpD;AAAA;;AAEH;AACA;AACA;AACA;AACAN,UAAU,CAACU,SAAS,GAAG,UAACR,WAAiC;EAAA,OACvDF,UA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C,MAAM,GAAG,CAAC,EAAE;MACzD,IAAMK,WAAW,GAAGhF,WAAW,CAACoC,OAAO,CAAC6C,IAAI,CAC1C,UAACC,MAAM;QAAA,OACLA,MAAM,CAAC7C,MAAM,KAAK6C,MAAM,CAAC7C,MAAM,CAAC9B,IAAI,KAAK+B,iBAAM,IAAI4C,MAAM,CAAC7C,MAAM,CAAC9B,IAAI,KAAK4E,oBAAS,CAAC;MAAA,EACvF;MAED,OAAOH,WAAW,GAAGzC,qBAAU,GAAGqC,2BAAgB;IACpD;IAEA,OAAOA,2BAAgB;EACzB;EACA,IAAI5E,WAAW,CAAC6E,KAAK,KAAKO,iBAAM,EAAE;IAChC,OAAOR,2BAAgB;EACzB;EAEA,OAAOA,2BAAgB;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA9E,UAAU,CAACuF,SAAS,GAAG,UAACrF,WAAgB,EAAK;EAC3C,IAAIA,WAAW,EAAE;IACf,OAAOA,WAAW,CAAC6B,EAAE;EACvB;EAEA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA/B,UAAU,CAACwF,WAAW,GAAG,UAACtF,WAAgB,EAAK;EAC7C,IAAIA,WAAW,IAAIA,WAAW,CAAC8B,MAAM,EAAE;IACrC,OAAO9B,WAAW,CAAC8B,MAAM,CAACyD,IAAI;EAChC;EAEA,OAAO,IAAI;AACb,CAAC;AAAC,eAEazF,UAAU;AAAA"}
|
|
1
|
+
{"version":3,"names":["MemberUtil","getControlsRoles","participant","controls","role","roles","hasRole","controlRole","some","type","hasCohost","ServerRoles","Cohost","hasModerator","Moderator","hasPresenter","Presenter","extractControlRoles","cohost","moderator","presenter","isUser","_USER_","isModerator","isGuest","guest","isDevice","_RESOURCE_ROOM_","isModeratorAssignmentProhibited","moderatorAssignmentNotAllowed","isSame","id","person","isAssociatedSame","associatedUsers","user","isNotAdmitted","status","devices","intent","_WAIT_","_IN_LOBBY_","_IN_MEETING_","isAudioMuted","ParameterError","mutedStatus","isMuted","AUDIO_STATUS","audio","muted","isVideoMuted","VIDEO_STATUS","isHandRaised","hand","raised","isBreakoutsSupported","doesNotSupportBreakouts","isInterpretationSupported","doesNotSupportSiInterpreter","isLiveAnnotationSupported","annotatorAssignmentNotAllowed","accessor","_RECEIVE_ONLY_","_SEND_RECEIVE_","getRecordingMember","record","recording","meta","modifiedBy","isRecording","localRecord","isRemovable","isSelf","isInMeeting","_CALL_","isMutable","extractStatus","length","_NOT_IN_MEETING_","state","_JOINED_","_IDLE_","foundDevice","find","device","_OBSERVE_","_LEFT_","extractId","extractMediaStatus","audioStatus","video","videoStatus","extractName","name"],"sources":["util.ts"],"sourcesContent":["import {\n IExternalRoles,\n ParticipantWithRoles,\n ServerRoles,\n ServerRoleShape,\n IMediaStatus,\n} from './types';\nimport {\n _USER_,\n _RESOURCE_ROOM_,\n _OBSERVE_,\n _WAIT_,\n _LEFT_,\n _JOINED_,\n _IDLE_,\n _IN_LOBBY_,\n _NOT_IN_MEETING_,\n _IN_MEETING_,\n AUDIO_STATUS,\n VIDEO_STATUS,\n _SEND_RECEIVE_,\n _RECEIVE_ONLY_,\n _CALL_,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nconst MemberUtil: any = {};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {[ServerRoleShape]}\n */\nMemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array<ServerRoleShape> =>\n participant?.controls?.role?.roles;\n\n/**\n * @param {Object} participant the locus participant\n * @param {ServerRoles} controlRole the search role\n * @returns {Boolean}\n */\nMemberUtil.hasRole = (participant: any, controlRole: ServerRoles): boolean =>\n MemberUtil.getControlsRoles(participant)?.some(\n (role) => role.type === controlRole && role.hasRole\n );\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.hasCohost = (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Cohost) || false;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.hasModerator = (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Moderator) || false;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.hasPresenter = (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Presenter) || false;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {IExternalRoles}\n */\nMemberUtil.extractControlRoles = (participant: ParticipantWithRoles): IExternalRoles => {\n const roles = {\n cohost: MemberUtil.hasCohost(participant),\n moderator: MemberUtil.hasModerator(participant),\n presenter: MemberUtil.hasPresenter(participant),\n };\n\n return roles;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isUser = (participant: any) => participant && participant.type === _USER_;\n\nMemberUtil.isModerator = (participant) => participant && participant.moderator;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isGuest = (participant: any) => participant && participant.guest;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isDevice = (participant: any) => participant && participant.type === _RESOURCE_ROOM_;\n\nMemberUtil.isModeratorAssignmentProhibited = (participant) =>\n participant && participant.moderatorAssignmentNotAllowed;\n\n/**\n * checks to see if the participant id is the same as the passed id\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isSame = (participant: any, id: string) =>\n participant && (participant.id === id || (participant.person && participant.person.id === id));\n\n/**\n * checks to see if the participant id is the same as the passed id for associated devices\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isAssociatedSame = (participant: any, id: string) =>\n participant &&\n participant.associatedUsers &&\n participant.associatedUsers.some(\n (user) => user.id === id || (user.person && user.person.id === id)\n );\n\n/**\n * @param {Object} participant the locus participant\n * @param {Boolean} isGuest\n * @param {String} status\n * @returns {Boolean}\n */\nMemberUtil.isNotAdmitted = (participant: any, isGuest: boolean, status: string): boolean =>\n participant &&\n participant.guest &&\n ((participant.devices &&\n participant.devices[0] &&\n participant.devices[0].intent &&\n participant.devices[0].intent.type === _WAIT_ &&\n // @ts-ignore\n isGuest &&\n status === _IN_LOBBY_) ||\n // @ts-ignore\n !status === _IN_MEETING_);\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isAudioMuted = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Audio could not be processed, participant is undefined.');\n }\n const mutedStatus = MemberUtil.isMuted(participant.status, AUDIO_STATUS);\n\n if (participant.controls && participant.controls.audio) {\n if (participant.controls.audio.muted) {\n return true;\n }\n if (mutedStatus) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isVideoMuted = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Video could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant.status, VIDEO_STATUS);\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isHandRaised = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Raise hand could not be processed, participant is undefined.');\n }\n\n return participant.controls?.hand?.raised || false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isBreakoutsSupported = (participant) => {\n if (!participant) {\n throw new ParameterError('Breakout support could not be processed, participant is undefined.');\n }\n\n return !participant.doesNotSupportBreakouts;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isInterpretationSupported = (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'Interpretation support could not be processed, participant is undefined.'\n );\n }\n\n return !participant.doesNotSupportSiInterpreter;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isLiveAnnotationSupported = (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'LiveAnnotation support could not be processed, participant is undefined.'\n );\n }\n\n return !participant.annotatorAssignmentNotAllowed;\n};\n\n/**\n * utility method for audio/video muted status\n * @param {String} status\n * @param {String} accessor\n * @returns {Boolean}\n */\nMemberUtil.isMuted = (status: string, accessor: string) => {\n if (status) {\n if (status[accessor] === _RECEIVE_ONLY_) {\n return true;\n }\n if (status[accessor] === _SEND_RECEIVE_) {\n return false;\n }\n }\n\n return null;\n};\n\n/**\n * utility method for getting the recording member for later comparison\n * @param {Object} controls\n * @returns {String|null}\n */\nMemberUtil.getRecordingMember = (controls: any) => {\n if (!controls) {\n return null;\n }\n if (controls.record && controls.record.recording && controls.record.meta) {\n return controls.record.meta.modifiedBy;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isRecording = (participant: any) => {\n if (!participant) {\n throw new ParameterError('Recording could not be processed, participant is undefined.');\n }\n if (participant.controls && participant.controls.localRecord) {\n return participant.controls.localRecord.recording;\n }\n\n return false;\n};\n\nMemberUtil.isRemovable = (isSelf, isGuest, isInMeeting, type) => {\n if (isGuest || isSelf) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isInMeeting) {\n return true;\n }\n\n return false;\n};\n\nMemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => {\n if (!isInMeeting) {\n return false;\n }\n if (isMuted) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isSelf || isDevice) {\n return true;\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractStatus = (participant: any) => {\n if (!(participant && participant.devices && participant.devices.length)) {\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _JOINED_) {\n return _IN_MEETING_;\n }\n if (participant.state === _IDLE_) {\n if (participant.devices && participant.devices.length > 0) {\n const foundDevice = participant.devices.find(\n (device) =>\n device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_)\n );\n\n return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _LEFT_) {\n return _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractId = (participant: any) => {\n if (participant) {\n return participant.id;\n }\n\n return null;\n};\n\n/**\n * extracts the media status from nested participant object\n * @param {Object} participant the locus participant\n * @returns {Object}\n */\nMemberUtil.extractMediaStatus = (participant: any): IMediaStatus => {\n if (!participant) {\n throw new ParameterError('Media status could not be extracted, participant is undefined.');\n }\n\n return {\n audio: participant.status.audioStatus,\n video: participant.status.videoStatus,\n };\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractName = (participant: any) => {\n if (participant && participant.person) {\n return participant.person.name;\n }\n\n return null;\n};\n\nexport default MemberUtil;\n"],"mappings":";;;;;;;;AAAA;AAOA;AAiBA;AAEA,IAAMA,UAAe,GAAG,CAAC,CAAC;;AAE1B;AACA;AACA;AACA;AACAA,UAAU,CAACC,gBAAgB,GAAG,UAACC,WAAiC;EAAA;EAAA,OAC9DA,WAAW,aAAXA,WAAW,gDAAXA,WAAW,CAAEC,QAAQ,oFAArB,sBAAuBC,IAAI,2DAA3B,uBAA6BC,KAAK;AAAA;;AAEpC;AACA;AACA;AACA;AACA;AACAL,UAAU,CAACM,OAAO,GAAG,UAACJ,WAAgB,EAAEK,WAAwB;EAAA;EAAA,gCAC9DP,UAAU,CAACC,gBAAgB,CAACC,WAAW,CAAC,0DAAxC,sBAA0CM,IAAI,CAC5C,UAACJ,IAAI;IAAA,OAAKA,IAAI,CAACK,IAAI,KAAKF,WAAW,IAAIH,IAAI,CAACE,OAAO;EAAA,EACpD;AAAA;;AAEH;AACA;AACA;AACA;AACAN,UAAU,CAACU,SAAS,GAAG,UAACR,WAAiC;EAAA,OACvDF,UAAU,CAACM,OAAO,CAACJ,WAAW,EAAES,kBAAW,CAACC,MAAM,CAAC,IAAI,KAA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AO,CAAC6C,IAAI,CAC1C,UAACC,MAAM;QAAA,OACLA,MAAM,CAAC7C,MAAM,KAAK6C,MAAM,CAAC7C,MAAM,CAAC9B,IAAI,KAAK+B,iBAAM,IAAI4C,MAAM,CAAC7C,MAAM,CAAC9B,IAAI,KAAK4E,oBAAS,CAAC;MAAA,EACvF;MAED,OAAOH,WAAW,GAAGzC,qBAAU,GAAGqC,2BAAgB;IACpD;IAEA,OAAOA,2BAAgB;EACzB;EACA,IAAI5E,WAAW,CAAC6E,KAAK,KAAKO,iBAAM,EAAE;IAChC,OAAOR,2BAAgB;EACzB;EAEA,OAAOA,2BAAgB;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA9E,UAAU,CAACuF,SAAS,GAAG,UAACrF,WAAgB,EAAK;EAC3C,IAAIA,WAAW,EAAE;IACf,OAAOA,WAAW,CAAC6B,EAAE;EACvB;EAEA,OAAO,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA/B,UAAU,CAACwF,kBAAkB,GAAG,UAACtF,WAAgB,EAAmB;EAClE,IAAI,CAACA,WAAW,EAAE;IAChB,MAAM,IAAI0C,kBAAc,CAAC,gEAAgE,CAAC;EAC5F;EAEA,OAAO;IACLI,KAAK,EAAE9C,WAAW,CAACmC,MAAM,CAACoD,WAAW;IACrCC,KAAK,EAAExF,WAAW,CAACmC,MAAM,CAACsD;EAC5B,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA3F,UAAU,CAAC4F,WAAW,GAAG,UAAC1F,WAAgB,EAAK;EAC7C,IAAIA,WAAW,IAAIA,WAAW,CAAC8B,MAAM,EAAE;IACrC,OAAO9B,WAAW,CAAC8B,MAAM,CAAC6D,IAAI;EAChC;EAEA,OAAO,IAAI;AACb,CAAC;AAAC,eAEa7F,UAAU;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IExternalRoles } from './types';
|
|
1
|
+
import { IExternalRoles, IMediaStatus } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* @class Member
|
|
4
4
|
*/
|
|
@@ -23,6 +23,7 @@ export default class Member {
|
|
|
23
23
|
isUser: any;
|
|
24
24
|
isVideoMuted: any;
|
|
25
25
|
roles: IExternalRoles;
|
|
26
|
+
mediaStatus: IMediaStatus;
|
|
26
27
|
name: any;
|
|
27
28
|
participant: any;
|
|
28
29
|
status: any;
|
|
@@ -19,3 +19,14 @@ export type ParticipantWithRoles = {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
export declare enum MediaStatus {
|
|
23
|
+
RECVONLY = "RECVONLY",
|
|
24
|
+
SENDONLY = "SENDONLY",
|
|
25
|
+
SENDRECV = "SENDRECV",
|
|
26
|
+
INACTIVE = "INACTIVE",
|
|
27
|
+
UNKNOWN = "UNKNOWN"
|
|
28
|
+
}
|
|
29
|
+
export interface IMediaStatus {
|
|
30
|
+
audio: MediaStatus;
|
|
31
|
+
video: MediaStatus;
|
|
32
|
+
}
|
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.172",
|
|
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.172",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.172",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.172",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.172",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.172",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.172",
|
|
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.172",
|
|
50
50
|
"@webex/internal-media-core": "1.39.1",
|
|
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.172",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.172",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.172",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.172",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.172",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.172",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.172",
|
|
58
|
+
"@webex/media-helpers": "3.0.0-beta.172",
|
|
59
|
+
"@webex/plugin-people": "3.0.0-beta.172",
|
|
60
|
+
"@webex/plugin-rooms": "3.0.0-beta.172",
|
|
61
|
+
"@webex/webex-core": "3.0.0-beta.172",
|
|
62
62
|
"ampersand-collection": "^2.0.2",
|
|
63
63
|
"bowser": "^2.11.0",
|
|
64
64
|
"btoa": "^1.2.1",
|
package/src/member/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
3
|
*/
|
|
4
4
|
import {MEETINGS, _IN_LOBBY_, _NOT_IN_MEETING_, _IN_MEETING_} from '../constants';
|
|
5
|
-
import {IExternalRoles, ParticipantWithRoles} from './types';
|
|
5
|
+
import {IExternalRoles, IMediaStatus, ParticipantWithRoles} from './types';
|
|
6
6
|
|
|
7
7
|
import MemberUtil from './util';
|
|
8
8
|
|
|
@@ -30,6 +30,7 @@ export default class Member {
|
|
|
30
30
|
isUser: any;
|
|
31
31
|
isVideoMuted: any;
|
|
32
32
|
roles: IExternalRoles;
|
|
33
|
+
mediaStatus: IMediaStatus;
|
|
33
34
|
name: any;
|
|
34
35
|
participant: any;
|
|
35
36
|
status: any;
|
|
@@ -247,6 +248,19 @@ export default class Member {
|
|
|
247
248
|
* @memberof Member
|
|
248
249
|
*/
|
|
249
250
|
this.roles = null;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @instance
|
|
254
|
+
* @type {IMediaStatus}
|
|
255
|
+
* @public
|
|
256
|
+
* @memberof Member
|
|
257
|
+
* @example {audio: MediaStatus.RECVONLY, video: MediaStatus.SENDRECV}
|
|
258
|
+
*/
|
|
259
|
+
this.mediaStatus = {
|
|
260
|
+
audio: null,
|
|
261
|
+
video: null,
|
|
262
|
+
};
|
|
263
|
+
|
|
250
264
|
// TODO: more participant types
|
|
251
265
|
// such as native client, web client, is a device, what type of phone, etc
|
|
252
266
|
this.processParticipant(participant);
|
|
@@ -325,6 +339,8 @@ export default class Member {
|
|
|
325
339
|
this.isAudioMuted,
|
|
326
340
|
this.type
|
|
327
341
|
);
|
|
342
|
+
|
|
343
|
+
this.mediaStatus = MemberUtil.extractMediaStatus(this.participant);
|
|
328
344
|
}
|
|
329
345
|
|
|
330
346
|
/**
|
package/src/member/types.ts
CHANGED
|
@@ -22,3 +22,17 @@ export type ParticipantWithRoles = {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
|
|
26
|
+
// values are inherited from locus so don't update these
|
|
27
|
+
export enum MediaStatus {
|
|
28
|
+
RECVONLY = 'RECVONLY', // participant only receiving and not sending
|
|
29
|
+
SENDONLY = 'SENDONLY', // participant only sending and not receiving
|
|
30
|
+
SENDRECV = 'SENDRECV', // participant both sending and receiving
|
|
31
|
+
INACTIVE = 'INACTIVE', // participant is not connected to media source
|
|
32
|
+
UNKNOWN = 'UNKNOWN', // participant has not added media in the meeting
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IMediaStatus {
|
|
36
|
+
audio: MediaStatus;
|
|
37
|
+
video: MediaStatus;
|
|
38
|
+
}
|
package/src/member/util.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
IExternalRoles,
|
|
3
|
+
ParticipantWithRoles,
|
|
4
|
+
ServerRoles,
|
|
5
|
+
ServerRoleShape,
|
|
6
|
+
IMediaStatus,
|
|
7
|
+
} from './types';
|
|
2
8
|
import {
|
|
3
9
|
_USER_,
|
|
4
10
|
_RESOURCE_ROOM_,
|
|
@@ -347,6 +353,22 @@ MemberUtil.extractId = (participant: any) => {
|
|
|
347
353
|
return null;
|
|
348
354
|
};
|
|
349
355
|
|
|
356
|
+
/**
|
|
357
|
+
* extracts the media status from nested participant object
|
|
358
|
+
* @param {Object} participant the locus participant
|
|
359
|
+
* @returns {Object}
|
|
360
|
+
*/
|
|
361
|
+
MemberUtil.extractMediaStatus = (participant: any): IMediaStatus => {
|
|
362
|
+
if (!participant) {
|
|
363
|
+
throw new ParameterError('Media status could not be extracted, participant is undefined.');
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return {
|
|
367
|
+
audio: participant.status.audioStatus,
|
|
368
|
+
video: participant.status.videoStatus,
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
|
|
350
372
|
/**
|
|
351
373
|
* @param {Object} participant the locus participant
|
|
352
374
|
* @returns {String}
|
|
@@ -5,22 +5,21 @@ import MemberUtil from '@webex/plugin-meetings/src/member/util';
|
|
|
5
5
|
import Member from '@webex/plugin-meetings/src/member';
|
|
6
6
|
|
|
7
7
|
describe('member', () => {
|
|
8
|
+
const participant = {controls: {}, status: {}};
|
|
9
|
+
|
|
10
|
+
const member = new Member(participant);
|
|
11
|
+
|
|
8
12
|
afterEach(() => {
|
|
9
13
|
sinon.restore();
|
|
10
14
|
});
|
|
11
15
|
|
|
12
16
|
it('checks member properties', () => {
|
|
13
|
-
const member = new Member({});
|
|
14
17
|
assert.exists(member.supportsInterpretation);
|
|
15
18
|
assert.exists(member.supportsBreakouts);
|
|
16
19
|
assert.exists(member.supportLiveAnnotation);
|
|
17
20
|
});
|
|
18
21
|
|
|
19
22
|
it('checks that processParticipant calls isHandRaised', () => {
|
|
20
|
-
const participant = {controls: {}};
|
|
21
|
-
|
|
22
|
-
const member = new Member({});
|
|
23
|
-
|
|
24
23
|
sinon.spy(MemberUtil, 'isHandRaised');
|
|
25
24
|
member.processParticipant(participant);
|
|
26
25
|
|
|
@@ -29,10 +28,6 @@ describe('member', () => {
|
|
|
29
28
|
|
|
30
29
|
describe('roles', () => {
|
|
31
30
|
it('checks that processParticipant calls processRoles', () => {
|
|
32
|
-
const participant = {};
|
|
33
|
-
|
|
34
|
-
const member = new Member({});
|
|
35
|
-
|
|
36
31
|
sinon.spy(member, 'processRoles');
|
|
37
32
|
member.processParticipant(participant);
|
|
38
33
|
|
|
@@ -40,14 +35,42 @@ describe('member', () => {
|
|
|
40
35
|
});
|
|
41
36
|
|
|
42
37
|
it('checks that processRoles calls extractControlRoles', () => {
|
|
43
|
-
const participant = {};
|
|
44
|
-
|
|
45
|
-
const member = new Member({});
|
|
46
|
-
|
|
47
38
|
sinon.spy(MemberUtil, 'extractControlRoles');
|
|
48
39
|
member.processParticipant(participant);
|
|
49
40
|
|
|
50
41
|
assert.calledOnceWithExactly(MemberUtil.extractControlRoles, participant);
|
|
51
42
|
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('#processParticipant', () => {
|
|
46
|
+
it('checks that processParticipant calls isHandRaised', () => {
|
|
47
|
+
sinon.spy(MemberUtil, 'isHandRaised');
|
|
48
|
+
member.processParticipant(participant);
|
|
49
|
+
|
|
50
|
+
assert.calledOnceWithExactly(MemberUtil.isHandRaised, participant);
|
|
51
|
+
});
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
describe('#processMember', () => {
|
|
55
|
+
it('checks that processMember calls isRemovable', () => {
|
|
56
|
+
sinon.spy(MemberUtil, 'isRemovable');
|
|
57
|
+
member.processMember();
|
|
58
|
+
|
|
59
|
+
assert.calledOnce(MemberUtil.isRemovable);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('checks that processMember calls isMutable', () => {
|
|
63
|
+
sinon.spy(MemberUtil, 'isMutable');
|
|
64
|
+
member.processMember();
|
|
65
|
+
|
|
66
|
+
assert.calledOnce(MemberUtil.isMutable);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('checks that processMember calls extractMediaStatus', () => {
|
|
70
|
+
sinon.spy(MemberUtil, 'extractMediaStatus');
|
|
71
|
+
member.processMember();
|
|
72
|
+
|
|
73
|
+
assert.calledOnceWithExactly(MemberUtil.extractMediaStatus, participant);
|
|
74
|
+
});
|
|
52
75
|
})
|
|
53
76
|
});
|
|
@@ -423,3 +423,34 @@ describe('plugin-meetings', () => {
|
|
|
423
423
|
});
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
|
+
|
|
427
|
+
describe('extractMediaStatus', () => {
|
|
428
|
+
it('throws error when there is no participant', () => {
|
|
429
|
+
assert.throws(() => {
|
|
430
|
+
MemberUtil.extractMediaStatus()
|
|
431
|
+
}, 'Media status could not be extracted, participant is undefined.');
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
it('returns undefined media status when participant audio/video status is not present', () => {
|
|
435
|
+
const participant = {
|
|
436
|
+
status: {}
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
const mediaStatus = MemberUtil.extractMediaStatus(participant)
|
|
440
|
+
|
|
441
|
+
assert.deepEqual(mediaStatus, {audio: undefined, video: undefined});
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
it('returns correct media status when participant audio/video status is present', () => {
|
|
445
|
+
const participant = {
|
|
446
|
+
status: {
|
|
447
|
+
audioStatus: 'RECVONLY',
|
|
448
|
+
videoStatus: 'SENDRECV'
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
const mediaStatus = MemberUtil.extractMediaStatus(participant)
|
|
453
|
+
|
|
454
|
+
assert.deepEqual(mediaStatus, {audio: 'RECVONLY', video: 'SENDRECV'});
|
|
455
|
+
});
|
|
456
|
+
});
|