@webex/plugin-meetings 3.8.0-web-workers-keepalive.1 → 3.8.1-next.1

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