@webex/plugin-meetings 3.12.0-next.9 → 3.12.0-task-refactor.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.
Files changed (201) hide show
  1. package/dist/annotation/index.js +5 -14
  2. package/dist/annotation/index.js.map +1 -1
  3. package/dist/breakouts/breakout.js +1 -1
  4. package/dist/breakouts/index.js +1 -1
  5. package/dist/config.js +2 -8
  6. package/dist/config.js.map +1 -1
  7. package/dist/constants.js +6 -29
  8. package/dist/constants.js.map +1 -1
  9. package/dist/hashTree/hashTreeParser.js +29 -1563
  10. package/dist/hashTree/hashTreeParser.js.map +1 -1
  11. package/dist/hashTree/types.js +3 -13
  12. package/dist/hashTree/types.js.map +1 -1
  13. package/dist/index.js +2 -11
  14. package/dist/index.js.map +1 -1
  15. package/dist/interceptors/index.js +0 -7
  16. package/dist/interceptors/index.js.map +1 -1
  17. package/dist/interceptors/locusRouteToken.js +5 -27
  18. package/dist/interceptors/locusRouteToken.js.map +1 -1
  19. package/dist/interpretation/index.js +2 -2
  20. package/dist/interpretation/index.js.map +1 -1
  21. package/dist/interpretation/siLanguage.js +1 -1
  22. package/dist/locus-info/controlsUtils.js +3 -7
  23. package/dist/locus-info/controlsUtils.js.map +1 -1
  24. package/dist/locus-info/index.js +247 -642
  25. package/dist/locus-info/index.js.map +1 -1
  26. package/dist/locus-info/selfUtils.js +0 -1
  27. package/dist/locus-info/selfUtils.js.map +1 -1
  28. package/dist/locus-info/types.js.map +1 -1
  29. package/dist/media/MediaConnectionAwaiter.js +1 -57
  30. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  31. package/dist/media/properties.js +2 -4
  32. package/dist/media/properties.js.map +1 -1
  33. package/dist/meeting/in-meeting-actions.js +1 -7
  34. package/dist/meeting/in-meeting-actions.js.map +1 -1
  35. package/dist/meeting/index.js +1036 -1481
  36. package/dist/meeting/index.js.map +1 -1
  37. package/dist/meeting/request.js +0 -50
  38. package/dist/meeting/request.js.map +1 -1
  39. package/dist/meeting/request.type.js.map +1 -1
  40. package/dist/meeting/util.js +3 -133
  41. package/dist/meeting/util.js.map +1 -1
  42. package/dist/meetings/index.js +59 -142
  43. package/dist/meetings/index.js.map +1 -1
  44. package/dist/meetings/util.js +7 -11
  45. package/dist/meetings/util.js.map +1 -1
  46. package/dist/member/index.js +0 -10
  47. package/dist/member/index.js.map +1 -1
  48. package/dist/member/util.js +0 -10
  49. package/dist/member/util.js.map +1 -1
  50. package/dist/metrics/constants.js +1 -7
  51. package/dist/metrics/constants.js.map +1 -1
  52. package/dist/multistream/mediaRequestManager.js +60 -9
  53. package/dist/multistream/mediaRequestManager.js.map +1 -1
  54. package/dist/multistream/remoteMediaManager.js +0 -11
  55. package/dist/multistream/remoteMediaManager.js.map +1 -1
  56. package/dist/multistream/sendSlotManager.js +2 -116
  57. package/dist/multistream/sendSlotManager.js.map +1 -1
  58. package/dist/reachability/clusterReachability.js +18 -171
  59. package/dist/reachability/clusterReachability.js.map +1 -1
  60. package/dist/reachability/index.js +11 -21
  61. package/dist/reachability/index.js.map +1 -1
  62. package/dist/reachability/reachabilityPeerConnection.js +1 -1
  63. package/dist/reachability/reachabilityPeerConnection.js.map +1 -1
  64. package/dist/reactions/reactions.type.js.map +1 -1
  65. package/dist/reconnection-manager/index.js +1 -0
  66. package/dist/reconnection-manager/index.js.map +1 -1
  67. package/dist/types/common/browser-detection.d.ts +0 -1
  68. package/dist/types/common/events/events-scope.d.ts +0 -1
  69. package/dist/types/common/events/events.d.ts +0 -1
  70. package/dist/types/config.d.ts +0 -5
  71. package/dist/types/constants.d.ts +1 -24
  72. package/dist/types/hashTree/hashTreeParser.d.ts +11 -260
  73. package/dist/types/hashTree/types.d.ts +0 -20
  74. package/dist/types/index.d.ts +0 -1
  75. package/dist/types/interceptors/index.d.ts +1 -2
  76. package/dist/types/interceptors/locusRouteToken.d.ts +0 -2
  77. package/dist/types/locus-info/index.d.ts +47 -68
  78. package/dist/types/locus-info/types.d.ts +12 -28
  79. package/dist/types/media/MediaConnectionAwaiter.d.ts +1 -10
  80. package/dist/types/media/properties.d.ts +1 -2
  81. package/dist/types/meeting/in-meeting-actions.d.ts +0 -6
  82. package/dist/types/meeting/index.d.ts +7 -86
  83. package/dist/types/meeting/request.d.ts +1 -16
  84. package/dist/types/meeting/request.type.d.ts +0 -5
  85. package/dist/types/meeting/util.d.ts +0 -31
  86. package/dist/types/meeting-info/util.d.ts +0 -1
  87. package/dist/types/meeting-info/utilv2.d.ts +0 -1
  88. package/dist/types/meetings/index.d.ts +2 -4
  89. package/dist/types/member/index.d.ts +0 -1
  90. package/dist/types/member/types.d.ts +4 -4
  91. package/dist/types/member/util.d.ts +0 -5
  92. package/dist/types/metrics/constants.d.ts +0 -6
  93. package/dist/types/multistream/mediaRequestManager.d.ts +23 -0
  94. package/dist/types/multistream/sendSlotManager.d.ts +1 -23
  95. package/dist/types/reachability/clusterReachability.d.ts +3 -30
  96. package/dist/types/reactions/reactions.type.d.ts +0 -1
  97. package/dist/types/recording-controller/util.d.ts +5 -5
  98. package/dist/types/roap/index.d.ts +1 -1
  99. package/dist/webinar/index.js +163 -438
  100. package/dist/webinar/index.js.map +1 -1
  101. package/package.json +24 -26
  102. package/src/annotation/index.ts +7 -27
  103. package/src/config.ts +0 -5
  104. package/src/constants.ts +1 -30
  105. package/src/hashTree/hashTreeParser.ts +25 -1523
  106. package/src/hashTree/types.ts +1 -24
  107. package/src/index.ts +1 -8
  108. package/src/interceptors/index.ts +1 -2
  109. package/src/interceptors/locusRouteToken.ts +5 -22
  110. package/src/interpretation/index.ts +2 -2
  111. package/src/locus-info/controlsUtils.ts +0 -17
  112. package/src/locus-info/index.ts +213 -707
  113. package/src/locus-info/selfUtils.ts +0 -1
  114. package/src/locus-info/types.ts +12 -27
  115. package/src/media/MediaConnectionAwaiter.ts +1 -41
  116. package/src/media/properties.ts +1 -3
  117. package/src/meeting/in-meeting-actions.ts +0 -12
  118. package/src/meeting/index.ts +84 -461
  119. package/src/meeting/request.ts +0 -42
  120. package/src/meeting/request.type.ts +0 -6
  121. package/src/meeting/util.ts +2 -160
  122. package/src/meetings/index.ts +60 -180
  123. package/src/meetings/util.ts +9 -10
  124. package/src/member/index.ts +0 -10
  125. package/src/member/util.ts +0 -12
  126. package/src/metrics/constants.ts +0 -7
  127. package/src/multistream/mediaRequestManager.ts +54 -4
  128. package/src/multistream/remoteMediaManager.ts +0 -13
  129. package/src/multistream/sendSlotManager.ts +3 -97
  130. package/src/reachability/clusterReachability.ts +27 -153
  131. package/src/reachability/index.ts +1 -15
  132. package/src/reachability/reachabilityPeerConnection.ts +1 -3
  133. package/src/reactions/reactions.type.ts +0 -1
  134. package/src/reconnection-manager/index.ts +1 -0
  135. package/src/webinar/index.ts +6 -265
  136. package/test/unit/spec/annotation/index.ts +7 -69
  137. package/test/unit/spec/interceptors/locusRouteToken.ts +0 -44
  138. package/test/unit/spec/locus-info/controlsUtils.js +1 -56
  139. package/test/unit/spec/locus-info/index.js +90 -1457
  140. package/test/unit/spec/media/MediaConnectionAwaiter.ts +1 -41
  141. package/test/unit/spec/media/properties.ts +3 -12
  142. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -8
  143. package/test/unit/spec/meeting/index.js +128 -981
  144. package/test/unit/spec/meeting/request.js +0 -70
  145. package/test/unit/spec/meeting/utils.js +26 -438
  146. package/test/unit/spec/meetings/index.js +33 -845
  147. package/test/unit/spec/meetings/utils.js +1 -51
  148. package/test/unit/spec/member/index.js +4 -28
  149. package/test/unit/spec/member/util.js +27 -65
  150. package/test/unit/spec/multistream/mediaRequestManager.ts +85 -2
  151. package/test/unit/spec/multistream/remoteMediaManager.ts +0 -30
  152. package/test/unit/spec/multistream/sendSlotManager.ts +36 -135
  153. package/test/unit/spec/reachability/clusterReachability.ts +1 -125
  154. package/test/unit/spec/reachability/index.ts +3 -26
  155. package/test/unit/spec/reconnection-manager/index.js +8 -4
  156. package/test/unit/spec/webinar/index.ts +37 -534
  157. package/dist/aiEnableRequest/index.js +0 -184
  158. package/dist/aiEnableRequest/index.js.map +0 -1
  159. package/dist/aiEnableRequest/utils.js +0 -36
  160. package/dist/aiEnableRequest/utils.js.map +0 -1
  161. package/dist/hashTree/constants.js +0 -22
  162. package/dist/hashTree/constants.js.map +0 -1
  163. package/dist/hashTree/hashTree.js +0 -533
  164. package/dist/hashTree/hashTree.js.map +0 -1
  165. package/dist/hashTree/utils.js +0 -69
  166. package/dist/hashTree/utils.js.map +0 -1
  167. package/dist/interceptors/constant.js +0 -12
  168. package/dist/interceptors/constant.js.map +0 -1
  169. package/dist/interceptors/dataChannelAuthToken.js +0 -290
  170. package/dist/interceptors/dataChannelAuthToken.js.map +0 -1
  171. package/dist/interceptors/utils.js +0 -27
  172. package/dist/interceptors/utils.js.map +0 -1
  173. package/dist/types/aiEnableRequest/index.d.ts +0 -5
  174. package/dist/types/aiEnableRequest/utils.d.ts +0 -2
  175. package/dist/types/hashTree/constants.d.ts +0 -9
  176. package/dist/types/hashTree/hashTree.d.ts +0 -136
  177. package/dist/types/hashTree/utils.d.ts +0 -22
  178. package/dist/types/interceptors/constant.d.ts +0 -5
  179. package/dist/types/interceptors/dataChannelAuthToken.d.ts +0 -43
  180. package/dist/types/interceptors/utils.d.ts +0 -1
  181. package/dist/types/webinar/utils.d.ts +0 -6
  182. package/dist/webinar/utils.js +0 -25
  183. package/dist/webinar/utils.js.map +0 -1
  184. package/src/aiEnableRequest/README.md +0 -84
  185. package/src/aiEnableRequest/index.ts +0 -170
  186. package/src/aiEnableRequest/utils.ts +0 -25
  187. package/src/hashTree/constants.ts +0 -10
  188. package/src/hashTree/hashTree.ts +0 -480
  189. package/src/hashTree/utils.ts +0 -62
  190. package/src/interceptors/constant.ts +0 -6
  191. package/src/interceptors/dataChannelAuthToken.ts +0 -170
  192. package/src/interceptors/utils.ts +0 -16
  193. package/src/webinar/utils.ts +0 -16
  194. package/test/unit/spec/aiEnableRequest/index.ts +0 -981
  195. package/test/unit/spec/aiEnableRequest/utils.ts +0 -130
  196. package/test/unit/spec/hashTree/hashTree.ts +0 -721
  197. package/test/unit/spec/hashTree/hashTreeParser.ts +0 -3670
  198. package/test/unit/spec/hashTree/utils.ts +0 -140
  199. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +0 -210
  200. package/test/unit/spec/interceptors/utils.ts +0 -75
  201. package/test/unit/spec/webinar/utils.ts +0 -39
