@webex/plugin-meetings 3.12.0-next.10 → 3.12.0-next.11

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.
@@ -511,7 +511,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
511
511
  }, {
512
512
  key: "createHashTreeParser",
513
513
  value: function createHashTreeParser(_ref) {
514
- var _this$webex$config$me;
514
+ var _locusUrl$split, _locusUrl$split$pop, _this$webex$config$me;
515
515
  var locusUrl = _ref.locusUrl,
516
516
  initialLocus = _ref.initialLocus,
517
517
  metadata = _ref.metadata,
@@ -521,7 +521,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
521
521
  metadata: metadata,
522
522
  webexRequest: this.webex.request.bind(this.webex),
523
523
  locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
524
- debugId: "HT-".concat(locusUrl.split('/').pop().substring(0, 4)),
524
+ debugId: "HT-".concat((_locusUrl$split = locusUrl.split('/')) === null || _locusUrl$split === void 0 ? void 0 : (_locusUrl$split$pop = _locusUrl$split.pop()) === null || _locusUrl$split$pop === void 0 ? void 0 : _locusUrl$split$pop.substring(0, 4)),
525
525
  excludedDataSets: (_this$webex$config$me = this.webex.config.meetings.locus) === null || _this$webex$config$me === void 0 ? void 0 : _this$webex$config$me.excludedDataSets
526
526
  });
527
527
 
@@ -903,7 +903,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
903
903
  var metadata = (_message$locusStateEl5 = message.locusStateElements) === null || _message$locusStateEl5 === void 0 ? void 0 : _message$locusStateEl5.find(function (el) {
904
904
  return (0, _utils.isMetadata)(el);
905
905
  });
