@webex/plugin-meetings 3.13.0-next.1 → 3.13.0-next.11
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/babel.config.js +17 -1
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/common/wasm-loader.js +174 -0
- package/dist/common/wasm-loader.js.map +1 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/e2ee/E2eeManager.js +91 -0
- package/dist/e2ee/E2eeManager.js.map +1 -0
- package/dist/e2ee/E2eeSignaling.js +200 -0
- package/dist/e2ee/E2eeSignaling.js.map +1 -0
- package/dist/e2ee/MediaEncryptionService.js +75 -0
- package/dist/e2ee/MediaEncryptionService.js.map +1 -0
- package/dist/e2ee/mls.js +558 -0
- package/dist/e2ee/mls.js.map +1 -0
- package/dist/e2ee/types.js +59 -0
- package/dist/e2ee/types.js.map +1 -0
- package/dist/e2ee/wasm.d.js +7 -0
- package/dist/e2ee/wasm.d.js.map +1 -0
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meetings/index.js +20 -0
- package/dist/meetings/index.js.map +1 -1
- package/dist/types/common/wasm-loader.d.ts +55 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/e2ee/E2eeManager.d.ts +23 -0
- package/dist/types/e2ee/E2eeSignaling.d.ts +94 -0
- package/dist/types/e2ee/MediaEncryptionService.d.ts +27 -0
- package/dist/types/e2ee/mls.d.ts +191 -0
- package/dist/types/e2ee/types.d.ts +104 -0
- package/dist/types/meetings/index.d.ts +4 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +21 -21
- package/src/common/wasm-loader.ts +124 -0
- package/src/config.ts +1 -0
- package/src/constants.ts +1 -1
- package/src/e2ee/E2eeManager.ts +58 -0
- package/src/e2ee/E2eeSignaling.ts +215 -0
- package/src/e2ee/MediaEncryptionService.ts +41 -0
- package/src/e2ee/mls.ts +548 -0
- package/src/e2ee/types.ts +114 -0
- package/src/e2ee/wasm.d.ts +153 -0
- package/src/meetings/ai-docs/meetings-spec.md +2 -0
- package/src/meetings/index.ts +18 -0
- package/test/integration/spec/transcription.js +1 -1
- package/test/unit/spec/common/wasm-loader.ts +171 -0
- package/test/unit/spec/e2ee/E2eeManager.ts +82 -0
- package/test/unit/spec/e2ee/E2eeSignaling.ts +172 -0
- package/test/unit/spec/e2ee/MediaEncryptionService.ts +43 -0
- package/test/unit/spec/e2ee/mls.ts +765 -0
- package/test/unit/spec/meeting-info/index.js +2 -3
- package/test/unit/spec/meetings/index.js +20 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
14
|
+
var _webCapabilities = require("@webex/web-capabilities");
|
|
15
|
+
var _webexCore = require("@webex/webex-core");
|
|
16
|
+
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
17
|
+
/*!
|
|
18
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// @ts-ignore - StaticAssetLoader is exported from webex-core's JavaScript entry point.
|
|
22
|
+
|
|
23
|
+
/* The WASM module that contains the libe2ee + mlspp libraries with a WebE2EE wrapper around them, required for joining MLS group for E2EE meetings.
|
|
24
|
+
* The version is in the filename as it is important that JS-SDK implementation of MLS class matches the WASM module version.
|
|
25
|
+
*/
|
|
26
|
+
var E2EE_WASM_ASSET = 'e2ee-0.0.1.wasm';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Owns E2EE resource preloading for a Meetings plugin session. The per-meeting controller is added
|
|
30
|
+
* in the follow-up integration change; this first step keeps the slow WASM load off the join path.
|
|
31
|
+
*/
|
|
32
|
+
var E2eeManager = exports.default = /*#__PURE__*/function () {
|
|
33
|
+
function E2eeManager(_ref) {
|
|
34
|
+
var webex = _ref.webex,
|
|
35
|
+
wasmLoader = _ref.wasmLoader;
|
|
36
|
+
(0, _classCallCheck2.default)(this, E2eeManager);
|
|
37
|
+
(0, _defineProperty2.default)(this, "webex", void 0);
|
|
38
|
+
(0, _defineProperty2.default)(this, "wasmLoader", void 0);
|
|
39
|
+
(0, _defineProperty2.default)(this, "assetLoader", void 0);
|
|
40
|
+
this.webex = webex;
|
|
41
|
+
this.wasmLoader = wasmLoader;
|
|
42
|
+
this.assetLoader = new _webexCore.StaticAssetLoader({
|
|
43
|
+
baseUrl: webex.config.meetings.assetsBaseUrl
|
|
44
|
+
}, {
|
|
45
|
+
parent: webex
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Warms the E2EE WASM module when configured and supported. Callers should not await this from
|
|
51
|
+
* registration; a loading failure must not prevent the client from registering for meetings.
|
|
52
|
+
* @returns {Promise<void>}
|
|
53
|
+
*/
|
|
54
|
+
return (0, _createClass2.default)(E2eeManager, [{
|
|
55
|
+
key: "preload",
|
|
56
|
+
value: (function () {
|
|
57
|
+
var _preload = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
58
|
+
var _this$webex, _this$webex$config, _this$webex$config$me;
|
|
59
|
+
var enabled, supported, wasmUrl;
|
|
60
|
+
return _regenerator.default.wrap(function (_context) {
|
|
61
|
+
while (1) switch (_context.prev = _context.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
enabled = !!((_this$webex = this.webex) !== null && _this$webex !== void 0 && (_this$webex$config = _this$webex.config) !== null && _this$webex$config !== void 0 && (_this$webex$config$me = _this$webex$config.meetings) !== null && _this$webex$config$me !== void 0 && _this$webex$config$me.enableE2ee);
|
|
64
|
+
supported = _webCapabilities.WebCapabilities.supportsWasm() === _webCapabilities.CapabilityState.CAPABLE;
|
|
65
|
+
if (!(!enabled || !supported)) {
|
|
66
|
+
_context.next = 1;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
_loggerProxy.default.logger.info('e2ee: E2eeManager#preload --> E2EE disabled or unsupported');
|
|
70
|
+
return _context.abrupt("return");
|
|
71
|
+
case 1:
|
|
72
|
+
wasmUrl = this.assetLoader.getUrl(E2EE_WASM_ASSET);
|
|
73
|
+
_loggerProxy.default.logger.info('e2ee: E2eeManager#preload --> preloading WASM module');
|
|
74
|
+
_context.next = 2;
|
|
75
|
+
return this.wasmLoader.preload(wasmUrl);
|
|
76
|
+
case 2:
|
|
77
|
+
_loggerProxy.default.logger.info('e2ee: E2eeManager#preload --> WASM module preloaded');
|
|
78
|
+
case 3:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}, _callee, this);
|
|
83
|
+
}));
|
|
84
|
+
function preload() {
|
|
85
|
+
return _preload.apply(this, arguments);
|
|
86
|
+
}
|
|
87
|
+
return preload;
|
|
88
|
+
}())
|
|
89
|
+
}]);
|
|
90
|
+
}();
|
|
91
|
+
//# sourceMappingURL=E2eeManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_webCapabilities","require","_webexCore","_loggerProxy","_interopRequireDefault","E2EE_WASM_ASSET","E2eeManager","exports","default","_ref","webex","wasmLoader","_classCallCheck2","_defineProperty2","assetLoader","StaticAssetLoader","baseUrl","config","meetings","assetsBaseUrl","parent","_createClass2","key","value","_preload","_asyncToGenerator2","_regenerator","mark","_callee","_this$webex","_this$webex$config","_this$webex$config$me","enabled","supported","wasmUrl","wrap","_context","prev","next","enableE2ee","WebCapabilities","supportsWasm","CapabilityState","CAPABLE","LoggerProxy","logger","info","abrupt","getUrl","preload","stop","apply","arguments"],"sources":["E2eeManager.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {CapabilityState, WebCapabilities} from '@webex/web-capabilities';\n// @ts-ignore - StaticAssetLoader is exported from webex-core's JavaScript entry point.\nimport {StaticAssetLoader} from '@webex/webex-core';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport WasmLoader from '../common/wasm-loader';\n\n/* The WASM module that contains the libe2ee + mlspp libraries with a WebE2EE wrapper around them, required for joining MLS group for E2EE meetings.\n * The version is in the filename as it is important that JS-SDK implementation of MLS class matches the WASM module version.\n */\nconst E2EE_WASM_ASSET = 'e2ee-0.0.1.wasm';\n\n/**\n * Owns E2EE resource preloading for a Meetings plugin session. The per-meeting controller is added\n * in the follow-up integration change; this first step keeps the slow WASM load off the join path.\n */\nexport default class E2eeManager {\n private readonly webex: any;\n\n private readonly wasmLoader: WasmLoader;\n\n private readonly assetLoader: StaticAssetLoader;\n\n constructor({webex, wasmLoader}: {webex: any; wasmLoader: WasmLoader}) {\n this.webex = webex;\n this.wasmLoader = wasmLoader;\n this.assetLoader = new StaticAssetLoader(\n {baseUrl: webex.config.meetings.assetsBaseUrl},\n {parent: webex}\n );\n }\n\n /**\n * Warms the E2EE WASM module when configured and supported. Callers should not await this from\n * registration; a loading failure must not prevent the client from registering for meetings.\n * @returns {Promise<void>}\n */\n async preload(): Promise<void> {\n const enabled = !!this.webex?.config?.meetings?.enableE2ee;\n const supported = WebCapabilities.supportsWasm() === CapabilityState.CAPABLE;\n\n if (!enabled || !supported) {\n LoggerProxy.logger.info('e2ee: E2eeManager#preload --> E2EE disabled or unsupported');\n\n return;\n }\n\n const wasmUrl = this.assetLoader.getUrl(E2EE_WASM_ASSET);\n\n LoggerProxy.logger.info('e2ee: E2eeManager#preload --> preloading WASM module');\n await this.wasmLoader.preload(wasmUrl);\n LoggerProxy.logger.info('e2ee: E2eeManager#preload --> WASM module preloaded');\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAIA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AARA;AACA;AACA;;AAGA;;AAMA;AACA;AACA;AACA,IAAMI,eAAe,GAAG,iBAAiB;;AAEzC;AACA;AACA;AACA;AAHA,IAIqBC,WAAW,GAAAC,OAAA,CAAAC,OAAA;EAO9B,SAAAF,YAAAG,IAAA,EAAuE;IAAA,IAA1DC,KAAK,GAAAD,IAAA,CAALC,KAAK;MAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAA,IAAAC,gBAAA,CAAAJ,OAAA,QAAAF,WAAA;IAAA,IAAAO,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAAA,IAAAK,gBAAA,CAAAL,OAAA;IAC5B,IAAI,CAACE,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACG,WAAW,GAAG,IAAIC,4BAAiB,CACtC;MAACC,OAAO,EAAEN,KAAK,CAACO,MAAM,CAACC,QAAQ,CAACC;IAAa,CAAC,EAC9C;MAACC,MAAM,EAAEV;IAAK,CAChB,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;EAJE,WAAAW,aAAA,CAAAb,OAA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F;MAAA,SAfKqB,OAAOA,CAAA;QAAA,OAAAzB,QAAA,CAAA2B,KAAA,OAAAC,SAAA;MAAA;MAAA,OAAPH,OAAO;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.MEDIA_ENCRYPTION_MERCURY_EVENTS = exports.LLM_ONLINE_EVENT = void 0;
|
|
9
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
13
|
+
/*!
|
|
14
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Source labels passed to the MLS engine for incoming signaling messages. */
|
|
18
|
+
|
|
19
|
+
/** LLM event carrying the channel's connection state. */
|
|
20
|
+
var LLM_ONLINE_EVENT = exports.LLM_ONLINE_EVENT = 'online';
|
|
21
|
+
|
|
22
|
+
/** Mercury events carrying MLS protocol messages. */
|
|
23
|
+
var MEDIA_ENCRYPTION_MERCURY_EVENTS = exports.MEDIA_ENCRYPTION_MERCURY_EVENTS = ['event:media_encryption.leader_nominated', 'event:media_encryption.welcome', 'event:media_encryption.annotated_welcome', 'event:media_encryption.multi_welcome', 'event:media_encryption.group_update', 'event:media_encryption.annotated_commit', 'event:media_encryption.large_group_update', 'event:media_encryption.use_key', 'event:media_encryption.join_request', 'event:media_encryption.leave_request', 'event:media_encryption.join_failure', 'event:media_encryption.leader_changed', 'event:media_encryption.message_segment'];
|
|
24
|
+
|
|
25
|
+
/** The subset of the MLS engine the signaling adapter drives. */
|
|
26
|
+
|
|
27
|
+
/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */
|
|
28
|
+
/**
|
|
29
|
+
* Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's
|
|
30
|
+
* media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,
|
|
31
|
+
* and tracks whether the signaling channel is connected so the engine knows when it can proceed
|
|
32
|
+
* with its join.
|
|
33
|
+
*/
|
|
34
|
+
var E2eeSignaling = exports.default = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* @param {Object} deps
|
|
37
|
+
* @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.
|
|
38
|
+
* @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).
|
|
39
|
+
* @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it
|
|
40
|
+
* can change, e.g. when moving between breakout sessions).
|
|
41
|
+
* @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.
|
|
42
|
+
*/
|
|
43
|
+
function E2eeSignaling(_ref) {
|
|
44
|
+
var _this = this;
|
|
45
|
+
var llm = _ref.llm,
|
|
46
|
+
mercury = _ref.mercury,
|
|
47
|
+
getLocusUrl = _ref.getLocusUrl,
|
|
48
|
+
session = _ref.session;
|
|
49
|
+
(0, _classCallCheck2.default)(this, E2eeSignaling);
|
|
50
|
+
(0, _defineProperty2.default)(this, "llm", void 0);
|
|
51
|
+
(0, _defineProperty2.default)(this, "mercury", void 0);
|
|
52
|
+
(0, _defineProperty2.default)(this, "getLocusUrl", void 0);
|
|
53
|
+
(0, _defineProperty2.default)(this, "session", void 0);
|
|
54
|
+
(0, _defineProperty2.default)(this, "started", false);
|
|
55
|
+
/**
|
|
56
|
+
* @param {Object} envelope - The mercury event envelope from the LLM channel.
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
|
+
(0, _defineProperty2.default)(this, "onLlmEvent", function (envelope) {
|
|
60
|
+
_this.forwardEvent(envelope, 'llm');
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* @param {Object} envelope - The mercury event envelope from the mercury channel.
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
(0, _defineProperty2.default)(this, "onMercuryEvent", function (envelope) {
|
|
67
|
+
_this.forwardEvent(envelope, 'mercury');
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
(0, _defineProperty2.default)(this, "onLlmOnline", function () {
|
|
73
|
+
if (_this.isLlmOnlineForThisSession()) {
|
|
74
|
+
_this.session.llmConnected();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
this.llm = llm;
|
|
78
|
+
this.mercury = mercury;
|
|
79
|
+
this.getLocusUrl = getLocusUrl;
|
|
80
|
+
this.session = session;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Subscribes to MLS mercury events and wires up connection tracking. Idempotent.
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
return (0, _createClass2.default)(E2eeSignaling, [{
|
|
88
|
+
key: "start",
|
|
89
|
+
value: function start() {
|
|
90
|
+
var _this2 = this;
|
|
91
|
+
if (this.started) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.started = true;
|
|
95
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
96
|
+
_this2.mercury.on(event, _this2.onMercuryEvent);
|
|
97
|
+
});
|
|
98
|
+
if (this.llm && this.isLlmOnlineForThisSession()) {
|
|
99
|
+
this.session.setLlmConnectedBeforeJoin(true);
|
|
100
|
+
}
|
|
101
|
+
this.subscribeToLlmEvents();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Removes all subscriptions. Idempotent.
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
}, {
|
|
109
|
+
key: "stop",
|
|
110
|
+
value: function stop() {
|
|
111
|
+
var _this3 = this;
|
|
112
|
+
if (!this.started) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this.started = false;
|
|
116
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
117
|
+
_this3.mercury.off(event, _this3.onMercuryEvent);
|
|
118
|
+
});
|
|
119
|
+
this.unsubscribeFromLlmEvents();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.
|
|
124
|
+
* @param {LLMChannel} [llm]
|
|
125
|
+
* @returns {void}
|
|
126
|
+
*/
|
|
127
|
+
}, {
|
|
128
|
+
key: "setLlmChannel",
|
|
129
|
+
value: function setLlmChannel(llm) {
|
|
130
|
+
if (this.llm === llm) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.unsubscribeFromLlmEvents();
|
|
134
|
+
this.llm = llm;
|
|
135
|
+
if (!this.started || !this.llm) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.subscribeToLlmEvents();
|
|
139
|
+
if (this.isLlmOnlineForThisSession()) {
|
|
140
|
+
this.session.llmConnected();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Forwards a signaling envelope to the engine, tagging which channel it came from.
|
|
146
|
+
* @param {Object} envelope - The mercury event envelope.
|
|
147
|
+
* @param {E2eeSignalingSource} source - The channel the envelope arrived on.
|
|
148
|
+
* @returns {void}
|
|
149
|
+
*/
|
|
150
|
+
}, {
|
|
151
|
+
key: "forwardEvent",
|
|
152
|
+
value: function forwardEvent(envelope, source) {
|
|
153
|
+
var _envelope$data;
|
|
154
|
+
var eventData = (_envelope$data = envelope === null || envelope === void 0 ? void 0 : envelope.data) !== null && _envelope$data !== void 0 ? _envelope$data : envelope;
|
|
155
|
+
var bytes = new TextEncoder().encode((0, _stringify.default)(eventData));
|
|
156
|
+
this.session.handleEvent(new Uint8Array(bytes), source);
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "subscribeToLlmEvents",
|
|
160
|
+
value: /** @returns {void} */
|
|
161
|
+
function subscribeToLlmEvents() {
|
|
162
|
+
var _this4 = this;
|
|
163
|
+
if (!this.started || !this.llm) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
167
|
+
var _this4$llm;
|
|
168
|
+
(_this4$llm = _this4.llm) === null || _this4$llm === void 0 ? void 0 : _this4$llm.on(event, _this4.onLlmEvent);
|
|
169
|
+
});
|
|
170
|
+
if (!this.isLlmOnlineForThisSession()) {
|
|
171
|
+
this.llm.on(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** @returns {void} */
|
|
176
|
+
}, {
|
|
177
|
+
key: "unsubscribeFromLlmEvents",
|
|
178
|
+
value: function unsubscribeFromLlmEvents() {
|
|
179
|
+
var _this$llm,
|
|
180
|
+
_this5 = this;
|
|
181
|
+
(_this$llm = this.llm) === null || _this$llm === void 0 ? void 0 : _this$llm.off(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
182
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
183
|
+
var _this5$llm;
|
|
184
|
+
(_this5$llm = _this5.llm) === null || _this5$llm === void 0 ? void 0 : _this5$llm.off(event, _this5.onLlmEvent);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).
|
|
190
|
+
*/
|
|
191
|
+
}, {
|
|
192
|
+
key: "isLlmOnlineForThisSession",
|
|
193
|
+
value: function isLlmOnlineForThisSession() {
|
|
194
|
+
var _this$llm2;
|
|
195
|
+
var sessionLocusUrl = this.getLocusUrl();
|
|
196
|
+
return !!sessionLocusUrl && !!((_this$llm2 = this.llm) !== null && _this$llm2 !== void 0 && _this$llm2.isConnected()) && sessionLocusUrl === this.llm.getLocusUrl();
|
|
197
|
+
}
|
|
198
|
+
}]);
|
|
199
|
+
}();
|
|
200
|
+
//# sourceMappingURL=E2eeSignaling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LLM_ONLINE_EVENT","exports","MEDIA_ENCRYPTION_MERCURY_EVENTS","E2eeSignaling","default","_ref","_this","llm","mercury","getLocusUrl","session","_classCallCheck2","_defineProperty2","envelope","forwardEvent","isLlmOnlineForThisSession","llmConnected","_createClass2","key","value","start","_this2","started","forEach","event","on","onMercuryEvent","setLlmConnectedBeforeJoin","subscribeToLlmEvents","stop","_this3","off","unsubscribeFromLlmEvents","setLlmChannel","source","_envelope$data","eventData","data","bytes","TextEncoder","encode","_stringify","handleEvent","Uint8Array","_this4","_this4$llm","onLlmEvent","onLlmOnline","_this$llm","_this5","_this5$llm","_this$llm2","sessionLocusUrl","isConnected"],"sources":["E2eeSignaling.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport type LLMChannel from '@webex/internal-plugin-llm';\n\n/** Source labels passed to the MLS engine for incoming signaling messages. */\ntype E2eeSignalingSource = 'llm' | 'mercury';\n\n/** LLM event carrying the channel's connection state. */\nexport const LLM_ONLINE_EVENT = 'online';\n\n/** Mercury events carrying MLS protocol messages. */\nexport const MEDIA_ENCRYPTION_MERCURY_EVENTS = [\n 'event:media_encryption.leader_nominated',\n 'event:media_encryption.welcome',\n 'event:media_encryption.annotated_welcome',\n 'event:media_encryption.multi_welcome',\n 'event:media_encryption.group_update',\n 'event:media_encryption.annotated_commit',\n 'event:media_encryption.large_group_update',\n 'event:media_encryption.use_key',\n 'event:media_encryption.join_request',\n 'event:media_encryption.leave_request',\n 'event:media_encryption.join_failure',\n 'event:media_encryption.leader_changed',\n 'event:media_encryption.message_segment',\n];\n\n/** The subset of the MLS engine the signaling adapter drives. */\nexport interface IMlsSignalingTarget {\n handleEvent(bytes: Uint8Array, source: E2eeSignalingSource): void;\n setLlmConnectedBeforeJoin(connected: boolean): void;\n llmConnected(): void;\n}\n\n/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */\nexport interface IMercuryChannel {\n on(event: string, handler: (envelope: any) => void): void;\n off(event: string, handler: (envelope: any) => void): void;\n}\n\n/**\n * Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's\n * media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,\n * and tracks whether the signaling channel is connected so the engine knows when it can proceed\n * with its join.\n */\nexport default class E2eeSignaling {\n private llm?: LLMChannel;\n\n private readonly mercury: IMercuryChannel;\n\n private readonly getLocusUrl: () => string | undefined;\n\n private readonly session: IMlsSignalingTarget;\n\n private started = false;\n\n /**\n * @param {Object} deps\n * @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.\n * @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).\n * @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it\n * can change, e.g. when moving between breakout sessions).\n * @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.\n */\n constructor({\n llm,\n mercury,\n getLocusUrl,\n session,\n }: {\n llm?: LLMChannel;\n mercury: IMercuryChannel;\n getLocusUrl: () => string | undefined;\n session: IMlsSignalingTarget;\n }) {\n this.llm = llm;\n this.mercury = mercury;\n this.getLocusUrl = getLocusUrl;\n this.session = session;\n }\n\n /**\n * Subscribes to MLS mercury events and wires up connection tracking. Idempotent.\n * @returns {void}\n */\n start(): void {\n if (this.started) {\n return;\n }\n this.started = true;\n\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.mercury.on(event, this.onMercuryEvent);\n });\n\n if (this.llm && this.isLlmOnlineForThisSession()) {\n this.session.setLlmConnectedBeforeJoin(true);\n }\n this.subscribeToLlmEvents();\n }\n\n /**\n * Removes all subscriptions. Idempotent.\n * @returns {void}\n */\n stop(): void {\n if (!this.started) {\n return;\n }\n this.started = false;\n\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.mercury.off(event, this.onMercuryEvent);\n });\n this.unsubscribeFromLlmEvents();\n }\n\n /**\n * Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.\n * @param {LLMChannel} [llm]\n * @returns {void}\n */\n setLlmChannel(llm?: LLMChannel): void {\n if (this.llm === llm) {\n return;\n }\n\n this.unsubscribeFromLlmEvents();\n this.llm = llm;\n\n if (!this.started || !this.llm) {\n return;\n }\n\n this.subscribeToLlmEvents();\n\n if (this.isLlmOnlineForThisSession()) {\n this.session.llmConnected();\n }\n }\n\n /**\n * Forwards a signaling envelope to the engine, tagging which channel it came from.\n * @param {Object} envelope - The mercury event envelope.\n * @param {E2eeSignalingSource} source - The channel the envelope arrived on.\n * @returns {void}\n */\n private forwardEvent(envelope: any, source: E2eeSignalingSource): void {\n const eventData = envelope?.data ?? envelope;\n const bytes = new TextEncoder().encode(JSON.stringify(eventData));\n\n this.session.handleEvent(new Uint8Array(bytes), source);\n }\n\n /**\n * @param {Object} envelope - The mercury event envelope from the LLM channel.\n * @returns {void}\n */\n private onLlmEvent = (envelope: any): void => {\n this.forwardEvent(envelope, 'llm');\n };\n\n /**\n * @param {Object} envelope - The mercury event envelope from the mercury channel.\n * @returns {void}\n */\n private onMercuryEvent = (envelope: any): void => {\n this.forwardEvent(envelope, 'mercury');\n };\n\n /**\n * @returns {void}\n */\n private onLlmOnline = (): void => {\n if (this.isLlmOnlineForThisSession()) {\n this.session.llmConnected();\n }\n };\n\n /** @returns {void} */\n private subscribeToLlmEvents(): void {\n if (!this.started || !this.llm) {\n return;\n }\n\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.llm?.on(event, this.onLlmEvent);\n });\n if (!this.isLlmOnlineForThisSession()) {\n this.llm.on(LLM_ONLINE_EVENT, this.onLlmOnline);\n }\n }\n\n /** @returns {void} */\n private unsubscribeFromLlmEvents(): void {\n this.llm?.off(LLM_ONLINE_EVENT, this.onLlmOnline);\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.llm?.off(event, this.onLlmEvent);\n });\n }\n\n /**\n * @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).\n */\n private isLlmOnlineForThisSession(): boolean {\n const sessionLocusUrl = this.getLocusUrl();\n\n return (\n !!sessionLocusUrl && !!this.llm?.isConnected() && sessionLocusUrl === this.llm.getLocusUrl()\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;;AAIA;;AAGA;AACO,IAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,QAAQ;;AAExC;AACO,IAAME,+BAA+B,GAAAD,OAAA,CAAAC,+BAAA,GAAG,CAC7C,yCAAyC,EACzC,gCAAgC,EAChC,0CAA0C,EAC1C,sCAAsC,EACtC,qCAAqC,EACrC,yCAAyC,EACzC,2CAA2C,EAC3C,gCAAgC,EAChC,qCAAqC,EACrC,sCAAsC,EACtC,qCAAqC,EACrC,uCAAuC,EACvC,wCAAwC,CACzC;;AAED;;AAOA;AAMA;AACA;AACA;AACA;AACA;AACA;AALA,IAMqBC,aAAa,GAAAF,OAAA,CAAAG,OAAA;EAWhC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,SAAAD,cAAAE,IAAA,EAUG;IAAA,IAAAC,KAAA;IAAA,IATDC,GAAG,GAAAF,IAAA,CAAHE,GAAG;MACHC,OAAO,GAAAH,IAAA,CAAPG,OAAO;MACPC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;MACXC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IAAA,IAA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AAAD,MAAI,CAAC1C,GAAG,cAAA2C,UAAA,uBAARA,UAAA,CAAUnB,GAAG,CAACP,KAAK,EAAEyB,MAAI,CAACH,UAAU,CAAC;MACvC,CAAC,CAAC;IACJ;;IAEA;AACF;AACA;EAFE;IAAA5B,GAAA;IAAAC,KAAA,EAGA,SAAQJ,yBAAyBA,CAAA,EAAY;MAAA,IAAAoC,UAAA;MAC3C,IAAMC,eAAe,GAAG,IAAI,CAAC3C,WAAW,CAAC,CAAC;MAE1C,OACE,CAAC,CAAC2C,eAAe,IAAI,CAAC,GAAAD,UAAA,GAAC,IAAI,CAAC5C,GAAG,cAAA4C,UAAA,eAARA,UAAA,CAAUE,WAAW,CAAC,CAAC,KAAID,eAAe,KAAK,IAAI,CAAC7C,GAAG,CAACE,WAAW,CAAC,CAAC;IAEhG;EAAC;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
14
|
+
/*!
|
|
15
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
var MEDIA_ENCRYPTION_SERVICE = 'media-encryption';
|
|
19
|
+
|
|
20
|
+
/** The bound webex.request function shape consumed by this adapter. */
|
|
21
|
+
/**
|
|
22
|
+
* Routes the MLS engine's protocol HTTP requests to the media-encryption service via
|
|
23
|
+
* webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.
|
|
24
|
+
* Requests use standard webex auth (Authorization bearer token) — no custom header is needed.
|
|
25
|
+
*/
|
|
26
|
+
var MediaEncryptionService = exports.default = /*#__PURE__*/function () {
|
|
27
|
+
/**
|
|
28
|
+
* @param {Object} deps
|
|
29
|
+
* @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.
|
|
30
|
+
*/
|
|
31
|
+
function MediaEncryptionService(_ref) {
|
|
32
|
+
var webexRequest = _ref.webexRequest;
|
|
33
|
+
(0, _classCallCheck2.default)(this, MediaEncryptionService);
|
|
34
|
+
(0, _defineProperty2.default)(this, "webexRequest", void 0);
|
|
35
|
+
this.webexRequest = webexRequest;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} url - The absolute request URL provided by the engine.
|
|
40
|
+
* @param {unknown} body - Request payload, sent as JSON.
|
|
41
|
+
* @returns {Promise<unknown>} The JSON-parsed response body.
|
|
42
|
+
*/
|
|
43
|
+
return (0, _createClass2.default)(MediaEncryptionService, [{
|
|
44
|
+
key: "request",
|
|
45
|
+
value: (function () {
|
|
46
|
+
var _request = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(url, body) {
|
|
47
|
+
var _yield$this$webexRequ, responseBody;
|
|
48
|
+
return _regenerator.default.wrap(function (_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.next = 1;
|
|
52
|
+
return this.webexRequest({
|
|
53
|
+
method: 'POST',
|
|
54
|
+
service: MEDIA_ENCRYPTION_SERVICE,
|
|
55
|
+
url: url,
|
|
56
|
+
body: body
|
|
57
|
+
});
|
|
58
|
+
case 1:
|
|
59
|
+
_yield$this$webexRequ = _context.sent;
|
|
60
|
+
responseBody = _yield$this$webexRequ.body;
|
|
61
|
+
return _context.abrupt("return", responseBody);
|
|
62
|
+
case 2:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}, _callee, this);
|
|
67
|
+
}));
|
|
68
|
+
function request(_x, _x2) {
|
|
69
|
+
return _request.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
return request;
|
|
72
|
+
}())
|
|
73
|
+
}]);
|
|
74
|
+
}();
|
|
75
|
+
//# sourceMappingURL=MediaEncryptionService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MEDIA_ENCRYPTION_SERVICE","MediaEncryptionService","exports","default","_ref","webexRequest","_classCallCheck2","_defineProperty2","_createClass2","key","value","_request","_asyncToGenerator2","_regenerator","mark","_callee","url","body","_yield$this$webexRequ","responseBody","wrap","_context","prev","next","method","service","sent","abrupt","stop","request","_x","_x2","apply","arguments"],"sources":["MediaEncryptionService.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst MEDIA_ENCRYPTION_SERVICE = 'media-encryption';\n\n/** The bound webex.request function shape consumed by this adapter. */\ntype WebexRequestMethod = (options: Record<string, any>) => Promise<any>;\n\n/**\n * Routes the MLS engine's protocol HTTP requests to the media-encryption service via\n * webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.\n * Requests use standard webex auth (Authorization bearer token) — no custom header is needed.\n */\nexport default class MediaEncryptionService {\n private readonly webexRequest: WebexRequestMethod;\n\n /**\n * @param {Object} deps\n * @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.\n */\n constructor({webexRequest}: {webexRequest: WebexRequestMethod}) {\n this.webexRequest = webexRequest;\n }\n\n /**\n * @param {string} url - The absolute request URL provided by the engine.\n * @param {unknown} body - Request payload, sent as JSON.\n * @returns {Promise<unknown>} The JSON-parsed response body.\n */\n async request(url: string, body: unknown): Promise<unknown> {\n const {body: responseBody} = await this.webexRequest({\n method: 'POST',\n service: MEDIA_ENCRYPTION_SERVICE,\n url,\n body,\n });\n\n return responseBody;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA,IAAMA,wBAAwB,GAAG,kBAAkB;;AAEnD;AAGA;AACA;AACA;AACA;AACA;AAJA,IAKqBC,sBAAsB,GAAAC,OAAA,CAAAC,OAAA;EAGzC;AACF;AACA;AACA;EACE,SAAAF,uBAAAG,IAAA,EAAgE;IAAA,IAAnDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAA,IAAAC,gBAAA,CAAAH,OAAA,QAAAF,sBAAA;IAAA,IAAAM,gBAAA,CAAAJ,OAAA;IACvB,IAAI,CAACE,YAAY,GAAGA,YAAY;EAClC;;EAEA;AACF;AACA;AACA;AACA;EAJE,WAAAG,aAAA,CAAAL,OAAA,EAAAF,sBAAA;IAAAQ,GAAA;IAAAC,KAAA;MAAA,IAAAC,QAAA,OAAAC,kBAAA,CAAAT,OAAA,eAAAU,YAAA,CAAAV,OAAA,CAAAW,IAAA,CAKA,SAAAC,QAAcC,GAAW,EAAEC,IAAa;QAAA,IAAAC,qBAAA,EAAAC,YAAA;QAAA,OAAAN,YAAA,CAAAV,OAAA,CAAAiB,IAAA,WAAAC,QAAA;UAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;YAAA;cAAAF,QAAA,CAAAE,IAAA;cAAA,OACH,IAAI,CAAClB,YAAY,CAAC;gBACnDmB,MAAM,EAAE,MAAM;gBACdC,OAAO,EAAEzB,wBAAwB;gBACjCgB,GAAG,EAAHA,GAAG;gBACHC,IAAI,EAAJA;cACF,CAAC,CAAC;YAAA;cAAAC,qBAAA,GAAAG,QAAA,CAAAK,IAAA;cALWP,YAAY,GAAAD,qBAAA,CA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