@webex/plugin-meetings 3.12.0-next.3 → 3.12.0-next.30

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 (77) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +1 -1
  3. package/dist/breakouts/breakout.js +1 -1
  4. package/dist/breakouts/index.js +1 -1
  5. package/dist/constants.js +3 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/controls-options-manager/constants.js +11 -1
  8. package/dist/controls-options-manager/constants.js.map +1 -1
  9. package/dist/controls-options-manager/index.js +23 -21
  10. package/dist/controls-options-manager/index.js.map +1 -1
  11. package/dist/controls-options-manager/util.js +91 -0
  12. package/dist/controls-options-manager/util.js.map +1 -1
  13. package/dist/hashTree/constants.js +10 -1
  14. package/dist/hashTree/constants.js.map +1 -1
  15. package/dist/hashTree/hashTreeParser.js +550 -346
  16. package/dist/hashTree/hashTreeParser.js.map +1 -1
  17. package/dist/hashTree/utils.js +22 -0
  18. package/dist/hashTree/utils.js.map +1 -1
  19. package/dist/interceptors/locusRetry.js +23 -8
  20. package/dist/interceptors/locusRetry.js.map +1 -1
  21. package/dist/interpretation/index.js +1 -1
  22. package/dist/interpretation/siLanguage.js +1 -1
  23. package/dist/locus-info/index.js +222 -61
  24. package/dist/locus-info/index.js.map +1 -1
  25. package/dist/meeting/index.js +372 -292
  26. package/dist/meeting/index.js.map +1 -1
  27. package/dist/meeting/util.js +1 -0
  28. package/dist/meeting/util.js.map +1 -1
  29. package/dist/meetings/index.js +146 -62
  30. package/dist/meetings/index.js.map +1 -1
  31. package/dist/meetings/util.js +39 -5
  32. package/dist/meetings/util.js.map +1 -1
  33. package/dist/metrics/constants.js +5 -1
  34. package/dist/metrics/constants.js.map +1 -1
  35. package/dist/multistream/sendSlotManager.js +116 -2
  36. package/dist/multistream/sendSlotManager.js.map +1 -1
  37. package/dist/types/constants.d.ts +1 -0
  38. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  39. package/dist/types/hashTree/constants.d.ts +1 -0
  40. package/dist/types/hashTree/hashTreeParser.d.ts +53 -15
  41. package/dist/types/hashTree/utils.d.ts +11 -0
  42. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  43. package/dist/types/locus-info/index.d.ts +38 -5
  44. package/dist/types/meeting/index.d.ts +11 -0
  45. package/dist/types/metrics/constants.d.ts +4 -0
  46. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  47. package/dist/webinar/index.js +301 -226
  48. package/dist/webinar/index.js.map +1 -1
  49. package/package.json +16 -16
  50. package/src/constants.ts +1 -0
  51. package/src/controls-options-manager/constants.ts +14 -1
  52. package/src/controls-options-manager/index.ts +26 -19
  53. package/src/controls-options-manager/util.ts +81 -1
  54. package/src/hashTree/constants.ts +9 -0
  55. package/src/hashTree/hashTreeParser.ts +273 -154
  56. package/src/hashTree/utils.ts +17 -0
  57. package/src/interceptors/locusRetry.ts +25 -4
  58. package/src/locus-info/index.ts +233 -79
  59. package/src/meeting/index.ts +98 -11
  60. package/src/meeting/util.ts +1 -0
  61. package/src/meetings/index.ts +58 -34
  62. package/src/meetings/util.ts +44 -1
  63. package/src/metrics/constants.ts +5 -0
  64. package/src/multistream/sendSlotManager.ts +97 -3
  65. package/src/webinar/index.ts +75 -1
  66. package/test/unit/spec/controls-options-manager/index.js +114 -6
  67. package/test/unit/spec/controls-options-manager/util.js +165 -0
  68. package/test/unit/spec/hashTree/hashTreeParser.ts +839 -37
  69. package/test/unit/spec/hashTree/utils.ts +88 -1
  70. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  71. package/test/unit/spec/locus-info/index.js +262 -64
  72. package/test/unit/spec/meeting/index.js +54 -36
  73. package/test/unit/spec/meeting/utils.js +4 -0
  74. package/test/unit/spec/meetings/index.js +190 -8
  75. package/test/unit/spec/meetings/utils.js +124 -0
  76. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  77. package/test/unit/spec/webinar/index.ts +60 -0
