@webex/plugin-meetings 3.12.0-next.35 → 3.12.0-next.36

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.
@@ -178,7 +178,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
178
178
  method: _constants.HTTP_VERBS.PUT
179
179
  });
180
180
  },
181
- version: "3.12.0-next.35"
181
+ version: "3.12.0-next.36"
182
182
  });
183
183
  var _default = exports.default = AIEnableRequest;
184
184
  //# sourceMappingURL=index.js.map
@@ -213,7 +213,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
213
213
  sessionId: this.sessionId
214
214
  });
215
215
  },
216
- version: "3.12.0-next.35"
216
+ version: "3.12.0-next.36"
217
217
  });
218
218
  var _default = exports.default = Breakout;
219
219
  //# sourceMappingURL=breakout.js.map
@@ -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.12.0-next.35"
1112
+ version: "3.12.0-next.36"
1113
1113
  });
1114
1114
  var _default = exports.default = Breakouts;
1115
1115
  //# sourceMappingURL=index.js.map
@@ -372,7 +372,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
372
372
  throw error;
373
373
  });
374
374
  },
375
- version: "3.12.0-next.35"
375
+ version: "3.12.0-next.36"
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.12.0-next.35"
21
+ version: "3.12.0-next.36"
22
22
  });
23
23
  var _default = exports.default = SILanguage;
24
24
  //# sourceMappingURL=siLanguage.js.map
@@ -32,9 +32,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
32
32
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
33
33
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
34
34
  var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
35
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
35
36
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
36
37
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
37
- var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
38
38
  var _lodash = require("lodash");
39
39
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
40
40
  var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
@@ -560,18 +560,20 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
560
560
 
561
561
  /**
562
562
  * @param {Object} data - data to initialize locus info with. It may be from a join or GET /loci response or from a Mercury event that triggers a creation of meeting object
563
+ * @param {Function} [onLocusSynced] - optional callback that will be called at the end of initial setup, when locus info is fully synced. It will be called with the full locus snapshot as an argument (which may be null if we haven't received any full locus DTOs during the initial setup, for example in case we receive only hash tree messages without full locus DTOs)
563
564
  * @returns {undefined}
564
565
  * @memberof LocusInfo
565
566
  */
