@webex/plugin-meetings 3.11.0-next.4 → 3.11.0-next.41

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 (146) hide show
  1. package/dist/aiEnableRequest/index.js +184 -0
  2. package/dist/aiEnableRequest/index.js.map +1 -0
  3. package/dist/aiEnableRequest/utils.js +36 -0
  4. package/dist/aiEnableRequest/utils.js.map +1 -0
  5. package/dist/annotation/index.js +3 -3
  6. package/dist/annotation/index.js.map +1 -1
  7. package/dist/breakouts/breakout.js +1 -1
  8. package/dist/breakouts/index.js +1 -1
  9. package/dist/config.js +5 -1
  10. package/dist/config.js.map +1 -1
  11. package/dist/constants.js +26 -6
  12. package/dist/constants.js.map +1 -1
  13. package/dist/hashTree/constants.js +3 -1
  14. package/dist/hashTree/constants.js.map +1 -1
  15. package/dist/hashTree/hashTree.js +18 -0
  16. package/dist/hashTree/hashTree.js.map +1 -1
  17. package/dist/hashTree/hashTreeParser.js +709 -380
  18. package/dist/hashTree/hashTreeParser.js.map +1 -1
  19. package/dist/hashTree/types.js +4 -2
  20. package/dist/hashTree/types.js.map +1 -1
  21. package/dist/hashTree/utils.js +10 -0
  22. package/dist/hashTree/utils.js.map +1 -1
  23. package/dist/index.js +11 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/interceptors/constant.js +12 -0
  26. package/dist/interceptors/constant.js.map +1 -0
  27. package/dist/interceptors/dataChannelAuthToken.js +233 -0
  28. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  29. package/dist/interceptors/index.js +7 -0
  30. package/dist/interceptors/index.js.map +1 -1
  31. package/dist/interpretation/index.js +2 -2
  32. package/dist/interpretation/index.js.map +1 -1
  33. package/dist/interpretation/siLanguage.js +1 -1
  34. package/dist/locus-info/controlsUtils.js +5 -3
  35. package/dist/locus-info/controlsUtils.js.map +1 -1
  36. package/dist/locus-info/index.js +125 -68
  37. package/dist/locus-info/index.js.map +1 -1
  38. package/dist/locus-info/selfUtils.js +1 -0
  39. package/dist/locus-info/selfUtils.js.map +1 -1
  40. package/dist/locus-info/types.js.map +1 -1
  41. package/dist/media/MediaConnectionAwaiter.js +57 -1
  42. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  43. package/dist/media/properties.js +4 -2
  44. package/dist/media/properties.js.map +1 -1
  45. package/dist/meeting/in-meeting-actions.js +7 -1
  46. package/dist/meeting/in-meeting-actions.js.map +1 -1
  47. package/dist/meeting/index.js +209 -90
  48. package/dist/meeting/index.js.map +1 -1
  49. package/dist/meeting/request.js +50 -0
  50. package/dist/meeting/request.js.map +1 -1
  51. package/dist/meeting/request.type.js.map +1 -1
  52. package/dist/meeting/util.js +128 -2
  53. package/dist/meeting/util.js.map +1 -1
  54. package/dist/meetings/index.js +78 -36
  55. package/dist/meetings/index.js.map +1 -1
  56. package/dist/member/index.js +10 -0
  57. package/dist/member/index.js.map +1 -1
  58. package/dist/member/util.js +10 -0
  59. package/dist/member/util.js.map +1 -1
  60. package/dist/metrics/constants.js +2 -1
  61. package/dist/metrics/constants.js.map +1 -1
  62. package/dist/multistream/mediaRequestManager.js +1 -1
  63. package/dist/multistream/mediaRequestManager.js.map +1 -1
  64. package/dist/multistream/remoteMediaManager.js +11 -0
  65. package/dist/multistream/remoteMediaManager.js.map +1 -1
  66. package/dist/reactions/reactions.type.js.map +1 -1
  67. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  68. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  69. package/dist/types/config.d.ts +3 -0
  70. package/dist/types/constants.d.ts +21 -1
  71. package/dist/types/hashTree/constants.d.ts +1 -0
  72. package/dist/types/hashTree/hashTree.d.ts +7 -0
  73. package/dist/types/hashTree/hashTreeParser.d.ts +99 -14
  74. package/dist/types/hashTree/types.d.ts +3 -0
  75. package/dist/types/hashTree/utils.d.ts +6 -0
  76. package/dist/types/index.d.ts +1 -0
  77. package/dist/types/interceptors/constant.d.ts +5 -0
  78. package/dist/types/interceptors/dataChannelAuthToken.d.ts +35 -0
  79. package/dist/types/interceptors/index.d.ts +2 -1
  80. package/dist/types/locus-info/index.d.ts +9 -2
  81. package/dist/types/locus-info/types.d.ts +1 -0
  82. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  83. package/dist/types/media/properties.d.ts +2 -1
  84. package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
  85. package/dist/types/meeting/index.d.ts +24 -2
  86. package/dist/types/meeting/request.d.ts +16 -1
  87. package/dist/types/meeting/request.type.d.ts +5 -0
  88. package/dist/types/meeting/util.d.ts +31 -0
  89. package/dist/types/meetings/index.d.ts +4 -2
  90. package/dist/types/member/index.d.ts +1 -0
  91. package/dist/types/member/util.d.ts +5 -0
  92. package/dist/types/metrics/constants.d.ts +1 -0
  93. package/dist/types/reactions/reactions.type.d.ts +1 -0
  94. package/dist/webinar/index.js +1 -1
  95. package/package.json +22 -22
  96. package/src/aiEnableRequest/README.md +84 -0
  97. package/src/aiEnableRequest/index.ts +170 -0
  98. package/src/aiEnableRequest/utils.ts +25 -0
  99. package/src/annotation/index.ts +7 -4
  100. package/src/config.ts +3 -0
  101. package/src/constants.ts +26 -1
  102. package/src/hashTree/constants.ts +1 -0
  103. package/src/hashTree/hashTree.ts +17 -0
  104. package/src/hashTree/hashTreeParser.ts +627 -249
  105. package/src/hashTree/types.ts +4 -0
  106. package/src/hashTree/utils.ts +9 -0
  107. package/src/index.ts +8 -1
  108. package/src/interceptors/constant.ts +6 -0
  109. package/src/interceptors/dataChannelAuthToken.ts +142 -0
  110. package/src/interceptors/index.ts +2 -1
  111. package/src/interpretation/index.ts +2 -2
  112. package/src/locus-info/controlsUtils.ts +11 -0
  113. package/src/locus-info/index.ts +146 -58
  114. package/src/locus-info/selfUtils.ts +1 -0
  115. package/src/locus-info/types.ts +1 -0
  116. package/src/media/MediaConnectionAwaiter.ts +41 -1
  117. package/src/media/properties.ts +3 -1
  118. package/src/meeting/in-meeting-actions.ts +12 -0
  119. package/src/meeting/index.ts +127 -17
  120. package/src/meeting/request.ts +42 -0
  121. package/src/meeting/request.type.ts +6 -0
  122. package/src/meeting/util.ts +156 -1
  123. package/src/meetings/index.ts +94 -9
  124. package/src/member/index.ts +10 -0
  125. package/src/member/util.ts +12 -0
  126. package/src/metrics/constants.ts +1 -0
  127. package/src/multistream/mediaRequestManager.ts +1 -1
  128. package/src/multistream/remoteMediaManager.ts +13 -0
  129. package/src/reactions/reactions.type.ts +1 -0
  130. package/test/unit/spec/aiEnableRequest/index.ts +981 -0
  131. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  132. package/test/unit/spec/hashTree/hashTree.ts +66 -0
  133. package/test/unit/spec/hashTree/hashTreeParser.ts +1869 -189
  134. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +141 -0
  135. package/test/unit/spec/locus-info/controlsUtils.js +29 -0
  136. package/test/unit/spec/locus-info/index.js +201 -45
  137. package/test/unit/spec/media/MediaConnectionAwaiter.ts +41 -1
  138. package/test/unit/spec/media/properties.ts +12 -3
  139. package/test/unit/spec/meeting/in-meeting-actions.ts +8 -2
  140. package/test/unit/spec/meeting/index.js +441 -75
  141. package/test/unit/spec/meeting/request.js +64 -0
  142. package/test/unit/spec/meeting/utils.js +433 -22
  143. package/test/unit/spec/meetings/index.js +550 -10
  144. package/test/unit/spec/member/index.js +28 -4
  145. package/test/unit/spec/member/util.js +65 -27
  146. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
