@webex/plugin-meetings 3.8.0 → 3.8.1-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -13
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +70 -6
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +12 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +28 -123
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +3 -0
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/types.js.map +1 -1
- package/dist/controls-options-manager/util.js +78 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/interpretation/index.js +4 -4
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +37 -11
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +92 -12
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +432 -418
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +17 -17
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +94 -6
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/brbState.js +9 -2
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +21 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +678 -344
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +21 -22
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +4 -4
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +30 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +13 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +373 -68
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +5 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +136 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +14 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +55 -9
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +3 -0
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +335 -353
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +137 -29
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +38 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +36 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +10 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +40 -8
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +63 -27
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +107 -47
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +14 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/request.js +19 -3
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/util.js +5 -5
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +45 -27
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js +17 -0
- package/dist/roap/types.js.map +1 -0
- package/dist/types/common/errors/webex-errors.d.ts +7 -1
- package/dist/types/config.d.ts +3 -0
- package/dist/types/constants.d.ts +20 -85
- package/dist/types/controls-options-manager/enums.d.ts +4 -1
- package/dist/types/controls-options-manager/types.d.ts +10 -1
- package/dist/types/locus-info/index.d.ts +3 -3
- package/dist/types/locus-info/selfUtils.d.ts +216 -1
- package/dist/types/media/properties.d.ts +15 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +20 -0
- package/dist/types/meeting/index.d.ts +65 -1
- package/dist/types/meeting/muteState.d.ts +0 -1
- package/dist/types/meeting/request.d.ts +12 -1
- package/dist/types/meeting/request.type.d.ts +6 -0
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +82 -1
- package/dist/types/meetings/index.d.ts +57 -0
- package/dist/types/member/index.d.ts +21 -6
- package/dist/types/member/types.d.ts +73 -14
- package/dist/types/member/util.d.ts +156 -1
- package/dist/types/members/collection.d.ts +6 -5
- package/dist/types/members/index.d.ts +32 -43
- package/dist/types/members/request.d.ts +26 -0
- package/dist/types/members/util.d.ts +27 -0
- package/dist/types/metrics/constants.d.ts +10 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
- package/dist/types/reachability/clusterReachability.d.ts +15 -7
- package/dist/types/reachability/index.d.ts +10 -1
- package/dist/types/reachability/reachability.types.d.ts +5 -0
- package/dist/types/roap/index.d.ts +3 -2
- package/dist/types/roap/turnDiscovery.d.ts +5 -17
- package/dist/types/roap/types.d.ts +16 -0
- package/dist/webinar/index.js +2 -2
- package/dist/webinar/index.js.map +1 -1
- package/package.json +24 -23
- package/src/breakouts/index.ts +69 -0
- package/src/common/errors/webex-errors.ts +8 -1
- package/src/config.ts +3 -0
- package/src/constants.ts +30 -90
- package/src/controls-options-manager/enums.ts +3 -0
- package/src/controls-options-manager/types.ts +16 -1
- package/src/controls-options-manager/util.ts +93 -0
- package/src/interpretation/index.ts +3 -3
- package/src/locus-info/controlsUtils.ts +59 -14
- package/src/locus-info/index.ts +97 -13
- package/src/locus-info/selfUtils.ts +496 -442
- package/src/media/index.ts +23 -21
- package/src/media/properties.ts +96 -0
- package/src/meeting/brbState.ts +11 -2
- package/src/meeting/in-meeting-actions.ts +40 -0
- package/src/meeting/index.ts +470 -105
- package/src/meeting/locusMediaRequest.ts +27 -22
- package/src/meeting/muteState.ts +4 -4
- package/src/meeting/request.ts +36 -1
- package/src/meeting/request.type.ts +7 -0
- package/src/meeting/util.ts +11 -2
- package/src/meeting-info/meeting-info-v2.ts +254 -8
- package/src/meeting-info/utilv2.ts +5 -0
- package/src/meetings/index.ts +148 -1
- package/src/meetings/util.ts +18 -0
- package/src/member/index.ts +68 -22
- package/src/member/types.ts +82 -16
- package/src/member/util.ts +357 -350
- package/src/members/collection.ts +4 -3
- package/src/members/index.ts +137 -18
- package/src/members/request.ts +44 -0
- package/src/members/util.ts +43 -1
- package/src/metrics/constants.ts +10 -0
- package/src/multistream/remoteMediaManager.ts +32 -10
- package/src/reachability/clusterReachability.ts +73 -26
- package/src/reachability/index.ts +62 -1
- package/src/reachability/reachability.types.ts +6 -0
- package/src/reachability/request.ts +7 -0
- package/src/reconnection-manager/index.ts +2 -2
- package/src/recording-controller/util.ts +17 -13
- package/src/roap/index.ts +3 -7
- package/src/roap/turnDiscovery.ts +34 -39
- package/src/roap/types.ts +23 -0
- package/src/webinar/index.ts +1 -1
- package/test/unit/spec/breakouts/index.ts +167 -95
- package/test/unit/spec/controls-options-manager/util.js +178 -0
- package/test/unit/spec/interpretation/index.ts +39 -1
- package/test/unit/spec/locus-info/controlsUtils.js +155 -9
- package/test/unit/spec/locus-info/index.js +209 -73
- package/test/unit/spec/locus-info/selfUtils.js +98 -24
- package/test/unit/spec/media/index.ts +150 -18
- package/test/unit/spec/media/properties.ts +130 -0
- package/test/unit/spec/meeting/brbState.ts +40 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +23 -4
- package/test/unit/spec/meeting/index.js +804 -139
- package/test/unit/spec/meeting/locusMediaRequest.ts +95 -87
- package/test/unit/spec/meeting/muteState.js +73 -2
- package/test/unit/spec/meeting/request.js +32 -1
- package/test/unit/spec/meeting/utils.js +119 -18
- package/test/unit/spec/meeting-info/meetinginfov2.js +484 -114
- package/test/unit/spec/meeting-info/utilv2.js +19 -0
- package/test/unit/spec/meetings/index.js +146 -2
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +24 -0
- package/test/unit/spec/members/index.js +304 -78
- package/test/unit/spec/members/request.js +68 -22
- package/test/unit/spec/members/utils.js +75 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
- package/test/unit/spec/reachability/clusterReachability.ts +88 -56
- package/test/unit/spec/reachability/index.ts +97 -0
- package/test/unit/spec/reachability/request.js +47 -2
- package/test/unit/spec/reconnection-manager/index.js +4 -4
- package/test/unit/spec/roap/turnDiscovery.ts +110 -28
- package/test/unit/spec/webinar/index.ts +5 -0
- package/dist/annotation/annotation.types.d.ts +0 -42
- package/dist/annotation/constants.d.ts +0 -31
- package/dist/annotation/index.d.ts +0 -117
- package/dist/breakouts/breakout.d.ts +0 -8
- package/dist/breakouts/collection.d.ts +0 -5
- package/dist/breakouts/edit-lock-error.d.ts +0 -15
- package/dist/breakouts/events.d.ts +0 -8
- package/dist/breakouts/index.d.ts +0 -5
- package/dist/breakouts/request.d.ts +0 -22
- package/dist/breakouts/utils.d.ts +0 -15
- package/dist/common/browser-detection.d.ts +0 -9
- package/dist/common/collection.d.ts +0 -48
- package/dist/common/config.d.ts +0 -2
- package/dist/common/errors/captcha-error.d.ts +0 -15
- package/dist/common/errors/intent-to-join.d.ts +0 -16
- package/dist/common/errors/join-meeting.d.ts +0 -17
- package/dist/common/errors/media.d.ts +0 -15
- package/dist/common/errors/no-meeting-info.d.ts +0 -14
- package/dist/common/errors/parameter.d.ts +0 -15
- package/dist/common/errors/password-error.d.ts +0 -15
- package/dist/common/errors/permission.d.ts +0 -14
- package/dist/common/errors/reclaim-host-role-error.js +0 -149
- package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
- package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
- package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/common/errors/reconnection-in-progress.js +0 -33
- package/dist/common/errors/reconnection-in-progress.js.map +0 -1
- package/dist/common/errors/reconnection.d.ts +0 -15
- package/dist/common/errors/stats.d.ts +0 -15
- package/dist/common/errors/webex-errors.d.ts +0 -93
- package/dist/common/errors/webex-meetings-error.d.ts +0 -20
- package/dist/common/events/events-scope.d.ts +0 -17
- package/dist/common/events/events.d.ts +0 -12
- package/dist/common/events/trigger-proxy.d.ts +0 -2
- package/dist/common/events/util.d.ts +0 -2
- package/dist/common/logs/logger-config.d.ts +0 -2
- package/dist/common/logs/logger-proxy.d.ts +0 -2
- package/dist/common/logs/request.d.ts +0 -36
- package/dist/common/queue.d.ts +0 -34
- package/dist/config.d.ts +0 -72
- package/dist/constants.d.ts +0 -1088
- package/dist/controls-options-manager/constants.d.ts +0 -4
- package/dist/controls-options-manager/enums.d.ts +0 -15
- package/dist/controls-options-manager/index.d.ts +0 -136
- package/dist/controls-options-manager/types.d.ts +0 -43
- package/dist/controls-options-manager/util.d.ts +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/interceptors/index.d.ts +0 -2
- package/dist/interceptors/locusRetry.d.ts +0 -27
- package/dist/interpretation/collection.d.ts +0 -5
- package/dist/interpretation/index.d.ts +0 -5
- package/dist/interpretation/siLanguage.d.ts +0 -5
- package/dist/locus-info/controlsUtils.d.ts +0 -2
- package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
- package/dist/locus-info/fullState.d.ts +0 -2
- package/dist/locus-info/hostUtils.d.ts +0 -2
- package/dist/locus-info/index.d.ts +0 -322
- package/dist/locus-info/infoUtils.d.ts +0 -2
- package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
- package/dist/locus-info/parser.d.ts +0 -272
- package/dist/locus-info/selfUtils.d.ts +0 -2
- package/dist/media/index.d.ts +0 -34
- package/dist/media/properties.d.ts +0 -93
- package/dist/media/util.d.ts +0 -2
- package/dist/mediaQualityMetrics/config.d.ts +0 -241
- package/dist/mediaQualityMetrics/config.js +0 -502
- package/dist/mediaQualityMetrics/config.js.map +0 -1
- package/dist/meeting/effectsState.js +0 -260
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/meeting/in-meeting-actions.d.ts +0 -167
- package/dist/meeting/index.d.ts +0 -1825
- package/dist/meeting/locusMediaRequest.d.ts +0 -74
- package/dist/meeting/muteState.d.ts +0 -178
- package/dist/meeting/request.d.ts +0 -295
- package/dist/meeting/request.type.d.ts +0 -11
- package/dist/meeting/state.d.ts +0 -9
- package/dist/meeting/util.d.ts +0 -119
- package/dist/meeting/voicea-meeting.d.ts +0 -16
- package/dist/meeting-info/collection.d.ts +0 -20
- package/dist/meeting-info/index.d.ts +0 -69
- package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
- package/dist/meeting-info/request.d.ts +0 -22
- package/dist/meeting-info/util.d.ts +0 -2
- package/dist/meeting-info/utilv2.d.ts +0 -2
- package/dist/meetings/collection.d.ts +0 -40
- package/dist/meetings/index.d.ts +0 -390
- package/dist/meetings/meetings.types.d.ts +0 -4
- package/dist/meetings/request.d.ts +0 -27
- package/dist/meetings/util.d.ts +0 -18
- package/dist/member/index.d.ts +0 -160
- package/dist/member/member.types.js +0 -17
- package/dist/member/member.types.js.map +0 -1
- package/dist/member/types.d.ts +0 -32
- package/dist/member/util.d.ts +0 -2
- package/dist/members/collection.d.ts +0 -29
- package/dist/members/index.d.ts +0 -353
- package/dist/members/request.d.ts +0 -114
- package/dist/members/types.d.ts +0 -25
- package/dist/members/util.d.ts +0 -215
- package/dist/metrics/config.js +0 -276
- package/dist/metrics/config.js.map +0 -1
- package/dist/metrics/constants.d.ts +0 -70
- package/dist/metrics/index.d.ts +0 -45
- package/dist/multistream/mediaRequestManager.d.ts +0 -119
- package/dist/multistream/receiveSlot.d.ts +0 -68
- package/dist/multistream/receiveSlotManager.d.ts +0 -56
- package/dist/multistream/remoteMedia.d.ts +0 -72
- package/dist/multistream/remoteMediaGroup.d.ts +0 -49
- package/dist/multistream/remoteMediaManager.d.ts +0 -300
- package/dist/multistream/sendSlotManager.d.ts +0 -69
- package/dist/networkQualityMonitor/index.d.ts +0 -70
- package/dist/networkQualityMonitor/index.js +0 -221
- package/dist/networkQualityMonitor/index.js.map +0 -1
- package/dist/peer-connection-manager/index.js +0 -671
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -109
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/personal-meeting-room/index.d.ts +0 -47
- package/dist/personal-meeting-room/request.d.ts +0 -14
- package/dist/personal-meeting-room/util.d.ts +0 -2
- package/dist/reachability/clusterReachability.d.ts +0 -109
- package/dist/reachability/index.d.ts +0 -105
- package/dist/reachability/request.d.ts +0 -39
- package/dist/reachability/util.d.ts +0 -8
- package/dist/reactions/constants.d.ts +0 -3
- package/dist/reactions/reactions.d.ts +0 -4
- package/dist/reactions/reactions.type.d.ts +0 -52
- package/dist/reconnection-manager/index.d.ts +0 -136
- package/dist/recording-controller/enums.d.ts +0 -7
- package/dist/recording-controller/index.d.ts +0 -207
- package/dist/recording-controller/util.d.ts +0 -14
- package/dist/roap/collection.js +0 -62
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -275
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/index.d.ts +0 -86
- package/dist/roap/request.d.ts +0 -39
- package/dist/roap/state.js +0 -126
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/turnDiscovery.d.ts +0 -155
- package/dist/roap/util.js +0 -75
- package/dist/roap/util.js.map +0 -1
- package/dist/rtcMetrics/constants.d.ts +0 -4
- package/dist/rtcMetrics/constants.js +0 -11
- package/dist/rtcMetrics/constants.js.map +0 -1
- package/dist/rtcMetrics/index.d.ts +0 -61
- package/dist/rtcMetrics/index.js +0 -197
- package/dist/rtcMetrics/index.js.map +0 -1
- package/dist/statsAnalyzer/global.d.ts +0 -36
- package/dist/statsAnalyzer/global.js +0 -126
- package/dist/statsAnalyzer/global.js.map +0 -1
- package/dist/statsAnalyzer/index.d.ts +0 -217
- package/dist/statsAnalyzer/index.js +0 -1013
- package/dist/statsAnalyzer/index.js.map +0 -1
- package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/dist/statsAnalyzer/mqaUtil.js +0 -179
- package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
- package/dist/transcription/index.d.ts +0 -64
- package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
- package/dist/types/networkQualityMonitor/index.d.ts +0 -70
- package/dist/types/rtcMetrics/constants.d.ts +0 -4
- package/dist/types/rtcMetrics/index.d.ts +0 -71
- package/dist/types/statsAnalyzer/global.d.ts +0 -36
- package/dist/types/statsAnalyzer/index.d.ts +0 -217
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/dist/webinar/collection.d.ts +0 -16
- package/dist/webinar/index.d.ts +0 -5
package/src/member/util.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
IExternalRoles,
|
3
|
-
ParticipantWithRoles,
|
4
3
|
ServerRoles,
|
5
4
|
ServerRoleShape,
|
6
5
|
IMediaStatus,
|
7
|
-
|
6
|
+
Participant,
|
7
|
+
ParticipantUrl,
|
8
8
|
} from './types';
|
9
9
|
import {
|
10
10
|
_USER_,
|
@@ -27,381 +27,388 @@ import {
|
|
27
27
|
} from '../constants';
|
28
28
|
import ParameterError from '../common/errors/parameter';
|
29
29
|
|
30
|
-
const MemberUtil
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
return participant.canReclaimHostRole || false;
|
44
|
-
};
|
45
|
-
|
46
|
-
/**
|
47
|
-
* @param {Object} participant - The locus participant object.
|
48
|
-
* @returns {[ServerRoleShape]}
|
49
|
-
*/
|
50
|
-
MemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array<ServerRoleShape> =>
|
51
|
-
participant?.controls?.role?.roles;
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Checks if the participant has the brb status enabled.
|
55
|
-
*
|
56
|
-
* @param {ParticipantWithBrb} participant - The locus participant object.
|
57
|
-
* @returns {boolean} - True if the participant has brb enabled, false otherwise.
|
58
|
-
*/
|
59
|
-
MemberUtil.isBrb = (participant: ParticipantWithBrb): boolean =>
|
60
|
-
participant.controls?.brb?.enabled || false;
|
61
|
-
|
62
|
-
/**
|
63
|
-
* @param {Object} participant - The locus participant object.
|
64
|
-
* @param {ServerRoles} controlRole the search role
|
65
|
-
* @returns {Boolean}
|
66
|
-
*/
|
67
|
-
MemberUtil.hasRole = (participant: any, controlRole: ServerRoles): boolean =>
|
68
|
-
MemberUtil.getControlsRoles(participant)?.some(
|
69
|
-
(role) => role.type === controlRole && role.hasRole
|
70
|
-
);
|
71
|
-
|
72
|
-
/**
|
73
|
-
* @param {Object} participant - The locus participant object.
|
74
|
-
* @returns {Boolean}
|
75
|
-
*/
|
76
|
-
MemberUtil.hasCohost = (participant: ParticipantWithRoles): boolean =>
|
77
|
-
MemberUtil.hasRole(participant, ServerRoles.Cohost) || false;
|
78
|
-
|
79
|
-
/**
|
80
|
-
* @param {Object} participant - The locus participant object.
|
81
|
-
* @returns {Boolean}
|
82
|
-
*/
|
83
|
-
MemberUtil.hasModerator = (participant: ParticipantWithRoles): boolean =>
|
84
|
-
MemberUtil.hasRole(participant, ServerRoles.Moderator) || false;
|
85
|
-
|
86
|
-
/**
|
87
|
-
* @param {Object} participant - The locus participant object.
|
88
|
-
* @returns {Boolean}
|
89
|
-
*/
|
90
|
-
MemberUtil.hasPresenter = (participant: ParticipantWithRoles): boolean =>
|
91
|
-
MemberUtil.hasRole(participant, ServerRoles.Presenter) || false;
|
92
|
-
|
93
|
-
/**
|
94
|
-
* @param {Object} participant - The locus participant object.
|
95
|
-
* @returns {IExternalRoles}
|
96
|
-
*/
|
97
|
-
MemberUtil.extractControlRoles = (participant: ParticipantWithRoles): IExternalRoles => {
|
98
|
-
const roles = {
|
99
|
-
cohost: MemberUtil.hasCohost(participant),
|
100
|
-
moderator: MemberUtil.hasModerator(participant),
|
101
|
-
presenter: MemberUtil.hasPresenter(participant),
|
102
|
-
};
|
103
|
-
|
104
|
-
return roles;
|
105
|
-
};
|
30
|
+
const MemberUtil = {
|
31
|
+
/**
|
32
|
+
* @param {Object} participant - The locus participant object.
|
33
|
+
* @returns {Boolean}
|
34
|
+
*/
|
35
|
+
canReclaimHost: (participant) => {
|
36
|
+
if (!participant) {
|
37
|
+
throw new ParameterError(
|
38
|
+
'canReclaimHostRole could not be processed, participant is undefined.'
|
39
|
+
);
|
40
|
+
}
|
106
41
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
MemberUtil.
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
42
|
+
return participant.canReclaimHostRole || false;
|
43
|
+
},
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @param {Object} participant - The locus participant object.
|
47
|
+
* @returns {[ServerRoleShape]}
|
48
|
+
*/
|
49
|
+
getControlsRoles: (participant: Participant): Array<ServerRoleShape> =>
|
50
|
+
participant?.controls?.role?.roles,
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Checks if the participant has the brb status enabled.
|
54
|
+
*
|
55
|
+
* @param {Participant} participant - The locus participant object.
|
56
|
+
* @returns {boolean} - True if the participant has brb enabled, false otherwise.
|
57
|
+
*/
|
58
|
+
isBrb: (participant: Participant): boolean => participant.controls?.brb?.enabled || false,
|
59
|
+
|
60
|
+
/**
|
61
|
+
* @param {Object} participant - The locus participant object.
|
62
|
+
* @param {ServerRoles} controlRole the search role
|
63
|
+
* @returns {Boolean}
|
64
|
+
*/
|
65
|
+
hasRole: (participant: Participant, controlRole: ServerRoles): boolean =>
|
66
|
+
MemberUtil.getControlsRoles(participant)?.some(
|
67
|
+
(role) => role.type === controlRole && role.hasRole
|
68
|
+
),
|
69
|
+
|
70
|
+
/**
|
71
|
+
* @param {Object} participant - The locus participant object.
|
72
|
+
* @returns {Boolean}
|
73
|
+
*/
|
74
|
+
hasCohost: (participant: Participant): boolean =>
|
75
|
+
MemberUtil.hasRole(participant, ServerRoles.Cohost) || false,
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @param {Object} participant - The locus participant object.
|
79
|
+
* @returns {Boolean}
|
80
|
+
*/
|
81
|
+
hasModerator: (participant: Participant): boolean =>
|
82
|
+
MemberUtil.hasRole(participant, ServerRoles.Moderator) || false,
|
83
|
+
|
84
|
+
/**
|
85
|
+
* @param {Object} participant - The locus participant object.
|
86
|
+
* @returns {Boolean}
|
87
|
+
*/
|
88
|
+
hasPresenter: (participant: Participant): boolean =>
|
89
|
+
MemberUtil.hasRole(participant, ServerRoles.Presenter) || false,
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @param {Object} participant - The locus participant object.
|
93
|
+
* @returns {IExternalRoles}
|
94
|
+
*/
|
95
|
+
extractControlRoles: (participant: Participant): IExternalRoles => {
|
96
|
+
const roles = {
|
97
|
+
cohost: MemberUtil.hasCohost(participant),
|
98
|
+
moderator: MemberUtil.hasModerator(participant),
|
99
|
+
presenter: MemberUtil.hasPresenter(participant),
|
100
|
+
};
|
101
|
+
|
102
|
+
return roles;
|
103
|
+
},
|
104
|
+
|
105
|
+
/**
|
106
|
+
* @param {Object} participant - The locus participant object.
|
107
|
+
* @returns {Boolean}
|
108
|
+
*/
|
109
|
+
isUser: (participant: Participant) => participant && participant.type === _USER_,
|
110
|
+
|
111
|
+
isModerator: (participant: Participant) => participant && participant.moderator,
|
112
|
+
|
113
|
+
/**
|
114
|
+
* @param {Object} participant - The locus participant object.
|
115
|
+
* @returns {Boolean}
|
116
|
+
*/
|
117
|
+
isGuest: (participant: Participant) => participant && participant.guest,
|
118
|
+
|
119
|
+
/**
|
120
|
+
* @param {Object} participant - The locus participant object.
|
121
|
+
* @returns {Boolean}
|
122
|
+
*/
|
123
|
+
isDevice: (participant: Participant) => participant && participant.type === _RESOURCE_ROOM_,
|
124
|
+
|
125
|
+
isModeratorAssignmentProhibited: (participant: Participant) =>
|
126
|
+
participant && participant.moderatorAssignmentNotAllowed,
|
127
|
+
|
128
|
+
isPresenterAssignmentProhibited: (participant: Participant) =>
|
129
|
+
participant && participant.presenterAssignmentNotAllowed,
|
130
|
+
|
131
|
+
/**
|
132
|
+
* checks to see if the participant id is the same as the passed id
|
133
|
+
* there are multiple ids that can be used
|
134
|
+
* @param {Object} participant - The locus participant object.
|
135
|
+
* @param {String} id
|
136
|
+
* @returns {Boolean}
|
137
|
+
*/
|
138
|
+
isSame: (participant: Participant, id: string) =>
|
139
|
+
participant && (participant.id === id || (participant.person && participant.person.id === id)),
|
140
|
+
|
141
|
+
/**
|
142
|
+
* @param {Object} participant - The locus participant object.
|
143
|
+
* @param {Boolean} isGuest
|
144
|
+
* @param {String} status
|
145
|
+
* @returns {Boolean}
|
146
|
+
*/
|
147
|
+
isNotAdmitted: (participant: Participant, isGuest: boolean, status: string): boolean =>
|
148
|
+
participant &&
|
149
|
+
participant.guest &&
|
150
|
+
((participant.devices &&
|
151
|
+
participant.devices[0] &&
|
152
|
+
participant.devices[0].intent &&
|
153
|
+
participant.devices[0].intent.type === _WAIT_ &&
|
154
|
+
// @ts-ignore
|
155
|
+
isGuest &&
|
156
|
+
status === _IN_LOBBY_) ||
|
157
|
+
// @ts-ignore
|
158
|
+
!status === _IN_MEETING_),
|
159
|
+
|
160
|
+
/**
|
161
|
+
* @param {Object} participant - The locus participant object.
|
162
|
+
* @returns {Boolean}
|
163
|
+
*/
|
164
|
+
isAudioMuted: (participant: Participant) => {
|
165
|
+
if (!participant) {
|
166
|
+
throw new ParameterError('Audio could not be processed, participant is undefined.');
|
167
|
+
}
|
184
168
|
|
185
|
-
|
186
|
-
|
187
|
-
* @returns {Boolean}
|
188
|
-
*/
|
189
|
-
MemberUtil.isVideoMuted = (participant: any): boolean => {
|
190
|
-
if (!participant) {
|
191
|
-
throw new ParameterError('Video could not be processed, participant is undefined.');
|
192
|
-
}
|
169
|
+
return MemberUtil.isMuted(participant, AUDIO_STATUS, AUDIO);
|
170
|
+
},
|
193
171
|
|
194
|
-
|
195
|
-
}
|
172
|
+
/**
|
173
|
+
* @param {Object} participant - The locus participant object.
|
174
|
+
* @returns {Boolean}
|
175
|
+
*/
|
176
|
+
isVideoMuted: (participant: Participant): boolean => {
|
177
|
+
if (!participant) {
|
178
|
+
throw new ParameterError('Video could not be processed, participant is undefined.');
|
179
|
+
}
|
196
180
|
|
197
|
-
|
198
|
-
|
199
|
-
* @returns {Boolean}
|
200
|
-
*/
|
201
|
-
MemberUtil.isHandRaised = (participant: any) => {
|
202
|
-
if (!participant) {
|
203
|
-
throw new ParameterError('Raise hand could not be processed, participant is undefined.');
|
204
|
-
}
|
181
|
+
return MemberUtil.isMuted(participant, VIDEO_STATUS, VIDEO);
|
182
|
+
},
|
205
183
|
|
206
|
-
|
207
|
-
}
|
184
|
+
/**
|
185
|
+
* @param {Object} participant - The locus participant object.
|
186
|
+
* @returns {Boolean}
|
187
|
+
*/
|
188
|
+
isHandRaised: (participant: Participant) => {
|
189
|
+
if (!participant) {
|
190
|
+
throw new ParameterError('Raise hand could not be processed, participant is undefined.');
|
191
|
+
}
|
208
192
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
193
|
+
return participant.controls?.hand?.raised || false;
|
194
|
+
},
|
195
|
+
|
196
|
+
/**
|
197
|
+
* @param {Object} participant - The locus participant object.
|
198
|
+
* @returns {Boolean}
|
199
|
+
*/
|
200
|
+
isBreakoutsSupported: (participant) => {
|
201
|
+
if (!participant) {
|
202
|
+
throw new ParameterError(
|
203
|
+
'Breakout support could not be processed, participant is undefined.'
|
204
|
+
);
|
205
|
+
}
|
217
206
|
|
218
|
-
|
219
|
-
}
|
207
|
+
return !participant.doesNotSupportBreakouts;
|
208
|
+
},
|
209
|
+
|
210
|
+
/**
|
211
|
+
* @param {Object} participant - The locus participant object.
|
212
|
+
* @returns {Boolean}
|
213
|
+
*/
|
214
|
+
isInterpretationSupported: (participant) => {
|
215
|
+
if (!participant) {
|
216
|
+
throw new ParameterError(
|
217
|
+
'Interpretation support could not be processed, participant is undefined.'
|
218
|
+
);
|
219
|
+
}
|
220
220
|
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
)
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
}
|
221
|
+
return !participant.doesNotSupportSiInterpreter;
|
222
|
+
},
|
223
|
+
|
224
|
+
/**
|
225
|
+
* @param {Object} participant - The locus participant object.
|
226
|
+
* @returns {Boolean}
|
227
|
+
*/
|
228
|
+
isLiveAnnotationSupported: (participant) => {
|
229
|
+
if (!participant) {
|
230
|
+
throw new ParameterError(
|
231
|
+
'LiveAnnotation support could not be processed, participant is undefined.'
|
232
|
+
);
|
233
|
+
}
|
234
234
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
235
|
+
return !participant.annotatorAssignmentNotAllowed;
|
236
|
+
},
|
237
|
+
|
238
|
+
/**
|
239
|
+
* utility method for audio/video muted status
|
240
|
+
* @param {any} participant
|
241
|
+
* @param {String} statusAccessor
|
242
|
+
* @param {String} controlsAccessor
|
243
|
+
* @returns {Boolean | undefined}
|
244
|
+
*/
|
245
|
+
isMuted: (participant: Participant, statusAccessor: string, controlsAccessor: string) => {
|
246
|
+
// check remote mute
|
247
|
+
const remoteMute = participant?.controls?.[controlsAccessor]?.muted;
|
248
|
+
if (remoteMute === true) {
|
249
|
+
return true;
|
250
|
+
}
|
248
251
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
// check remote mute
|
258
|
-
const remoteMute = participant?.controls?.[controlsAccessor]?.muted;
|
259
|
-
if (remoteMute === true) {
|
260
|
-
return true;
|
261
|
-
}
|
262
|
-
|
263
|
-
// check local mute
|
264
|
-
const localStatus = participant?.status?.[statusAccessor];
|
265
|
-
if (localStatus === _RECEIVE_ONLY_) {
|
266
|
-
return true;
|
267
|
-
}
|
268
|
-
if (localStatus === _SEND_RECEIVE_) {
|
269
|
-
return false;
|
270
|
-
}
|
252
|
+
// check local mute
|
253
|
+
const localStatus = participant?.status?.[statusAccessor];
|
254
|
+
if (localStatus === _RECEIVE_ONLY_) {
|
255
|
+
return true;
|
256
|
+
}
|
257
|
+
if (localStatus === _SEND_RECEIVE_) {
|
258
|
+
return false;
|
259
|
+
}
|
271
260
|
|
272
|
-
|
273
|
-
}
|
261
|
+
return remoteMute;
|
262
|
+
},
|
263
|
+
|
264
|
+
/**
|
265
|
+
* utility method for getting the recording member for later comparison
|
266
|
+
* @param {Object} controls
|
267
|
+
* @returns {String|null}
|
268
|
+
*/
|
269
|
+
getRecordingMember: (controls: any) => {
|
270
|
+
if (!controls) {
|
271
|
+
return null;
|
272
|
+
}
|
273
|
+
if (controls.record && controls.record.recording && controls.record.meta) {
|
274
|
+
return controls.record.meta.modifiedBy;
|
275
|
+
}
|
274
276
|
|
275
|
-
/**
|
276
|
-
* utility method for getting the recording member for later comparison
|
277
|
-
* @param {Object} controls
|
278
|
-
* @returns {String|null}
|
279
|
-
*/
|
280
|
-
MemberUtil.getRecordingMember = (controls: any) => {
|
281
|
-
if (!controls) {
|
282
277
|
return null;
|
283
|
-
}
|
284
|
-
|
285
|
-
|
286
|
-
|
278
|
+
},
|
279
|
+
|
280
|
+
/**
|
281
|
+
* @param {Object} participant - The locus participant object.
|
282
|
+
* @returns {Boolean}
|
283
|
+
*/
|
284
|
+
isRecording: (participant: Participant) => {
|
285
|
+
if (!participant) {
|
286
|
+
throw new ParameterError('Recording could not be processed, participant is undefined.');
|
287
|
+
}
|
288
|
+
if (participant.controls && participant.controls.localRecord) {
|
289
|
+
return participant.controls.localRecord.recording;
|
290
|
+
}
|
287
291
|
|
288
|
-
|
289
|
-
}
|
292
|
+
return false;
|
293
|
+
},
|
290
294
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
}
|
302
|
-
|
303
|
-
return false;
|
304
|
-
};
|
295
|
+
isRemovable: (isSelf, isGuest, isInMeeting, type) => {
|
296
|
+
if (isGuest || isSelf) {
|
297
|
+
return false;
|
298
|
+
}
|
299
|
+
if (type === _CALL_) {
|
300
|
+
return false;
|
301
|
+
}
|
302
|
+
if (isInMeeting) {
|
303
|
+
return true;
|
304
|
+
}
|
305
305
|
|
306
|
-
MemberUtil.isRemovable = (isSelf, isGuest, isInMeeting, type) => {
|
307
|
-
if (isGuest || isSelf) {
|
308
306
|
return false;
|
309
|
-
}
|
310
|
-
if (type === _CALL_) {
|
311
|
-
return false;
|
312
|
-
}
|
313
|
-
if (isInMeeting) {
|
314
|
-
return true;
|
315
|
-
}
|
307
|
+
},
|
316
308
|
|
317
|
-
|
318
|
-
|
309
|
+
isMutable: (isSelf, isDevice, isInMeeting, isMuted, type) => {
|
310
|
+
if (!isInMeeting) {
|
311
|
+
return false;
|
312
|
+
}
|
313
|
+
if (isMuted) {
|
314
|
+
return false;
|
315
|
+
}
|
316
|
+
if (type === _CALL_) {
|
317
|
+
return false;
|
318
|
+
}
|
319
|
+
if (isSelf || isDevice) {
|
320
|
+
return true;
|
321
|
+
}
|
319
322
|
|
320
|
-
MemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => {
|
321
|
-
if (!isInMeeting) {
|
322
|
-
return false;
|
323
|
-
}
|
324
|
-
if (isMuted) {
|
325
|
-
return false;
|
326
|
-
}
|
327
|
-
if (type === _CALL_) {
|
328
323
|
return false;
|
329
|
-
}
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
324
|
+
},
|
325
|
+
|
326
|
+
/**
|
327
|
+
* @param {Object} participant - The locus participant object.
|
328
|
+
* @returns {String}
|
329
|
+
*/
|
330
|
+
extractStatus: (participant: Participant) => {
|
331
|
+
if (!(participant && participant.devices && participant.devices.length)) {
|
332
|
+
return _NOT_IN_MEETING_;
|
333
|
+
}
|
334
|
+
if (participant.state === _JOINED_) {
|
335
|
+
return _IN_MEETING_;
|
336
|
+
}
|
337
|
+
if (participant.state === _IDLE_) {
|
338
|
+
if (participant.devices && participant.devices.length > 0) {
|
339
|
+
const foundDevice = participant.devices.find(
|
340
|
+
(device) =>
|
341
|
+
device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_)
|
342
|
+
);
|
336
343
|
|
337
|
-
|
338
|
-
|
339
|
-
* @returns {String}
|
340
|
-
*/
|
341
|
-
MemberUtil.extractStatus = (participant: any) => {
|
342
|
-
if (!(participant && participant.devices && participant.devices.length)) {
|
343
|
-
return _NOT_IN_MEETING_;
|
344
|
-
}
|
345
|
-
if (participant.state === _JOINED_) {
|
346
|
-
return _IN_MEETING_;
|
347
|
-
}
|
348
|
-
if (participant.state === _IDLE_) {
|
349
|
-
if (participant.devices && participant.devices.length > 0) {
|
350
|
-
const foundDevice = participant.devices.find(
|
351
|
-
(device) =>
|
352
|
-
device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_)
|
353
|
-
);
|
344
|
+
return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;
|
345
|
+
}
|
354
346
|
|
355
|
-
return
|
347
|
+
return _NOT_IN_MEETING_;
|
348
|
+
}
|
349
|
+
if (participant.state === _LEFT_) {
|
350
|
+
return _NOT_IN_MEETING_;
|
356
351
|
}
|
357
352
|
|
358
353
|
return _NOT_IN_MEETING_;
|
359
|
-
}
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
* @returns {String}
|
370
|
-
*/
|
371
|
-
MemberUtil.extractId = (participant: any) => {
|
372
|
-
if (participant) {
|
373
|
-
return participant.id;
|
374
|
-
}
|
375
|
-
|
376
|
-
return null;
|
377
|
-
};
|
354
|
+
},
|
355
|
+
|
356
|
+
/**
|
357
|
+
* @param {Object} participant - The locus participant object.
|
358
|
+
* @returns {String}
|
359
|
+
*/
|
360
|
+
extractId: (participant: Participant) => {
|
361
|
+
if (participant) {
|
362
|
+
return participant.id;
|
363
|
+
}
|
378
364
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
video: participant.status?.videoStatus,
|
392
|
-
};
|
393
|
-
};
|
365
|
+
return null;
|
366
|
+
},
|
367
|
+
|
368
|
+
/**
|
369
|
+
* extracts the media status from nested participant object
|
370
|
+
* @param {Object} participant - The locus participant object.
|
371
|
+
* @returns {Object}
|
372
|
+
*/
|
373
|
+
extractMediaStatus: (participant: Participant): IMediaStatus => {
|
374
|
+
if (!participant) {
|
375
|
+
throw new ParameterError('Media status could not be extracted, participant is undefined.');
|
376
|
+
}
|
394
377
|
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
378
|
+
return {
|
379
|
+
audio: participant.status?.audioStatus,
|
380
|
+
video: participant.status?.videoStatus,
|
381
|
+
};
|
382
|
+
},
|
383
|
+
|
384
|
+
/**
|
385
|
+
* @param {Object} participant - The locus participant object.
|
386
|
+
* @returns {String}
|
387
|
+
*/
|
388
|
+
extractName: (participant: Participant) => {
|
389
|
+
if (participant && participant.person) {
|
390
|
+
return participant.person.name;
|
391
|
+
}
|
403
392
|
|
404
|
-
|
393
|
+
return null;
|
394
|
+
},
|
395
|
+
|
396
|
+
/**
|
397
|
+
* @param {Object} participant - The locus participant object.
|
398
|
+
* @returns {String}
|
399
|
+
*/
|
400
|
+
extractPairedWithParticipantUrl: (participant: Participant): ParticipantUrl | undefined => {
|
401
|
+
let participantUrl;
|
402
|
+
|
403
|
+
participant?.devices?.forEach((device) => {
|
404
|
+
device?.intents?.forEach((intent) => {
|
405
|
+
if (intent?.type === _OBSERVE_ && intent?.associatedWith) {
|
406
|
+
participantUrl = intent.associatedWith;
|
407
|
+
}
|
408
|
+
});
|
409
|
+
});
|
410
|
+
|
411
|
+
return participantUrl;
|
412
|
+
},
|
405
413
|
};
|
406
|
-
|
407
414
|
export default MemberUtil;
|