@webex/plugin-meetings 3.9.0-webinar5k.1 → 3.9.0
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/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/constants.js +16 -0
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +40 -328
- package/dist/locus-info/index.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +6 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +196 -160
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +5 -2
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/type.js +7 -0
- package/dist/meeting/type.js.map +1 -0
- package/dist/meeting/util.js +79 -10
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +37 -39
- package/dist/meetings/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/members/collection.js +0 -13
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +21 -40
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +34 -5
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +42 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/types/constants.d.ts +16 -0
- package/dist/types/locus-info/index.d.ts +3 -102
- package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
- package/dist/types/meeting/index.d.ts +23 -28
- package/dist/types/meeting/type.d.ts +9 -0
- package/dist/types/meeting/util.d.ts +6 -3
- package/dist/types/member/types.d.ts +0 -1
- package/dist/types/members/collection.d.ts +0 -6
- package/dist/types/members/index.d.ts +7 -16
- package/dist/types/members/util.d.ts +2 -1
- package/dist/types/multistream/remoteMedia.d.ts +20 -1
- package/dist/types/multistream/remoteMediaGroup.d.ts +11 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +22 -24
- package/src/constants.ts +16 -2
- package/src/locus-info/index.ts +39 -409
- package/src/meeting/in-meeting-actions.ts +13 -0
- package/src/meeting/index.ts +92 -63
- package/src/meeting/muteState.ts +6 -2
- package/src/meeting/type.ts +9 -0
- package/src/meeting/util.ts +93 -19
- package/src/meetings/index.ts +6 -19
- package/src/member/types.ts +0 -1
- package/src/members/collection.ts +0 -11
- package/src/members/index.ts +10 -33
- package/src/members/util.ts +2 -1
- package/src/multistream/mediaRequestManager.ts +7 -7
- package/src/multistream/remoteMedia.ts +34 -4
- package/src/multistream/remoteMediaGroup.ts +37 -2
- package/test/unit/spec/locus-info/index.js +8 -365
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
- package/test/unit/spec/meeting/index.js +254 -38
- package/test/unit/spec/meeting/utils.js +122 -1
- package/test/unit/spec/meetings/index.js +2 -0
- package/test/unit/spec/members/index.js +37 -1
- package/test/unit/spec/multistream/mediaRequestManager.ts +19 -6
- package/test/unit/spec/multistream/remoteMedia.ts +66 -2
- package/dist/hashTree/constants.js +0 -23
- package/dist/hashTree/constants.js.map +0 -1
- package/dist/hashTree/hashTree.js +0 -516
- package/dist/hashTree/hashTree.js.map +0 -1
- package/dist/hashTree/hashTreeParser.js +0 -521
- package/dist/hashTree/hashTreeParser.js.map +0 -1
- package/dist/types/hashTree/constants.d.ts +0 -8
- package/dist/types/hashTree/hashTree.d.ts +0 -128
- package/dist/types/hashTree/hashTreeParser.d.ts +0 -152
- package/src/hashTree/constants.ts +0 -12
- package/src/hashTree/hashTree.ts +0 -460
- package/src/hashTree/hashTreeParser.ts +0 -556
- package/test/unit/spec/hashTree/hashTree.ts +0 -394
- package/test/unit/spec/hashTree/hashTreeParser.ts +0 -156
@@ -1,128 +0,0 @@
|
|
1
|
-
export type LeafDataItem = {
|
2
|
-
type: string;
|
3
|
-
id: number;
|
4
|
-
version: number;
|
5
|
-
};
|
6
|
-
/**
|
7
|
-
* HashTree is a data structure that organizes items into leaves based on their IDs,
|
8
|
-
*/
|
9
|
-
declare class HashTree {
|
10
|
-
leaves: Array<Record<string, Record<number, LeafDataItem>>>;
|
11
|
-
leafHashes: Array<string>;
|
12
|
-
readonly numLeaves: number;
|
13
|
-
/**
|
14
|
-
* Constructs a new HashTree.
|
15
|
-
* @param {LeafDataItem[]} leafData Initial data to populate the tree.
|
16
|
-
* @param {number} numLeaves The number of leaf nodes in the tree. Must be 0 or a power of 2.
|
17
|
-
* @throws {Error} If numLeaves is not 0 or a power of 2.
|
18
|
-
*/
|
19
|
-
constructor(leafData: LeafDataItem[], numLeaves: number);
|
20
|
-
/**
|
21
|
-
* Internal logic for adding or updating an item, without computing the leaf hash.
|
22
|
-
* @param {LeafDataItem} item The item to add or update.
|
23
|
-
* @returns {{put: boolean, index: (number|null)}} Object indicating if put and the leaf index.
|
24
|
-
* @private
|
25
|
-
*/
|
26
|
-
private _putItemInternal;
|
27
|
-
/**
|
28
|
-
* Adds or updates a single item in the hash tree.
|
29
|
-
* @param {LeafDataItem} item The item to add or update.
|
30
|
-
* @returns {boolean} True if the item was added or updated, false otherwise (e.g., older version or tree has 0 leaves).
|
31
|
-
*/
|
32
|
-
putItem(item: LeafDataItem): boolean;
|
33
|
-
/**
|
34
|
-
* Adds or updates multiple items in the hash tree.
|
35
|
-
* @param {LeafDataItem[]} items The array of items to add or update.
|
36
|
-
* @returns {boolean[]} An array of booleans indicating success for each item.
|
37
|
-
*/
|
38
|
-
putItems(items: LeafDataItem[]): boolean[];
|
39
|
-
/**
|
40
|
-
* Internal logic for removing an item, without computing the leaf hash.
|
41
|
-
* @param {LeafDataItem} item The item to remove.
|
42
|
-
* @returns {{removed: boolean, index: (number|null)}} Object indicating if removed and the leaf index.
|
43
|
-
* @private
|
44
|
-
*/
|
45
|
-
private _removeItemInternal;
|
46
|
-
/**
|
47
|
-
* Removes a single item from the hash tree.
|
48
|
-
* The removal is based on matching type, id, and the provided item's version
|
49
|
-
* being greater than or equal to the existing item's version.
|
50
|
-
* @param {LeafDataItem} item The item to remove.
|
51
|
-
* @returns {boolean} True if the item was removed, false otherwise.
|
52
|
-
*/
|
53
|
-
removeItem(item: LeafDataItem): boolean;
|
54
|
-
/**
|
55
|
-
* Removes multiple items from the hash tree.
|
56
|
-
* @param {LeafDataItem[]} items The array of items to remove.
|
57
|
-
* @returns {boolean[]} An array of booleans indicating success for each item.
|
58
|
-
*/
|
59
|
-
removeItems(items: LeafDataItem[]): boolean[];
|
60
|
-
/**
|
61
|
-
* Updates multiple items in the hash tree.
|
62
|
-
* This method can handle both adding and removing items based on the `operation` flag.
|
63
|
-
*
|
64
|
-
* @param {object[]} itemUpdates An array of objects containing `operation` flag and the `item` to update.
|
65
|
-
* @returns {boolean[]} An array of booleans indicating success for each operation.
|
66
|
-
*/
|
67
|
-
updateItems(itemUpdates: {
|
68
|
-
operation: 'update' | 'remove';
|
69
|
-
item: LeafDataItem;
|
70
|
-
}[]): boolean[];
|
71
|
-
/**
|
72
|
-
* Computes the hash for a specific leaf.
|
73
|
-
* The hash is based on the sorted items within the leaf.
|
74
|
-
* @param {number} index The index of the leaf to compute the hash for.
|
75
|
-
* @returns {void}
|
76
|
-
*/
|
77
|
-
computeLeafHash(index: number): void;
|
78
|
-
/**
|
79
|
-
* Computes all internal and leaf node hashes of the tree.
|
80
|
-
* Internal node hashes are computed bottom-up from the leaf hashes.
|
81
|
-
* @returns {string[]} An array of hash strings, with internal node hashes first, followed by leaf hashes.
|
82
|
-
* Returns `[EMPTY_HASH]` if the tree has 0 leaves.
|
83
|
-
*/
|
84
|
-
computeTreeHashes(): string[];
|
85
|
-
/**
|
86
|
-
* Returns all hashes in the tree (internal nodes then leaf nodes).
|
87
|
-
* @returns {string[]} An array of hash strings.
|
88
|
-
*/
|
89
|
-
getHashes(): string[];
|
90
|
-
/**
|
91
|
-
* Computes and returns the hash value of the root node.
|
92
|
-
* @returns {string} The root hash of the entire tree. Returns `EMPTY_HASH` if the tree has 0 leaves.
|
93
|
-
*/
|
94
|
-
getRootHash(): string;
|
95
|
-
/**
|
96
|
-
* Gets the number of leaves in the tree.
|
97
|
-
* @returns {number} The number of leaves.
|
98
|
-
*/
|
99
|
-
getLeafCount(): number;
|
100
|
-
/**
|
101
|
-
* Calculates the total number of items stored in the tree.
|
102
|
-
* @returns {number} The total number of items.
|
103
|
-
*/
|
104
|
-
getTotalItemCount(): number;
|
105
|
-
/**
|
106
|
-
* Retrieves all data items from a specific leaf.
|
107
|
-
* @param {number} leafIndex The index of the leaf.
|
108
|
-
* @returns {LeafDataItem[]} An array of LeafDataItem in the specified leaf, sorted by ID,
|
109
|
-
* or an empty array if the index is invalid or leaf is empty.
|
110
|
-
*/
|
111
|
-
getLeafData(leafIndex: number): LeafDataItem[];
|
112
|
-
/**
|
113
|
-
* Resizes the HashTree to have a new number of leaf nodes, redistributing all existing items.
|
114
|
-
* @param {number} newNumLeaves The new number of leaf nodes (must be 0 or a power of 2).
|
115
|
-
* @returns {boolean} true if the tree was resized, false if the size didn't change.
|
116
|
-
* @throws {Error} if newNumLeaves is not 0 or a power of 2.
|
117
|
-
*/
|
118
|
-
resize(newNumLeaves: number): boolean;
|
119
|
-
/**
|
120
|
-
* Compares the tree's leaf hashes with an external set of hashes and returns the indices of differing leaf nodes.
|
121
|
-
* The externalHashes array is expected to contain all node hashes (internal followed by leaves),
|
122
|
-
* similar to the output of getHashes().
|
123
|
-
* @param {string[]} externalHashes An array of hash strings (internal node hashes then leaf hashes).
|
124
|
-
* @returns {number[]} An array of indices of the leaf nodes that have different hashes.
|
125
|
-
*/
|
126
|
-
diffHashes(externalHashes: string[]): number[];
|
127
|
-
}
|
128
|
-
export default HashTree;
|
@@ -1,152 +0,0 @@
|
|
1
|
-
import HashTree from './hashTree';
|
2
|
-
import { Enum } from '../constants';
|
3
|
-
export interface DataSet {
|
4
|
-
url: string;
|
5
|
-
root: string;
|
6
|
-
version: number;
|
7
|
-
leafCount: number;
|
8
|
-
name: string;
|
9
|
-
idleMs: number;
|
10
|
-
backoff: {
|
11
|
-
maxMs: number;
|
12
|
-
exponent: number;
|
13
|
-
};
|
14
|
-
}
|
15
|
-
export declare const ObjectType: {
|
16
|
-
readonly participant: "participant";
|
17
|
-
readonly self: "self";
|
18
|
-
readonly locus: "locus";
|
19
|
-
};
|
20
|
-
export type ObjectType = Enum<typeof ObjectType>;
|
21
|
-
export interface HtMeta {
|
22
|
-
elementId: {
|
23
|
-
type: ObjectType;
|
24
|
-
id: number;
|
25
|
-
version: number;
|
26
|
-
};
|
27
|
-
dataSetNames: string[];
|
28
|
-
}
|
29
|
-
export interface HashTreeObject {
|
30
|
-
htMeta: HtMeta;
|
31
|
-
data: Record<string, any>;
|
32
|
-
}
|
33
|
-
export interface RootHashMessage {
|
34
|
-
dataSets: Array<DataSet>;
|
35
|
-
}
|
36
|
-
export interface HashTreeMessage {
|
37
|
-
dataSets: Array<DataSet>;
|
38
|
-
locusStateElements?: Array<HashTreeObject>;
|
39
|
-
locusSessionId?: string;
|
40
|
-
locusUrl?: string;
|
41
|
-
}
|
42
|
-
interface InternalDataSet extends DataSet {
|
43
|
-
hashTree: HashTree;
|
44
|
-
timer?: ReturnType<typeof setTimeout>;
|
45
|
-
}
|
46
|
-
type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
|
47
|
-
export declare const LocusInfoUpdateType: {
|
48
|
-
readonly OBJECTS_UPDATED: "OBJECTS_UPDATED";
|
49
|
-
readonly MEETING_ENDED: "MEETING_ENDED";
|
50
|
-
};
|
51
|
-
export type LocusInfoUpdateType = Enum<typeof LocusInfoUpdateType>;
|
52
|
-
export type LocusInfoUpdateCallback = (updateType: LocusInfoUpdateType, data?: {
|
53
|
-
updatedObjects: HashTreeObject[];
|
54
|
-
}) => void;
|
55
|
-
/**
|
56
|
-
* Parses hash tree eventing locus data
|
57
|
-
*/
|
58
|
-
declare class HashTreeParser {
|
59
|
-
dataSets: Record<string, InternalDataSet>;
|
60
|
-
webexRequest: WebexRequestMethod;
|
61
|
-
locusInfoUpdateCallback: LocusInfoUpdateCallback;
|
62
|
-
debugId: string;
|
63
|
-
/**
|
64
|
-
* Constructor for HashTreeParser
|
65
|
-
* @param {Object} options
|
66
|
-
* @param {Object} options.initialLocus The initial locus data containing the hash tree information
|
67
|
-
*/
|
68
|
-
constructor(options: {
|
69
|
-
initialLocus: {
|
70
|
-
dataSets: Array<DataSet>;
|
71
|
-
locus: any;
|
72
|
-
};
|
73
|
-
webexRequest: WebexRequestMethod;
|
74
|
-
locusInfoUpdateCallback: LocusInfoUpdateCallback;
|
75
|
-
debugId: string;
|
76
|
-
});
|
77
|
-
/**
|
78
|
-
* Each dataset exists at a different place in the dto
|
79
|
-
* iterate recursively over the locus and if it has a htMeta key,
|
80
|
-
* create an object with the type, id and version and add it to the appropriate leafData array
|
81
|
-
*
|
82
|
-
* @param {any} locus - The current part of the locus being processed
|
83
|
-
* @returns {any} - An object mapping dataset names to arrays of leaf data
|
84
|
-
*/
|
85
|
-
private analyzeLocusHtMeta;
|
86
|
-
/**
|
87
|
-
* Checks if the provided hash tree message indicates the end of the meeting and that there won't be any more updates.
|
88
|
-
*
|
89
|
-
* @param {HashTreeMessage} message - The hash tree message to check
|
90
|
-
* @returns {boolean} - Returns true if the message indicates the end of the meeting, false otherwise
|
91
|
-
*/
|
92
|
-
private isEndMessage;
|
93
|
-
/**
|
94
|
-
* Handles the root hash heartbeat message
|
95
|
-
*
|
96
|
-
* @param {RootHashMessage} message - The root hash heartbeat message
|
97
|
-
* @returns {void}
|
98
|
-
*/
|
99
|
-
handleRootHashHeartBeatMessage(message: RootHashMessage): void;
|
100
|
-
/**
|
101
|
-
* This method should be called when we receive a partial locus DTO that contains dataSets and htMeta information
|
102
|
-
* It updates the hash trees with the new leaf data based on the received Locus
|
103
|
-
*
|
104
|
-
* @param {Object} update - The locus update containing data sets and locus information
|
105
|
-
* @returns {void}
|
106
|
-
*/
|
107
|
-
handleLocusUpdate(update: {
|
108
|
-
dataSets?: Array<DataSet>;
|
109
|
-
locus: any;
|
110
|
-
}): void;
|
111
|
-
/**
|
112
|
-
* Handles incoming hash tree messages, updates the hash trees and calls locusInfoUpdateCallback
|
113
|
-
*
|
114
|
-
* @param {HashTreeMessage} message - The hash tree message containing data sets and objects to be processed
|
115
|
-
* @returns {void}
|
116
|
-
*/
|
117
|
-
handleMessage(message: HashTreeMessage): void;
|
118
|
-
/**
|
119
|
-
* Calculates a weighted backoff time that should be used for syncs
|
120
|
-
*
|
121
|
-
* @param {Object} backoff - The backoff configuration containing maxMs and exponent
|
122
|
-
* @returns {number} - A weighted backoff time based on the provided configuration, using algorithm supplied by Locus team
|
123
|
-
*/
|
124
|
-
private getWeightedBackoffTime;
|
125
|
-
/**
|
126
|
-
* Runs the sync algorithm for the given data set.
|
127
|
-
*
|
128
|
-
* @param {DataSet} receivedDataSet - The data set to run the sync algorithm for.
|
129
|
-
* @returns {void}
|
130
|
-
*/
|
131
|
-
private runSyncAlgorithm;
|
132
|
-
/**
|
133
|
-
* Stops all timers for the data sets to prevent any further sync attempts.
|
134
|
-
* @returns {void}
|
135
|
-
*/
|
136
|
-
stopAllTimers(): void;
|
137
|
-
/**
|
138
|
-
* Gets the current hashes from the locus for a specific data set.
|
139
|
-
* @param {string} dataSetName
|
140
|
-
* @returns {string[]}
|
141
|
-
*/
|
142
|
-
private getHashesFromLocus;
|
143
|
-
/**
|
144
|
-
* Sends a sync request to Locus for the specified data set.
|
145
|
-
*
|
146
|
-
* @param {InternalDataSet} dataSet The data set to sync.
|
147
|
-
* @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
|
148
|
-
* @returns {Promise<HashTreeObject[]>}
|
149
|
-
*/
|
150
|
-
private sendSyncRequestToLocus;
|
151
|
-
}
|
152
|
-
export default HashTreeParser;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
// TODO: Consider moving these to the main meetings constants file at some point
|
2
|
-
// Only worth doing so if they are used outside of the hash tree
|
3
|
-
|
4
|
-
export const EMPTY_HASH = '99aa06d3014798d86001c324468d497f';
|
5
|
-
|
6
|
-
export const DataSetNames = {
|
7
|
-
MAIN: 'main', // sent to web client, contains also panelists, over LLM
|
8
|
-
ATTENDEES: 'attendees', // NOT SENT to web client, all the attendees in the locus
|
9
|
-
ATD_ACTIVE: 'atd-active', // only sent to panelists, over LLM; the attendees that have their hands raised or are allowed to unmute themselves
|
10
|
-
ATD_UNMUTED: 'atd-unmuted', // sent to web client, over LLM, not sent to panelists; the attendees that are unmuted
|
11
|
-
SELF: 'self', // sent to web client, over Mercury
|
12
|
-
};
|