@@ -45,9 +45,13 @@ export declare const LocusInfoUpdateType: {
45
45
  readonly MEETING_ENDED: "MEETING_ENDED";
46
46
  };
47
47
  export type LocusInfoUpdateType = Enum<typeof LocusInfoUpdateType>;
48
- export type LocusInfoUpdateCallback = (updateType: LocusInfoUpdateType, data?: {
48
+ export type LocusInfoUpdate = {
49
+ updateType: typeof LocusInfoUpdateType.OBJECTS_UPDATED;
49
50
  updatedObjects: HashTreeObject[];
50
- }) => void;
51
+ } | {
52
+ updateType: typeof LocusInfoUpdateType.MEETING_ENDED;
53
+ };
54
+ export type LocusInfoUpdateCallback = (update: LocusInfoUpdate) => void;
51
55
  /**
52
56
  * This error is thrown if we receive information that the meeting has ended while we're processing some hash messages.
53
57
  * It's handled internally by HashTreeParser and results in MEETING_ENDED being sent up.
@@ -67,6 +71,10 @@ declare class HashTreeParser {
67
71
  heartbeatIntervalMs?: number;
68
72
  private excludedDataSets;
69
73
  state: 'active' | 'stopped';
74
+ private syncQueue;
75
+ private isSyncInProgress;
76
+ private isSyncAllInProgress;
77
+ private syncQueueProcessingPromise;
70
78
  /**
71
79
  * Constructor for HashTreeParser
72
80
  * @param {Object} options
@@ -120,14 +128,6 @@ declare class HashTreeParser {
120
128
  * @returns {Promise}
121
129
  */
122
130
  private initializeNewVisibleDataSet;
123
- /**
124
- * Sends a special sync request to Locus with all leaves empty - this is a way to get all the data for a given dataset.
125
- *
126
- * @param {string} datasetName - name of the dataset for which to send the request
127
- * @param {string} debugText - text to include in logs
128
- * @returns {Promise}
129
- */
130
- private sendInitializationSyncRequestToLocus;
131
131
  /**
132
132
  * Queries Locus for all up-to-date information about all visible data sets
133
133
  *
@@ -298,11 +298,35 @@ declare class HashTreeParser {
298
298
  * Performs a sync for the given data set.
299
299
  *
300
300
  * @param {InternalDataSet} dataSet - The data set to sync
301
- * @param {string} rootHash - Our current root hash for this data set
302
301
  * @param {string} reason - The reason for the sync (used for logging)
302
+ * @param {boolean} [isInitialization] - Whether this is an initialization sync (sends empty leaves data instead of comparing hashes)
303
303
  * @returns {Promise<void>}
304
304
  */
305
305
  private performSync;
306
+ /**
307
+ * Enqueues a sync for the given data set. If the data set is already in the queue, the request is ignored.
308
+ * This ensures that all syncs are executed sequentially and no more than 1 sync runs at a time.
309
+ *
310
+ * @param {string} dataSetName - The name of the data set to sync
311
+ * @param {string} reason - The reason for the sync (used for logging)
312
+ * @param {boolean} [isInitialization=false] - Whether this is an initialization sync (uses empty leaves data instead of hash comparison)
313
+ * @returns {void}
314
+ */
315
+ private enqueueSyncForDataset;
316
+ /**
317
+ * Processes the sync queue sequentially. Only one instance of this method runs at a time.
318
+ *
319
+ * @returns {Promise<void>}
320
+ */
321
+ private processSyncQueue;
322
+ /**
323
+ * Syncs all data sets that have hash trees, one by one in sequence, using the priority order
324
+ * provided by sortByInitPriority(). Does nothing if the parser is stopped or if a syncAllDatasets
325
+ * call is already in progress.
326
+ *
327
+ * @returns {Promise<void>}
328
+ */
329
+ syncAllDatasets(): Promise<void>;
306
330
  /**
307
331
  * Runs the sync algorithm for the given data set.
308
332
  *
@@ -333,24 +357,38 @@ declare class HashTreeParser {
333
357
  */