@@ -5,6 +5,8 @@ import {ConnectionState, MediaConnectionEventNames} from '@webex/internal-media-
5
5
  import testUtils from '../../../utils/testUtils';
6
6
  import {ICE_AND_DTLS_CONNECTION_TIMEOUT} from '@webex/plugin-meetings/src/constants';
7
7
  import MediaConnectionAwaiter from '../../../../src/media/MediaConnectionAwaiter';
8
+ import Metrics from '../../../../src/metrics';
9
+ import BEHAVIORAL_METRICS from '../../../../src/metrics/constants';
8
10
 
9
11
  describe('MediaConnectionAwaiter', () => {
10
12
  let mediaConnectionAwaiter;
@@ -14,18 +16,34 @@ describe('MediaConnectionAwaiter', () => {
14
16
  beforeEach(() => {
15
17
  clock = sinon.useFakeTimers();
16
18
 
19
+ const mockTransportReport = {
20
+ type: 'transport',
21
+ dtlsState: 'connecting',
22
+ iceState: 'checking',
23
+ packetsSent: 10,
24
+ packetsReceived: 5,
25
+ };
26
+
17
27
  mockMC = {
18
- getStats: sinon.stub().resolves([]),
28
+ getStats: sinon.stub().resolves({
29
+ values: () => [mockTransportReport],
30
+ }),
19
31
  on: sinon.stub(),
20
32
  off: sinon.stub(),
21
33
  getConnectionState: sinon.stub().returns(ConnectionState.New),
22
34
  getIceGatheringState: sinon.stub().returns('new'),
23
35
  getIceConnectionState: sinon.stub().returns('new'),
24
36
  getPeerConnectionState: sinon.stub().returns('new'),
37
+ multistreamConnection: {
38
+ dataChannel: {
39
+ readyState: 'open',
40
+ },
41
+ },
25
42
  };
26
43
 
27
44
  mediaConnectionAwaiter = new MediaConnectionAwaiter({
28
45
  webrtcMediaConnection: mockMC,
46
+ correlationId: 'test-correlation-id',
29
47
  });
30
48
  });
31
49
 
@@ -44,6 +62,8 @@ describe('MediaConnectionAwaiter', () => {
44
62
  });
45
63
 
46
64
  it('rejects after timeout if ice state is not connected', async () => {
65
+ const sendMetricSpy = sinon.spy(Metrics, 'sendBehavioralMetric');
66
+
47
67
  mockMC.getConnectionState.returns(ConnectionState.Connecting);
48
68
  mockMC.getIceGatheringState.returns('gathering');
49
69
 
@@ -83,6 +103,18 @@ describe('MediaConnectionAwaiter', () => {
83
103
  assert.equal(promiseRejected, true);
84
104
 
85
105
  assert.calledThrice(mockMC.off);
106
+
107
+ assert.calledOnceWithExactly(sendMetricSpy, BEHAVIORAL_METRICS.MEDIA_STILL_NOT_CONNECTED, {
108
+ correlation_id: 'test-correlation-id',
109
+ numTransports: 1,
110
+ dtlsState: 'connecting',
111
+ iceState: 'checking',
112
+ packetsSent: 10,
113
+ packetsReceived: 5,
114
+ dataChannelState: 'open',
115
+ });
116
+
117
+ sendMetricSpy.restore();
86
118
  });
87
119
 
88
120
  it('rejects immediately if ice state is FAILED', async () => {
@@ -351,6 +383,8 @@ describe('MediaConnectionAwaiter', () => {
351
383
  });
352
384
 
353
385
  it(`reject with restart timer once if gathering state is not complete`, async () => {
386
+ const sendMetricSpy = sinon.spy(Metrics, 'sendBehavioralMetric');
387
+
354
388
  mockMC.getConnectionState.returns(ConnectionState.Connecting);
355
389
  mockMC.getIceGatheringState.returns('new');
356
390
 
@@ -390,6 +424,12 @@ describe('MediaConnectionAwaiter', () => {
390
424
 
391
425
  assert.calledOnce(clearTimeoutSpy);
392
426
  assert.calledTwice(setTimeoutSpy);
427
+
428
+ // verify sendMetric was called twice (once for each timeout)
429
+ assert.calledTwice(sendMetricSpy);
430
+ assert.calledWith(sendMetricSpy, BEHAVIORAL_METRICS.MEDIA_STILL_NOT_CONNECTED);
431
+
432
+ sendMetricSpy.restore();
393
433
  });
394
434
 
395
435
  it(`resolves gathering and connection state complete right after`, async () => {
@@ -41,14 +41,23 @@ describe('MediaProperties', () => {
41
41
  describe('waitForMediaConnectionConnected', () => {
42
42
  it('resolves if media connection is connected', async () => {
43
43
  const waitForMediaConnectionConnectedResult = new Defer();
44
+ const correlationId = 'aaaa-bbbb-cccc-dddd';
44
45
 
45
- sinon
46
+ let capturedInstance;
47
+ const stub = sinon
46
48
  .stub(MediaConnectionAwaiter.prototype, 'waitForMediaConnectionConnected')
47
- .returns(waitForMediaConnectionConnectedResult.promise);
49
+ .callsFake(function () {
50
+ capturedInstance = this;
51
+ return waitForMediaConnectionConnectedResult.promise;
52
+ });
48
53
 
49
54
  waitForMediaConnectionConnectedResult.resolve();
50
55
 
51
- await mediaProperties.waitForMediaConnectionConnected();
56
+ await mediaProperties.waitForMediaConnectionConnected(correlationId);
57
+
58
+ assert.calledOnce(stub);
59
+ assert.equal(capturedInstance.correlationId, correlationId);
60
+ assert.equal(capturedInstance.webrtcMediaConnection, mockMC);
52
61
  });
53
62
  it('rejects if media connection is not connected', async () => {
54
63
  const waitForMediaConnectionConnectedResult = new Defer();
@@ -26,6 +26,7 @@ describe('plugin-meetings', () => {
26
26
  canLowerAllHands: null,
27
27
  canLowerSomeoneElsesHand: null,
28
28
  bothLeaveAndEndMeetingAvailable: null,
29
+ requireHostEndMeetingBeforeLeave: null,
29
30
  canEnableClosedCaption: null,
30
31
  canStartTranscribing: null,
31
32
  canStopTranscribing: null,
@@ -35,8 +36,8 @@ describe('plugin-meetings', () => {
35
36
  isLocalRecordingStarted: null,
36
37
  isLocalRecordingStopped: null,
37
38
  isLocalRecordingPaused: null,
38
- isLocalStreamingStarted:null,
39
- isLocalStreamingStopped:null,
39
+ isLocalStreamingStarted: null,
40
+ isLocalStreamingStopped: null,
40
41
  isManualCaptionActive: null,
41
42
  isPremiseRecordingEnabled: null,
42
43
  isSaveTranscriptsEnabled: null,
@@ -111,6 +112,8 @@ describe('plugin-meetings', () => {
111
112
  canMoveToLobby: null,
112
113
  canEnablePollingQA: null,
113
114
  canDisablePollingQA: null,
115
+ canAttendeeRequestAiAssistantEnabled: null,
116
+ isAttendeeRequestAiAssistantDeclinedAll: null,
114
117
 
115
118
  ...expected,
116
119
  };
@@ -149,6 +152,7 @@ describe('plugin-meetings', () => {
149
152
  'canLowerAllHands',
150
153
  'canLowerSomeoneElsesHand',
151
154
  'bothLeaveAndEndMeetingAvailable',
155
+ 'requireHostEndMeetingBeforeLeave',
152
156
  'canEnableClosedCaption',
153
157
  'canStopTranscribing',
154
158
  'isClosedCaptionActive',
@@ -228,6 +232,8 @@ describe('plugin-meetings', () => {
228
232
  'canMoveToLobby',
229
233
  'canEnablePollingQA',
230
234
  'canDisablePollingQA',
235
+ 'canAttendeeRequestAiAssistantEnabled',
236
+ 'isAttendeeRequestAiAssistantDeclinedAll',
231
237
  ].forEach((key) => {
232
238
  it(`get and set for ${key} work as expected`, () => {
233
239
  const inMeetingActions = new InMeetingActions();