906
- if ((metadata === null || metadata === void 0 ? void 0 : (_metadata$data = metadata.data) === null || _metadata$data === void 0 ? void 0 : (_metadata$data$visibl = _metadata$data.visibleDataSets) === null || _metadata$data$visibl === void 0 ? void 0 : _metadata$data$visibl.length) > 0) {
906
+ if (metadata && ((_metadata$data = metadata.data) === null || _metadata$data === void 0 ? void 0 : (_metadata$data$visibl = _metadata$data.visibleDataSets) === null || _metadata$data$visibl === void 0 ? void 0 : _metadata$data$visibl.length) > 0) {
907
907
  _loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> no hash tree parser found for locusUrl ".concat(message.locusUrl, ", creating a new one"));
908
908
  var parser = this.createHashTreeParser({
909
909
  locusUrl: message.locusUrl,
@@ -970,7 +970,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
970
970
  return;
971
971
  }
972
972
  var entry = this.hashTreeParsers.get(message.locusUrl);
973
- entry.parser.handleMessage(message);
973
+
974
+ // the check is just for typescript, the case of no entry in hashTreeParsers is handled in handleHashTreeParserSwitch() above
975
+ if (entry) {
976
+ entry.parser.handleMessage(message);
977
+ }
974
978
  }
975
979
 
976
980
  /**
@@ -978,15 +982,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
978
982
  * Updates our locus info based on the data parsed by the hash tree parser.
979
983
  *
980
984
  * @param {string} locusUrl - the locus URL for which the update is received
981
- * @param {LocusInfoUpdateType} updateType - The type of update received.
982
- * @param {Object} [data] - Additional data for the update, if applicable.
985
+ * @param {LocusInfoUpdate} update - Details about the update.
983
986
  * @returns {void}
984
987
  */
985
988
  }, {
986
989
  key: "updateFromHashTree",
987
- value: function updateFromHashTree(locusUrl, updateType, data) {
990
+ value: function updateFromHashTree(locusUrl, update) {
988
991
  var _this5 = this;
989
- switch (updateType) {
992
+ switch (update.updateType) {
990
993
  case _hashTreeParser2.LocusInfoUpdateType.OBJECTS_UPDATED:
991
994
  {
992
995
  // initialize our new locus
@@ -1000,7 +1003,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1000
1003
 
1001
1004
  // first go over all the updates and check what happens with the main locus object
1002
1005
  var locusObjectStateAfterUpdates = LocusObjectStateAfterUpdates.unchanged;
1003
- data.updatedObjects.forEach(function (object) {
1006
+ update.updatedObjects.forEach(function (object) {
1004
1007
  if (object.htMeta.elementId.type.toLowerCase() === _types.ObjectType.locus) {
1005
1008
  if (locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.updated) {
1006
1009
  var _object$data;
@@ -1021,12 +1024,17 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1021
1024
  }
1022
1025
  });
1023
1026
  var hashTreeParserEntry = this.hashTreeParsers.get(locusUrl);
1027
+ if (!hashTreeParserEntry) {
1028
+ _loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> no HashTreeParser found for locusUrl ".concat(locusUrl, " when trying to apply updates from hash tree"));
1029
+ return;
1030
+ }
1024
1031
  if (!hashTreeParserEntry.initializedFromHashTree) {
1025
1032
  // this is the first time we're getting an update for this locusUrl,
1026
1033
  // so it's probably a move to/from breakout. We need to start from a clean state,
1027
1034
  // so empty locus and we rely on Locus giving us sufficient data in the updates to populate it.
1028
1035
  _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> first INITIAL update for locusUrl ".concat(locusUrl, ", starting from empty state"));
1029
1036
  hashTreeParserEntry.initializedFromHashTree = true;
1037
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1030
1038
  locus.jsSdkMeta.forceReplaceMembers = true;
1031
1039
  } else if (
1032
1040
  // if Locus object is unchanged or removed, we need to keep using the existing locus
@@ -1050,7 +1058,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1050
1058
  }
1051
1059
  });
1052
1060
  }
1053
- _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> LOCUS object is ".concat(locusObjectStateAfterUpdates, ", all updates: ").concat((0, _stringify.default)(data.updatedObjects.map(function (o) {
1061
+ _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> LOCUS object is ".concat(locusObjectStateAfterUpdates, ", all updates: ").concat((0, _stringify.default)(update.updatedObjects.map(function (o) {
1054
1062
  return {
1055
1063
  type: o.htMeta.elementId.type,
1056
1064
  id: o.htMeta.elementId.id,
@@ -1058,7 +1066,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1058
1066
  };
1059
1067
  }))));
1060
1068
  // now apply all the updates from the hash tree onto the locus
1061
- data.updatedObjects.forEach(function (object) {
1069
+ update.updatedObjects.forEach(function (object) {
1062
1070
  locus = _this5.updateLocusFromHashTreeObject(object, locus);
1063
1071
  });
1064
1072
 
@@ -1148,13 +1156,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1148
1156
  * @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
1149
1157
  * @param {object} locus locus object
1150
1158
  * @param {object} metadata locus hash trees metadata
1151
- * @param {string} eventType locus event
1152
1159
  * @param {DataSet[]} dataSets
1160
+ * @param {string} eventType locus event
1153
1161
  * @returns {void}
1154
1162
  */
1155
1163
  }, {
1156
1164
  key: "onFullLocusWithHashTrees",
1157
- value: function onFullLocusWithHashTrees(debugText, locus, metadata, eventType, dataSets) {
1165
+ value: function onFullLocusWithHashTrees(debugText, locus, metadata, dataSets, eventType) {
1158
1166
  if (!this.hashTreeParsers.has(locus.url)) {
1159
1167
  _loggerProxy.default.logger.info("Locus-info:index#onFullLocus (".concat(debugText, ") --> creating hash tree parser for locusUrl=").concat(locus.url));
1160
1168
  _loggerProxy.default.logger.info("Locus-info:index#onFullLocus (".concat(debugText, ") --> dataSets:"), dataSets, ' and locus:', locus, ' and metadata:', metadata);
@@ -1167,6 +1175,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1167
1175
  metadata: metadata
1168
1176
  });
1169
1177
  // we have a full locus to start with, so we consider Locus info to be "initialized"
1178
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1170
1179
  this.hashTreeParsers.get(locus.url).initializedFromHashTree = true;
1171
1180
  this.onFullLocusCommon(locus, eventType);
1172
1181
  } else {
@@ -1221,7 +1230,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1221
1230
  throw new Error("Locus-info:index#onFullLocus (".concat(debugText, ") --> hash tree metadata is missing with full Locus"));
1222
1231
  }
1223
1232
  // this is the new hashmap Locus DTO format (only applicable to webinars for now)
1224
- this.onFullLocusWithHashTrees(debugText, locus, metadata, eventType, dataSets);
1233
+ this.onFullLocusWithHashTrees(debugText, locus, metadata, dataSets, eventType);
1225
1234
  } else {
1226
1235
  this.onFullLocusClassic(debugText, locus, eventType);
1227
1236
  }
@@ -2495,6 +2504,21 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2495
2504
  value: function clearMainSessionLocusCache() {
2496
2505
  this.mainSessionLocusCache = null;
2497
2506
  }
2507
+
2508
+ /**
2509
+ * Cleans up all hash tree parsers and clears internal maps.
2510
+ * @returns {void}
2511
+ * @memberof LocusInfo
2512
+ */
2513
+ }, {
2514
+ key: "cleanUp",
2515
+ value: function cleanUp() {
2516
+ this.hashTreeParsers.forEach(function (entry) {
2517
+ entry.parser.cleanUp();
2518
+ });
2519
+ this.hashTreeParsers.clear();
2520
+ this.hashTreeObjectId2ParticipantId.clear();
2521
+ }
2498
2522
  }]);
2499
2523
  }(_eventsScope.default);
2500
2524
  //# sourceMappingURL=index.js.map