@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
package/src/webinar/index.ts
CHANGED
|
@@ -4,20 +4,23 @@
|
|
|
4
4
|
import {WebexPlugin, config} from '@webex/webex-core';
|
|
5
5
|
import uuid from 'uuid';
|
|
6
6
|
import {get} from 'lodash';
|
|
7
|
-
import
|
|
7
|
+
import type LLMChannel from '@webex/internal-plugin-llm';
|
|
8
8
|
import {
|
|
9
9
|
_ID_,
|
|
10
|
+
EVENT_TRIGGERS,
|
|
10
11
|
HEADERS,
|
|
11
12
|
HTTP_VERBS,
|
|
12
13
|
MEETINGS,
|
|
13
14
|
SELF_ROLES,
|
|
14
15
|
SHARE_STATUS,
|
|
15
16
|
DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
|
|
16
|
-
|
|
17
|
+
LOCUS_LLM_EVENT,
|
|
17
18
|
} from '../constants';
|
|
19
|
+
import Trigger from '../common/events/trigger-proxy';
|
|
18
20
|
|
|
19
21
|
import WebinarCollection from './collection';
|
|
20
22
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
23
|
+
import MeetingUtil from '../meeting/util';
|
|
21
24
|
import {sanitizeParams} from './utils';
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -39,6 +42,21 @@ const Webinar = WebexPlugin.extend({
|
|
|
39
42
|
meetingId: 'string',
|
|
40
43
|
},
|
|
41
44
|
|
|
45
|
+
/**
|
|
46
|
+
* LLM channel for practice session, owned by this webinar instance.
|
|
47
|
+
* @private
|
|
48
|
+
* @type {LLMChannel|undefined}
|
|
49
|
+
*/
|
|
50
|
+
_practiceSessionLLMChannel: undefined as LLMChannel | undefined,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Pending practice session datachannel token, saved from join response.
|
|
54
|
+
* Used when creating the practice session LLM channel.
|
|
55
|
+
* @private
|
|
56
|
+
* @type {string|undefined}
|
|
57
|
+
*/
|
|
58
|
+
_pendingPracticeSessionDatachannelToken: undefined as string | undefined,
|
|
59
|
+
|
|
42
60
|
/**
|
|
43
61
|
* Calls this to clean up listeners
|
|
44
62
|
* @returns {void}
|
|
@@ -98,13 +116,49 @@ const Webinar = WebexPlugin.extend({
|
|
|
98
116
|
return {isPromoted, isDemoted};
|
|
99
117
|
},
|
|
100
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Resolves the meeting associated with this webinar instance, guarded against the
|
|
121
|
+
* meetingId pointer drifting onto an unrelated transient meeting (e.g. an inbound
|
|
122
|
+
* 1:1 call) that may exist in the meeting collection. Returns the meeting only when
|
|
123
|
+
* its locusUrl matches this webinar's tracked locusUrl. Returns undefined (with a
|
|
124
|
+
* warning) when the meeting cannot be resolved or when the webinar's locusUrl has
|
|
125
|
+
* not been initialized yet — callers must treat this as "no owned meeting" rather
|
|
126
|
+
* than fall through to an unvalidated lookup.
|
|
127
|
+
* @returns {object|undefined}
|
|
128
|
+
*/
|
|
129
|
+
getValidatedWebinarMeeting() {
|
|
130
|
+
const meeting = this.webex.meetings.getMeetingByType(_ID_, this.meetingId);
|
|
131
|
+
|
|
132
|
+
if (!meeting) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (!this.locusUrl) {
|
|
137
|
+
LoggerProxy.logger.warn(
|
|
138
|
+
`Webinar:index#getValidatedWebinarMeeting --> skipping; webinar locusUrl is not yet initialized for meetingId ${this.meetingId}`
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (meeting.locusUrl !== this.locusUrl) {
|
|
145
|
+
LoggerProxy.logger.warn(
|
|
146
|
+
`Webinar:index#getValidatedWebinarMeeting --> skipping; meeting ${this.meetingId} locusUrl ${meeting.locusUrl} does not match webinar locusUrl ${this.locusUrl}`
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return meeting;
|
|
153
|
+
},
|
|
154
|
+
|
|
101
155
|
/**
|
|
102
156
|
* should join practice session data channel or not
|
|
103
157
|
* @param {Object} {isPromoted: boolean, isDemoted: boolean}} Role transition states
|
|
104
158
|
* @returns {void}
|
|
105
159
|
*/
|
|
106
160
|
updateStatusByRole({isPromoted, isDemoted}) {
|
|
107
|
-
const meeting = this.
|
|
161
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
108
162
|
|
|
109
163
|
if (
|
|
110
164
|
(isDemoted && meeting?.shareStatus === SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE) ||
|
|
@@ -127,34 +181,161 @@ const Webinar = WebexPlugin.extend({
|
|
|
127
181
|
},
|
|
128
182
|
|
|
129
183
|
/**
|
|
130
|
-
*
|
|
184
|
+
* Returns the practice session LLM channel binding, if connected.
|
|
185
|
+
* @returns {string|undefined}
|
|
186
|
+
*/
|
|
187
|
+
getPracticeSessionBinding() {
|
|
188
|
+
return this._practiceSessionLLMChannel?.getBinding();
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Returns whether the practice session LLM channel is connected.
|
|
193
|
+
* @returns {boolean}
|
|
194
|
+
*/
|
|
195
|
+
isPracticeSessionLLMChannelConnected() {
|
|
196
|
+
return this._practiceSessionLLMChannel?.isConnected() ?? false;
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Returns the practice session LLM channel's locus URL, if available.
|
|
201
|
+
* @returns {string|undefined}
|
|
202
|
+
*/
|
|
203
|
+
getPracticeSessionLocusUrl() {
|
|
204
|
+
return this._practiceSessionLLMChannel?.getLocusUrl();
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Stores the practice session datachannel token for later use when
|
|
209
|
+
* creating the practice session LLM channel.
|
|
210
|
+
* @param {string} token - The datachannel token to store
|
|
211
|
+
* @returns {void}
|
|
212
|
+
*/
|
|
213
|
+
setPracticeSessionDatachannelToken(token: string) {
|
|
214
|
+
this._pendingPracticeSessionDatachannelToken = token;
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Disconnects the practice session LLM channel and cleans up listeners.
|
|
131
219
|
* @returns {Promise<void>}
|
|
132
220
|
*/
|
|
133
221
|
async cleanupPSDataChannel() {
|
|
134
|
-
|
|
222
|
+
// Remove pending online listener if any
|
|
223
|
+
if (this._pendingOnlineListener) {
|
|
224
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
225
|
+
meeting?.llmChannel?.off('online', this._pendingOnlineListener);
|
|
226
|
+
this._pendingOnlineListener = null;
|
|
227
|
+
}
|
|
135
228
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
229
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
230
|
+
|
|
231
|
+
if (!this._practiceSessionLLMChannel) {
|
|
232
|
+
// Even without PS channel, ensure voicea is bound to main channel
|
|
233
|
+
if (meeting?.voiceaChannel && meeting?.llmChannel) {
|
|
234
|
+
await meeting.voiceaChannel.switchLLMChannel(meeting.llmChannel);
|
|
235
|
+
meeting.startTranscriptionIfNeeded();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
try {
|
|
242
|
+
await this._practiceSessionLLMChannel.disconnect({
|
|
139
243
|
code: 3050,
|
|
140
244
|
reason: 'done (permanent)',
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
245
|
+
});
|
|
246
|
+
} catch (error) {
|
|
247
|
+
LoggerProxy.logger.error(
|
|
248
|
+
'Webinar:index#cleanupPSDataChannel --> Failed to disconnect practice session LLM channel',
|
|
249
|
+
error
|
|
250
|
+
);
|
|
251
|
+
throw error;
|
|
252
|
+
} finally {
|
|
253
|
+
// Remove listeners from the channel
|
|
254
|
+
if (meeting) {
|
|
255
|
+
this._practiceSessionLLMChannel?.off('event:relay.event', meeting.processRelayEvent);
|
|
256
|
+
this._practiceSessionLLMChannel?.off(LOCUS_LLM_EVENT, meeting.processLocusLLMEvent);
|
|
257
|
+
this._practiceSessionLLMChannel?.off('online', meeting.handleLLMOnline);
|
|
258
|
+
|
|
259
|
+
// Switch annotation back to the meeting's default channel
|
|
260
|
+
if (meeting.llmChannel) {
|
|
261
|
+
meeting.annotation.registerChannel(meeting.llmChannel);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
this._practiceSessionLLMChannel = undefined;
|
|
265
|
+
|
|
266
|
+
// Switch voicea to current main channel. Switching after disconnect ensures:
|
|
267
|
+
// - If main channel was replaced during disconnect (concurrent updateLLMConnection),
|
|
268
|
+
// meeting.llmChannel will be the new channel
|
|
269
|
+
// - If the channel is still connecting, switchLLMChannel waits for it to come online
|
|
270
|
+
if (meeting?.voiceaChannel && meeting?.llmChannel) {
|
|
271
|
+
await meeting.voiceaChannel.switchLLMChannel(meeting.llmChannel);
|
|
272
|
+
meeting.startTranscriptionIfNeeded();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
149
275
|
},
|
|
150
276
|
|
|
151
277
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
278
|
+
* Ensures practice-session token exists before registering the practice LLM channel.
|
|
279
|
+
* Caller is responsible for passing a meeting that has already been resolved via
|
|
280
|
+
* getValidatedWebinarMeeting() — this method does not re-validate ownership.
|
|
281
|
+
* @param {object} meeting
|
|
282
|
+
* @returns {Promise<string|undefined>}
|
|
283
|
+
*/
|
|
284
|
+
async ensurePracticeSessionDatachannelToken(meeting) {
|
|
285
|
+
// @ts-ignore
|
|
286
|
+
const isDataChannelTokenEnabled = await this.webex.internal.llm.isDataChannelTokenEnabled();
|
|
287
|
+
|
|
288
|
+
if (!isDataChannelTokenEnabled) {
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Check for cached token on the channel or pending token
|
|
293
|
+
const cachedToken =
|
|
294
|
+
this._practiceSessionLLMChannel?.getDatachannelToken() ??
|
|
295
|
+
this._pendingPracticeSessionDatachannelToken;
|
|
296
|
+
|
|
297
|
+
if (cachedToken) {
|
|
298
|
+
return cachedToken;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
const refreshResponse = await meeting.refreshDataChannelToken();
|
|
303
|
+
const {datachannelToken} = refreshResponse?.body ?? {};
|
|
304
|
+
|
|
305
|
+
if (!datachannelToken) {
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Store token on the channel if it exists, otherwise save for later
|
|
310
|
+
if (this._practiceSessionLLMChannel) {
|
|
311
|
+
this._practiceSessionLLMChannel.setDatachannelToken(datachannelToken);
|
|
312
|
+
} else {
|
|
313
|
+
this._pendingPracticeSessionDatachannelToken = datachannelToken;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return datachannelToken;
|
|
317
|
+
} catch (error) {
|
|
318
|
+
LoggerProxy.logger.warn(
|
|
319
|
+
`Webinar:index#ensurePracticeSessionDatachannelToken --> failed to proactively refresh practice-session token: ${
|
|
320
|
+
error?.message || String(error)
|
|
321
|
+
}`
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Connects practice session LLM channel. Creates a new channel if needed.
|
|
330
|
+
* Will disconnect if the meeting has ended or is no longer in practice session mode.
|
|
331
|
+
* Waits for the main LLM channel to be connected before connecting practice session.
|
|
154
332
|
* @returns {Promise}
|
|
155
333
|
*/
|
|
156
334
|
async updatePSDataChannel() {
|
|
157
|
-
|
|
335
|
+
this._updatePSDataChannelSequence = (this._updatePSDataChannelSequence || 0) + 1;
|
|
336
|
+
const invocationSequence = this._updatePSDataChannelSequence;
|
|
337
|
+
|
|
338
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
158
339
|
const isPracticeSession = meeting?.isJoined() && this.isJoinPracticeSessionDataChannel();
|
|
159
340
|
|
|
160
341
|
if (!isPracticeSession) {
|
|
@@ -164,71 +345,134 @@ const Webinar = WebexPlugin.extend({
|
|
|
164
345
|
}
|
|
165
346
|
|
|
166
347
|
// @ts-ignore - Fix type
|
|
167
|
-
const {
|
|
168
|
-
|
|
169
|
-
info: {practiceSessionDatachannelUrl = undefined} = {},
|
|
170
|
-
self: {practiceSessionDatachannelToken = undefined} = {},
|
|
171
|
-
} = meeting?.locusInfo || {};
|
|
348
|
+
const {url = undefined, info: {practiceSessionDatachannelUrl = undefined} = {}} =
|
|
349
|
+
meeting?.locusInfo || {};
|
|
172
350
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
);
|
|
351
|
+
if (!practiceSessionDatachannelUrl) {
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
177
354
|
|
|
178
|
-
|
|
355
|
+
// If already connected to same URLs, skip reconnect
|
|
356
|
+
if (this._practiceSessionLLMChannel?.isConnected()) {
|
|
357
|
+
if (
|
|
358
|
+
url === this._practiceSessionLLMChannel.getLocusUrl() &&
|
|
359
|
+
practiceSessionDatachannelUrl === this._practiceSessionLLMChannel.getDatachannelUrl()
|
|
360
|
+
) {
|
|
361
|
+
return undefined;
|
|
362
|
+
}
|
|
363
|
+
// URLs changed, disconnect existing channel
|
|
364
|
+
await this.cleanupPSDataChannel();
|
|
365
|
+
}
|
|
179
366
|
|
|
180
|
-
|
|
367
|
+
// Ensure the default session LLM channel is connected before connecting the practice session.
|
|
368
|
+
// Subscribe before checking isConnected() to avoid a race where the 'online' event fires
|
|
369
|
+
// between the check and the subscription — the channel does not replay missed events.
|
|
370
|
+
if (!this._pendingOnlineListener && meeting?.llmChannel) {
|
|
371
|
+
const onDefaultSessionConnected = () => {
|
|
372
|
+
this._pendingOnlineListener = null;
|
|
373
|
+
meeting.llmChannel?.off('online', onDefaultSessionConnected);
|
|
374
|
+
this.updatePSDataChannel();
|
|
375
|
+
};
|
|
376
|
+
this._pendingOnlineListener = onDefaultSessionConnected;
|
|
377
|
+
meeting.llmChannel.on('online', onDefaultSessionConnected);
|
|
378
|
+
}
|
|
181
379
|
|
|
182
|
-
if (!
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
practiceSessionDatachannelToken,
|
|
186
|
-
DataChannelTokenType.PracticeSession
|
|
380
|
+
if (!meeting?.llmChannel?.isConnected()) {
|
|
381
|
+
LoggerProxy.logger.info(
|
|
382
|
+
'Webinar:index#updatePSDataChannel --> default session not yet connected, deferring practice session connect.'
|
|
187
383
|
);
|
|
384
|
+
|
|
385
|
+
return undefined;
|
|
188
386
|
}
|
|
189
387
|
|
|
190
|
-
|
|
388
|
+
// Default session is already connected — cancel the pending listener and proceed
|
|
389
|
+
if (this._pendingOnlineListener) {
|
|
390
|
+
meeting.llmChannel.off('online', this._pendingOnlineListener);
|
|
391
|
+
this._pendingOnlineListener = null;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Get token from pending or refresh if needed
|
|
395
|
+
let practiceSessionDatachannelToken =
|
|
396
|
+
this._pendingPracticeSessionDatachannelToken ??
|
|
397
|
+
this._practiceSessionLLMChannel?.getDatachannelToken();
|
|
398
|
+
|
|
399
|
+
const refreshedToken = await this.ensurePracticeSessionDatachannelToken(meeting);
|
|
400
|
+
|
|
401
|
+
const latestPracticeSessionDatachannelUrl = get(
|
|
402
|
+
meeting,
|
|
403
|
+
'locusInfo.info.practiceSessionDatachannelUrl'
|
|
404
|
+
);
|
|
405
|
+
const isStillPracticeSession = meeting?.isJoined() && this.isJoinPracticeSessionDataChannel();
|
|
406
|
+
|
|
407
|
+
// Skip stale invocations after async refresh to avoid reconnecting a session
|
|
408
|
+
// that was already updated/cleaned by a newer state transition.
|
|
409
|
+
if (
|
|
410
|
+
invocationSequence !== this._updatePSDataChannelSequence ||
|
|
411
|
+
!isStillPracticeSession ||
|
|
412
|
+
!latestPracticeSessionDatachannelUrl ||
|
|
413
|
+
latestPracticeSessionDatachannelUrl !== practiceSessionDatachannelUrl
|
|
414
|
+
) {
|
|
191
415
|
return undefined;
|
|
192
416
|
}
|
|
193
|
-
// @ts-ignore - Fix type
|
|
194
|
-
if (this.webex.internal.llm.isConnected(LLM_PRACTICE_SESSION)) {
|
|
195
|
-
if (
|
|
196
|
-
// @ts-ignore - Fix type
|
|
197
|
-
url === this.webex.internal.llm.getLocusUrl(LLM_PRACTICE_SESSION) &&
|
|
198
|
-
// @ts-ignore - Fix type
|
|
199
|
-
practiceSessionDatachannelUrl ===
|
|
200
|
-
this.webex.internal.llm.getDatachannelUrl(LLM_PRACTICE_SESSION)
|
|
201
|
-
) {
|
|
202
|
-
return undefined;
|
|
203
|
-
}
|
|
204
417
|
|
|
205
|
-
|
|
418
|
+
if (refreshedToken) {
|
|
419
|
+
practiceSessionDatachannelToken = refreshedToken;
|
|
206
420
|
}
|
|
207
421
|
|
|
422
|
+
// Create a new practice session LLM channel
|
|
208
423
|
// @ts-ignore - Fix type
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (
|
|
225
|
-
|
|
424
|
+
const psChannel = this.webex.internal.llm.createChannel();
|
|
425
|
+
this._practiceSessionLLMChannel = psChannel;
|
|
426
|
+
|
|
427
|
+
// Set up refresh handler before registration
|
|
428
|
+
psChannel.setRefreshHandler(() => meeting.refreshDataChannelToken());
|
|
429
|
+
|
|
430
|
+
// If we have a pending token, store it on the channel
|
|
431
|
+
if (this._pendingPracticeSessionDatachannelToken) {
|
|
432
|
+
psChannel.setDatachannelToken(this._pendingPracticeSessionDatachannelToken);
|
|
433
|
+
this._pendingPracticeSessionDatachannelToken = undefined;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
return psChannel
|
|
437
|
+
.registerAndConnect(url, practiceSessionDatachannelUrl, practiceSessionDatachannelToken)
|
|
438
|
+
.then(async (registerAndConnectResult) => {
|
|
439
|
+
// Check if this channel is still the current one (race condition guard)
|
|
440
|
+
if (this._practiceSessionLLMChannel !== psChannel) {
|
|
441
|
+
psChannel.disconnect({code: 3050, reason: 'replaced'}).catch(() => {});
|
|
442
|
+
|
|
443
|
+
return undefined;
|
|
226
444
|
}
|
|
445
|
+
// Register event listeners on the practice session channel
|
|
446
|
+
psChannel.off('event:relay.event', meeting.processRelayEvent);
|
|
447
|
+
psChannel.on('event:relay.event', meeting.processRelayEvent);
|
|
448
|
+
psChannel.off(LOCUS_LLM_EVENT, meeting.processLocusLLMEvent);
|
|
449
|
+
psChannel.on(LOCUS_LLM_EVENT, meeting.processLocusLLMEvent);
|
|
450
|
+
psChannel.off('online', meeting.handleLLMOnline);
|
|
451
|
+
psChannel.on('online', meeting.handleLLMOnline);
|
|
452
|
+
|
|
453
|
+
// Switch annotation to practice session channel
|
|
454
|
+
meeting.annotation.registerChannel(psChannel);
|
|
455
|
+
|
|
456
|
+
// Switch meeting's voicea channel to use the PS LLM connection.
|
|
457
|
+
// The reconciler pattern preserves caption state and handles all timing.
|
|
458
|
+
// transcription is always initialized (reset to initial shape, never null).
|
|
459
|
+
if (meeting.voiceaChannel) {
|
|
460
|
+
await meeting.voiceaChannel.switchLLMChannel(psChannel);
|
|
461
|
+
meeting.startTranscriptionIfNeeded();
|
|
462
|
+
}
|
|
463
|
+
|
|
227
464
|
LoggerProxy.logger.info(
|
|
228
|
-
|
|
465
|
+
'Webinar:index#updatePSDataChannel --> enabled to receive relay events for practice session!'
|
|
229
466
|
);
|
|
230
467
|
|
|
231
468
|
return Promise.resolve(registerAndConnectResult);
|
|
469
|
+
})
|
|
470
|
+
.catch((error) => {
|
|
471
|
+
// Clean up the channel on failure, but only if it's still the current one
|
|
472
|
+
if (this._practiceSessionLLMChannel === psChannel) {
|
|
473
|
+
this._practiceSessionLLMChannel = undefined;
|
|
474
|
+
}
|
|
475
|
+
throw error;
|
|
232
476
|
});
|
|
233
477
|
},
|
|
234
478
|
|
|
@@ -238,6 +482,8 @@ const Webinar = WebexPlugin.extend({
|
|
|
238
482
|
* @returns {Promise}
|
|
239
483
|
*/
|
|
240
484
|
setPracticeSessionState(enabled) {
|
|
485
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
486
|
+
|
|
241
487
|
return this.request({
|
|
242
488
|
method: HTTP_VERBS.PATCH,
|
|
243
489
|
uri: `${this.locusUrl}/controls`,
|
|
@@ -246,10 +492,16 @@ const Webinar = WebexPlugin.extend({
|
|
|
246
492
|
enabled,
|
|
247
493
|
},
|
|
248
494
|
},
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
495
|
+
})
|
|
496
|
+
.then((response) => {
|
|
497
|
+
MeetingUtil.updateLocusFromApiResponse(meeting, response);
|
|
498
|
+
|
|
499
|
+
return response;
|
|
500
|
+
})
|
|
501
|
+
.catch((error) => {
|
|
502
|
+
LoggerProxy.logger.error('Meeting:webinar#setPracticeSessionState failed', error);
|
|
503
|
+
throw error;
|
|
504
|
+
});
|
|
253
505
|
},
|
|
254
506
|
|
|
255
507
|
/**
|
|
@@ -366,7 +618,6 @@ const Webinar = WebexPlugin.extend({
|
|
|
366
618
|
|
|
367
619
|
/**
|
|
368
620
|
* view all webcast attendees
|
|
369
|
-
* @param {string} queryString
|
|
370
621
|
* @returns {Promise}
|
|
371
622
|
*/
|
|
372
623
|
async viewAllWebcastAttendees() {
|
|
@@ -430,7 +681,14 @@ const Webinar = WebexPlugin.extend({
|
|
|
430
681
|
* @returns {Promise}
|
|
431
682
|
*/
|
|
432
683
|
async searchLargeScaleWebinarAttendees(payload) {
|
|
433
|
-
const meeting = this.
|
|
684
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
685
|
+
if (!meeting) {
|
|
686
|
+
LoggerProxy.logger.error(
|
|
687
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> webinar meeting could not be validated'
|
|
688
|
+
);
|
|
689
|
+
throw new Error('Meeting:webinar5k#Webinar meeting is not resolvable for the current locus');
|
|
690
|
+
}
|
|
691
|
+
|
|
434
692
|
const rawParams = {
|
|
435
693
|
search_text: payload?.queryString,
|
|
436
694
|
limit: payload?.limit ?? DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
|
|
@@ -438,7 +696,9 @@ const Webinar = WebexPlugin.extend({
|
|
|
438
696
|
};
|
|
439
697
|
const attendeeSearchUrl = meeting?.locusInfo?.links?.resources?.attendeeSearch?.url;
|
|
440
698
|
if (!attendeeSearchUrl) {
|
|
441
|
-
LoggerProxy.logger.error(
|
|
699
|
+
LoggerProxy.logger.error(
|
|
700
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> attendee search url unavailable'
|
|
701
|
+
);
|
|
442
702
|
throw new Error('Meeting:webinar5k#Attendee search url is not available');
|
|
443
703
|
}
|
|
444
704
|
|
|
@@ -55,6 +55,27 @@ describe('plugin-meetings', () => {
|
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
describe('#locusUrlUpdate', () => {
|
|
59
|
+
it('should update the locusUrl property', () => {
|
|
60
|
+
const testLocusUrl = 'https://locus-a.wbx2.com/locus/api/v1/loci/test-id';
|
|
61
|
+
|
|
62
|
+
aiEnableRequest.locusUrlUpdate(testLocusUrl);
|
|
63
|
+
|
|
64
|
+
assert.equal(aiEnableRequest.locusUrl, testLocusUrl);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should handle updating locusUrl multiple times', () => {
|
|
68
|
+
const firstUrl = 'https://locus-a.wbx2.com/locus/api/v1/loci/test-id-1';
|
|
69
|
+
const secondUrl = 'https://locus-a.wbx2.com/locus/api/v1/loci/test-id-2';
|
|
70
|
+
|
|
71
|
+
aiEnableRequest.locusUrlUpdate(firstUrl);
|
|
72
|
+
assert.equal(aiEnableRequest.locusUrl, firstUrl);
|
|
73
|
+
|
|
74
|
+
aiEnableRequest.locusUrlUpdate(secondUrl);
|
|
75
|
+
assert.equal(aiEnableRequest.locusUrl, secondUrl);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
58
79
|
describe('#selfParticipantIdUpdate', () => {
|
|
59
80
|
it('should update the selfParticipantId property', () => {
|
|
60
81
|
const testSelfParticipantId = 'participant-123';
|
|
@@ -254,6 +275,71 @@ describe('plugin-meetings', () => {
|
|
|
254
275
|
sinon.assert.notCalled(triggerSpy);
|
|
255
276
|
});
|
|
256
277
|
|
|
278
|
+
it('should not trigger event when locusUrl does not match', () => {
|
|
279
|
+
const testLocusUrl = 'https://locus-a.wbx2.com/locus/api/v1/loci/test-id';
|
|
280
|
+
const differentLocusUrl = 'https://locus-a.wbx2.com/locus/api/v1/loci/different-id';
|
|
281
|
+
|
|
282
|
+
aiEnableRequest.locusUrl = testLocusUrl;
|
|
283
|
+
|
|
284
|
+
// Reset the spy after setting locusUrl to avoid counting property change events
|
|
285
|
+
triggerSpy.resetHistory();
|
|
286
|
+
|
|
287
|
+
aiEnableRequest.listenToApprovalRequests();
|
|
288
|
+
|
|
289
|
+
const event = {
|
|
290
|
+
data: {
|
|
291
|
+
locusUrl: differentLocusUrl,
|
|
292
|
+
approval: {
|
|
293
|
+
resourceType: AI_ENABLE_REQUEST.RESOURCE_TYPE,
|
|
294
|
+
receivers: [{participantId: testSelfParticipantId}],
|
|
295
|
+
initiator: {participantId: testInitiatorId},
|
|
296
|
+
actionType: AI_ENABLE_REQUEST.ACTION_TYPE.REQUESTED,
|
|
297
|
+
url: testUrl,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
webex.internal.mercury.emit(`event:${LOCUSEVENT.APPROVAL_REQUEST}`, event);
|
|
303
|
+
|
|
304
|
+
sinon.assert.notCalled(triggerSpy);
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it('should trigger event when locusUrl matches', () => {
|
|
308
|
+
const testLocusUrl = 'https://locus-a.wbx2.com/locus/api/v1/loci/test-id';
|
|
309
|
+
|
|
310
|
+
aiEnableRequest.locusUrl = testLocusUrl;
|
|
311
|
+
|
|
312
|
+
// Reset the spy after setting locusUrl to avoid counting property change events
|
|
313
|
+
triggerSpy.resetHistory();
|
|
314
|
+
|
|
315
|
+
aiEnableRequest.listenToApprovalRequests();
|
|
316
|
+
|
|
317
|
+
const event = {
|
|
318
|
+
data: {
|
|
319
|
+
locusUrl: testLocusUrl,
|
|
320
|
+
approval: {
|
|
321
|
+
resourceType: AI_ENABLE_REQUEST.RESOURCE_TYPE,
|
|
322
|
+
receivers: [{participantId: testSelfParticipantId}],
|
|
323
|
+
initiator: {participantId: testInitiatorId},
|
|
324
|
+
actionType: AI_ENABLE_REQUEST.ACTION_TYPE.REQUESTED,
|
|
325
|
+
url: testUrl,
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
webex.internal.mercury.emit(`event:${LOCUSEVENT.APPROVAL_REQUEST}`, event);
|
|
331
|
+
|
|
332
|
+
sinon.assert.calledOnce(triggerSpy);
|
|
333
|
+
sinon.assert.calledWith(triggerSpy, AI_ENABLE_REQUEST.EVENTS.APPROVAL_REQUEST_ARRIVED, {
|
|
334
|
+
actionType: AI_ENABLE_REQUEST.ACTION_TYPE.REQUESTED,
|
|
335
|
+
isApprover: true,
|
|
336
|
+
isInitiator: false,
|
|
337
|
+
initiatorId: testInitiatorId,
|
|
338
|
+
approverId: testSelfParticipantId,
|
|
339
|
+
url: testUrl,
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
|
|
257
343
|
it('should handle events with different action types', () => {
|
|
258
344
|
aiEnableRequest.listenToApprovalRequests();
|
|
259
345
|
|