@webex/plugin-meetings 3.12.0-next.143 → 3.12.0-next.145
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.
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +46 -12
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/util.js +3 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +7 -4
- package/dist/meetings/index.js.map +1 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/interpretation/index.ts +38 -1
- package/src/meeting/util.ts +5 -2
- package/src/meetings/index.ts +3 -0
- package/test/unit/spec/interpretation/index.ts +93 -0
- package/test/unit/spec/meeting/utils.js +26 -15
- package/test/unit/spec/meetings/index.js +11 -0
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ const SimultaneousInterpretation = WebexPlugin.extend({
|
|
|
33
33
|
meetingSIEnabled: 'boolean', // appears the meeting support SI feature
|
|
34
34
|
hostSIEnabled: 'boolean', // appears the meeting host/interpreter feature of SI enabled
|
|
35
35
|
selfIsInterpreter: 'boolean', // current user is interpreter or not
|
|
36
|
+
siEnabled: 'boolean', // appears SI is currently enabled in the meeting (from locus controls)
|
|
36
37
|
},
|
|
37
38
|
derived: {
|
|
38
39
|
shouldQuerySupportLanguages: {
|
|
@@ -114,10 +115,15 @@ const SimultaneousInterpretation = WebexPlugin.extend({
|
|
|
114
115
|
/**
|
|
115
116
|
* Update the interpretation languages channels which user can choose to subscribe
|
|
116
117
|
* @param {Object} interpretation
|
|
118
|
+
* @param {Object} [options]
|
|
119
|
+
* @param {boolean} [options.preserveSiEnabled] keep the current siEnabled untouched (meeting-info path)
|
|
117
120
|
* @returns {void}
|
|
118
121
|
*/
|
|
119
|
-
updateInterpretation(interpretation) {
|
|
122
|
+
updateInterpretation(interpretation, {preserveSiEnabled = false} = {}) {
|
|
120
123
|
this.siLanguages.set(interpretation?.siLanguages || []);
|
|
124
|
+
if (!preserveSiEnabled) {
|
|
125
|
+
this.set('siEnabled', !!interpretation?.siEnabled);
|
|
126
|
+
}
|
|
121
127
|
},
|
|
122
128
|
/**
|
|
123
129
|
* Update self's interpretation information (self is interpreter)
|
|
@@ -206,6 +212,37 @@ const SimultaneousInterpretation = WebexPlugin.extend({
|
|
|
206
212
|
throw error;
|
|
207
213
|
});
|
|
208
214
|
},
|
|
215
|
+
/**
|
|
216
|
+
* End simultaneous interpretation in the meeting. Only the host is allowed to call this api.
|
|
217
|
+
* Locus clears SI subscriptions, removes interpreters and their interpreter roles.
|
|
218
|
+
* It cannot be re-enabled during the current meeting.
|
|
219
|
+
* @returns {Promise}
|
|
220
|
+
*/
|
|
221
|
+
endSimultaneousInterpretation() {
|
|
222
|
+
const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);
|
|
223
|
+
|
|
224
|
+
return this.request({
|
|
225
|
+
method: HTTP_VERBS.PATCH,
|
|
226
|
+
uri: `${this.locusUrl}/controls`,
|
|
227
|
+
body: {
|
|
228
|
+
interpretation: {
|
|
229
|
+
siEnabled: false,
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
})
|
|
233
|
+
.then((response) => {
|
|
234
|
+
MeetingUtil.updateLocusFromApiResponse(meeting, response);
|
|
235
|
+
|
|
236
|
+
return response;
|
|
237
|
+
})
|
|
238
|
+
.catch((error) => {
|
|
239
|
+
LoggerProxy.logger.error(
|
|
240
|
+
'Meeting:interpretation#endSimultaneousInterpretation failed',
|
|
241
|
+
error
|
|
242
|
+
);
|
|
243
|
+
throw error;
|
|
244
|
+
});
|
|
245
|
+
},
|
|
209
246
|
/**
|
|
210
247
|
* Change direction of interpretation for an interpreter participant
|
|
211
248
|
* @returns {Promise}
|
package/src/meeting/util.ts
CHANGED
|
@@ -372,7 +372,6 @@ const MeetingUtil = {
|
|
|
372
372
|
meeting.breakouts.cleanUp();
|
|
373
373
|
meeting.webinar.cleanUp();
|
|
374
374
|
meeting.simultaneousInterpretation.cleanUp();
|
|
375
|
-
meeting.locusInfo.cleanUp();
|
|
376
375
|
meeting.locusMediaRequest = undefined;
|
|
377
376
|
|
|
378
377
|
meeting.webex?.internal?.newMetrics?.callDiagnosticMetrics?.clearEventLimitsForCorrelationId(
|
|
@@ -1008,7 +1007,11 @@ const MeetingUtil = {
|
|
|
1008
1007
|
renameKey(language, 'languageGroupId', 'languageCode');
|
|
1009
1008
|
}
|
|
1010
1009
|
if (!meeting.simultaneousInterpretation?.siLanguages?.length) {
|
|
1011
|
-
|
|
1010
|
+
// Meeting-info only carries siLanguages; preserve siEnabled owned by locus controls.
|
|
1011
|
+
meeting.simultaneousInterpretation.updateInterpretation(
|
|
1012
|
+
{siLanguages: lanuagesInfo},
|
|
1013
|
+
{preserveSiEnabled: true}
|
|
1014
|
+
);
|
|
1012
1015
|
}
|
|
1013
1016
|
}
|
|
1014
1017
|
Trigger.trigger(
|
package/src/meetings/index.ts
CHANGED
|
@@ -1493,6 +1493,9 @@ export default class Meetings extends WebexPlugin {
|
|
|
1493
1493
|
*/
|
|
1494
1494
|
private destroy(meeting: Meeting, reason: object) {
|
|
1495
1495
|
MeetingUtil.cleanUp(meeting);
|
|
1496
|
+
// Tear down hash tree parsers here (and not in MeetingUtil.cleanUp) so they survive
|
|
1497
|
+
// leave/endMeetingForAll to consume the final sentinel END message from Locus.
|
|
1498
|
+
meeting.locusInfo?.cleanUp();
|
|
1496
1499
|
// keep some basic info about the deleted meeting forever
|
|
1497
1500
|
this.deletedMeetings.set(meeting.id, {
|
|
1498
1501
|
id: meeting.id,
|
|
@@ -159,6 +159,39 @@ describe('plugin-meetings', () => {
|
|
|
159
159
|
interpretation.updateInterpretation({siLanguages: [{languageName: 'en', languageCode: 1}]});
|
|
160
160
|
checkSILanguage(interpretation.siLanguages.en, {languageName: 'en', languageCode: 1});
|
|
161
161
|
});
|
|
162
|
+
it('stores siEnabled from the interpretation control', () => {
|
|
163
|
+
interpretation.updateInterpretation({siEnabled: true, siLanguages: []});
|
|
164
|
+
assert.equal(interpretation.siEnabled, true);
|
|
165
|
+
|
|
166
|
+
interpretation.updateInterpretation({siEnabled: false, siLanguages: []});
|
|
167
|
+
assert.equal(interpretation.siEnabled, false);
|
|
168
|
+
});
|
|
169
|
+
it('preserves siEnabled when preserveSiEnabled is set (meeting-info path)', () => {
|
|
170
|
+
interpretation.updateInterpretation({siEnabled: true, siLanguages: []});
|
|
171
|
+
assert.equal(interpretation.siEnabled, true);
|
|
172
|
+
|
|
173
|
+
// The meeting-info path passes only siLanguages; siEnabled must survive.
|
|
174
|
+
interpretation.updateInterpretation(
|
|
175
|
+
{siLanguages: [{languageName: 'en', languageCode: 1}]},
|
|
176
|
+
{preserveSiEnabled: true}
|
|
177
|
+
);
|
|
178
|
+
assert.equal(interpretation.siEnabled, true);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('resets siEnabled and siLanguages consistently for a delta without interpretation', () => {
|
|
182
|
+
interpretation.updateInterpretation({
|
|
183
|
+
siEnabled: true,
|
|
184
|
+
siLanguages: [{languageName: 'en', languageCode: 1}],
|
|
185
|
+
});
|
|
186
|
+
assert.equal(interpretation.siEnabled, true);
|
|
187
|
+
assert.equal(interpretation.siLanguages.length, 1);
|
|
188
|
+
|
|
189
|
+
// A locus delta carrying no interpretation resets both fields together, so we never
|
|
190
|
+
// land in the "SI on with zero languages" state.
|
|
191
|
+
interpretation.updateInterpretation(undefined);
|
|
192
|
+
assert.equal(interpretation.siEnabled, false);
|
|
193
|
+
assert.equal(interpretation.siLanguages.length, 0);
|
|
194
|
+
});
|
|
162
195
|
});
|
|
163
196
|
|
|
164
197
|
describe('#updateSelfInterpretation', () => {
|
|
@@ -361,6 +394,66 @@ describe('plugin-meetings', () => {
|
|
|
361
394
|
});
|
|
362
395
|
});
|
|
363
396
|
|
|
397
|
+
describe('#endSimultaneousInterpretation', () => {
|
|
398
|
+
it('makes the request as expected', async () => {
|
|
399
|
+
const mockResponse = {body: {locus: {url: 'locusUrl'}}};
|
|
400
|
+
webex.request.returns(Promise.resolve(mockResponse));
|
|
401
|
+
|
|
402
|
+
await interpretation.endSimultaneousInterpretation();
|
|
403
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
404
|
+
method: 'PATCH',
|
|
405
|
+
uri: 'locusUrl/controls',
|
|
406
|
+
body: {
|
|
407
|
+
interpretation: {
|
|
408
|
+
siEnabled: false,
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
assert.calledOnceWithExactly(
|
|
413
|
+
mockMeeting.locusInfo.handleLocusAPIResponse,
|
|
414
|
+
mockMeeting,
|
|
415
|
+
mockResponse.body
|
|
416
|
+
);
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
it('rejects with error', async () => {
|
|
420
|
+
const mockError = new Error('something wrong');
|
|
421
|
+
webex.request.returns(Promise.reject(mockError));
|
|
422
|
+
LoggerProxy.logger.error = sinon.stub();
|
|
423
|
+
|
|
424
|
+
await assert.isRejected(
|
|
425
|
+
interpretation.endSimultaneousInterpretation(),
|
|
426
|
+
mockError,
|
|
427
|
+
'something wrong'
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
assert.calledOnceWithExactly(
|
|
431
|
+
LoggerProxy.logger.error,
|
|
432
|
+
'Meeting:interpretation#endSimultaneousInterpretation failed',
|
|
433
|
+
mockError
|
|
434
|
+
);
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
it('resolves without touching locusInfo when the meeting is not found', async () => {
|
|
438
|
+
webex.meetings.meetingCollection.getByKey.returns(undefined);
|
|
439
|
+
const mockResponse = {body: {locus: {url: 'locusUrl'}}};
|
|
440
|
+
webex.request.returns(Promise.resolve(mockResponse));
|
|
441
|
+
|
|
442
|
+
await interpretation.endSimultaneousInterpretation();
|
|
443
|
+
|
|
444
|
+
assert.calledOnceWithExactly(webex.request, {
|
|
445
|
+
method: 'PATCH',
|
|
446
|
+
uri: 'locusUrl/controls',
|
|
447
|
+
body: {
|
|
448
|
+
interpretation: {
|
|
449
|
+
siEnabled: false,
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
});
|
|
453
|
+
assert.notCalled(mockMeeting.locusInfo.handleLocusAPIResponse);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
|
|
364
457
|
describe('#changeDirection', () => {
|
|
365
458
|
it('makes the request as expected', async () => {
|
|
366
459
|
interpretation.set({
|
|
@@ -90,7 +90,8 @@ describe('plugin-meetings', () => {
|
|
|
90
90
|
assert.calledOnceWithExactly(meeting.cleanupLLMConneciton, {throwOnError: false});
|
|
91
91
|
assert.calledOnce(meeting.breakouts.cleanUp);
|
|
92
92
|
assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
|
|
93
|
-
|
|
93
|
+
// locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
|
|
94
|
+
assert.notCalled(meeting.locusInfo.cleanUp);
|
|
94
95
|
assert.calledOnce(webex.internal.device.meetingEnded);
|
|
95
96
|
assert.calledOnceWithExactly(
|
|
96
97
|
meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
|
|
@@ -112,7 +113,8 @@ describe('plugin-meetings', () => {
|
|
|
112
113
|
assert.notCalled(meeting.cleanupLLMConneciton);
|
|
113
114
|
assert.calledOnce(meeting.breakouts.cleanUp);
|
|
114
115
|
assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
|
|
115
|
-
|
|
116
|
+
// locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
|
|
117
|
+
assert.notCalled(meeting.locusInfo.cleanUp);
|
|
116
118
|
assert.calledOnce(webex.internal.device.meetingEnded);
|
|
117
119
|
assert.calledOnceWithExactly(
|
|
118
120
|
meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
|
|
@@ -133,7 +135,8 @@ describe('plugin-meetings', () => {
|
|
|
133
135
|
assert.notCalled(meeting.cleanupLLMConneciton);
|
|
134
136
|
assert.calledOnce(meeting.breakouts.cleanUp);
|
|
135
137
|
assert.calledOnce(meeting.simultaneousInterpretation.cleanUp);
|
|
136
|
-
|
|
138
|
+
// locusInfo.cleanUp (hash tree parser teardown) is deferred to Meetings#destroy
|
|
139
|
+
assert.notCalled(meeting.locusInfo.cleanUp);
|
|
137
140
|
assert.calledOnce(webex.internal.device.meetingEnded);
|
|
138
141
|
assert.calledOnceWithExactly(
|
|
139
142
|
meeting.webex.internal.newMetrics.callDiagnosticMetrics.clearEventLimitsForCorrelationId,
|
|
@@ -1412,12 +1415,16 @@ describe('plugin-meetings', () => {
|
|
|
1412
1415
|
MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
|
|
1413
1416
|
assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, true);
|
|
1414
1417
|
assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, true);
|
|
1415
|
-
assert.calledWith(
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1418
|
+
assert.calledWith(
|
|
1419
|
+
meeting.simultaneousInterpretation.updateInterpretation,
|
|
1420
|
+
{
|
|
1421
|
+
siLanguages: [
|
|
1422
|
+
{languageName: 'en', languageCode: 1},
|
|
1423
|
+
{languageName: 'es', languageCode: 2},
|
|
1424
|
+
],
|
|
1425
|
+
},
|
|
1426
|
+
{preserveSiEnabled: true}
|
|
1427
|
+
);
|
|
1421
1428
|
});
|
|
1422
1429
|
|
|
1423
1430
|
it('should update simultaneous interpretation settings with host SI disabled', () => {
|
|
@@ -1426,12 +1433,16 @@ describe('plugin-meetings', () => {
|
|
|
1426
1433
|
MeetingUtil.parseInterpretationInfo(meeting, meetingInfo);
|
|
1427
1434
|
assert.calledWith(meeting.simultaneousInterpretation.updateMeetingSIEnabled, true, false);
|
|
1428
1435
|
assert.calledWith(meeting.simultaneousInterpretation.updateHostSIEnabled, false);
|
|
1429
|
-
assert.calledWith(
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1436
|
+
assert.calledWith(
|
|
1437
|
+
meeting.simultaneousInterpretation.updateInterpretation,
|
|
1438
|
+
{
|
|
1439
|
+
siLanguages: [
|
|
1440
|
+
{languageName: 'en', languageCode: 1},
|
|
1441
|
+
{languageName: 'es', languageCode: 2},
|
|
1442
|
+
],
|
|
1443
|
+
},
|
|
1444
|
+
{preserveSiEnabled: true}
|
|
1445
|
+
);
|
|
1435
1446
|
});
|
|
1436
1447
|
it('should update simultaneous interpretation settings with SI disabled', () => {
|
|
1437
1448
|
meetingInfo.turnOnSimultaneousInterpretation = false;
|
|
@@ -1708,6 +1708,7 @@ describe('plugin-meetings', () => {
|
|
|
1708
1708
|
locusInfo: {
|
|
1709
1709
|
info: {globalMeetingId: 'gmid-other'},
|
|
1710
1710
|
sync: sinon.stub().resolves(),
|
|
1711
|
+
cleanUp: sinon.stub(),
|
|
1711
1712
|
},
|
|
1712
1713
|
sendCallAnalyzerMetrics: sinon.stub(),
|
|
1713
1714
|
},
|
|
@@ -3463,6 +3464,16 @@ describe('plugin-meetings', () => {
|
|
|
3463
3464
|
assert.equal(deletedMeetingInfo.roles, meetingIds.roles);
|
|
3464
3465
|
assert.equal(deletedMeetingInfo.callStateForMetrics, meetingIds.callStateForMetrics);
|
|
3465
3466
|
});
|
|
3467
|
+
|
|
3468
|
+
it('cleans up locusInfo (tearing down hash tree parsers) when destroying the meeting', async () => {
|
|
3469
|
+
const meeting = await webex.meetings.createMeeting('test', 'test');
|
|
3470
|
+
const locusInfoCleanUpSpy = sinon.spy(meeting.locusInfo, 'cleanUp');
|
|
3471
|
+
|
|
3472
|
+
webex.meetings.destroy(meeting, test1);
|
|
3473
|
+
|
|
3474
|
+
// hash tree parser teardown is deferred from MeetingUtil.cleanUp to Meetings#destroy
|
|
3475
|
+
assert.calledOnce(locusInfoCleanUpSpy);
|
|
3476
|
+
});
|
|
3466
3477
|
});
|
|
3467
3478
|
|
|
3468
3479
|
describe('with auto upload logs enabled', () => {
|