566
567
  }, {
567
568
  key: "initialSetup",
568
569
  value: (function () {
569
- var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data) {
570
+ var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data, onLocusSynced) {
570
571
  var _data$locus, _data$locus$links, _data$locus$links$res, _data$locus$links$res2;
571
- var _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
572
+ var initialFullLocus, _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
572
573
  return _regenerator.default.wrap(function (_context) {
573
574
  while (1) switch (_context.prev = _context.next) {
574
575
  case 0:
576
+ initialFullLocus = null;
575
577
  _t = data.trigger;
576
578
  _context.next = _t === 'locus-message' ? 1 : _t === 'join-response' ? 6 : _t === 'get-loci-response' ? 7 : 10;
577
579
  break;
@@ -623,6 +625,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
623
625
  case 6:
624
626
  this.updateLocusCache(data.locus);
625
627
  this.onFullLocus('join response', data.locus, undefined, data.dataSets, data.metadata);
628
+ initialFullLocus = data.locus;
626
629
  return _context.abrupt("continue", 10);
627
630
  case 7:
628
631
  if (!((_data$locus = data.locus) !== null && _data$locus !== void 0 && (_data$locus$links = _data$locus.links) !== null && _data$locus$links !== void 0 && (_data$locus$links$res = _data$locus$links.resources) !== null && _data$locus$links$res !== void 0 && (_data$locus$links$res2 = _data$locus$links$res.visibleDataSets) !== null && _data$locus$links$res2 !== void 0 && _data$locus$links$res2.url)) {
@@ -648,7 +651,16 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
648
651
  // "classic" Locus case, no hash trees involved
649
652
  this.updateLocusCache(data.locus);
650
653
  this.onFullLocus('classic get-loci-response', data.locus, undefined);
654
+ initialFullLocus = data.locus || null;
651
655
  case 10:
656
+ if (onLocusSynced) {
657
+ try {
658
+ onLocusSynced(initialFullLocus || this.getCurrentLocusSnapshot());
659
+ } catch (error) {
660
+ _loggerProxy.default.logger.warn("Locus-info:index#initialSetup --> onLocusSynced callback failed: ".concat(error));
661
+ }
662
+ }
663
+
652
664
  // Change it to true after it receives it first locus object
653
665
  this.emitChange = true;
654
666
  case 11:
@@ -657,18 +669,40 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
657
669
  }
658
670
  }, _callee, this);
659
671
  }));
660
- function initialSetup(_x) {
672
+ function initialSetup(_x, _x2) {
661
673
  return _initialSetup.apply(this, arguments);
662
674
  }
663
675
  return initialSetup;
664
676
  }()
677
+ /**
678
+ * Builds a full locus DTO snapshot from current internal locus state.
679
+ *
680
+ * @returns {LocusDTO}
681
+ */
682
+ )
683
+ }, {
684
+ key: "getCurrentLocusSnapshot",
685
+ value: function getCurrentLocusSnapshot() {
686
+ var _this4 = this;
687
+ var locus = {};
688
+ LocusDtoTopLevelKeys.forEach(function (key) {
689
+ var value = _this4[key];
690
+ if (value !== undefined && value !== null) {
691
+ locus[key] = (0, _lodash.cloneDeep)(value);
692
+ }
693
+ });
694
+ if (!(0, _isArray.default)(locus.participants)) {
695
+ locus.participants = [];
696
+ }
697
+ return locus;
698
+ }
699
+
665
700
  /**
666
701
  * Handles HTTP response from Locus API call.
667
702
  * @param {Meeting} meeting meeting object
668
703
  * @param {LocusApiResponseBody} responseBody body of the http response from Locus API call
669
704
  * @returns {void}
670
705
  */
671
- )
672
706
  }, {
673
707
  key: "handleLocusAPIResponse",
674
708
  value: function handleLocusAPIResponse(meeting, responseBody) {
@@ -719,7 +753,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
719
753
  }, {
720
754
  key: "updateLocusFromHashTreeObject",
721
755
  value: function updateLocusFromHashTreeObject(object, locus) {
722
- var _this4 = this,
756
+ var _this5 = this,
723
757
  _locus$self;
724
758
  var type = object.htMeta.elementId.type.toLowerCase();
725
759
  var addParticipantObject = function addParticipantObject(obj) {
@@ -727,7 +761,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
727
761
  locus.participants = [];
728
762
  }
729
763
  locus.participants.push(obj.data);
730
- _this4.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
764
+ _this5.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
731
765
  };
732
766
  switch (type) {
733
767
  case _types.ObjectType.locus:
@@ -1114,7 +1148,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1114
1148
  }, {
1115
1149
  key: "updateFromHashTree",
1116
1150
  value: function updateFromHashTree(locusUrl, update) {
1117
- var _this5 = this;
1151
+ var _this6 = this;
1118
1152
  switch (update.updateType) {
1119
1153
  case _hashTreeParser2.LocusInfoUpdateType.OBJECTS_UPDATED:
1120
1154
  {
@@ -1138,7 +1172,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1138
1172
  // but these should never happen
1139
1173
  _loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> received multiple LOCUS objects in one update, this is unexpected!");
1140
1174
  _metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_HASH_TREE_UNSUPPORTED_OPERATION, {
1141
- locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this5.url,
1175
+ locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this6.url,
1142
1176
  message: object.data ? 'multiple LOCUS object updates' : 'LOCUS object update followed by removal'
1143
1177
  });
1144
1178
  }
@@ -1172,7 +1206,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1172
1206
  // copy over all of existing locus except participants
1173
1207
  LocusDtoTopLevelKeys.forEach(function (key) {
1174
1208
  if (key !== 'participants') {
1175
- locus[key] = (0, _lodash.cloneDeep)(_this5[key]);
1209
+ locus[key] = (0, _lodash.cloneDeep)(_this6[key]);
1176
1210
  }
1177
1211
  });
1178
1212
  } else {
@@ -1180,7 +1214,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1180
1214
  // (except participants, which need to stay empty - that means "no participant changes")
1181
1215
  (0, _values.default)(_types.ObjectTypeToLocusKeyMap).forEach(function (locusDtoKey) {
1182
1216
  if (locusDtoKey !== 'participants') {
1183
- locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this5[locusDtoKey]);
1217
+ locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this6[locusDtoKey]);
1184
1218
  }
1185
1219
  });
1186
1220
  }
@@ -1193,7 +1227,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1193
1227
  }))));
1194
1228
  // now apply all the updates from the hash tree onto the locus
1195
1229
  update.updatedObjects.forEach(function (object) {
1196
- locus = _this5.updateLocusFromHashTreeObject(object, locus);
1230
+ locus = _this6.updateLocusFromHashTreeObject(object, locus);
1197
1231
  });
1198
1232
 
1199
1233
  // update our locus info with the new locus
@@ -1378,7 +1412,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1378
1412
  key: "onFullLocusCommon",
1379
1413
  value: function onFullLocusCommon(locus, eventType) {
1380
1414
  var _this$participants,
1381
- _this6 = this,
1415
+ _this7 = this,
1382
1416
  _locus$jsSdkMeta;
1383
1417
  this.scheduledMeeting = locus.meeting || null;
1384
1418
  this.participants = locus.participants;
@@ -1386,7 +1420,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1386
1420
  var _participant$htMeta;
1387
1421
  // participant.htMeta is set only for hash tree based locus
1388
1422
  if (typeof ((_participant$htMeta = participant.htMeta) === null || _participant$htMeta === void 0 ? void 0 : _participant$htMeta.elementId.id) === 'number') {
1389
- _this6.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
1423
+ _this7.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
1390
1424
  }
1391
1425
  });
1392
1426
  var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
@@ -2609,7 +2643,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2609
2643
  }, {
2610
2644
  key: "updateMainSessionLocusCache",
2611
2645
  value: function updateMainSessionLocusCache(mainLocus) {
2612
- var _this7 = this;
2646
+ var _this8 = this;
2613
2647
  if (!mainLocus) {
2614
2648
  return;
2615
2649
  }
@@ -2618,7 +2652,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2618
2652
  // shallow merge and do special merge for participants
2619
2653
  (0, _lodash.assignWith)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
2620
2654
  if (key === 'participants') {
2621
- return _this7.mergeParticipants(objValue, srcValue);
2655
+ return _this8.mergeParticipants(objValue, srcValue);
2622
2656
  }
2623
2657
  return srcValue || objValue;
2624
2658
  });