@@ -1,170 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
3
- */
4
-
5
- import {Interceptor} from '@webex/http-core';
6
- import LoggerProxy from '../common/logs/logger-proxy';
7
- import {DATA_CHANNEL_AUTH_HEADER, MAX_RETRY, RETRY_INTERVAL, RETRY_KEY} from './constant';
8
- import {isJwtTokenExpired} from './utils';
9
-
10
- /*!
11
- * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
12
- */
13
-
14
- const retryCountMap = new Map();
15
- interface HttpLikeError extends Error {
16
- statusCode?: number;
17
- original?: any;
18
- }
19
- /**
20
- * @class
21
- */
22
- export default class DataChannelAuthTokenInterceptor extends Interceptor {
23
- private _refreshDataChannelToken: () => Promise<string>;
24
- private _isDataChannelTokenEnabled: () => Promise<boolean>;
25
- constructor(options) {
26
- super(options);
27
-
28
- this._refreshDataChannelToken = options.refreshDataChannelToken;
29
- this._isDataChannelTokenEnabled = options.isDataChannelTokenEnabled;
30
- }
31
-
32
- /**
33
- * @returns {DataChannelAuthTokenInterceptor}
34
- */
35
- static create() {
36
- // @ts-ignore
37
- return new DataChannelAuthTokenInterceptor({
38
- webex: this,
39
-
40
- isDataChannelTokenEnabled: async () => {
41
- // @ts-ignore
42
- return this.internal.llm.isDataChannelTokenEnabled();
43
- },
44
-
45
- refreshDataChannelToken: async () => {
46
- // @ts-ignore
47
- const {body} = await this.internal.llm.refreshDataChannelToken();
48
- const {datachannelToken, dataChannelTokenType} = body ?? {};
49
-
50
- // @ts-ignore
51
- this.internal.llm.setDatachannelToken(datachannelToken, dataChannelTokenType);
52
-
53
- return datachannelToken;
54
- },
55
- });
56
- }
57
-
58
- private getRetryKey(options) {
59
- if (!options[RETRY_KEY]) {
60
- options[RETRY_KEY] = `${Date.now()}-${Math.random()}`;
61
- }
62
-
63
- return options[RETRY_KEY];
64
- }
65
-
66
- // Helper function to get header value case insensitively
67
- private getHeader(headers: Record<string, string>, name: string) {
68
- const key = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());
69
-
70
- return key ? headers[key] : undefined;
71
- }
72
-
73
- /**
74
- * Intercepts outgoing requests and refreshes the Data-Channel-Auth-Token
75
- * if the current JWT token is expired before the request is sent.
76
- *
77
- * @param {Object} options - The original request options.
78
- * @returns {Promise<Object>} Updated request options with refreshed token if needed.
79
- */
80
- async onRequest(options) {
81
- const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);
82
- const enabled = await this._isDataChannelTokenEnabled();
83
-
84
- if (!token || !enabled) {
85
- return options;
86
- }
87
-
88
- if (isJwtTokenExpired(token)) {
89
- try {
90
- const newToken = await this._refreshDataChannelToken();
91
- options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;
92
- } catch (e) {
93
- LoggerProxy.logger.warn(`DataChannelAuthTokenInterceptor: refresh failed: ${e.message}`);
94
- }
95
- }
96
-
97
- return options;
98
- }
99
-
100
- /**
101
- * Intercept responses and, on 401/403 with `Data-Channel-Auth-Token` header,
102
- * attempt to refresh the data channel token and retry the original request once.
103
- *
104
- * @param {Object} options
105
- * @param {Object} reason
106
- * @returns {Promise<HttpResponse>}
107
- */
108
- async onResponseError(options, reason) {
109
- const token = this.getHeader(options.headers, DATA_CHANNEL_AUTH_HEADER);
110
- const enabled = await this._isDataChannelTokenEnabled();
111
-
112
- if (!token || !enabled) {
113
- return Promise.reject(reason);
114
- }
115
-
116
- if (reason.statusCode !== 401 && reason.statusCode !== 403) {
117
- return Promise.reject(reason);
118
- }
119
-
120
- const key = this.getRetryKey(options);
121
- const retryCount = retryCountMap.get(key) || 0;
122
-
123
- if (retryCount >= MAX_RETRY) {
124
- LoggerProxy.logger.error(`data channel token refresh exceeded max retry (${MAX_RETRY})`);
125
- retryCountMap.delete(key);
126
-
127
- return Promise.reject(reason);
128
- }
129
-
130
- retryCountMap.set(key, retryCount + 1);
131
-
132
- return this.refreshTokenAndRetryWithDelay(options);
133
- }
134
-
135
- /**
136
- * Retry the failed data channel request after a delay.
137
- * Refreshes the Data-Channel-Auth-Token and re-sends the original request.
138
- *
139
- * @param {Object} options - Original request options.
140
- * @returns {Promise<HttpResponse>} - Resolves on successful retry.
141
- */
142
- refreshTokenAndRetryWithDelay(options) {
143
- return new Promise((resolve, reject) => {
144
- setTimeout(async () => {
145
- const key = this.getRetryKey(options);
146
- try {
147
- const newToken = await this._refreshDataChannelToken();
148
-
149
- options.headers[DATA_CHANNEL_AUTH_HEADER] = newToken;
150
-
151
- // @ts-ignore
152
- const res = await this.webex.request(options);
153
- retryCountMap.delete(key);
154
-
155
- resolve(res);
156
- } catch (e) {
157
- retryCountMap.delete(key);
158
-
159
- const msg = e?.message || String(e);
160
-
161
- const err: HttpLikeError = new Error(`DataChannel token refresh failed: ${msg}`);
162
- err.statusCode = e?.statusCode;
163
- err.original = e;
164
-
165
- reject(err);
166
- }
167
- }, RETRY_INTERVAL);
168
- });
169
- }
170
- }
@@ -1,16 +0,0 @@
1
- import * as jose from 'jose';
2
-
3
- const EXPIRY_BUFFER = 30 * 1000;
4
-
5
- // eslint-disable-next-line import/prefer-default-export
6
- export const isJwtTokenExpired = (token: string): boolean => {
7
- try {
8
- const payload = jose.decodeJwt(token);
9
-
10
- if (!payload?.exp) return false;
11
-
12
- return payload.exp * 1000 < Date.now() + EXPIRY_BUFFER;
13
- } catch {
14
- return true;
15
- }
16
- };
@@ -1,16 +0,0 @@
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
- };