@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
@@ -9,367 +9,344 @@ exports.default = void 0;
9
9
  var _types = require("./types");
10
10
  var _constants = require("../constants");
11
11
  var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
12
- var MemberUtil = {};
13
-
14
- /**
15
- * @param {Object} participant - The locus participant object.
16
- * @returns {Boolean}
17
- */
18
- MemberUtil.canReclaimHost = function (participant) {
19
- if (!participant) {
20
- throw new _parameter.default('canReclaimHostRole could not be processed, participant is undefined.');
21
- }
22
- return participant.canReclaimHostRole || false;
23
- };
24
-
25
- /**
26
- * @param {Object} participant - The locus participant object.
27
- * @returns {[ServerRoleShape]}
28
- */
29
- MemberUtil.getControlsRoles = function (participant) {
30
- var _participant$controls, _participant$controls2;
31
- return participant === null || participant === void 0 ? void 0 : (_participant$controls = participant.controls) === null || _participant$controls === void 0 ? void 0 : (_participant$controls2 = _participant$controls.role) === null || _participant$controls2 === void 0 ? void 0 : _participant$controls2.roles;
32
- };
33
-
34
- /**
35
- * Checks if the participant has the brb status enabled.
36
- *
37
- * @param {ParticipantWithBrb} participant - The locus participant object.
38
- * @returns {boolean} - True if the participant has brb enabled, false otherwise.
39
- */
40
- MemberUtil.isBrb = function (participant) {
41
- var _participant$controls3, _participant$controls4;
42
- return ((_participant$controls3 = participant.controls) === null || _participant$controls3 === void 0 ? void 0 : (_participant$controls4 = _participant$controls3.brb) === null || _participant$controls4 === void 0 ? void 0 : _participant$controls4.enabled) || false;
43
- };
44
-
45
- /**
46
- * @param {Object} participant - The locus participant object.
47
- * @param {ServerRoles} controlRole the search role
48
- * @returns {Boolean}
49
- */
50
- MemberUtil.hasRole = function (participant, controlRole) {
51
- var _MemberUtil$getContro;
52
- return (_MemberUtil$getContro = MemberUtil.getControlsRoles(participant)) === null || _MemberUtil$getContro === void 0 ? void 0 : _MemberUtil$getContro.some(function (role) {
53
- return role.type === controlRole && role.hasRole;
54
- });
55
- };
56
-
57
- /**
58
- * @param {Object} participant - The locus participant object.
59
- * @returns {Boolean}
60
- */
61
- MemberUtil.hasCohost = function (participant) {
62
- return MemberUtil.hasRole(participant, _types.ServerRoles.Cohost) || false;
63
- };
64
-
65
- /**
66
- * @param {Object} participant - The locus participant object.
67
- * @returns {Boolean}
68
- */
69
- MemberUtil.hasModerator = function (participant) {
70
- return MemberUtil.hasRole(participant, _types.ServerRoles.Moderator) || false;
71
- };
72
-
73
- /**
74
- * @param {Object} participant - The locus participant object.
75
- * @returns {Boolean}
76
- */
77
- MemberUtil.hasPresenter = function (participant) {
78
- return MemberUtil.hasRole(participant, _types.ServerRoles.Presenter) || false;
79
- };
80
-
81
- /**
82
- * @param {Object} participant - The locus participant object.
83
- * @returns {IExternalRoles}
84
- */
85
- MemberUtil.extractControlRoles = function (participant) {
86
- var roles = {
87
- cohost: MemberUtil.hasCohost(participant),
88
- moderator: MemberUtil.hasModerator(participant),
89
- presenter: MemberUtil.hasPresenter(participant)
90
- };
91
- return roles;
92
- };
93
-
94
- /**
95
- * @param {Object} participant - The locus participant object.
96
- * @returns {Boolean}
97
- */
98
- MemberUtil.isUser = function (participant) {
99
- return participant && participant.type === _constants._USER_;
100
- };
101
- MemberUtil.isModerator = function (participant) {
102
- return participant && participant.moderator;
103
- };
104
-
105
- /**
106
- * @param {Object} participant - The locus participant object.
107
- * @returns {Boolean}
108
- */
109
- MemberUtil.isGuest = function (participant) {
110
- return participant && participant.guest;
111
- };
112
-
113
- /**
114
- * @param {Object} participant - The locus participant object.
115
- * @returns {Boolean}
116
- */
117
- MemberUtil.isDevice = function (participant) {
118
- return participant && participant.type === _constants._RESOURCE_ROOM_;
119
- };
120
- MemberUtil.isModeratorAssignmentProhibited = function (participant) {
121
- return participant && participant.moderatorAssignmentNotAllowed;
122
- };
123
-
124
- /**
125
- * checks to see if the participant id is the same as the passed id
126
- * there are multiple ids that can be used
127
- * @param {Object} participant - The locus participant object.
128
- * @param {String} id
129
- * @returns {Boolean}
130
- */
131
- MemberUtil.isSame = function (participant, id) {
132
- return participant && (participant.id === id || participant.person && participant.person.id === id);
133
- };
134
-
135
- /**
136
- * checks to see if the participant id is the same as the passed id for associated devices
137
- * there are multiple ids that can be used
138
- * @param {Object} participant - The locus participant object.
139
- * @param {String} id
140
- * @returns {Boolean}
141
- */
142
- MemberUtil.isAssociatedSame = function (participant, id) {
143
- return participant && participant.associatedUsers && participant.associatedUsers.some(function (user) {
144
- return user.id === id || user.person && user.person.id === id;
145
- });
146
- };
147
-
148
- /**
149
- * @param {Object} participant - The locus participant object.
150
- * @param {Boolean} isGuest
151
- * @param {String} status
152
- * @returns {Boolean}
153
- */
154
- MemberUtil.isNotAdmitted = function (participant, isGuest, status) {
155
- return participant && participant.guest && (participant.devices && participant.devices[0] && participant.devices[0].intent && participant.devices[0].intent.type === _constants._WAIT_ &&
156
- // @ts-ignore
157
- isGuest && status === _constants._IN_LOBBY_ ||
158
- // @ts-ignore
159
- !status === _constants._IN_MEETING_);
160
- };
161
-
162
- /**
163
- * @param {Object} participant - The locus participant object.
164
- * @returns {Boolean}
165
- */
166
- MemberUtil.isAudioMuted = function (participant) {
167
- if (!participant) {
168
- throw new _parameter.default('Audio could not be processed, participant is undefined.');
169
- }
170
- return MemberUtil.isMuted(participant, _constants.AUDIO_STATUS, _constants.AUDIO);
171
- };
172
-
173
- /**
174
- * @param {Object} participant - The locus participant object.
175
- * @returns {Boolean}
176
- */
177
- MemberUtil.isVideoMuted = function (participant) {
178
- if (!participant) {
179
- throw new _parameter.default('Video could not be processed, participant is undefined.');
180
- }
181
- return MemberUtil.isMuted(participant, _constants.VIDEO_STATUS, _constants.VIDEO);
182
- };
183
-
184
- /**
185
- * @param {Object} participant - The locus participant object.
186
- * @returns {Boolean}
187
- */
188
- MemberUtil.isHandRaised = function (participant) {
189
- var _participant$controls5, _participant$controls6;
190
- if (!participant) {
191
- throw new _parameter.default('Raise hand could not be processed, participant is undefined.');
192
- }
193
- return ((_participant$controls5 = participant.controls) === null || _participant$controls5 === void 0 ? void 0 : (_participant$controls6 = _participant$controls5.hand) === null || _participant$controls6 === void 0 ? void 0 : _participant$controls6.raised) || false;
194
- };
195
-
196
- /**
197
- * @param {Object} participant - The locus participant object.
198
- * @returns {Boolean}
199
- */
200
- MemberUtil.isBreakoutsSupported = function (participant) {
201
- if (!participant) {
202
- throw new _parameter.default('Breakout support could not be processed, participant is undefined.');
203
- }
204
- return !participant.doesNotSupportBreakouts;
205
- };
206
-
207
- /**
208
- * @param {Object} participant - The locus participant object.
209
- * @returns {Boolean}
210
- */
211
- MemberUtil.isInterpretationSupported = function (participant) {
212
- if (!participant) {
213
- throw new _parameter.default('Interpretation support could not be processed, participant is undefined.');
214
- }
215
- return !participant.doesNotSupportSiInterpreter;
216
- };
217
-
218
- /**
219
- * @param {Object} participant - The locus participant object.
220
- * @returns {Boolean}
221
- */
222
- MemberUtil.isLiveAnnotationSupported = function (participant) {
223
- if (!participant) {
224
- throw new _parameter.default('LiveAnnotation support could not be processed, participant is undefined.');
225
- }
226
- return !participant.annotatorAssignmentNotAllowed;
227
- };
228
-
229
- /**
230
- * utility method for audio/video muted status
231
- * @param {any} participant
232
- * @param {String} statusAccessor
233
- * @param {String} controlsAccessor
234
- * @returns {Boolean | undefined}
235
- */
236
- MemberUtil.isMuted = function (participant, statusAccessor, controlsAccessor) {
237
- var _participant$controls7, _participant$controls8, _participant$status;
238
- // check remote mute
239
- var remoteMute = participant === null || participant === void 0 ? void 0 : (_participant$controls7 = participant.controls) === null || _participant$controls7 === void 0 ? void 0 : (_participant$controls8 = _participant$controls7[controlsAccessor]) === null || _participant$controls8 === void 0 ? void 0 : _participant$controls8.muted;
240
- if (remoteMute === true) {
241
- return true;
242
- }
243
-
244
- // check local mute
245
- var localStatus = participant === null || participant === void 0 ? void 0 : (_participant$status = participant.status) === null || _participant$status === void 0 ? void 0 : _participant$status[statusAccessor];
246
- if (localStatus === _constants._RECEIVE_ONLY_) {
247
- return true;
248
- }
249
- if (localStatus === _constants._SEND_RECEIVE_) {
250
- return false;
251
- }
252
- return remoteMute;
253
- };
12
+ var MemberUtil = {
13
+ /**
14
+ * @param {Object} participant - The locus participant object.
15
+ * @returns {Boolean}
16
+ */
17
+ canReclaimHost: function canReclaimHost(participant) {
18
+ if (!participant) {
19
+ throw new _parameter.default('canReclaimHostRole could not be processed, participant is undefined.');
20
+ }
21
+ return participant.canReclaimHostRole || false;
22
+ },
23
+ /**
24
+ * @param {Object} participant - The locus participant object.
25
+ * @returns {[ServerRoleShape]}
26
+ */
27
+ getControlsRoles: function getControlsRoles(participant) {
28
+ var _participant$controls, _participant$controls2;
29
+ return participant === null || participant === void 0 ? void 0 : (_participant$controls = participant.controls) === null || _participant$controls === void 0 ? void 0 : (_participant$controls2 = _participant$controls.role) === null || _participant$controls2 === void 0 ? void 0 : _participant$controls2.roles;
30
+ },
31
+ /**
32
+ * Checks if the participant has the brb status enabled.
33
+ *
34
+ * @param {ParticipantWithBrb} participant - The locus participant object.
35
+ * @returns {boolean} - True if the participant has brb enabled, false otherwise.
36
+ */
37
+ isBrb: function isBrb(participant) {
38
+ var _participant$controls3, _participant$controls4;
39
+ return ((_participant$controls3 = participant.controls) === null || _participant$controls3 === void 0 ? void 0 : (_participant$controls4 = _participant$controls3.brb) === null || _participant$controls4 === void 0 ? void 0 : _participant$controls4.enabled) || false;
40
+ },
41
+ /**
42
+ * @param {Object} participant - The locus participant object.
43
+ * @param {ServerRoles} controlRole the search role
44
+ * @returns {Boolean}
45
+ */
46
+ hasRole: function hasRole(participant, controlRole) {
47
+ var _MemberUtil$getContro;
48
+ return (_MemberUtil$getContro = MemberUtil.getControlsRoles(participant)) === null || _MemberUtil$getContro === void 0 ? void 0 : _MemberUtil$getContro.some(function (role) {
49
+ return role.type === controlRole && role.hasRole;
50
+ });
51
+ },
52
+ /**
53
+ * @param {Object} participant - The locus participant object.
54
+ * @returns {Boolean}
55
+ */
56
+ hasCohost: function hasCohost(participant) {
57
+ return MemberUtil.hasRole(participant, _types.ServerRoles.Cohost) || false;
58
+ },
59
+ /**
60
+ * @param {Object} participant - The locus participant object.
61
+ * @returns {Boolean}
62
+ */
63
+ hasModerator: function hasModerator(participant) {
64
+ return MemberUtil.hasRole(participant, _types.ServerRoles.Moderator) || false;
65
+ },
66
+ /**
67
+ * @param {Object} participant - The locus participant object.
68
+ * @returns {Boolean}
69
+ */
70
+ hasPresenter: function hasPresenter(participant) {
71
+ return MemberUtil.hasRole(participant, _types.ServerRoles.Presenter) || false;
72
+ },
73
+ /**
74
+ * @param {Object} participant - The locus participant object.
75
+ * @returns {IExternalRoles}
76
+ */
77
+ extractControlRoles: function extractControlRoles(participant) {
78
+ var roles = {
79
+ cohost: MemberUtil.hasCohost(participant),
80
+ moderator: MemberUtil.hasModerator(participant),
81
+ presenter: MemberUtil.hasPresenter(participant)
82
+ };
83
+ return roles;
84
+ },
85
+ /**
86
+ * @param {Object} participant - The locus participant object.
87
+ * @returns {Boolean}
88
+ */
89
+ isUser: function isUser(participant) {
90
+ return participant && participant.type === _constants._USER_;
91
+ },
92
+ isModerator: function isModerator(participant) {
93
+ return participant && participant.moderator;
94
+ },
95
+ /**
96
+ * @param {Object} participant - The locus participant object.
97
+ * @returns {Boolean}
98
+ */
99
+ isGuest: function isGuest(participant) {
100
+ return participant && participant.guest;
101
+ },
102
+ /**
103
+ * @param {Object} participant - The locus participant object.
104
+ * @returns {Boolean}
105
+ */
106
+ isDevice: function isDevice(participant) {
107
+ return participant && participant.type === _constants._RESOURCE_ROOM_;
108
+ },
109
+ isModeratorAssignmentProhibited: function isModeratorAssignmentProhibited(participant) {
110
+ return participant && participant.moderatorAssignmentNotAllowed;
111
+ },
112
+ isPresenterAssignmentProhibited: function isPresenterAssignmentProhibited(participant) {
113
+ return participant && participant.presenterAssignmentNotAllowed;
114
+ },
115
+ /**
116
+ * checks to see if the participant id is the same as the passed id
117
+ * there are multiple ids that can be used
118
+ * @param {Object} participant - The locus participant object.
119
+ * @param {String} id
120
+ * @returns {Boolean}
121
+ */
122
+ isSame: function isSame(participant, id) {
123
+ return participant && (participant.id === id || participant.person && participant.person.id === id);
124
+ },
125
+ /**
126
+ * checks to see if the participant id is the same as the passed id for associated devices
127
+ * there are multiple ids that can be used
128
+ * @param {Object} participant - The locus participant object.
129
+ * @param {String} id
130
+ * @returns {Boolean}
131
+ */
132
+ isAssociatedSame: function isAssociatedSame(participant, id) {
133
+ return participant && participant.associatedUsers && participant.associatedUsers.some(function (user) {
134
+ return user.id === id || user.person && user.person.id === id;
135
+ });
136
+ },
137
+ /**
138
+ * @param {Object} participant - The locus participant object.
139
+ * @param {Boolean} isGuest
140
+ * @param {String} status
141
+ * @returns {Boolean}
142
+ */
143
+ isNotAdmitted: function isNotAdmitted(participant, isGuest, status) {
144
+ return participant && participant.guest && (participant.devices && participant.devices[0] && participant.devices[0].intent && participant.devices[0].intent.type === _constants._WAIT_ &&
145
+ // @ts-ignore
146
+ isGuest && status === _constants._IN_LOBBY_ ||
147
+ // @ts-ignore
148
+ !status === _constants._IN_MEETING_);
149
+ },
150
+ /**
151
+ * @param {Object} participant - The locus participant object.
152
+ * @returns {Boolean}
153
+ */
154
+ isAudioMuted: function isAudioMuted(participant) {
155
+ if (!participant) {
156
+ throw new _parameter.default('Audio could not be processed, participant is undefined.');
157
+ }
158
+ return MemberUtil.isMuted(participant, _constants.AUDIO_STATUS, _constants.AUDIO);
159
+ },
160
+ /**
161
+ * @param {Object} participant - The locus participant object.
162
+ * @returns {Boolean}
163
+ */
164
+ isVideoMuted: function isVideoMuted(participant) {
165
+ if (!participant) {
166
+ throw new _parameter.default('Video could not be processed, participant is undefined.');
167
+ }
168
+ return MemberUtil.isMuted(participant, _constants.VIDEO_STATUS, _constants.VIDEO);
169
+ },
170
+ /**
171
+ * @param {Object} participant - The locus participant object.
172
+ * @returns {Boolean}
173
+ */
174
+ isHandRaised: function isHandRaised(participant) {
175
+ var _participant$controls5, _participant$controls6;
176
+ if (!participant) {
177
+ throw new _parameter.default('Raise hand could not be processed, participant is undefined.');
178
+ }
179
+ return ((_participant$controls5 = participant.controls) === null || _participant$controls5 === void 0 ? void 0 : (_participant$controls6 = _participant$controls5.hand) === null || _participant$controls6 === void 0 ? void 0 : _participant$controls6.raised) || false;
180
+ },
181
+ /**
182
+ * @param {Object} participant - The locus participant object.
183
+ * @returns {Boolean}
184
+ */
185
+ isBreakoutsSupported: function isBreakoutsSupported(participant) {
186
+ if (!participant) {
187
+ throw new _parameter.default('Breakout support could not be processed, participant is undefined.');
188
+ }
189
+ return !participant.doesNotSupportBreakouts;
190
+ },
191
+ /**
192
+ * @param {Object} participant - The locus participant object.
193
+ * @returns {Boolean}
194
+ */
195
+ isInterpretationSupported: function isInterpretationSupported(participant) {
196
+ if (!participant) {
197
+ throw new _parameter.default('Interpretation support could not be processed, participant is undefined.');
198
+ }
199
+ return !participant.doesNotSupportSiInterpreter;
200
+ },
201
+ /**
202
+ * @param {Object} participant - The locus participant object.
203
+ * @returns {Boolean}
204
+ */
205
+ isLiveAnnotationSupported: function isLiveAnnotationSupported(participant) {
206
+ if (!participant) {
207
+ throw new _parameter.default('LiveAnnotation support could not be processed, participant is undefined.');
208
+ }
209
+ return !participant.annotatorAssignmentNotAllowed;
210
+ },
211
+ /**
212
+ * utility method for audio/video muted status
213
+ * @param {any} participant
214
+ * @param {String} statusAccessor
215
+ * @param {String} controlsAccessor
216
+ * @returns {Boolean | undefined}
217
+ */
218
+ isMuted: function isMuted(participant, statusAccessor, controlsAccessor) {
219
+ var _participant$controls7, _participant$controls8, _participant$status;
220
+ // check remote mute
221
+ var remoteMute = participant === null || participant === void 0 ? void 0 : (_participant$controls7 = participant.controls) === null || _participant$controls7 === void 0 ? void 0 : (_participant$controls8 = _participant$controls7[controlsAccessor]) === null || _participant$controls8 === void 0 ? void 0 : _participant$controls8.muted;
222
+ if (remoteMute === true) {
223
+ return true;
224
+ }
254
225
 
255
- /**
256
- * utility method for getting the recording member for later comparison
257
- * @param {Object} controls
258
- * @returns {String|null}
259
- */
260
- MemberUtil.getRecordingMember = function (controls) {
261
- if (!controls) {
226
+ // check local mute
227
+ var localStatus = participant === null || participant === void 0 ? void 0 : (_participant$status = participant.status) === null || _participant$status === void 0 ? void 0 : _participant$status[statusAccessor];
228
+ if (localStatus === _constants._RECEIVE_ONLY_) {
229
+ return true;
230
+ }
231
+ if (localStatus === _constants._SEND_RECEIVE_) {
232
+ return false;
233
+ }
234
+ return remoteMute;
235
+ },
236
+ /**
237
+ * utility method for getting the recording member for later comparison
238
+ * @param {Object} controls
239
+ * @returns {String|null}
240
+ */
241
+ getRecordingMember: function getRecordingMember(controls) {
242
+ if (!controls) {
243
+ return null;
244
+ }
245
+ if (controls.record && controls.record.recording && controls.record.meta) {
246
+ return controls.record.meta.modifiedBy;
247
+ }
262
248
  return null;
263
- }
264
- if (controls.record && controls.record.recording && controls.record.meta) {
265
- return controls.record.meta.modifiedBy;
266
- }
267
- return null;
268
- };
269
-
270
- /**
271
- * @param {Object} participant - The locus participant object.
272
- * @returns {Boolean}
273
- */
274
- MemberUtil.isRecording = function (participant) {
275
- if (!participant) {
276
- throw new _parameter.default('Recording could not be processed, participant is undefined.');
277
- }
278
- if (participant.controls && participant.controls.localRecord) {
279
- return participant.controls.localRecord.recording;
280
- }
281
- return false;
282
- };
283
- MemberUtil.isRemovable = function (isSelf, isGuest, isInMeeting, type) {
284
- if (isGuest || isSelf) {
285
- return false;
286
- }
287
- if (type === _constants._CALL_) {
288
- return false;
289
- }
290
- if (isInMeeting) {
291
- return true;
292
- }
293
- return false;
294
- };
295
- MemberUtil.isMutable = function (isSelf, isDevice, isInMeeting, isMuted, type) {
296
- if (!isInMeeting) {
249
+ },
250
+ /**
251
+ * @param {Object} participant - The locus participant object.
252
+ * @returns {Boolean}
253
+ */
254
+ isRecording: function isRecording(participant) {
255
+ if (!participant) {
256
+ throw new _parameter.default('Recording could not be processed, participant is undefined.');
257
+ }
258
+ if (participant.controls && participant.controls.localRecord) {
259
+ return participant.controls.localRecord.recording;
260
+ }
297
261
  return false;
298
- }
299
- if (isMuted) {
262
+ },
263
+ isRemovable: function isRemovable(isSelf, isGuest, isInMeeting, type) {
264
+ if (isGuest || isSelf) {
265
+ return false;
266
+ }
267
+ if (type === _constants._CALL_) {
268
+ return false;
269
+ }
270
+ if (isInMeeting) {
271
+ return true;
272
+ }
300
273
  return false;
301
- }
302
- if (type === _constants._CALL_) {
274
+ },
275
+ isMutable: function isMutable(isSelf, isDevice, isInMeeting, isMuted, type) {
276
+ if (!isInMeeting) {
277
+ return false;
278
+ }
279
+ if (isMuted) {
280
+ return false;
281
+ }
282
+ if (type === _constants._CALL_) {
283
+ return false;
284
+ }
285
+ if (isSelf || isDevice) {
286
+ return true;
287
+ }
303
288
  return false;
304
- }
305
- if (isSelf || isDevice) {
306
- return true;
307
- }
308
- return false;
309
- };
310
-
311
- /**
312
- * @param {Object} participant - The locus participant object.
313
- * @returns {String}
314
- */
315
- MemberUtil.extractStatus = function (participant) {
316
- if (!(participant && participant.devices && participant.devices.length)) {
317
- return _constants._NOT_IN_MEETING_;
318
- }
319
- if (participant.state === _constants._JOINED_) {
320
- return _constants._IN_MEETING_;
321
- }
322
- if (participant.state === _constants._IDLE_) {
323
- if (participant.devices && participant.devices.length > 0) {
324
- var foundDevice = participant.devices.find(function (device) {
325
- return device.intent && (device.intent.type === _constants._WAIT_ || device.intent.type === _constants._OBSERVE_);
326
- });
327
- return foundDevice ? _constants._IN_LOBBY_ : _constants._NOT_IN_MEETING_;
289
+ },
290
+ /**
291
+ * @param {Object} participant - The locus participant object.
292
+ * @returns {String}
293
+ */
294
+ extractStatus: function extractStatus(participant) {
295
+ if (!(participant && participant.devices && participant.devices.length)) {
296
+ return _constants._NOT_IN_MEETING_;
297
+ }
298
+ if (participant.state === _constants._JOINED_) {
299
+ return _constants._IN_MEETING_;
300
+ }
301
+ if (participant.state === _constants._IDLE_) {
302
+ if (participant.devices && participant.devices.length > 0) {
303
+ var foundDevice = participant.devices.find(function (device) {
304
+ return device.intent && (device.intent.type === _constants._WAIT_ || device.intent.type === _constants._OBSERVE_);
305
+ });
306
+ return foundDevice ? _constants._IN_LOBBY_ : _constants._NOT_IN_MEETING_;
307
+ }
308
+ return _constants._NOT_IN_MEETING_;
309
+ }
310
+ if (participant.state === _constants._LEFT_) {
311
+ return _constants._NOT_IN_MEETING_;
328
312
  }
329
313
  return _constants._NOT_IN_MEETING_;
314
+ },
315
+ /**
316
+ * @param {Object} participant - The locus participant object.
317
+ * @returns {String}
318
+ */
319
+ extractId: function extractId(participant) {
320
+ if (participant) {
321
+ return participant.id;
322
+ }
323
+ return null;
324
+ },
325
+ /**
326
+ * extracts the media status from nested participant object
327
+ * @param {Object} participant - The locus participant object.
328
+ * @returns {Object}
329
+ */
330
+ extractMediaStatus: function extractMediaStatus(participant) {
331
+ var _participant$status2, _participant$status3;
332
+ if (!participant) {
333
+ throw new _parameter.default('Media status could not be extracted, participant is undefined.');
334
+ }
335
+ return {
336
+ audio: (_participant$status2 = participant.status) === null || _participant$status2 === void 0 ? void 0 : _participant$status2.audioStatus,
337
+ video: (_participant$status3 = participant.status) === null || _participant$status3 === void 0 ? void 0 : _participant$status3.videoStatus
338
+ };
339
+ },
340
+ /**
341
+ * @param {Object} participant - The locus participant object.
342
+ * @returns {String}
343
+ */
344
+ extractName: function extractName(participant) {
345
+ if (participant && participant.person) {
346
+ return participant.person.name;
347
+ }
348
+ return null;
330
349
  }
331
- if (participant.state === _constants._LEFT_) {
332
- return _constants._NOT_IN_MEETING_;
333
- }
334
- return _constants._NOT_IN_MEETING_;
335
- };
336
-
337
- /**
338
- * @param {Object} participant - The locus participant object.
339
- * @returns {String}
340
- */
341
- MemberUtil.extractId = function (participant) {
342
- if (participant) {
343
- return participant.id;
344
- }
345
- return null;
346
- };
347
-
348
- /**
349
- * extracts the media status from nested participant object
350
- * @param {Object} participant - The locus participant object.
351
- * @returns {Object}
352
- */
353
- MemberUtil.extractMediaStatus = function (participant) {
354
- var _participant$status2, _participant$status3;
355
- if (!participant) {
356
- throw new _parameter.default('Media status could not be extracted, participant is undefined.');
357
- }
358
- return {
359
- audio: (_participant$status2 = participant.status) === null || _participant$status2 === void 0 ? void 0 : _participant$status2.audioStatus,
360
- video: (_participant$status3 = participant.status) === null || _participant$status3 === void 0 ? void 0 : _participant$status3.videoStatus
361
- };
362
- };
363
-
364
- /**
365
- * @param {Object} participant - The locus participant object.
366
- * @returns {String}
367
- */
368
- MemberUtil.extractName = function (participant) {
369
- if (participant && participant.person) {
370
- return participant.person.name;
371
- }
372
- return null;
373
350
  };
374
351
  var _default = exports.default = MemberUtil;
375
352
  //# sourceMappingURL=util.js.map