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