@webex/plugin-meetings 3.12.0-next.12 → 3.12.0-next.120

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 (227) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/events.js +29 -14
  7. package/dist/breakouts/events.js.map +1 -1
  8. package/dist/breakouts/index.js +90 -3
  9. package/dist/breakouts/index.js.map +1 -1
  10. package/dist/common/errors/webex-errors.js +49 -5
  11. package/dist/common/errors/webex-errors.js.map +1 -1
  12. package/dist/config.js +2 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/constants.js +37 -10
  15. package/dist/constants.js.map +1 -1
  16. package/dist/controls-options-manager/index.js +46 -10
  17. package/dist/controls-options-manager/index.js.map +1 -1
  18. package/dist/hashTree/constants.js +4 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +1045 -393
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +20 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  27. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  28. package/dist/interceptors/locusRetry.js +23 -8
  29. package/dist/interceptors/locusRetry.js.map +1 -1
  30. package/dist/interpretation/index.js +10 -1
  31. package/dist/interpretation/index.js.map +1 -1
  32. package/dist/interpretation/interpretation.types.js +7 -0
  33. package/dist/interpretation/interpretation.types.js.map +1 -0
  34. package/dist/interpretation/siLanguage.js +1 -1
  35. package/dist/locus-info/controlsUtils.js +4 -1
  36. package/dist/locus-info/controlsUtils.js.map +1 -1
  37. package/dist/locus-info/index.js +406 -121
  38. package/dist/locus-info/index.js.map +1 -1
  39. package/dist/locus-info/infoUtils.js +36 -5
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/types.js +19 -0
  42. package/dist/locus-info/types.js.map +1 -1
  43. package/dist/media/MediaConnectionAwaiter.js +15 -2
  44. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  45. package/dist/media/index.js +8 -2
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/properties.js +4 -5
  48. package/dist/media/properties.js.map +1 -1
  49. package/dist/meeting/in-meeting-actions.js +5 -1
  50. package/dist/meeting/in-meeting-actions.js.map +1 -1
  51. package/dist/meeting/index.js +1667 -834
  52. package/dist/meeting/index.js.map +1 -1
  53. package/dist/meeting/locusMediaRequest.js +229 -82
  54. package/dist/meeting/locusMediaRequest.js.map +1 -1
  55. package/dist/meeting/muteState.js +10 -1
  56. package/dist/meeting/muteState.js.map +1 -1
  57. package/dist/meeting/request.js +5 -2
  58. package/dist/meeting/request.js.map +1 -1
  59. package/dist/meeting/util.js +34 -2
  60. package/dist/meeting/util.js.map +1 -1
  61. package/dist/meeting-info/meeting-info-v2.js +2 -2
  62. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  63. package/dist/meetings/index.js +256 -118
  64. package/dist/meetings/index.js.map +1 -1
  65. package/dist/meetings/meetings.types.js +6 -1
  66. package/dist/meetings/meetings.types.js.map +1 -1
  67. package/dist/meetings/request.js +39 -0
  68. package/dist/meetings/request.js.map +1 -1
  69. package/dist/meetings/util.js +116 -18
  70. package/dist/meetings/util.js.map +1 -1
  71. package/dist/member/index.js +10 -0
  72. package/dist/member/index.js.map +1 -1
  73. package/dist/member/types.js.map +1 -1
  74. package/dist/member/util.js +30 -0
  75. package/dist/member/util.js.map +1 -1
  76. package/dist/members/index.js +101 -43
  77. package/dist/members/index.js.map +1 -1
  78. package/dist/members/util.js +8 -1
  79. package/dist/members/util.js.map +1 -1
  80. package/dist/metrics/constants.js +7 -1
  81. package/dist/metrics/constants.js.map +1 -1
  82. package/dist/multistream/codec/constants.js +63 -0
  83. package/dist/multistream/codec/constants.js.map +1 -0
  84. package/dist/multistream/mediaRequestManager.js +62 -15
  85. package/dist/multistream/mediaRequestManager.js.map +1 -1
  86. package/dist/multistream/receiveSlot.js +9 -0
  87. package/dist/multistream/receiveSlot.js.map +1 -1
  88. package/dist/reachability/clusterReachability.js.map +1 -1
  89. package/dist/reachability/index.js +121 -83
  90. package/dist/reachability/index.js.map +1 -1
  91. package/dist/reachability/reachability.types.js +2 -0
  92. package/dist/reachability/reachability.types.js.map +1 -1
  93. package/dist/reachability/util.js +45 -0
  94. package/dist/reachability/util.js.map +1 -1
  95. package/dist/reactions/reactions.type.js.map +1 -1
  96. package/dist/recording-controller/index.js +1 -3
  97. package/dist/recording-controller/index.js.map +1 -1
  98. package/dist/roap/turnDiscovery.js +8 -1
  99. package/dist/roap/turnDiscovery.js.map +1 -1
  100. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  101. package/dist/types/config.d.ts +2 -2
  102. package/dist/types/constants.d.ts +13 -1
  103. package/dist/types/controls-options-manager/index.d.ts +16 -0
  104. package/dist/types/hashTree/constants.d.ts +1 -0
  105. package/dist/types/hashTree/hashTreeParser.d.ts +189 -22
  106. package/dist/types/hashTree/utils.d.ts +7 -0
  107. package/dist/types/index.d.ts +3 -0
  108. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  109. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  110. package/dist/types/locus-info/index.d.ts +61 -7
  111. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  112. package/dist/types/locus-info/types.d.ts +21 -1
  113. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  114. package/dist/types/media/properties.d.ts +6 -2
  115. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  116. package/dist/types/meeting/index.d.ts +175 -11
  117. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  118. package/dist/types/meeting/request.d.ts +1 -0
  119. package/dist/types/meeting/util.d.ts +9 -0
  120. package/dist/types/meetings/index.d.ts +38 -18
  121. package/dist/types/meetings/meetings.types.d.ts +15 -0
  122. package/dist/types/meetings/request.d.ts +14 -0
  123. package/dist/types/member/index.d.ts +1 -0
  124. package/dist/types/member/types.d.ts +1 -0
  125. package/dist/types/member/util.d.ts +9 -0
  126. package/dist/types/members/index.d.ts +15 -2
  127. package/dist/types/members/util.d.ts +1 -5
  128. package/dist/types/metrics/constants.d.ts +6 -0
  129. package/dist/types/multistream/codec/constants.d.ts +7 -0
  130. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  131. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  132. package/dist/types/reachability/index.d.ts +10 -3
  133. package/dist/types/reachability/reachability.types.d.ts +7 -0
  134. package/dist/types/reachability/util.d.ts +17 -0
  135. package/dist/types/reactions/reactions.type.d.ts +3 -0
  136. package/dist/webinar/index.js +307 -161
  137. package/dist/webinar/index.js.map +1 -1
  138. package/package.json +23 -23
  139. package/src/aiEnableRequest/index.ts +16 -0
  140. package/src/breakouts/breakout.ts +3 -1
  141. package/src/breakouts/events.ts +33 -11
  142. package/src/breakouts/index.ts +110 -1
  143. package/src/common/errors/webex-errors.ts +50 -3
  144. package/src/config.ts +2 -2
  145. package/src/constants.ts +21 -3
  146. package/src/controls-options-manager/index.ts +62 -10
  147. package/src/hashTree/constants.ts +7 -0
  148. package/src/hashTree/hashTreeParser.ts +796 -192
  149. package/src/hashTree/utils.ts +19 -0
  150. package/src/index.ts +6 -0
  151. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  152. package/src/interceptors/locusRetry.ts +25 -4
  153. package/src/interpretation/index.ts +27 -9
  154. package/src/interpretation/interpretation.types.ts +11 -0
  155. package/src/locus-info/controlsUtils.ts +3 -1
  156. package/src/locus-info/index.ts +412 -130
  157. package/src/locus-info/infoUtils.ts +41 -6
  158. package/src/locus-info/types.ts +25 -1
  159. package/src/media/MediaConnectionAwaiter.ts +21 -4
  160. package/src/media/index.ts +10 -1
  161. package/src/media/properties.ts +8 -3
  162. package/src/meeting/in-meeting-actions.ts +8 -0
  163. package/src/meeting/index.ts +922 -116
  164. package/src/meeting/locusMediaRequest.ts +106 -6
  165. package/src/meeting/muteState.ts +10 -1
  166. package/src/meeting/request.ts +11 -0
  167. package/src/meeting/util.ts +46 -5
  168. package/src/meeting-info/meeting-info-v2.ts +4 -2
  169. package/src/meetings/index.ts +168 -79
  170. package/src/meetings/meetings.types.ts +19 -0
  171. package/src/meetings/request.ts +43 -0
  172. package/src/meetings/util.ts +117 -4
  173. package/src/member/index.ts +10 -0
  174. package/src/member/types.ts +1 -0
  175. package/src/member/util.ts +29 -0
  176. package/src/members/index.ts +70 -7
  177. package/src/members/util.ts +12 -4
  178. package/src/metrics/constants.ts +6 -0
  179. package/src/multistream/codec/constants.ts +58 -0
  180. package/src/multistream/mediaRequestManager.ts +119 -28
  181. package/src/multistream/receiveSlot.ts +18 -0
  182. package/src/reachability/clusterReachability.ts +3 -2
  183. package/src/reachability/index.ts +47 -16
  184. package/src/reachability/reachability.types.ts +11 -0
  185. package/src/reachability/util.ts +36 -0
  186. package/src/reactions/reactions.type.ts +3 -0
  187. package/src/recording-controller/index.ts +1 -2
  188. package/src/roap/turnDiscovery.ts +9 -1
  189. package/src/webinar/index.ts +216 -38
  190. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  191. package/test/unit/spec/breakouts/breakout.ts +9 -3
  192. package/test/unit/spec/breakouts/events.ts +120 -2
  193. package/test/unit/spec/breakouts/index.ts +191 -2
  194. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  195. package/test/unit/spec/controls-options-manager/index.js +139 -32
  196. package/test/unit/spec/hashTree/hashTreeParser.ts +2299 -243
  197. package/test/unit/spec/hashTree/utils.ts +37 -0
  198. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  199. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  200. package/test/unit/spec/interpretation/index.ts +26 -4
  201. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  202. package/test/unit/spec/locus-info/index.js +643 -63
  203. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  204. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  205. package/test/unit/spec/media/index.ts +92 -0
  206. package/test/unit/spec/media/properties.ts +23 -23
  207. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  208. package/test/unit/spec/meeting/index.js +2704 -135
  209. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  210. package/test/unit/spec/meeting/muteState.js +81 -0
  211. package/test/unit/spec/meeting/request.js +12 -0
  212. package/test/unit/spec/meeting/utils.js +153 -1
  213. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  214. package/test/unit/spec/meetings/index.js +479 -48
  215. package/test/unit/spec/meetings/request.js +141 -0
  216. package/test/unit/spec/meetings/utils.js +402 -51
  217. package/test/unit/spec/member/index.js +7 -0
  218. package/test/unit/spec/member/util.js +89 -0
  219. package/test/unit/spec/members/index.js +216 -0
  220. package/test/unit/spec/members/request.js +37 -1
  221. package/test/unit/spec/members/utils.js +63 -0
  222. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  223. package/test/unit/spec/reachability/index.ts +128 -46
  224. package/test/unit/spec/reachability/util.ts +31 -0
  225. package/test/unit/spec/recording-controller/index.js +9 -8
  226. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  227. package/test/unit/spec/webinar/index.ts +332 -31
