@webex/plugin-meetings 3.11.0-webex-services-ready.1 → 3.12.0-auth-prejoin-fetch.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +197 -0
- package/dist/aiEnableRequest/index.js.map +1 -0
- package/dist/aiEnableRequest/utils.js +36 -0
- package/dist/aiEnableRequest/utils.js.map +1 -0
- package/dist/annotation/index.js +16 -7
- package/dist/annotation/index.js.map +1 -1
- 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 +99 -4
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +8 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +60 -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/hashTree/constants.js +16 -2
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTree.js +18 -0
- package/dist/hashTree/hashTree.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1655 -538
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +4 -2
- package/dist/hashTree/types.js.map +1 -1
- package/dist/hashTree/utils.js +52 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/constant.js +12 -0
- package/dist/interceptors/constant.js.map +1 -0
- package/dist/interceptors/dataChannelAuthToken.js +350 -0
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
- package/dist/interceptors/index.js +7 -0
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/utils.js +27 -0
- package/dist/interceptors/utils.js.map +1 -0
- package/dist/interpretation/index.js +11 -2
- 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 +9 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +914 -212
- 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/selfUtils.js +1 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +72 -3
- 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 +8 -7
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +11 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2347 -1096
- 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 +55 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +168 -5
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +100 -38
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +466 -174
- 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 +20 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +40 -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 +12 -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 +64 -68
- 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 +11 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- 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/reconnection-manager/index.js +0 -1
- package/dist/reconnection-manager/index.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/aiEnableRequest/index.d.ts +5 -0
- package/dist/types/aiEnableRequest/utils.d.ts +2 -0
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +6 -2
- package/dist/types/constants.d.ts +35 -1
- 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/hashTree/constants.d.ts +3 -0
- package/dist/types/hashTree/hashTree.d.ts +7 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
- package/dist/types/hashTree/types.d.ts +3 -0
- package/dist/types/hashTree/utils.d.ts +24 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/constant.d.ts +5 -0
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
- package/dist/types/interceptors/index.d.ts +2 -1
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interceptors/utils.d.ts +1 -0
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +126 -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 +20 -2
- package/dist/types/media/properties.d.ts +8 -3
- package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
- package/dist/types/meeting/index.d.ts +253 -16
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +17 -1
- package/dist/types/meeting/request.type.d.ts +5 -0
- package/dist/types/meeting/util.d.ts +40 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +25 -1
- package/dist/types/meetings/index.d.ts +54 -21
- package/dist/types/meetings/meetings.types.d.ts +30 -1
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +2 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +14 -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 +11 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- 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 +4 -0
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/index.js +585 -164
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +24 -23
- package/src/aiEnableRequest/README.md +84 -0
- package/src/aiEnableRequest/index.ts +186 -0
- package/src/aiEnableRequest/utils.ts +25 -0
- package/src/annotation/index.ts +32 -10
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +122 -2
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +6 -2
- package/src/constants.ts +49 -3
- 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/hashTree/constants.ts +17 -0
- package/src/hashTree/hashTree.ts +17 -0
- package/src/hashTree/hashTreeParser.ts +1482 -361
- package/src/hashTree/types.ts +4 -0
- package/src/hashTree/utils.ts +45 -0
- package/src/index.ts +14 -1
- package/src/interceptors/constant.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +246 -0
- package/src/interceptors/index.ts +2 -1
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interceptors/utils.ts +16 -0
- package/src/interpretation/index.ts +29 -11
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +14 -1
- package/src/locus-info/index.ts +976 -203
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/selfUtils.ts +1 -0
- package/src/locus-info/types.ts +33 -1
- package/src/media/MediaConnectionAwaiter.ts +62 -5
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +11 -4
- package/src/meeting/in-meeting-actions.ts +20 -0
- package/src/meeting/index.ts +1300 -180
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +53 -0
- package/src/meeting/request.type.ts +6 -0
- package/src/meeting/util.ts +207 -7
- package/src/meeting-info/meeting-info-v2.ts +83 -21
- package/src/meetings/index.ts +402 -121
- package/src/meetings/meetings.types.ts +36 -1
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +20 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +41 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +12 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +117 -76
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +13 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- 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/reactions.type.ts +4 -0
- package/src/reconnection-manager/index.ts +0 -1
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +448 -11
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
- package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
- package/test/unit/spec/annotation/index.ts +70 -8
- 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 +223 -3
- package/test/unit/spec/common/errors/webex-errors.ts +78 -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/hashTree/hashTree.ts +66 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interceptors/utils.ts +75 -0
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +200 -56
- package/test/unit/spec/locus-info/index.js +1861 -149
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +35 -26
- package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
- package/test/unit/spec/meeting/index.js +3691 -366
- 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 +82 -0
- package/test/unit/spec/meeting/utils.js +595 -27
- package/test/unit/spec/meeting-info/meetinginfov2.js +286 -10
- package/test/unit/spec/meetings/index.js +1400 -78
- 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 +35 -4
- package/test/unit/spec/member/util.js +154 -27
- 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 +503 -122
- package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -8
- 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 +837 -39
- package/test/unit/spec/webinar/utils.ts +39 -0
package/src/reachability/util.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
import {EnableReachabilityChecksConfig, ResolvedReachabilityProtocols} from './reachability.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves `enableReachabilityChecks` into explicit per-protocol flags.
|
|
6
|
+
* Defaults to all protocols enabled when not configured.
|
|
7
|
+
* UDP is always tested unless reachability is disabled entirely (`false`).
|
|
8
|
+
*
|
|
9
|
+
* @param {EnableReachabilityChecksConfig} enabled value of config.meetings.enableReachabilityChecks
|
|
10
|
+
* @returns {ResolvedReachabilityProtocols} resolved per-protocol flags
|
|
11
|
+
*/
|
|
12
|
+
export function resolveReachabilityProtocols(
|
|
13
|
+
enabled: EnableReachabilityChecksConfig = true
|
|
14
|
+
): ResolvedReachabilityProtocols {
|
|
15
|
+
if (typeof enabled === 'object') {
|
|
16
|
+
return {
|
|
17
|
+
udp: true,
|
|
18
|
+
tcp: enabled.tcp ?? true,
|
|
19
|
+
tls: enabled.tls ?? true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {udp: enabled, tcp: enabled, tls: enabled};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether any reachability protocol is enabled.
|
|
28
|
+
*
|
|
29
|
+
* @param {EnableReachabilityChecksConfig} config value of config.meetings.enableReachabilityChecks
|
|
30
|
+
* @returns {boolean} true if any protocol is enabled
|
|
31
|
+
*/
|
|
32
|
+
export function isReachabilityEnabled(config: EnableReachabilityChecksConfig = true): boolean {
|
|
33
|
+
const {udp, tcp, tls} = resolveReachabilityProtocols(config);
|
|
34
|
+
|
|
35
|
+
return udp || tcp || tls;
|
|
36
|
+
}
|
|
37
|
+
|
|
2
38
|
/**
|
|
3
39
|
* Converts a stun url to a turn url
|
|
4
40
|
*
|
|
@@ -40,6 +40,7 @@ export enum SkinToneType {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export type Sender = {
|
|
43
|
+
displayName: string;
|
|
43
44
|
participantId: string;
|
|
44
45
|
};
|
|
45
46
|
|
|
@@ -59,4 +60,7 @@ type RelayEventData = {
|
|
|
59
60
|
|
|
60
61
|
export type RelayEvent = {
|
|
61
62
|
data: RelayEventData;
|
|
63
|
+
headers?: {
|
|
64
|
+
route?: string;
|
|
65
|
+
};
|
|
62
66
|
};
|
|
@@ -609,7 +609,6 @@ export default class ReconnectionManager {
|
|
|
609
609
|
if (this.meeting.isMultistream) {
|
|
610
610
|
Object.values(this.meeting.mediaRequestManagers).forEach(
|
|
611
611
|
(mediaRequestManager: MediaRequestManager) => {
|
|
612
|
-
mediaRequestManager.clearPreviousRequests();
|
|
613
612
|
mediaRequestManager.commit();
|
|
614
613
|
}
|
|
615
614
|
);
|
|
@@ -261,8 +261,7 @@ export default class RecordingController {
|
|
|
261
261
|
|
|
262
262
|
LoggerProxy.logger.log(`RecordingController:index#recordingControls --> ${record}`);
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
return this.request.request({
|
|
264
|
+
return this.request.locusDeltaRequest({
|
|
266
265
|
uri: `${this.locusUrl}/${CONTROLS}`,
|
|
267
266
|
body: {
|
|
268
267
|
record,
|
|
@@ -229,9 +229,17 @@ export default class TurnDiscovery {
|
|
|
229
229
|
* @returns {TurnDiscoveryResult}
|
|
230
230
|
*/
|
|
231
231
|
private handleTurnDiscoveryFailure(meeting: Meeting, error: Error): TurnDiscoveryResult {
|
|
232
|
+
// if we got a 409/403 from Locus, it means we've been dropped from the meeting,
|
|
233
|
+
// so there's no point continuing with the media connection attempt
|
|
234
|
+
if ((error as any).statusCode === 409 || (error as any).statusCode === 403) {
|
|
235
|
+
this.defer = undefined;
|
|
236
|
+
throw error;
|
|
237
|
+
}
|
|
238
|
+
|
|
232
239
|
// we catch any errors and resolve with no turn information so that the normal call join flow can continue without TURN
|
|
233
240
|
LoggerProxy.logger.info(
|
|
234
|
-
`Roap:turnDiscovery#doTurnDiscovery --> TURN discovery failed, continuing without TURN
|
|
241
|
+
`Roap:turnDiscovery#doTurnDiscovery --> TURN discovery failed, continuing without TURN:`,
|
|
242
|
+
error
|
|
235
243
|
);
|
|
236
244
|
|
|
237
245
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.TURN_DISCOVERY_FAILURE, {
|
package/src/webinar/index.ts
CHANGED
|
@@ -4,10 +4,35 @@
|
|
|
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 {
|
|
8
|
+
_ID_,
|
|
9
|
+
HEADERS,
|
|
10
|
+
HTTP_VERBS,
|
|
11
|
+
MEETINGS,
|
|
12
|
+
SELF_ROLES,
|
|
13
|
+
SHARE_STATUS,
|
|
14
|
+
DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
|
|
15
|
+
LLM_PRACTICE_SESSION,
|
|
16
|
+
LOCUS_LLM_EVENT,
|
|
17
|
+
} from '../constants';
|
|
8
18
|
|
|
9
19
|
import WebinarCollection from './collection';
|
|
10
20
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
21
|
+
import MeetingUtil from '../meeting/util';
|
|
22
|
+
import {sanitizeParams} from './utils';
|
|
23
|
+
|
|
24
|
+
const PS_LLM_EVENTS = [
|
|
25
|
+
{
|
|
26
|
+
event: `event:relay.event:${LLM_PRACTICE_SESSION}`,
|
|
27
|
+
listenerKey: 'relay',
|
|
28
|
+
handlerKey: 'processRelayEvent',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
event: `${LOCUS_LLM_EVENT}:${LLM_PRACTICE_SESSION}`,
|
|
32
|
+
listenerKey: 'locusLLM',
|
|
33
|
+
handlerKey: 'processLocusLLMEvent',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
11
36
|
|
|
12
37
|
/**
|
|
13
38
|
* @class Webinar
|
|
@@ -28,6 +53,14 @@ const Webinar = WebexPlugin.extend({
|
|
|
28
53
|
meetingId: 'string',
|
|
29
54
|
},
|
|
30
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Calls this to clean up listeners
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
cleanUp() {
|
|
61
|
+
this.cleanupPSDataChannel();
|
|
62
|
+
},
|
|
63
|
+
|
|
31
64
|
/**
|
|
32
65
|
* Update the current locus url of the webinar
|
|
33
66
|
* @param {string} locusUrl
|
|
@@ -79,13 +112,49 @@ const Webinar = WebexPlugin.extend({
|
|
|
79
112
|
return {isPromoted, isDemoted};
|
|
80
113
|
},
|
|
81
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Resolves the meeting associated with this webinar instance, guarded against the
|
|
117
|
+
* meetingId pointer drifting onto an unrelated transient meeting (e.g. an inbound
|
|
118
|
+
* 1:1 call) that may exist in the meeting collection. Returns the meeting only when
|
|
119
|
+
* its locusUrl matches this webinar's tracked locusUrl. Returns undefined (with a
|
|
120
|
+
* warning) when the meeting cannot be resolved or when the webinar's locusUrl has
|
|
121
|
+
* not been initialized yet — callers must treat this as "no owned meeting" rather
|
|
122
|
+
* than fall through to an unvalidated lookup.
|
|
123
|
+
* @returns {object|undefined}
|
|
124
|
+
*/
|
|
125
|
+
getValidatedWebinarMeeting() {
|
|
126
|
+
const meeting = this.webex.meetings.getMeetingByType(_ID_, this.meetingId);
|
|
127
|
+
|
|
128
|
+
if (!meeting) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!this.locusUrl) {
|
|
133
|
+
LoggerProxy.logger.warn(
|
|
134
|
+
`Webinar:index#getValidatedWebinarMeeting --> skipping; webinar locusUrl is not yet initialized for meetingId ${this.meetingId}`
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (meeting.locusUrl !== this.locusUrl) {
|
|
141
|
+
LoggerProxy.logger.warn(
|
|
142
|
+
`Webinar:index#getValidatedWebinarMeeting --> skipping; meeting ${this.meetingId} locusUrl ${meeting.locusUrl} does not match webinar locusUrl ${this.locusUrl}`
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return meeting;
|
|
149
|
+
},
|
|
150
|
+
|
|
82
151
|
/**
|
|
83
152
|
* should join practice session data channel or not
|
|
84
153
|
* @param {Object} {isPromoted: boolean, isDemoted: boolean}} Role transition states
|
|
85
154
|
* @returns {void}
|
|
86
155
|
*/
|
|
87
156
|
updateStatusByRole({isPromoted, isDemoted}) {
|
|
88
|
-
const meeting = this.
|
|
157
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
89
158
|
|
|
90
159
|
if (
|
|
91
160
|
(isDemoted && meeting?.shareStatus === SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE) ||
|
|
@@ -96,10 +165,7 @@ const Webinar = WebexPlugin.extend({
|
|
|
96
165
|
meeting?.locusInfo?.updateMediaShares(meeting?.locusInfo?.mediaShares, true);
|
|
97
166
|
}
|
|
98
167
|
|
|
99
|
-
|
|
100
|
-
// may need change data channel in practice session
|
|
101
|
-
meeting?.updateLLMConnection();
|
|
102
|
-
}
|
|
168
|
+
this.updatePSDataChannel();
|
|
103
169
|
},
|
|
104
170
|
|
|
105
171
|
/**
|
|
@@ -110,12 +176,334 @@ const Webinar = WebexPlugin.extend({
|
|
|
110
176
|
return this.selfIsPanelist && this.practiceSessionEnabled;
|
|
111
177
|
},
|
|
112
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Disconnects the practice session data channel and removes its relay listener.
|
|
181
|
+
* The listener reference removed here is the exact callback captured at subscribe
|
|
182
|
+
* time (see updatePSDataChannel) so that cleanup is correct even if the underlying
|
|
183
|
+
* meeting can no longer be resolved (e.g. locusUrl mismatch).
|
|
184
|
+
* @returns {Promise<void>}
|
|
185
|
+
*/
|
|
186
|
+
async cleanupPSDataChannel() {
|
|
187
|
+
const {isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
188
|
+
this.meetingId,
|
|
189
|
+
LLM_PRACTICE_SESSION
|
|
190
|
+
);
|
|
191
|
+
this.llmListeners = this.llmListeners || {};
|
|
192
|
+
|
|
193
|
+
if (this._pendingOnlineListener) {
|
|
194
|
+
// @ts-ignore - Fix type
|
|
195
|
+
this.webex.internal.llm.off('online', this._pendingOnlineListener);
|
|
196
|
+
this._pendingOnlineListener = null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
try {
|
|
200
|
+
// @ts-ignore - Fix type
|
|
201
|
+
const disconnected = await this.webex.internal.llm.disconnectLLM(
|
|
202
|
+
{
|
|
203
|
+
code: 3050,
|
|
204
|
+
reason: 'done (permanent)',
|
|
205
|
+
},
|
|
206
|
+
LLM_PRACTICE_SESSION,
|
|
207
|
+
this.meetingId
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
if (!disconnected) {
|
|
211
|
+
LoggerProxy.logger.info(
|
|
212
|
+
`Webinar:index#cleanupPSDataChannel --> skipping disconnect; practice-session LLM is not owned by meeting ${this.meetingId}`
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
} catch (error) {
|
|
216
|
+
// disconnectLLM clears ownership only on success; release a stale owner
|
|
217
|
+
// tag here so other meeting instances can reclaim practice-session LLM.
|
|
218
|
+
if (isOwner) {
|
|
219
|
+
// @ts-ignore - Fix type
|
|
220
|
+
this.webex.internal.llm.setOwnerMeetingId?.(undefined, LLM_PRACTICE_SESSION);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
throw error;
|
|
224
|
+
} finally {
|
|
225
|
+
if (this._practiceSessionRelayListener) {
|
|
226
|
+
// @ts-ignore - Fix type
|
|
227
|
+
this.webex.internal.llm.off(
|
|
228
|
+
`event:relay.event:${LLM_PRACTICE_SESSION}`,
|
|
229
|
+
this._practiceSessionRelayListener
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
this._practiceSessionRelayListener = null;
|
|
233
|
+
|
|
234
|
+
for (const {event, listenerKey} of PS_LLM_EVENTS) {
|
|
235
|
+
if (this.llmListeners[listenerKey]) {
|
|
236
|
+
// @ts-ignore - Fix type
|
|
237
|
+
this.webex.internal.llm.off(event, this.llmListeners[listenerKey]);
|
|
238
|
+
this.llmListeners[listenerKey] = null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Ensures practice-session token exists before registering the practice LLM channel.
|
|
246
|
+
* Caller is responsible for passing a meeting that has already been resolved via
|
|
247
|
+
* getValidatedWebinarMeeting() — this method does not re-validate ownership.
|
|
248
|
+
* @param {object} meeting
|
|
249
|
+
* @returns {Promise<string|undefined>}
|
|
250
|
+
*/
|
|
251
|
+
async ensurePracticeSessionDatachannelToken(meeting) {
|
|
252
|
+
// @ts-ignore
|
|
253
|
+
const isDataChannelTokenEnabled = await this.webex.internal.llm.isDataChannelTokenEnabled();
|
|
254
|
+
|
|
255
|
+
if (!isDataChannelTokenEnabled) {
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// @ts-ignore
|
|
260
|
+
const cachedToken = this.webex.internal.llm.getDatachannelToken(
|
|
261
|
+
LLM_PRACTICE_SESSION,
|
|
262
|
+
this.meetingId
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
if (cachedToken) {
|
|
266
|
+
return cachedToken;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
try {
|
|
270
|
+
const refreshResponse = await meeting.refreshDataChannelToken();
|
|
271
|
+
const {datachannelToken, dataChannelTokenType} = refreshResponse?.body ?? {};
|
|
272
|
+
|
|
273
|
+
if (!datachannelToken) {
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// @ts-ignore
|
|
278
|
+
this.webex.internal.llm.setDatachannelToken(
|
|
279
|
+
datachannelToken,
|
|
280
|
+
dataChannelTokenType || LLM_PRACTICE_SESSION,
|
|
281
|
+
this.meetingId
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
return datachannelToken;
|
|
285
|
+
} catch (error) {
|
|
286
|
+
LoggerProxy.logger.warn(
|
|
287
|
+
`Webinar:index#ensurePracticeSessionDatachannelToken --> failed to proactively refresh practice-session token: ${
|
|
288
|
+
error?.message || String(error)
|
|
289
|
+
}`
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
return undefined;
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Connects to low latency mercury and reconnects if the address has changed
|
|
298
|
+
* It will also disconnect if called when the meeting has ended
|
|
299
|
+
* @returns {Promise}
|
|
300
|
+
*/
|
|
301
|
+
async updatePSDataChannel() {
|
|
302
|
+
this.llmListeners = this.llmListeners || {};
|
|
303
|
+
|
|
304
|
+
this._updatePSDataChannelSequence = (this._updatePSDataChannelSequence || 0) + 1;
|
|
305
|
+
const invocationSequence = this._updatePSDataChannelSequence;
|
|
306
|
+
|
|
307
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
308
|
+
const isPracticeSession = meeting?.isJoined() && this.isJoinPracticeSessionDataChannel();
|
|
309
|
+
const {currentOwner, isOwner} = this.webex.internal.llm.resolveSessionOwnership(
|
|
310
|
+
this.meetingId,
|
|
311
|
+
LLM_PRACTICE_SESSION
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
if (!isPracticeSession) {
|
|
315
|
+
await this.cleanupPSDataChannel();
|
|
316
|
+
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (!isOwner) {
|
|
321
|
+
LoggerProxy.logger.info(
|
|
322
|
+
`Webinar:index#updatePSDataChannel --> skipping; practice-session LLM owned by meeting ${currentOwner}, not ${this.meetingId}`
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
return undefined;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// @ts-ignore - Fix type
|
|
329
|
+
const {url = undefined, info: {practiceSessionDatachannelUrl = undefined} = {}} =
|
|
330
|
+
meeting?.locusInfo || {};
|
|
331
|
+
|
|
332
|
+
// @ts-ignore
|
|
333
|
+
let practiceSessionDatachannelToken = this.webex.internal.llm.getDatachannelToken(
|
|
334
|
+
LLM_PRACTICE_SESSION,
|
|
335
|
+
this.meetingId
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
const keepTranscriptionSubscribed = this.webex.internal.voicea.getKeepTranscriptionSubscribed();
|
|
339
|
+
|
|
340
|
+
if (!practiceSessionDatachannelUrl) {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
// @ts-ignore - Fix type
|
|
344
|
+
if (this.webex.internal.llm.isConnected(LLM_PRACTICE_SESSION)) {
|
|
345
|
+
if (
|
|
346
|
+
// @ts-ignore - Fix type
|
|
347
|
+
url === this.webex.internal.llm.getLocusUrl(LLM_PRACTICE_SESSION) &&
|
|
348
|
+
// @ts-ignore - Fix type
|
|
349
|
+
practiceSessionDatachannelUrl ===
|
|
350
|
+
this.webex.internal.llm.getDatachannelUrl(LLM_PRACTICE_SESSION)
|
|
351
|
+
) {
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
await this.cleanupPSDataChannel();
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Ensure the default session data channel is connected before connecting the practice session.
|
|
359
|
+
// Subscribe before checking isConnected() to avoid a race where the 'online' event fires
|
|
360
|
+
// between the check and the subscription — Mercury does not replay missed events.
|
|
361
|
+
if (!this._pendingOnlineListener) {
|
|
362
|
+
const onDefaultSessionConnected = () => {
|
|
363
|
+
this._pendingOnlineListener = null;
|
|
364
|
+
// @ts-ignore - Fix type
|
|
365
|
+
this.webex.internal.llm.off('online', onDefaultSessionConnected);
|
|
366
|
+
this.updatePSDataChannel();
|
|
367
|
+
};
|
|
368
|
+
this._pendingOnlineListener = onDefaultSessionConnected;
|
|
369
|
+
// @ts-ignore - Fix type
|
|
370
|
+
this.webex.internal.llm.on('online', onDefaultSessionConnected);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// @ts-ignore - Fix type
|
|
374
|
+
if (!this.webex.internal.llm.isConnected()) {
|
|
375
|
+
LoggerProxy.logger.info(
|
|
376
|
+
'Webinar:index#updatePSDataChannel --> default session not yet connected, deferring practice session connect.'
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
return undefined;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Default session is already connected — cancel the pending listener and proceed
|
|
383
|
+
if (this._pendingOnlineListener) {
|
|
384
|
+
// @ts-ignore - Fix type
|
|
385
|
+
this.webex.internal.llm.off('online', this._pendingOnlineListener);
|
|
386
|
+
this._pendingOnlineListener = null;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const refreshedPracticeSessionToken = await this.ensurePracticeSessionDatachannelToken(meeting);
|
|
390
|
+
|
|
391
|
+
const latestPracticeSessionDatachannelUrl = get(
|
|
392
|
+
meeting,
|
|
393
|
+
'locusInfo.info.practiceSessionDatachannelUrl'
|
|
394
|
+
);
|
|
395
|
+
const isStillPracticeSession = meeting?.isJoined() && this.isJoinPracticeSessionDataChannel();
|
|
396
|
+
|
|
397
|
+
// Skip stale invocations after async refresh to avoid reconnecting a session
|
|
398
|
+
// that was already updated/cleaned by a newer state transition.
|
|
399
|
+
if (
|
|
400
|
+
invocationSequence !== this._updatePSDataChannelSequence ||
|
|
401
|
+
!isStillPracticeSession ||
|
|
402
|
+
!latestPracticeSessionDatachannelUrl ||
|
|
403
|
+
latestPracticeSessionDatachannelUrl !== practiceSessionDatachannelUrl
|
|
404
|
+
) {
|
|
405
|
+
return undefined;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if (refreshedPracticeSessionToken) {
|
|
409
|
+
practiceSessionDatachannelToken = refreshedPracticeSessionToken;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const {currentOwner: currentOwnerBeforeConnect, isOwner: isOwnerBeforeConnect} =
|
|
413
|
+
this.webex.internal.llm.resolveSessionOwnership(this.meetingId, LLM_PRACTICE_SESSION);
|
|
414
|
+
|
|
415
|
+
if (!isOwnerBeforeConnect) {
|
|
416
|
+
LoggerProxy.logger.info(
|
|
417
|
+
`Webinar:index#updatePSDataChannel --> skipping pre-connect owner write; practice-session LLM owned by meeting ${currentOwnerBeforeConnect}, not ${this.meetingId}`
|
|
418
|
+
);
|
|
419
|
+
|
|
420
|
+
return undefined;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Ensure refresh for practice datachannel requests is routed to this
|
|
424
|
+
// meeting only when we are actually about to connect the practice session.
|
|
425
|
+
// This avoids claiming ownership in flows that return early (e.g. missing
|
|
426
|
+
// practiceSessionDatachannelUrl or waiting for default session online).
|
|
427
|
+
// @ts-ignore - Fix type
|
|
428
|
+
this.webex.internal.llm.setRefreshHandler(
|
|
429
|
+
() => meeting.refreshDataChannelToken(),
|
|
430
|
+
LLM_PRACTICE_SESSION,
|
|
431
|
+
this.meetingId
|
|
432
|
+
);
|
|
433
|
+
// @ts-ignore - Fix type
|
|
434
|
+
this.webex.internal.llm.setOwnerMeetingId?.(this.meetingId, LLM_PRACTICE_SESSION);
|
|
435
|
+
|
|
436
|
+
// @ts-ignore - Fix type
|
|
437
|
+
return this.webex.internal.llm
|
|
438
|
+
.registerAndConnect(
|
|
439
|
+
url,
|
|
440
|
+
practiceSessionDatachannelUrl,
|
|
441
|
+
practiceSessionDatachannelToken,
|
|
442
|
+
LLM_PRACTICE_SESSION
|
|
443
|
+
)
|
|
444
|
+
.then((registerAndConnectResult) => {
|
|
445
|
+
const {currentOwner: currentOwnerAfterConnect, isOwner: isOwnerAfterConnect} =
|
|
446
|
+
this.webex.internal.llm.resolveSessionOwnership(this.meetingId, LLM_PRACTICE_SESSION);
|
|
447
|
+
|
|
448
|
+
if (this.meetingId && isOwnerAfterConnect) {
|
|
449
|
+
// @ts-ignore - Fix type
|
|
450
|
+
this.webex.internal.llm.setOwnerMeetingId?.(this.meetingId, LLM_PRACTICE_SESSION);
|
|
451
|
+
} else {
|
|
452
|
+
LoggerProxy.logger.info(
|
|
453
|
+
`Webinar:index#updatePSDataChannel --> skipping post-connect owner write; practice-session LLM owned by meeting ${currentOwnerAfterConnect}, not ${this.meetingId}`
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Track the exact listener references so cleanupPSDataChannel can
|
|
458
|
+
// unsubscribe deterministically, even if the meeting can no longer
|
|
459
|
+
// be resolved at cleanup time.
|
|
460
|
+
for (const {event, listenerKey, handlerKey} of PS_LLM_EVENTS) {
|
|
461
|
+
if (this.llmListeners[listenerKey]) {
|
|
462
|
+
// @ts-ignore - Fix type
|
|
463
|
+
this.webex.internal.llm.off(event, this.llmListeners[listenerKey]);
|
|
464
|
+
}
|
|
465
|
+
this.llmListeners[listenerKey] = meeting?.[handlerKey];
|
|
466
|
+
// @ts-ignore - Fix type
|
|
467
|
+
this.webex.internal.llm.on(event, this.llmListeners[listenerKey]);
|
|
468
|
+
}
|
|
469
|
+
// @ts-ignore - Fix type
|
|
470
|
+
this.webex.internal.voicea?.announce?.();
|
|
471
|
+
if (keepTranscriptionSubscribed) {
|
|
472
|
+
this.webex.internal.voicea.updateSubchannelSubscriptions({subscribe: ['transcription']});
|
|
473
|
+
}
|
|
474
|
+
LoggerProxy.logger.info(
|
|
475
|
+
`Webinar:index#updatePSDataChannel --> enabled to receive relay events for default session for ${LLM_PRACTICE_SESSION}!`
|
|
476
|
+
);
|
|
477
|
+
|
|
478
|
+
return Promise.resolve(registerAndConnectResult);
|
|
479
|
+
})
|
|
480
|
+
.catch((error) => {
|
|
481
|
+
const {
|
|
482
|
+
currentOwner: currentOwnerAfterRegisterFailure,
|
|
483
|
+
isOwner: isOwnerAfterRegisterFailure,
|
|
484
|
+
} = this.webex.internal.llm.resolveSessionOwnership(this.meetingId, LLM_PRACTICE_SESSION);
|
|
485
|
+
|
|
486
|
+
if (isOwnerAfterRegisterFailure) {
|
|
487
|
+
// @ts-ignore - Fix type
|
|
488
|
+
this.webex.internal.llm.setOwnerMeetingId?.(undefined, LLM_PRACTICE_SESSION);
|
|
489
|
+
} else {
|
|
490
|
+
LoggerProxy.logger.info(
|
|
491
|
+
`Webinar:index#updatePSDataChannel --> skipping failure owner release; practice-session LLM owned by meeting ${currentOwnerAfterRegisterFailure}, not ${this.meetingId}`
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
throw error;
|
|
496
|
+
});
|
|
497
|
+
},
|
|
498
|
+
|
|
113
499
|
/**
|
|
114
500
|
* start or stop practice session for webinar
|
|
115
501
|
* @param {boolean} enabled
|
|
116
502
|
* @returns {Promise}
|
|
117
503
|
*/
|
|
118
504
|
setPracticeSessionState(enabled) {
|
|
505
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
506
|
+
|
|
119
507
|
return this.request({
|
|
120
508
|
method: HTTP_VERBS.PATCH,
|
|
121
509
|
uri: `${this.locusUrl}/controls`,
|
|
@@ -124,10 +512,16 @@ const Webinar = WebexPlugin.extend({
|
|
|
124
512
|
enabled,
|
|
125
513
|
},
|
|
126
514
|
},
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
515
|
+
})
|
|
516
|
+
.then((response) => {
|
|
517
|
+
MeetingUtil.updateLocusFromApiResponse(meeting, response);
|
|
518
|
+
|
|
519
|
+
return response;
|
|
520
|
+
})
|
|
521
|
+
.catch((error) => {
|
|
522
|
+
LoggerProxy.logger.error('Meeting:webinar#setPracticeSessionState failed', error);
|
|
523
|
+
throw error;
|
|
524
|
+
});
|
|
131
525
|
},
|
|
132
526
|
|
|
133
527
|
/**
|
|
@@ -137,6 +531,7 @@ const Webinar = WebexPlugin.extend({
|
|
|
137
531
|
*/
|
|
138
532
|
updatePracticeSessionStatus(payload) {
|
|
139
533
|
this.set('practiceSessionEnabled', !!payload?.enabled);
|
|
534
|
+
this.updatePSDataChannel().then(() => {});
|
|
140
535
|
},
|
|
141
536
|
|
|
142
537
|
/**
|
|
@@ -243,7 +638,6 @@ const Webinar = WebexPlugin.extend({
|
|
|
243
638
|
|
|
244
639
|
/**
|
|
245
640
|
* view all webcast attendees
|
|
246
|
-
* @param {string} queryString
|
|
247
641
|
* @returns {Promise}
|
|
248
642
|
*/
|
|
249
643
|
async viewAllWebcastAttendees() {
|
|
@@ -297,6 +691,49 @@ const Webinar = WebexPlugin.extend({
|
|
|
297
691
|
throw error;
|
|
298
692
|
});
|
|
299
693
|
},
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* search large scale webinar attendees
|
|
697
|
+
* @param {object} payload
|
|
698
|
+
* @param {string} payload.queryString
|
|
699
|
+
* @param {number} payload.limit
|
|
700
|
+
* @param {string} payload.next
|
|
701
|
+
* @returns {Promise}
|
|
702
|
+
*/
|
|
703
|
+
async searchLargeScaleWebinarAttendees(payload) {
|
|
704
|
+
const meeting = this.getValidatedWebinarMeeting();
|
|
705
|
+
if (!meeting) {
|
|
706
|
+
LoggerProxy.logger.error(
|
|
707
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> webinar meeting could not be validated'
|
|
708
|
+
);
|
|
709
|
+
throw new Error('Meeting:webinar5k#Webinar meeting is not resolvable for the current locus');
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const rawParams = {
|
|
713
|
+
search_text: payload?.queryString,
|
|
714
|
+
limit: payload?.limit ?? DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
|
|
715
|
+
next: payload?.next,
|
|
716
|
+
};
|
|
717
|
+
const attendeeSearchUrl = meeting?.locusInfo?.links?.resources?.attendeeSearch?.url;
|
|
718
|
+
if (!attendeeSearchUrl) {
|
|
719
|
+
LoggerProxy.logger.error(
|
|
720
|
+
'Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> attendee search url unavailable'
|
|
721
|
+
);
|
|
722
|
+
throw new Error('Meeting:webinar5k#Attendee search url is not available');
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return this.request({
|
|
726
|
+
method: HTTP_VERBS.GET,
|
|
727
|
+
uri: `${attendeeSearchUrl}?${new URLSearchParams(sanitizeParams(rawParams)).toString()}`,
|
|
728
|
+
headers: {
|
|
729
|
+
authorization: await this.webex.credentials.getUserToken(),
|
|
730
|
+
trackingId: `${config.trackingIdPrefix}_${uuid.v4().toString()}`,
|
|
731
|
+
},
|
|
732
|
+
}).catch((error) => {
|
|
733
|
+
LoggerProxy.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed', error);
|
|
734
|
+
throw error;
|
|
735
|
+
});
|
|
736
|
+
},
|
|
300
737
|
});
|
|
301
738
|
|
|
302
739
|
export default Webinar;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove null/undefined/empty string values from an object
|
|
3
|
+
* @param {object} params
|
|
4
|
+
* @returns {object}
|
|
5
|
+
*/
|
|
6
|
+
export const sanitizeParams = (params: Record<string, any>) => {
|
|
7
|
+
const result: Record<string, any> = {};
|
|
8
|
+
Object.keys(params).forEach((key) => {
|
|
9
|
+
const value = params[key];
|
|
10
|
+
if (value !== null && value !== undefined && value !== '') {
|
|
11
|
+
result[key] = value;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return result;
|
|
16
|
+
};
|