@webex/plugin-meetings 3.12.0-next.12 → 3.12.0-next.121

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 (227) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/events.js +29 -14
  7. package/dist/breakouts/events.js.map +1 -1
  8. package/dist/breakouts/index.js +90 -3
  9. package/dist/breakouts/index.js.map +1 -1
  10. package/dist/common/errors/webex-errors.js +49 -5
  11. package/dist/common/errors/webex-errors.js.map +1 -1
  12. package/dist/config.js +2 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/constants.js +37 -10
  15. package/dist/constants.js.map +1 -1
  16. package/dist/controls-options-manager/index.js +46 -10
  17. package/dist/controls-options-manager/index.js.map +1 -1
  18. package/dist/hashTree/constants.js +4 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +1045 -393
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +20 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  27. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  28. package/dist/interceptors/locusRetry.js +23 -8
  29. package/dist/interceptors/locusRetry.js.map +1 -1
  30. package/dist/interpretation/index.js +10 -1
  31. package/dist/interpretation/index.js.map +1 -1
  32. package/dist/interpretation/interpretation.types.js +7 -0
  33. package/dist/interpretation/interpretation.types.js.map +1 -0
  34. package/dist/interpretation/siLanguage.js +1 -1
  35. package/dist/locus-info/controlsUtils.js +4 -1
  36. package/dist/locus-info/controlsUtils.js.map +1 -1
  37. package/dist/locus-info/index.js +406 -121
  38. package/dist/locus-info/index.js.map +1 -1
  39. package/dist/locus-info/infoUtils.js +36 -5
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/types.js +19 -0
  42. package/dist/locus-info/types.js.map +1 -1
  43. package/dist/media/MediaConnectionAwaiter.js +15 -2
  44. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  45. package/dist/media/index.js +8 -2
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/properties.js +4 -5
  48. package/dist/media/properties.js.map +1 -1
  49. package/dist/meeting/in-meeting-actions.js +5 -1
  50. package/dist/meeting/in-meeting-actions.js.map +1 -1
  51. package/dist/meeting/index.js +1667 -834
  52. package/dist/meeting/index.js.map +1 -1
  53. package/dist/meeting/locusMediaRequest.js +229 -82
  54. package/dist/meeting/locusMediaRequest.js.map +1 -1
  55. package/dist/meeting/muteState.js +10 -1
  56. package/dist/meeting/muteState.js.map +1 -1
  57. package/dist/meeting/request.js +5 -2
  58. package/dist/meeting/request.js.map +1 -1
  59. package/dist/meeting/util.js +34 -2
  60. package/dist/meeting/util.js.map +1 -1
  61. package/dist/meeting-info/meeting-info-v2.js +2 -2
  62. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  63. package/dist/meetings/index.js +256 -118
  64. package/dist/meetings/index.js.map +1 -1
  65. package/dist/meetings/meetings.types.js +6 -1
  66. package/dist/meetings/meetings.types.js.map +1 -1
  67. package/dist/meetings/request.js +39 -0
  68. package/dist/meetings/request.js.map +1 -1
  69. package/dist/meetings/util.js +116 -18
  70. package/dist/meetings/util.js.map +1 -1
  71. package/dist/member/index.js +10 -0
  72. package/dist/member/index.js.map +1 -1
  73. package/dist/member/types.js.map +1 -1
  74. package/dist/member/util.js +30 -0
  75. package/dist/member/util.js.map +1 -1
  76. package/dist/members/index.js +101 -43
  77. package/dist/members/index.js.map +1 -1
  78. package/dist/members/util.js +8 -1
  79. package/dist/members/util.js.map +1 -1
  80. package/dist/metrics/constants.js +7 -1
  81. package/dist/metrics/constants.js.map +1 -1
  82. package/dist/multistream/codec/constants.js +63 -0
  83. package/dist/multistream/codec/constants.js.map +1 -0
  84. package/dist/multistream/mediaRequestManager.js +62 -15
  85. package/dist/multistream/mediaRequestManager.js.map +1 -1
  86. package/dist/multistream/receiveSlot.js +9 -0
  87. package/dist/multistream/receiveSlot.js.map +1 -1
  88. package/dist/reachability/clusterReachability.js.map +1 -1
  89. package/dist/reachability/index.js +121 -83
  90. package/dist/reachability/index.js.map +1 -1
  91. package/dist/reachability/reachability.types.js +2 -0
  92. package/dist/reachability/reachability.types.js.map +1 -1
  93. package/dist/reachability/util.js +45 -0
  94. package/dist/reachability/util.js.map +1 -1
  95. package/dist/reactions/reactions.type.js.map +1 -1
  96. package/dist/recording-controller/index.js +1 -3
  97. package/dist/recording-controller/index.js.map +1 -1
  98. package/dist/roap/turnDiscovery.js +8 -1
  99. package/dist/roap/turnDiscovery.js.map +1 -1
  100. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  101. package/dist/types/config.d.ts +2 -2
  102. package/dist/types/constants.d.ts +13 -1
  103. package/dist/types/controls-options-manager/index.d.ts +16 -0
  104. package/dist/types/hashTree/constants.d.ts +1 -0
  105. package/dist/types/hashTree/hashTreeParser.d.ts +189 -22
  106. package/dist/types/hashTree/utils.d.ts +7 -0
  107. package/dist/types/index.d.ts +3 -0
  108. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  109. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  110. package/dist/types/locus-info/index.d.ts +61 -7
  111. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  112. package/dist/types/locus-info/types.d.ts +21 -1
  113. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  114. package/dist/types/media/properties.d.ts +6 -2
  115. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  116. package/dist/types/meeting/index.d.ts +175 -11
  117. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  118. package/dist/types/meeting/request.d.ts +1 -0
  119. package/dist/types/meeting/util.d.ts +9 -0
  120. package/dist/types/meetings/index.d.ts +38 -18
  121. package/dist/types/meetings/meetings.types.d.ts +15 -0
  122. package/dist/types/meetings/request.d.ts +14 -0
  123. package/dist/types/member/index.d.ts +1 -0
  124. package/dist/types/member/types.d.ts +1 -0
  125. package/dist/types/member/util.d.ts +9 -0
  126. package/dist/types/members/index.d.ts +15 -2
  127. package/dist/types/members/util.d.ts +1 -5
  128. package/dist/types/metrics/constants.d.ts +6 -0
  129. package/dist/types/multistream/codec/constants.d.ts +7 -0
  130. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  131. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  132. package/dist/types/reachability/index.d.ts +10 -3
  133. package/dist/types/reachability/reachability.types.d.ts +7 -0
  134. package/dist/types/reachability/util.d.ts +17 -0
  135. package/dist/types/reactions/reactions.type.d.ts +3 -0
  136. package/dist/webinar/index.js +307 -161
  137. package/dist/webinar/index.js.map +1 -1
  138. package/package.json +23 -23
  139. package/src/aiEnableRequest/index.ts +16 -0
  140. package/src/breakouts/breakout.ts +3 -1
  141. package/src/breakouts/events.ts +33 -11
  142. package/src/breakouts/index.ts +110 -1
  143. package/src/common/errors/webex-errors.ts +50 -3
  144. package/src/config.ts +2 -2
  145. package/src/constants.ts +21 -3
  146. package/src/controls-options-manager/index.ts +62 -10
  147. package/src/hashTree/constants.ts +7 -0
  148. package/src/hashTree/hashTreeParser.ts +796 -192
  149. package/src/hashTree/utils.ts +19 -0
  150. package/src/index.ts +6 -0
  151. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  152. package/src/interceptors/locusRetry.ts +25 -4
  153. package/src/interpretation/index.ts +27 -9
  154. package/src/interpretation/interpretation.types.ts +11 -0
  155. package/src/locus-info/controlsUtils.ts +3 -1
  156. package/src/locus-info/index.ts +412 -130
  157. package/src/locus-info/infoUtils.ts +41 -6
  158. package/src/locus-info/types.ts +25 -1
  159. package/src/media/MediaConnectionAwaiter.ts +21 -4
  160. package/src/media/index.ts +10 -1
  161. package/src/media/properties.ts +8 -3
  162. package/src/meeting/in-meeting-actions.ts +8 -0
  163. package/src/meeting/index.ts +922 -116
  164. package/src/meeting/locusMediaRequest.ts +106 -6
  165. package/src/meeting/muteState.ts +10 -1
  166. package/src/meeting/request.ts +11 -0
  167. package/src/meeting/util.ts +46 -5
  168. package/src/meeting-info/meeting-info-v2.ts +4 -2
  169. package/src/meetings/index.ts +168 -79
  170. package/src/meetings/meetings.types.ts +19 -0
  171. package/src/meetings/request.ts +43 -0
  172. package/src/meetings/util.ts +117 -4
  173. package/src/member/index.ts +10 -0
  174. package/src/member/types.ts +1 -0
  175. package/src/member/util.ts +29 -0
  176. package/src/members/index.ts +70 -7
  177. package/src/members/util.ts +12 -4
  178. package/src/metrics/constants.ts +6 -0
  179. package/src/multistream/codec/constants.ts +58 -0
  180. package/src/multistream/mediaRequestManager.ts +119 -28
  181. package/src/multistream/receiveSlot.ts +18 -0
  182. package/src/reachability/clusterReachability.ts +3 -2
  183. package/src/reachability/index.ts +47 -16
  184. package/src/reachability/reachability.types.ts +11 -0
  185. package/src/reachability/util.ts +36 -0
  186. package/src/reactions/reactions.type.ts +3 -0
  187. package/src/recording-controller/index.ts +1 -2
  188. package/src/roap/turnDiscovery.ts +9 -1
  189. package/src/webinar/index.ts +216 -38
  190. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  191. package/test/unit/spec/breakouts/breakout.ts +9 -3
  192. package/test/unit/spec/breakouts/events.ts +120 -2
  193. package/test/unit/spec/breakouts/index.ts +191 -2
  194. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  195. package/test/unit/spec/controls-options-manager/index.js +139 -32
  196. package/test/unit/spec/hashTree/hashTreeParser.ts +2299 -243
  197. package/test/unit/spec/hashTree/utils.ts +37 -0
  198. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  199. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  200. package/test/unit/spec/interpretation/index.ts +26 -4
  201. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  202. package/test/unit/spec/locus-info/index.js +643 -63
  203. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  204. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  205. package/test/unit/spec/media/index.ts +92 -0
  206. package/test/unit/spec/media/properties.ts +23 -23
  207. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  208. package/test/unit/spec/meeting/index.js +2704 -135
  209. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  210. package/test/unit/spec/meeting/muteState.js +81 -0
  211. package/test/unit/spec/meeting/request.js +12 -0
  212. package/test/unit/spec/meeting/utils.js +153 -1
  213. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  214. package/test/unit/spec/meetings/index.js +479 -48
  215. package/test/unit/spec/meetings/request.js +141 -0
  216. package/test/unit/spec/meetings/utils.js +402 -51
  217. package/test/unit/spec/member/index.js +7 -0
  218. package/test/unit/spec/member/util.js +89 -0
  219. package/test/unit/spec/members/index.js +216 -0
  220. package/test/unit/spec/members/request.js +37 -1
  221. package/test/unit/spec/members/utils.js +63 -0
  222. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  223. package/test/unit/spec/reachability/index.ts +128 -46
  224. package/test/unit/spec/reachability/util.ts +31 -0
  225. package/test/unit/spec/recording-controller/index.js +9 -8
  226. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  227. package/test/unit/spec/webinar/index.ts +332 -31