@@ -1,7 +1,13 @@
1
+ import type { LocusSyncLatencyEventName } from '@webex/internal-plugin-metrics';
1
2
  import HashTree from './hashTree';
2
3
  import { Enum } from '../constants';
3
4
  import { HtMeta, HashTreeObject } from './types';
4
5
  import { LocusDTO } from '../locus-info/types';
6
+ export declare enum SyncAllBackoffType {
7
+ NONE = "none",
8
+ ONLY_LLM = "onlyLLM",
9
+ ALL = "all"
10
+ }
5
11
  export interface DataSet {
6
12
  url: string;
7
13
  root: string;
@@ -13,9 +19,11 @@ export interface DataSet {
13
19
  maxMs: number;
14
20
  exponent: number;
15
21
  };
22
+ heartbeatIntervalMs?: number;
16
23
  }
17
24
  export interface RootHashMessage {
18
25
  dataSets: Array<DataSet>;
26
+ heartbeatIntervalMs?: number;
19
27
  }
20
28
  export interface HashTreeMessage {
21
29
  dataSets: Array<DataSet>;
@@ -38,26 +46,62 @@ interface InternalDataSet extends DataSet {
38
46
  hashTree?: HashTree;
39
47
  timer?: ReturnType<typeof setTimeout>;
40
48
  heartbeatWatchdogTimer?: ReturnType<typeof setTimeout>;
49
+ syncAbortController?: AbortController;
41
50
  }
42
51
  type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
52
+ type GenerateTrackingId = () => string | undefined;
43
53
  export declare const LocusInfoUpdateType: {
44
54
  readonly OBJECTS_UPDATED: "OBJECTS_UPDATED";
45
55
  readonly MEETING_ENDED: "MEETING_ENDED";
56
+ readonly LOCUS_NOT_FOUND: "LOCUS_NOT_FOUND";
46
57
  };
47
58
  export type LocusInfoUpdateType = Enum<typeof LocusInfoUpdateType>;
59
+ interface LocusUpdatePayloads {
60
+ [LocusInfoUpdateType.OBJECTS_UPDATED]: {
61
+ updatedObjects: HashTreeObject[];
62
+ };
63
+ [LocusInfoUpdateType.MEETING_ENDED]: unknown;
64
+ [LocusInfoUpdateType.LOCUS_NOT_FOUND]: unknown;
65
+ }
48
66
  export type LocusInfoUpdate = {
49
- updateType: typeof LocusInfoUpdateType.OBJECTS_UPDATED;
50
- updatedObjects: HashTreeObject[];
51
- } | {
52
- updateType: typeof LocusInfoUpdateType.MEETING_ENDED;
53
- };
67
+ [K in keyof LocusUpdatePayloads]: {
68
+ updateType: K;
69
+ } & LocusUpdatePayloads[K];
70
+ }[keyof LocusUpdatePayloads];
54
71
  export type LocusInfoUpdateCallback = (update: LocusInfoUpdate) => void;
