@webex/plugin-meetings 3.10.0-webex-services-ready.1 → 3.10.0-webex-services-ready.3
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/hashTree/hashTree.js +3 -3
- package/dist/hashTree/hashTree.js.map +1 -1
- package/dist/hashTree/types.js +3 -2
- package/dist/hashTree/types.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +56 -99
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/types.js.map +1 -1
- package/dist/meeting/index.js +22 -7
- package/dist/meeting/index.js.map +1 -1
- package/dist/types/hashTree/types.d.ts +2 -0
- package/dist/types/locus-info/index.d.ts +7 -39
- package/dist/types/locus-info/types.d.ts +9 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +20 -20
- package/src/hashTree/hashTree.ts +1 -1
- package/src/hashTree/types.ts +2 -0
- package/src/locus-info/index.ts +50 -78
- package/src/locus-info/types.ts +6 -1
- package/src/meeting/index.ts +20 -1
- package/test/unit/spec/locus-info/index.js +128 -15
- package/test/unit/spec/meeting/index.js +29 -0
|
@@ -209,7 +209,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
|
|
|
209
209
|
sessionId: this.sessionId
|
|
210
210
|
});
|
|
211
211
|
},
|
|
212
|
-
version: "3.10.0-webex-services-ready.
|
|
212
|
+
version: "3.10.0-webex-services-ready.3"
|
|
213
213
|
});
|
|
214
214
|
var _default = exports.default = Breakout;
|
|
215
215
|
//# sourceMappingURL=breakout.js.map
|
package/dist/breakouts/index.js
CHANGED
|
@@ -1109,7 +1109,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1109
1109
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1110
1110
|
}
|
|
1111
1111
|
},
|
|
1112
|
-
version: "3.10.0-webex-services-ready.
|
|
1112
|
+
version: "3.10.0-webex-services-ready.3"
|
|
1113
1113
|
});
|
|
1114
1114
|
var _default = exports.default = Breakouts;
|
|
1115
1115
|
//# sourceMappingURL=index.js.map
|
|
@@ -17,7 +17,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2
|
|
|
17
17
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
18
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
19
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
20
|
-
var
|
|
20
|
+
var _xxh = require("xxh3-ts/xxh3");
|
|
21
21
|
var _constants = require("./constants");
|
|
22
22
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && r[_Symbol$iterator] || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
23
23
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -298,7 +298,7 @@ var HashTree = /*#__PURE__*/function () {
|
|
|
298
298
|
offset += 16;
|
|
299
299
|
});
|
|
300
300
|
});
|
|
301
|
-
this.leafHashes[index] = (0,
|
|
301
|
+
this.leafHashes[index] = (0, _xxh.XXH3_128)(buffer, BigInt(0)).toString(16).padStart(32, '0');
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
/**
|
|
@@ -321,7 +321,7 @@ var HashTree = /*#__PURE__*/function () {
|
|
|
321
321
|
var leftHash = currentLevelHashes[i];
|
|
322
322
|
var rightHash = i + 1 < currentLevelHashes.length ? currentLevelHashes[i + 1] : leftHash;
|
|
323
323
|
var input = Buffer.concat([Buffer.from(leftHash, 'hex').subarray(0, 8).reverse(), Buffer.from(leftHash, 'hex').subarray(8, 16).reverse(), Buffer.from(rightHash, 'hex').subarray(0, 8).reverse(), Buffer.from(rightHash, 'hex').subarray(8, 16).reverse()]);
|
|
324
|
-
nextLevelHashes.push((0,
|
|
324
|
+
nextLevelHashes.push((0, _xxh.XXH3_128)(input, BigInt(0)).toString(16).padStart(32, '0'));
|
|
325
325
|
}
|
|
326
326
|
currentLevelHashes = nextLevelHashes;
|
|
327
327
|
allHashes.unshift.apply(allHashes, (0, _toConsumableArray2.default)(currentLevelHashes));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_xxh3Ts","require","_constants","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","HashTree","leafData","numLeaves","_classCallCheck2","default","_defineProperty2","Error","concat","leafHashes","fill","EMPTY_HASH","leaves","map","putItems","_createClass2","key","_putItemInternal","item","put","index","id","type","existingItem","version","putItem","_this$_putItemInterna","computeLeafHash","items","_this","results","changedLeafIndexes","_set","forEach","_this$_putItemInterna2","push","add","_removeItemInternal","removed","_keys","removeItem","_this$_removeItemInte","removeItems","_this2","_this2$_removeItemInt","updateItems","itemUpdates","_this3","_ref","operation","_this3$_removeItemInt","_this3$_putItemIntern","leafContent","totalItemsCount","reduce","count","buffer","Buffer","alloc","offset","itemTypes","sort","_values","b","writeBigInt64LE","BigInt","XXH3_128","padStart","computeTreeHashes","currentLevelHashes","_toConsumableArray2","allHashes","nextLevelHashes","i","leftHash","rightHash","input","from","subarray","reverse","unshift","apply","getHashes","getRootHash","getLeafCount","getTotalItemCount","_iterator","_step","leaf","_i","_Object$keys2","err","getLeafData","leafIndex","_i2","_Object$keys3","resize","newNumLeaves","allItems","_iterator2","_step2","_i3","_Object$keys4","diffHashes","externalHashes","differingLeafIndexes","externalLeafHashesStart","ownLeafHash","externalLeafHash","_default","exports"],"sources":["hashTree.ts"],"sourcesContent":["import {XXH3_128} from 'xxh3-ts';\nimport {EMPTY_HASH} from './constants';\nimport {ObjectType} from './types';\n\nexport type LeafDataItem = {\n type: ObjectType;\n id: number;\n version: number;\n};\n\n/**\n * HashTree is a data structure that organizes items into leaves based on their IDs,\n */\nclass HashTree {\n leaves: Array<Record<string, Record<number, LeafDataItem>>>;\n\n leafHashes: Array<string>;\n readonly numLeaves: number;\n\n /**\n * Constructs a new HashTree.\n * @param {LeafDataItem[]} leafData Initial data to populate the tree.\n * @param {number} numLeaves The number of leaf nodes in the tree. Must be 0 or a power of 2.\n * @throws {Error} If numLeaves is not 0 or a power of 2.\n */\n constructor(leafData: LeafDataItem[], numLeaves: number) {\n // eslint-disable-next-line no-bitwise\n if ((numLeaves & (numLeaves - 1)) !== 0) {\n throw new Error(`Number of leaves must be a power of 2, saw ${numLeaves}`);\n }\n\n this.numLeaves = numLeaves;\n this.leafHashes = new Array(numLeaves).fill(EMPTY_HASH);\n\n this.leaves = new Array(numLeaves).fill(null).map(() => {\n return {};\n });\n\n if (leafData) {\n this.putItems(leafData);\n }\n }\n\n /**\n * Internal logic for adding or updating an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {{put: boolean, index: (number|null)}} Object indicating if put and the leaf index.\n * @private\n */\n private _putItemInternal(item: LeafDataItem): {put: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {put: false, index: null}; // Cannot add to a tree with 0 leaves\n }\n\n const index = item.id % this.numLeaves;\n\n if (!this.leaves[index][item.type]) {\n this.leaves[index][item.type] = {};\n }\n\n const existingItem = this.leaves[index][item.type][item.id];\n\n if (!existingItem || existingItem.version < item.version) {\n this.leaves[index][item.type][item.id] = item;\n\n return {put: true, index};\n }\n\n return {put: false, index: null};\n }\n\n /**\n * Adds or updates a single item in the hash tree.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {boolean} True if the item was added or updated, false otherwise (e.g., older version or tree has 0 leaves).\n */\n putItem(item: LeafDataItem): boolean {\n const {put, index} = this._putItemInternal(item);\n\n if (put && index !== null) {\n this.computeLeafHash(index);\n }\n\n return put;\n }\n\n /**\n * Adds or updates multiple items in the hash tree.\n * @param {LeafDataItem[]} items The array of items to add or update.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n putItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n // Cannot add items to a tree with 0 leaves.\n return items.map(() => false);\n }\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Internal logic for removing an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to remove.\n * @returns {{removed: boolean, index: (number|null)}} Object indicating if removed and the leaf index.\n * @private\n */\n private _removeItemInternal(item: LeafDataItem): {removed: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {removed: false, index: null};\n }\n\n const index = item.id % this.numLeaves;\n\n if (\n this.leaves[index] &&\n this.leaves[index][item.type] &&\n this.leaves[index][item.type][item.id]\n ) {\n const existingItem = this.leaves[index][item.type][item.id];\n if (\n existingItem.id === item.id &&\n existingItem.type === item.type &&\n existingItem.version <= item.version\n ) {\n delete this.leaves[index][item.type][item.id];\n if (Object.keys(this.leaves[index][item.type]).length === 0) {\n delete this.leaves[index][item.type];\n }\n\n return {removed: true, index};\n }\n }\n\n return {removed: false, index: null};\n }\n\n /**\n * Removes a single item from the hash tree.\n * The removal is based on matching type, id, and the provided item's version\n * being greater than or equal to the existing item's version.\n * @param {LeafDataItem} item The item to remove.\n * @returns {boolean} True if the item was removed, false otherwise.\n */\n removeItem(item: LeafDataItem): boolean {\n const {removed, index} = this._removeItemInternal(item);\n\n if (removed && index !== null) {\n this.computeLeafHash(index);\n }\n\n return removed;\n }\n\n /**\n * Removes multiple items from the hash tree.\n * @param {LeafDataItem[]} items The array of items to remove.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n removeItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n return items.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Updates multiple items in the hash tree.\n * This method can handle both updating and removing items based on the `operation` flag.\n *\n * @param {object[]} itemUpdates An array of objects containing `operation` flag and the `item` to update.\n * @returns {boolean[]} An array of booleans indicating success for each operation.\n */\n updateItems(itemUpdates: {operation: 'update' | 'remove'; item: LeafDataItem}[]): boolean[] {\n if (this.numLeaves === 0 && itemUpdates.length > 0) {\n return itemUpdates.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n itemUpdates.forEach(({operation, item}) => {\n if (operation === 'remove') {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n } else {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Computes the hash for a specific leaf.\n * The hash is based on the sorted items within the leaf.\n * @param {number} index The index of the leaf to compute the hash for.\n * @returns {void}\n */\n computeLeafHash(index: number) {\n if (index < 0 || index >= this.numLeaves) {\n // nothing to do\n return;\n }\n const leafContent = this.leaves[index];\n\n const totalItemsCount = Object.keys(leafContent).reduce((count, type) => {\n return count + Object.keys(leafContent[type]).length;\n }, 0);\n const buffer = Buffer.alloc(totalItemsCount * 16);\n\n let offset = 0;\n\n // iterate through the item types lexicographically\n const itemTypes = Object.keys(leafContent).sort();\n itemTypes.forEach((type) => {\n // iterate through the items of this type in ascending order of ID\n const items = Object.values(leafContent[type]).sort(\n (a: LeafDataItem, b: LeafDataItem) => a.id - b.id\n );\n\n // add all the items id and version to the hasher\n items.forEach((item: LeafDataItem) => {\n buffer.writeBigInt64LE(BigInt(item.id), offset);\n buffer.writeBigInt64LE(BigInt(item.version), offset + 8);\n\n offset += 16;\n });\n });\n\n this.leafHashes[index] = XXH3_128(buffer, BigInt(0)).toString(16).padStart(32, '0');\n }\n\n /**\n * Computes all internal and leaf node hashes of the tree.\n * Internal node hashes are computed bottom-up from the leaf hashes.\n * @returns {string[]} An array of hash strings, with internal node hashes first, followed by leaf hashes.\n * Returns `[EMPTY_HASH]` if the tree has 0 leaves.\n */\n computeTreeHashes(): string[] {\n if (this.numLeaves === 0) {\n return [EMPTY_HASH];\n }\n\n let currentLevelHashes = [...this.leafHashes];\n const allHashes = [];\n\n while (currentLevelHashes.length > 1) {\n const nextLevelHashes: string[] = [];\n for (let i = 0; i < currentLevelHashes.length; i += 2) {\n const leftHash = currentLevelHashes[i];\n const rightHash = i + 1 < currentLevelHashes.length ? currentLevelHashes[i + 1] : leftHash;\n\n const input = Buffer.concat([\n Buffer.from(leftHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(leftHash, 'hex').subarray(8, 16).reverse(),\n Buffer.from(rightHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(rightHash, 'hex').subarray(8, 16).reverse(),\n ]);\n\n nextLevelHashes.push(XXH3_128(input, BigInt(0)).toString(16).padStart(32, '0'));\n }\n currentLevelHashes = nextLevelHashes;\n allHashes.unshift(...currentLevelHashes);\n }\n\n return [...allHashes, ...this.leafHashes];\n }\n\n /**\n * Returns all hashes in the tree (internal nodes then leaf nodes).\n * @returns {string[]} An array of hash strings.\n */\n getHashes(): string[] {\n return this.computeTreeHashes();\n }\n\n /**\n * Computes and returns the hash value of the root node.\n * @returns {string} The root hash of the entire tree. Returns `EMPTY_HASH` if the tree has 0 leaves.\n */\n getRootHash(): string {\n if (this.numLeaves === 0) {\n return EMPTY_HASH;\n }\n\n return this.computeTreeHashes()[0];\n }\n\n /**\n * Gets the number of leaves in the tree.\n * @returns {number} The number of leaves.\n */\n getLeafCount(): number {\n return this.numLeaves;\n }\n\n /**\n * Calculates the total number of items stored in the tree.\n * @returns {number} The total number of items.\n */\n getTotalItemCount(): number {\n let count = 0;\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n count += Object.keys(leaf[type]).length;\n }\n }\n\n return count;\n }\n\n /**\n * Retrieves all data items from a specific leaf.\n * @param {number} leafIndex The index of the leaf.\n * @returns {LeafDataItem[]} An array of LeafDataItem in the specified leaf, sorted by ID,\n * or an empty array if the index is invalid or leaf is empty.\n */\n getLeafData(leafIndex: number): LeafDataItem[] {\n if (leafIndex < 0 || leafIndex >= this.numLeaves) {\n return [];\n }\n const leafContent = this.leaves[leafIndex];\n const items: LeafDataItem[] = [];\n for (const type of Object.keys(leafContent)) {\n items.push(...Object.values(leafContent[type]));\n }\n // Optionally sort them if a specific order is required, e.g., by ID\n items.sort((a, b) => a.id - b.id);\n\n return items;\n }\n\n /**\n * Resizes the HashTree to have a new number of leaf nodes, redistributing all existing items.\n * @param {number} newNumLeaves The new number of leaf nodes (must be 0 or a power of 2).\n * @returns {boolean} true if the tree was resized, false if the size didn't change.\n * @throws {Error} if newNumLeaves is not 0 or a power of 2.\n */\n resize(newNumLeaves: number): boolean {\n // eslint-disable-next-line no-bitwise\n if (newNumLeaves < 0 || (newNumLeaves !== 0 && (newNumLeaves & (newNumLeaves - 1)) !== 0)) {\n throw new Error('New number of leaves must be 0 or a power of 2');\n }\n\n if (newNumLeaves === this.numLeaves) {\n return false;\n }\n\n const allItems: LeafDataItem[] = [];\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n allItems.push(...Object.values(leaf[type]));\n }\n }\n\n // Re-initialize\n // eslint-disable-next-line no-extra-semi\n (this as any).numLeaves = newNumLeaves; // Type assertion to update readonly property\n this.leafHashes = new Array(newNumLeaves).fill(EMPTY_HASH);\n this.leaves = new Array(newNumLeaves).fill(null).map(() => ({}));\n\n if (newNumLeaves > 0) {\n this.putItems(allItems); // Re-add items which will be re-assigned to leaves and re-hashed\n }\n\n return true;\n }\n\n /**\n * Compares the tree's leaf hashes with an external set of hashes and returns the indices of differing leaf nodes.\n * The externalHashes array is expected to contain all node hashes (internal followed by leaves),\n * similar to the output of getHashes().\n * @param {string[]} externalHashes An array of hash strings (internal node hashes then leaf hashes).\n * @returns {number[]} An array of indices of the leaf nodes that have different hashes.\n */\n diffHashes(externalHashes: string[]): number[] {\n if (this.numLeaves === 0) {\n // If this tree is empty, its hash is EMPTY_HASH.\n // It differs if externalHashes is not a single EMPTY_HASH.\n if (externalHashes && externalHashes.length === 1 && externalHashes[0] === EMPTY_HASH) {\n return []; // No differences\n }\n // An empty tree has no leaves to differ, so return an empty array\n // as no specific leaf indexes are different.\n\n return [];\n }\n\n // We are interested in comparing the leaf hashes part.\n // The externalHashes array should also have its leaf hashes at the end.\n const differingLeafIndexes: number[] = [];\n // Calculate where the leaf hashes would start in the externalHashes array,\n // assuming it has the same number of leaves as this tree.\n const externalLeafHashesStart = externalHashes.length - this.numLeaves;\n\n if (externalLeafHashesStart < 0) {\n // externalHashes is too short to contain a complete set of leaf hashes\n // corresponding to this tree's numLeaves.\n // In this case, consider all of this tree's leaves as \"different\".\n for (let i = 0; i < this.numLeaves; i += 1) {\n differingLeafIndexes.push(i);\n }\n\n return differingLeafIndexes;\n }\n\n // Compare each leaf hash\n for (let i = 0; i < this.numLeaves; i += 1) {\n const ownLeafHash = this.leafHashes[i];\n // externalLeafHash might be undefined if externalHashes is shorter than expected\n // but externalLeafHashesStart was non-negative, implying a structural mismatch.\n const externalLeafHash = externalHashes[externalLeafHashesStart + i];\n if (ownLeafHash !== externalLeafHash) {\n differingLeafIndexes.push(i);\n }\n }\n\n return differingLeafIndexes;\n }\n}\n\nexport default HashTree;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAuC,SAAAE,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,OAAA,IAAAH,CAAA,CAAAI,gBAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,cAAA,CAAAL,CAAA,MAAAE,CAAA,GAAAI,2BAAA,CAAAN,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAO,MAAA,IAAAL,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAM,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAR,CAAA,CAAAO,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAb,CAAA,CAAAQ,EAAA,UAAAP,CAAA,WAAAA,EAAAD,CAAA,UAAAA,CAAA,KAAAc,CAAA,EAAAL,CAAA,gBAAAM,SAAA,iJAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,gBAAAR,CAAA,WAAAA,EAAA,IAAAR,CAA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QACA;QACA,IAAMmC,gBAAgB,GAAGJ,cAAc,CAACE,uBAAuB,GAAGjC,GAAC,CAAC;QACpE,IAAIkC,WAAW,KAAKC,gBAAgB,EAAE;UACpCH,oBAAoB,CAACtE,IAAI,CAACsC,GAAC,CAAC;QAC9B;MACF;MAEA,OAAOgC,oBAAoB;IAC7B;EAAC;AAAA;AAAA,IAAAI,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAGYJ,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_xxh","require","_constants","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","HashTree","leafData","numLeaves","_classCallCheck2","default","_defineProperty2","Error","concat","leafHashes","fill","EMPTY_HASH","leaves","map","putItems","_createClass2","key","_putItemInternal","item","put","index","id","type","existingItem","version","putItem","_this$_putItemInterna","computeLeafHash","items","_this","results","changedLeafIndexes","_set","forEach","_this$_putItemInterna2","push","add","_removeItemInternal","removed","_keys","removeItem","_this$_removeItemInte","removeItems","_this2","_this2$_removeItemInt","updateItems","itemUpdates","_this3","_ref","operation","_this3$_removeItemInt","_this3$_putItemIntern","leafContent","totalItemsCount","reduce","count","buffer","Buffer","alloc","offset","itemTypes","sort","_values","b","writeBigInt64LE","BigInt","XXH3_128","padStart","computeTreeHashes","currentLevelHashes","_toConsumableArray2","allHashes","nextLevelHashes","i","leftHash","rightHash","input","from","subarray","reverse","unshift","apply","getHashes","getRootHash","getLeafCount","getTotalItemCount","_iterator","_step","leaf","_i","_Object$keys2","err","getLeafData","leafIndex","_i2","_Object$keys3","resize","newNumLeaves","allItems","_iterator2","_step2","_i3","_Object$keys4","diffHashes","externalHashes","differingLeafIndexes","externalLeafHashesStart","ownLeafHash","externalLeafHash","_default","exports"],"sources":["hashTree.ts"],"sourcesContent":["import {XXH3_128} from 'xxh3-ts/xxh3';\nimport {EMPTY_HASH} from './constants';\nimport {ObjectType} from './types';\n\nexport type LeafDataItem = {\n type: ObjectType;\n id: number;\n version: number;\n};\n\n/**\n * HashTree is a data structure that organizes items into leaves based on their IDs,\n */\nclass HashTree {\n leaves: Array<Record<string, Record<number, LeafDataItem>>>;\n\n leafHashes: Array<string>;\n readonly numLeaves: number;\n\n /**\n * Constructs a new HashTree.\n * @param {LeafDataItem[]} leafData Initial data to populate the tree.\n * @param {number} numLeaves The number of leaf nodes in the tree. Must be 0 or a power of 2.\n * @throws {Error} If numLeaves is not 0 or a power of 2.\n */\n constructor(leafData: LeafDataItem[], numLeaves: number) {\n // eslint-disable-next-line no-bitwise\n if ((numLeaves & (numLeaves - 1)) !== 0) {\n throw new Error(`Number of leaves must be a power of 2, saw ${numLeaves}`);\n }\n\n this.numLeaves = numLeaves;\n this.leafHashes = new Array(numLeaves).fill(EMPTY_HASH);\n\n this.leaves = new Array(numLeaves).fill(null).map(() => {\n return {};\n });\n\n if (leafData) {\n this.putItems(leafData);\n }\n }\n\n /**\n * Internal logic for adding or updating an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {{put: boolean, index: (number|null)}} Object indicating if put and the leaf index.\n * @private\n */\n private _putItemInternal(item: LeafDataItem): {put: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {put: false, index: null}; // Cannot add to a tree with 0 leaves\n }\n\n const index = item.id % this.numLeaves;\n\n if (!this.leaves[index][item.type]) {\n this.leaves[index][item.type] = {};\n }\n\n const existingItem = this.leaves[index][item.type][item.id];\n\n if (!existingItem || existingItem.version < item.version) {\n this.leaves[index][item.type][item.id] = item;\n\n return {put: true, index};\n }\n\n return {put: false, index: null};\n }\n\n /**\n * Adds or updates a single item in the hash tree.\n * @param {LeafDataItem} item The item to add or update.\n * @returns {boolean} True if the item was added or updated, false otherwise (e.g., older version or tree has 0 leaves).\n */\n putItem(item: LeafDataItem): boolean {\n const {put, index} = this._putItemInternal(item);\n\n if (put && index !== null) {\n this.computeLeafHash(index);\n }\n\n return put;\n }\n\n /**\n * Adds or updates multiple items in the hash tree.\n * @param {LeafDataItem[]} items The array of items to add or update.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n putItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n // Cannot add items to a tree with 0 leaves.\n return items.map(() => false);\n }\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Internal logic for removing an item, without computing the leaf hash.\n * @param {LeafDataItem} item The item to remove.\n * @returns {{removed: boolean, index: (number|null)}} Object indicating if removed and the leaf index.\n * @private\n */\n private _removeItemInternal(item: LeafDataItem): {removed: boolean; index: number | null} {\n if (this.numLeaves === 0) {\n return {removed: false, index: null};\n }\n\n const index = item.id % this.numLeaves;\n\n if (\n this.leaves[index] &&\n this.leaves[index][item.type] &&\n this.leaves[index][item.type][item.id]\n ) {\n const existingItem = this.leaves[index][item.type][item.id];\n if (\n existingItem.id === item.id &&\n existingItem.type === item.type &&\n existingItem.version <= item.version\n ) {\n delete this.leaves[index][item.type][item.id];\n if (Object.keys(this.leaves[index][item.type]).length === 0) {\n delete this.leaves[index][item.type];\n }\n\n return {removed: true, index};\n }\n }\n\n return {removed: false, index: null};\n }\n\n /**\n * Removes a single item from the hash tree.\n * The removal is based on matching type, id, and the provided item's version\n * being greater than or equal to the existing item's version.\n * @param {LeafDataItem} item The item to remove.\n * @returns {boolean} True if the item was removed, false otherwise.\n */\n removeItem(item: LeafDataItem): boolean {\n const {removed, index} = this._removeItemInternal(item);\n\n if (removed && index !== null) {\n this.computeLeafHash(index);\n }\n\n return removed;\n }\n\n /**\n * Removes multiple items from the hash tree.\n * @param {LeafDataItem[]} items The array of items to remove.\n * @returns {boolean[]} An array of booleans indicating success for each item.\n */\n removeItems(items: LeafDataItem[]): boolean[] {\n if (this.numLeaves === 0 && items.length > 0) {\n return items.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n items.forEach((item) => {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Updates multiple items in the hash tree.\n * This method can handle both updating and removing items based on the `operation` flag.\n *\n * @param {object[]} itemUpdates An array of objects containing `operation` flag and the `item` to update.\n * @returns {boolean[]} An array of booleans indicating success for each operation.\n */\n updateItems(itemUpdates: {operation: 'update' | 'remove'; item: LeafDataItem}[]): boolean[] {\n if (this.numLeaves === 0 && itemUpdates.length > 0) {\n return itemUpdates.map(() => false);\n }\n\n const results: boolean[] = [];\n const changedLeafIndexes = new Set<number>();\n\n itemUpdates.forEach(({operation, item}) => {\n if (operation === 'remove') {\n const {removed, index} = this._removeItemInternal(item);\n results.push(removed);\n if (removed && index !== null) {\n changedLeafIndexes.add(index);\n }\n } else {\n const {put, index} = this._putItemInternal(item);\n results.push(put);\n if (put && index !== null) {\n changedLeafIndexes.add(index);\n }\n }\n });\n\n changedLeafIndexes.forEach((index) => {\n this.computeLeafHash(index);\n });\n\n return results;\n }\n\n /**\n * Computes the hash for a specific leaf.\n * The hash is based on the sorted items within the leaf.\n * @param {number} index The index of the leaf to compute the hash for.\n * @returns {void}\n */\n computeLeafHash(index: number) {\n if (index < 0 || index >= this.numLeaves) {\n // nothing to do\n return;\n }\n const leafContent = this.leaves[index];\n\n const totalItemsCount = Object.keys(leafContent).reduce((count, type) => {\n return count + Object.keys(leafContent[type]).length;\n }, 0);\n const buffer = Buffer.alloc(totalItemsCount * 16);\n\n let offset = 0;\n\n // iterate through the item types lexicographically\n const itemTypes = Object.keys(leafContent).sort();\n itemTypes.forEach((type) => {\n // iterate through the items of this type in ascending order of ID\n const items = Object.values(leafContent[type]).sort(\n (a: LeafDataItem, b: LeafDataItem) => a.id - b.id\n );\n\n // add all the items id and version to the hasher\n items.forEach((item: LeafDataItem) => {\n buffer.writeBigInt64LE(BigInt(item.id), offset);\n buffer.writeBigInt64LE(BigInt(item.version), offset + 8);\n\n offset += 16;\n });\n });\n\n this.leafHashes[index] = XXH3_128(buffer, BigInt(0)).toString(16).padStart(32, '0');\n }\n\n /**\n * Computes all internal and leaf node hashes of the tree.\n * Internal node hashes are computed bottom-up from the leaf hashes.\n * @returns {string[]} An array of hash strings, with internal node hashes first, followed by leaf hashes.\n * Returns `[EMPTY_HASH]` if the tree has 0 leaves.\n */\n computeTreeHashes(): string[] {\n if (this.numLeaves === 0) {\n return [EMPTY_HASH];\n }\n\n let currentLevelHashes = [...this.leafHashes];\n const allHashes = [];\n\n while (currentLevelHashes.length > 1) {\n const nextLevelHashes: string[] = [];\n for (let i = 0; i < currentLevelHashes.length; i += 2) {\n const leftHash = currentLevelHashes[i];\n const rightHash = i + 1 < currentLevelHashes.length ? currentLevelHashes[i + 1] : leftHash;\n\n const input = Buffer.concat([\n Buffer.from(leftHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(leftHash, 'hex').subarray(8, 16).reverse(),\n Buffer.from(rightHash, 'hex').subarray(0, 8).reverse(),\n Buffer.from(rightHash, 'hex').subarray(8, 16).reverse(),\n ]);\n\n nextLevelHashes.push(XXH3_128(input, BigInt(0)).toString(16).padStart(32, '0'));\n }\n currentLevelHashes = nextLevelHashes;\n allHashes.unshift(...currentLevelHashes);\n }\n\n return [...allHashes, ...this.leafHashes];\n }\n\n /**\n * Returns all hashes in the tree (internal nodes then leaf nodes).\n * @returns {string[]} An array of hash strings.\n */\n getHashes(): string[] {\n return this.computeTreeHashes();\n }\n\n /**\n * Computes and returns the hash value of the root node.\n * @returns {string} The root hash of the entire tree. Returns `EMPTY_HASH` if the tree has 0 leaves.\n */\n getRootHash(): string {\n if (this.numLeaves === 0) {\n return EMPTY_HASH;\n }\n\n return this.computeTreeHashes()[0];\n }\n\n /**\n * Gets the number of leaves in the tree.\n * @returns {number} The number of leaves.\n */\n getLeafCount(): number {\n return this.numLeaves;\n }\n\n /**\n * Calculates the total number of items stored in the tree.\n * @returns {number} The total number of items.\n */\n getTotalItemCount(): number {\n let count = 0;\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n count += Object.keys(leaf[type]).length;\n }\n }\n\n return count;\n }\n\n /**\n * Retrieves all data items from a specific leaf.\n * @param {number} leafIndex The index of the leaf.\n * @returns {LeafDataItem[]} An array of LeafDataItem in the specified leaf, sorted by ID,\n * or an empty array if the index is invalid or leaf is empty.\n */\n getLeafData(leafIndex: number): LeafDataItem[] {\n if (leafIndex < 0 || leafIndex >= this.numLeaves) {\n return [];\n }\n const leafContent = this.leaves[leafIndex];\n const items: LeafDataItem[] = [];\n for (const type of Object.keys(leafContent)) {\n items.push(...Object.values(leafContent[type]));\n }\n // Optionally sort them if a specific order is required, e.g., by ID\n items.sort((a, b) => a.id - b.id);\n\n return items;\n }\n\n /**\n * Resizes the HashTree to have a new number of leaf nodes, redistributing all existing items.\n * @param {number} newNumLeaves The new number of leaf nodes (must be 0 or a power of 2).\n * @returns {boolean} true if the tree was resized, false if the size didn't change.\n * @throws {Error} if newNumLeaves is not 0 or a power of 2.\n */\n resize(newNumLeaves: number): boolean {\n // eslint-disable-next-line no-bitwise\n if (newNumLeaves < 0 || (newNumLeaves !== 0 && (newNumLeaves & (newNumLeaves - 1)) !== 0)) {\n throw new Error('New number of leaves must be 0 or a power of 2');\n }\n\n if (newNumLeaves === this.numLeaves) {\n return false;\n }\n\n const allItems: LeafDataItem[] = [];\n for (const leaf of this.leaves) {\n for (const type of Object.keys(leaf)) {\n allItems.push(...Object.values(leaf[type]));\n }\n }\n\n // Re-initialize\n // eslint-disable-next-line no-extra-semi\n (this as any).numLeaves = newNumLeaves; // Type assertion to update readonly property\n this.leafHashes = new Array(newNumLeaves).fill(EMPTY_HASH);\n this.leaves = new Array(newNumLeaves).fill(null).map(() => ({}));\n\n if (newNumLeaves > 0) {\n this.putItems(allItems); // Re-add items which will be re-assigned to leaves and re-hashed\n }\n\n return true;\n }\n\n /**\n * Compares the tree's leaf hashes with an external set of hashes and returns the indices of differing leaf nodes.\n * The externalHashes array is expected to contain all node hashes (internal followed by leaves),\n * similar to the output of getHashes().\n * @param {string[]} externalHashes An array of hash strings (internal node hashes then leaf hashes).\n * @returns {number[]} An array of indices of the leaf nodes that have different hashes.\n */\n diffHashes(externalHashes: string[]): number[] {\n if (this.numLeaves === 0) {\n // If this tree is empty, its hash is EMPTY_HASH.\n // It differs if externalHashes is not a single EMPTY_HASH.\n if (externalHashes && externalHashes.length === 1 && externalHashes[0] === EMPTY_HASH) {\n return []; // No differences\n }\n // An empty tree has no leaves to differ, so return an empty array\n // as no specific leaf indexes are different.\n\n return [];\n }\n\n // We are interested in comparing the leaf hashes part.\n // The externalHashes array should also have its leaf hashes at the end.\n const differingLeafIndexes: number[] = [];\n // Calculate where the leaf hashes would start in the externalHashes array,\n // assuming it has the same number of leaves as this tree.\n const externalLeafHashesStart = externalHashes.length - this.numLeaves;\n\n if (externalLeafHashesStart < 0) {\n // externalHashes is too short to contain a complete set of leaf hashes\n // corresponding to this tree's numLeaves.\n // In this case, consider all of this tree's leaves as \"different\".\n for (let i = 0; i < this.numLeaves; i += 1) {\n differingLeafIndexes.push(i);\n }\n\n return differingLeafIndexes;\n }\n\n // Compare each leaf hash\n for (let i = 0; i < this.numLeaves; i += 1) {\n const ownLeafHash = this.leafHashes[i];\n // externalLeafHash might be undefined if externalHashes is shorter than expected\n // but externalLeafHashesStart was non-negative, implying a structural mismatch.\n const externalLeafHash = externalHashes[externalLeafHashesStart + i];\n if (ownLeafHash !== externalLeafHash) {\n differingLeafIndexes.push(i);\n }\n }\n\n return differingLeafIndexes;\n }\n}\n\nexport default HashTree;\n"],"mappings":";;;;;;;;;;;;;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,CAAC9H,MAAM,KAAK,CAAC,IAAI8H,cAAc,CAAC,CAAC,CAAC,KAAK7F,qBAAU,EAAE;UACrF,OAAO,EAAE,CAAC,CAAC;QACb;QACA;QACA;;QAEA,OAAO,EAAE;MACX;;MAEA;MACA;MACA,IAAM8F,oBAA8B,GAAG,EAAE;MACzC;MACA;MACA,IAAMC,uBAAuB,GAAGF,cAAc,CAAC9H,MAAM,GAAG,IAAI,CAACyB,SAAS;MAEtE,IAAIuG,uBAAuB,GAAG,CAAC,EAAE;QAC/B;QACA;QACA;QACA,KAAK,IAAIjC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,IAAI,CAACtE,SAAS,EAAEsE,CAAC,IAAI,CAAC,EAAE;UAC1CgC,oBAAoB,CAACtE,IAAI,CAACsC,CAAC,CAAC;QAC9B;QAEA,OAAOgC,oBAAoB;MAC7B;;MAEA;MACA,KAAK,IAAIhC,GAAC,GAAG,CAAC,EAAEA,GAAC,GAAG,IAAI,CAACtE,SAAS,EAAEsE,GAAC,IAAI,CAAC,EAAE;QAC1C,IAAMkC,WAAW,GAAG,IAAI,CAAClG,UAAU,CAACgE,GAAC,CAAC;QACtC;QACA;QACA,IAAMmC,gBAAgB,GAAGJ,cAAc,CAACE,uBAAuB,GAAGjC,GAAC,CAAC;QACpE,IAAIkC,WAAW,KAAKC,gBAAgB,EAAE;UACpCH,oBAAoB,CAACtE,IAAI,CAACsC,GAAC,CAAC;QAC9B;MACF;MAEA,OAAOgC,oBAAoB;IAC7B;EAAC;AAAA;AAAA,IAAAI,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAGYJ,QAAQ","ignoreList":[]}
|
package/dist/hashTree/types.js
CHANGED
|
@@ -14,8 +14,9 @@ var ObjectType = exports.ObjectType = {
|
|
|
14
14
|
locus: 'locus',
|
|
15
15
|
mediaShare: 'mediashare',
|
|
16
16
|
info: 'info',
|
|
17
|
-
fullState: 'fullstate'
|
|
17
|
+
fullState: 'fullstate',
|
|
18
|
+
links: 'links'
|
|
18
19
|
};
|
|
19
20
|
// mapping from ObjectType to top level LocusDTO keys
|
|
20
|
-
var ObjectTypeToLocusKeyMap = exports.ObjectTypeToLocusKeyMap = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ObjectType.info, 'info'), ObjectType.fullState, 'fullState'), ObjectType.self, 'self'), ObjectType.participant, 'participants'), ObjectType.mediaShare, 'mediaShares');
|
|
21
|
+
var ObjectTypeToLocusKeyMap = exports.ObjectTypeToLocusKeyMap = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ObjectType.links, 'links'), ObjectType.info, 'info'), ObjectType.fullState, 'fullState'), ObjectType.self, 'self'), ObjectType.participant, 'participants'), ObjectType.mediaShare, 'mediaShares');
|
|
21
22
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ObjectType","exports","participant","self","locus","mediaShare","info","fullState","ObjectTypeToLocusKeyMap","_defineProperty2","default"],"sources":["types.ts"],"sourcesContent":["import {Enum} from '../constants';\n\n// todo: Locus docs have now more types like CONTROL_ENTRY, EMBEDDED_APP - need to add support for them once Locus implements them\nexport const ObjectType = {\n participant: 'participant',\n self: 'self',\n locus: 'locus',\n mediaShare: 'mediashare',\n info: 'info',\n fullState: 'fullstate',\n} as const;\n\nexport type ObjectType = Enum<typeof ObjectType>;\n\n// mapping from ObjectType to top level LocusDTO keys\nexport const ObjectTypeToLocusKeyMap = {\n [ObjectType.info]: 'info',\n [ObjectType.fullState]: 'fullState',\n [ObjectType.self]: 'self',\n [ObjectType.participant]: 'participants', // note: each object is a single participant in participants array\n [ObjectType.mediaShare]: 'mediaShares', // note: each object is a single mediaShare in mediaShares array\n};\nexport interface HtMeta {\n elementId: {\n type: ObjectType;\n id: number;\n version: number;\n };\n dataSetNames: string[];\n}\n"],"mappings":";;;;;;;;;AAEA;AACO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,WAAW,EAAE,aAAa;EAC1BC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,UAAU,EAAE,YAAY;EACxBC,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE;
|
|
1
|
+
{"version":3,"names":["ObjectType","exports","participant","self","locus","mediaShare","info","fullState","links","ObjectTypeToLocusKeyMap","_defineProperty2","default"],"sources":["types.ts"],"sourcesContent":["import {Enum} from '../constants';\n\n// todo: Locus docs have now more types like CONTROL_ENTRY, EMBEDDED_APP - need to add support for them once Locus implements them\nexport const ObjectType = {\n participant: 'participant',\n self: 'self',\n locus: 'locus',\n mediaShare: 'mediashare',\n info: 'info',\n fullState: 'fullstate',\n links: 'links',\n} as const;\n\nexport type ObjectType = Enum<typeof ObjectType>;\n\n// mapping from ObjectType to top level LocusDTO keys\nexport const ObjectTypeToLocusKeyMap = {\n [ObjectType.links]: 'links',\n [ObjectType.info]: 'info',\n [ObjectType.fullState]: 'fullState',\n [ObjectType.self]: 'self',\n [ObjectType.participant]: 'participants', // note: each object is a single participant in participants array\n [ObjectType.mediaShare]: 'mediaShares', // note: each object is a single mediaShare in mediaShares array\n};\nexport interface HtMeta {\n elementId: {\n type: ObjectType;\n id: number;\n version: number;\n };\n dataSetNames: string[];\n}\n"],"mappings":";;;;;;;;;AAEA;AACO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,WAAW,EAAE,aAAa;EAC1BC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,UAAU,EAAE,YAAY;EACxBC,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE,WAAW;EACtBC,KAAK,EAAE;AACT,CAAU;AAIV;AACO,IAAMC,uBAAuB,GAAAR,OAAA,CAAAQ,uBAAA,OAAAC,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MAAAD,gBAAA,CAAAC,OAAA,MACjCX,UAAU,CAACQ,KAAK,EAAG,OAAO,GAC1BR,UAAU,CAACM,IAAI,EAAG,MAAM,GACxBN,UAAU,CAACO,SAAS,EAAG,WAAW,GAClCP,UAAU,CAACG,IAAI,EAAG,MAAM,GACxBH,UAAU,CAACE,WAAW,EAAG,cAAc,GACvCF,UAAU,CAACK,UAAU,EAAG,aAAa,CACvC","ignoreList":[]}
|
|
@@ -372,7 +372,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
372
372
|
throw error;
|
|
373
373
|
});
|
|
374
374
|
},
|
|
375
|
-
version: "3.10.0-webex-services-ready.
|
|
375
|
+
version: "3.10.0-webex-services-ready.3"
|
|
376
376
|
});
|
|
377
377
|
var _default = exports.default = SimultaneousInterpretation;
|
|
378
378
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
|
|
|
18
18
|
languageCode: 'number',
|
|
19
19
|
languageName: 'string'
|
|
20
20
|
},
|
|
21
|
-
version: "3.10.0-webex-services-ready.
|
|
21
|
+
version: "3.10.0-webex-services-ready.3"
|
|
22
22
|
});
|
|
23
23
|
var _default = exports.default = SILanguage;
|
|
24
24
|
//# sourceMappingURL=siLanguage.js.map
|
package/dist/locus-info/index.js
CHANGED
|
@@ -92,10 +92,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
92
92
|
(0, _defineProperty2.default)(_this, "aclUrl", void 0);
|
|
93
93
|
(0, _defineProperty2.default)(_this, "baseSequence", void 0);
|
|
94
94
|
(0, _defineProperty2.default)(_this, "created", void 0);
|
|
95
|
-
(0, _defineProperty2.default)(_this, "identities", void 0);
|
|
96
|
-
(0, _defineProperty2.default)(_this, "membership", void 0);
|
|
97
95
|
(0, _defineProperty2.default)(_this, "participants", void 0);
|
|
98
|
-
(0, _defineProperty2.default)(_this, "participantsUrl", void 0);
|
|
99
96
|
(0, _defineProperty2.default)(_this, "replaces", void 0);
|
|
100
97
|
(0, _defineProperty2.default)(_this, "scheduledMeeting", void 0);
|
|
101
98
|
(0, _defineProperty2.default)(_this, "sequence", void 0);
|
|
@@ -107,10 +104,8 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
107
104
|
(0, _defineProperty2.default)(_this, "info", void 0);
|
|
108
105
|
(0, _defineProperty2.default)(_this, "roles", void 0);
|
|
109
106
|
(0, _defineProperty2.default)(_this, "mediaShares", void 0);
|
|
110
|
-
(0, _defineProperty2.default)(_this, "replace", void 0);
|
|
111
107
|
(0, _defineProperty2.default)(_this, "url", void 0);
|
|
112
|
-
(0, _defineProperty2.default)(_this, "
|
|
113
|
-
(0, _defineProperty2.default)(_this, "resources", void 0);
|
|
108
|
+
(0, _defineProperty2.default)(_this, "links", void 0);
|
|
114
109
|
(0, _defineProperty2.default)(_this, "mainSessionLocusCache", void 0);
|
|
115
110
|
(0, _defineProperty2.default)(_this, "self", void 0);
|
|
116
111
|
(0, _defineProperty2.default)(_this, "hashTreeParser", void 0);
|
|
@@ -299,17 +294,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
299
294
|
}, {
|
|
300
295
|
key: "init",
|
|
301
296
|
value: function init() {
|
|
302
|
-
var _locus$links, _locus$links2;
|
|
303
297
|
var locus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
304
298
|
this.created = locus.created || null;
|
|
305
299
|
this.scheduledMeeting = locus.meeting || null;
|
|
306
|
-
this.participantsUrl = locus.participantsUrl || null;
|
|
307
300
|
this.replaces = locus.replaces || null;
|
|
308
301
|
this.aclUrl = locus.aclUrl || null;
|
|
309
302
|
this.baseSequence = locus.baseSequence || null;
|
|
310
303
|
this.sequence = locus.sequence || null;
|
|
311
|
-
this.membership = locus.membership || null;
|
|
312
|
-
this.identities = locus.identities || null;
|
|
313
304
|
this.participants = locus.participants || null;
|
|
314
305
|
|
|
315
306
|
/**
|
|
@@ -335,8 +326,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
335
326
|
this.updateSelf(locus.self);
|
|
336
327
|
this.updateHostInfo(locus.host);
|
|
337
328
|
this.updateMediaShares(locus.mediaShares);
|
|
338
|
-
this.
|
|
339
|
-
this.updateResources((_locus$links2 = locus.links) === null || _locus$links2 === void 0 ? void 0 : _locus$links2.resources);
|
|
329
|
+
this.updateLinks(locus.links);
|
|
340
330
|
}
|
|
341
331
|
|
|
342
332
|
/**
|
|
@@ -499,7 +489,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
499
489
|
}, {
|
|
500
490
|
key: "updateLocusFromHashTreeObject",
|
|
501
491
|
value: function updateLocusFromHashTreeObject(object, locus) {
|
|
492
|
+
var _this4 = this;
|
|
502
493
|
var type = object.htMeta.elementId.type.toLowerCase();
|
|
494
|
+
var addParticipantObject = function addParticipantObject(obj) {
|
|
495
|
+
if (!locus.participants) {
|
|
496
|
+
locus.participants = [];
|
|
497
|
+
}
|
|
498
|
+
locus.participants.push(obj.data);
|
|
499
|
+
_this4.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
|
|
500
|
+
};
|
|
503
501
|
switch (type) {
|
|
504
502
|
case _types.ObjectType.locus:
|
|
505
503
|
{
|
|
@@ -546,13 +544,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
546
544
|
case _types.ObjectType.participant:
|
|
547
545
|
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> participant id=".concat(object.htMeta.elementId.id, " ").concat(object.data ? 'updated' : 'removed', " version=").concat(object.htMeta.elementId.version));
|
|
548
546
|
if (object.data) {
|
|
549
|
-
|
|
550
|
-
locus.participants = [];
|
|
551
|
-
}
|
|
552
|
-
var participantObject = object.data;
|
|
553
|
-
participantObject.htMeta = object.htMeta;
|
|
554
|
-
locus.participants.push(participantObject);
|
|
555
|
-
this.hashTreeObjectId2ParticipantId.set(object.htMeta.elementId.id, participantObject.id);
|
|
547
|
+
addParticipantObject(object);
|
|
556
548
|
} else {
|
|
557
549
|
var participantId = this.hashTreeObjectId2ParticipantId.get(object.htMeta.elementId.id);
|
|
558
550
|
if (!locus.jsSdkMeta) {
|
|
@@ -564,17 +556,31 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
564
556
|
this.hashTreeObjectId2ParticipantId.delete(object.htMeta.elementId.id);
|
|
565
557
|
}
|
|
566
558
|
break;
|
|
559
|
+
case _types.ObjectType.links:
|
|
567
560
|
case _types.ObjectType.info:
|
|
568
561
|
case _types.ObjectType.fullState:
|
|
569
562
|
case _types.ObjectType.self:
|
|
570
563
|
if (!object.data) {
|
|
571
564
|
// self without data is handled inside HashTreeParser and results in LocusInfoUpdateType.MEETING_ENDED, so we should never get here
|
|
572
|
-
// other types
|
|
565
|
+
// all other types info, fullstate, etc - Locus should never send them without data
|
|
573
566
|
_loggerProxy.default.logger.warn("Locus-info:index#updateLocusFromHashTreeObject --> received ".concat(type, " object without data, this is not expected! version=").concat(object.htMeta.elementId.version));
|
|
574
567
|
} else {
|
|
568
|
+
var _locus$info, _object$data$controls, _object$data$controls2, _object$data$controls3;
|
|
575
569
|
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> ".concat(type, " object updated to version ").concat(object.htMeta.elementId.version));
|
|
576
570
|
var locusDtoKey = _types.ObjectTypeToLocusKeyMap[type];
|
|
577
571
|
locus[locusDtoKey] = object.data;
|
|
572
|
+
|
|
573
|
+
/* Hash tree based webinar attendees don't receive a Participant object for themselves from Locus,
|
|
574
|
+
but a lot of existing code in SDK and web app expects a member object for self to exist,
|
|
575
|
+
so whenever SELF changes for a webinar attendee, we copy it into a participant object.
|
|
576
|
+
We can do it, because SELF has always all the same properties as a participant object.
|
|
577
|
+
*/
|
|
578
|
+
if (type === _types.ObjectType.self && (_locus$info = locus.info) !== null && _locus$info !== void 0 && _locus$info.isWebinar && (_object$data$controls = object.data.controls) !== null && _object$data$controls !== void 0 && (_object$data$controls2 = _object$data$controls.role) !== null && _object$data$controls2 !== void 0 && (_object$data$controls3 = _object$data$controls2.roles) !== null && _object$data$controls3 !== void 0 && _object$data$controls3.find(function (r) {
|
|
579
|
+
return r.type === _constants.SELF_ROLES.ATTENDEE && r.hasRole;
|
|
580
|
+
})) {
|
|
581
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> webinar attendee: creating participant object from self");
|
|
582
|
+
addParticipantObject(object);
|
|
583
|
+
}
|
|
578
584
|
}
|
|
579
585
|
break;
|
|
580
586
|
default:
|
|
@@ -635,7 +641,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
635
641
|
}, {
|
|
636
642
|
key: "updateFromHashTree",
|
|
637
643
|
value: function updateFromHashTree(updateType, data) {
|
|
638
|
-
var
|
|
644
|
+
var _this5 = this;
|
|
639
645
|
switch (updateType) {
|
|
640
646
|
case _hashTreeParser.LocusInfoUpdateType.OBJECTS_UPDATED:
|
|
641
647
|
{
|
|
@@ -658,7 +664,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
658
664
|
// but these should never happen
|
|
659
665
|
_loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> received multiple LOCUS objects in one update, this is unexpected!");
|
|
660
666
|
_metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_HASH_TREE_UNSUPPORTED_OPERATION, {
|
|
661
|
-
locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) ||
|
|
667
|
+
locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this5.url,
|
|
662
668
|
message: object.data ? 'multiple LOCUS object updates' : 'LOCUS object update followed by removal'
|
|
663
669
|
});
|
|
664
670
|
}
|
|
@@ -679,7 +685,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
679
685
|
// copy over all of existing locus except participants
|
|
680
686
|
LocusDtoTopLevelKeys.forEach(function (key) {
|
|
681
687
|
if (key !== 'participants') {
|
|
682
|
-
locus[key] = (0, _lodash.cloneDeep)(
|
|
688
|
+
locus[key] = (0, _lodash.cloneDeep)(_this5[key]);
|
|
683
689
|
}
|
|
684
690
|
});
|
|
685
691
|
} else {
|
|
@@ -687,7 +693,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
687
693
|
// (except participants, which need to stay empty - that means "no participant changes")
|
|
688
694
|
(0, _values.default)(_types.ObjectTypeToLocusKeyMap).forEach(function (locusDtoKey) {
|
|
689
695
|
if (locusDtoKey !== 'participants') {
|
|
690
|
-
locus[locusDtoKey] = (0, _lodash.cloneDeep)(
|
|
696
|
+
locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this5[locusDtoKey]);
|
|
691
697
|
}
|
|
692
698
|
});
|
|
693
699
|
}
|
|
@@ -700,7 +706,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
700
706
|
}))));
|
|
701
707
|
// now apply all the updates from the hash tree onto the locus
|
|
702
708
|
data.updatedObjects.forEach(function (object) {
|
|
703
|
-
locus =
|
|
709
|
+
locus = _this5.updateLocusFromHashTreeObject(object, locus);
|
|
704
710
|
});
|
|
705
711
|
|
|
706
712
|
// update our locus info with the new locus
|
|
@@ -861,7 +867,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
861
867
|
key: "onFullLocusCommon",
|
|
862
868
|
value: function onFullLocusCommon(locus, eventType) {
|
|
863
869
|
var _this$participants,
|
|
864
|
-
|
|
870
|
+
_this6 = this,
|
|
865
871
|
_locus$jsSdkMeta;
|
|
866
872
|
this.scheduledMeeting = locus.meeting || null;
|
|
867
873
|
this.participants = locus.participants;
|
|
@@ -869,7 +875,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
869
875
|
var _participant$htMeta;
|
|
870
876
|
// participant.htMeta is set only for hash tree based locus
|
|
871
877
|
if ((_participant$htMeta = participant.htMeta) !== null && _participant$htMeta !== void 0 && _participant$htMeta.elementId.id) {
|
|
872
|
-
|
|
878
|
+
_this6.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
|
|
873
879
|
}
|
|
874
880
|
});
|
|
875
881
|
var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
|
|
@@ -942,7 +948,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
942
948
|
}, {
|
|
943
949
|
key: "updateLocusInfo",
|
|
944
950
|
value: function updateLocusInfo(locus) {
|
|
945
|
-
var _locus$self, _locus$self2
|
|
951
|
+
var _locus$self, _locus$self2;
|
|
946
952
|
if (((_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.reason) === 'MOVED' && ((_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.state) === 'LEFT') {
|
|
947
953
|
// When moved to a breakout session locus sends a message for the previous locus
|
|
948
954
|
// indicating that we have been moved. It isn't helpful to continue parsing this
|
|
@@ -957,17 +963,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
957
963
|
this.updateLocusUrl(locus.url, _controlsUtils.default.isMainSessionDTO(locus));
|
|
958
964
|
this.updateMeetingInfo(locus.info, locus.self);
|
|
959
965
|
this.updateMediaShares(locus.mediaShares);
|
|
960
|
-
this.
|
|
961
|
-
this.updateReplace(locus.replace);
|
|
966
|
+
this.updateReplaces(locus.replaces);
|
|
962
967
|
this.updateSelf(locus.self);
|
|
963
968
|
this.updateAclUrl(locus.aclUrl);
|
|
964
969
|
this.updateBasequence(locus.baseSequence);
|
|
965
970
|
this.updateSequence(locus.sequence);
|
|
966
|
-
this.updateMemberShip(locus.membership);
|
|
967
|
-
this.updateIdentifiers(locus.identities);
|
|
968
971
|
this.updateEmbeddedApps(locus.embeddedApps);
|
|
969
|
-
this.
|
|
970
|
-
this.updateResources((_locus$links4 = locus.links) === null || _locus$links4 === void 0 ? void 0 : _locus$links4.resources);
|
|
972
|
+
this.updateLinks(locus.links);
|
|
971
973
|
this.compareAndUpdate();
|
|
972
974
|
// update which required to compare different objects from locus
|
|
973
975
|
}
|
|
@@ -1516,41 +1518,35 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1516
1518
|
}
|
|
1517
1519
|
|
|
1518
1520
|
/**
|
|
1519
|
-
*
|
|
1521
|
+
* Updates links and emits appropriate events if services or resources have changed
|
|
1522
|
+
* @param {Object} links
|
|
1520
1523
|
* @returns {undefined}
|
|
1521
1524
|
* @memberof LocusInfo
|
|
1522
1525
|
*/
|
|
1523
1526
|
}, {
|
|
1524
|
-
key: "
|
|
1525
|
-
value: function
|
|
1526
|
-
|
|
1527
|
-
|
|
1527
|
+
key: "updateLinks",
|
|
1528
|
+
value: function updateLinks(links) {
|
|
1529
|
+
var _this$links, _this$links2;
|
|
1530
|
+
var _ref2 = links || {},
|
|
1531
|
+
services = _ref2.services,
|
|
1532
|
+
resources = _ref2.resources;
|
|
1533
|
+
if (services && !(0, _lodash.isEqual)((_this$links = this.links) === null || _this$links === void 0 ? void 0 : _this$links.services, services)) {
|
|
1528
1534
|
this.emitScoped({
|
|
1529
1535
|
file: 'locus-info',
|
|
1530
|
-
function: '
|
|
1536
|
+
function: 'updateLinks'
|
|
1531
1537
|
}, _constants.LOCUSINFO.EVENTS.LINKS_SERVICES, {
|
|
1532
1538
|
services: services
|
|
1533
1539
|
});
|
|
1534
1540
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
/**
|
|
1538
|
-
* @param {Object} resources
|
|
1539
|
-
* @returns {undefined}
|
|
1540
|
-
* @memberof LocusInfo
|
|
1541
|
-
*/
|
|
1542
|
-
}, {
|
|
1543
|
-
key: "updateResources",
|
|
1544
|
-
value: function updateResources(resources) {
|
|
1545
|
-
if (resources && !(0, _lodash.isEqual)(this.resources, resources)) {
|
|
1546
|
-
this.resources = resources;
|
|
1541
|
+
if (resources && !(0, _lodash.isEqual)((_this$links2 = this.links) === null || _this$links2 === void 0 ? void 0 : _this$links2.resources, resources)) {
|
|
1547
1542
|
this.emitScoped({
|
|
1548
1543
|
file: 'locus-info',
|
|
1549
|
-
function: '
|
|
1544
|
+
function: 'updateLinks'
|
|
1550
1545
|
}, _constants.LOCUSINFO.EVENTS.LINKS_RESOURCES, {
|
|
1551
1546
|
resources: resources
|
|
1552
1547
|
});
|
|
1553
1548
|
}
|
|
1549
|
+
this.links = links;
|
|
1554
1550
|
}
|
|
1555
1551
|
|
|
1556
1552
|
/**
|
|
@@ -1708,28 +1704,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1708
1704
|
}
|
|
1709
1705
|
|
|
1710
1706
|
/**
|
|
1711
|
-
* @param {
|
|
1707
|
+
* @param {Object} replaces
|
|
1712
1708
|
* @returns {undefined}
|
|
1713
1709
|
* @memberof LocusInfo
|
|
1714
1710
|
*/
|
|
1715
1711
|
}, {
|
|
1716
|
-
key: "
|
|
1717
|
-
value: function
|
|
1718
|
-
if (
|
|
1719
|
-
this.
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
/**
|
|
1724
|
-
* @param {Object} replace
|
|
1725
|
-
* @returns {undefined}
|
|
1726
|
-
* @memberof LocusInfo
|
|
1727
|
-
*/
|
|
1728
|
-
}, {
|
|
1729
|
-
key: "updateReplace",
|
|
1730
|
-
value: function updateReplace(replace) {
|
|
1731
|
-
if (replace && !(0, _lodash.isEqual)(this.replace, replace)) {
|
|
1732
|
-
this.replace = replace;
|
|
1712
|
+
key: "updateReplaces",
|
|
1713
|
+
value: function updateReplaces(replaces) {
|
|
1714
|
+
if (replaces && !(0, _lodash.isEqual)(this.replaces, replaces)) {
|
|
1715
|
+
this.replaces = replaces;
|
|
1733
1716
|
}
|
|
1734
1717
|
}
|
|
1735
1718
|
|
|
@@ -1988,32 +1971,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1988
1971
|
}
|
|
1989
1972
|
}
|
|
1990
1973
|
|
|
1991
|
-
/**
|
|
1992
|
-
* @param {Object} membership
|
|
1993
|
-
* @returns {undefined}
|
|
1994
|
-
* @memberof LocusInfo
|
|
1995
|
-
*/
|
|
1996
|
-
}, {
|
|
1997
|
-
key: "updateMemberShip",
|
|
1998
|
-
value: function updateMemberShip(membership) {
|
|
1999
|
-
if (membership && !(0, _lodash.isEqual)(this.membership, membership)) {
|
|
2000
|
-
this.membership = membership;
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
/**
|
|
2005
|
-
* @param {Array} identities
|
|
2006
|
-
* @returns {undefined}
|
|
2007
|
-
* @memberof LocusInfo
|
|
2008
|
-
*/
|
|
2009
|
-
}, {
|
|
2010
|
-
key: "updateIdentifiers",
|
|
2011
|
-
value: function updateIdentifiers(identities) {
|
|
2012
|
-
if (identities && !(0, _lodash.isEqual)(this.identities, identities)) {
|
|
2013
|
-
this.identities = identities;
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
1974
|
/**
|
|
2018
1975
|
* check the locus is main session's one or not, if is main session's, update main session cache
|
|
2019
1976
|
* @param {Object} locus
|
|
@@ -2091,7 +2048,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2091
2048
|
}, {
|
|
2092
2049
|
key: "updateMainSessionLocusCache",
|
|
2093
2050
|
value: function updateMainSessionLocusCache(mainLocus) {
|
|
2094
|
-
var
|
|
2051
|
+
var _this7 = this;
|
|
2095
2052
|
if (!mainLocus) {
|
|
2096
2053
|
return;
|
|
2097
2054
|
}
|
|
@@ -2100,7 +2057,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2100
2057
|
// shallow merge and do special merge for participants
|
|
2101
2058
|
(0, _lodash.assignWith)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
|
|
2102
2059
|
if (key === 'participants') {
|
|
2103
|
-
return
|
|
2060
|
+
return _this7.mergeParticipants(objValue, srcValue);
|
|
2104
2061
|
}
|
|
2105
2062
|
return srcValue || objValue;
|
|
2106
2063
|
});
|