334
358
  stop(): void;
335
359
  /**
336
- * Resumes the HashTreeParser that was previously stopped.
360
+ * Cleans up the HashTreeParser, stopping all timers and clearing all internal state.
361
+ * After calling this, the parser should not be used anymore.
362
+ * @returns {void}
363
+ */
364
+ cleanUp(): void;
365
+ /**
366
+ * Resumes the HashTreeParser that was previously stopped, using a hash tree message.
337
367
  * @param {HashTreeMessage} message - The message to resume with, it must contain metadata with visible data sets info
338
368
  * @returns {void}
339
369
  */
340
- resume(message: HashTreeMessage): void;
370
+ resumeFromMessage(message: HashTreeMessage): void;
371
+ /**
372
+ * Resumes the HashTreeParser that was previously stopped, using a Locus API response.
373
+ * Unlike resumeFromMessage(), this does not require metadata/dataSets in the input,
374
+ * as it fetches all necessary information from Locus via initializeFromGetLociResponse.
375
+ * @param {LocusDTO} locus - locus object from an API response
376
+ * @returns {Promise}
377
+ */
378
+ resumeFromApiResponse(locus: LocusDTO): Promise<void>;
341
379
  private checkForSentinelHttpResponse;
342
380
  /**
343
381
  * Gets the current hashes from the locus for a specific data set.
344
382
  * @param {string} dataSetName
345
383
  * @param {string} currentRootHash
346
- * @returns {string[]}
384
+ * @returns {Object|null} An object containing the hashes and leaf count, or null if the hashes match and no sync is needed
347
385
  */
348
386
  private getHashesFromLocus;
349
387
  /**
350
388
  * Sends a sync request to Locus for the specified data set.
351
389
  *
352
390
  * @param {InternalDataSet} dataSet The data set to sync.
353
- * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
391
+ * @param {Object} options Either `{ isInitialization: true }` for init syncs (uses leafCount=1 with empty leaf data) or `{ mismatchedLeavesData }` for normal syncs.
354
392
  * @returns {Promise<HashTreeMessage|null>}
355
393
  */
356
394
  private sendSyncRequestToLocus;
@@ -20,3 +20,14 @@ export declare function isMetadata(object: HashTreeObject): boolean;
20
20
  * @returns {void}
21
21
  */
22
22
  export declare const deleteNestedObjectsWithHtMeta: (currentLocusPart: any, parent?: any, currentKey?: string | number) => void;