72
+ export type SyncLatencyTracker = {
73
+ saveLatency: (key: 'internal.client.locus.sync.random.backoff', value: number, options: {
74
+ meetingId: string;
75
+ dataSetName: string;
76
+ }) => void;
77
+ saveTimestamp: (options: {
78
+ key: LocusSyncLatencyEventName;
79
+ options: {
80
+ meetingId: string;
81
+ dataSetName: string;
82
+ trackingId?: string;
83
+ };
84
+ }) => void;
85
+ clearLocusSyncLatency: (dataSetName: string, meetingId: string, trackingId?: string) => void;
86
+ };
87
+ export type HashTreeParserCallbacks = {
88
+ locusInfoUpdateCallback: LocusInfoUpdateCallback;
89
+ syncLatencyTracker?: SyncLatencyTracker;
90
+ generateTrackingId?: GenerateTrackingId;
91
+ };
55
92
  /**
56
93
  * This error is thrown if we receive information that the meeting has ended while we're processing some hash messages.
57
94
  * It's handled internally by HashTreeParser and results in MEETING_ENDED being sent up.
58
95
  */
59
96
  export declare class MeetingEndedError extends Error {
60
97
  }
98
+ /**
99
+ * This error is thrown when a 404 is received from Locus hash tree endpoints, indicating that the locus URL
100
+ * is no longer valid (e.g. participant moved to a breakout room, or meeting ended).
101
+ * It's handled internally by HashTreeParser and results in LOCUS_NOT_FOUND being sent up.
102
+ */
103
+ export declare class LocusNotFoundError extends Error {
104
+ }
61
105
  /**
62
106
  * Parses hash tree eventing locus data
63
107
  */