@@ -7,8 +7,7 @@ import sinon from 'sinon';
7
7
  import MockWebex from '@webex/test-helper-mock-webex';
8
8
  import testUtils from '../../../utils/testUtils';
9
9
  import BreakoutEditLockedError from '@webex/plugin-meetings/src/breakouts/edit-lock-error';
10
- import breakoutEvent from '../../../../src/breakouts/events';
11
-
10
+ import breakoutEvent from '../../../../src/breakouts/events'
12
11
  const getBOResponse = (status: string) => {
13
12
  return {
14
13
  url: 'url',
@@ -217,6 +216,21 @@ describe('plugin-meetings', () => {
217
216
  });
218
217
  assert.calledThrice(breakouts.queryPreAssignments);
219
218
  });
219
+
220
+ it('wires LLM_CONNECT_RESPONSE to handleLLMBreakoutJoinResponseMetric', () => {
221
+ const handleStub = sinon.stub(Breakouts.prototype, 'handleLLMBreakoutJoinResponseMetric');
222
+ const bo = new Breakouts({}, {parent: webex});
223
+
224
+ const eventInfo = {
225
+ meeting: {id: 'meeting-id'},
226
+ llmLatency: {clientLLMWebSocketConnectTime: 1},
227
+ };
228
+ bo.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, eventInfo);
229
+
230
+ assert.calledOnceWithExactly(handleStub, eventInfo);
231
+
232
+ handleStub.restore();
233
+ });
220
234
  });
