@webex/plugin-meetings 3.12.0-next.171 → 3.12.0-next.172
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/dist/aiEnableRequest/index.js +1 -1
- package/dist/annotation/index.js +53 -17
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +35 -9
- package/dist/breakouts/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +41 -59
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/index.js +327 -292
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +5 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +4 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/meeting/index.d.ts +46 -12
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/webinar/index.js +298 -255
- package/dist/webinar/index.js.map +1 -1
- package/package.json +9 -9
- package/src/annotation/index.ts +55 -25
- package/src/breakouts/index.ts +33 -11
- package/src/interceptors/dataChannelAuthToken.ts +48 -77
- package/src/meeting/index.ts +296 -289
- package/src/meeting/util.ts +2 -2
- package/src/meetings/index.ts +2 -1
- package/src/webinar/index.ts +168 -188
- package/test/unit/spec/annotation/index.ts +214 -182
- package/test/unit/spec/breakouts/index.ts +126 -25
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
- package/test/unit/spec/meeting/index.js +939 -705
- package/test/unit/spec/meeting/utils.js +16 -2
- package/test/unit/spec/meetings/index.js +5 -0
- package/test/unit/spec/webinar/index.ts +886 -718
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import {Interceptor} from '@webex/http-core';
|
|
6
|
+
|
|
7
|
+
// @ts-ignore - internal-plugin-llm types
|
|
6
8
|
import LLMChannel from '@webex/internal-plugin-llm';
|
|
7
9
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
10
|
+
import Meeting from '../meeting';
|
|
8
11
|
import {DATA_CHANNEL_AUTH_HEADER, MAX_RETRY, RETRY_INTERVAL, RETRY_KEY} from './constant';
|
|
9
12
|
import {isJwtTokenExpired} from './utils';
|
|
10
|
-
import {LLM_DEFAULT_SESSION, LLM_PRACTICE_SESSION, LOCUS_URL} from '../constants';
|
|
11
13
|
|
|
12
14
|
const retryCountMap = new Map();
|
|
13
15
|
interface HttpLikeError extends Error {
|
|
@@ -40,93 +42,62 @@ export default class DataChannelAuthTokenInterceptor extends Interceptor {
|
|
|
40
42
|
return this.internal.llm.isDataChannelTokenEnabled();
|
|
41
43
|
},
|
|
42
44
|
|
|
43
|
-
// Route refresh by request URL
|
|
44
|
-
// 1)
|
|
45
|
-
// 2) If
|
|
46
|
-
// If
|
|
45
|
+
// Route refresh by request URL:
|
|
46
|
+
// 1) Find the LLM channel that matches the request URL
|
|
47
|
+
// 2) If found, use its refresh handler
|
|
48
|
+
// 3) If no channel matches, fall back to finding the meeting by locusUrl
|
|
47
49
|
refreshDataChannelToken: async (requestUrl?: string) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (typeof requestUrl === 'string') {
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
sessionId = this.internal.llm.getSessionIdByDatachannelUrl?.(requestUrl);
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
const channel = this.internal.llm.getChannelByDatachannelUrl(requestUrl);
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
if (channel) {
|
|
54
|
+
// Channel found - use its refresh handler
|
|
55
|
+
const result = await channel.refreshDataChannelToken();
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
meeting = this.meetings?.getMeetingByType?.(LOCUS_URL, locusUrl);
|
|
62
|
-
}
|
|
57
|
+
if (!result?.body) {
|
|
58
|
+
throw new Error('DataChannel token refresh returned no payload');
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// where connections are not yet populated (e.g. if setRefreshHandler
|
|
70
|
-
// is called on a session that has no connection entry at all).
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
const allMeetings = this.meetings?.getAllMeetings?.() || {};
|
|
73
|
-
|
|
74
|
-
meeting = Object.values(allMeetings).find((activeMeeting: any) => {
|
|
75
|
-
const info = activeMeeting?.locusInfo?.info || {};
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
(info.practiceSessionDatachannelUrl &&
|
|
79
|
-
LLMChannel.matchesDatachannelRequestUrl(
|
|
80
|
-
requestUrl,
|
|
81
|
-
info.practiceSessionDatachannelUrl
|
|
82
|
-
)) ||
|
|
83
|
-
(info.datachannelUrl &&
|
|
84
|
-
LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl))
|
|
85
|
-
);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (!sessionId) {
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
const info = meeting?.locusInfo?.info || {};
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
info.practiceSessionDatachannelUrl &&
|
|
94
|
-
LLMChannel.matchesDatachannelRequestUrl(
|
|
95
|
-
requestUrl,
|
|
96
|
-
info.practiceSessionDatachannelUrl
|
|
97
|
-
)
|
|
98
|
-
) {
|
|
99
|
-
sessionId = LLM_PRACTICE_SESSION;
|
|
100
|
-
} else if (
|
|
101
|
-
info.datachannelUrl &&
|
|
102
|
-
LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl)
|
|
103
|
-
) {
|
|
104
|
-
sessionId = LLM_DEFAULT_SESSION;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
61
|
+
const {datachannelToken} = result.body;
|
|
62
|
+
channel.setDatachannelToken(datachannelToken);
|
|
63
|
+
|
|
64
|
+
return datachannelToken;
|
|
108
65
|
}
|
|
109
66
|
|
|
110
|
-
|
|
67
|
+
// No channel found - fallback to finding meeting by matching datachannel URLs
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
const allMeetings: Record<string, Meeting> = this.meetings?.getAllMeetings() || {};
|
|
70
|
+
|
|
71
|
+
const meeting = Object.values(allMeetings).find((activeMeeting) => {
|
|
72
|
+
const info = activeMeeting?.locusInfo?.info || {};
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
(info.practiceSessionDatachannelUrl &&
|
|
76
|
+
LLMChannel.matchesDatachannelRequestUrl(
|
|
77
|
+
requestUrl,
|
|
78
|
+
info.practiceSessionDatachannelUrl
|
|
79
|
+
)) ||
|
|
80
|
+
(info.datachannelUrl &&
|
|
81
|
+
LLMChannel.matchesDatachannelRequestUrl(requestUrl, info.datachannelUrl))
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
111
85
|
if (meeting) {
|
|
112
|
-
result = await meeting.refreshDataChannelToken();
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
86
|
+
const result = await meeting.refreshDataChannelToken();
|
|
87
|
+
|
|
88
|
+
if (!result?.body) {
|
|
89
|
+
throw new Error('DataChannel token refresh returned no payload');
|
|
90
|
+
}
|
|
117
91
|
|
|
118
|
-
|
|
119
|
-
|
|
92
|
+
const {datachannelToken} = result.body;
|
|
93
|
+
|
|
94
|
+
// Store token on the meeting's LLM channel if available
|
|
95
|
+
meeting.setLLMChannelDataToken(datachannelToken);
|
|
96
|
+
|
|
97
|
+
return datachannelToken;
|
|
120
98
|
}
|
|
121
|
-
const {datachannelToken, dataChannelTokenType} = result.body;
|
|
122
|
-
const tokenStoreKey = dataChannelTokenType || sessionId;
|
|
123
|
-
const ownerMeetingId =
|
|
124
|
-
// @ts-ignore
|
|
125
|
-
meeting?.id || this.internal.llm.getOwnerMeetingId?.(tokenStoreKey);
|
|
126
|
-
// @ts-ignore
|
|
127
|
-
this.internal.llm.setDatachannelToken(datachannelToken, tokenStoreKey, ownerMeetingId);
|
|
128
99
|
|
|
129
|
-
|
|
100
|
+
throw new Error('No LLM channel or meeting found for request URL');
|
|
130
101
|
},
|
|
131
102
|
});
|
|
132
103
|
}
|