@@ -65,12 +109,18 @@ declare class HashTreeParser {
65
109
  dataSets: Record<string, InternalDataSet>;
66
110
  visibleDataSetsUrl: string;
67
111
  webexRequest: WebexRequestMethod;
68
- locusInfoUpdateCallback: LocusInfoUpdateCallback;
112
+ private callbacks;
113
+ private syncLatencyMeetingId;
69
114
  visibleDataSets: VisibleDataSetInfo[];
70
115
  debugId: string;
71
- heartbeatIntervalMs?: number;
72
116
  private excludedDataSets;
73
117
  state: 'active' | 'stopped';
118
+ private syncQueue;
119
+ private isSyncInProgress;
120
+ private syncAllBackoffType;
121
+ private dataSetsSyncedDuringBackoff;
122
+ private syncQueueProcessingPromise;
123
+ private topLevelHeartbeatIntervalMs?;
74
124
  /**
75
125
  * Constructor for HashTreeParser
76
126
  * @param {Object} options
@@ -83,9 +133,10 @@ declare class HashTreeParser {
83
133
  };
84
134
  metadata: Metadata | null;
85
135
  webexRequest: WebexRequestMethod;
86
- locusInfoUpdateCallback: LocusInfoUpdateCallback;
136
+ callbacks: HashTreeParserCallbacks;
87
137
  debugId: string;
88
138
  excludedDataSets?: string[];
139
+ syncLatencyMeetingId: string;
89
140
  });
90
141
  /**
91
142
  * Sets the visible data sets list for the HashTreeParser. This method should be called only at the start, to initialize
@@ -124,14 +175,6 @@ declare class HashTreeParser {
124
175
  * @returns {Promise}
125
176
  */
126
177
  private initializeNewVisibleDataSet;
127
- /**
128
- * Sends a special sync request to Locus with all leaves empty - this is a way to get all the data for a given dataset.
129
- *
130
- * @param {string} datasetName - name of the dataset for which to send the request
131
- * @param {string} debugText - text to include in logs
132
- * @returns {Promise}
133
- */
134
- private sendInitializationSyncRequestToLocus;
135
178
  /**
136
179
  * Queries Locus for all up-to-date information about all visible data sets
137
180
  *
@@ -197,6 +240,13 @@ declare class HashTreeParser {
197
240
  * @returns {void}
198
241
  */
199
242
  private handleRootHashHeartBeatMessage;
243
+ /**
244
+ * Handles known errors that can happen during syncs
245
+ *
246
+ * @param {any} error - The error to handle
247
+ * @returns {boolean} true if the error was recognized and handled, false otherwise
248
+ */
249
+ private handleSyncErrors;
200
250
  /**
201
251
  * Asynchronously initializes new visible data sets
202
252
  *
@@ -232,6 +282,14 @@ declare class HashTreeParser {
232
282
  * @returns {void}
233
283
  */
234
284
  private updateDataSetInfo;
285
+ /**
286
+ * Updates the leaf count for a data set, resizing its hash tree accordingly.
287
+ *
288
+ * @param {InternalDataSet} dataSet - The data set to update
289
+ * @param {number} newLeafCount - The new leaf count
290
+ * @returns {void}
291
+ */
292
+ private updateDataSetLeafCount;
235
293
  /**
236
294
  * Checks for changes in the visible data sets based on the updated objects.
237
295
  * @param {HashTreeObject[]} updatedObjects - The list of updated hash tree objects.
@@ -284,6 +342,15 @@ declare class HashTreeParser {
284
342
  * @returns {void}
285
343
  */
286
344
  handleMessage(message: HashTreeMessage, debugText?: string): void;
345
+ /**
346
+ * Checks if Locus sync latency metrics should be collected for a dataset.
347
+ *
348
+ * @param {string} dataSetName dataset name
349
+ * @param {boolean} [isInitialization=false] whether this is an initialization sync
350
+ * @returns {boolean}
351
+ */
352
+ private shouldCollectSyncMetrics;
353
+ private saveSyncBackoffLatency;
287
354
  /**
288
355
  * Calls the updateInfo callback if there are any updates to report
289
356
  *
@@ -298,15 +365,103 @@ declare class HashTreeParser {
298
365
  * @returns {number} - A weighted backoff time based on the provided configuration, using algorithm supplied by Locus team
299
366
  */
300
367
  private getWeightedBackoffTime;
368
+ /**
369
+ * Returns a copy of a hash tree message restricted to a single dataset, keeping only the
370
+ * requested dataset and the elements belonging to it. Used to strip out datasets that Locus
371
+ * may include in a sync response but that we didn't request (e.g. "unjoined" sharing elements
372
+ * with "main"), which would otherwise be applied once per dataset.
373
+ *
374
+ * @param {HashTreeMessage} message the sync response message
375
+ * @param {string} dataSetName the dataset that was requested
376
+ * @returns {HashTreeMessage} a new message containing only the requested dataset
377
+ */
378
+ private filterMessageToDataSet;
301
379
  /**
302
380
  * Performs a sync for the given data set.
303
381
  *
304
382
  * @param {InternalDataSet} dataSet - The data set to sync
305
- * @param {string} rootHash - Our current root hash for this data set
306
383
  * @param {string} reason - The reason for the sync (used for logging)
384
+ * @param {boolean} [isInitialization] - Whether this is an initialization sync (sends empty leaves data instead of comparing hashes)
307
385
  * @returns {Promise<void>}
308
386
  */
309
387
  private performSync;
388
+ /**
389
+ * Cancels any pending or in-flight syncs for the specified data sets.
390
+ * This removes matching entries from the sync queue and aborts any in-flight sync HTTP requests.
391
+ *
392
+ * @param {string[]} dataSetNames - The names of the data sets to cancel syncs for
393
+ * @returns {void}
394
+ */
395
+ private cancelPendingSyncsForDataSets;
396
+ /**
397
+ * If a syncAllDatasets backoff sleep is in progress, marks the given data sets to be skipped
398
+ * after the sleep completes.
399
+ *
400
+ * @param {string[]} dataSetNames - The names of the data sets to mark
401
+ * @returns {void}
402
+ */
403
+ private markDataSetsForSyncAllBackoffSkip;
404
+ /**
405
+ * Aborts any in-flight sync HTTP requests for the specified data sets.
406
+ *
407
+ * @param {string[]} dataSetNames - The names of the data sets whose syncs should be aborted
408
+ * @returns {void}
409
+ */
410
+ private abortInFlightSyncs;
411
+ /**
412
+ * Enqueues a sync for the given data set. If the data set is already in the queue, the request is ignored.
413
+ * This ensures that all syncs are executed sequentially and no more than 1 sync runs at a time.
414
+ *
415
+ * @param {string} dataSetName - The name of the data set to sync
416
+ * @param {string} reason - The reason for the sync (used for logging)
417
+ * @param {boolean} [isInitialization=false] - Whether this is an initialization sync (uses empty leaves data instead of hash comparison)
418
+ * @returns {void}
419
+ */
420
+ private enqueueSyncForDataset;
421
+ /**
422
+ * Processes the sync queue sequentially. Only one instance of this method runs at a time.
423
+ *
424
+ * @returns {Promise<void>}
425
+ */
426
+ private processSyncQueue;
427
+ /**
428
+ * sets the backoff type for syncAllDatasets calls, which determines the scope of datasets that will be synced after the backoff delay.
429
+ *
430
+ * @param {boolean} onlyLLM - Whether the backoff is for a syncAllDatasets call that is syncing only LLM datasets
431
+ * @returns {void}
432
+ */
433
+ private setSyncAllBackoffType;
434
+ /**
435
+ * Checks if a syncAll backoff is already in progress. If so, upgrades the scope from
436
+ * onlyLLM to all datasets when the new call has a broader scope.
437
+ *
438
+ * @param {boolean} onlyLLM - Whether the current call is for LLM datasets only
439
+ * @returns {boolean} true if a backoff is already pending (caller should return early)
440
+ */
441
+ private tryUpgradePendingBackoff;
442
+ /**
443
+ * Syncs all data sets that have hash trees, one by one in sequence, using the priority order
444
+ * provided by sortByInitPriority().
445
+ *
446
+ * If a call is already waiting in the backoff delay phase, a new call with a broader scope
447
+ * (onlyLLM=false) will upgrade the pending scope, and the dataset list will be computed after
448
+ * the backoff using the upgraded scope. After the backoff, the sync queue handles deduplication
449
+ * so no guard is needed.
450
+ *
451
+ * @param {Object} [options={}] - Options for syncing
452
+ * @param {boolean} [options.onlyLLM=false] - Whether to sync only LLM based data sets
453
+ * @returns {Promise<void>}
454
+ */
455
+ syncAllDatasets(options?: {
456
+ onlyLLM?: boolean;
457
+ }): Promise<void>;
458
+ /**
459
+ * Returns the list of data sets that have hash trees, sorted by the priority order provided by sortByInitPriority().
460
+ *
461
+ * @param {boolean} onlyLLM - Whether to include only LLM based data sets
462
+ * @returns {Array<{name: string, backoff: {maxMs: number, exponent: number}}>} The sorted list of data sets with their backoff configurations
463
+ */
464
+ private getSortedDataSetsWithHashTrees;
310
465
  /**
311
466
  * Runs the sync algorithm for the given data set.
312
467
  *
@@ -343,25 +498,37 @@ declare class HashTreeParser {
343
498
  */
344
499
  cleanUp(): void;
345
500
  /**
346
- * Resumes the HashTreeParser that was previously stopped.
501
+ * Resumes the HashTreeParser that was previously stopped, using a hash tree message.
347
502
  * @param {HashTreeMessage} message - The message to resume with, it must contain metadata with visible data sets info
348
503
  * @returns {void}
349
504
  */
350
- resume(message: HashTreeMessage): void;
505
+ resumeFromMessage(message: HashTreeMessage): void;
506
+ /**
507
+ * Resumes the HashTreeParser that was previously stopped, using a Locus API response.
508
+ * Unlike resumeFromMessage(), this does not require metadata/dataSets in the input,
509
+ * as it fetches all necessary information from Locus via initializeFromGetLociResponse.
510
+ * @param {LocusDTO} locus - locus object from an API response
511
+ * @returns {Promise}
512
+ */
513
+ resumeFromApiResponse(locus: LocusDTO): Promise<void>;
351
514
  private checkForSentinelHttpResponse;
352
515
  /**
353
516
  * Gets the current hashes from the locus for a specific data set.
354
517
  * @param {string} dataSetName
355
518
  * @param {string} currentRootHash
356
- * @returns {string[]}
519
+ * @param {Object} [trackingIds] tracking ids for the /hashtree request
520
+ * @param {string} [trackingIds.requestTrackingId] tracking id forced onto the /hashtree HTTP request header (kept distinct from the /sync request's tracking id)
521
+ * @param {string} [trackingIds.metricTrackingId] tracking id (the /sync request's) under which the hashtree latency milestones are recorded, so they belong to the same sync latency record
522
+ * @returns {Object|null} An object containing the hashes and leaf count, or null if the hashes match and no sync is needed
357
523
  */
358
524
  private getHashesFromLocus;
359
525
  /**
360
526
  * Sends a sync request to Locus for the specified data set.
361
527
  *
362
528
  * @param {InternalDataSet} dataSet The data set to sync.
363
- * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
364
- * @returns {Promise<HashTreeMessage|null>}
529
+ * @param {Object} options Either `{ isInitialization: true }` for init syncs (uses leafCount=1 with empty leaf data) or `{ mismatchedLeavesData }` for normal syncs.
530
+ * @param {string} [trackingId] tracking id
531
+ * @returns {Promise<HashTreeMessage | null>}
365
532
  */
366
533
  private sendSyncRequestToLocus;
367
534
  }
