@webex/internal-plugin-voicea 3.12.0-next.9 → 3.12.0-task-refactor.1
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/constants.js +1 -2
- package/dist/constants.js.map +1 -1
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/voicea.d.ts +2 -56
- package/dist/voicea.js +24 -173
- package/dist/voicea.js.map +1 -1
- package/package.json +9 -9
- package/src/constants.ts +0 -1
- package/src/voicea.ts +24 -163
- package/test/unit/spec/voicea.js +20 -498
package/dist/constants.js
CHANGED
|
@@ -4,7 +4,7 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.VOICEA = exports.TURN_ON_CAPTION_STATUS = exports.TRANSCRIPTION_TYPE = exports.TOGGLE_MANUAL_CAPTION_STATUS = exports.
|
|
7
|
+
exports.VOICEA = exports.TURN_ON_CAPTION_STATUS = exports.TRANSCRIPTION_TYPE = exports.TOGGLE_MANUAL_CAPTION_STATUS = exports.LANGUAGE_ASSIGNMENT = exports.EVENT_TRIGGERS = exports.DEFAULT_SPOKEN_LANGUAGE = exports.ANNOUNCE_STATUS = exports.AIBRIDGE_RELAY_TYPES = void 0;
|
|
8
8
|
var EVENT_TRIGGERS = exports.EVENT_TRIGGERS = {
|
|
9
9
|
VOICEA_ANNOUNCEMENT: 'voicea:announcement',
|
|
10
10
|
CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',
|
|
@@ -46,7 +46,6 @@ var TRANSCRIPTION_TYPE = exports.TRANSCRIPTION_TYPE = {
|
|
|
46
46
|
};
|
|
47
47
|
var VOICEA = exports.VOICEA = 'voicea';
|
|
48
48
|
var DEFAULT_SPOKEN_LANGUAGE = exports.DEFAULT_SPOKEN_LANGUAGE = 'en';
|
|
49
|
-
var LLM_PRACTICE_SESSION = exports.LLM_PRACTICE_SESSION = 'llm-practice-session';
|
|
50
49
|
var ANNOUNCE_STATUS = exports.ANNOUNCE_STATUS = {
|
|
51
50
|
IDLE: 'idle',
|
|
52
51
|
JOINED: 'joined',
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EVENT_TRIGGERS","exports","VOICEA_ANNOUNCEMENT","CAPTION_LANGUAGE_UPDATE","SPOKEN_LANGUAGE_UPDATE","CAPTIONS_TURNED_ON","TRANSCRIBING_ON","TRANSCRIBING_OFF","NEW_CAPTION","EVA_COMMAND","HIGHLIGHT_CREATED","NEW_MANUAL_CAPTION","LANGUAGE_DETECTED","AIBRIDGE_RELAY_TYPES","VOICEA","ANNOUNCEMENT","CLIENT_ANNOUNCEMENT","TRANSLATION_REQUEST","TRANSLATION_RESPONSE","TRANSCRIPTION","MANUAL","CAPTIONER","TRANSCRIPTION_TYPE","UNKNOWN","EVA_WAKE","EVA_THANKS","EVA_CANCEL","TRANSCRIPT_INTERIM_RESULTS","TRANSCRIPT_FINAL_RESULT","MANUAL_CAPTION_INTERIM_RESULTS","MANUAL_CAPTION_INTERIM_RESULT","MANUAL_CAPTION_FINAL_RESULT","DEFAULT_SPOKEN_LANGUAGE","
|
|
1
|
+
{"version":3,"names":["EVENT_TRIGGERS","exports","VOICEA_ANNOUNCEMENT","CAPTION_LANGUAGE_UPDATE","SPOKEN_LANGUAGE_UPDATE","CAPTIONS_TURNED_ON","TRANSCRIBING_ON","TRANSCRIBING_OFF","NEW_CAPTION","EVA_COMMAND","HIGHLIGHT_CREATED","NEW_MANUAL_CAPTION","LANGUAGE_DETECTED","AIBRIDGE_RELAY_TYPES","VOICEA","ANNOUNCEMENT","CLIENT_ANNOUNCEMENT","TRANSLATION_REQUEST","TRANSLATION_RESPONSE","TRANSCRIPTION","MANUAL","CAPTIONER","TRANSCRIPTION_TYPE","UNKNOWN","EVA_WAKE","EVA_THANKS","EVA_CANCEL","TRANSCRIPT_INTERIM_RESULTS","TRANSCRIPT_FINAL_RESULT","MANUAL_CAPTION_INTERIM_RESULTS","MANUAL_CAPTION_INTERIM_RESULT","MANUAL_CAPTION_FINAL_RESULT","DEFAULT_SPOKEN_LANGUAGE","ANNOUNCE_STATUS","IDLE","JOINED","JOINING","TURN_ON_CAPTION_STATUS","ENABLED","SENDING","TOGGLE_MANUAL_CAPTION_STATUS","LANGUAGE_ASSIGNMENT","AUTO","DEFAULT"],"sources":["constants.ts"],"sourcesContent":["export const EVENT_TRIGGERS = {\n VOICEA_ANNOUNCEMENT: 'voicea:announcement',\n CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',\n SPOKEN_LANGUAGE_UPDATE: 'voicea:spokenLanguageUpdate',\n CAPTIONS_TURNED_ON: 'voicea:captionOn',\n TRANSCRIBING_ON: 'voicea:transcribingOn',\n TRANSCRIBING_OFF: 'voicea:transcribingOff',\n\n NEW_CAPTION: 'voicea:newCaption',\n EVA_COMMAND: 'voicea:wxa',\n HIGHLIGHT_CREATED: 'voicea:highlightCreated',\n NEW_MANUAL_CAPTION: 'aibridge:newManualCaption',\n\n LANGUAGE_DETECTED: 'voicea:languageDetected',\n};\n\nexport const AIBRIDGE_RELAY_TYPES = {\n VOICEA: {\n ANNOUNCEMENT: 'voicea.annc',\n CLIENT_ANNOUNCEMENT: 'client.annc',\n TRANSLATION_REQUEST: 'voicea.transl.req',\n TRANSLATION_RESPONSE: 'voicea.transl.rsp',\n TRANSCRIPTION: 'voicea.transcription',\n },\n MANUAL: {\n TRANSCRIPTION: 'aibridge.manual_transcription',\n CAPTIONER: 'client.manual_transcription',\n },\n};\n\nexport const TRANSCRIPTION_TYPE = {\n UNKNOWN: 'unknown',\n EVA_WAKE: 'eva_wake',\n EVA_THANKS: 'eva_thanks',\n EVA_CANCEL: 'eva_cancel',\n HIGHLIGHT_CREATED: 'highlight_created',\n TRANSCRIPT_INTERIM_RESULTS: 'transcript_interim_results',\n TRANSCRIPT_FINAL_RESULT: 'transcript_final_result',\n MANUAL_CAPTION_INTERIM_RESULTS: 'manual_caption_interim_results',\n MANUAL_CAPTION_INTERIM_RESULT: 'manual_caption_interim_result',\n MANUAL_CAPTION_FINAL_RESULT: 'manual_caption_final_result',\n LANGUAGE_DETECTED: 'language_detected',\n};\n\nexport const VOICEA = 'voicea';\nexport const DEFAULT_SPOKEN_LANGUAGE = 'en';\n\nexport const ANNOUNCE_STATUS = {\n IDLE: 'idle',\n JOINED: 'joined',\n JOINING: 'joining',\n};\n\nexport const TURN_ON_CAPTION_STATUS = {\n IDLE: 'idle',\n ENABLED: 'enabled',\n SENDING: 'sending',\n};\n\nexport const TOGGLE_MANUAL_CAPTION_STATUS = {\n IDLE: 'idle',\n SENDING: 'sending',\n};\n\nexport const LANGUAGE_ASSIGNMENT = {\n AUTO: 'AUTO',\n MANUAL: 'MANUAL',\n DEFAULT: 'DEFAULT',\n};\n"],"mappings":";;;;;;;AAAO,IAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,mBAAmB,EAAE,qBAAqB;EAC1CC,uBAAuB,EAAE,8BAA8B;EACvDC,sBAAsB,EAAE,6BAA6B;EACrDC,kBAAkB,EAAE,kBAAkB;EACtCC,eAAe,EAAE,uBAAuB;EACxCC,gBAAgB,EAAE,wBAAwB;EAE1CC,WAAW,EAAE,mBAAmB;EAChCC,WAAW,EAAE,YAAY;EACzBC,iBAAiB,EAAE,yBAAyB;EAC5CC,kBAAkB,EAAE,2BAA2B;EAE/CC,iBAAiB,EAAE;AACrB,CAAC;AAEM,IAAMC,oBAAoB,GAAAZ,OAAA,CAAAY,oBAAA,GAAG;EAClCC,MAAM,EAAE;IACNC,YAAY,EAAE,aAAa;IAC3BC,mBAAmB,EAAE,aAAa;IAClCC,mBAAmB,EAAE,mBAAmB;IACxCC,oBAAoB,EAAE,mBAAmB;IACzCC,aAAa,EAAE;EACjB,CAAC;EACDC,MAAM,EAAE;IACND,aAAa,EAAE,+BAA+B;IAC9CE,SAAS,EAAE;EACb;AACF,CAAC;AAEM,IAAMC,kBAAkB,GAAArB,OAAA,CAAAqB,kBAAA,GAAG;EAChCC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE,YAAY;EACxBC,UAAU,EAAE,YAAY;EACxBhB,iBAAiB,EAAE,mBAAmB;EACtCiB,0BAA0B,EAAE,4BAA4B;EACxDC,uBAAuB,EAAE,yBAAyB;EAClDC,8BAA8B,EAAE,gCAAgC;EAChEC,6BAA6B,EAAE,+BAA+B;EAC9DC,2BAA2B,EAAE,6BAA6B;EAC1DnB,iBAAiB,EAAE;AACrB,CAAC;AAEM,IAAME,MAAM,GAAAb,OAAA,CAAAa,MAAA,GAAG,QAAQ;AACvB,IAAMkB,uBAAuB,GAAA/B,OAAA,CAAA+B,uBAAA,GAAG,IAAI;AAEpC,IAAMC,eAAe,GAAAhC,OAAA,CAAAgC,eAAA,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE;AACX,CAAC;AAEM,IAAMC,sBAAsB,GAAApC,OAAA,CAAAoC,sBAAA,GAAG;EACpCH,IAAI,EAAE,MAAM;EACZI,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACX,CAAC;AAEM,IAAMC,4BAA4B,GAAAvC,OAAA,CAAAuC,4BAAA,GAAG;EAC1CN,IAAI,EAAE,MAAM;EACZK,OAAO,EAAE;AACX,CAAC;AAEM,IAAME,mBAAmB,GAAAxC,OAAA,CAAAwC,mBAAA,GAAG;EACjCC,IAAI,EAAE,MAAM;EACZtB,MAAM,EAAE,QAAQ;EAChBuB,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -39,7 +39,6 @@ export declare const TRANSCRIPTION_TYPE: {
|
|
|
39
39
|
};
|
|
40
40
|
export declare const VOICEA = "voicea";
|
|
41
41
|
export declare const DEFAULT_SPOKEN_LANGUAGE = "en";
|
|
42
|
-
export declare const LLM_PRACTICE_SESSION = "llm-practice-session";
|
|
43
42
|
export declare const ANNOUNCE_STATUS: {
|
|
44
43
|
IDLE: string;
|
|
45
44
|
JOINED: string;
|
package/dist/types/voicea.d.ts
CHANGED
|
@@ -10,14 +10,12 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
10
10
|
private seqNum;
|
|
11
11
|
private areCaptionsEnabled;
|
|
12
12
|
private hasSubscribedToEvents;
|
|
13
|
-
private
|
|
13
|
+
private vmcDeviceId?;
|
|
14
14
|
private announceStatus;
|
|
15
15
|
private captionStatus;
|
|
16
|
-
private isCaptionBoxOn;
|
|
17
16
|
private toggleManualCaptionStatus;
|
|
18
17
|
private currentSpokenLanguage?;
|
|
19
18
|
private spokenLanguages;
|
|
20
|
-
private currentCaptionLanguage?;
|
|
21
19
|
/**
|
|
22
20
|
* @param {Object} e
|
|
23
21
|
* @returns {undefined}
|
|
@@ -62,18 +60,6 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
62
60
|
* @returns {void}
|
|
63
61
|
*/
|
|
64
62
|
private processAnnouncementMessage;
|
|
65
|
-
/**
|
|
66
|
-
* Indicates whether the default or practice-session LLM connection is active.
|
|
67
|
-
* @returns {boolean}
|
|
68
|
-
*/
|
|
69
|
-
private isLLMConnected;
|
|
70
|
-
getIsCaptionBoxOn: () => boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Resolves the active LLM publish transport, preferring the practice-session
|
|
73
|
-
* connection only when that session is fully connected.
|
|
74
|
-
* @returns {Object}
|
|
75
|
-
*/
|
|
76
|
-
private getPublishTransport;
|
|
77
63
|
/**
|
|
78
64
|
* Sends Announcement to add voicea to the meeting
|
|
79
65
|
* @returns {void}
|
|
@@ -85,7 +71,7 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
85
71
|
* @param {"DEFAULT" | "AUTO" | "MANUAL"} languageAssignment
|
|
86
72
|
* @returns {Promise}
|
|
87
73
|
*/
|
|
88
|
-
setSpokenLanguage: (languageCode: string, languageAssignment?:
|
|
74
|
+
setSpokenLanguage: (languageCode: string, languageAssignment?: "DEFAULT" | "AUTO" | "MANUAL") => Promise<void>;
|
|
89
75
|
/**
|
|
90
76
|
* Request Language translation
|
|
91
77
|
* @param {string} languageCode
|
|
@@ -112,11 +98,6 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
112
98
|
* @returns {boolean}
|
|
113
99
|
*/
|
|
114
100
|
private isAnnounceProcessing;
|
|
115
|
-
/**
|
|
116
|
-
* is announce processed
|
|
117
|
-
* @returns {boolean}
|
|
118
|
-
*/
|
|
119
|
-
private isAnnounceProcessed;
|
|
120
101
|
/**
|
|
121
102
|
* announce to voicea data chanel
|
|
122
103
|
* @returns {void}
|
|
@@ -153,12 +134,6 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
153
134
|
* @returns {void}
|
|
154
135
|
*/
|
|
155
136
|
onSpokenLanguageUpdate: (languageCode: string, meetingId: any) => void;
|
|
156
|
-
/**
|
|
157
|
-
* In meeting Spoken Language changed event
|
|
158
|
-
* @param {string} serviceId
|
|
159
|
-
* @returns {void}
|
|
160
|
-
*/
|
|
161
|
-
onCaptionServiceIdUpdate: (serviceId: string) => void;
|
|
162
137
|
/**
|
|
163
138
|
* get caption status
|
|
164
139
|
* @returns {string}
|
|
@@ -169,34 +144,5 @@ export declare class VoiceaChannel extends WebexPlugin implements IVoiceaChannel
|
|
|
169
144
|
* @returns {string}
|
|
170
145
|
*/
|
|
171
146
|
getAnnounceStatus: () => string;
|
|
172
|
-
/**
|
|
173
|
-
* update LLM sub‑channel subscriptions.
|
|
174
|
-
*
|
|
175
|
-
* sends a single `subchannelSubscriptionRequest` to LLM,
|
|
176
|
-
* allowing subscribe and unsubscribe subchannel.
|
|
177
|
-
*
|
|
178
|
-
* @param {string[]} options.subscribe Sub‑channels to subscribe to.
|
|
179
|
-
* @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from.
|
|
180
|
-
* @returns {Promise}
|
|
181
|
-
*/
|
|
182
|
-
updateSubchannelSubscriptions: ({ subscribe, unsubscribe, }?: {
|
|
183
|
-
subscribe?: string[];
|
|
184
|
-
unsubscribe?: string[];
|
|
185
|
-
}) => Promise<void>;
|
|
186
|
-
/**
|
|
187
|
-
* Syncs the UI caption intent and updates transcription subchannel
|
|
188
|
-
* subscriptions accordingly.
|
|
189
|
-
*
|
|
190
|
-
* @param {Object} [options] - Subscription options.
|
|
191
|
-
* @param {string[]} [options.subscribe] - Subchannels to subscribe to.
|
|
192
|
-
* @param {string[]} [options.unsubscribe] - Subchannels to unsubscribe from.
|
|
193
|
-
* @param {boolean} [isCaptionBoxOn=false] - Whether captions are intended to be enabled.
|
|
194
|
-
*
|
|
195
|
-
* @returns {Promise<void>}
|
|
196
|
-
*/
|
|
197
|
-
updateSubchannelSubscriptionsAndSyncCaptionState: (options?: {
|
|
198
|
-
subscribe?: string[];
|
|
199
|
-
unsubscribe?: string[];
|
|
200
|
-
}, isCaptionBoxOn?: boolean) => Promise<void>;
|
|
201
147
|
}
|
|
202
148
|
export default VoiceaChannel;
|
package/dist/voicea.js
CHANGED
|
@@ -49,14 +49,12 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
49
49
|
(0, _defineProperty2.default)(_this, "seqNum", void 0);
|
|
50
50
|
(0, _defineProperty2.default)(_this, "areCaptionsEnabled", void 0);
|
|
51
51
|
(0, _defineProperty2.default)(_this, "hasSubscribedToEvents", false);
|
|
52
|
-
(0, _defineProperty2.default)(_this, "
|
|
52
|
+
(0, _defineProperty2.default)(_this, "vmcDeviceId", void 0);
|
|
53
53
|
(0, _defineProperty2.default)(_this, "announceStatus", void 0);
|
|
54
54
|
(0, _defineProperty2.default)(_this, "captionStatus", void 0);
|
|
55
|
-
(0, _defineProperty2.default)(_this, "isCaptionBoxOn", void 0);
|
|
56
55
|
(0, _defineProperty2.default)(_this, "toggleManualCaptionStatus", void 0);
|
|
57
56
|
(0, _defineProperty2.default)(_this, "currentSpokenLanguage", void 0);
|
|
58
57
|
(0, _defineProperty2.default)(_this, "spokenLanguages", []);
|
|
59
|
-
(0, _defineProperty2.default)(_this, "currentCaptionLanguage", void 0);
|
|
60
58
|
/**
|
|
61
59
|
* @param {Object} e
|
|
62
60
|
* @returns {undefined}
|
|
@@ -66,7 +64,7 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
66
64
|
_this.seqNum = e.sequenceNumber + 1;
|
|
67
65
|
switch (e.data.relayType) {
|
|
68
66
|
case _constants.AIBRIDGE_RELAY_TYPES.VOICEA.ANNOUNCEMENT:
|
|
69
|
-
_this.
|
|
67
|
+
_this.vmcDeviceId = e.headers.from;
|
|
70
68
|
_this.announceStatus = _constants.ANNOUNCE_STATUS.JOINED;
|
|
71
69
|
_this.processAnnouncementMessage(e.data.voiceaPayload);
|
|
72
70
|
break;
|
|
@@ -206,36 +204,6 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
206
204
|
// @ts-ignore
|
|
207
205
|
_this.trigger(_constants.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT, voiceaLanguageOptions);
|
|
208
206
|
});
|
|
209
|
-
/**
|
|
210
|
-
* Indicates whether the default or practice-session LLM connection is active.
|
|
211
|
-
* @returns {boolean}
|
|
212
|
-
*/
|
|
213
|
-
(0, _defineProperty2.default)(_this, "isLLMConnected", function () {
|
|
214
|
-
return (
|
|
215
|
-
// @ts-ignore
|
|
216
|
-
_this.webex.internal.llm.isConnected() ||
|
|
217
|
-
// @ts-ignore
|
|
218
|
-
_this.webex.internal.llm.isConnected(_constants.LLM_PRACTICE_SESSION)
|
|
219
|
-
);
|
|
220
|
-
});
|
|
221
|
-
(0, _defineProperty2.default)(_this, "getIsCaptionBoxOn", function () {
|
|
222
|
-
return _this.isCaptionBoxOn;
|
|
223
|
-
});
|
|
224
|
-
/**
|
|
225
|
-
* Resolves the active LLM publish transport, preferring the practice-session
|
|
226
|
-
* connection only when that session is fully connected.
|
|
227
|
-
* @returns {Object}
|
|
228
|
-
*/
|
|
229
|
-
(0, _defineProperty2.default)(_this, "getPublishTransport", function () {
|
|
230
|
-
// @ts-ignore
|
|
231
|
-
var llm = _this.webex.internal.llm;
|
|
232
|
-
var isPracticeSessionConnected = llm.isConnected(_constants.LLM_PRACTICE_SESSION);
|
|
233
|
-
return {
|
|
234
|
-
socket: isPracticeSessionConnected && llm.getSocket(_constants.LLM_PRACTICE_SESSION) || llm.socket,
|
|
235
|
-
binding: isPracticeSessionConnected && llm.getBinding(_constants.LLM_PRACTICE_SESSION) || llm.getBinding(),
|
|
236
|
-
datachannelUrl: isPracticeSessionConnected && llm.getDatachannelUrl(_constants.LLM_PRACTICE_SESSION) || llm.getDatachannelUrl()
|
|
237
|
-
};
|
|
238
|
-
});
|
|
239
207
|
/**
|
|
240
208
|
* Sends Announcement to add voicea to the meeting
|
|
241
209
|
* @returns {void}
|
|
@@ -243,20 +211,15 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
243
211
|
(0, _defineProperty2.default)(_this, "sendAnnouncement", function () {
|
|
244
212
|
_this.announceStatus = _constants.ANNOUNCE_STATUS.JOINING;
|
|
245
213
|
_this.listenToEvents();
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
binding = _this$getPublishTrans.binding;
|
|
249
|
-
socket.send({
|
|
214
|
+
// @ts-ignore
|
|
215
|
+
_this.webex.internal.llm.socket.send({
|
|
250
216
|
id: "".concat(_this.seqNum),
|
|
251
217
|
type: 'publishRequest',
|
|
252
218
|
recipients: {
|
|
253
219
|
// @ts-ignore
|
|
254
|
-
route:
|
|
220
|
+
route: _this.webex.internal.llm.getBinding()
|
|
255
221
|
},
|
|
256
|
-
|
|
257
|
-
headers: _this.captionServiceId ? {
|
|
258
|
-
to: _this.captionServiceId
|
|
259
|
-
} : {},
|
|
222
|
+
headers: {},
|
|
260
223
|
data: {
|
|
261
224
|
clientPayload: {
|
|
262
225
|
version: 'v2'
|
|
@@ -302,21 +265,18 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
302
265
|
* @returns {void}
|
|
303
266
|
*/
|
|
304
267
|
(0, _defineProperty2.default)(_this, "requestLanguage", function (languageCode) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
socket = _this$getPublishTrans2.socket,
|
|
310
|
-
binding = _this$getPublishTrans2.binding;
|
|
311
|
-
socket.send({
|
|
268
|
+
// @ts-ignore
|
|
269
|
+
if (!_this.webex.internal.llm.isConnected()) return;
|
|
270
|
+
// @ts-ignore
|
|
271
|
+
_this.webex.internal.llm.socket.send({
|
|
312
272
|
id: "".concat(_this.seqNum),
|
|
313
273
|
type: 'publishRequest',
|
|
314
274
|
recipients: {
|
|
315
275
|
// @ts-ignore
|
|
316
|
-
route:
|
|
276
|
+
route: _this.webex.internal.llm.getBinding()
|
|
317
277
|
},
|
|
318
278
|
headers: {
|
|
319
|
-
to: _this.
|
|
279
|
+
to: _this.vmcDeviceId
|
|
320
280
|
},
|
|
321
281
|
data: {
|
|
322
282
|
clientPayload: {
|
|
@@ -328,7 +288,6 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
328
288
|
},
|
|
329
289
|
trackingId: "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString())
|
|
330
290
|
});
|
|
331
|
-
_this.currentCaptionLanguage = languageCode;
|
|
332
291
|
_this.seqNum += 1;
|
|
333
292
|
});
|
|
334
293
|
/**
|
|
@@ -340,18 +299,16 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
340
299
|
* @returns {void}
|
|
341
300
|
*/
|
|
342
301
|
(0, _defineProperty2.default)(_this, "sendManualClosedCaption", function (text, timeStamp, csis, isFinal) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
binding = _this$getPublishTrans3.binding;
|
|
349
|
-
socket === null || socket === void 0 ? void 0 : socket.send({
|
|
302
|
+
// @ts-ignore
|
|
303
|
+
if (!_this.webex.internal.llm.isConnected()) return;
|
|
304
|
+
|
|
305
|
+
// @ts-ignore
|
|
306
|
+
_this.webex.internal.llm.socket.send({
|
|
350
307
|
id: "".concat(_this.seqNum),
|
|
351
308
|
type: 'publishRequest',
|
|
352
309
|
recipients: {
|
|
353
310
|
// @ts-ignore
|
|
354
|
-
route:
|
|
311
|
+
route: _this.webex.internal.llm.getBinding()
|
|
355
312
|
},
|
|
356
313
|
headers: {},
|
|
357
314
|
data: {
|
|
@@ -402,9 +359,6 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
402
359
|
_this.areCaptionsEnabled = true;
|
|
403
360
|
_this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.ENABLED;
|
|
404
361
|
_this.announce();
|
|
405
|
-
_this.updateSubchannelSubscriptionsAndSyncCaptionState({
|
|
406
|
-
subscribe: ['transcription']
|
|
407
|
-
}, true);
|
|
408
362
|
}).catch(function () {
|
|
409
363
|
_this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;
|
|
410
364
|
throw new Error('turn on captions fail');
|
|
@@ -417,22 +371,14 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
417
371
|
(0, _defineProperty2.default)(_this, "isAnnounceProcessing", function () {
|
|
418
372
|
return [_constants.ANNOUNCE_STATUS.JOINING, _constants.ANNOUNCE_STATUS.JOINED].includes(_this.announceStatus);
|
|
419
373
|
});
|
|
420
|
-
/**
|
|
421
|
-
* is announce processed
|
|
422
|
-
* @returns {boolean}
|
|
423
|
-
*/
|
|
424
|
-
(0, _defineProperty2.default)(_this, "isAnnounceProcessed", function () {
|
|
425
|
-
return _this.announceStatus === _constants.ANNOUNCE_STATUS.JOINED;
|
|
426
|
-
});
|
|
427
374
|
/**
|
|
428
375
|
* announce to voicea data chanel
|
|
429
376
|
* @returns {void}
|
|
430
377
|
*/
|
|
431
378
|
(0, _defineProperty2.default)(_this, "announce", function () {
|
|
432
|
-
if (_this.
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
if (!_this.isLLMConnected()) {
|
|
379
|
+
if (_this.isAnnounceProcessing()) return;
|
|
380
|
+
// @ts-ignore
|
|
381
|
+
if (!_this.webex.internal.llm.isConnected()) {
|
|
436
382
|
throw new Error('voicea can not announce before llm connected');
|
|
437
383
|
}
|
|
438
384
|
_this.sendAnnouncement();
|
|
@@ -460,7 +406,7 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
460
406
|
}
|
|
461
407
|
return _context.abrupt("return", undefined);
|
|
462
408
|
case 1:
|
|
463
|
-
if (_this.
|
|
409
|
+
if (_this.webex.internal.llm.isConnected()) {
|
|
464
410
|
_context.next = 2;
|
|
465
411
|
break;
|
|
466
412
|
}
|
|
@@ -543,23 +489,6 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
543
489
|
});
|
|
544
490
|
_this.currentSpokenLanguage = languageCode;
|
|
545
491
|
});
|
|
546
|
-
/**
|
|
547
|
-
* In meeting Spoken Language changed event
|
|
548
|
-
* @param {string} serviceId
|
|
549
|
-
* @returns {void}
|
|
550
|
-
*/
|
|
551
|
-
(0, _defineProperty2.default)(_this, "onCaptionServiceIdUpdate", function (serviceId) {
|
|
552
|
-
if (!serviceId) {
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
if (_this.captionServiceId !== serviceId) {
|
|
556
|
-
_this.captionServiceId = serviceId;
|
|
557
|
-
// if service id value has changed and the translation language has been set, client needs to resend the translator language message to the LLM.
|
|
558
|
-
if (_this.currentCaptionLanguage) {
|
|
559
|
-
_this.requestLanguage(_this.currentCaptionLanguage);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
});
|
|
563
492
|
/**
|
|
564
493
|
* get caption status
|
|
565
494
|
* @returns {string}
|
|
@@ -574,85 +503,13 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
574
503
|
(0, _defineProperty2.default)(_this, "getAnnounceStatus", function () {
|
|
575
504
|
return _this.announceStatus;
|
|
576
505
|
});
|
|
577
|
-
/**
|
|
578
|
-
* update LLM sub‑channel subscriptions.
|
|
579
|
-
*
|
|
580
|
-
* sends a single `subchannelSubscriptionRequest` to LLM,
|
|
581
|
-
* allowing subscribe and unsubscribe subchannel.
|
|
582
|
-
*
|
|
583
|
-
* @param {string[]} options.subscribe Sub‑channels to subscribe to.
|
|
584
|
-
* @param {string[]} options.unsubscribe Sub‑channels to unsubscribe from.
|
|
585
|
-
* @returns {Promise}
|
|
586
|
-
*/
|
|
587
|
-
(0, _defineProperty2.default)(_this, "updateSubchannelSubscriptions", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
588
|
-
var _ref3,
|
|
589
|
-
_ref3$subscribe,
|
|
590
|
-
subscribe,
|
|
591
|
-
_ref3$unsubscribe,
|
|
592
|
-
unsubscribe,
|
|
593
|
-
isDataChannelTokenEnabled,
|
|
594
|
-
_this$getPublishTrans4,
|
|
595
|
-
socket,
|
|
596
|
-
datachannelUrl,
|
|
597
|
-
_args2 = arguments;
|
|
598
|
-
return _regenerator.default.wrap(function (_context2) {
|
|
599
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
600
|
-
case 0:
|
|
601
|
-
_ref3 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref3$subscribe = _ref3.subscribe, subscribe = _ref3$subscribe === void 0 ? [] : _ref3$subscribe, _ref3$unsubscribe = _ref3.unsubscribe, unsubscribe = _ref3$unsubscribe === void 0 ? [] : _ref3$unsubscribe;
|
|
602
|
-
_context2.next = 1;
|
|
603
|
-
return _this.webex.internal.llm.isDataChannelTokenEnabled();
|
|
604
|
-
case 1:
|
|
605
|
-
isDataChannelTokenEnabled = _context2.sent;
|
|
606
|
-
if (!(!_this.isLLMConnected() || !isDataChannelTokenEnabled)) {
|
|
607
|
-
_context2.next = 2;
|
|
608
|
-
break;
|
|
609
|
-
}
|
|
610
|
-
return _context2.abrupt("return");
|
|
611
|
-
case 2:
|
|
612
|
-
_this$getPublishTrans4 = _this.getPublishTransport(), socket = _this$getPublishTrans4.socket, datachannelUrl = _this$getPublishTrans4.datachannelUrl; // @ts-ignore
|
|
613
|
-
socket.send({
|
|
614
|
-
id: "".concat(_this.seqNum),
|
|
615
|
-
type: 'subchannelSubscriptionRequest',
|
|
616
|
-
data: {
|
|
617
|
-
// @ts-ignore
|
|
618
|
-
datachannelUri: datachannelUrl,
|
|
619
|
-
subscribe: subscribe,
|
|
620
|
-
unsubscribe: unsubscribe
|
|
621
|
-
},
|
|
622
|
-
trackingId: "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString())
|
|
623
|
-
});
|
|
624
|
-
_this.seqNum += 1;
|
|
625
|
-
case 3:
|
|
626
|
-
case "end":
|
|
627
|
-
return _context2.stop();
|
|
628
|
-
}
|
|
629
|
-
}, _callee2);
|
|
630
|
-
})));
|
|
631
|
-
/**
|
|
632
|
-
* Syncs the UI caption intent and updates transcription subchannel
|
|
633
|
-
* subscriptions accordingly.
|
|
634
|
-
*
|
|
635
|
-
* @param {Object} [options] - Subscription options.
|
|
636
|
-
* @param {string[]} [options.subscribe] - Subchannels to subscribe to.
|
|
637
|
-
* @param {string[]} [options.unsubscribe] - Subchannels to unsubscribe from.
|
|
638
|
-
* @param {boolean} [isCaptionBoxOn=false] - Whether captions are intended to be enabled.
|
|
639
|
-
*
|
|
640
|
-
* @returns {Promise<void>}
|
|
641
|
-
*/
|
|
642
|
-
(0, _defineProperty2.default)(_this, "updateSubchannelSubscriptionsAndSyncCaptionState", function () {
|
|
643
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
644
|
-
var isCaptionBoxOn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
645
|
-
_this.isCaptionBoxOn = isCaptionBoxOn;
|
|
646
|
-
return _this.updateSubchannelSubscriptions(options);
|
|
647
|
-
});
|
|
648
506
|
_this.seqNum = 1;
|
|
649
507
|
_this.areCaptionsEnabled = false;
|
|
650
|
-
_this.
|
|
508
|
+
_this.vmcDeviceId = undefined;
|
|
651
509
|
_this.announceStatus = _constants.ANNOUNCE_STATUS.IDLE;
|
|
652
510
|
_this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;
|
|
653
511
|
_this.toggleManualCaptionStatus = _constants.TOGGLE_MANUAL_CAPTION_STATUS.IDLE;
|
|
654
512
|
_this.currentSpokenLanguage = _constants.DEFAULT_SPOKEN_LANGUAGE;
|
|
655
|
-
_this.currentCaptionLanguage = undefined;
|
|
656
513
|
return _this;
|
|
657
514
|
}
|
|
658
515
|
(0, _inherits2.default)(VoiceaChannel, _WebexPlugin);
|
|
@@ -667,8 +524,6 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
667
524
|
if (!this.hasSubscribedToEvents) {
|
|
668
525
|
// @ts-ignore
|
|
669
526
|
this.webex.internal.llm.on('event:relay.event', this.eventProcessor);
|
|
670
|
-
// @ts-ignore
|
|
671
|
-
this.webex.internal.llm.on("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), this.eventProcessor);
|
|
672
527
|
this.hasSubscribedToEvents = true;
|
|
673
528
|
}
|
|
674
529
|
}
|
|
@@ -681,18 +536,14 @@ var VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin)
|
|
|
681
536
|
key: "deregisterEvents",
|
|
682
537
|
value: function deregisterEvents() {
|
|
683
538
|
this.areCaptionsEnabled = false;
|
|
684
|
-
this.
|
|
685
|
-
this.captionServiceId = undefined;
|
|
539
|
+
this.vmcDeviceId = undefined;
|
|
686
540
|
// @ts-ignore
|
|
687
541
|
this.webex.internal.llm.off('event:relay.event', this.eventProcessor);
|
|
688
|
-
// @ts-ignore
|
|
689
|
-
this.webex.internal.llm.off("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), this.eventProcessor);
|
|
690
542
|
this.hasSubscribedToEvents = false;
|
|
691
543
|
this.announceStatus = _constants.ANNOUNCE_STATUS.IDLE;
|
|
692
544
|
this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;
|
|
693
545
|
this.toggleManualCaptionStatus = _constants.TOGGLE_MANUAL_CAPTION_STATUS.IDLE;
|
|
694
546
|
this.currentSpokenLanguage = undefined;
|
|
695
|
-
this.currentCaptionLanguage = undefined;
|
|
696
547
|
}
|
|
697
548
|
}]);
|
|
698
549
|
}(_webexCore.WebexPlugin);
|