23
+ /**
24
+ * Reorders items so that those matching the given priority list come first (in priority order),
25
+ * followed by everything else in their original order.
26
+ *
27
+ * @param {Array<T>} items - The items to reorder
28
+ * @param {string[]} priority - Ordered list of names that should come first
29
+ * @returns {Array<T>} A new array with prioritized items first
30
+ */
31
+ export declare function sortByInitPriority<T extends {
32
+ name: string;
33
+ }>(items: T[], priority: string[]): T[];
@@ -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
@@ -25,10 +25,9 @@ export type HashTreeParserEntry = {
25
25
  *
26
26
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
27
27
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
28
- * @param {string} deviceUrl - The URL of the user's device
29
28
  * @returns {any} The meeting if found, otherwise undefined
30
29
  */
31
- export declare function findMeetingForHashTreeMessage(message: HashTreeMessage, meetingCollection: MeetingCollection, deviceUrl: string): any;
30
+ export declare function findMeetingForHashTreeMessage(message: HashTreeMessage | undefined, meetingCollection: MeetingCollection): any;
32
31
  /**
33
32
  * Creates a locus object from the objects received in a hash tree message. It usually will be
34
33
  * incomplete, because hash tree messages only contain the parts of locus that have changed,
@@ -167,6 +166,28 @@ export default class LocusInfo extends EventsScope {
167
166
  * @returns {void}
168
167
  */
169
168
  sendClassicVsHashTreeMismatchMetric(meeting: any, message: string): void;
169
+ /**
170
+ * Helper that handles the common logic for reactivating a stopped HashTreeParser when
171
+ * a newer "replaces" is detected. Used by both the message and API response parser switch methods.
172
+ *
173
+ * @param {string} callerName - name of the calling method, used in log messages
174
+ * @param {string} locusUrl - the locus URL of the stopped parser
175
+ * @param {HashTreeParserEntry} stoppedEntry - the stopped parser entry
176
+ * @param {ReplacesInfo} replaces - replacement info extracted from self
177
+ * @param {Function} resumeCallback - callback to invoke after reactivation to resume the parser
178
+ * @returns {void}
179
+ */
180
+ private resumeStoppedParser;
181
+ /**
182
+ * Handles an API response whose locusUrl doesn't match any active HashTreeParser
183
+ * (either no entry exists, or the existing entry is stopped).
184
+ * Creates a new parser or reactivates a stopped one using initializeFromGetLociResponse.
185
+ *
186
+ * @param {string} locusUrl - the locus URL from the API response
187
+ * @param {LocusDTO} locus - the locus DTO from the API response
188
+ * @returns {void}
189
+ */
190
+ private handleHashTreeParserSwitchForAPIResponse;
170
191
  /**
171
192
  * Checks if the hash tree message should trigger a switch to a different HashTreeParser
172
193
  *
@@ -183,13 +204,19 @@ export default class LocusInfo extends EventsScope {
183
204
  * @returns {void}
184
205
  */
185
206
  private handleHashTreeMessage;
207
+ /**
208
+ * Triggers a sync of all hash tree datasets for all hash tree parsers associated with this meeting.
209
+ * The syncs are executed sequentially within each parser.
210
+ *
211
+ * @returns {Promise<void>}
212
+ */
213
+ syncAllHashTreeDatasets(): Promise<void>;
186
214
  /**
187
215
  * Callback registered with HashTreeParser to receive locus info updates.
188
216
  * Updates our locus info based on the data parsed by the hash tree parser.
189
217
  *
190
218
  * @param {string} locusUrl - the locus URL for which the update is received
191
- * @param {LocusInfoUpdateType} updateType - The type of update received.
192
- * @param {Object} [data] - Additional data for the update, if applicable.
219
+ * @param {LocusInfoUpdate} update - Details about the update.
193
220
  * @returns {void}
194
221
  */
195
222
  private updateFromHashTree;
@@ -214,8 +241,8 @@ export default class LocusInfo extends EventsScope {
214
241
  * @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
215
242
  * @param {object} locus locus object
216
243
  * @param {object} metadata locus hash trees metadata
217
- * @param {string} eventType locus event
218
244
  * @param {DataSet[]} dataSets
245
+ * @param {string} eventType locus event
219
246
  * @returns {void}
220
247
  */
221
248
  private onFullLocusWithHashTrees;
@@ -444,4 +471,10 @@ export default class LocusInfo extends EventsScope {
444
471
  * @memberof LocusInfo
445
472
  */
446
473
  clearMainSessionLocusCache(): void;
474
+ /**
475
+ * Cleans up all hash tree parsers and clears internal maps.
476
+ * @returns {void}
477
+ * @memberof LocusInfo
478
+ */
479
+ cleanUp(): void;
447
480
  }
@@ -1318,6 +1318,11 @@ export default class Meeting extends StatelessWebexPlugin {
1318
1318
  * @returns{void}
1319
1319
  */
1320
1320
  private triggerStopReceivingTranscriptionEvent;
1321
+ /**
1322
+ * Restores LLM subchannel subscriptions after reconnect when captions are active.
1323
+ * @returns {void}
1324
+ */
1325
+ private restoreLLMSubscriptionsIfNeeded;
1321
1326
  /**
1322
1327
  * This is a callback for the LLM event that is triggered when it comes online
1323
1328
  * This method in turn will trigger an event to the developers that the LLM is connected
@@ -1372,6 +1377,12 @@ export default class Meeting extends StatelessWebexPlugin {
1372
1377
  * @returns {void}
1373
1378
  */
1374
1379
  saveDataChannelToken(join: any): void;
1380
+ /**
1381
+ * Ensures default-session data channel token exists after lobby admission.
1382
+ * Some lobby users do not receive a token until they are admitted.
1383
+ * @returns {Promise<boolean>} true when a new token is fetched and cached
1384
+ */
1385
+ private ensureDefaultDatachannelTokenAfterAdmit;
1375
1386
  /**
1376
1387
  * Connects to low latency mercury and reconnects if the address has changed
1377
1388
  * It will also disconnect if called when the meeting has ended
@@ -88,5 +88,9 @@ declare const BEHAVIORAL_METRICS: {
88
88
  LOCUS_CLASSIC_VS_HASH_TREE_MISMATCH: string;
89
89
  LOCUS_HASH_TREE_UNSUPPORTED_OPERATION: string;
90
90
  MEDIA_STILL_NOT_CONNECTED: string;
91
+ DEPRECATED_SET_CODEC_PARAMETERS_USED: string;
92
+ DEPRECATED_DELETE_CODEC_PARAMETERS_USED: string;
93
+ SET_CUSTOM_CODEC_PARAMETERS_USED: string;
94
+ MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED: string;
91
95
  };
92
96
  export { BEHAVIORAL_METRICS as default };
@@ -1,4 +1,4 @@
1
- import { SendSlot, MediaType, LocalStream, MultistreamRoapMediaConnection, NamedMediaGroup, StreamState } from '@webex/internal-media-core';
1
+ import { SendSlot, MediaType, LocalStream, MultistreamRoapMediaConnection, NamedMediaGroup, StreamState, MediaCodecMimeType, CodecParameters } from '@webex/internal-media-core';
2
2
  /**
3
3
  * This class is used to manage the sendSlots for the given media types.
4
4
  */
@@ -69,6 +69,8 @@ export default class SendSlotManager {
69
69
  */
70
70
  setActive(mediaType: MediaType, active?: boolean): void;
71
71
  /**
72
+ * @deprecated Use {@link setCustomCodecParameters} instead, which requires specifying the codec MIME type.
73
+ *
72
74
  * This method is used to set the codec parameters for the sendSlot of the given mediaType
73
75
  * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
74
76
  * @param {Object} codecParameters
@@ -78,12 +80,32 @@ export default class SendSlotManager {
78
80
  [key: string]: string | undefined;
79
81
  }): Promise<void>;
80
82
  /**
83
+ * @deprecated Use {@link markCustomCodecParametersForDeletion} instead, which requires specifying the codec MIME type.
84
+ *
81
85
  * This method is used to delete the codec parameters for the sendSlot of the given mediaType
82
86
  * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
83
87
  * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted
84
88
  * @returns {Promise<void>}
85
89
  */
86
90
  deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void>;
91
+ /**
92
+ * Sets custom codec parameters for the sendSlot of the given mediaType, scoped to a specific codec MIME type.
93
+ * Delegates to WCME's setCustomCodecParameters API.
94
+ * @param {MediaType} mediaType MediaType of the sendSlot
95
+ * @param {MediaCodecMimeType} codecMimeType The codec MIME type to apply parameters to (e.g. OPUS, H264, AV1)
96
+ * @param {CodecParameters} parameters Key-value pairs of codec parameters to set
97
+ * @returns {Promise<void>}
98
+ */
99
+ setCustomCodecParameters(mediaType: MediaType, codecMimeType: MediaCodecMimeType, parameters: CodecParameters): Promise<void>;
100
+ /**
101
+ * Marks custom codec parameters for deletion on the sendSlot of the given mediaType, scoped to a specific codec MIME type.
102
+ * Delegates to WCME's markCustomCodecParametersForDeletion API.
103
+ * @param {MediaType} mediaType MediaType of the sendSlot
104
+ * @param {MediaCodecMimeType} codecMimeType The codec MIME type whose parameters should be deleted (e.g. OPUS, H264, AV1)
105
+ * @param {string[]} parameters Array of parameter keys to delete
106
+ * @returns {Promise<void>}
107
+ */
108
+ markCustomCodecParametersForDeletion(mediaType: MediaType, codecMimeType: MediaCodecMimeType, parameters: string[]): Promise<void>;
87
109
  /**
88
110
  * This method is used to reset the SendSlotsManager by deleting all the sendSlots
89
111
  * @returns {undefined}