@@ -31,3 +31,10 @@ export declare const deleteNestedObjectsWithHtMeta: (currentLocusPart: any, pare
31
31
  export declare function sortByInitPriority<T extends {
32
32
  name: string;
33
33
  }>(items: T[], priority: string[]): T[];
34
+ /**
35
+ * Sleeps for the specified amount of milliseconds
36
+ *
37
+ * @param {number} ms amount of milliseconds to sleep
38
+ * @returns {Promise<void>} A promise that resolves after the specified delay
39
+ */
40
+ export declare function sleep(ms: number): Promise<void>;
@@ -16,6 +16,9 @@ export * as REACTIONS from './reactions/reactions';
16
16
  export * as sdkAnnotationTypes from './annotation/annotation.types';
17
17
  export * as MeetingInfoV2 from './meeting-info/meeting-info-v2';
18
18
  export { type Reaction } from './reactions/reactions.type';
19
+ export { SitePreferenceSelectOption } from './meetings/meetings.types';
20
+ export type { FetchSitePreferencesMeViaSiteOptions, SitePreferencesResponse, } from './meetings/meetings.types';
21
+ export type { Interpreter, InterpreterUsingResource } from './interpretation/interpretation.types';
19
22
  export { CaptchaError, IntentToJoinError, JoinMeetingError, PasswordError, PermissionError, ReclaimHostIsHostAlreadyError, ReclaimHostNotAllowedError, ReclaimHostNotSupportedError, ReclaimHostEmptyWrongKeyError, Meeting, MeetingInfoUtil, JoinWebinarError, SdpResponseTimeoutError, };
20
23
  export { RemoteMedia } from './multistream/remoteMedia';
21
24
  export { default as TriggerProxy } from './common/events/trigger-proxy';
@@ -11,11 +11,11 @@ export default class LocusRetryStatusInterceptor extends Interceptor {
11
11
  */
12
12
  static create(): LocusRetryStatusInterceptor;
13
13
  /**
14
- * Handle response errors
15
- * @param {Object} options
16
- * @param {WebexHttpError} reason
17
- * @returns {Promise<WebexHttpError>}
14
+ * Check whether a URI is a Locus /hashtree or /sync endpoint.
15
+ * @param {string} uri
16
+ * @returns {boolean}
18
17
  */
18
+ private static isLocusHashtreeOrSync;
19
19
  onResponseError(options: any, reason: any): Promise<unknown>;
20
20
  /**
21
21
  * Handle retries for locus service unavailable errors
@@ -0,0 +1,10 @@
1
+ export type InterpreterUsingResource = {
2
+ id: string;
3
+ email?: string;
4
+ };
5
+ export type Interpreter = {
6
+ order: number;
7
+ sourceLanguage: string;
8
+ targetLanguage: string;
9
+ usingResource: InterpreterUsingResource;
10
+ };
@@ -1,10 +1,11 @@
1
1
  import EventsScope from '../common/events/events-scope';
2
2
  import { LOCUSEVENT } from '../constants';
3
- import HashTreeParser, { DataSet, HashTreeMessage, Metadata } from '../hashTree/hashTreeParser';
3
+ import HashTreeParser, { DataSet, HashTreeMessage, Metadata, SyncLatencyTracker } from '../hashTree/hashTreeParser';
4
4
  import { HashTreeObject } from '../hashTree/types';
5
5
  import { Links, LocusDTO } from './types';
6
6
  import MeetingCollection from '../meetings/collection';
7
7
  export type LocusLLMEvent = {
8
+ trackingId?: string;
8
9
  data: {
9
10
  eventType: typeof LOCUSEVENT.HASH_TREE_DATA_UPDATED;
10
11
  stateElementsMessage: HashTreeMessage;
@@ -20,15 +21,18 @@ export type HashTreeParserEntry = {
20
21
  replacedAt?: string;
21
22
  initializedFromHashTree: boolean;
22
23
  };
24
+ export type LocusInfoCallbacks = {
25
+ updateMeeting: (object: any) => void;
26
+ syncLatencyTracker?: SyncLatencyTracker;
27
+ };
23
28
  /**
24
29
  * Finds a meeting for a given hash tree message.
25
30
  *
26
31
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
27
32
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
28
- * @param {string} deviceUrl - The URL of the user's device
29
33
  * @returns {any} The meeting if found, otherwise undefined
30
34
  */
31
- export declare function findMeetingForHashTreeMessage(message: HashTreeMessage, meetingCollection: MeetingCollection, deviceUrl: string): any;
35
+ export declare function findMeetingForHashTreeMessage(message: HashTreeMessage | undefined, meetingCollection: MeetingCollection): any;
32
36
  /**
33
37
  * Creates a locus object from the objects received in a hash tree message. It usually will be
34
38
  * incomplete, because hash tree messages only contain the parts of locus that have changed,
@@ -53,7 +57,6 @@ export default class LocusInfo extends EventsScope {
53
57
  locusParser: any;
54
58
  meetingId: any;
55
59
  parsedLocus: any;
56
- updateMeeting: any;
57
60
  webex: any;
58
61
  aclUrl: any;
59
62
  baseSequence: any;
@@ -77,14 +80,17 @@ export default class LocusInfo extends EventsScope {
77
80
  hashTreeParsers: Map<string, HashTreeParserEntry>;
78
81
  hashTreeObjectId2ParticipantId: Map<number, string>;
79
82
  classicVsHashTreeMismatchMetricCounter: number;
83
+ private callbacks;
84
+ private destroyMeetingSuspended;
80
85
  /**
81
86
  * Constructor
82
- * @param {function} updateMeeting callback to update the meeting object from an object
87
+ * @param {Object} callbacks callbacks used by LocusInfo
88
+ * @param {function} callbacks.updateMeeting callback to update the meeting object from an object
83
89
  * @param {object} webex
84
90
  * @param {string} meetingId
85
91
  * @returns {undefined}
86
92
  */
87
- constructor(updateMeeting: any, webex: any, meetingId: any);
93
+ constructor(callbacks: LocusInfoCallbacks, webex: any, meetingId: any);
88
94
  /**
89
95
  * Does a Locus sync. It tries to get the latest delta DTO or if it can't, it falls back to getting the full Locus DTO.
90
96
  * WARNING: This function must not be used for hash tree based Locus meetings.
@@ -130,6 +136,7 @@ export default class LocusInfo extends EventsScope {
130
136
  private createHashTreeParser;
131
137
  /**
132
138
  * @param {Object} data - data to initialize locus info with. It may be from a join or GET /loci response or from a Mercury event that triggers a creation of meeting object
139
+ * @param {Function} [onLocusSynced] - optional callback that will be called at the end of initial setup, when locus info is fully synced. It will be called with the full locus snapshot as an argument (which may be null if we haven't received any full locus DTOs during the initial setup, for example in case we receive only hash tree messages without full locus DTOs)
133
140
  * @returns {undefined}
134
141
  * @memberof LocusInfo
135
142
  */
@@ -145,7 +152,13 @@ export default class LocusInfo extends EventsScope {
145
152
  } | {
146
153
  trigger: 'get-loci-response';
147
154
  locus?: LocusDTO;
148
- }): Promise<void>;
155
+ }, onLocusSynced?: (locus: LocusDTO) => void): Promise<void>;
156
+ /**
157
+ * Builds a full locus DTO snapshot from current internal locus state.
158
+ *
159
+ * @returns {LocusDTO}
160
+ */
161
+ private getCurrentLocusSnapshot;
149
162
  /**
150
163
  * Handles HTTP response from Locus API call.
151
164
  * @param {Meeting} meeting meeting object
@@ -167,6 +180,28 @@ export default class LocusInfo extends EventsScope {
167
180
  * @returns {void}
168
181
  */
