@webex/plugin-meetings 3.12.0-webex-services-ready.4 → 3.13.0
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/.sdd/manifest.json +1312 -0
- package/.sdd/templates/.source.json +30 -0
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
- package/.sdd/templates/component-repo/template-map.json +112 -0
- package/AGENTS.md +130 -4
- package/ai-docs/ARCHITECTURE.md +208 -0
- package/ai-docs/CONTRACTS.md +267 -0
- package/ai-docs/DATA_MODEL.md +64 -0
- package/ai-docs/GETTING_STARTED.md +73 -0
- package/ai-docs/GLOSSARY.md +56 -0
- package/ai-docs/REVIEW_CHECKLIST.md +45 -0
- package/ai-docs/RULES.md +79 -0
- package/ai-docs/SECURITY.md +74 -0
- package/ai-docs/SERVICE_STATE.md +59 -0
- package/ai-docs/SPEC_INDEX.md +85 -0
- package/ai-docs/TEST_INDEX.md +45 -0
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
- package/ai-docs/patterns/defensive-error-propagation.md +55 -0
- package/ai-docs/patterns/event-scope-emission.md +46 -0
- package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
- package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
- package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
- package/assets/README.md +28 -0
- package/assets/e2ee-0.0.1.js +2 -0
- package/assets/e2ee-0.0.1.wasm +0 -0
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/annotation/index.js +55 -19
- package/dist/annotation/index.js.map +1 -1
- package/dist/assets/e2ee-0.0.1.js +2 -0
- package/dist/assets/e2ee-0.0.1.wasm +0 -0
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +39 -5
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +7 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +6 -5
- package/dist/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +101 -48
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +41 -59
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +1 -1
- package/dist/interceptors/locusRetry.js.map +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/locus-info/index.js +236 -80
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/types.js +2 -1
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +225 -175
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/meeting/index.js +355 -299
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +8 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +2 -1
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +10 -3
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +72 -31
- package/dist/meetings/index.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +32 -4
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +11 -1
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/common/errors/webex-errors.d.ts +6 -2
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/hashTree/hashTreeParser.d.ts +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/locus-info/index.d.ts +45 -1
- package/dist/types/locus-info/types.d.ts +1 -0
- package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -53
- package/dist/types/meeting/index.d.ts +49 -12
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +2 -1
- package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
- package/dist/types/multistream/sendSlotManager.d.ts +5 -1
- package/dist/webinar/index.js +298 -255
- package/dist/webinar/index.js.map +1 -1
- package/package.json +25 -23
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/annotation/ai-docs/annotation-spec.md +236 -0
- package/src/annotation/index.ts +61 -29
- package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
- package/src/breakouts/index.ts +35 -2
- package/src/common/errors/webex-errors.ts +8 -2
- package/src/config.ts +5 -1
- package/src/constants.ts +2 -1
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
- package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
- package/src/hashTree/hashTreeParser.ts +67 -3
- package/src/index.ts +1 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interceptors/dataChannelAuthToken.ts +48 -77
- package/src/interceptors/locusRetry.ts +1 -1
- package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
- package/src/interpretation/index.ts +38 -1
- package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
- package/src/locus-info/index.ts +156 -35
- package/src/locus-info/types.ts +1 -0
- package/src/media/MediaConnectionAwaiter.ts +223 -207
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/meeting/ai-docs/meeting-spec.md +404 -0
- package/src/meeting/index.ts +332 -296
- package/src/meeting/util.ts +7 -4
- package/src/meeting/voicea-meeting.ts +1 -1
- package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
- package/src/meeting-info/meeting-info-v2.ts +7 -2
- package/src/meetings/ai-docs/meetings-spec.md +296 -0
- package/src/meetings/index.ts +59 -23
- package/src/member/ai-docs/member-spec.md +196 -0
- package/src/members/ai-docs/members-spec.md +256 -0
- package/src/metrics/ai-docs/metrics-spec.md +185 -0
- package/src/multistream/ai-docs/multistream-spec.md +295 -0
- package/src/multistream/remoteMediaManager.ts +23 -1
- package/src/multistream/sendSlotManager.ts +15 -1
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
- package/src/reachability/ai-docs/reachability-spec.md +261 -0
- package/src/reactions/ai-docs/reactions-spec.md +198 -0
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
- package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
- package/src/roap/ai-docs/roap-spec.md +241 -0
- package/src/webinar/ai-docs/webinar-spec.md +243 -0
- package/src/webinar/index.ts +168 -188
- package/test/unit/spec/annotation/index.ts +214 -182
- package/test/unit/spec/breakouts/index.ts +145 -13
- package/test/unit/spec/hashTree/hashTreeParser.ts +212 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
- package/test/unit/spec/interceptors/locusRetry.ts +29 -1
- package/test/unit/spec/interpretation/index.ts +93 -0
- package/test/unit/spec/locus-info/index.js +397 -0
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +426 -19
- package/test/unit/spec/media/properties.ts +3 -3
- package/test/unit/spec/meeting/index.js +1219 -723
- package/test/unit/spec/meeting/utils.js +52 -18
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +69 -1
- package/test/unit/spec/meetings/index.js +145 -43
- package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +30 -2
- package/test/unit/spec/webinar/index.ts +886 -718
package/dist/index.js
CHANGED
|
@@ -229,6 +229,7 @@ _Object$defineProperty(exports, "getAIEnablementApprover", {
|
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
exports.sdkAnnotationTypes = void 0;
|
|
232
|
+
require("@webex/internal-plugin-identity");
|
|
232
233
|
var _webexCore = require("@webex/webex-core");
|
|
233
234
|
var _meetings = _interopRequireDefault(require("./meetings"));
|
|
234
235
|
var _config = _interopRequireDefault(require("./config"));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["require","_webexCore","_meetings","_interopRequireDefault","_config","_interceptors","_captchaError","_intentToJoin","_passwordError","_permission","_joinWebinarError","_reclaimHostRoleErrors","_meeting","_utilv","_joinMeeting","_webexErrors","_mediaHelpers","_CONSTANTS","_interopRequireWildcard","exports","CONSTANTS","_REACTIONS","REACTIONS","_sdkAnnotationTypes","sdkAnnotationTypes","_MeetingInfoV","MeetingInfoV2","_meetings2","_remoteMedia","_triggerProxy","_utils","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","_typeof","has","get","set","_t","hasOwnProperty","call","_Object$defineProperty","_Object$getOwnPropertyDescriptor","registerPlugin","Meetings","config","interceptors","LocusRetryStatusInterceptor","create","LocusRouteTokenInterceptor","DataChannelAuthTokenInterceptor","_default"],"sources":["index.ts"],"sourcesContent":["/* eslint-env browser */\nimport '@webex/internal-plugin-identity';\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Meetings from './meetings';\nimport config from './config';\nimport {\n LocusRetryStatusInterceptor,\n LocusRouteTokenInterceptor,\n DataChannelAuthTokenInterceptor,\n} from './interceptors';\nimport CaptchaError from './common/errors/captcha-error';\nimport IntentToJoinError from './common/errors/intent-to-join';\nimport PasswordError from './common/errors/password-error';\nimport PermissionError from './common/errors/permission';\nimport JoinWebinarError from './common/errors/join-webinar-error';\nimport {\n ReclaimHostEmptyWrongKeyError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n} from './common/errors/reclaim-host-role-errors';\nimport Meeting from './meeting';\nimport MeetingInfoUtil from './meeting-info/utilv2';\nimport JoinMeetingError from './common/errors/join-meeting';\nimport {SdpResponseTimeoutError} from './common/errors/webex-errors';\n\nregisterPlugin('meetings', Meetings, {\n config,\n interceptors: {\n LocusRetryStatusInterceptor: LocusRetryStatusInterceptor.create,\n LocusRouteTokenInterceptor: LocusRouteTokenInterceptor.create,\n DataChannelAuthTokenInterceptor: DataChannelAuthTokenInterceptor.create,\n },\n});\n\nexport {\n LocalStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n LocalStreamEventNames,\n StreamEventNames,\n RemoteStreamEventNames,\n type ServerMuteReason,\n LocalMicrophoneStreamEventNames,\n LocalCameraStreamEventNames,\n LocalMicrophoneStream,\n LocalCameraStream,\n createMicrophoneStream,\n createCameraStream,\n createCameraAndMicrophoneStreams,\n createDisplayStream,\n createDisplayStreamWithAudio,\n createDisplayMedia,\n FacingMode,\n DisplaySurface,\n PresetCameraConstraints,\n type VideoContentHint,\n type StreamState,\n} from '@webex/media-helpers';\n\nexport default Meetings;\n\nexport * as CONSTANTS from './constants';\nexport * as REACTIONS from './reactions/reactions';\nexport * as sdkAnnotationTypes from './annotation/annotation.types';\nexport * as MeetingInfoV2 from './meeting-info/meeting-info-v2';\nexport {type Reaction} from './reactions/reactions.type';\nexport {SitePreferenceSelectOption} from './meetings/meetings.types';\nexport type {\n FetchSitePreferencesMeViaSiteOptions,\n SitePreferencesResponse,\n} from './meetings/meetings.types';\nexport type {Interpreter, InterpreterUsingResource} from './interpretation/interpretation.types';\n\nexport {\n CaptchaError,\n IntentToJoinError,\n JoinMeetingError,\n PasswordError,\n PermissionError,\n ReclaimHostIsHostAlreadyError,\n ReclaimHostNotAllowedError,\n ReclaimHostNotSupportedError,\n ReclaimHostEmptyWrongKeyError,\n Meeting,\n MeetingInfoUtil,\n JoinWebinarError,\n SdpResponseTimeoutError,\n};\n\nexport {RemoteMedia} from './multistream/remoteMedia';\n\nexport {default as TriggerProxy} from './common/events/trigger-proxy';\n\nexport {getAIEnablementApprover} from './aiEnableRequest/utils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACAA,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,aAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,cAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,I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GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAM,GAAA,CAAAZ,CAAA,UAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,GAAAM,CAAA,CAAAQ,GAAA,CAAAd,CAAA,EAAAQ,CAAA,cAAAO,EAAA,IAAAf,CAAA,gBAAAe,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,EAAA,OAAAR,CAAA,IAAAD,CAAA,GAAAY,sBAAA,KAAAC,gCAAA,CAAAnB,CAAA,EAAAe,EAAA,OAAAR,CAAA,CAAAM,GAAA,IAAAN,CAAA,CAAAO,GAAA,IAAAR,CAAA,CAAAE,CAAA,EAAAO,EAAA,EAAAR,CAAA,IAAAC,CAAA,CAAAO,EAAA,IAAAf,CAAA,CAAAe,EAAA,WAAAP,CAAA,KAAAR,CAAA,EAAAC,CAAA;AA/FhE;;AA2BA,IAAAmB,yBAAc,EAAC,UAAU,EAAEC,iBAAQ,EAAE;EACnCC,MAAM,EAANA,eAAM;EACNC,YAAY,EAAE;IACZC,2BAA2B,EAAEA,yCAA2B,CAACC,MAAM;IAC/DC,0BAA0B,EAAEA,wCAA0B,CAACD,MAAM;IAC7DE,+BAA+B,EAAEA,6CAA+B,CAACF;EACnE;AACF,CAAC,CAAC;AAAC,IAAAG,QAAA,GAAAxC,OAAA,CAAAsB,OAAA,GA2BYW,iBAAQ","ignoreList":[]}
|
|
@@ -25,11 +25,10 @@ var _internalPluginLlm = _interopRequireDefault(require("@webex/internal-plugin-
|
|
|
25
25
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
26
26
|
var _constant = require("./constant");
|
|
27
27
|
var _utils = require("./utils");
|
|
28
|
-
var _constants = require("../constants");
|
|
29
28
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
30
29
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*!
|
|
31
30
|
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
32
|
-
*/
|
|
31
|
+
*/ // @ts-ignore - internal-plugin-llm types
|
|
33
32
|
var retryCountMap = new _map.default();
|
|
34
33
|
/**
|
|
35
34
|
* @class
|
|
@@ -257,82 +256,65 @@ var DataChannelAuthTokenInterceptor = exports.default = /*#__PURE__*/function (_
|
|
|
257
256
|
}
|
|
258
257
|
return isDataChannelTokenEnabled;
|
|
259
258
|
}(),
|
|
260
|
-
// Route refresh by request URL
|
|
261
|
-
// 1)
|
|
262
|
-
// 2) If
|
|
263
|
-
// If
|
|
259
|
+
// Route refresh by request URL:
|
|
260
|
+
// 1) Find the LLM channel that matches the request URL
|
|
261
|
+
// 2) If found, use its refresh handler
|
|
262
|
+
// 3) If no channel matches, fall back to finding the meeting by locusUrl
|
|
264
263
|
refreshDataChannelToken: function () {
|
|
265
264
|
var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(requestUrl) {
|
|
266
|
-
var
|
|
267
|
-
var
|
|
265
|
+
var _this3$meetings;
|
|
266
|
+
var channel, result, datachannelToken, allMeetings, meeting, _result, _datachannelToken;
|
|
268
267
|
return _regenerator.default.wrap(function (_context5) {
|
|
269
268
|
while (1) switch (_context5.prev = _context5.next) {
|
|
270
269
|
case 0:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// @ts-ignore
|
|
276
|
-
locusUrl = (_this3$internal$llm$g2 = (_this3$internal$llm2 = _this3.internal.llm).getLocusUrlByDatachannelUrl) === null || _this3$internal$llm$g2 === void 0 ? void 0 : _this3$internal$llm$g2.call(_this3$internal$llm2, requestUrl);
|
|
277
|
-
if (locusUrl) {
|
|
278
|
-
// @ts-ignore
|
|
279
|
-
meeting = (_this3$meetings = _this3.meetings) === null || _this3$meetings === void 0 ? void 0 : (_this3$meetings$getMe = _this3$meetings.getMeetingByType) === null || _this3$meetings$getMe === void 0 ? void 0 : _this3$meetings$getMe.call(_this3$meetings, _constants.LOCUS_URL, locusUrl);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (!meeting) {
|
|
283
|
-
// Fallback: registerAndConnect() pre-populates datachannelUrl in
|
|
284
|
-
// connections before calling register(), so getSessionIdByDatachannelUrl
|
|
285
|
-
// above should normally resolve. This scan covers any residual gap
|
|
286
|
-
// where connections are not yet populated (e.g. if setRefreshHandler
|
|
287
|
-
// is called on a session that has no connection entry at all).
|
|
288
|
-
// @ts-ignore
|
|
289
|
-
allMeetings = ((_this3$meetings2 = _this3.meetings) === null || _this3$meetings2 === void 0 ? void 0 : (_this3$meetings2$getA = _this3$meetings2.getAllMeetings) === null || _this3$meetings2$getA === void 0 ? void 0 : _this3$meetings2$getA.call(_this3$meetings2)) || {};
|
|
290
|
-
meeting = (0, _values.default)(allMeetings).find(function (activeMeeting) {
|
|
291
|
-
var _activeMeeting$locusI;
|
|
292
|
-
var info = (activeMeeting === null || activeMeeting === void 0 ? void 0 : (_activeMeeting$locusI = activeMeeting.locusInfo) === null || _activeMeeting$locusI === void 0 ? void 0 : _activeMeeting$locusI.info) || {};
|
|
293
|
-
return info.practiceSessionDatachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.practiceSessionDatachannelUrl) || info.datachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl);
|
|
294
|
-
});
|
|
295
|
-
if (!sessionId) {
|
|
296
|
-
// @ts-ignore
|
|
297
|
-
info = ((_meeting = meeting) === null || _meeting === void 0 ? void 0 : (_meeting$locusInfo = _meeting.locusInfo) === null || _meeting$locusInfo === void 0 ? void 0 : _meeting$locusInfo.info) || {};
|
|
298
|
-
if (info.practiceSessionDatachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.practiceSessionDatachannelUrl)) {
|
|
299
|
-
sessionId = _constants.LLM_PRACTICE_SESSION;
|
|
300
|
-
} else if (info.datachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl)) {
|
|
301
|
-
sessionId = _constants.LLM_DEFAULT_SESSION;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
if (!meeting) {
|
|
307
|
-
_context5.next = 2;
|
|
270
|
+
// @ts-ignore
|
|
271
|
+
channel = _this3.internal.llm.getChannelByDatachannelUrl(requestUrl);
|
|
272
|
+
if (!channel) {
|
|
273
|
+
_context5.next = 3;
|
|
308
274
|
break;
|
|
309
275
|
}
|
|
310
276
|
_context5.next = 1;
|
|
311
|
-
return
|
|
277
|
+
return channel.refreshDataChannelToken();
|
|
312
278
|
case 1:
|
|
313
279
|
result = _context5.sent;
|
|
314
|
-
|
|
315
|
-
|
|
280
|
+
if (result !== null && result !== void 0 && result.body) {
|
|
281
|
+
_context5.next = 2;
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
throw new Error('DataChannel token refresh returned no payload');
|
|
316
285
|
case 2:
|
|
317
|
-
|
|
318
|
-
|
|
286
|
+
datachannelToken = result.body.datachannelToken;
|
|
287
|
+
channel.setDatachannelToken(datachannelToken);
|
|
288
|
+
return _context5.abrupt("return", datachannelToken);
|
|
319
289
|
case 3:
|
|
320
|
-
|
|
290
|
+
// No channel found - fallback to finding meeting by matching datachannel URLs
|
|
291
|
+
// @ts-ignore
|
|
292
|
+
allMeetings = ((_this3$meetings = _this3.meetings) === null || _this3$meetings === void 0 ? void 0 : _this3$meetings.getAllMeetings()) || {};
|
|
293
|
+
meeting = (0, _values.default)(allMeetings).find(function (activeMeeting) {
|
|
294
|
+
var _activeMeeting$locusI;
|
|
295
|
+
var info = (activeMeeting === null || activeMeeting === void 0 ? void 0 : (_activeMeeting$locusI = activeMeeting.locusInfo) === null || _activeMeeting$locusI === void 0 ? void 0 : _activeMeeting$locusI.info) || {};
|
|
296
|
+
return info.practiceSessionDatachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.practiceSessionDatachannelUrl) || info.datachannelUrl && _internalPluginLlm.default.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl);
|
|
297
|
+
});
|
|
298
|
+
if (!meeting) {
|
|
299
|
+
_context5.next = 6;
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
_context5.next = 4;
|
|
303
|
+
return meeting.refreshDataChannelToken();
|
|
321
304
|
case 4:
|
|
322
|
-
|
|
305
|
+
_result = _context5.sent;
|
|
306
|
+
if (_result !== null && _result !== void 0 && _result.body) {
|
|
323
307
|
_context5.next = 5;
|
|
324
308
|
break;
|
|
325
309
|
}
|
|
326
310
|
throw new Error('DataChannel token refresh returned no payload');
|
|
327
311
|
case 5:
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
// @ts-ignore
|
|
332
|
-
((_meeting2 = meeting) === null || _meeting2 === void 0 ? void 0 : _meeting2.id) || ((_this3$internal$llm$g3 = (_this3$internal$llm3 = _this3.internal.llm).getOwnerMeetingId) === null || _this3$internal$llm$g3 === void 0 ? void 0 : _this3$internal$llm$g3.call(_this3$internal$llm3, tokenStoreKey)); // @ts-ignore
|
|
333
|
-
_this3.internal.llm.setDatachannelToken(datachannelToken, tokenStoreKey, ownerMeetingId);
|
|
334
|
-
return _context5.abrupt("return", datachannelToken);
|
|
312
|
+
_datachannelToken = _result.body.datachannelToken; // Store token on the meeting's LLM channel if available
|
|
313
|
+
meeting.setLLMChannelDataToken(_datachannelToken);
|
|
314
|
+
return _context5.abrupt("return", _datachannelToken);
|
|
335
315
|
case 6:
|
|
316
|
+
throw new Error('No LLM channel or meeting found for request URL');
|
|
317
|
+
case 7:
|
|
336
318
|
case "end":
|
|
337
319
|
return _context5.stop();
|
|
338
320
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_httpCore","require","_internalPluginLlm","_interopRequireDefault","_loggerProxy","_constant","_utils","_constants","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","retryCountMap","_map","DataChannelAuthTokenInterceptor","exports","_Interceptor","options","_this","_classCallCheck2","_defineProperty2","_refreshDataChannelToken","refreshDataChannelToken","_isDataChannelTokenEnabled","isDataChannelTokenEnabled","_inherits2","_createClass2","key","value","getRetryKey","RETRY_KEY","concat","_now","Math","random","getHeader","headers","name","_keys","find","k","toLowerCase","undefined","_onRequest","_asyncToGenerator2","_regenerator","mark","_callee","token","enabled","newToken","_t","wrap","_context","prev","next","DATA_CHANNEL_AUTH_HEADER","sent","abrupt","isJwtTokenExpired","uri","url","LoggerProxy","logger","warn","message","stop","onRequest","_x","arguments","_onResponseError","_callee2","reason","retryCount","_context2","_promise","reject","statusCode","get","MAX_RETRY","error","delete","set","refreshTokenAndRetryWithDelay","onResponseError","_x2","_x3","_this2","resolve","setTimeout","_callee3","res","msg","err","_t2","_context3","webex","request","String","Error","original","RETRY_INTERVAL","create","_this3","_callee4","_context4","internal","llm","_callee5","requestUrl","_result","_meeting2","_this3$internal$llm$g3","_this3$internal$llm3","sessionId","meeting","_this3$internal$llm$g","_this3$internal$llm","_this3$internal$llm$g2","_this3$internal$llm2","locusUrl","_this3$meetings","_this3$meetings$getMe","_this3$meetings2","_this3$meetings2$getA","allMeetings","_meeting","_meeting$locusInfo","info","result","_result$body","datachannelToken","dataChannelTokenType","tokenStoreKey","ownerMeetingId","_context5","getSessionIdByDatachannelUrl","getLocusUrlByDatachannelUrl","meetings","getMeetingByType","LOCUS_URL","getAllMeetings","_values","activeMeeting","_activeMeeting$locusI","locusInfo","practiceSessionDatachannelUrl","LLMChannel","matchesDatachannelRequestUrl","datachannelUrl","LLM_PRACTICE_SESSION","LLM_DEFAULT_SESSION","body","id","getOwnerMeetingId","setDatachannelToken","_x4","Interceptor"],"sources":["dataChannelAuthToken.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\nimport LLMChannel from '@webex/internal-plugin-llm';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {DATA_CHANNEL_AUTH_HEADER, MAX_RETRY, RETRY_INTERVAL, RETRY_KEY} from './constant';\nimport {isJwtTokenExpired} from './utils';\nimport {LLM_DEFAULT_SESSION, LLM_PRACTICE_SESSION, LOCUS_URL} from '../constants';\n\nconst retryCountMap = new Map();\ninterface HttpLikeError extends Error {\n statusCode?: number;\n original?: any;\n}\n/**\n * @class\n */\nexport default class DataChannelAuthTokenInterceptor extends Interceptor {\n private _refreshDataChannelToken: (requestUrl?: string) => Promise<string>;\n private _isDataChannelTokenEnabled: () => Promise<boolean>;\n constructor(options) {\n super(options);\n\n this._refreshDataChannelToken = options.refreshDataChannelToken;\n this._isDataChannelTokenEnabled = options.isDataChannelTokenEnabled;\n }\n\n /**\n * @returns {DataChannelAuthTokenInterceptor}\n */\n static create() {\n // @ts-ignore\n return new DataChannelAuthTokenInterceptor({\n webex: this,\n\n isDataChannelTokenEnabled: async () => {\n // @ts-ignore\n return this.internal.llm.isDataChannelTokenEnabled();\n },\n\n // Route refresh by request URL in two steps:\n // 1) Match active LLM sessions (supports non-default/multiple sessions)\n // 2) If no session matches, resolve locusUrl and refresh via owning meeting\n // If neither route matches, fall back to the default-session refresh.\n refreshDataChannelToken: async (requestUrl?: string) => {\n let sessionId;\n let meeting;\n\n if (typeof requestUrl === 'string') {\n // @ts-ignore\n sessionId = this.internal.llm.getSessionIdByDatachannelUrl?.(requestUrl);\n\n if (!sessionId) {\n // @ts-ignore\n const locusUrl = this.internal.llm.getLocusUrlByDatachannelUrl?.(requestUrl);\n\n if (locusUrl) {\n // @ts-ignore\n meeting = this.meetings?.getMeetingByType?.(LOCUS_URL, locusUrl);\n }\n }\n\n if (!meeting) {\n // Fallback: registerAndConnect() pre-populates datachannelUrl in\n // connections before calling register(), so getSessionIdByDatachannelUrl\n // above should normally resolve. This scan covers any residual gap\n // where connections are not yet populated (e.g. if setRefreshHandler\n // is called on a session that has no connection entry at all).\n // @ts-ignore\n const allMeetings = this.meetings?.getAllMeetings?.() || {};\n\n meeting = Object.values(allMeetings).find((activeMeeting: any) => {\n const info = activeMeeting?.locusInfo?.info || {};\n\n return (\n (info.practiceSessionDatachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(\n requestUrl,\n info.practiceSessionDatachannelUrl\n )) ||\n (info.datachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl))\n );\n });\n\n if (!sessionId) {\n // @ts-ignore\n const info = meeting?.locusInfo?.info || {};\n\n if (\n info.practiceSessionDatachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(\n requestUrl,\n info.practiceSessionDatachannelUrl\n )\n ) {\n sessionId = LLM_PRACTICE_SESSION;\n } else if (\n info.datachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl)\n ) {\n sessionId = LLM_DEFAULT_SESSION;\n }\n }\n }\n }\n\n let result;\n if (meeting) {\n result = await meeting.refreshDataChannelToken();\n } else {\n // @ts-ignore\n result = await this.internal.llm.refreshDataChannelToken(sessionId);\n }\n\n if (!result?.body) {\n throw new Error('DataChannel token refresh returned no payload');\n }\n const {datachannelToken, dataChannelTokenType} = result.body;\n const tokenStoreKey = dataChannelTokenType || sessionId;\n const ownerMeetingId =\n // @ts-ignore\n meeting?.id || this.internal.llm.getOwnerMeetingId?.(tokenStoreKey);\n // @ts-ignore\n this.internal.llm.setDatachannelToken(datachannelToken, tokenStoreKey, ownerMeetingId);\n\n return datachannelToken;\n },\n });\n }\n\n private getRetryKey(options) {\n if (!options[RETRY_KEY]) {\n options[RETRY_KEY] = `${Date.now()}-${Math.random()}`;\n }\n\n return options[RETRY_KEY];\n }\n\n // Helper function to get header value case insensitively\n private getHeader(headers: Record<string, string>, name: string) {\n const key = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());\n\n return key ? headers[key] : undefined;\n }\n\n /**\n * Intercepts outgoing requests and refreshes the Data-Channel-Auth-Token\n * if the current JWT token is expired before the request is sent.\n *\n * @param {Object} options - The original request options.\n * @returns {Promise<Object>} Updated request options with refreshed token if needed.\n */\n async onRequest(options) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return options;\n }\n\n if (isJwtTokenExpired(token)) {\n try {\n const newToken = await this._refreshDataChannelToken(options.uri || options.url);\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n } catch (e) {\n LoggerProxy.logger.warn(`DataChannelAuthTokenInterceptor: refresh failed: ${e.message}`);\n }\n }\n\n return options;\n }\n\n /**\n * Intercept responses and, on 401/403 with `Data-Channel-Auth-Token` header,\n * attempt to refresh the data channel token and retry the original request once.\n *\n * @param {Object} options\n * @param {Object} reason\n * @returns {Promise<HttpResponse>}\n */\n async onResponseError(options, reason) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return Promise.reject(reason);\n }\n\n if (reason.statusCode !== 401 && reason.statusCode !== 403) {\n return Promise.reject(reason);\n }\n\n const key = this.getRetryKey(options);\n const retryCount = retryCountMap.get(key) || 0;\n\n if (retryCount >= MAX_RETRY) {\n LoggerProxy.logger.error(`data channel token refresh exceeded max retry (${MAX_RETRY})`);\n retryCountMap.delete(key);\n\n return Promise.reject(reason);\n }\n\n retryCountMap.set(key, retryCount + 1);\n\n return this.refreshTokenAndRetryWithDelay(options);\n }\n\n /**\n * Retry the failed data channel request after a delay.\n * Refreshes the Data-Channel-Auth-Token and re-sends the original request.\n *\n * @param {Object} options - Original request options.\n * @returns {Promise<HttpResponse>} - Resolves on successful retry.\n */\n refreshTokenAndRetryWithDelay(options) {\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n const key = this.getRetryKey(options);\n try {\n const newToken = await this._refreshDataChannelToken(options.uri || options.url);\n\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n\n // @ts-ignore\n const res = await this.webex.request(options);\n retryCountMap.delete(key);\n\n resolve(res);\n } catch (e) {\n retryCountMap.delete(key);\n\n const msg = e?.message || String(e);\n\n const err: HttpLikeError = new Error(`DataChannel token refresh failed: ${msg}`);\n err.statusCode = e?.statusCode;\n err.original = e;\n\n reject(err);\n }\n }, RETRY_INTERVAL);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAAkF,SAAAO,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UATlF;AACA;AACA;AASA,IAAM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7E,MAAA,WAEhFyE,gBAAgB;gBAAA;gBAAA;kBAAA,OAAAI,SAAA,CAAArE,IAAA;cAAA;YAAA,GAAA0C,QAAA;UAAA,CACxB;UAAA,SAnFDtF,uBAAuBA,CAAAsI,GAAA;YAAA,OAAAvI,wBAAA,CAAAd,KAAA,OAAA8D,SAAA;UAAA;UAAA,OAAvB/C,uBAAuB;QAAA;MAoFzB,CAAC,CAAC;IACJ;EAAC;AAAA,EAhH0DuI,qBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_httpCore","require","_internalPluginLlm","_interopRequireDefault","_loggerProxy","_constant","_utils","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","retryCountMap","_map","DataChannelAuthTokenInterceptor","exports","_Interceptor","options","_this","_classCallCheck2","_defineProperty2","_refreshDataChannelToken","refreshDataChannelToken","_isDataChannelTokenEnabled","isDataChannelTokenEnabled","_inherits2","_createClass2","key","value","getRetryKey","RETRY_KEY","concat","_now","Math","random","getHeader","headers","name","_keys","find","k","toLowerCase","undefined","_onRequest","_asyncToGenerator2","_regenerator","mark","_callee","token","enabled","newToken","_t","wrap","_context","prev","next","DATA_CHANNEL_AUTH_HEADER","sent","abrupt","isJwtTokenExpired","uri","url","LoggerProxy","logger","warn","message","stop","onRequest","_x","arguments","_onResponseError","_callee2","reason","retryCount","_context2","_promise","reject","statusCode","get","MAX_RETRY","error","delete","set","refreshTokenAndRetryWithDelay","onResponseError","_x2","_x3","_this2","resolve","setTimeout","_callee3","res","msg","err","_t2","_context3","webex","request","String","Error","original","RETRY_INTERVAL","create","_this3","_callee4","_context4","internal","llm","_callee5","requestUrl","_this3$meetings","channel","result","datachannelToken","allMeetings","meeting","_result","_datachannelToken","_context5","getChannelByDatachannelUrl","body","setDatachannelToken","meetings","getAllMeetings","_values","activeMeeting","_activeMeeting$locusI","info","locusInfo","practiceSessionDatachannelUrl","LLMChannel","matchesDatachannelRequestUrl","datachannelUrl","setLLMChannelDataToken","_x4","Interceptor"],"sources":["dataChannelAuthToken.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\n// @ts-ignore - internal-plugin-llm types\nimport LLMChannel from '@webex/internal-plugin-llm';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Meeting from '../meeting';\nimport {DATA_CHANNEL_AUTH_HEADER, MAX_RETRY, RETRY_INTERVAL, RETRY_KEY} from './constant';\nimport {isJwtTokenExpired} from './utils';\n\nconst retryCountMap = new Map();\ninterface HttpLikeError extends Error {\n statusCode?: number;\n original?: any;\n}\n/**\n * @class\n */\nexport default class DataChannelAuthTokenInterceptor extends Interceptor {\n private _refreshDataChannelToken: (requestUrl?: string) => Promise<string>;\n private _isDataChannelTokenEnabled: () => Promise<boolean>;\n constructor(options) {\n super(options);\n\n this._refreshDataChannelToken = options.refreshDataChannelToken;\n this._isDataChannelTokenEnabled = options.isDataChannelTokenEnabled;\n }\n\n /**\n * @returns {DataChannelAuthTokenInterceptor}\n */\n static create() {\n // @ts-ignore\n return new DataChannelAuthTokenInterceptor({\n webex: this,\n\n isDataChannelTokenEnabled: async () => {\n // @ts-ignore\n return this.internal.llm.isDataChannelTokenEnabled();\n },\n\n // Route refresh by request URL:\n // 1) Find the LLM channel that matches the request URL\n // 2) If found, use its refresh handler\n // 3) If no channel matches, fall back to finding the meeting by locusUrl\n refreshDataChannelToken: async (requestUrl?: string) => {\n // @ts-ignore\n const channel = this.internal.llm.getChannelByDatachannelUrl(requestUrl);\n\n if (channel) {\n // Channel found - use its refresh handler\n const result = await channel.refreshDataChannelToken();\n\n if (!result?.body) {\n throw new Error('DataChannel token refresh returned no payload');\n }\n\n const {datachannelToken} = result.body;\n channel.setDatachannelToken(datachannelToken);\n\n return datachannelToken;\n }\n\n // No channel found - fallback to finding meeting by matching datachannel URLs\n // @ts-ignore\n const allMeetings: Record<string, Meeting> = this.meetings?.getAllMeetings() || {};\n\n const meeting = Object.values(allMeetings).find((activeMeeting) => {\n const info = activeMeeting?.locusInfo?.info || {};\n\n return (\n (info.practiceSessionDatachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(\n requestUrl,\n info.practiceSessionDatachannelUrl\n )) ||\n (info.datachannelUrl &&\n LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl))\n );\n });\n\n if (meeting) {\n const result = await meeting.refreshDataChannelToken();\n\n if (!result?.body) {\n throw new Error('DataChannel token refresh returned no payload');\n }\n\n const {datachannelToken} = result.body;\n\n // Store token on the meeting's LLM channel if available\n meeting.setLLMChannelDataToken(datachannelToken);\n\n return datachannelToken;\n }\n\n throw new Error('No LLM channel or meeting found for request URL');\n },\n });\n }\n\n private getRetryKey(options) {\n if (!options[RETRY_KEY]) {\n options[RETRY_KEY] = `${Date.now()}-${Math.random()}`;\n }\n\n return options[RETRY_KEY];\n }\n\n // Helper function to get header value case insensitively\n private getHeader(headers: Record<string, string>, name: string) {\n const key = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());\n\n return key ? headers[key] : undefined;\n }\n\n /**\n * Intercepts outgoing requests and refreshes the Data-Channel-Auth-Token\n * if the current JWT token is expired before the request is sent.\n *\n * @param {Object} options - The original request options.\n * @returns {Promise<Object>} Updated request options with refreshed token if needed.\n */\n async onRequest(options) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return options;\n }\n\n if (isJwtTokenExpired(token)) {\n try {\n const newToken = await this._refreshDataChannelToken(options.uri || options.url);\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n } catch (e) {\n LoggerProxy.logger.warn(`DataChannelAuthTokenInterceptor: refresh failed: ${e.message}`);\n }\n }\n\n return options;\n }\n\n /**\n * Intercept responses and, on 401/403 with `Data-Channel-Auth-Token` header,\n * attempt to refresh the data channel token and retry the original request once.\n *\n * @param {Object} options\n * @param {Object} reason\n * @returns {Promise<HttpResponse>}\n */\n async onResponseError(options, reason) {\n const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);\n const enabled = await this._isDataChannelTokenEnabled();\n\n if (!token || !enabled) {\n return Promise.reject(reason);\n }\n\n if (reason.statusCode !== 401 && reason.statusCode !== 403) {\n return Promise.reject(reason);\n }\n\n const key = this.getRetryKey(options);\n const retryCount = retryCountMap.get(key) || 0;\n\n if (retryCount >= MAX_RETRY) {\n LoggerProxy.logger.error(`data channel token refresh exceeded max retry (${MAX_RETRY})`);\n retryCountMap.delete(key);\n\n return Promise.reject(reason);\n }\n\n retryCountMap.set(key, retryCount + 1);\n\n return this.refreshTokenAndRetryWithDelay(options);\n }\n\n /**\n * Retry the failed data channel request after a delay.\n * Refreshes the Data-Channel-Auth-Token and re-sends the original request.\n *\n * @param {Object} options - Original request options.\n * @returns {Promise<HttpResponse>} - Resolves on successful retry.\n */\n refreshTokenAndRetryWithDelay(options) {\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n const key = this.getRetryKey(options);\n try {\n const newToken = await this._refreshDataChannelToken(options.uri || options.url);\n\n options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;\n\n // @ts-ignore\n const res = await this.webex.request(options);\n retryCountMap.delete(key);\n\n resolve(res);\n } catch (e) {\n retryCountMap.delete(key);\n\n const msg = e?.message || String(e);\n\n const err: HttpLikeError = new Error(`DataChannel token refresh failed: ${msg}`);\n err.statusCode = e?.statusCode;\n err.original = e;\n\n reject(err);\n }\n }, RETRY_INTERVAL);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAGA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL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,CAACkB,sBAAsB,CAACpB,iBAAgB,CAAC;kBAAC,OAAAK,SAAA,CAAA5D,MAAA,WAE1CuD,iBAAgB;gBAAA;kBAAA,MAGnB,IAAId,KAAK,CAAC,iDAAiD,CAAC;gBAAA;gBAAA;kBAAA,OAAAmB,SAAA,CAAApD,IAAA;cAAA;YAAA,GAAA0C,QAAA;UAAA,CACnE;UAAA,SApDDtF,uBAAuBA,CAAAgH,GAAA;YAAA,OAAAjH,wBAAA,CAAAd,KAAA,OAAA8D,SAAA;UAAA;UAAA,OAAvB/C,uBAAuB;QAAA;MAqDzB,CAAC,CAAC;IACJ;EAAC;AAAA,EAjF0DiH,qBAAW","ignoreList":[]}
|
|
@@ -42,7 +42,7 @@ var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Inte
|
|
|
42
42
|
var retryAfterTime = options.headers['retry-after'] || 2000;
|
|
43
43
|
if (hasRetriedLocusRequest) {
|
|
44
44
|
rateLimitExpiryTime.set(this, false);
|
|
45
|
-
return _promise.default.reject(
|
|
45
|
+
return _promise.default.reject(reason);
|
|
46
46
|
}
|
|
47
47
|
rateLimitExpiryTime.set(this, true);
|
|
48
48
|
return this.handleRetryRequestLocusServiceError(options, retryAfterTime);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","isLocusHashtreeOrSync","uri","_promise","reject","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","_URL","URL","pathname","endsWith","_unused","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Check whether a URI is a Locus /hashtree or /sync endpoint.\n * @param {string} uri\n * @returns {boolean}\n */\n private static isLocusHashtreeOrSync(uri: string): boolean {\n try {\n const {pathname} = new URL(uri);\n\n return (\n pathname.includes('/locus/') &&\n (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'))\n );\n } catch {\n return false;\n }\n }\n\n onResponseError(options, reason) {\n // Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries\n // make things worse. The normal sync timers will handle recovery for these endpoints.\n if (\n (reason.statusCode === 429 || reason.statusCode >= 500) &&\n LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)\n ) {\n return Promise.reject(reason);\n }\n\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(
|
|
1
|
+
{"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","isLocusHashtreeOrSync","uri","_promise","reject","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","_URL","URL","pathname","endsWith","_unused","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Check whether a URI is a Locus /hashtree or /sync endpoint.\n * @param {string} uri\n * @returns {boolean}\n */\n private static isLocusHashtreeOrSync(uri: string): boolean {\n try {\n const {pathname} = new URL(uri);\n\n return (\n pathname.includes('/locus/') &&\n (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'))\n );\n } catch {\n return false;\n }\n }\n\n onResponseError(options, reason) {\n // Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries\n // make things worse. The normal sync timers will handle recovery for these endpoints.\n if (\n (reason.statusCode === 429 || reason.statusCode >= 500) &&\n LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)\n ) {\n return Promise.reject(reason);\n }\n\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(reason);\n }\n rateLimitExpiryTime.set(this, true);\n\n return this.handleRetryRequestLocusServiceError(options, retryAfterTime);\n }\n\n return Promise.reject(reason);\n }\n\n /**\n * Handle retries for locus service unavailable errors\n * @param {Object} options associated with the request\n * @param {number} retryAfterTime retry after time in milliseconds\n * @returns {Promise}\n */\n handleRetryRequestLocusServiceError(options, retryAfterTime) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n clearTimeout(timeout);\n\n // @ts-ignore\n this.webex\n .request({\n method: options.method,\n uri: options.uri,\n body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,IAAI,CAACR,OAAO,CAAC,CACbS,KAAK,CAAClB,MAAM,CAAC;QAClB,CAAC,EAAEI,cAAc,CAAC;MACpB,CAAC,CAAC;IACJ;EAAC;IAAAb,GAAA;IAAAC,KAAA;IA3ED;AACF;AACA;IACE,SAAO2B,MAAMA,CAAA,EAAG;MACd;MACA,OAAO,IAAInC,2BAA2B,CAAC;QAAC6B,KAAK,EAAE;MAAI,CAAC,CAAC;IACvD;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAAtB,GAAA;IAAAC,KAAA,EAKA,SAAeK,qBAAqBA,CAACC,GAAW,EAAW;MACzD,IAAI;QACF,IAAAsB,IAAA,GAAmB,IAAIC,GAAG,CAACvB,GAAG,CAAC;UAAxBwB,QAAQ,GAAAF,IAAA,CAARE,QAAQ;QAEf,OACEA,QAAQ,CAACrB,QAAQ,CAAC,SAAS,CAAC,KAC3BqB,QAAQ,CAACC,QAAQ,CAAC,WAAW,CAAC,IAAID,QAAQ,CAACC,QAAQ,CAAC,OAAO,CAAC,CAAC;MAElE,CAAC,CAAC,OAAAC,OAAA,EAAM;QACN,OAAO,KAAK;MACd;IACF;EAAC;AAAA,EAzBsDC,qBAAW","ignoreList":[]}
|
|
@@ -51,7 +51,9 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
51
51
|
// appears the meeting support SI feature
|
|
52
52
|
hostSIEnabled: 'boolean',
|
|
53
53
|
// appears the meeting host/interpreter feature of SI enabled
|
|
54
|
-
selfIsInterpreter: 'boolean'
|
|
54
|
+
selfIsInterpreter: 'boolean',
|
|
55
|
+
// current user is interpreter or not
|
|
56
|
+
siEnabled: 'boolean' // appears SI is currently enabled in the meeting (from locus controls)
|
|
55
57
|
},
|
|
56
58
|
derived: {
|
|
57
59
|
shouldQuerySupportLanguages: {
|
|
@@ -131,10 +133,18 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
131
133
|
/**
|
|
132
134
|
* Update the interpretation languages channels which user can choose to subscribe
|
|
133
135
|
* @param {Object} interpretation
|
|
136
|
+
* @param {Object} [options]
|
|
137
|
+
* @param {boolean} [options.preserveSiEnabled] keep the current siEnabled untouched (meeting-info path)
|
|
134
138
|
* @returns {void}
|
|
135
139
|
*/
|
|
136
140
|
updateInterpretation: function updateInterpretation(interpretation) {
|
|
141
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
142
|
+
_ref$preserveSiEnable = _ref.preserveSiEnabled,
|
|
143
|
+
preserveSiEnabled = _ref$preserveSiEnable === void 0 ? false : _ref$preserveSiEnable;
|
|
137
144
|
this.siLanguages.set((interpretation === null || interpretation === void 0 ? void 0 : interpretation.siLanguages) || []);
|
|
145
|
+
if (!preserveSiEnabled) {
|
|
146
|
+
this.set('siEnabled', !!(interpretation !== null && interpretation !== void 0 && interpretation.siEnabled));
|
|
147
|
+
}
|
|
138
148
|
},
|
|
139
149
|
/**
|
|
140
150
|
* Update self's interpretation information (self is interpreter)
|
|
@@ -142,17 +152,17 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
142
152
|
* @param {String} selfParticipantId
|
|
143
153
|
* @returns {bool} is target language changed
|
|
144
154
|
*/
|
|
145
|
-
updateSelfInterpretation: function updateSelfInterpretation(
|
|
146
|
-
var interpretation =
|
|
147
|
-
selfParticipantId =
|
|
155
|
+
updateSelfInterpretation: function updateSelfInterpretation(_ref2) {
|
|
156
|
+
var interpretation = _ref2.interpretation,
|
|
157
|
+
selfParticipantId = _ref2.selfParticipantId;
|
|
148
158
|
var preTargetLanguage = this.targetLanguage;
|
|
149
|
-
var
|
|
150
|
-
originalLanguage =
|
|
151
|
-
sourceLanguage =
|
|
152
|
-
order =
|
|
153
|
-
isActive =
|
|
154
|
-
targetLanguage =
|
|
155
|
-
receiveLanguage =
|
|
159
|
+
var _ref3 = interpretation || {},
|
|
160
|
+
originalLanguage = _ref3.originalLanguage,
|
|
161
|
+
sourceLanguage = _ref3.sourceLanguage,
|
|
162
|
+
order = _ref3.order,
|
|
163
|
+
isActive = _ref3.isActive,
|
|
164
|
+
targetLanguage = _ref3.targetLanguage,
|
|
165
|
+
receiveLanguage = _ref3.receiveLanguage;
|
|
156
166
|
this.set({
|
|
157
167
|
originalLanguage: originalLanguage,
|
|
158
168
|
sourceLanguage: sourceLanguage,
|
|
@@ -230,6 +240,30 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
230
240
|
throw error;
|
|
231
241
|
});
|
|
232
242
|
},
|
|
243
|
+
/**
|
|
244
|
+
* End simultaneous interpretation in the meeting. Only the host is allowed to call this api.
|
|
245
|
+
* Locus clears SI subscriptions, removes interpreters and their interpreter roles.
|
|
246
|
+
* It cannot be re-enabled during the current meeting.
|
|
247
|
+
* @returns {Promise}
|
|
248
|
+
*/
|
|
249
|
+
endSimultaneousInterpretation: function endSimultaneousInterpretation() {
|
|
250
|
+
var meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);
|
|
251
|
+
return this.request({
|
|
252
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
253
|
+
uri: "".concat(this.locusUrl, "/controls"),
|
|
254
|
+
body: {
|
|
255
|
+
interpretation: {
|
|
256
|
+
siEnabled: false
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}).then(function (response) {
|
|
260
|
+
_util.default.updateLocusFromApiResponse(meeting, response);
|
|
261
|
+
return response;
|
|
262
|
+
}).catch(function (error) {
|
|
263
|
+
_loggerProxy.default.logger.error('Meeting:interpretation#endSimultaneousInterpretation failed', error);
|
|
264
|
+
throw error;
|
|
265
|
+
});
|
|
266
|
+
},
|
|
233
267
|
/**
|
|
234
268
|
* Change direction of interpretation for an interpreter participant
|
|
235
269
|
* @returns {Promise}
|
|
@@ -381,7 +415,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
381
415
|
throw error;
|
|
382
416
|
});
|
|
383
417
|
},
|
|
384
|
-
version: "3.
|
|
418
|
+
version: "3.13.0"
|
|
385
419
|
});
|
|
386
420
|
var _default = exports.default = SimultaneousInterpretation;
|
|
387
421
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_loggerProxy","_interopRequireDefault","_constants","_util","_collection","SimultaneousInterpretation","WebexPlugin","extend","namespace","MEETINGS","collections","siLanguages","SILanguageCollection","props","locusUrl","approvalUrl","originalLanguage","sourceLanguage","targetLanguage","receiveLanguage","order","isActive","selfParticipantId","canManageInterpreters","supportLanguages","meetingSIEnabled","hostSIEnabled","selfIsInterpreter","derived","shouldQuerySupportLanguages","cache","deps","fn","initialize","_this","listenTo","querySupportLanguages","listenToHandoffRequests","cleanUp","stopListening","locusUrlUpdate","set","approvalUrlUpdate","updateCanManageInterpreters","updateHostSIEnabled","updateMeetingSIEnabled","updateInterpretation","interpretation","updateSelfInterpretation","_ref","preTargetLanguage","_ref2","getTargetLanguageCode","_this$siLanguages$get","get","languageCode","_this2","request","method","HTTP_VERBS","GET","uri","concat","then","result","_result$body","body","trigger","INTERPRETATION","EVENTS","SUPPORT_LANGUAGES_UPDATE","catch","error","LoggerProxy","logger","getInterpreters","updateInterpreters","interpreters","meeting","webex","meetings","meetingCollection","getByKey","PATCH","response","MeetingUtil","updateLocusFromApiResponse","changeDirection","_promise","default","reject","Error","_this3","internal","mercury","LOCUSEVENT","APPROVAL_REQUEST","event","_event$data","_event$data$approval","data","approval","resourceType","RESOURCE_TYPE","_receivers$","_event$data$approval2","receivers","initiator","actionType","url","receiverId","participantId","isReceiver","senderId","isSender","HANDOFF_REQUESTS_ARRIVED","handoffInterpreter","POST","ACTION_TYPE","OFFERED","requestHandoff","REQUESTED","acceptRequest","PUT","ACCEPTED","declineRequest","DECLINED","version","_default","exports"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.\n */\nimport {WebexPlugin} from '@webex/webex-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, INTERPRETATION, LOCUSEVENT, MEETINGS} from '../constants';\nimport MeetingUtil from '../meeting/util';\n\nimport SILanguageCollection from './collection';\nimport {Interpreter} from './interpretation.types';\n\n/**\n * @class SimultaneousInterpretation\n */\nconst SimultaneousInterpretation = WebexPlugin.extend({\n namespace: MEETINGS,\n collections: {\n siLanguages: SILanguageCollection,\n },\n\n props: {\n locusUrl: 'string', // appears current meeting's locus url\n approvalUrl: 'string', // appears current meeting's approval url for handoff between interpreters\n originalLanguage: 'string', // appears current meeting's original language\n sourceLanguage: 'string', // appears self interpreter's source language\n targetLanguage: 'string', // appears self interpreter's target language\n receiveLanguage: 'string', // appears self's receive language\n order: 'number', // appears the order of self as interpreter\n isActive: 'boolean', // appears self is interpreter and is active\n selfParticipantId: 'string', // appears the self participant id\n canManageInterpreters: 'boolean', // appears the ability to manage interpreters\n supportLanguages: 'array', // appears the support languages\n meetingSIEnabled: 'boolean', // appears the meeting support SI feature\n hostSIEnabled: 'boolean', // appears the meeting host/interpreter feature of SI enabled\n selfIsInterpreter: 'boolean', // current user is interpreter or not\n },\n derived: {\n shouldQuerySupportLanguages: {\n cache: false,\n deps: ['canManageInterpreters', 'hostSIEnabled', 'locusUrl'],\n /**\n * Returns should query support languages or not\n * @returns {boolean}\n */\n fn() {\n return !!(this.canManageInterpreters && this.hostSIEnabled && this.locusUrl);\n },\n },\n },\n /**\n * initialize for interpretation\n * @returns {void}\n */\n initialize() {\n this.listenTo(this, 'change:shouldQuerySupportLanguages', () => {\n if (this.shouldQuerySupportLanguages && !this.supportLanguages) {\n this.querySupportLanguages();\n }\n });\n this.listenToHandoffRequests();\n },\n\n /**\n * Calls this to clean up listeners\n * @returns {void}\n */\n cleanUp() {\n this.stopListening();\n },\n /**\n * Update the current locus url of the meeting\n * @param {string} locusUrl // locus url\n * @returns {void}\n */\n locusUrlUpdate(locusUrl) {\n this.set('locusUrl', locusUrl);\n },\n /**\n * Update the approval url for handoff\n * @param {string} approvalUrl // approval url\n * @returns {void}\n */\n approvalUrlUpdate(approvalUrl) {\n this.set('approvalUrl', approvalUrl);\n },\n /**\n * Update whether self has capability to manage interpreters (only host can manage it)\n * @param {boolean} canManageInterpreters\n * @returns {void}\n */\n updateCanManageInterpreters(canManageInterpreters) {\n this.set('canManageInterpreters', canManageInterpreters);\n },\n /**\n * Update whether the meeting's host si is enabled or not\n * @param {boolean} hostSIEnabled\n * @returns {void}\n */\n updateHostSIEnabled(hostSIEnabled) {\n this.set('hostSIEnabled', hostSIEnabled);\n },\n\n /**\n * Update whether the meeting support SI feature or not from meeting info\n * @param {boolean} meetingSIEnabled\n * @param {boolean} selfIsInterpreter\n * @returns {void}\n */\n updateMeetingSIEnabled(meetingSIEnabled: boolean, selfIsInterpreter): void {\n this.set('meetingSIEnabled', meetingSIEnabled);\n this.set('selfIsInterpreter', selfIsInterpreter);\n },\n\n /**\n * Update the interpretation languages channels which user can choose to subscribe\n * @param {Object} interpretation\n * @returns {void}\n */\n updateInterpretation(interpretation) {\n this.siLanguages.set(interpretation?.siLanguages || []);\n },\n /**\n * Update self's interpretation information (self is interpreter)\n * @param {Object} interpretation\n * @param {String} selfParticipantId\n * @returns {bool} is target language changed\n */\n updateSelfInterpretation({interpretation, selfParticipantId}) {\n const preTargetLanguage = this.targetLanguage;\n const {originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage} =\n interpretation || {};\n this.set({originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage});\n this.set('selfParticipantId', selfParticipantId);\n this.set('selfIsInterpreter', !!targetLanguage);\n\n return !!(preTargetLanguage !== targetLanguage);\n },\n\n /**\n * Get the language code of the interpreter target language\n * @returns {number}\n */\n getTargetLanguageCode() {\n if (this.selfIsInterpreter) {\n return this.siLanguages.get(this.targetLanguage)?.languageCode;\n }\n\n return 0;\n },\n\n /**\n * query interpretation languages\n * @returns {Promise}\n */\n querySupportLanguages() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/languages/interpretation`,\n })\n .then((result) => {\n this.set('supportLanguages', result.body?.siLanguages);\n this.trigger(INTERPRETATION.EVENTS.SUPPORT_LANGUAGES_UPDATE);\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#querySupportLanguages failed', error);\n throw error;\n });\n },\n /**\n * get interpreters of the meeting\n * @returns {Promise}\n */\n getInterpreters() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/interpretation/interpreters`,\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#getInterpreters failed', error);\n throw error;\n });\n },\n /**\n * update interpreters of the meeting\n * @param {Array} interpreters\n * @returns {Promise}\n */\n updateInterpreters(interpreters: Interpreter[]) {\n const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/controls`,\n body: {\n interpretation: {\n interpreters,\n },\n },\n })\n .then((response) => {\n MeetingUtil.updateLocusFromApiResponse(meeting, response);\n\n return response;\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#updateInterpreters failed', error);\n throw error;\n });\n },\n /**\n * Change direction of interpretation for an interpreter participant\n * @returns {Promise}\n */\n changeDirection() {\n if (!this.sourceLanguage || !this.targetLanguage) {\n return Promise.reject(new Error('Missing sourceLanguage or targetLanguage'));\n }\n\n if (!this.selfParticipantId) {\n return Promise.reject(new Error('Missing self participant id'));\n }\n\n const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/participant/${this.selfParticipantId}/controls`,\n body: {\n interpretation: {\n sourceLanguage: this.targetLanguage,\n targetLanguage: this.sourceLanguage,\n isActive: this.isActive,\n order: this.order,\n },\n },\n })\n .then((response) => {\n MeetingUtil.updateLocusFromApiResponse(meeting, response);\n\n return response;\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#changeDirection failed', error);\n throw error;\n });\n },\n /**\n * Sets up a listener for handoff requests from mercury\n * @returns {void}\n */\n listenToHandoffRequests() {\n this.listenTo(this.webex.internal.mercury, `event:${LOCUSEVENT.APPROVAL_REQUEST}`, (event) => {\n if (event?.data?.approval?.resourceType === INTERPRETATION.RESOURCE_TYPE) {\n const {receivers, initiator, actionType, url} = event.data.approval;\n const receiverId = receivers?.[0]?.participantId;\n const isReceiver = !!receiverId && receiverId === this.selfParticipantId;\n const senderId = initiator?.participantId;\n const isSender = !!senderId && senderId === this.selfParticipantId;\n if (!isReceiver && !isSender) {\n return;\n }\n this.trigger(INTERPRETATION.EVENTS.HANDOFF_REQUESTS_ARRIVED, {\n actionType,\n isReceiver,\n isSender,\n senderId,\n receiverId,\n url,\n });\n }\n });\n },\n /**\n * handoff the active interpreter role to another interpreter in same group, only the interpreter is allowed to call this api\n * @param {string} participantId the participant id you want to hand off\n * @returns {Promise}\n */\n handoffInterpreter(participantId) {\n if (!participantId) {\n return Promise.reject(new Error('Missing target participant id'));\n }\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.OFFERED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n receivers: [\n {\n participantId,\n },\n ],\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#handoffInterpreter failed', error);\n throw error;\n });\n },\n /**\n * the in-active interpreter request to hand off the active role to self\n * @returns {Promise}\n */\n requestHandoff() {\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.REQUESTED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#requestHandoff failed', error);\n throw error;\n });\n },\n /**\n * accept the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n acceptRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to accept'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.ACCEPTED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#acceptRequest failed', error);\n throw error;\n });\n },\n /**\n * decline the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n declineRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to decline'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.DECLINED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#declineRequest failed', error);\n throw error;\n });\n },\n});\n\nexport default SimultaneousInterpretation;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AASA;AACA;AACA;AACA,IAAMM,0BAA0B,GAAGC,sBAAW,CAACC,MAAM,CAAC;EACpDC,SAAS,EAAEC,mBAAQ;EACnBC,WAAW,EAAE;IACXC,WAAW,EAAEC;EACf,CAAC;EAEDC,KAAK,EAAE;IACLC,QAAQ,EAAE,QAAQ;IAAE;IACpBC,WAAW,EAAE,QAAQ;IAAE;IACvBC,gBAAgB,EAAE,QAAQ;IAAE;IAC5BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,eAAe,EAAE,QAAQ;IAAE;IAC3BC,KAAK,EAAE,QAAQ;IAAE;IACjBC,QAAQ,EAAE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O,IAAI,CAAClC,OAAO,CAAC;MAClBC,MAAM,EAAEC,qBAAU,CAACgE,GAAG;MACtB9D,GAAG,EAAEgD,GAAG;MACR3C,IAAI,EAAE;QACJ0C,UAAU,EAAExC,yBAAc,CAACkD,WAAW,CAACQ;MACzC;IACF,CAAC,CAAC,CAACvD,KAAK,CAAC,UAACC,KAAK,EAAK;MAClBC,oBAAW,CAACC,MAAM,CAACF,KAAK,CAAC,8CAA8C,EAAEA,KAAK,CAAC;MAC/E,MAAMA,KAAK;IACb,CAAC,CAAC;EACJ,CAAC;EAAAuD,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEYpF,0BAA0B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_loggerProxy","_interopRequireDefault","_constants","_util","_collection","SimultaneousInterpretation","WebexPlugin","extend","namespace","MEETINGS","collections","siLanguages","SILanguageCollection","props","locusUrl","approvalUrl","originalLanguage","sourceLanguage","targetLanguage","receiveLanguage","order","isActive","selfParticipantId","canManageInterpreters","supportLanguages","meetingSIEnabled","hostSIEnabled","selfIsInterpreter","siEnabled","derived","shouldQuerySupportLanguages","cache","deps","fn","initialize","_this","listenTo","querySupportLanguages","listenToHandoffRequests","cleanUp","stopListening","locusUrlUpdate","set","approvalUrlUpdate","updateCanManageInterpreters","updateHostSIEnabled","updateMeetingSIEnabled","updateInterpretation","interpretation","_ref","arguments","length","undefined","_ref$preserveSiEnable","preserveSiEnabled","updateSelfInterpretation","_ref2","preTargetLanguage","_ref3","getTargetLanguageCode","_this$siLanguages$get","get","languageCode","_this2","request","method","HTTP_VERBS","GET","uri","concat","then","result","_result$body","body","trigger","INTERPRETATION","EVENTS","SUPPORT_LANGUAGES_UPDATE","catch","error","LoggerProxy","logger","getInterpreters","updateInterpreters","interpreters","meeting","webex","meetings","meetingCollection","getByKey","PATCH","response","MeetingUtil","updateLocusFromApiResponse","endSimultaneousInterpretation","changeDirection","_promise","default","reject","Error","_this3","internal","mercury","LOCUSEVENT","APPROVAL_REQUEST","event","_event$data","_event$data$approval","data","approval","resourceType","RESOURCE_TYPE","_receivers$","_event$data$approval2","receivers","initiator","actionType","url","receiverId","participantId","isReceiver","senderId","isSender","HANDOFF_REQUESTS_ARRIVED","handoffInterpreter","POST","ACTION_TYPE","OFFERED","requestHandoff","REQUESTED","acceptRequest","PUT","ACCEPTED","declineRequest","DECLINED","version","_default","exports"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.\n */\nimport {WebexPlugin} from '@webex/webex-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, INTERPRETATION, LOCUSEVENT, MEETINGS} from '../constants';\nimport MeetingUtil from '../meeting/util';\n\nimport SILanguageCollection from './collection';\nimport {Interpreter} from './interpretation.types';\n\n/**\n * @class SimultaneousInterpretation\n */\nconst SimultaneousInterpretation = WebexPlugin.extend({\n namespace: MEETINGS,\n collections: {\n siLanguages: SILanguageCollection,\n },\n\n props: {\n locusUrl: 'string', // appears current meeting's locus url\n approvalUrl: 'string', // appears current meeting's approval url for handoff between interpreters\n originalLanguage: 'string', // appears current meeting's original language\n sourceLanguage: 'string', // appears self interpreter's source language\n targetLanguage: 'string', // appears self interpreter's target language\n receiveLanguage: 'string', // appears self's receive language\n order: 'number', // appears the order of self as interpreter\n isActive: 'boolean', // appears self is interpreter and is active\n selfParticipantId: 'string', // appears the self participant id\n canManageInterpreters: 'boolean', // appears the ability to manage interpreters\n supportLanguages: 'array', // appears the support languages\n meetingSIEnabled: 'boolean', // appears the meeting support SI feature\n hostSIEnabled: 'boolean', // appears the meeting host/interpreter feature of SI enabled\n selfIsInterpreter: 'boolean', // current user is interpreter or not\n siEnabled: 'boolean', // appears SI is currently enabled in the meeting (from locus controls)\n },\n derived: {\n shouldQuerySupportLanguages: {\n cache: false,\n deps: ['canManageInterpreters', 'hostSIEnabled', 'locusUrl'],\n /**\n * Returns should query support languages or not\n * @returns {boolean}\n */\n fn() {\n return !!(this.canManageInterpreters && this.hostSIEnabled && this.locusUrl);\n },\n },\n },\n /**\n * initialize for interpretation\n * @returns {void}\n */\n initialize() {\n this.listenTo(this, 'change:shouldQuerySupportLanguages', () => {\n if (this.shouldQuerySupportLanguages && !this.supportLanguages) {\n this.querySupportLanguages();\n }\n });\n this.listenToHandoffRequests();\n },\n\n /**\n * Calls this to clean up listeners\n * @returns {void}\n */\n cleanUp() {\n this.stopListening();\n },\n /**\n * Update the current locus url of the meeting\n * @param {string} locusUrl // locus url\n * @returns {void}\n */\n locusUrlUpdate(locusUrl) {\n this.set('locusUrl', locusUrl);\n },\n /**\n * Update the approval url for handoff\n * @param {string} approvalUrl // approval url\n * @returns {void}\n */\n approvalUrlUpdate(approvalUrl) {\n this.set('approvalUrl', approvalUrl);\n },\n /**\n * Update whether self has capability to manage interpreters (only host can manage it)\n * @param {boolean} canManageInterpreters\n * @returns {void}\n */\n updateCanManageInterpreters(canManageInterpreters) {\n this.set('canManageInterpreters', canManageInterpreters);\n },\n /**\n * Update whether the meeting's host si is enabled or not\n * @param {boolean} hostSIEnabled\n * @returns {void}\n */\n updateHostSIEnabled(hostSIEnabled) {\n this.set('hostSIEnabled', hostSIEnabled);\n },\n\n /**\n * Update whether the meeting support SI feature or not from meeting info\n * @param {boolean} meetingSIEnabled\n * @param {boolean} selfIsInterpreter\n * @returns {void}\n */\n updateMeetingSIEnabled(meetingSIEnabled: boolean, selfIsInterpreter): void {\n this.set('meetingSIEnabled', meetingSIEnabled);\n this.set('selfIsInterpreter', selfIsInterpreter);\n },\n\n /**\n * Update the interpretation languages channels which user can choose to subscribe\n * @param {Object} interpretation\n * @param {Object} [options]\n * @param {boolean} [options.preserveSiEnabled] keep the current siEnabled untouched (meeting-info path)\n * @returns {void}\n */\n updateInterpretation(interpretation, {preserveSiEnabled = false} = {}) {\n this.siLanguages.set(interpretation?.siLanguages || []);\n if (!preserveSiEnabled) {\n this.set('siEnabled', !!interpretation?.siEnabled);\n }\n },\n /**\n * Update self's interpretation information (self is interpreter)\n * @param {Object} interpretation\n * @param {String} selfParticipantId\n * @returns {bool} is target language changed\n */\n updateSelfInterpretation({interpretation, selfParticipantId}) {\n const preTargetLanguage = this.targetLanguage;\n const {originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage} =\n interpretation || {};\n this.set({originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage});\n this.set('selfParticipantId', selfParticipantId);\n this.set('selfIsInterpreter', !!targetLanguage);\n\n return !!(preTargetLanguage !== targetLanguage);\n },\n\n /**\n * Get the language code of the interpreter target language\n * @returns {number}\n */\n getTargetLanguageCode() {\n if (this.selfIsInterpreter) {\n return this.siLanguages.get(this.targetLanguage)?.languageCode;\n }\n\n return 0;\n },\n\n /**\n * query interpretation languages\n * @returns {Promise}\n */\n querySupportLanguages() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/languages/interpretation`,\n })\n .then((result) => {\n this.set('supportLanguages', result.body?.siLanguages);\n this.trigger(INTERPRETATION.EVENTS.SUPPORT_LANGUAGES_UPDATE);\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#querySupportLanguages failed', error);\n throw error;\n });\n },\n /**\n * get interpreters of the meeting\n * @returns {Promise}\n */\n getInterpreters() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/interpretation/interpreters`,\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#getInterpreters failed', error);\n throw error;\n });\n },\n /**\n * update interpreters of the meeting\n * @param {Array} interpreters\n * @returns {Promise}\n */\n updateInterpreters(interpreters: Interpreter[]) {\n const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/controls`,\n body: {\n interpretation: {\n interpreters,\n },\n },\n })\n .then((response) => {\n MeetingUtil.updateLocusFromApiResponse(meeting, response);\n\n return response;\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#updateInterpreters failed', error);\n throw error;\n });\n },\n /**\n * End simultaneous interpretation in the meeting. Only the host is allowed to call this api.\n * Locus clears SI subscriptions, removes interpreters and their interpreter roles.\n * It cannot be re-enabled during the current meeting.\n * @returns {Promise}\n */\n endSimultaneousInterpretation() {\n const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/controls`,\n body: {\n interpretation: {\n siEnabled: false,\n },\n },\n })\n .then((response) => {\n MeetingUtil.updateLocusFromApiResponse(meeting, response);\n\n return response;\n })\n .catch((error) => {\n LoggerProxy.logger.error(\n 'Meeting:interpretation#endSimultaneousInterpretation failed',\n error\n );\n throw error;\n });\n },\n /**\n * Change direction of interpretation for an interpreter participant\n * @returns {Promise}\n */\n changeDirection() {\n if (!this.sourceLanguage || !this.targetLanguage) {\n return Promise.reject(new Error('Missing sourceLanguage or targetLanguage'));\n }\n\n if (!this.selfParticipantId) {\n return Promise.reject(new Error('Missing self participant id'));\n }\n\n const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/participant/${this.selfParticipantId}/controls`,\n body: {\n interpretation: {\n sourceLanguage: this.targetLanguage,\n targetLanguage: this.sourceLanguage,\n isActive: this.isActive,\n order: this.order,\n },\n },\n })\n .then((response) => {\n MeetingUtil.updateLocusFromApiResponse(meeting, response);\n\n return response;\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#changeDirection failed', error);\n throw error;\n });\n },\n /**\n * Sets up a listener for handoff requests from mercury\n * @returns {void}\n */\n listenToHandoffRequests() {\n this.listenTo(this.webex.internal.mercury, `event:${LOCUSEVENT.APPROVAL_REQUEST}`, (event) => {\n if (event?.data?.approval?.resourceType === INTERPRETATION.RESOURCE_TYPE) {\n const {receivers, initiator, actionType, url} = event.data.approval;\n const receiverId = receivers?.[0]?.participantId;\n const isReceiver = !!receiverId && receiverId === this.selfParticipantId;\n const senderId = initiator?.participantId;\n const isSender = !!senderId && senderId === this.selfParticipantId;\n if (!isReceiver && !isSender) {\n return;\n }\n this.trigger(INTERPRETATION.EVENTS.HANDOFF_REQUESTS_ARRIVED, {\n actionType,\n isReceiver,\n isSender,\n senderId,\n receiverId,\n url,\n });\n }\n });\n },\n /**\n * handoff the active interpreter role to another interpreter in same group, only the interpreter is allowed to call this api\n * @param {string} participantId the participant id you want to hand off\n * @returns {Promise}\n */\n handoffInterpreter(participantId) {\n if (!participantId) {\n return Promise.reject(new Error('Missing target participant id'));\n }\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.OFFERED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n receivers: [\n {\n participantId,\n },\n ],\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#handoffInterpreter failed', error);\n throw error;\n });\n },\n /**\n * the in-active interpreter request to hand off the active role to self\n * @returns {Promise}\n */\n requestHandoff() {\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.REQUESTED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#requestHandoff failed', error);\n throw error;\n });\n },\n /**\n * accept the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n acceptRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to accept'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.ACCEPTED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#acceptRequest failed', error);\n throw error;\n });\n },\n /**\n * decline the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n declineRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to decline'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.DECLINED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#declineRequest failed', error);\n throw error;\n });\n },\n});\n\nexport default SimultaneousInterpretation;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AASA;AACA;AACA;AACA,IAAMM,0BAA0B,GAAGC,sBAAW,CAACC,MAAM,CAAC;EACpDC,SAAS,EAAEC,mBAAQ;EACnBC,WAAW,EAAE;IACXC,WAAW,EAAEC;EACf,CAAC;EAEDC,KAAK,EAAE;IACLC,QAAQ,EAAE,QAAQ;IAAE;IACpBC,WAAW,EAAE,QAAQ;IAAE;IACvBC,gBAAgB,EAAE,QAAQ;IAAE;IAC5BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,eAAe,EAAE,QAAQ;IAAE;IAC3BC,KAAK,EAAE,QAAQ;IAAE;IACjBC,QAAQ,EAAE,SAAS;IAAE;IACrBC,iBAAiB,EAAE,QAAQ;IAAE;IAC7BC,qBAAqB,EAAE,SAAS;IAAE;IAClCC,gBAAgB,EAAE,OAAO;IAAE;IAC3BC,gBAAgB,EAAE,SAAS;IAAE;IAC7BC,aAAa,EAAE,SAAS;IAAE;IAC1BC,iBAAiB,EAAE,SAA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MAAMA,KAAK;IACb,CAAC,CAAC;EACJ,CAAC;EAAAwD,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEY5F,0BAA0B","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
|
|
|
18
18
|
languageCode: 'number',
|
|
19
19
|
languageName: 'string'
|
|
20
20
|
},
|
|
21
|
-
version: "3.
|
|
21
|
+
version: "3.13.0"
|
|
22
22
|
});
|
|
23
23
|
var _default = exports.default = SILanguage;
|
|
24
24
|
//# sourceMappingURL=siLanguage.js.map
|