@webex/plugin-meetings 3.8.0 → 3.8.1-next.10

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