@webex/plugin-meetings 3.8.0-next.69 → 3.8.0-next.70

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.
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_constants","_parameter","_interopRequireDefault","MemberUtil","canReclaimHost","participant","ParameterError","canReclaimHostRole","getControlsRoles","_participant$controls","_participant$controls2","controls","role","roles","isBrb","_participant$controls3","_participant$controls4","brb","enabled","hasRole","controlRole","_MemberUtil$getContro","some","type","hasCohost","ServerRoles","Cohost","hasModerator","Moderator","hasPresenter","Presenter","extractControlRoles","cohost","moderator","presenter","isUser","_USER_","isModerator","isGuest","guest","isDevice","_RESOURCE_ROOM_","isModeratorAssignmentProhibited","moderatorAssignmentNotAllowed","isPresenterAssignmentProhibited","presenterAssignmentNotAllowed","isSame","id","person","isAssociatedSame","associatedUsers","user","isNotAdmitted","status","devices","intent","_WAIT_","_IN_LOBBY_","_IN_MEETING_","isAudioMuted","isMuted","AUDIO_STATUS","AUDIO","isVideoMuted","VIDEO_STATUS","VIDEO","isHandRaised","_participant$controls5","_participant$controls6","hand","raised","isBreakoutsSupported","doesNotSupportBreakouts","isInterpretationSupported","doesNotSupportSiInterpreter","isLiveAnnotationSupported","annotatorAssignmentNotAllowed","statusAccessor","controlsAccessor","_participant$controls7","_participant$controls8","_participant$status","remoteMute","muted","localStatus","_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","_participant$status2","_participant$status3","audio","audioStatus","video","videoStatus","extractName","name","_default","exports","default"],"sources":["util.ts"],"sourcesContent":["import {\n IExternalRoles,\n ParticipantWithRoles,\n ServerRoles,\n ServerRoleShape,\n IMediaStatus,\n ParticipantWithBrb,\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 VIDEO,\n AUDIO,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nconst MemberUtil: any = {};\n\n/**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\nMemberUtil.canReclaimHost = (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'canReclaimHostRole could not be processed, participant is undefined.'\n );\n }\n\n return participant.canReclaimHostRole || false;\n};\n\n/**\n * @param {Object} participant - The locus participant object.\n * @returns {[ServerRoleShape]}\n */\nMemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array<ServerRoleShape> =>\n participant?.controls?.role?.roles;\n\n/**\n * Checks if the participant has the brb status enabled.\n *\n * @param {ParticipantWithBrb} participant - The locus participant object.\n * @returns {boolean} - True if the participant has brb enabled, false otherwise.\n */\nMemberUtil.isBrb = (participant: ParticipantWithBrb): boolean =>\n participant.controls?.brb?.enabled || false;\n\n/**\n * @param {Object} participant - The locus participant object.\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 object.\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 object.\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 object.\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 object.\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 object.\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 object.\n * @returns {Boolean}\n */\nMemberUtil.isGuest = (participant: any) => participant && participant.guest;\n\n/**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\nMemberUtil.isDevice = (participant: any) => participant && participant.type === _RESOURCE_ROOM_;\n\nMemberUtil.isModeratorAssignmentProhibited = (participant) =>\n participant && participant.moderatorAssignmentNotAllowed;\n\nMemberUtil.isPresenterAssignmentProhibited = (participant) =>\n participant && participant.presenterAssignmentNotAllowed;\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 object.\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 object.\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 object.\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 object.\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\n return MemberUtil.isMuted(participant, AUDIO_STATUS, AUDIO);\n};\n\n/**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\nMemberUtil.isVideoMuted = (participant: any): boolean => {\n if (!participant) {\n throw new ParameterError('Video could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant, VIDEO_STATUS, VIDEO);\n};\n\n/**\n * @param {Object} participant - The locus participant object.\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 object.\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 object.\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 object.\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 {any} participant\n * @param {String} statusAccessor\n * @param {String} controlsAccessor\n * @returns {Boolean | undefined}\n */\nMemberUtil.isMuted = (participant: any, statusAccessor: string, controlsAccessor: string) => {\n // check remote mute\n const remoteMute = participant?.controls?.[controlsAccessor]?.muted;\n if (remoteMute === true) {\n return true;\n }\n\n // check local mute\n const localStatus = participant?.status?.[statusAccessor];\n if (localStatus === _RECEIVE_ONLY_) {\n return true;\n }\n if (localStatus === _SEND_RECEIVE_) {\n return false;\n }\n\n return remoteMute;\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 object.\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 object.\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 object.\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 object.\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 object.\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,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,UAAA,GAAAD,OAAA;AAmBA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAMI,UAAe,GAAG,CAAC,CAAC;;AAE1B;AACA;AACA;AACA;AACAA,UAAU,CAACC,cAAc,GAAG,UAACC,WAAW,EAAK;EAC3C,IAAI,CAACA,WAAW,EAAE;IAChB,MAAM,IAAIC,kBAAc,CACtB,sEACF,CAAC;EACH;EAEA,OAAOD,WAAW,CAACE,kBAAkB,IAAI,KAAK;AAChD,CAAC;;AAED;AACA;AACA;AACA;AACAJ,UAAU,CAACK,gBAAgB,GAAG,UAACH,WAAiC;EAAA,IAAAI,qBAAA,EAAAC,sBAAA;EAAA,OAC9DL,WAAW,aAAXA,WAAW,wBAAAI,qBAAA,GAAXJ,WAAW,CAAEM,QAAQ,cAAAF,qBAAA,wBAAAC,sBAAA,GAArBD,qBAAA,CAA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AC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavH,UAAU"}
1
+ {"version":3,"names":["_types","require","_constants","_parameter","_interopRequireDefault","MemberUtil","canReclaimHost","participant","ParameterError","canReclaimHostRole","getControlsRoles","_participant$controls","_participant$controls2","controls","role","roles","isBrb","_participant$controls3","_participant$controls4","brb","enabled","hasRole","controlRole","_MemberUtil$getContro","some","type","hasCohost","ServerRoles","Cohost","hasModerator","Moderator","hasPresenter","Presenter","extractControlRoles","cohost","moderator","presenter","isUser","_USER_","isModerator","isGuest","guest","isDevice","_RESOURCE_ROOM_","isModeratorAssignmentProhibited","moderatorAssignmentNotAllowed","isPresenterAssignmentProhibited","presenterAssignmentNotAllowed","isSame","id","person","isAssociatedSame","associatedUsers","user","isNotAdmitted","status","devices","intent","_WAIT_","_IN_LOBBY_","_IN_MEETING_","isAudioMuted","isMuted","AUDIO_STATUS","AUDIO","isVideoMuted","VIDEO_STATUS","VIDEO","isHandRaised","_participant$controls5","_participant$controls6","hand","raised","isBreakoutsSupported","doesNotSupportBreakouts","isInterpretationSupported","doesNotSupportSiInterpreter","isLiveAnnotationSupported","annotatorAssignmentNotAllowed","statusAccessor","controlsAccessor","_participant$controls7","_participant$controls8","_participant$status","remoteMute","muted","localStatus","_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","_participant$status2","_participant$status3","audio","audioStatus","video","videoStatus","extractName","name","_default","exports","default"],"sources":["util.ts"],"sourcesContent":["import {\n IExternalRoles,\n ParticipantWithRoles,\n ServerRoles,\n ServerRoleShape,\n IMediaStatus,\n ParticipantWithBrb,\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 VIDEO,\n AUDIO,\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nconst MemberUtil = {\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n canReclaimHost: (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'canReclaimHostRole could not be processed, participant is undefined.'\n );\n }\n\n return participant.canReclaimHostRole || false;\n },\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {[ServerRoleShape]}\n */\n getControlsRoles: (participant: ParticipantWithRoles): Array<ServerRoleShape> =>\n participant?.controls?.role?.roles,\n\n /**\n * Checks if the participant has the brb status enabled.\n *\n * @param {ParticipantWithBrb} participant - The locus participant object.\n * @returns {boolean} - True if the participant has brb enabled, false otherwise.\n */\n isBrb: (participant: ParticipantWithBrb): boolean => participant.controls?.brb?.enabled || false,\n\n /**\n * @param {Object} participant - The locus participant object.\n * @param {ServerRoles} controlRole the search role\n * @returns {Boolean}\n */\n 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 object.\n * @returns {Boolean}\n */\n hasCohost: (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Cohost) || false,\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n hasModerator: (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Moderator) || false,\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n hasPresenter: (participant: ParticipantWithRoles): boolean =>\n MemberUtil.hasRole(participant, ServerRoles.Presenter) || false,\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {IExternalRoles}\n */\n 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 object.\n * @returns {Boolean}\n */\n isUser: (participant: any) => participant && participant.type === _USER_,\n\n isModerator: (participant) => participant && participant.moderator,\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n isGuest: (participant: any) => participant && participant.guest,\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n isDevice: (participant: any) => participant && participant.type === _RESOURCE_ROOM_,\n\n isModeratorAssignmentProhibited: (participant) =>\n participant && participant.moderatorAssignmentNotAllowed,\n\n isPresenterAssignmentProhibited: (participant) =>\n participant && participant.presenterAssignmentNotAllowed,\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 object.\n * @param {String} id\n * @returns {Boolean}\n */\n 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 object.\n * @param {String} id\n * @returns {Boolean}\n */\n 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 object.\n * @param {Boolean} isGuest\n * @param {String} status\n * @returns {Boolean}\n */\n 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 object.\n * @returns {Boolean}\n */\n isAudioMuted: (participant: any) => {\n if (!participant) {\n throw new ParameterError('Audio could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant, AUDIO_STATUS, AUDIO);\n },\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n isVideoMuted: (participant: any): boolean => {\n if (!participant) {\n throw new ParameterError('Video could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant, VIDEO_STATUS, VIDEO);\n },\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n 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 object.\n * @returns {Boolean}\n */\n isBreakoutsSupported: (participant) => {\n if (!participant) {\n throw new ParameterError(\n 'Breakout support could not be processed, participant is undefined.'\n );\n }\n\n return !participant.doesNotSupportBreakouts;\n },\n\n /**\n * @param {Object} participant - The locus participant object.\n * @returns {Boolean}\n */\n 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 object.\n * @returns {Boolean}\n */\n 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 {any} participant\n * @param {String} statusAccessor\n * @param {String} controlsAccessor\n * @returns {Boolean | undefined}\n */\n isMuted: (participant: any, statusAccessor: string, controlsAccessor: string) => {\n // check remote mute\n const remoteMute = participant?.controls?.[controlsAccessor]?.muted;\n if (remoteMute === true) {\n return true;\n }\n\n // check local mute\n const localStatus = participant?.status?.[statusAccessor];\n if (localStatus === _RECEIVE_ONLY_) {\n return true;\n }\n if (localStatus === _SEND_RECEIVE_) {\n return false;\n }\n\n return remoteMute;\n },\n\n /**\n * utility method for getting the recording member for later comparison\n * @param {Object} controls\n * @returns {String|null}\n */\n 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 object.\n * @returns {Boolean}\n */\n 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\n 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\n 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 object.\n * @returns {String}\n */\n 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 object.\n * @returns {String}\n */\n 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 object.\n * @returns {Object}\n */\n 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 object.\n * @returns {String}\n */\n 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,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,UAAA,GAAAD,OAAA;AAmBA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAMI,UAAU,GAAG;EACjB;AACF;AACA;AACA;EACEC,cAAc,EAAE,SAAAA,eAACC,WAAW,EAAK;IAC/B,IAAI,CAACA,WAAW,EAAE;MAChB,MAAM,IAAIC,kBAAc,CACtB,sEACF,CAAC;IACH;IAEA,OAAOD,WAAW,CAACE,kBAAkB,IAAI,KAAK;EAChD,CAAC;EAED;AACF;AACA;AACA;EACEC,gBAAgB,EAAE,SAAAA,iBAACH,WAAiC;IAAA,IAAAI,qBAAA,EAAAC,sBAAA;IAAA,OAClDL,WAAW,aAAXA,WAAW,wBAAAI,qBAAA,GAAXJ,WAAW,CAAEM,QAAQ,cAAAF,qBAAA,wBAAAC,sBAAA,GAArBD,qBAAA,CAAuBG,IAAI,cAAAF,sBAAA,uBAA3BA,sBAAA,CAA6BG,KAAK;EAAA;EAEpC;AACF;AACA;AACA;AACA;AACA;EACEC,KAAK,EAAE,SAAAA,MAACT,WAA+B;IAAA,IAAAU,sBAAA,EAAAC,sBAAA;IAAA,OAAc,EAAAD,sBAAA,GAAAV,WAAW,CAACM,QAAQ,cAAAI,sBAAA,wBAAAC,sBAAA,GAApBD,sBAAA,CAAsBE,GAAG,cAAAD,sBAAA,uBAAzBA,sBAAA,CAA2BE,OAAO,KAAI,KAAK;EAAA;EAEhG;AACF;AACA;AACA;AACA;EACEC,OA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kBAAkB,EAAE,SAAAA,mBAAC1G,WAAgB,EAAmB;IAAA,IAAA2G,oBAAA,EAAAC,oBAAA;IACtD,IAAI,CAAC5G,WAAW,EAAE;MAChB,MAAM,IAAIC,kBAAc,CAAC,gEAAgE,CAAC;IAC5F;IAEA,OAAO;MACL4G,KAAK,GAAAF,oBAAA,GAAE3G,WAAW,CAACgD,MAAM,cAAA2D,oBAAA,uBAAlBA,oBAAA,CAAoBG,WAAW;MACtCC,KAAK,GAAAH,oBAAA,GAAE5G,WAAW,CAACgD,MAAM,cAAA4D,oBAAA,uBAAlBA,oBAAA,CAAoBI;IAC7B,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;EACEC,WAAW,EAAE,SAAAA,YAACjH,WAAgB,EAAK;IACjC,IAAIA,WAAW,IAAIA,WAAW,CAAC2C,MAAM,EAAE;MACrC,OAAO3C,WAAW,CAAC2C,MAAM,CAACuE,IAAI;IAChC;IAEA,OAAO,IAAI;EACb;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACavH,UAAU"}
@@ -1,2 +1,160 @@
1
- declare const MemberUtil: any;
1
+ import { IExternalRoles, ParticipantWithRoles, ServerRoles, ServerRoleShape, IMediaStatus, ParticipantWithBrb } from './types';
2
+ declare const MemberUtil: {
3
+ /**
4
+ * @param {Object} participant - The locus participant object.
5
+ * @returns {Boolean}
6
+ */
7
+ canReclaimHost: (participant: any) => any;
8
+ /**
9
+ * @param {Object} participant - The locus participant object.
10
+ * @returns {[ServerRoleShape]}
11
+ */
12
+ getControlsRoles: (participant: ParticipantWithRoles) => Array<ServerRoleShape>;
13
+ /**
14
+ * Checks if the participant has the brb status enabled.
15
+ *
16
+ * @param {ParticipantWithBrb} participant - The locus participant object.
17
+ * @returns {boolean} - True if the participant has brb enabled, false otherwise.
18
+ */
19
+ isBrb: (participant: ParticipantWithBrb) => boolean;
20
+ /**
21
+ * @param {Object} participant - The locus participant object.
22
+ * @param {ServerRoles} controlRole the search role
23
+ * @returns {Boolean}
24
+ */
25
+ hasRole: (participant: any, controlRole: ServerRoles) => boolean;
26
+ /**
27
+ * @param {Object} participant - The locus participant object.
28
+ * @returns {Boolean}
29
+ */
30
+ hasCohost: (participant: ParticipantWithRoles) => boolean;
31
+ /**
32
+ * @param {Object} participant - The locus participant object.
33
+ * @returns {Boolean}
34
+ */
35
+ hasModerator: (participant: ParticipantWithRoles) => boolean;
36
+ /**
37
+ * @param {Object} participant - The locus participant object.
38
+ * @returns {Boolean}
39
+ */
40
+ hasPresenter: (participant: ParticipantWithRoles) => boolean;
41
+ /**
42
+ * @param {Object} participant - The locus participant object.
43
+ * @returns {IExternalRoles}
44
+ */
45
+ extractControlRoles: (participant: ParticipantWithRoles) => IExternalRoles;
46
+ /**
47
+ * @param {Object} participant - The locus participant object.
48
+ * @returns {Boolean}
49
+ */
50
+ isUser: (participant: any) => boolean;
51
+ isModerator: (participant: any) => any;
52
+ /**
53
+ * @param {Object} participant - The locus participant object.
54
+ * @returns {Boolean}
55
+ */
56
+ isGuest: (participant: any) => any;
57
+ /**
58
+ * @param {Object} participant - The locus participant object.
59
+ * @returns {Boolean}
60
+ */
61
+ isDevice: (participant: any) => boolean;
62
+ isModeratorAssignmentProhibited: (participant: any) => any;
63
+ isPresenterAssignmentProhibited: (participant: any) => any;
64
+ /**
65
+ * checks to see if the participant id is the same as the passed id
66
+ * there are multiple ids that can be used
67
+ * @param {Object} participant - The locus participant object.
68
+ * @param {String} id
69
+ * @returns {Boolean}
70
+ */
71
+ isSame: (participant: any, id: string) => boolean;
72
+ /**
73
+ * checks to see if the participant id is the same as the passed id for associated devices
74
+ * there are multiple ids that can be used
75
+ * @param {Object} participant - The locus participant object.
76
+ * @param {String} id
77
+ * @returns {Boolean}
78
+ */
79
+ isAssociatedSame: (participant: any, id: string) => any;
80
+ /**
81
+ * @param {Object} participant - The locus participant object.
82
+ * @param {Boolean} isGuest
83
+ * @param {String} status
84
+ * @returns {Boolean}
85
+ */
86
+ isNotAdmitted: (participant: any, isGuest: boolean, status: string) => boolean;
87
+ /**
88
+ * @param {Object} participant - The locus participant object.
89
+ * @returns {Boolean}
90
+ */
91
+ isAudioMuted: (participant: any) => any;
92
+ /**
93
+ * @param {Object} participant - The locus participant object.
94
+ * @returns {Boolean}
95
+ */
96
+ isVideoMuted: (participant: any) => boolean;
97
+ /**
98
+ * @param {Object} participant - The locus participant object.
99
+ * @returns {Boolean}
100
+ */
101
+ isHandRaised: (participant: any) => any;
102
+ /**
103
+ * @param {Object} participant - The locus participant object.
104
+ * @returns {Boolean}
105
+ */
106
+ isBreakoutsSupported: (participant: any) => boolean;
107
+ /**
108
+ * @param {Object} participant - The locus participant object.
109
+ * @returns {Boolean}
110
+ */
111
+ isInterpretationSupported: (participant: any) => boolean;
112
+ /**
113
+ * @param {Object} participant - The locus participant object.
114
+ * @returns {Boolean}
115
+ */
116
+ isLiveAnnotationSupported: (participant: any) => boolean;
117
+ /**
118
+ * utility method for audio/video muted status
119
+ * @param {any} participant
120
+ * @param {String} statusAccessor
121
+ * @param {String} controlsAccessor
122
+ * @returns {Boolean | undefined}
123
+ */
124
+ isMuted: (participant: any, statusAccessor: string, controlsAccessor: string) => any;
125
+ /**
126
+ * utility method for getting the recording member for later comparison
127
+ * @param {Object} controls
128
+ * @returns {String|null}
129
+ */
130
+ getRecordingMember: (controls: any) => any;
131
+ /**
132
+ * @param {Object} participant - The locus participant object.
133
+ * @returns {Boolean}
134
+ */
135
+ isRecording: (participant: any) => any;
136
+ isRemovable: (isSelf: any, isGuest: any, isInMeeting: any, type: any) => boolean;
137
+ isMutable: (isSelf: any, isDevice: any, isInMeeting: any, isMuted: any, type: any) => boolean;
138
+ /**
139
+ * @param {Object} participant - The locus participant object.
140
+ * @returns {String}
141
+ */
142
+ extractStatus: (participant: any) => "IN_LOBBY" | "IN_MEETING" | "NOT_IN_MEETING";
143
+ /**
144
+ * @param {Object} participant - The locus participant object.
145
+ * @returns {String}
146
+ */
147
+ extractId: (participant: any) => any;
148
+ /**
149
+ * extracts the media status from nested participant object
150
+ * @param {Object} participant - The locus participant object.
151
+ * @returns {Object}
152
+ */
153
+ extractMediaStatus: (participant: any) => IMediaStatus;
154
+ /**
155
+ * @param {Object} participant - The locus participant object.
156
+ * @returns {String}
157
+ */
158
+ extractName: (participant: any) => any;
159
+ };
2
160
  export default MemberUtil;
@@ -458,7 +458,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
458
458
  }, _callee7);
459
459
  }))();
