@webex/plugin-meetings 3.12.0 → 3.13.0-next.10
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 +135 -0
- 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/babel.config.js +17 -1
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +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 +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +128 -7
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +54 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/wasm-loader.js +174 -0
- package/dist/common/wasm-loader.js.map +1 -0
- package/dist/config.js +5 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +39 -11
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.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/hashTree/constants.js +13 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1245 -404
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +42 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +58 -16
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +24 -9
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +55 -12
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +914 -196
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/types.js +20 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +229 -166
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +4 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1931 -887
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +42 -3
- 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 +12 -5
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +342 -129
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +11 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +62 -15
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +32 -4
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +127 -3
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/common/errors/webex-errors.d.ts +36 -2
- package/dist/types/common/wasm-loader.d.ts +55 -0
- package/dist/types/config.d.ts +5 -2
- package/dist/types/constants.d.ts +15 -2
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- 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/hashTree/constants.d.ts +2 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +230 -18
- package/dist/types/hashTree/utils.d.ts +18 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +151 -15
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +28 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +66 -49
- package/dist/types/media/properties.d.ts +6 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +247 -13
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +12 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +44 -19
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +10 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
- package/dist/types/multistream/sendSlotManager.d.ts +28 -2
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +3 -0
- package/dist/webinar/index.js +539 -245
- package/dist/webinar/index.js.map +1 -1
- package/package.json +26 -24
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/aiEnableRequest/index.ts +16 -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/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +145 -3
- package/src/common/errors/webex-errors.ts +56 -3
- package/src/common/wasm-loader.ts +124 -0
- package/src/config.ts +9 -3
- package/src/constants.ts +23 -4
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -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/hashTree/ai-docs/hash-tree-spec.md +267 -0
- package/src/hashTree/constants.ts +16 -0
- package/src/hashTree/hashTreeParser.ts +1021 -214
- package/src/hashTree/utils.ts +36 -0
- package/src/index.ts +7 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interceptors/dataChannelAuthToken.ts +59 -12
- package/src/interceptors/locusRetry.ts +26 -5
- package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
- package/src/interpretation/index.ts +65 -10
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +907 -184
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +33 -1
- package/src/media/MediaConnectionAwaiter.ts +229 -196
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +8 -3
- package/src/meeting/ai-docs/meeting-spec.md +404 -0
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +1237 -254
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +53 -8
- 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 +11 -4
- package/src/meetings/ai-docs/meetings-spec.md +298 -0
- package/src/meetings/index.ts +242 -80
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/ai-docs/member-spec.md +196 -0
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/ai-docs/members-spec.md +256 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/ai-docs/metrics-spec.md +185 -0
- package/src/metrics/constants.ts +11 -0
- package/src/multistream/ai-docs/multistream-spec.md +295 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +23 -1
- package/src/multistream/sendSlotManager.ts +112 -4
- 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/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/ai-docs/reactions-spec.md +198 -0
- package/src/reactions/reactions.type.ts +3 -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/recording-controller/index.ts +1 -2
- package/src/roap/ai-docs/roap-spec.md +241 -0
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/ai-docs/webinar-spec.md +243 -0
- package/src/webinar/index.ts +333 -73
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/annotation/index.ts +214 -182
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +336 -15
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/common/wasm-loader.ts +171 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -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/hashTree/hashTreeParser.ts +3126 -238
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +179 -1
- package/test/unit/spec/interceptors/locusRetry.ts +234 -5
- package/test/unit/spec/interpretation/index.ts +119 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +1880 -136
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +479 -17
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +26 -26
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +3697 -501
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +12 -0
- package/test/unit/spec/meeting/utils.js +206 -16
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/index.js +2 -3
- package/test/unit/spec/meeting-info/meetinginfov2.js +88 -11
- package/test/unit/spec/meetings/index.js +606 -53
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +89 -0
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
- package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +165 -38
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +982 -328
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {camelCase} from 'lodash';
|
|
2
|
+
import ParameterError from '../common/errors/parameter';
|
|
2
3
|
import PermissionError from '../common/errors/permission';
|
|
3
|
-
import {CONTROLS, HTTP_VERBS} from '../constants';
|
|
4
4
|
import MeetingRequest from '../meeting/request';
|
|
5
5
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
6
6
|
import {Control, Setting} from './enums';
|
|
7
|
-
import {ControlConfig} from './types';
|
|
7
|
+
import {ControlConfig, ViewTheParticipantListProperties} from './types';
|
|
8
8
|
import Util from './util';
|
|
9
9
|
import {CAN_SET, CAN_UNSET, ENABLED} from './constants';
|
|
10
10
|
|
|
@@ -56,6 +56,10 @@ export default class ControlsOptionsManager {
|
|
|
56
56
|
*/
|
|
57
57
|
private mainLocusUrl: string;
|
|
58
58
|
|
|
59
|
+
private getControls: () => Record<string, any> = () => ({});
|
|
60
|
+
|
|
61
|
+
private isWebinar: () => boolean = () => false;
|
|
62
|
+
|
|
59
63
|
/**
|
|
60
64
|
* @param {MeetingRequest} request
|
|
61
65
|
* @param {Object} options
|
|
@@ -67,6 +71,8 @@ export default class ControlsOptionsManager {
|
|
|
67
71
|
options?: {
|
|
68
72
|
locusUrl: string;
|
|
69
73
|
displayHints?: Array<string>;
|
|
74
|
+
getControls?: () => Record<string, any>;
|
|
75
|
+
isWebinar?: () => boolean;
|
|
70
76
|
}
|
|
71
77
|
) {
|
|
72
78
|
this.initialize(request);
|
|
@@ -89,7 +95,12 @@ export default class ControlsOptionsManager {
|
|
|
89
95
|
* @public
|
|
90
96
|
* @memberof ControlsOptionsManager
|
|
91
97
|
*/
|
|
92
|
-
public set(options?: {
|
|
98
|
+
public set(options?: {
|
|
99
|
+
locusUrl: string;
|
|
100
|
+
displayHints?: Array<string>;
|
|
101
|
+
getControls?: () => Record<string, any>;
|
|
102
|
+
isWebinar?: () => boolean;
|
|
103
|
+
}) {
|
|
93
104
|
this.extract(options);
|
|
94
105
|
}
|
|
95
106
|
|
|
@@ -141,9 +152,20 @@ export default class ControlsOptionsManager {
|
|
|
141
152
|
* @private
|
|
142
153
|
* @memberof ControlsOptionsManager
|
|
143
154
|
*/
|
|
144
|
-
private extract(options?: {
|
|
155
|
+
private extract(options?: {
|
|
156
|
+
locusUrl: string;
|
|
157
|
+
displayHints?: Array<string>;
|
|
158
|
+
getControls?: () => Record<string, any>;
|
|
159
|
+
isWebinar?: () => boolean;
|
|
160
|
+
}) {
|
|
145
161
|
this.setDisplayHints(options?.displayHints);
|
|
146
162
|
this.setLocusUrl(options?.locusUrl);
|
|
163
|
+
if (options?.getControls) {
|
|
164
|
+
this.getControls = options.getControls;
|
|
165
|
+
}
|
|
166
|
+
if (options?.isWebinar) {
|
|
167
|
+
this.isWebinar = options.isWebinar;
|
|
168
|
+
}
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
/**
|
|
@@ -153,6 +175,12 @@ export default class ControlsOptionsManager {
|
|
|
153
175
|
* @returns {Promise<Array<any>>}- Promise resolving if the request was successful.
|
|
154
176
|
*/
|
|
155
177
|
public update(...controls: Array<ControlConfig>) {
|
|
178
|
+
if (!this.locusUrl) {
|
|
179
|
+
return Promise.reject(
|
|
180
|
+
new ParameterError('The associated locusUrl for update() controls must be defined.')
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
156
184
|
const payloads = controls.map((control) => {
|
|
157
185
|
if (!Object.keys(Control).includes(control.scope)) {
|
|
158
186
|
throw new Error(
|
|
@@ -166,25 +194,33 @@ export default class ControlsOptionsManager {
|
|
|
166
194
|
);
|
|
167
195
|
}
|
|
168
196
|
|
|
197
|
+
let {properties} = control;
|
|
198
|
+
|
|
199
|
+
if (control.scope === Control.viewTheParticipantList) {
|
|
200
|
+
const props = properties as ViewTheParticipantListProperties;
|
|
201
|
+
const current = this.getControls()?.viewTheParticipantList;
|
|
202
|
+
properties = {
|
|
203
|
+
enabled: props.enabled ?? current?.enabled ?? false,
|
|
204
|
+
...(this.isWebinar() && {
|
|
205
|
+
panelistEnabled: props.panelistEnabled ?? current?.panelistEnabled ?? false,
|
|
206
|
+
attendeeCount: props.attendeeCount ?? Boolean(current?.attendeeCount) ?? false,
|
|
207
|
+
}),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
|
|
169
211
|
return {
|
|
170
|
-
[control.scope]:
|
|
212
|
+
[control.scope]: properties,
|
|
171
213
|
};
|
|
172
214
|
});
|
|
173
215
|
|
|
174
216
|
return payloads.reduce((previous, payload) => {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
this.request.request({
|
|
183
|
-
uri: `${this.mainLocusUrl || this.locusUrl}/${CONTROLS}`,
|
|
184
|
-
body: {...payload, ...extraBody},
|
|
185
|
-
method: HTTP_VERBS.PATCH,
|
|
186
|
-
})
|
|
187
|
-
);
|
|
217
|
+
const requestParams = Util.getControlsRequestParams({
|
|
218
|
+
body: payload,
|
|
219
|
+
locusUrl: this.locusUrl,
|
|
220
|
+
mainLocusUrl: this.mainLocusUrl,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
return previous.then(() => this.sendControlsRequest(requestParams));
|
|
188
224
|
}, Promise.resolve());
|
|
189
225
|
}
|
|
190
226
|
|
|
@@ -200,6 +236,12 @@ export default class ControlsOptionsManager {
|
|
|
200
236
|
[Setting.muteOnEntry]?: boolean;
|
|
201
237
|
[Setting.roles]?: Array<string>;
|
|
202
238
|
}): Promise<any> {
|
|
239
|
+
if (!this.locusUrl) {
|
|
240
|
+
return Promise.reject(
|
|
241
|
+
new ParameterError('The associated locusUrl for setControls() must be defined.')
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
203
245
|
LoggerProxy.logger.log(
|
|
204
246
|
`ControlsOptionsManager:index#setControls --> ${JSON.stringify(setting)}`
|
|
205
247
|
);
|
|
@@ -258,17 +300,34 @@ export default class ControlsOptionsManager {
|
|
|
258
300
|
if (error) {
|
|
259
301
|
return Promise.reject(error);
|
|
260
302
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
// @ts-ignore
|
|
267
|
-
return this.request.request({
|
|
268
|
-
uri: `${this.mainLocusUrl || this.locusUrl}/${CONTROLS}`,
|
|
269
|
-
body: {...body, ...extraBody},
|
|
270
|
-
method: HTTP_VERBS.PATCH,
|
|
303
|
+
|
|
304
|
+
const requestParams = Util.getControlsRequestParams({
|
|
305
|
+
body,
|
|
306
|
+
locusUrl: this.locusUrl,
|
|
307
|
+
mainLocusUrl: this.mainLocusUrl,
|
|
271
308
|
});
|
|
309
|
+
|
|
310
|
+
return this.sendControlsRequest(requestParams);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Sends a controls request to Locus. When authorizingLocusUrl is present in the body,
|
|
315
|
+
* we use a plain request() because the response contains the main session Locus DTO
|
|
316
|
+
* instead of the breakout we're in, so we don't want to parse it as a delta.
|
|
317
|
+
* Otherwise we use locusDeltaRequest() for normal delta processing.
|
|
318
|
+
*
|
|
319
|
+
* @param {Object} requestParams - The request parameters from getControlsRequestParams.
|
|
320
|
+
* @returns {Promise<any>}
|
|
321
|
+
*/
|
|
322
|
+
private sendControlsRequest(requestParams: {
|
|
323
|
+
uri: string;
|
|
324
|
+
body: Record<string, any>;
|
|
325
|
+
method: string;
|
|
326
|
+
}): Promise<any> {
|
|
327
|
+
return requestParams.body.authorizingLocusUrl
|
|
328
|
+
? // @ts-ignore
|
|
329
|
+
this.request.request(requestParams)
|
|
330
|
+
: this.request.locusDeltaRequest(requestParams);
|
|
272
331
|
}
|
|
273
332
|
|
|
274
333
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {DISPLAY_HINTS} from '../constants';
|
|
1
|
+
import {CONTROLS, DISPLAY_HINTS, HTTP_VERBS} from '../constants';
|
|
2
2
|
import {Control} from './enums';
|
|
3
|
+
import {AUDIO_CONTROL_BODY_KEYS} from './constants';
|
|
3
4
|
import {
|
|
4
5
|
ControlConfig,
|
|
5
6
|
AudioProperties,
|
|
@@ -400,6 +401,85 @@ class Utils {
|
|
|
400
401
|
|
|
401
402
|
return determinant;
|
|
402
403
|
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Check if all body keys represent audio controls.
|
|
407
|
+
*
|
|
408
|
+
* @param {Record<string, any>} body - The request body to inspect.
|
|
409
|
+
* @returns {boolean} - True if every key in the body is an audio control key.
|
|
410
|
+
*/
|
|
411
|
+
public static isAudioControl(body: Record<string, any>): boolean {
|
|
412
|
+
return Object.keys(body).every((key) => AUDIO_CONTROL_BODY_KEYS.has(key));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Check if the current locus URL differs from the main locus URL,
|
|
417
|
+
* indicating a breakout session.
|
|
418
|
+
*
|
|
419
|
+
* @param {string} locusUrl - The current locus URL.
|
|
420
|
+
* @param {string} [mainLocusUrl] - The main locus URL.
|
|
421
|
+
* @returns {boolean} - True if in a breakout session.
|
|
422
|
+
*/
|
|
423
|
+
public static isBreakoutLocusUrl(locusUrl: string, mainLocusUrl?: string): boolean {
|
|
424
|
+
return Boolean(mainLocusUrl) && mainLocusUrl !== locusUrl;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Resolve the target URL and extra body fields for a controls request,
|
|
429
|
+
* handling breakout session routing. Note: This is a pure computation function.
|
|
430
|
+
* It does not validate that locusUrl is
|
|
431
|
+
* defined. Callers must guard against falsy locusUrl before
|
|
432
|
+
* invoking this function.
|
|
433
|
+
* Mixed audio and non-audio keys in a single body (e.g., {audio: {...},
|
|
434
|
+
* raiseHand: {...}}) are treated as non-audio and routed to mainLocusUrl with
|
|
435
|
+
* authorizingLocusUrl. This means the audio portion would go through unsupported
|
|
436
|
+
* cross-locus authorization. Callers must not produce mixed payloads — update()
|
|
437
|
+
* sends each control scope as a separate request, and setControls() only handles
|
|
438
|
+
* audio-related settings.
|
|
439
|
+
*
|
|
440
|
+
* The authorizingLocusUrl mechanism on PATCH /loci/{lid}/controls is not supported
|
|
441
|
+
* for audio control updates (mute/unmute, muteOnEntry, disallowUnmute).
|
|
442
|
+
* Audio controls are not wired into the cross-locus GraphQL authorization path that
|
|
443
|
+
* other control types (raiseHand, viewParticipantList, admit, reactions, etc.) use.
|
|
444
|
+
* Specifically, the GraphQL authorization layer does not recognize audio as a control
|
|
445
|
+
* type eligible for remote locus authorization.
|
|
446
|
+
* This means authorizingLocusUrl is effectively ignored for audio controls and the
|
|
447
|
+
* server evaluates the request against the target locus only, where the host may not
|
|
448
|
+
* be currently joined.
|
|
449
|
+
* Audio control updates must be sent directly to the locus the user is currently in.
|
|
450
|
+
* If the host is in a breakout and wants to mute participants in that breakout, the
|
|
451
|
+
* request should target the breakout locus URL directly, not the main session locus
|
|
452
|
+
* with authorizingLocusUrl.
|
|
453
|
+
* Meeting-wide audio control actions (e.g., muting panelists across all breakouts
|
|
454
|
+
* from a single request) are not currently supported through this mechanism.
|
|
455
|
+
*
|
|
456
|
+
* @param {object} options
|
|
457
|
+
* @param {Record<string, any>} options.body - The request body.
|
|
458
|
+
* @param {string} options.locusUrl - The current locus URL. Must be defined (callers must validate).
|
|
459
|
+
* @param {string} [options.mainLocusUrl] - The main locus URL.
|
|
460
|
+
* @returns {{ uri: string, body: Record<string, any>, method: string }}
|
|
461
|
+
*/
|
|
462
|
+
public static getControlsRequestParams(options: {
|
|
463
|
+
body: Record<string, any>;
|
|
464
|
+
locusUrl: string;
|
|
465
|
+
mainLocusUrl?: string;
|
|
466
|
+
}): {
|
|
467
|
+
uri: string;
|
|
468
|
+
body: Record<string, any>;
|
|
469
|
+
method: string;
|
|
470
|
+
} {
|
|
471
|
+
const {body, locusUrl, mainLocusUrl} = options;
|
|
472
|
+
|
|
473
|
+
const isAudio = Utils.isAudioControl(body);
|
|
474
|
+
const inBreakout = Utils.isBreakoutLocusUrl(locusUrl, mainLocusUrl);
|
|
475
|
+
const targetUrl = inBreakout && !isAudio ? mainLocusUrl : locusUrl;
|
|
476
|
+
|
|
477
|
+
return {
|
|
478
|
+
uri: `${targetUrl}/${CONTROLS}`,
|
|
479
|
+
body: inBreakout && !isAudio ? {...body, authorizingLocusUrl: locusUrl} : body,
|
|
480
|
+
method: HTTP_VERBS.PATCH,
|
|
481
|
+
};
|
|
482
|
+
}
|
|
403
483
|
}
|
|
404
484
|
|
|
405
485
|
export default Utils;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {CapabilityState, WebCapabilities} from '@webex/web-capabilities';
|
|
6
|
+
// @ts-ignore - StaticAssetLoader is exported from webex-core's JavaScript entry point.
|
|
7
|
+
import {StaticAssetLoader} from '@webex/webex-core';
|
|
8
|
+
|
|
9
|
+
import LoggerProxy from '../common/logs/logger-proxy';
|
|
10
|
+
import WasmLoader from '../common/wasm-loader';
|
|
11
|
+
|
|
12
|
+
/* The WASM module that contains the libe2ee + mlspp libraries with a WebE2EE wrapper around them, required for joining MLS group for E2EE meetings.
|
|
13
|
+
* The version is in the filename as it is important that JS-SDK implementation of MLS class matches the WASM module version.
|
|
14
|
+
*/
|
|
15
|
+
const E2EE_WASM_ASSET = 'e2ee-0.0.1.wasm';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Owns E2EE resource preloading for a Meetings plugin session. The per-meeting controller is added
|
|
19
|
+
* in the follow-up integration change; this first step keeps the slow WASM load off the join path.
|
|
20
|
+
*/
|
|
21
|
+
export default class E2eeManager {
|
|
22
|
+
private readonly webex: any;
|
|
23
|
+
|
|
24
|
+
private readonly wasmLoader: WasmLoader;
|
|
25
|
+
|
|
26
|
+
private readonly assetLoader: StaticAssetLoader;
|
|
27
|
+
|
|
28
|
+
constructor({webex, wasmLoader}: {webex: any; wasmLoader: WasmLoader}) {
|
|
29
|
+
this.webex = webex;
|
|
30
|
+
this.wasmLoader = wasmLoader;
|
|
31
|
+
this.assetLoader = new StaticAssetLoader(
|
|
32
|
+
{baseUrl: webex.config.meetings.assetsBaseUrl},
|
|
33
|
+
{parent: webex}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Warms the E2EE WASM module when configured and supported. Callers should not await this from
|
|
39
|
+
* registration; a loading failure must not prevent the client from registering for meetings.
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
async preload(): Promise<void> {
|
|
43
|
+
const enabled = !!this.webex?.config?.meetings?.enableE2ee;
|
|
44
|
+
const supported = WebCapabilities.supportsWasm() === CapabilityState.CAPABLE;
|
|
45
|
+
|
|
46
|
+
if (!enabled || !supported) {
|
|
47
|
+
LoggerProxy.logger.info('e2ee: E2eeManager#preload --> E2EE disabled or unsupported');
|
|
48
|
+
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const wasmUrl = this.assetLoader.getUrl(E2EE_WASM_ASSET);
|
|
53
|
+
|
|
54
|
+
LoggerProxy.logger.info('e2ee: E2eeManager#preload --> preloading WASM module');
|
|
55
|
+
await this.wasmLoader.preload(wasmUrl);
|
|
56
|
+
LoggerProxy.logger.info('e2ee: E2eeManager#preload --> WASM module preloaded');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type LLMChannel from '@webex/internal-plugin-llm';
|
|
6
|
+
|
|
7
|
+
/** Source labels passed to the MLS engine for incoming signaling messages. */
|
|
8
|
+
type E2eeSignalingSource = 'llm' | 'mercury';
|
|
9
|
+
|
|
10
|
+
/** LLM event carrying the channel's connection state. */
|
|
11
|
+
export const LLM_ONLINE_EVENT = 'online';
|
|
12
|
+
|
|
13
|
+
/** Mercury events carrying MLS protocol messages. */
|
|
14
|
+
export const MEDIA_ENCRYPTION_MERCURY_EVENTS = [
|
|
15
|
+
'event:media_encryption.leader_nominated',
|
|
16
|
+
'event:media_encryption.welcome',
|
|
17
|
+
'event:media_encryption.annotated_welcome',
|
|
18
|
+
'event:media_encryption.multi_welcome',
|
|
19
|
+
'event:media_encryption.group_update',
|
|
20
|
+
'event:media_encryption.annotated_commit',
|
|
21
|
+
'event:media_encryption.large_group_update',
|
|
22
|
+
'event:media_encryption.use_key',
|
|
23
|
+
'event:media_encryption.join_request',
|
|
24
|
+
'event:media_encryption.leave_request',
|
|
25
|
+
'event:media_encryption.join_failure',
|
|
26
|
+
'event:media_encryption.leader_changed',
|
|
27
|
+
'event:media_encryption.message_segment',
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/** The subset of the MLS engine the signaling adapter drives. */
|
|
31
|
+
export interface IMlsSignalingTarget {
|
|
32
|
+
handleEvent(bytes: Uint8Array, source: E2eeSignalingSource): void;
|
|
33
|
+
setLlmConnectedBeforeJoin(connected: boolean): void;
|
|
34
|
+
llmConnected(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */
|
|
38
|
+
export interface IMercuryChannel {
|
|
39
|
+
on(event: string, handler: (envelope: any) => void): void;
|
|
40
|
+
off(event: string, handler: (envelope: any) => void): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's
|
|
45
|
+
* media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,
|
|
46
|
+
* and tracks whether the signaling channel is connected so the engine knows when it can proceed
|
|
47
|
+
* with its join.
|
|
48
|
+
*/
|
|
49
|
+
export default class E2eeSignaling {
|
|
50
|
+
private llm?: LLMChannel;
|
|
51
|
+
|
|
52
|
+
private readonly mercury: IMercuryChannel;
|
|
53
|
+
|
|
54
|
+
private readonly getLocusUrl: () => string | undefined;
|
|
55
|
+
|
|
56
|
+
private readonly session: IMlsSignalingTarget;
|
|
57
|
+
|
|
58
|
+
private started = false;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @param {Object} deps
|
|
62
|
+
* @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.
|
|
63
|
+
* @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).
|
|
64
|
+
* @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it
|
|
65
|
+
* can change, e.g. when moving between breakout sessions).
|
|
66
|
+
* @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.
|
|
67
|
+
*/
|
|
68
|
+
constructor({
|
|
69
|
+
llm,
|
|
70
|
+
mercury,
|
|
71
|
+
getLocusUrl,
|
|
72
|
+
session,
|
|
73
|
+
}: {
|
|
74
|
+
llm?: LLMChannel;
|
|
75
|
+
mercury: IMercuryChannel;
|
|
76
|
+
getLocusUrl: () => string | undefined;
|
|
77
|
+
session: IMlsSignalingTarget;
|
|
78
|
+
}) {
|
|
79
|
+
this.llm = llm;
|
|
80
|
+
this.mercury = mercury;
|
|
81
|
+
this.getLocusUrl = getLocusUrl;
|
|
82
|
+
this.session = session;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Subscribes to MLS mercury events and wires up connection tracking. Idempotent.
|
|
87
|
+
* @returns {void}
|
|
88
|
+
*/
|
|
89
|
+
start(): void {
|
|
90
|
+
if (this.started) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.started = true;
|
|
94
|
+
|
|
95
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
96
|
+
this.mercury.on(event, this.onMercuryEvent);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (this.llm && this.isLlmOnlineForThisSession()) {
|
|
100
|
+
this.session.setLlmConnectedBeforeJoin(true);
|
|
101
|
+
}
|
|
102
|
+
this.subscribeToLlmEvents();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Removes all subscriptions. Idempotent.
|
|
107
|
+
* @returns {void}
|
|
108
|
+
*/
|
|
109
|
+
stop(): void {
|
|
110
|
+
if (!this.started) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.started = false;
|
|
114
|
+
|
|
115
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
116
|
+
this.mercury.off(event, this.onMercuryEvent);
|
|
117
|
+
});
|
|
118
|
+
this.unsubscribeFromLlmEvents();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.
|
|
123
|
+
* @param {LLMChannel} [llm]
|
|
124
|
+
* @returns {void}
|
|
125
|
+
*/
|
|
126
|
+
setLlmChannel(llm?: LLMChannel): void {
|
|
127
|
+
if (this.llm === llm) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this.unsubscribeFromLlmEvents();
|
|
132
|
+
this.llm = llm;
|
|
133
|
+
|
|
134
|
+
if (!this.started || !this.llm) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
this.subscribeToLlmEvents();
|
|
139
|
+
|
|
140
|
+
if (this.isLlmOnlineForThisSession()) {
|
|
141
|
+
this.session.llmConnected();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Forwards a signaling envelope to the engine, tagging which channel it came from.
|
|
147
|
+
* @param {Object} envelope - The mercury event envelope.
|
|
148
|
+
* @param {E2eeSignalingSource} source - The channel the envelope arrived on.
|
|
149
|
+
* @returns {void}
|
|
150
|
+
*/
|
|
151
|
+
private forwardEvent(envelope: any, source: E2eeSignalingSource): void {
|
|
152
|
+
const eventData = envelope?.data ?? envelope;
|
|
153
|
+
const bytes = new TextEncoder().encode(JSON.stringify(eventData));
|
|
154
|
+
|
|
155
|
+
this.session.handleEvent(new Uint8Array(bytes), source);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @param {Object} envelope - The mercury event envelope from the LLM channel.
|
|
160
|
+
* @returns {void}
|
|
161
|
+
*/
|
|
162
|
+
private onLlmEvent = (envelope: any): void => {
|
|
163
|
+
this.forwardEvent(envelope, 'llm');
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param {Object} envelope - The mercury event envelope from the mercury channel.
|
|
168
|
+
* @returns {void}
|
|
169
|
+
*/
|
|
170
|
+
private onMercuryEvent = (envelope: any): void => {
|
|
171
|
+
this.forwardEvent(envelope, 'mercury');
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @returns {void}
|
|
176
|
+
*/
|
|
177
|
+
private onLlmOnline = (): void => {
|
|
178
|
+
if (this.isLlmOnlineForThisSession()) {
|
|
179
|
+
this.session.llmConnected();
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/** @returns {void} */
|
|
184
|
+
private subscribeToLlmEvents(): void {
|
|
185
|
+
if (!this.started || !this.llm) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
190
|
+
this.llm?.on(event, this.onLlmEvent);
|
|
191
|
+
});
|
|
192
|
+
if (!this.isLlmOnlineForThisSession()) {
|
|
193
|
+
this.llm.on(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** @returns {void} */
|
|
198
|
+
private unsubscribeFromLlmEvents(): void {
|
|
199
|
+
this.llm?.off(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
200
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
201
|
+
this.llm?.off(event, this.onLlmEvent);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).
|
|
207
|
+
*/
|
|
208
|
+
private isLlmOnlineForThisSession(): boolean {
|
|
209
|
+
const sessionLocusUrl = this.getLocusUrl();
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
!!sessionLocusUrl && !!this.llm?.isConnected() && sessionLocusUrl === this.llm.getLocusUrl()
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const MEDIA_ENCRYPTION_SERVICE = 'media-encryption';
|
|
6
|
+
|
|
7
|
+
/** The bound webex.request function shape consumed by this adapter. */
|
|
8
|
+
type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Routes the MLS engine's protocol HTTP requests to the media-encryption service via
|
|
12
|
+
* webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.
|
|
13
|
+
* Requests use standard webex auth (Authorization bearer token) — no custom header is needed.
|
|
14
|
+
*/
|
|
15
|
+
export default class MediaEncryptionService {
|
|
16
|
+
private readonly webexRequest: WebexRequestMethod;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} deps
|
|
20
|
+
* @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.
|
|
21
|
+
*/
|
|
22
|
+
constructor({webexRequest}: {webexRequest: WebexRequestMethod}) {
|
|
23
|
+
this.webexRequest = webexRequest;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} url - The absolute request URL provided by the engine.
|
|
28
|
+
* @param {unknown} body - Request payload, sent as JSON.
|
|
29
|
+
* @returns {Promise<unknown>} The JSON-parsed response body.
|
|
30
|
+
*/
|
|
31
|
+
async request(url: string, body: unknown): Promise<unknown> {
|
|
32
|
+
const {body: responseBody} = await this.webexRequest({
|
|
33
|
+
method: 'POST',
|
|
34
|
+
service: MEDIA_ENCRYPTION_SERVICE,
|
|
35
|
+
url,
|
|
36
|
+
body,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return responseBody;
|
|
40
|
+
}
|
|
41
|
+
}
|