221
235
 
222
236
  describe('#listenToCurrentSessionTypeChange', () => {
@@ -313,6 +327,7 @@ describe('plugin-meetings', () => {
313
327
  groupId: 'groupId',
314
328
  sessionType: 'sessionType',
315
329
  url: 'url',
330
+ resourceLink: 'resource-link',
316
331
  name: 'name',
317
332
  allowBackToMain: true,
318
333
  delayCloseTime: 10,
@@ -339,6 +354,7 @@ describe('plugin-meetings', () => {
339
354
  assert.equal(breakouts.currentBreakoutSession.current, true);
340
355
  assert.equal(breakouts.currentBreakoutSession.sessionType, 'sessionType');
341
356
  assert.equal(breakouts.currentBreakoutSession.url, 'url');
357
+ assert.equal(breakouts.currentBreakoutSession.resourceLink, 'resource-link');
342
358
  assert.equal(breakouts.currentBreakoutSession.active, false);
343
359
  assert.equal(breakouts.currentBreakoutSession.allowed, false);
344
360
  assert.equal(breakouts.currentBreakoutSession.assigned, false);
@@ -372,6 +388,27 @@ describe('plugin-meetings', () => {
372
388
  assert.calledOnce(breakouts.clearBreakouts);
373
389
  });
374
390
 
391
+ it('preserves the last non-empty breakoutMoveId when a later update omits it', () => {
392
+ breakouts.updateBreakout({
393
+ sessionId: 'sessionId',
394
+ groupId: 'groupId',
395
+ sessionType: 'BREAKOUT',
396
+ status: 'active',
397
+ breakoutMoveId: 'move-id-1',
398
+ });
399
+ assert.equal(breakouts.breakoutMoveId, 'move-id-1');
400
+
401
+ // a later controls update arrives without a replaces entry -> null move id
402
+ breakouts.updateBreakout({
403
+ sessionId: 'sessionId',
404
+ groupId: 'groupId',
405
+ sessionType: 'BREAKOUT',
406
+ status: 'active',
407
+ breakoutMoveId: null,
408
+ });
409
+ assert.equal(breakouts.breakoutMoveId, 'move-id-1');
410
+ });
411
+
375
412
  it('updates the current breakout session, call onBreakoutJoinResponse when session changed', () => {
376
413
  breakouts.webex.meetings = {
377
414
  getMeetingByType: sinon.stub().returns({
@@ -429,6 +466,111 @@ describe('plugin-meetings', () => {
429
466
  });
430
467
  });
431
468
 
469
+ describe('#submitLLMBreakoutJoinResponseMetric', () => {
470
+ let onBreakoutJoinResponseSpy;
471
+
472
+ const setupReadyToEmit = () => {
473
+ breakouts.webex.meetings = {
474
+ getMeetingByType: sinon.stub().returns({id: 'meeting-id'}),
475
+ };
476
+ breakouts.webex.internal.newMetrics = {submitClientEvent: sinon.stub()};
477
+ breakouts.webex.internal.llm.getWebSocketUrl = sinon.stub().returns('wss://llm');
478
+ breakouts.breakoutMoveId = 'moveId';
479
+ breakouts.currentBreakoutSession.set({sessionId: 'sessionId', groupId: 'groupId'});
480
+ breakouts.llmBreakoutJoinResponseInfo = {
481
+ breakoutMoveId: 'moveId',
482
+ meeting: {id: 'meeting-id'},
483
+ llmLatency: {clientLLMWebSocketConnectTime: 1},
484
+ };
485
+ };
486
+
487
+ beforeEach(() => {
488
+ onBreakoutJoinResponseSpy = sinon.stub(breakoutEvent, 'onBreakoutJoinResponse');
489
+ });
490
+
491
+ afterEach(() => {
492
+ onBreakoutJoinResponseSpy.restore();
493
+ });
494
+
495
+ it('emits the join response while an active breakout is in progress', () => {
496
+ setupReadyToEmit();
497
+ breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.BREAKOUT);
498
+ breakouts.set('status', BREAKOUTS.STATUS.OPEN);
499
+
500
+ breakouts.submitLLMBreakoutJoinResponseMetric();
501
+
502
+ assert.calledOnce(onBreakoutJoinResponseSpy);
503
+ const eventInfoArg = onBreakoutJoinResponseSpy.getCall(0).args[0];
504
+ assert.equal(eventInfoArg.breakoutMoveId, 'moveId');
505
+ assert.deepEqual(eventInfoArg.llmLatency, {clientLLMWebSocketConnectTime: 1});
506
+ assert.equal(eventInfoArg.llmWebsocketUrl, 'wss://llm');
507
+ assert.equal(eventInfoArg.meeting.id, 'meeting-id');
508
+ assert.equal(eventInfoArg.currentSession.sessionId, 'sessionId');
509
+ assert.equal(eventInfoArg.currentSession.groupId, 'groupId');
510
+ assert.isUndefined(eventInfoArg.error);
511
+ assert.isUndefined(breakouts.llmBreakoutJoinResponseInfo);
512
+ });
513
+
514
+ it('emits the join response after returning to the main session', () => {
515
+ setupReadyToEmit();
516
+ breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
517
+ breakouts.currentBreakoutSession.set({sessionType: BREAKOUTS.SESSION_TYPES.MAIN});
518
+
519
+ breakouts.submitLLMBreakoutJoinResponseMetric();
520
+
521
+ assert.calledOnce(onBreakoutJoinResponseSpy);
522
+ const eventInfoArg = onBreakoutJoinResponseSpy.getCall(0).args[0];
523
+ assert.equal(eventInfoArg.breakoutMoveId, 'moveId');
524
+ assert.deepEqual(eventInfoArg.llmLatency, {clientLLMWebSocketConnectTime: 1});
525
+ assert.equal(eventInfoArg.llmWebsocketUrl, 'wss://llm');
526
+ assert.equal(eventInfoArg.meeting.id, 'meeting-id');
527
+ assert.equal(eventInfoArg.currentSession.sessionId, 'sessionId');
528
+ assert.equal(eventInfoArg.currentSession.groupId, 'groupId');
529
+ assert.isUndefined(eventInfoArg.error);
530
+ assert.isUndefined(breakouts.llmBreakoutJoinResponseInfo);
531
+ });
532
+
533
+ it('does not emit without a breakoutMoveId (non-breakout meeting)', () => {
534
+ setupReadyToEmit();
535
+ breakouts.breakoutMoveId = undefined;
536
+ breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
537
+
538
+ breakouts.submitLLMBreakoutJoinResponseMetric();
539
+
540
+ assert.notCalled(onBreakoutJoinResponseSpy);
541
+ });
542
+
543
+ it('does not emit when the LLM latency belongs to a different move id', () => {
544
+ setupReadyToEmit();
545
+ breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
546
+ breakouts.llmBreakoutJoinResponseInfo.breakoutMoveId = 'staleMoveId';
547
+
548
+ breakouts.submitLLMBreakoutJoinResponseMetric();
549
+
550
+ assert.notCalled(onBreakoutJoinResponseSpy);
551
+ });
552
+ });
553
+
554
+ describe('#handleLLMBreakoutJoinResponseMetric', () => {
555
+ it('stores the LLM connect response with the current breakoutMoveId and tries to emit', () => {
556
+ breakouts.breakoutMoveId = 'moveId';
557
+ breakouts.submitLLMBreakoutJoinResponseMetric = sinon.stub();
558
+
559
+ const eventInfo = {
560
+ meeting: {id: 'meeting-id'},
561
+ llmLatency: {clientLLMWebSocketConnectTime: 1},
562
+ };
563
+
564
+ breakouts.handleLLMBreakoutJoinResponseMetric(eventInfo);
565
+
566
+ assert.deepEqual(breakouts.llmBreakoutJoinResponseInfo, {
567
+ ...eventInfo,
568
+ breakoutMoveId: 'moveId',
569
+ });
570
+ assert.calledOnce(breakouts.submitLLMBreakoutJoinResponseMetric);
571
+ });
572
+ });
573
+
432
574
  describe('#updateBreakoutSessions', () => {
433
575
  const checkBreakout = (breakout, sessionId, state) => {
434
576
  assert.deepEqual(breakout.attributes, {
@@ -1847,6 +1989,53 @@ describe('plugin-meetings', () => {
1847
1989
  });
1848
1990
  });
1849
1991
 
1992
+ describe('#removeFromBreakout', () => {
1993
+ it('should make a POST request with correct body and return the result', async () => {
1994
+ breakouts.request = sinon.stub().returns(Promise.resolve('REQUEST_RETURN_VALUE'));
1995
+ breakouts.set('url', 'url');
1996
+ breakouts.set('mainGroupId', 'mainGroupId');
1997
+ breakouts.set('mainSessionId', 'mainSessionId');
1998
+
1999
+ const participants = ['participant1', 'participant2'];
2000
+ const result = await breakouts.removeFromBreakout(participants);
2001
+
2002
+ assert.calledOnceWithExactly(breakouts.request, {
2003
+ method: 'POST',
2004
+ uri: 'url/move',
2005
+ body: {
2006
+ groups: [
2007
+ {
2008
+ id: 'mainGroupId',
2009
+ sessions: [
2010
+ {
2011
+ id: 'mainSessionId',
2012
+ participants,
2013
+ },
2014
+ ],
2015
+ },
2016
+ ],
2017
+ },
2018
+ });
2019
+ assert.equal(result, 'REQUEST_RETURN_VALUE');
2020
+ });
2021
+
2022
+ it('should throw an error if mainGroupId is missing', () => {
2023
+ breakouts.set('mainSessionId', 'mainSessionId');
2024
+ assert.throws(
2025
+ () => breakouts.removeFromBreakout(['participant1']),
2026
+ 'Main group ID and session ID must be available to remove participants from breakout'
2027
+ );
2028
+ });
2029
+
2030
+ it('should throw an error if mainSessionId is missing', () => {
2031
+ breakouts.set('mainGroupId', 'mainGroupId');
2032
+ assert.throws(
2033
+ () => breakouts.removeFromBreakout(['participant1']),
2034
+ 'Main group ID and session ID must be available to remove participants from breakout'
2035
+ );
2036
+ });
2037
+ });
2038
+
1850
2039
  describe('#triggerReturnToMainEvent', () => {
1851
2040
  const checkTrigger = ({breakout, shouldTrigger}) => {
1852
2041
  breakouts.trigger = sinon.stub();
@@ -0,0 +1,78 @@
1
+ import {assert} from '@webex/test-helper-chai';
2
+ import {
3
+ AddMediaFailed,
4
+ MediaConnectionTimedOutError,
5
+ } from '@webex/plugin-meetings/src/common/errors/webex-errors';
6
+
7
+ describe('MediaConnectionTimedOutError', () => {
8
+ [
9
+ {iceConnected: true, message: 'timeout with ice connected'},
10
+ {iceConnected: false, message: 'timeout without ice connected'},
11
+ ].forEach(({iceConnected, message}) => {
12
+ it(`stores message and iceConnected=${iceConnected}`, () => {
13
+ const error = new MediaConnectionTimedOutError(message, iceConnected);
14
+
15
+ assert.equal(error.message, message);
16
+ assert.equal(error.iceConnected, iceConnected);
17
+ assert.equal(error.name, 'MediaConnectionTimedOutError');
18
+ assert.instanceOf(error, Error);
19
+ });
20
+ });
21
+
22
+ it('stores the cause when provided', () => {
23
+ const cause = {iceConnected: true};
24
+ const error = new MediaConnectionTimedOutError('timeout', true, cause);
25
+
26
+ assert.equal(error.cause, cause);
27
+ });
28
+
29
+ it('leaves cause undefined when not provided', () => {
30
+ const error = new MediaConnectionTimedOutError('timeout', true);
31
+
32
+ assert.isUndefined(error.cause);
33
+ });
34
+ });
35
+
36
+ describe('AddMediaFailed', () => {
37
+ it('stores all options properties', () => {
38
+ const cause = new Error('underlying');
39
+ const error = new AddMediaFailed({
40
+ cause,
41
+ connectionType: 'UDP',
42
+ selectedCandidatePairChanges: 3,
43
+ numTransports: 2,
44
+ iceConnected: true,
45
+ });
46
+
47
+ assert.equal(error.cause, cause);
48
+ assert.equal(error.connectionType, 'UDP');
49
+ assert.equal(error.selectedCandidatePairChanges, 3);
50
+ assert.equal(error.numTransports, 2);
51
+ assert.equal(error.iceConnected, true);
52
+ assert.equal(error.message, 'Failed to add media');
53
+ });
54
+
55
+ it('works with default empty options', () => {
56
+ const error = new AddMediaFailed();
57
+
58
+ assert.isUndefined(error.cause);
59
+ assert.isUndefined(error.connectionType);
60
+ assert.isUndefined(error.selectedCandidatePairChanges);
61
+ assert.isUndefined(error.numTransports);
62
+ assert.isUndefined(error.iceConnected);
63
+ });
64
+
65
+ describe('isDtlsHandshakeFailure', () => {
66
+ [
67
+ {iceConnected: true, expected: true},
68
+ {iceConnected: false, expected: false},
69
+ {iceConnected: undefined, expected: false},
70
+ ].forEach(({iceConnected, expected}) => {
71
+ it(`returns ${expected} when iceConnected=${iceConnected}`, () => {
72
+ const error = new AddMediaFailed({iceConnected});
73
+
74
+ assert.equal(error.isDtlsHandshakeFailure, expected);
75
+ });
76
+ });
77
+ });
78
+ });
@@ -27,6 +27,7 @@ describe('plugin-meetings', () => {
27
27
  beforeEach(() => {
28
28
  request = {
29
29
  request: sinon.stub().returns(Promise.resolve()),
30
+ locusDeltaRequest: sinon.stub().returns(Promise.resolve()),
30
31
  };
31
32
 
32
33
  manager = new ControlsOptionsManager(request);
@@ -59,11 +60,11 @@ describe('plugin-meetings', () => {
59
60
 
60
61
  const result = manager.setMuteOnEntry(true);
61
62
 
62
- assert.calledWith(request.request, { uri: 'test/id/controls',
63
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
63
64
  body: { muteOnEntry: { enabled: true } },
64
65
  method: HTTP_VERBS.PATCH});
65
66
 
66
- assert.deepEqual(result, request.request.firstCall.returnValue);
67
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
67
68
  });
68
69
 
69
70
  it('can set mute on entry when the display hint is available enabled=false', () => {
@@ -71,11 +72,11 @@ describe('plugin-meetings', () => {
71
72
 
72
73
  const result = manager.setMuteOnEntry(false);
73
74
 
74
- assert.calledWith(request.request, { uri: 'test/id/controls',
75
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
75
76
  body: { muteOnEntry: { enabled: false } },
76
77
  method: HTTP_VERBS.PATCH});
77
78
 
78
- assert.deepEqual(result, request.request.firstCall.returnValue);
79
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
79
80
  });
80
81
 
81
82
  it('should send setMuteOnEntry to locusUrl without authorizingLocusUrl when in breakout', () => {
@@ -84,11 +85,11 @@ describe('plugin-meetings', () => {
84
85
 
85
86
  const result = manager.setMuteOnEntry(true);
86
87
 
87
- assert.calledWith(request.request, { uri: 'test/id/controls',
88
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
88
89
  body: { muteOnEntry: { enabled: true } },
89
90
  method: HTTP_VERBS.PATCH});
90
91
 
91
- assert.deepEqual(result, request.request.firstCall.returnValue);
92
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
92
93
  });
93
94
  });
94
95
 
@@ -114,11 +115,11 @@ describe('plugin-meetings', () => {
114
115
 
115
116
  const result = manager.setDisallowUnmute(true);
116
117
 
117
- assert.calledWith(request.request, { uri: 'test/id/controls',
118
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
118
119
  body: { disallowUnmute: { enabled: true } },
119
120
  method: HTTP_VERBS.PATCH});
120
121
 
121
- assert.deepEqual(result, request.request.firstCall.returnValue);
122
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
122
123
  });
123
124
 
124
125
  it('can set allow unmute when DISABLE_HARD_MUTE display hint is available', () => {
@@ -126,11 +127,11 @@ describe('plugin-meetings', () => {
126
127
 
127
128
  const result = manager.setDisallowUnmute(false);
128
129
 
129
- assert.calledWith(request.request, { uri: 'test/id/controls',
130
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
130
131
  body: { disallowUnmute: { enabled: false } },
131
132
  method: HTTP_VERBS.PATCH});
132
133
 
133
- assert.deepEqual(result, request.request.firstCall.returnValue);
134
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
134
135
  });
135
136
 
136
137
  it('should send setDisallowUnmute to locusUrl without authorizingLocusUrl when in breakout', () => {
@@ -139,11 +140,11 @@ describe('plugin-meetings', () => {
139
140
 
140
141
  const result = manager.setDisallowUnmute(true);
141
142
 
142
- assert.calledWith(request.request, { uri: 'test/id/controls',
143
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
143
144
  body: { disallowUnmute: { enabled: true } },
144
145
  method: HTTP_VERBS.PATCH});
145
146
 
146
- assert.deepEqual(result, request.request.firstCall.returnValue);
147
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
147
148
  });
148
149
  });
149
150
  });
@@ -154,6 +155,7 @@ describe('plugin-meetings', () => {
154
155
  beforeEach(() => {
155
156
  request = {
156
157
  request: sinon.stub().resolves(),
158
+ locusDeltaRequest: sinon.stub().resolves(),
157
159
  };
158
160
 
159
161
  manager = new ControlsOptionsManager(request);
@@ -202,7 +204,7 @@ describe('plugin-meetings', () => {
202
204
 
203
205
  return manager.update(audio, reactions)
204
206
  .then(() => {
205
- assert.calledWith(request.request, {
207
+ assert.calledWith(request.locusDeltaRequest, {
206
208
  uri: 'test/id/controls',
207
209
  body: {
208
210
  audio: audio.properties,
@@ -210,7 +212,7 @@ describe('plugin-meetings', () => {
210
212
  method: HTTP_VERBS.PATCH,
211
213
  });
212
214
 
213
- assert.calledWith(request.request, {
215
+ assert.calledWith(request.locusDeltaRequest, {
214
216
  uri: 'test/id/controls',
215
217
  body: {
216
218
  reactions: reactions.properties,
@@ -253,7 +255,7 @@ describe('plugin-meetings', () => {
253
255
  return manager.update(audio, reactions)
254
256
  .then(() => {
255
257
  // Audio controls go directly to current locusUrl (no cross-locus authorization)
256
- assert.calledWith(request.request, {
258
+ assert.calledWith(request.locusDeltaRequest, {
257
259
  uri: 'test/id/controls',
258
260
  body: {
259
261
  audio: audio.properties,
@@ -284,7 +286,7 @@ describe('plugin-meetings', () => {
284
286
 
285
287
  return manager.update(audio)
286
288
  .then(() => {
287
- assert.calledWith(request.request, {
289
+ assert.calledWith(request.locusDeltaRequest, {
288
290
  uri: 'test/id/controls',
289
291
  body: {
290
292
  audio: audio.properties,
@@ -317,6 +319,110 @@ describe('plugin-meetings', () => {
317
319
  Util.canUpdate = restorable;
318
320
  });
319
321
  });
322
+
323
+ describe('viewTheParticipantList fill-in', () => {
324
+ let restorable;
325
+
326
+ afterEach(() => {
327
+ Util.canUpdate = restorable;
328
+ });
329
+
330
+ describe('when meeting is a webinar', () => {
331
+ beforeEach(() => {
332
+ restorable = Util.canUpdate;
333
+ Util.canUpdate = sinon.stub().returns(true);
334
+ manager.set({
335
+ locusUrl: 'test/id',
336
+ displayHints: [],
337
+ getControls: () => ({viewTheParticipantList: {enabled: true, panelistEnabled: true, attendeeCount: true}}),
338
+ isWebinar: () => true,
339
+ });
340
+ });
341
+
342
+ it('should fill in all undefined properties from current state', () => {
343
+ const control = {scope: 'viewTheParticipantList', properties: {}};
344
+
345
+ return manager.update(control).then(() => {
346
+ assert.calledOnceWithExactly(request.locusDeltaRequest, {
347
+ uri: 'test/id/controls',
348
+ body: {
349
+ viewTheParticipantList: {enabled: true, panelistEnabled: true, attendeeCount: true},
350
+ },
351
+ method: HTTP_VERBS.PATCH,
352
+ });
353
+ });
354
+ });
355
+
356
+ it('should keep explicitly provided properties and fill in the rest', () => {
357
+ const control = {scope: 'viewTheParticipantList', properties: {enabled: false}};
358
+
359
+ return manager.update(control).then(() => {
360
+ assert.calledOnceWithExactly(request.locusDeltaRequest, {
361
+ uri: 'test/id/controls',
362
+ body: {
363
+ viewTheParticipantList: {enabled: false, panelistEnabled: true, attendeeCount: true},
364
+ },
365
+ method: HTTP_VERBS.PATCH,
366
+ });
367
+ });
368
+ });
369
+
370
+ it('should not fill in properties when all are explicitly provided', () => {
371
+ const control = {scope: 'viewTheParticipantList', properties: {enabled: false, panelistEnabled: false, attendeeCount: false}};
372
+
373
+ return manager.update(control).then(() => {
374
+ assert.calledOnceWithExactly(request.locusDeltaRequest, {
375
+ uri: 'test/id/controls',
376
+ body: {
377
+ viewTheParticipantList: {enabled: false, panelistEnabled: false, attendeeCount: false},
378
+ },
379
+ method: HTTP_VERBS.PATCH,
380
+ });
381
+ });
382
+ });
383
+ });
384
+
385
+ describe('when meeting is not a webinar', () => {
386
+ beforeEach(() => {
387
+ restorable = Util.canUpdate;
388
+ Util.canUpdate = sinon.stub().returns(true);
389
+ manager.set({
390
+ locusUrl: 'test/id',
391
+ displayHints: [],
392
+ getControls: () => ({viewTheParticipantList: {enabled: true, panelistEnabled: true, attendeeCount: true}}),
393
+ isWebinar: () => false,
394
+ });
395
+ });
396
+
397
+ it('should only send enabled property', () => {
398
+ const control = {scope: 'viewTheParticipantList', properties: {}};
399
+
400
+ return manager.update(control).then(() => {
401
+ assert.calledOnceWithExactly(request.locusDeltaRequest, {
402
+ uri: 'test/id/controls',
403
+ body: {
404
+ viewTheParticipantList: {enabled: true},
405
+ },
406
+ method: HTTP_VERBS.PATCH,
407
+ });
408
+ });
409
+ });
410
+
411
+ it('should not include panelistEnabled or attendeeCount even if explicitly provided', () => {
412
+ const control = {scope: 'viewTheParticipantList', properties: {enabled: false, panelistEnabled: true, attendeeCount: true}};
413
+
414
+ return manager.update(control).then(() => {
415
+ assert.calledOnceWithExactly(request.locusDeltaRequest, {
416
+ uri: 'test/id/controls',
417
+ body: {
418
+ viewTheParticipantList: {enabled: false},
419
+ },
420
+ method: HTTP_VERBS.PATCH,
421
+ });
422
+ });
423
+ });
424
+ });
425
+ });
320
426
  });
321
427
 
322
428
  describe('Mute/Unmute All', () => {
@@ -324,6 +430,7 @@ describe('plugin-meetings', () => {
324
430
  beforeEach(() => {
325
431
  request = {
326
432
  request: sinon.stub().returns(Promise.resolve()),
433
+ locusDeltaRequest: sinon.stub().returns(Promise.resolve()),
327
434
  };
328
435
 
329
436
  manager = new ControlsOptionsManager(request);
@@ -368,11 +475,11 @@ describe('plugin-meetings', () => {
368
475
 
369
476
  const result = manager.setMuteAll(true, true, true);
370
477
 
371
- assert.calledWith(request.request, { uri: 'test/id/controls',
478
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
372
479
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true } },
373
480
  method: HTTP_VERBS.PATCH});
374
481
 
375
- assert.deepEqual(result, request.request.firstCall.returnValue);
482
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
376
483
  });
377
484
 
378
485
  it('can set mute all when the display hint is available mutedEnabled=true', () => {
@@ -380,11 +487,11 @@ describe('plugin-meetings', () => {
380
487
 
381
488
  const result = manager.setMuteAll(true, true, true);
382
489
 
383
- assert.calledWith(request.request, { uri: 'test/id/controls',
490
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
384
491
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true } },
385
492
  method: HTTP_VERBS.PATCH});
386
493
 
387
- assert.deepEqual(result, request.request.firstCall.returnValue);
494
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
388
495
  });
389
496
 
390
497
  it('can set mute all when the display hint is available mutedEnabled=true', () => {
@@ -392,11 +499,11 @@ describe('plugin-meetings', () => {
392
499
 
393
500
  const result = manager.setMuteAll(true, true, true);
394
501
 
395
- assert.calledWith(request.request, { uri: 'test/id/controls',
502
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
396
503
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true } },
397
504
  method: HTTP_VERBS.PATCH});
398
505
 
399
- assert.deepEqual(result, request.request.firstCall.returnValue);
506
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
400
507
  });
401
508
 
402
509
  it('can set mute all when the display hint is available mutedEnabled=false', () => {
@@ -404,11 +511,11 @@ describe('plugin-meetings', () => {
404
511
 
405
512
  const result = manager.setMuteAll(false, false, false);
406
513
 
407
- assert.calledWith(request.request, { uri: 'test/id/controls',
514
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
408
515
  body: { audio: { muted: false, disallowUnmute: false, muteOnEntry: false } },
409
516
  method: HTTP_VERBS.PATCH});
410
517
 
411
- assert.deepEqual(result, request.request.firstCall.returnValue);
518
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
412
519
  });
413
520
 
414
521
  it('can set mute all panelists when the display hint is available mutedEnabled=true', () => {
@@ -416,11 +523,11 @@ describe('plugin-meetings', () => {
416
523
 
417
524
  const result = manager.setMuteAll(true, true, true, ['panelist']);
418
525
 
419
- assert.calledWith(request.request, { uri: 'test/id/controls',
526
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
420
527
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true, roles: ['panelist'] } },
421
528
  method: HTTP_VERBS.PATCH});
422
529
 
423
- assert.deepEqual(result, request.request.firstCall.returnValue);
530
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
424
531
  });
425
532
 
426
533
  it('can set mute all attendees when the display hint is available mutedEnabled=true', () => {
@@ -428,11 +535,11 @@ describe('plugin-meetings', () => {
428
535
 
429
536
  const result = manager.setMuteAll(true, true, true, ['attendee']);
430
537
 
431
- assert.calledWith(request.request, { uri: 'test/id/controls',
538
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
432
539
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true, roles: ['attendee'] } },
433
540
  method: HTTP_VERBS.PATCH});
434
541
 
435
- assert.deepEqual(result, request.request.firstCall.returnValue);
542
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
436
543
  });
437
544
 
438
545
  it('should send setMuteAll to locusUrl without authorizingLocusUrl when in breakout', () => {
@@ -441,11 +548,11 @@ describe('plugin-meetings', () => {
441
548
 
442
549
  const result = manager.setMuteAll(true, true, true, ['attendee']);
443
550
 
444
- assert.calledWith(request.request, { uri: 'test/id/controls',
551
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
445
552
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true, roles: ['attendee'] } },
446
553
  method: HTTP_VERBS.PATCH});
447
554
 
448
- assert.deepEqual(result, request.request.firstCall.returnValue);
555
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
449
556
  });
450
557
 
451
558
  it('should send setMuteAll with PANELIST role to locusUrl without authorizingLocusUrl when in breakout', () => {
@@ -454,11 +561,11 @@ describe('plugin-meetings', () => {
454
561
 
455
562
  const result = manager.setMuteAll(true, true, true, ['PANELIST']);
456
563
 
457
- assert.calledWith(request.request, { uri: 'test/id/controls',
564
+ assert.calledWith(request.locusDeltaRequest, { uri: 'test/id/controls',
458
565
  body: { audio: { muted: true, disallowUnmute: true, muteOnEntry: true, roles: ['PANELIST'] } },
459
566
  method: HTTP_VERBS.PATCH});
460
567
 
461
- assert.deepEqual(result, request.request.firstCall.returnValue);
568
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
462
569
  });
463
570
  });
464
571
  });