460
460
  },
461
- version: "3.8.0-next.69"
461
+ version: "3.8.0-next.70"
462
462
  });
463
463
  var _default = exports.default = Webinar;
464
464
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "@webex/eslint-config-legacy": "0.0.0",
44
44
  "@webex/jest-config-legacy": "0.0.0",
45
45
  "@webex/legacy-tools": "0.0.0",
46
- "@webex/plugin-meetings": "3.8.0-next.69",
46
+ "@webex/plugin-meetings": "3.8.0-next.70",
47
47
  "@webex/plugin-rooms": "3.8.0-next.24",
48
48
  "@webex/test-helper-chai": "3.8.0-next.20",
49
49
  "@webex/test-helper-mocha": "3.8.0-next.20",
@@ -71,7 +71,7 @@
71
71
  "@webex/internal-plugin-metrics": "3.8.0-next.20",
72
72
  "@webex/internal-plugin-support": "3.8.0-next.24",
73
73
  "@webex/internal-plugin-user": "3.8.0-next.20",
74
- "@webex/internal-plugin-voicea": "3.8.0-next.69",
74
+ "@webex/internal-plugin-voicea": "3.8.0-next.70",
75
75
  "@webex/media-helpers": "3.8.0-next.24",
76
76
  "@webex/plugin-people": "3.8.0-next.22",