169
182
  sendClassicVsHashTreeMismatchMetric(meeting: any, message: string): void;
183
+ /**
184
+ * Helper that handles the common logic for reactivating a stopped HashTreeParser when
185
+ * a newer "replaces" is detected. Used by both the message and API response parser switch methods.
186
+ *
187
+ * @param {string} callerName - name of the calling method, used in log messages
188
+ * @param {string} locusUrl - the locus URL of the stopped parser
189
+ * @param {HashTreeParserEntry} stoppedEntry - the stopped parser entry
190
+ * @param {ReplacesInfo} replaces - replacement info extracted from self
191
+ * @param {Function} resumeCallback - callback to invoke after reactivation to resume the parser
192
+ * @returns {void}
193
+ */
194
+ private resumeStoppedParser;
195
+ /**
196
+ * Handles an API response whose locusUrl doesn't match any active HashTreeParser
197
+ * (either no entry exists, or the existing entry is stopped).
198
+ * Creates a new parser or reactivates a stopped one using initializeFromGetLociResponse.
199
+ *
200
+ * @param {string} locusUrl - the locus URL from the API response
201
+ * @param {LocusDTO} locus - the locus DTO from the API response
202
+ * @returns {void}
203
+ */
204
+ private handleHashTreeParserSwitchForAPIResponse;
170
205
  /**
171
206
  * Checks if the hash tree message should trigger a switch to a different HashTreeParser
172
207
  *
@@ -183,6 +218,17 @@ export default class LocusInfo extends EventsScope {
183
218
  * @returns {void}
184
219
  */
185
220
  private handleHashTreeMessage;
221
+ /**
222
+ * Triggers a sync of all hash tree datasets for all hash tree parsers associated with this meeting.
223
+ * The syncs are executed sequentially within each parser.
224
+ *
225
+ * @param {Object} [options={}] - Options for syncing
226
+ * @param {boolean} [options.onlyLLM=false] - Whether to sync only LLM based data sets
227
+ * @returns {Promise<void>}
228
+ */
229
+ syncAllHashTreeDatasets(options?: {
230
+ onlyLLM?: boolean;
231
+ }): Promise<void>;
186
232
  /**
187
233
  * Callback registered with HashTreeParser to receive locus info updates.
188
234
  * Updates our locus info based on the data parsed by the hash tree parser.
@@ -282,6 +328,14 @@ export default class LocusInfo extends EventsScope {
282
328
  * @memberof LocusInfo
283
329
  */
284
330
  isMeetingActive(): void;
331
+ /**
332
+ * Suspends or resumes the emission of DESTROY_MEETING events in certain situations.
333
+ * Used by joinWithMedia to prevent meeting destruction during retry flows.
334
+ * @param {boolean} suspend - true to suppress, false to resume
335
+ * @returns {undefined}
336
+ * @memberof LocusInfo
337
+ */
338
+ suspendDestroyMeeting(suspend: boolean): void;
285
339
  /**
286
340
  * checks if the host permissions have changed while in the meeting
287
341
  * This would be the case if your role as host or moderator has been updated
@@ -1,2 +1,10 @@
1
+ export declare enum DisplayHintSection {
2
+ JOINED = "joined",
3
+ MODERATOR = "moderator",
4
+ COHOST = "coHost",
5
+ PRESENTER = "presenter",
6
+ PANELIST = "panelist",
7
+ ATTENDEE = "attendee"
8
+ }
1
9
  declare const InfoUtils: any;
2
10
  export default InfoUtils;
@@ -1,14 +1,30 @@
1
+ import { Enum } from '../constants';
1
2
  import { HtMeta } from '../hashTree/types';
3
+ export declare const EndMeetingReason: {
4
+ readonly maxMeetingDuration: "MAX_MEETING_DURATION";
5
+ readonly allParticipantsLeft: "ALL_PARTICIPANTS_LEFT";
6
+ readonly sipHostLeft: "SIP_HOST_LEFT";
7
+ readonly noHost: "NO_HOST";
8
+ readonly waitingForMpsEndMeetingTimeout: "WAITING_FOR_MPS_END_MEETING_TIMEOUT";
9
+ readonly fraudDetection: "FRAUD_DETECTION";
10
+ readonly meetingEndedByHost: "MEETING_ENDED_BY_HOST";
11
+ readonly meetingUpdated: "MEETING_UPDATED";
12
+ readonly meetingCancelled: "MEETING_CANCELLED";
13
+ readonly autoEndWithSingleParticipant: "AUTO_END_WITH_SINGLE_PARTICIPANT";
14
+ readonly breakoutEnded: "BREAKOUT_ENDED";
15
+ };
16
+ export type EndMeetingReason = Enum<typeof EndMeetingReason>;
2
17
  export type LocusFullState = {
3
18
  active: boolean;
4
19
  count: number;
5
20
  lastActive: string;
6
21
  locked: boolean;
7
22
  sessionId: string;
8
- seessionIds: string[];
23
+ sessionIds: string[];
9
24
  startTime: number;
10
25
  state: string;
11
26
  type: string;
27
+ endMeetingReason?: EndMeetingReason;
12
28
  };
13
29
  export type Links = {
14
30
  services: Record<'breakout' | 'record', {
@@ -59,3 +75,7 @@ export type ReplacesInfo = {
59
75
  replacedAt: string;
60
76
  sessionId: string;
61
77
  };
78
+ export declare const LocusErrorCodes: {
79
+ readonly LOCUS_INACTIVE: 2403004;
80
+ };
81
+ export type LocusErrorCodes = Enum<typeof LocusErrorCodes>;
@@ -2,6 +2,9 @@ export interface MediaConnectionAwaiterProps {
2
2
  webrtcMediaConnection: any;
3
3
  correlationId: string;
4
4
  }
5
+ export interface FailureResult {
6
+ iceConnected: boolean;
7
+ }
5
8
  /**
6
9
  * @class MediaConnectionAwaiter
7
10
  */