77
77
  "@webex/plugin-rooms": "3.8.0-next.24",
@@ -93,5 +93,5 @@
93
93
  "//": [
94
94
  "TODO: upgrade jwt-decode when moving to node 18"
95
95
  ],
96
- "version": "3.8.0-next.69"
96
+ "version": "3.8.0-next.70"
97
97
  }
@@ -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, IMediaStatus, ParticipantWithRoles} from './types';
5
+ import {IExternalRoles, IMediaStatus, ParticipantWithBrb, ParticipantWithRoles} from './types';
6
6
 
7
7
  import MemberUtil from './util';
8
8
 
@@ -312,7 +312,7 @@ export default class Member {
312
312
  this.supportsInterpretation = MemberUtil.isInterpretationSupported(participant);
313
313
  this.supportLiveAnnotation = MemberUtil.isLiveAnnotationSupported(participant);
314
314
  this.isGuest = MemberUtil.isGuest(participant);
315
- this.isBrb = MemberUtil.isBrb(participant);
315
+ this.isBrb = MemberUtil.isBrb(participant as ParticipantWithBrb);
316
316
  this.isUser = MemberUtil.isUser(participant);
317
317
  this.isDevice = MemberUtil.isDevice(participant);
318
318
  this.isModerator = MemberUtil.isModerator(participant);