@@ -32,6 +35,12 @@ export default class MediaConnectionAwaiter {
32
35
  * @returns {boolean}
33
36
  */
34
37
  private isFailed;
38
+ /**
39
+ * Returns true if ICE connection state indicates connectivity.
40
+ *
41
+ * @returns {boolean}
42
+ */
43
+ private isIceConnected;
35
44
  /**
36
45
  * Returns true if the ICE Gathering is completed, false otherwise.
37
46
  *
@@ -84,7 +93,7 @@ export default class MediaConnectionAwaiter {
84
93
  /**
85
94
  * Waits for the webrtc media connection to be connected.
86
95
  *
87
- * @returns {Promise}
96
+ * @returns {Promise<void>} In case of failure, the promise is rejected with FailureResult
88
97
  */
89
98
  waitForMediaConnectionConnected(): Promise<void>;
90
99
  }
@@ -26,6 +26,7 @@ export default class MediaProperties {
26
26
  shareAudioStream?: LocalSystemAudioStream;
27
27
  videoDeviceId: any;
28
28
  videoStream?: LocalCameraStream;
29
+ srtpCipher: string | undefined;
29
30
  namespace: string;
30
31
  mediaIssueCounters: {
31
32
  [key: string]: number;
@@ -147,8 +148,11 @@ export default class MediaProperties {
147
148
  *
148
149
  * @param {string} issueType
149
150
  * @param {string} issueSubType
150
- * @param {string} correlationId
151
+ * @param {Object} metadata
151
152
  * @returns {void}
152
153
  */
153
- sendMediaIssueMetric(issueType: string, issueSubType: string, correlationId: any): void;
154
+ sendMediaIssueMetric(issueType: string, issueSubType: string, metadata: {
155
+ correlationId: string;
156
+ isMultistream: boolean;
157
+ }): void;
154
158
  }
@@ -115,6 +115,8 @@ interface IInMeetingActions {
115
115
  canDisablePollingQA?: boolean;
116
116
  canAttendeeRequestAiAssistantEnabled?: boolean;
117
117
  isAttendeeRequestAiAssistantDeclinedAll?: boolean;
118
+ isAnonymizeDisplayNamesEnabled?: boolean;
119
+ canViewTheParticipantList?: boolean;
118
120
  }
119
121
  /**
120
122
  * @class InMeetingActions
@@ -230,6 +232,8 @@ export default class InMeetingActions implements IInMeetingActions {
230
232
  canDisablePollingQA: any;
231
233
  canAttendeeRequestAiAssistantEnabled: any;
232
234
  isAttendeeRequestAiAssistantDeclinedAll: any;
235
+ isAnonymizeDisplayNamesEnabled: any;
236
+ canViewTheParticipantList: any;
233
237
  /**
234
238
  * Returns all meeting action options
235
239
  * @returns {Object}